Whamcloud - gitweb
Branch b1_5
authornathan <nathan>
Fri, 23 Jun 2006 19:02:32 +0000 (19:02 +0000)
committernathan <nathan>
Fri, 23 Jun 2006 19:02:32 +0000 (19:02 +0000)
b=8007
ia64 doesn't have BLKGETSIZE64

lustre/utils/mkfs_lustre.c

index 13a5aea..7972fc6 100644 (file)
@@ -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",