linux-bcache.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: majianpeng <majianpeng@gmail.com>
To: kmo <kmo@daterainc.com>
Cc: linux-bcache <linux-bcache@vger.kernel.org>
Subject: [PATCH 1/3] bcache: For back device, stripe_size get the small value  between "1 << 31" and the io_opt of request_queue of back device.
Date: Wed, 8 Jan 2014 19:39:21 +0800	[thread overview]
Message-ID: <201401081939186527303@gmail.com> (raw)

Let's the stripe_size of back device is io_opt of request_queue make
good sense.

Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
---
 drivers/md/bcache/super.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index c57bfa0..21f77c1 100644
--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -759,11 +759,15 @@ static int bcache_device_init(struct bcache_device *d, unsigned block_size,
 			      sector_t sectors)
 {
 	struct request_queue *q;
+	struct cached_dev *dc;
 	size_t n;
 	int minor;
 
+	dc = container_of(d, struct cached_dev, disk);
+	q = bdev_get_queue(dc->bdev);
+
 	if (!d->stripe_size)
-		d->stripe_size = 1 << 31;
+		d->stripe_size = min_t(unsigned, 1 << 31, q->limits.io_opt);
 
 	d->nr_stripes = DIV_ROUND_UP_ULL(sectors, d->stripe_size);
 
-- 
1.7.10.4

             reply	other threads:[~2014-01-08 11:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-08 11:39 majianpeng [this message]
2014-01-08 21:33 ` [PATCH 1/3] bcache: For back device, stripe_size get the small value between "1 << 31" and the io_opt of request_queue of back device Kent Overstreet

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=201401081939186527303@gmail.com \
    --to=majianpeng@gmail.com \
    --cc=kmo@daterainc.com \
    --cc=linux-bcache@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).