diff options
author | NeilBrown <neilb@suse.de> | 2006-10-03 01:15:53 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-03 08:04:18 -0700 |
commit | 26be34dc3a46be983352dd89683db374b0cb73fa (patch) | |
tree | 296ed9d019ac56d4a6ea0909f1cf11bdfd08a3e5 /drivers/md/raid0.c | |
parent | c04be0aa82ff535e3676ab3e573957bdeef41879 (diff) | |
download | blackbird-op-linux-26be34dc3a46be983352dd89683db374b0cb73fa.tar.gz blackbird-op-linux-26be34dc3a46be983352dd89683db374b0cb73fa.zip |
[PATCH] md: define backing_dev_info.congested_fn for raid0 and linear
Each backing_dev needs to be able to report whether it is congested, either by
modulating BDI_*_congested in ->state, or by defining a ->congested_fn.
md/raid did neither of these. This patch add a congested_fn which simply
checks all component devices to see if they are congested.
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/md/raid0.c')
-rw-r--r-- | drivers/md/raid0.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c index cb8c6317e4e5..dfe32149ad3a 100644 --- a/drivers/md/raid0.c +++ b/drivers/md/raid0.c @@ -60,6 +60,21 @@ static int raid0_issue_flush(request_queue_t *q, struct gendisk *disk, return ret; } +static int raid0_congested(void *data, int bits) +{ + mddev_t *mddev = data; + raid0_conf_t *conf = mddev_to_conf(mddev); + mdk_rdev_t **devlist = conf->strip_zone[0].dev; + int i, ret = 0; + + for (i = 0; i < mddev->raid_disks && !ret ; i++) { + request_queue_t *q = bdev_get_queue(devlist[i]->bdev); + + ret |= bdi_congested(&q->backing_dev_info, bits); + } + return ret; +} + static int create_strip_zones (mddev_t *mddev) { @@ -236,6 +251,8 @@ static int create_strip_zones (mddev_t *mddev) mddev->queue->unplug_fn = raid0_unplug; mddev->queue->issue_flush_fn = raid0_issue_flush; + mddev->queue->backing_dev_info.congested_fn = raid0_congested; + mddev->queue->backing_dev_info.congested_data = mddev; printk("raid0: done.\n"); return 0; |