]> git.wh0rd.org - dump.git/commitdiff
BLKSFBUF ioctl in dump.
authorStelian Pop <stelian@popies.net>
Thu, 6 Sep 2001 09:00:31 +0000 (09:00 +0000)
committerStelian Pop <stelian@popies.net>
Thu, 6 Sep 2001 09:00:31 +0000 (09:00 +0000)
CHANGES
THANKS
dump/main.c
dump/tape.c

diff --git a/CHANGES b/CHANGES
index dba3572463ec12b7920ad084d59c5af8d5785469..0ede091214a1e6a8ba8367240ba7475b63fe4c05 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,4 @@
-$Id: CHANGES,v 1.135 2001/08/17 09:55:09 stelian Exp $
+$Id: CHANGES,v 1.136 2001/09/06 09:00:31 stelian Exp $
 
 Changes between versions 0.4b23 and 0.4b24 (released ?????????????)
 ===================================================================
@@ -31,6 +31,12 @@ Changes between versions 0.4b23 and 0.4b24 (released ?????????????)
        very large files were encountered. Thanks to Vladimir Nadvornik 
        for the bug report.
 
+8.     Added a ioctl(BLKFLSBUF) in dump which should flush the
+       kernel buffer/page cache before starting the dump, helping
+       a bit those who use dump on mounted filesystems. Thanks to
+       John Yu <jky@it.bu.edu> and to Theodore T'so <tytso@mit.edu>
+       for this suggestion.
+       
 Changes between versions 0.4b22 and 0.4b23 (released July 20, 2001)
 ===================================================================
 
diff --git a/THANKS b/THANKS
index 80e2063044a4a56b9bd140c84b8633f242954a98..4e4b0f8155f6d706ca4ecff39cfdabf530c2f660 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -1,4 +1,4 @@
-$Id: THANKS,v 1.46 2001/07/18 09:50:48 stelian Exp $
+$Id: THANKS,v 1.47 2001/09/06 09:00:31 stelian Exp $
 
 Dump and restore were written by the people of the CSRG at the University
 of California, Berkeley.
@@ -81,4 +81,5 @@ Daniel Veillard               Daniel.Veillard@imag.fr
 Jason Venner           jason@idiom.com
 Christian Weisgerber   naddy@mips.rhein-neckar.de
 Kim Yong-jun           loveyou@hackerslab.org
+John Yu                        jky@it.bu.edu
 Ian Zimmerman          itz@speakeasy.org>
index 5e9c111c621df8ed73fd70639a64fb8937050ebe..722ca71e1764bb5fd381818210011d26155fa5ca 100644 (file)
@@ -41,7 +41,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: main.c,v 1.59 2001/08/16 15:24:21 stelian Exp $";
+       "$Id: main.c,v 1.60 2001/09/06 09:00:32 stelian Exp $";
 #endif /* not lint */
 
 #include <config.h>
@@ -60,6 +60,7 @@ static const char rcsid[] =
 #include <sys/time.h>
 #include <time.h>
 #ifdef __linux__
+#include <linux/fs.h>
 #ifdef HAVE_EXT2FS_EXT2_FS_H
 #include <ext2fs/ext2_fs.h>
 #else
@@ -628,6 +629,14 @@ main(int argc, char *argv[])
        } /* end of size estimate */
 
 #ifdef __linux__
+       if ((diskfd = OPEN(disk, O_RDONLY)) < 0) {
+               msg("Cannot open %s\n", disk);
+               msg("The ENTIRE dump is aborted.\n");
+               exit(X_STARTUP);
+       }
+#ifdef BLKFLSBUF
+       (void)ioctl(diskfd, BLKFLSBUF);
+#endif
        retval = dump_fs_open(disk, &fs);
        if (retval) {
                com_err(disk, retval, "while opening filesystem");
@@ -642,11 +651,6 @@ main(int argc, char *argv[])
                msg("The ENTIRE dump is aborted.\n");
                exit(X_STARTUP);
        }
-       if ((diskfd = OPEN(disk, O_RDONLY)) < 0) {
-               msg("Cannot open %s\n", disk);
-               msg("The ENTIRE dump is aborted.\n");
-               exit(X_STARTUP);
-       }
        /* if no user label specified, use ext2 filesystem label if available */
        if (spcl.c_label[0] == '\0') {
                const char *lbl;
index 8d8933f6eea8079fcf87e719101142e6bc5a97a3..f61fc879ee395b2228fe61d4e510d0348ea96210 100644 (file)
@@ -41,7 +41,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: tape.c,v 1.54 2001/08/16 15:24:21 stelian Exp $";
+       "$Id: tape.c,v 1.55 2001/09/06 09:00:32 stelian Exp $";
 #endif /* not lint */
 
 #include <config.h>
@@ -72,6 +72,9 @@ int    write(), read();
 #include <sys/wait.h>
 #include <sys/mtio.h>
 #ifdef __linux__
+#include <linux/fs.h>
+#undef atomic_read     /* this get wrongly defined in kernel */
+                       /* headers and we don't want it */
 #ifdef HAVE_EXT2FS_EXT2_FS_H
 #include <ext2fs/ext2_fs.h>
 #else
@@ -562,7 +565,7 @@ close_rewind(void)
 void
 rollforward(void)
 {
-       register struct req *p, *q, *prev;
+       register struct req *p, *q = NULL, *prev;
        register struct slave *tslp;
        int i, size, savedtapea, got;
        union u_spcl *ntb, *otb;
@@ -1046,6 +1049,9 @@ doslave(int cmd, int slave_number, int first)
        if ((diskfd = OPEN(disk, O_RDONLY)) < 0)
                quit("slave couldn't reopen disk: %s\n", strerror(errno));
 #ifdef __linux__
+#ifdef BLKFLSBUF
+       (void)ioctl(diskfd, BLKFLSBUF);
+#endif
        ext2fs_close(fs);
        retval = dump_fs_open(disk, &fs);
        if (retval)