Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d7f3d291a0e1330f341fdf1128b2d12fff7932ee
Commit:     d7f3d291a0e1330f341fdf1128b2d12fff7932ee
Parent:     2b12ab6d33f413aabb623197eeecaad5c216e6ae
Author:     Iustin Pop <[EMAIL PROTECTED]>
AuthorDate: Tue Oct 16 23:30:54 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Wed Oct 17 08:43:03 2007 -0700

    md: expose the degraded status of an assembled array through sysfs
    
    The 'degraded' attribute is useful to quickly determine if the array is
    degraded, instead of parsing 'mdadm -D' output or relying on the other
    techniques (number of working devices against number of defined devices,
    etc.).  The md code already keeps track of this attribute, so it's useful to
    export it.
    
    Signed-off-by: Iustin Pop <[EMAIL PROTECTED]>
    Signed-off-by: Neil Brown <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 drivers/md/md.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/md/md.c b/drivers/md/md.c
index 510625e..c059ae6 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -2833,6 +2833,12 @@ sync_max_store(mddev_t *mddev, const char *buf, size_t 
len)
 static struct md_sysfs_entry md_sync_max =
 __ATTR(sync_speed_max, S_IRUGO|S_IWUSR, sync_max_show, sync_max_store);
 
+static ssize_t
+degraded_show(mddev_t *mddev, char *page)
+{
+       return sprintf(page, "%d\n", mddev->degraded);
+}
+static struct md_sysfs_entry md_degraded = __ATTR_RO(degraded);
 
 static ssize_t
 sync_speed_show(mddev_t *mddev, char *page)
@@ -2976,6 +2982,7 @@ static struct attribute *md_redundancy_attrs[] = {
        &md_suspend_lo.attr,
        &md_suspend_hi.attr,
        &md_bitmap.attr,
+       &md_degraded.attr,
        NULL,
 };
 static struct attribute_group md_redundancy_group = {
-
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