]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
Do not issue BLKFLSBUF to ramdisk devices.
authorNathan Scott <nathans@sgi.com>
Mon, 9 Aug 2004 05:30:39 +0000 (05:30 +0000)
committerNathan Scott <nathans@sgi.com>
Mon, 9 Aug 2004 05:30:39 +0000 (05:30 +0000)
libxfs/darwin.c
libxfs/freebsd.c
libxfs/init.c
libxfs/init.h
libxfs/irix.c
libxfs/linux.c

index b8138a0aca57544882cf6afaed4bebec2d2b3276..ce66f66ec8c92be52984a5e300fa53747dd5b2c7 100644 (file)
@@ -71,7 +71,7 @@ platform_set_blocksize(int fd, char *path, int blocksize)
 }
 
 void
-platform_flush_device(int fd)
+platform_flush_device(int fd, dev_t device)
 {
        ioctl(fd, DKIOCSYNCHRONIZECACHE, NULL);
 }
index aac56ffa9949b4883dfa145993a249f6f7121b1b..fabd22c918783ff790e544f9fd7d5f64e9266ff7 100644 (file)
@@ -109,11 +109,13 @@ platform_check_iswritable(char *name, char *block, struct stat64 *s, int fatal)
 void
 platform_set_blocksize(int fd, char *path, int blocksize)
 {
+       return;
 }
 
 void
-platform_flush_device(int fd)
+platform_flush_device(int fd, dev_t device)
 {
+       return;
 }
 
 void
index 8ad6dfd8b5abe2be0e7184f93cd14233179af616..12bd0c086a53bdd595d987a6b0793f0e62dfcdd6 100644 (file)
@@ -162,7 +162,7 @@ libxfs_device_close(dev_t dev)
                        dev_map[d].dev = dev_map[d].fd = 0;
 
                        fsync(fd);
-                       platform_flush_device(fd);
+                       platform_flush_device(fd, dev);
                        close(fd);
 
                        return;
index 1c11df41fbac584025adda9cb1c649c3923f995c..77e2744a733398a8ffa1ee53ff821a44b549c420 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
+ * Copyright (c) 2000-2004 Silicon Graphics, Inc.  All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of version 2 of the GNU General Public License as
@@ -40,6 +40,6 @@ extern int platform_check_iswritable (char *path, char *block,
                                        struct stat64 *sptr, int fatal);
 extern void platform_findsizes (char *path, int fd, long long *sz, int *bsz);
 extern void platform_set_blocksize (int fd, char *path, int blocksize);
-extern void platform_flush_device (int fd);
+extern void platform_flush_device (int fd, dev_t device);
 
 #endif /* LIBXFS_INIT_H */
index 622f1ca62bc8288488f7869163f377d2110e7aa2..1ab460cf67cbafda79ce5a517b6d416708d10102 100644 (file)
@@ -60,7 +60,7 @@ platform_get_blocksize(int fd, char *path)
 }
 
 void
-platform_flush_device(int fd)
+platform_flush_device(int fd, dev_t device)
 {
        return;
 }
index d4217bebf920238e518bc3fe6bf942e54f4c169a..30ab632618ef9f7944b5cfc95196b38f6e214ef7 100644 (file)
@@ -51,6 +51,10 @@ extern char *progname;
 # define BLKSSZGET     _IO(0x12,104)
 #endif
 
+#ifndef RAMDISK_MAJOR
+#define RAMDISK_MAJOR  1       /* ramdisk major number */
+#endif
+
 #define PROC_MOUNTED   "/proc/mounts"
 
 int
@@ -121,9 +125,10 @@ platform_set_blocksize(int fd, char *path, int blocksize)
 }
 
 void
-platform_flush_device(int fd)
+platform_flush_device(int fd, dev_t device)
 {
-       ioctl(fd, BLKFLSBUF, 0);
+       if (major(device) != RAMDISK_MAJOR)
+               ioctl(fd, BLKFLSBUF, 0);
 }
 
 void