mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
o get block size moved to dev-io.c
This commit is contained in:
parent
58f5fa84f3
commit
2f15b18f93
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user