1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
lvm2/lib/device/dev-io.c
Joe Thornber 8696e06602 o I've moved the dev-cache and dev-io into here since this directory has a
better name.  dev-mgr will be removed at some point.
2001-10-03 12:41:29 +00:00

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;
}