lib/blkdev: remove support for Linux < 2.6
Remove a hack for kernels between 2.4.15 and 2.4.17 Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
This commit is contained in:
parent
9f3d0fce66
commit
ad553030fb
13
lib/blkdev.c
13
lib/blkdev.c
|
@ -91,18 +91,9 @@ blkdev_get_size(int fd, unsigned long long *bytes)
|
|||
#endif
|
||||
|
||||
#ifdef BLKGETSIZE64
|
||||
{
|
||||
#ifdef __linux__
|
||||
int ver = get_linux_version();
|
||||
|
||||
/* kernels 2.4.15-2.4.17, had a broken BLKGETSIZE64 */
|
||||
if (ver >= KERNEL_VERSION (2,6,0) ||
|
||||
(ver >= KERNEL_VERSION (2,4,18) && ver < KERNEL_VERSION (2,5,0)))
|
||||
if (ioctl(fd, BLKGETSIZE64, bytes) >= 0)
|
||||
return 0;
|
||||
#endif
|
||||
if (ioctl(fd, BLKGETSIZE64, bytes) >= 0)
|
||||
return 0;
|
||||
}
|
||||
#endif /* BLKGETSIZE64 */
|
||||
|
||||
#ifdef BLKGETSIZE
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue