* Subject: [PATCH 002/009]: have raid0 report its formation
@ 2009-05-19 16:06 raz ben yehuda
2009-05-20 1:27 ` Neil Brown
0 siblings, 1 reply; 5+ messages in thread
From: raz ben yehuda @ 2009-05-19 16:06 UTC (permalink / raw)
To: linux raid, neilb; +Cc: ofer, yaron
Report to the user what are the raid zones
raid0.c | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
Signed-off-by: raziebe@gmail.com
---
diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c
index 8049a92..0a6d0fa 100644
--- a/drivers/md/raid0.c
+++ b/drivers/md/raid0.c
@@ -52,6 +52,38 @@ static int raid0_congested(void *data, int bits)
return ret;
}
+/*
+ * inform the user of the raid configuration
+*/
+static void dump_zones(mddev_t *mddev)
+{
+ int j, k, h;
+ sector_t zone_size = 0;
+ sector_t zone_start = 0;
+ char b[BDEVNAME_SIZE];
+ raid0_conf_t *conf = mddev->private;
+ printk(KERN_INFO "******* %s configuration *********",
+ mdname(mddev));
+ h = 0;
+ for (j = 0; j < conf->nr_strip_zones; j++) {
+ printk("\nzone%d", j);
+ printk("=[");
+ for (k = 0; k < conf->strip_zone[j].nb_dev; k++)
+ printk("%s/",
+ bdevname(conf->devlist[j*mddev->raid_disks
+ + k]->bdev, b));
+
+ zone_size = conf->strip_zone[j].zone_end - zone_start;
+ printk("]\n\t zone offset=%llukb "
+ "device offset=%llukb size=%llukb\n",
+ (unsigned long long)zone_start>>1,
+ (unsigned long long)conf->strip_zone[j].dev_start>>1,
+ (unsigned long long)zone_size>>1);
+ zone_start = conf->strip_zone[j].zone_end;
+ }
+ printk(KERN_INFO "**********************************\n\n");
+}
+
static int create_strip_zones(mddev_t *mddev)
{
int i, c, j, err;
@@ -291,6 +323,7 @@ static int raid0_run(mddev_t *mddev)
}
blk_queue_merge_bvec(mddev->queue, raid0_mergeable_bvec);
+ dump_zones(mddev);
return 0;
}
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Subject: [PATCH 002/009]: have raid0 report its formation
@ 2009-05-19 16:07 raz ben yehuda
0 siblings, 0 replies; 5+ messages in thread
From: raz ben yehuda @ 2009-05-19 16:07 UTC (permalink / raw)
To: linux raid, Neil Brown; +Cc: ofer, yaron
Report to the user what are the raid zones
raid0.c | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
Signed-off-by: raziebe@gmail.com
---
diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c
index 8049a92..0a6d0fa 100644
--- a/drivers/md/raid0.c
+++ b/drivers/md/raid0.c
@@ -52,6 +52,38 @@ static int raid0_congested(void *data, int bits)
return ret;
}
+/*
+ * inform the user of the raid configuration
+*/
+static void dump_zones(mddev_t *mddev)
+{
+ int j, k, h;
+ sector_t zone_size = 0;
+ sector_t zone_start = 0;
+ char b[BDEVNAME_SIZE];
+ raid0_conf_t *conf = mddev->private;
+ printk(KERN_INFO "******* %s configuration *********",
+ mdname(mddev));
+ h = 0;
+ for (j = 0; j < conf->nr_strip_zones; j++) {
+ printk("\nzone%d", j);
+ printk("=[");
+ for (k = 0; k < conf->strip_zone[j].nb_dev; k++)
+ printk("%s/",
+ bdevname(conf->devlist[j*mddev->raid_disks
+ + k]->bdev, b));
+
+ zone_size = conf->strip_zone[j].zone_end - zone_start;
+ printk("]\n\t zone offset=%llukb "
+ "device offset=%llukb size=%llukb\n",
+ (unsigned long long)zone_start>>1,
+ (unsigned long long)conf->strip_zone[j].dev_start>>1,
+ (unsigned long long)zone_size>>1);
+ zone_start = conf->strip_zone[j].zone_end;
+ }
+ printk(KERN_INFO "**********************************\n\n");
+}
+
static int create_strip_zones(mddev_t *mddev)
{
int i, c, j, err;
@@ -291,6 +323,7 @@ static int raid0_run(mddev_t *mddev)
}
blk_queue_merge_bvec(mddev->queue, raid0_mergeable_bvec);
+ dump_zones(mddev);
return 0;
}
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Subject: [PATCH 002/009]: have raid0 report its formation
@ 2009-05-19 16:09 raz ben yehuda
0 siblings, 0 replies; 5+ messages in thread
From: raz ben yehuda @ 2009-05-19 16:09 UTC (permalink / raw)
To: linux raid, neilb; +Cc: ofer, yaron
Report to the user what are the raid zones
raid0.c | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
Signed-off-by: raziebe@gmail.com
---
diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c
index 8049a92..0a6d0fa 100644
--- a/drivers/md/raid0.c
+++ b/drivers/md/raid0.c
@@ -52,6 +52,38 @@ static int raid0_congested(void *data, int bits)
return ret;
}
+/*
+ * inform the user of the raid configuration
+*/
+static void dump_zones(mddev_t *mddev)
+{
+ int j, k, h;
+ sector_t zone_size = 0;
+ sector_t zone_start = 0;
+ char b[BDEVNAME_SIZE];
+ raid0_conf_t *conf = mddev->private;
+ printk(KERN_INFO "******* %s configuration *********",
+ mdname(mddev));
+ h = 0;
+ for (j = 0; j < conf->nr_strip_zones; j++) {
+ printk("\nzone%d", j);
+ printk("=[");
+ for (k = 0; k < conf->strip_zone[j].nb_dev; k++)
+ printk("%s/",
+ bdevname(conf->devlist[j*mddev->raid_disks
+ + k]->bdev, b));
+
+ zone_size = conf->strip_zone[j].zone_end - zone_start;
+ printk("]\n\t zone offset=%llukb "
+ "device offset=%llukb size=%llukb\n",
+ (unsigned long long)zone_start>>1,
+ (unsigned long long)conf->strip_zone[j].dev_start>>1,
+ (unsigned long long)zone_size>>1);
+ zone_start = conf->strip_zone[j].zone_end;
+ }
+ printk(KERN_INFO "**********************************\n\n");
+}
+
static int create_strip_zones(mddev_t *mddev)
{
int i, c, j, err;
@@ -291,6 +323,7 @@ static int raid0_run(mddev_t *mddev)
}
blk_queue_merge_bvec(mddev->queue, raid0_mergeable_bvec);
+ dump_zones(mddev);
return 0;
}
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: Subject: [PATCH 002/009]: have raid0 report its formation
2009-05-19 16:06 Subject: [PATCH 002/009]: have raid0 report its formation raz ben yehuda
@ 2009-05-20 1:27 ` Neil Brown
2009-05-20 13:50 ` raz ben yehuda
0 siblings, 1 reply; 5+ messages in thread
From: Neil Brown @ 2009-05-20 1:27 UTC (permalink / raw)
To: raz ben yehuda; +Cc: linux raid, ofer, yaron
On Tuesday May 19, raziebe@gmail.com wrote:
> Report to the user what are the raid zones
You didn't reply to my question of:
- why did you want this?
- can it be combined with other information printed by
make_strip_zones?
- if not, can it be combined with the MD_DEBUG part of
raid0_status??
I've applied it for now, but I need answers before I can promise to
keep it.
NeilBrown
>
> raid0.c | 33 +++++++++++++++++++++++++++++++++
> 1 file changed, 33 insertions(+)
>
> Signed-off-by: raziebe@gmail.com
> ---
> diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c
> index 8049a92..0a6d0fa 100644
> --- a/drivers/md/raid0.c
> +++ b/drivers/md/raid0.c
> @@ -52,6 +52,38 @@ static int raid0_congested(void *data, int bits)
> return ret;
> }
>
> +/*
> + * inform the user of the raid configuration
> +*/
> +static void dump_zones(mddev_t *mddev)
> +{
> + int j, k, h;
> + sector_t zone_size = 0;
> + sector_t zone_start = 0;
> + char b[BDEVNAME_SIZE];
> + raid0_conf_t *conf = mddev->private;
> + printk(KERN_INFO "******* %s configuration *********",
> + mdname(mddev));
> + h = 0;
> + for (j = 0; j < conf->nr_strip_zones; j++) {
> + printk("\nzone%d", j);
> + printk("=[");
> + for (k = 0; k < conf->strip_zone[j].nb_dev; k++)
> + printk("%s/",
> + bdevname(conf->devlist[j*mddev->raid_disks
> + + k]->bdev, b));
> +
> + zone_size = conf->strip_zone[j].zone_end - zone_start;
> + printk("]\n\t zone offset=%llukb "
> + "device offset=%llukb size=%llukb\n",
> + (unsigned long long)zone_start>>1,
> + (unsigned long long)conf->strip_zone[j].dev_start>>1,
> + (unsigned long long)zone_size>>1);
> + zone_start = conf->strip_zone[j].zone_end;
> + }
> + printk(KERN_INFO "**********************************\n\n");
> +}
> +
> static int create_strip_zones(mddev_t *mddev)
> {
> int i, c, j, err;
> @@ -291,6 +323,7 @@ static int raid0_run(mddev_t *mddev)
> }
>
> blk_queue_merge_bvec(mddev->queue, raid0_mergeable_bvec);
> + dump_zones(mddev);
> return 0;
> }
>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Subject: [PATCH 002/009]: have raid0 report its formation
2009-05-20 1:27 ` Neil Brown
@ 2009-05-20 13:50 ` raz ben yehuda
0 siblings, 0 replies; 5+ messages in thread
From: raz ben yehuda @ 2009-05-20 13:50 UTC (permalink / raw)
To: Neil Brown; +Cc: linux raid, ofer, yaron
On Wed, 2009-05-20 at 11:27 +1000, Neil Brown wrote:
> On Tuesday May 19, raziebe@gmail.com wrote:
> > Report to the user what are the raid zones
>
> You didn't reply to my question of:
> - why did you want this?
> - can it be combined with other information printed by
> make_strip_zones?
> - if not, can it be combined with the MD_DEBUG part of
> raid0_status??
>
> I've applied it for now, but I need answers before I can promise to
> keep it.
I will use raid0_status. Please drop it and I will post a new patch in
the reshape patch set ( in a different patch obviously ). I think
create_strip_zones printouts are NOT clear to the naive user while
raid0_status output is;
Also, I would like to note that i have tested these patches several
times.The MD_DEBUG failure was due to bad git commit id i accidentally
used.sorry about that.
> NeilBrown
>
>
> >
> > raid0.c | 33 +++++++++++++++++++++++++++++++++
> > 1 file changed, 33 insertions(+)
> >
> > Signed-off-by: raziebe@gmail.com
> > ---
> > diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c
> > index 8049a92..0a6d0fa 100644
> > --- a/drivers/md/raid0.c
> > +++ b/drivers/md/raid0.c
> > @@ -52,6 +52,38 @@ static int raid0_congested(void *data, int bits)
> > return ret;
> > }
> >
> > +/*
> > + * inform the user of the raid configuration
> > +*/
> > +static void dump_zones(mddev_t *mddev)
> > +{
> > + int j, k, h;
> > + sector_t zone_size = 0;
> > + sector_t zone_start = 0;
> > + char b[BDEVNAME_SIZE];
> > + raid0_conf_t *conf = mddev->private;
> > + printk(KERN_INFO "******* %s configuration *********",
> > + mdname(mddev));
> > + h = 0;
> > + for (j = 0; j < conf->nr_strip_zones; j++) {
> > + printk("\nzone%d", j);
> > + printk("=[");
> > + for (k = 0; k < conf->strip_zone[j].nb_dev; k++)
> > + printk("%s/",
> > + bdevname(conf->devlist[j*mddev->raid_disks
> > + + k]->bdev, b));
> > +
> > + zone_size = conf->strip_zone[j].zone_end - zone_start;
> > + printk("]\n\t zone offset=%llukb "
> > + "device offset=%llukb size=%llukb\n",
> > + (unsigned long long)zone_start>>1,
> > + (unsigned long long)conf->strip_zone[j].dev_start>>1,
> > + (unsigned long long)zone_size>>1);
> > + zone_start = conf->strip_zone[j].zone_end;
> > + }
> > + printk(KERN_INFO "**********************************\n\n");
> > +}
> > +
> > static int create_strip_zones(mddev_t *mddev)
> > {
> > int i, c, j, err;
> > @@ -291,6 +323,7 @@ static int raid0_run(mddev_t *mddev)
> > }
> >
> > blk_queue_merge_bvec(mddev->queue, raid0_mergeable_bvec);
> > + dump_zones(mddev);
> > return 0;
> > }
> >
> >
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-05-20 13:50 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-19 16:06 Subject: [PATCH 002/009]: have raid0 report its formation raz ben yehuda
2009-05-20 1:27 ` Neil Brown
2009-05-20 13:50 ` raz ben yehuda
-- strict thread matches above, loose matches on Subject: below --
2009-05-19 16:07 raz ben yehuda
2009-05-19 16:09 raz ben yehuda
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).