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