summaryrefslogtreecommitdiff
path: root/sysfs.c
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2006-03-20 03:17:31 +0000
committerNeil Brown <neilb@suse.de>2006-03-20 03:17:31 +0000
commit353632d927d6e46282ef4f51d4ad17940a30cdf0 (patch)
tree7257d93e459937f1b5bffa90ea5b2dccd18a2b00 /sysfs.c
parente86c9dd6d847ec57ec400b118efaf2c1808f10bc (diff)
Support restarting of a reshape on --assemble
Signed-off-by: Neil Brown <neilb@suse.de>
Diffstat (limited to 'sysfs.c')
-rw-r--r--sysfs.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sysfs.c b/sysfs.c
index 98947606..1774509c 100644
--- a/sysfs.c
+++ b/sysfs.c
@@ -98,6 +98,8 @@ struct sysarray *sysfs_read(int fd, int devnum, unsigned long options)
if (load_sys(fname, buf))
goto abort;
sra->component_size = strtoull(buf, NULL, 0);
+ /* sysfs reports "K", but we want sectors */
+ sra->component_size *= 2;
}
if (options & GET_CHUNK) {
strcpy(base, "chunk_size");
@@ -192,6 +194,8 @@ unsigned long long get_component_size(int fd)
* We cannot trust GET_ARRAY_INFO ioctl as it's
* size field is only 32bits.
* So look in /sys/block/mdXXX/md/component_size
+ *
+ * WARNING: this returns in units of Kilobytes.
*/
struct stat stb;
char fname[50];