mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jesper Juhl <jesper.juhl@gmail.com>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: Ingo Molnar <mingo@elte.hu>,
	Miguel de Icaza <miguel@nuclecu.unam.mx>,
	Gadi Oxman <gadio@netvision.net.il>,
	Andrew Morton <akpm@osdl.org>,
	Jesper Juhl <jesper.juhl@gmail.com>
Subject: [PATCH] Decrease number of pointer derefs in multipath.c
Date: Thu, 8 Dec 2005 23:36:29 +0100	[thread overview]
Message-ID: <200512082336.30194.jesper.juhl@gmail.com> (raw)

Hi,

Here's a small patch to 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

Please consider applying.


Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
---

 drivers/md/multipath.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

orig:
   text    data     bss     dec     hex filename
   3747      68       0    3815     ee7 drivers/md/multipath.o

patched:
   text    data     bss     dec     hex filename
   3736      68       0    3804     edc drivers/md/multipath.o

--- linux-2.6.15-rc5-git1-orig/drivers/md/multipath.c	2005-12-04 18:47:49.000000000 +0100
+++ linux-2.6.15-rc5-git1/drivers/md/multipath.c	2005-12-08 21:30:57.000000000 +0100
@@ -308,6 +308,7 @@ static void print_multipath_conf (multip
 static int multipath_add_disk(mddev_t *mddev, mdk_rdev_t *rdev)
 {
 	multipath_conf_t *conf = mddev->private;
+	struct request_queue *q;
 	int found = 0;
 	int path;
 	struct multipath_info *p;
@@ -316,8 +317,8 @@ static int multipath_add_disk(mddev_t *m
 
 	for (path=0; path<mddev->raid_disks; path++) 
 		if ((p=conf->multipaths+path)->rdev == NULL) {
-			blk_queue_stack_limits(mddev->queue,
-					       rdev->bdev->bd_disk->queue);
+			q = rdev->bdev->bd_disk->queue;
+			blk_queue_stack_limits(mddev->queue, q);
 
 		/* as we don't honour merge_bvec_fn, we must never risk
 		 * violating it, so limit ->max_sector to one PAGE, as
@@ -325,7 +326,7 @@ static int multipath_add_disk(mddev_t *m
 		 * (Note: it is very unlikely that a device with
 		 * merge_bvec_fn will be involved in multipath.)
 		 */
-			if (rdev->bdev->bd_disk->queue->merge_bvec_fn &&
+			if (q->merge_bvec_fn &&
 			    mddev->queue->max_sectors > (PAGE_SIZE>>9))
 				blk_queue_max_sectors(mddev->queue, PAGE_SIZE>>9);
 



             reply	other threads:[~2005-12-08 22:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-08 22:36 Jesper Juhl [this message]
2005-12-09 11:01 ` Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200512082336.30194.jesper.juhl@gmail.com \
    --to=jesper.juhl@gmail.com \
    --cc=akpm@osdl.org \
    --cc=gadio@netvision.net.il \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miguel@nuclecu.unam.mx \
    --cc=mingo@elte.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome