diff options
author | Suzanne Wood <suzannew@cs.pdx.edu> | 2005-11-09 00:39:27 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-09 10:56:37 -0500 |
commit | d6065f7bf8bec170c9c56524a250093ce73ca5d9 (patch) | |
tree | 336c7db10aa8cee48386171e3de7569fca01dcfd /drivers/md/multipath.c | |
parent | 9d88883e68f404d5581bd391713ceef470ea53a9 (diff) |
[PATCH] md: provide proper rcu_dereference / rcu_assign_pointer annotations in md
Acked-by: <paulmck@us.ibm.com>
Signed-off-by: Suzanne Wood <suzannew@cs.pdx.edu>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/md/multipath.c')
-rw-r--r-- | drivers/md/multipath.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/md/multipath.c b/drivers/md/multipath.c index c06f4474192b..ae2c5fd6105d 100644 --- a/drivers/md/multipath.c +++ b/drivers/md/multipath.c | |||
@@ -63,7 +63,7 @@ static int multipath_map (multipath_conf_t *conf) | |||
63 | 63 | ||
64 | rcu_read_lock(); | 64 | rcu_read_lock(); |
65 | for (i = 0; i < disks; i++) { | 65 | for (i = 0; i < disks; i++) { |
66 | mdk_rdev_t *rdev = conf->multipaths[i].rdev; | 66 | mdk_rdev_t *rdev = rcu_dereference(conf->multipaths[i].rdev); |
67 | if (rdev && rdev->in_sync) { | 67 | if (rdev && rdev->in_sync) { |
68 | atomic_inc(&rdev->nr_pending); | 68 | atomic_inc(&rdev->nr_pending); |
69 | rcu_read_unlock(); | 69 | rcu_read_unlock(); |
@@ -139,7 +139,7 @@ static void unplug_slaves(mddev_t *mddev) | |||
139 | 139 | ||
140 | rcu_read_lock(); | 140 | rcu_read_lock(); |
141 | for (i=0; i<mddev->raid_disks; i++) { | 141 | for (i=0; i<mddev->raid_disks; i++) { |
142 | mdk_rdev_t *rdev = conf->multipaths[i].rdev; | 142 | mdk_rdev_t *rdev = rcu_dereference(conf->multipaths[i].rdev); |
143 | if (rdev && !rdev->faulty && atomic_read(&rdev->nr_pending)) { | 143 | if (rdev && !rdev->faulty && atomic_read(&rdev->nr_pending)) { |
144 | request_queue_t *r_queue = bdev_get_queue(rdev->bdev); | 144 | request_queue_t *r_queue = bdev_get_queue(rdev->bdev); |
145 | 145 | ||
@@ -224,7 +224,7 @@ static int multipath_issue_flush(request_queue_t *q, struct gendisk *disk, | |||
224 | 224 | ||
225 | rcu_read_lock(); | 225 | rcu_read_lock(); |
226 | for (i=0; i<mddev->raid_disks && ret == 0; i++) { | 226 | for (i=0; i<mddev->raid_disks && ret == 0; i++) { |
227 | mdk_rdev_t *rdev = conf->multipaths[i].rdev; | 227 | mdk_rdev_t *rdev = rcu_dereference(conf->multipaths[i].rdev); |
228 | if (rdev && !rdev->faulty) { | 228 | if (rdev && !rdev->faulty) { |
229 | struct block_device *bdev = rdev->bdev; | 229 | struct block_device *bdev = rdev->bdev; |
230 | request_queue_t *r_queue = bdev_get_queue(bdev); | 230 | request_queue_t *r_queue = bdev_get_queue(bdev); |
@@ -331,7 +331,7 @@ static int multipath_add_disk(mddev_t *mddev, mdk_rdev_t *rdev) | |||
331 | conf->working_disks++; | 331 | conf->working_disks++; |
332 | rdev->raid_disk = path; | 332 | rdev->raid_disk = path; |
333 | rdev->in_sync = 1; | 333 | rdev->in_sync = 1; |
334 | p->rdev = rdev; | 334 | rcu_assign_pointer(p->rdev, rdev); |
335 | found = 1; | 335 | found = 1; |
336 | } | 336 | } |
337 | 337 | ||