[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>

authored by

Jesper Juhl and committed by
Linus Torvalds
352d768b 3795e161

+4 -3
+4 -3
drivers/md/multipath.c
··· 303 static int multipath_add_disk(mddev_t *mddev, mdk_rdev_t *rdev) 304 { 305 multipath_conf_t *conf = mddev->private; 306 int found = 0; 307 int path; 308 struct multipath_info *p; ··· 312 313 for (path=0; path<mddev->raid_disks; path++) 314 if ((p=conf->multipaths+path)->rdev == NULL) { 315 - blk_queue_stack_limits(mddev->queue, 316 - rdev->bdev->bd_disk->queue); 317 318 /* as we don't honour merge_bvec_fn, we must never risk 319 * violating it, so limit ->max_sector to one PAGE, as ··· 321 * (Note: it is very unlikely that a device with 322 * merge_bvec_fn will be involved in multipath.) 323 */ 324 - if (rdev->bdev->bd_disk->queue->merge_bvec_fn && 325 mddev->queue->max_sectors > (PAGE_SIZE>>9)) 326 blk_queue_max_sectors(mddev->queue, PAGE_SIZE>>9); 327
··· 303 static int multipath_add_disk(mddev_t *mddev, mdk_rdev_t *rdev) 304 { 305 multipath_conf_t *conf = mddev->private; 306 + struct request_queue *q; 307 int found = 0; 308 int path; 309 struct multipath_info *p; ··· 311 312 for (path=0; path<mddev->raid_disks; path++) 313 if ((p=conf->multipaths+path)->rdev == NULL) { 314 + q = rdev->bdev->bd_disk->queue; 315 + blk_queue_stack_limits(mddev->queue, q); 316 317 /* as we don't honour merge_bvec_fn, we must never risk 318 * violating it, so limit ->max_sector to one PAGE, as ··· 320 * (Note: it is very unlikely that a device with 321 * merge_bvec_fn will be involved in multipath.) 322 */ 323 + if (q->merge_bvec_fn && 324 mddev->queue->max_sectors > (PAGE_SIZE>>9)) 325 blk_queue_max_sectors(mddev->queue, PAGE_SIZE>>9); 326