diff options
Diffstat (limited to 'drivers/md/linear.c')
-rw-r--r-- | drivers/md/linear.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/md/linear.c b/drivers/md/linear.c index b99c19c7eb22..c625ddb8833d 100644 --- a/drivers/md/linear.c +++ b/drivers/md/linear.c | |||
@@ -111,6 +111,19 @@ static int linear_issue_flush(request_queue_t *q, struct gendisk *disk, | |||
111 | return ret; | 111 | return ret; |
112 | } | 112 | } |
113 | 113 | ||
114 | static int linear_congested(void *data, int bits) | ||
115 | { | ||
116 | mddev_t *mddev = data; | ||
117 | linear_conf_t *conf = mddev_to_conf(mddev); | ||
118 | int i, ret = 0; | ||
119 | |||
120 | for (i = 0; i < mddev->raid_disks && !ret ; i++) { | ||
121 | request_queue_t *q = bdev_get_queue(conf->disks[i].rdev->bdev); | ||
122 | ret |= bdi_congested(&q->backing_dev_info, bits); | ||
123 | } | ||
124 | return ret; | ||
125 | } | ||
126 | |||
114 | static linear_conf_t *linear_conf(mddev_t *mddev, int raid_disks) | 127 | static linear_conf_t *linear_conf(mddev_t *mddev, int raid_disks) |
115 | { | 128 | { |
116 | linear_conf_t *conf; | 129 | linear_conf_t *conf; |
@@ -269,6 +282,8 @@ static int linear_run (mddev_t *mddev) | |||
269 | blk_queue_merge_bvec(mddev->queue, linear_mergeable_bvec); | 282 | blk_queue_merge_bvec(mddev->queue, linear_mergeable_bvec); |
270 | mddev->queue->unplug_fn = linear_unplug; | 283 | mddev->queue->unplug_fn = linear_unplug; |
271 | mddev->queue->issue_flush_fn = linear_issue_flush; | 284 | mddev->queue->issue_flush_fn = linear_issue_flush; |
285 | mddev->queue->backing_dev_info.congested_fn = linear_congested; | ||
286 | mddev->queue->backing_dev_info.congested_data = mddev; | ||
272 | return 0; | 287 | return 0; |
273 | } | 288 | } |
274 | 289 | ||