diff options
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, | |||
60 | return ret; | 60 | return ret; |
61 | } | 61 | } |
62 | 62 | ||
63 | static int raid0_congested(void *data, int bits) | ||
64 | { | ||
65 | mddev_t *mddev = data; | ||
66 | raid0_conf_t *conf = mddev_to_conf(mddev); | ||
67 | mdk_rdev_t **devlist = conf->strip_zone[0].dev; | ||
68 | int i, ret = 0; | ||
69 | |||
70 | for (i = 0; i < mddev->raid_disks && !ret ; i++) { | ||
71 | request_queue_t *q = bdev_get_queue(devlist[i]->bdev); | ||
72 | |||
73 | ret |= bdi_congested(&q->backing_dev_info, bits); | ||
74 | } | ||
75 | return ret; | ||
76 | } | ||
77 | |||
63 | 78 | ||
64 | static int create_strip_zones (mddev_t *mddev) | 79 | static int create_strip_zones (mddev_t *mddev) |
65 | { | 80 | { |
@@ -236,6 +251,8 @@ static int create_strip_zones (mddev_t *mddev) | |||
236 | mddev->queue->unplug_fn = raid0_unplug; | 251 | mddev->queue->unplug_fn = raid0_unplug; |
237 | 252 | ||
238 | mddev->queue->issue_flush_fn = raid0_issue_flush; | 253 | mddev->queue->issue_flush_fn = raid0_issue_flush; |
254 | mddev->queue->backing_dev_info.congested_fn = raid0_congested; | ||
255 | mddev->queue->backing_dev_info.congested_data = mddev; | ||
239 | 256 | ||
240 | printk("raid0: done.\n"); | 257 | printk("raid0: done.\n"); |
241 | return 0; | 258 | return 0; |