From bb636547b02411ca5eef87b1d030ea3fc090a717 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Tue, 8 Nov 2005 21:39:45 -0800 Subject: [PATCH] md: document sysfs usage of md, and make a couple of small refinements Document in Documentation/md.txt the files that now appear in sysfs, and make a couple of small refinements to exactly when 'level' and 'raid_disks' are empty, to make it match the documentation. Signed-off-by: Neil Brown Acked-by: Greg Kroah-Hartman Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/md/md.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'drivers/md') diff --git a/drivers/md/md.c b/drivers/md/md.c index 023aecd0295e..adf960d8a7c9 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -1727,7 +1727,7 @@ static ssize_t level_show(mddev_t *mddev, char *page) { mdk_personality_t *p = mddev->pers; - if (p == NULL) + if (p == NULL && mddev->raid_disks == 0) return 0; if (mddev->level >= 0) return sprintf(page, "RAID-%d\n", mddev->level); @@ -1740,6 +1740,8 @@ static struct md_sysfs_entry md_level = __ATTR_RO(level); static ssize_t raid_disks_show(mddev_t *mddev, char *page) { + if (mddev->raid_disks == 0) + return 0; return sprintf(page, "%d\n", mddev->raid_disks); } -- cgit v1.2.3