mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-28 11:22:15 +03:00
Flush on open as well as close.
This commit is contained in:
parent
18f3ec8297
commit
b40b90f035
@ -62,6 +62,12 @@ int dev_get_sectsize(struct device *dev, uint32_t * size)
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
static void _flush(int fd)
|
||||
{
|
||||
ioctl(fd, BLKFLSBUF, 0);
|
||||
}
|
||||
|
||||
int dev_open(struct device *dev, int flags)
|
||||
{
|
||||
struct stat buf;
|
||||
@ -92,17 +98,12 @@ int dev_open(struct device *dev, int flags)
|
||||
dev_close(dev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
_flush(dev->fd);
|
||||
dev->flags = 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void _flush(int fd)
|
||||
{
|
||||
ioctl(fd, BLKFLSBUF, 0);
|
||||
}
|
||||
|
||||
int dev_close(struct device *dev)
|
||||
{
|
||||
if (dev->fd < 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user