summaryrefslogtreecommitdiffstats
path: root/Grow.c
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2006-12-14 17:32:57 +1100
committerNeil Brown <neilb@suse.de>2006-12-14 17:32:57 +1100
commitbeae1dfe2e5a3f11e6e52a93fbf617d644708415 (patch)
treeca12b130f76d63e7156e43ac89d76c11b2c140b8 /Grow.c
parentab5303d695eb7249b9462f9ad4e973711622a9c5 (diff)
downloadmdadm-beae1dfe2e5a3f11e6e52a93fbf617d644708415.tar.gz
mdadm-beae1dfe2e5a3f11e6e52a93fbf617d644708415.tar.xz
mdadm-beae1dfe2e5a3f11e6e52a93fbf617d644708415.zip
Central calls to ioctl BLKGETSIZE
Instead of opencoding the same thing everywhere.
Diffstat (limited to 'Grow.c')
-rw-r--r--Grow.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/Grow.c b/Grow.c
index fec0d32..c160f2c 100644
--- a/Grow.c
+++ b/Grow.c
@@ -257,15 +257,13 @@ int Grow_addbitmap(char *devname, int fd, char *file, int chunk, int delay, int
}
bitmapsize = array.size;
bitmapsize <<= 1;
-#ifdef BLKGETSIZE64
- if (ioctl(fd, BLKGETSIZE64, &array_size) == 0 &&
+ if (get_dev_size(fd, NULL, &array_size) &&
array_size > (0x7fffffffULL<<9)) {
/* Array is big enough that we cannot trust array.size
* try other approaches
*/
bitmapsize = get_component_size(fd);
}
-#endif
if (bitmapsize == 0) {
fprintf(stderr, Name ": Cannot reliably determine size of array to create bitmap - sorry.\n");
return 1;