]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
block: Substitute rcu_access_pointer() for rcu_dereference_raw()
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Mon, 17 Feb 2014 21:35:57 +0000 (13:35 -0800)
committerJens Axboe <axboe@fb.com>
Tue, 18 Feb 2014 20:21:26 +0000 (12:21 -0800)
(Trivial patch.)

If the code is looking at the RCU-protected pointer itself, but not
dereferencing it, the rcu_dereference() functions can be downgraded to
rcu_access_pointer().  This commit makes this downgrade in blkg_destroy()
and ioc_destroy_icq(), both of which simply compare the RCU-protected
pointer against another pointer with no dereferencing.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Jens Axboe <axboe@fb.com>
block/blk-cgroup.c
block/blk-ioc.c

index 4e491d9b529255476939b8608d91718c40140059..b6e95b5e262f985b6a2304eddb1cc7c1b85faa14 100644 (file)
@@ -336,7 +336,7 @@ static void blkg_destroy(struct blkcg_gq *blkg)
         * under queue_lock.  If it's not pointing to @blkg now, it never
         * will.  Hint assignment itself can race safely.
         */
-       if (rcu_dereference_raw(blkcg->blkg_hint) == blkg)
+       if (rcu_access_pointer(blkcg->blkg_hint) == blkg)
                rcu_assign_pointer(blkcg->blkg_hint, NULL);
 
        /*
index 242df01413f6ee902b50b028b228b31330e0c1f2..1a27f45ec776a4e0a951a89de3185dc2ead26a42 100644 (file)
@@ -68,7 +68,7 @@ static void ioc_destroy_icq(struct io_cq *icq)
         * under queue_lock.  If it's not pointing to @icq now, it never
         * will.  Hint assignment itself can race safely.
         */
-       if (rcu_dereference_raw(ioc->icq_hint) == icq)
+       if (rcu_access_pointer(ioc->icq_hint) == icq)
                rcu_assign_pointer(ioc->icq_hint, NULL);
 
        ioc_exit_icq(icq);