]> sourceware.org Git - lvm2.git/commitdiff
Flush on open as well as close.
authorPatrick Caulfield <pcaulfie@redhat.com>
Tue, 25 Jun 2002 14:02:28 +0000 (14:02 +0000)
committerPatrick Caulfield <pcaulfie@redhat.com>
Tue, 25 Jun 2002 14:02:28 +0000 (14:02 +0000)
lib/device/dev-io.c

index a8f24a729ecbf4a636c728843e8f7288f5ef2171..4be596fb6297a56dcae934862272e6ec1891c747 100644 (file)
@@ -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) {
This page took 0.0403480000000001 seconds and 5 git commands to generate.