]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lib: [blkdev.c] remove kernel version check from blkdev_get_sector_size()
authorKarel Zak <kzak@redhat.com>
Mon, 27 Jun 2011 14:09:56 +0000 (16:09 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 27 Jun 2011 14:09:56 +0000 (16:09 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
disk-utils/mkfs.minix.c
lib/blkdev.c

index 405e241b9219a6ac23ea2bcfe2be9ec2bec51f39..328e285a9785c1aa263f00ecaba66013aabec5d4 100644 (file)
@@ -659,8 +659,7 @@ int main(int argc, char ** argv) {
                int sectorsize;
 
                if (blkdev_get_sector_size(DEV, &sectorsize) == -1)
-                       errx(MKFS_ERROR, _("cannot determine sector size for %s"),
-                                       device_name);
+                       sectorsize = DEFAULT_SECTOR_SIZE;               /* kernel < 2.3.3 */
                if (BLOCK_SIZE < sectorsize)
                        errx(MKFS_ERROR, _("block size smaller than physical "
                                        "sector size of %s"), device_name);
index d889b787f175610a8a26f62dda30072e96a6308e..3f652bb6029a6fbd96d0ecc8beb8777abed7b6ae 100644 (file)
@@ -179,24 +179,17 @@ blkdev_get_sectors(int fd, unsigned long long *sectors)
        return -1;
 }
 
-/* get logical sector size (default is 512)
+/*
+ * Get logical sector size.
  *
  * This is the smallest unit the storage device can
  * address. It is typically 512 bytes.
  */
-int
-blkdev_get_sector_size(int fd, int *sector_size)
+int blkdev_get_sector_size(int fd, int *sector_size)
 {
 #ifdef BLKSSZGET
-#ifdef __linux__
-       if (get_linux_version() < KERNEL_VERSION(2,3,3)) {
-               *sector_size = DEFAULT_SECTOR_SIZE;
-               return 0;
-       }
-#endif
        if (ioctl(fd, BLKSSZGET, sector_size) >= 0)
                return 0;
-
        return -1;
 #else
        *sector_size = DEFAULT_SECTOR_SIZE;