mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
8696e06602
better name. dev-mgr will be removed at some point.
43 lines
706 B
C
43 lines
706 B
C
/*
|
|
* Copyright (C) 2001 Sistina Software
|
|
*
|
|
* This file is released under the GPL.
|
|
*/
|
|
|
|
int dev_get_size(struct device *dev, uint64_t *size)
|
|
{
|
|
int fd;
|
|
long s;
|
|
|
|
log_verbose("Getting device size");
|
|
if ((fd = open(pv, O_RDONLY)) < 0) {
|
|
log_sys_error("open");
|
|
return 0;
|
|
}
|
|
|
|
/* FIXME: add 64 bit ioctl */
|
|
if (ioctl(fd, BLKGETSIZE, &s) < 0) {
|
|
log_sys_err("ioctl");
|
|
close(fd);
|
|
return 0;
|
|
}
|
|
|
|
close(fd);
|
|
*size = (uint64_t) s;
|
|
return 1;
|
|
}
|
|
|
|
int64_t dev_read(struct device *dev, uint64_t offset,
|
|
int64_t len, void *buffer)
|
|
{
|
|
// FIXME: lazy programmer
|
|
return 0;
|
|
}
|
|
|
|
int64_t dev_write(struct device *dev, uint64_t offset,
|
|
int64_t len, void *buffer)
|
|
{
|
|
// FIXME: lazy programmer
|
|
return 0;
|
|
}
|