[PATCH] Get the name for partitioned devices in sysfs correct.

There are 64 partitions per device, not 16.

Signed-off-by: Neil Brown <neilb@suse.de>

### Diffstat output
 ./sysfs.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff ./sysfs.c~current~ ./sysfs.c
This commit is contained in:
Neil Brown 2006-04-28 14:09:24 +10:00
parent 90d0adf4ba
commit 7fa42a0b5e
1 changed files with 2 additions and 2 deletions

View File

@ -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;