diff options
author | Mike Galbraith <efault@gmx.de> | 2017-08-23 11:57:29 +0200 |
---|---|---|
committer | Steven Rostedt (VMware) <rostedt@goodmis.org> | 2017-11-20 22:00:07 -0500 |
commit | 48671bb6024506bc0c4c46bbbc3332563081f237 (patch) | |
tree | 8080628448f71b3afe2df77caab2b819602cfd1f /drivers/block | |
parent | d0bcb84cbec27d7eb876b6f1d1fffdb65ccefcd4 (diff) |
drivers/zram: fix zcomp_stream_get() smp_processor_id() use in preemptible code
Use get_local_ptr() instead this_cpu_ptr() to avoid a warning regarding
smp_processor_id() in preemptible code.
raw_cpu_ptr() would be fine, too because the per-CPU data structure is
protected with a spin lock so it does not matter much if we take the
other one.
Cc: stable-rt@vger.kernel.org
Signed-off-by: Mike Galbraith <efault@gmx.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/zram/zcomp.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/block/zram/zcomp.c b/drivers/block/zram/zcomp.c index fa8329ad79fd..8c93ee150ee8 100644 --- a/drivers/block/zram/zcomp.c +++ b/drivers/block/zram/zcomp.c @@ -120,7 +120,7 @@ struct zcomp_strm *zcomp_stream_get(struct zcomp *comp) { struct zcomp_strm *zstrm; - zstrm = *this_cpu_ptr(comp->stream); + zstrm = *get_local_ptr(comp->stream); spin_lock(&zstrm->zcomp_lock); return zstrm; } @@ -131,6 +131,7 @@ void zcomp_stream_put(struct zcomp *comp) zstrm = *this_cpu_ptr(comp->stream); spin_unlock(&zstrm->zcomp_lock); + put_local_ptr(zstrm); } int zcomp_compress(struct zcomp_strm *zstrm, |