From 2f15b18f93ff202baad838207230ad31f8ebe105 Mon Sep 17 00:00:00 2001 From: Joe Thornber Date: Mon, 1 Oct 2001 16:07:29 +0000 Subject: [PATCH] o get block size moved to dev-io.c --- lib/device/device.c | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/lib/device/device.c b/lib/device/device.c index 77e073883..061435183 100644 --- a/lib/device/device.c +++ b/lib/device/device.c @@ -40,35 +40,6 @@ int _get_partition_type(struct dev_mgr *dm, struct device *d); -int do_ioctl(const char *file, int mode, unsigned long cmd, void *req) -{ - int ret, fd; - - if ((fd = open(file, mode)) < 0) { - log_sys_err("open"); - return fd; - } - - if ((ret = ioctl(fd, cmd, req)) < 0) { - log_sys_err("ioctl"); - } - - close(fd); - return ret; -} - -long device_get_size(const char *dev_name) -{ - int ret; - long size; - - log_verbose("Getting device size"); - if ((ret = do_ioctl(dev_name, O_RDONLY, BLKGETSIZE, &size)) < 0) - return ret; - - return size; -} - #define MINOR_PART(dm, d) (MINOR((d)->dev) % dev_max_partitions(dm, (d)->dev)) int is_whole_disk(struct dev_mgr *dm, struct device *d)