Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4f7f5c675fd6bacaae3c67be44de872dcff0e3b7
Commit:     4f7f5c675fd6bacaae3c67be44de872dcff0e3b7
Parent:     a25eb9446ad50027bc2082386e5358bedad087ed
Author:     Brian Wood <[EMAIL PROTECTED]>
AuthorDate: Fri Feb 8 02:11:24 2008 +0000
Committer:  Alasdair G Kergon <[EMAIL PROTECTED]>
CommitDate: Fri Feb 8 02:11:24 2008 +0000

    dm: stripe enhanced status return
    
    This patch adds additional information to the status line. It is added at 
the
    end of the returned text so it will not interfere with existing
    implementations using this data. The addition of this information will allow
    for a common return interface to match that returned with the dm-raid1.c
    status line (with Jonathan Brassow's patches).
    
    Here is a sample of what is returned with a mirror "status" call:
    isw_eeaaabgfg_mirror: 0 488390920 mirror 2 8:16 8:32 3727/3727 1 AA 1 core
    
    Here's what's returned with this patch for a stripe "status" call:
    isw_dheeijjdej_stripe: 0 976783872 striped 2 8:16 8:32 1 AA
    
    Signed-off-by: Brian Wood <[EMAIL PROTECTED]>
    Signed-off-by: Alasdair G Kergon <[EMAIL PROTECTED]>
---
 drivers/md/dm-stripe.c |   23 ++++++++++++++++++++++-
 1 files changed, 22 insertions(+), 1 deletions(-)

diff --git a/drivers/md/dm-stripe.c b/drivers/md/dm-stripe.c
index 7c5e2a0..4de90ab 100644
--- a/drivers/md/dm-stripe.c
+++ b/drivers/md/dm-stripe.c
@@ -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:
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to