From 6eaaf40bd664d1c8ef82e7c36fb43942d9537366 Mon Sep 17 00:00:00 2001
From: Thiemo Nagel <thiemo.nagel@gmail.com>
Date: Fri, 13 Sep 2013 15:57:57 +0200
Subject: [PATCH] blockdev-wipe: Remove BLKGETSIZE fallback

The fallback is obsolete and also broken on 32bit platforms,
cf. bug #722696.
---
 blockdev-wipe/blockdev-wipe.c |    7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/blockdev-wipe/blockdev-wipe.c b/blockdev-wipe/blockdev-wipe.c
index 064ab15..dfced12 100644
--- a/blockdev-wipe/blockdev-wipe.c
+++ b/blockdev-wipe/blockdev-wipe.c
@@ -63,19 +63,14 @@ static unsigned long long dev_size(int fd)
 {
 	int ret;
 	unsigned long long size;
-	unsigned long blocks;
 
 	ret = ioctl(fd, BLKGETSIZE64, &size);
-	if (ret == 0)
-		return size;
-
-	ret = ioctl(fd, BLKGETSIZE, &blocks);
 	if (ret < 0) {
 		close(fd);
 		die("failed to get device size", 1);
 	}
 
-	return blocks * 512;
+	return size;
 }
 
 static int do_wipe(int source, int target, size_t wsize)
-- 
1.7.10.4

