From 465ad7d411a28b850a75fc25a95031e7bfb8b1f4 Mon Sep 17 00:00:00 2001 From: nathan Date: Fri, 23 Jun 2006 19:02:32 +0000 Subject: [PATCH] Branch b1_5 b=8007 ia64 doesn't have BLKGETSIZE64 --- lustre/utils/mkfs_lustre.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lustre/utils/mkfs_lustre.c b/lustre/utils/mkfs_lustre.c index 13a5aea..7972fc6 100644 --- a/lustre/utils/mkfs_lustre.c +++ b/lustre/utils/mkfs_lustre.c @@ -301,8 +301,17 @@ __u64 get_device_size(char* device) return 0; } +#ifdef BLKGETSIZE64 /* size in bytes. bz5831 */ ret = ioctl(fd, BLKGETSIZE64, (void*)&size); +#else + { + __u32 lsize = 0; + /* size in blocks */ + ret = ioctl(fd, BLKGETSIZE, (void*)&lsize); + size = (__u64)lsize * 512; + } +#endif close(fd); if (ret < 0) { fprintf(stderr, "%s: size ioctl failed: %s\n", -- 1.8.3.1