aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJesper Juhl <jesper.juhl@gmail.com>2006-01-09 23:54:44 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-10 11:02:01 -0500
commit352d768b19408d3c019a3fa09fd5bfed99a55bc6 (patch)
tree1e3aee2364e1a9a610b05cab8c468f4647c1df31 /drivers
parent3795e1616f16905889761536cdc266ebc51855e5 (diff)
[PATCH] Decrease number of pointer derefs in multipath.c
Decrease the number of pointer derefs in drivers/md/multipath.c Benefits of the patch: - Fewer pointer dereferences should make the code slightly faster. - Size of generated code is smaller - improved readability Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com> Acked-by: Ingo Molnar <mingo@elte.hu> Cc: Alasdair G Kergon <agk@redhat.com> Acked-by: NeilBrown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/md/multipath.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/md/multipath.c b/drivers/md/multipath.c
index e6aa309a66d7..96f7af4ae400 100644
--- a/drivers/md/multipath.c
+++ b/drivers/md/multipath.c
@@ -303,6 +303,7 @@ static void print_multipath_conf (multipath_conf_t *conf)
303static int multipath_add_disk(mddev_t *mddev, mdk_rdev_t *rdev) 303static int multipath_add_disk(mddev_t *mddev, mdk_rdev_t *rdev)
304{ 304{
305 multipath_conf_t *conf = mddev->private; 305 multipath_conf_t *conf = mddev->private;
306 struct request_queue *q;
306 int found = 0; 307 int found = 0;
307 int path; 308 int path;
308 struct multipath_info *p; 309 struct multipath_info *p;
@@ -311,8 +312,8 @@ static int multipath_add_disk(mddev_t *mddev, mdk_rdev_t *rdev)
311 312
312 for (path=0; path<mddev->raid_disks; path++) 313 for (path=0; path<mddev->raid_disks; path++)
313 if ((p=conf->multipaths+path)->rdev == NULL) { 314 if ((p=conf->multipaths+path)->rdev == NULL) {
314 blk_queue_stack_limits(mddev->queue, 315 q = rdev->bdev->bd_disk->queue;
315 rdev->bdev->bd_disk->queue); 316 blk_queue_stack_limits(mddev->queue, q);
316 317
317 /* as we don't honour merge_bvec_fn, we must never risk 318 /* as we don't honour merge_bvec_fn, we must never risk
318 * violating it, so limit ->max_sector to one PAGE, as 319 * violating it, so limit ->max_sector to one PAGE, as
@@ -320,7 +321,7 @@ static int multipath_add_disk(mddev_t *mddev, mdk_rdev_t *rdev)
320 * (Note: it is very unlikely that a device with 321 * (Note: it is very unlikely that a device with
321 * merge_bvec_fn will be involved in multipath.) 322 * merge_bvec_fn will be involved in multipath.)
322 */ 323 */
323 if (rdev->bdev->bd_disk->queue->merge_bvec_fn && 324 if (q->merge_bvec_fn &&
324 mddev->queue->max_sectors > (PAGE_SIZE>>9)) 325 mddev->queue->max_sectors > (PAGE_SIZE>>9))
325 blk_queue_max_sectors(mddev->queue, PAGE_SIZE>>9); 326 blk_queue_max_sectors(mddev->queue, PAGE_SIZE>>9);
326 327