diff options
author | NeilBrown <neilb@suse.de> | 2005-11-09 00:39:45 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-09 10:56:40 -0500 |
commit | bb636547b02411ca5eef87b1d030ea3fc090a717 (patch) | |
tree | f6abbad4e7283d5d327646859ad0af1f9ee43aa8 /drivers/md/md.c | |
parent | 7eec314d7512d5281742263cff3853b43df431db (diff) |
[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 <neilb@suse.de>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r-- | drivers/md/md.c | 4 |
1 files changed, 3 insertions, 1 deletions
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 | |||
1727 | level_show(mddev_t *mddev, char *page) | 1727 | level_show(mddev_t *mddev, char *page) |
1728 | { | 1728 | { |
1729 | mdk_personality_t *p = mddev->pers; | 1729 | mdk_personality_t *p = mddev->pers; |
1730 | if (p == NULL) | 1730 | if (p == NULL && mddev->raid_disks == 0) |
1731 | return 0; | 1731 | return 0; |
1732 | if (mddev->level >= 0) | 1732 | if (mddev->level >= 0) |
1733 | return sprintf(page, "RAID-%d\n", mddev->level); | 1733 | return sprintf(page, "RAID-%d\n", mddev->level); |
@@ -1740,6 +1740,8 @@ static struct md_sysfs_entry md_level = __ATTR_RO(level); | |||
1740 | static ssize_t | 1740 | static ssize_t |
1741 | raid_disks_show(mddev_t *mddev, char *page) | 1741 | raid_disks_show(mddev_t *mddev, char *page) |
1742 | { | 1742 | { |
1743 | if (mddev->raid_disks == 0) | ||
1744 | return 0; | ||
1743 | return sprintf(page, "%d\n", mddev->raid_disks); | 1745 | return sprintf(page, "%d\n", mddev->raid_disks); |
1744 | } | 1746 | } |
1745 | 1747 | ||