Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 84592
b: refs/heads/master
c: 4f7f5c6
h: refs/heads/master
v: v3
  • Loading branch information
Brian Wood authored and Alasdair G Kergon committed Feb 8, 2008
1 parent d12cd1c commit def0338
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a25eb9446ad50027bc2082386e5358bedad087ed
refs/heads/master: 4f7f5c675fd6bacaae3c67be44de872dcff0e3b7
23 changes: 22 additions & 1 deletion trunk/drivers/md/dm-stripe.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,16 +222,37 @@ static int stripe_map(struct dm_target *ti, struct bio *bio,
return DM_MAPIO_REMAPPED;
}

/*
* Stripe status:
*
* INFO
* #stripes [stripe_name <stripe_name>] [group word count]
* [error count 'A|D' <error count 'A|D'>]
*
* TABLE
* #stripes [stripe chunk size]
* [stripe_name physical_start <stripe_name physical_start>]
*
*/

static int stripe_status(struct dm_target *ti,
status_type_t type, char *result, unsigned int maxlen)
{
struct stripe_c *sc = (struct stripe_c *) ti->private;
char buffer[sc->stripes + 1];
unsigned int sz = 0;
unsigned int i;

switch (type) {
case STATUSTYPE_INFO:
result[0] = '\0';
DMEMIT("%d ", sc->stripes);
for (i = 0; i < sc->stripes; i++) {
DMEMIT("%s ", sc->stripe[i].dev->name);
buffer[i] = atomic_read(&(sc->stripe[i].error_count)) ?
'D' : 'A';
}
buffer[i] = '\0';
DMEMIT("1 %s", buffer);
break;

case STATUSTYPE_TABLE:
Expand Down

0 comments on commit def0338

Please sign in to comment.