From 7fa42a0b5e4541b7178c848229fcb7e98696babe Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Fri, 28 Apr 2006 14:09:24 +1000 Subject: [PATCH] Get the name for partitioned devices in sysfs correct. There are 64 partitions per device, not 16. Signed-off-by: Neil Brown ### Diffstat output ./sysfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff ./sysfs.c~current~ ./sysfs.c --- sysfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sysfs.c') diff --git a/sysfs.c b/sysfs.c index 1774509c..8c1d45f0 100644 --- a/sysfs.c +++ b/sysfs.c @@ -69,7 +69,7 @@ struct sysarray *sysfs_read(int fd, int devnum, unsigned long options) sprintf(sra->name, "md%d", minor(stb.st_rdev)); else sprintf(sra->name, "md_d%d", - minor(stb.st_rdev)/16); + minor(stb.st_rdev)>>MdpMinorShift); } else { if (devnum >= 0) sprintf(sra->name, "md%d", devnum); @@ -206,7 +206,7 @@ unsigned long long get_component_size(int fd) minor(stb.st_rdev)); else sprintf(fname, "/sys/block/md_d%d/md/component_size", - minor(stb.st_rdev)/16); + minor(stb.st_rdev)>>MdpMinorShift); fd = open(fname, O_RDONLY); if (fd < 0) return 0; -- cgit v1.2.3