From: NeilBrown <nfbrown@novell.com>
To: Heinz Mauelshagen <heinzm@redhat.com>,
Alasdair G Kergon <agk@redhat.com>
Cc: linux-raid@vger.kernel.org, dm-devel@redhat.com
Subject: [PATCH 4/8] dm-raid456: add support for setting IO hints.
Date: Mon, 26 Jul 2010 13:24:35 +1000 [thread overview]
Message-ID: <20100726032435.29687.50704.stgit@localhost.localdomain> (raw)
In-Reply-To: <20100726032230.29687.5366.stgit@localhost.localdomain>
Signed-off-by: NeilBrown <neilb@suse.de>
---
drivers/md/dm-raid456.c | 33 +++++++++++++++++++++++++++++++++
1 files changed, 33 insertions(+), 0 deletions(-)
diff --git a/drivers/md/dm-raid456.c b/drivers/md/dm-raid456.c
index 47db9d4..4ffd654 100644
--- a/drivers/md/dm-raid456.c
+++ b/drivers/md/dm-raid456.c
@@ -435,6 +435,37 @@ static int raid_status(struct dm_target *ti, status_type_t type,
return 0;
}
+static int raid_iterate_devices(struct dm_target *ti,
+ iterate_devices_callout_fn fn,
+ void *data)
+{
+ struct raid_set *rs = ti->private;
+ int ret = 0;
+ unsigned i = 0;
+
+ for (i = 0; !ret && i < rs->md.raid_disks; i++)
+ if (rs->dev[i].dev)
+ ret = fn(ti,
+ rs->dev[i].dev,
+ rs->dev[i].rdev.data_offset,
+ rs->md.dev_sectors,
+ data);
+
+ return ret;
+}
+
+static void raid_io_hints(struct dm_target *ti,
+ struct queue_limits *limits)
+{
+ struct raid_set *rs = ti->private;
+ unsigned chunk_size = rs->md.chunk_sectors << 9;
+ raid5_conf_t *conf = rs->md.private;
+
+ blk_limits_io_min(limits, chunk_size);
+ blk_limits_io_opt(limits, chunk_size *
+ (conf->raid_disks - conf->max_degraded));
+}
+
static struct target_type raid_target = {
.name = "raid45",
.version = {1, 0, 0},
@@ -443,6 +474,8 @@ static struct target_type raid_target = {
.dtr = raid_dtr,
.map = raid_map,
.status = raid_status,
+ .iterate_devices = raid_iterate_devices,
+ .io_hints = raid_io_hints,
};
static int __init dm_raid_init(void)
next prev parent reply other threads:[~2010-07-26 3:24 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-26 3:24 [PATCH 0/8] The DM part of dm-raid45 NeilBrown
2010-07-26 3:24 ` [PATCH 7/8] dm-dirty-log: allow log size to be different from target size NeilBrown
2010-07-26 3:24 ` [PATCH 5/8] dm-raid456: add suspend/resume method NeilBrown
2010-07-26 3:24 ` NeilBrown [this message]
2010-07-26 3:24 ` [PATCH 3/8] dm-raid456: support unplug NeilBrown
2010-07-26 3:24 ` [PATCH 2/8] dm-raid456: add congestion checking NeilBrown
2010-07-26 3:24 ` [PATCH 6/8] dm-raid456: add message handler NeilBrown
2010-07-26 3:24 ` [PATCH 1/8] md/dm: create dm-raid456 module using md/raid5 NeilBrown
2010-07-26 3:24 ` [PATCH 8/8] dm-raid456: switch to use dm_dirty_log for tracking dirty regions NeilBrown
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=20100726032435.29687.50704.stgit@localhost.localdomain \
--to=nfbrown@novell.com \
--cc=agk@redhat.com \
--cc=dm-devel@redhat.com \
--cc=heinzm@redhat.com \
--cc=linux-raid@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).