lkml.org 
[lkml]   [2006]   [Aug]   [29]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateMon, 28 Aug 2006 22:59:08 -0700
FromAndrew Morton <>
SubjectRe: [PATCH 001 of 4] md: Define backing_dev_info.congested_fn for raid0 and linear
On Tue, 29 Aug 2006 15:39:24 +1000
NeilBrown <neilb@suse.de> wrote:

> > 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>> > +static int linear_congested(void *data, int bits)> +{> +	mddev_t *mddev = data;> +	linear_conf_t *conf = mddev_to_conf(mddev);> +	int i, ret = 0;> +> +	for (i = 0; i < mddev->raid_disks && !ret ; i++) {
> +		request_queue_t *q = bdev_get_queue(conf->disks[i].rdev->bdev);
> +		ret |= bdi_congested(&q->backing_dev_info, bits);

nit: `ret = ' would suffice here.

> +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);

And here.

> +	}> +	return ret;> +}> +> >  static int create_strip_zones (mddev_t *mddev)
>  {
> @@ -236,6 +251,8 @@ static int create_strip_zones (mddev_t *
>  	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;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-08-29 08:03    [from the cache]
©2003-2008