Whamcloud - gitweb
ChangeLog, e2fsck.h, flushb.c, iscan.c, unix.c:
authorTheodore Ts'o <tytso@mit.edu>
Thu, 11 Jan 2001 19:15:02 +0000 (19:15 +0000)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 11 Jan 2001 19:15:02 +0000 (19:15 +0000)
  iscan.c, unix.c, e2fsck.h: Don't use NOARGS, and use
   ext2fs_sync_device() instead of using BLKFLSBUF.
  flushb.c: Don't use NOARGS anymore; everything is STDC these days.
ChangeLog, pass1.c:
  pass1.c (process_block): Remove dead code which was never getting
   executed.

e2fsck/ChangeLog
e2fsck/e2fsck.h
e2fsck/flushb.c
e2fsck/iscan.c
e2fsck/pass1.c
e2fsck/unix.c

index 9fe5d3e..c5f4d16 100644 (file)
@@ -1,5 +1,13 @@
 2001-01-11    <tytso@snap.thunk.org>
 
+       * pass1.c (process_block): Remove dead code which was never
+               getting executed.
+
+       * iscan.c, unix.c, e2fsck.h: Don't use NOARGS, and use
+               ext2fs_sync_device() instead of using BLKFLSBUF.
+
+       * flushb.c: Don't use NOARGS anymore; everything is STDC these days.
+       
        * dirinfo.c, e2fsck.h, emptydir.c, iscan.c, jfs_user.h, journal.c,
                message.c, pass1.c, pass1b.c, pass2.c, pass3.c, pass4.c,
                pass5.c, problem.h, scantest.c, super.c, swapfs.c: Change
index 5ffcd59..1c7ecf9 100644 (file)
 #define N_(a) a
 #endif
 
-/* For Linux/i386, define BLKFLSBUF */
-#if (!defined(BLKFLSBUF) && defined(__i386__))
-#define BLKFLSBUF  0x1261      /* flush buffer cache */
-#endif
-
-/* Everything is STDC, these days */
-#define NOARGS void
-
 /*
  * Exit codes used by fsck-type programs
  */
index c260bf6..16389b2 100644 (file)
 #include <sys/ioctl.h>
 #include "../misc/nls-enable.h"
 
-#ifdef __STDC__
-#define NOARGS void
-#else
-#define NOARGS
-#define const
-#endif
-
 /* For Linux/i386, define BLKFLSBUF */
 #if (!defined(BLKFLSBUF) && defined(__i386__))
 #define BLKFLSBUF  0x1261      /* flush buffer cache */
@@ -45,7 +38,7 @@
 
 const char *progname;
 
-static void usage(NOARGS)
+static void usage(void)
 {
        fprintf(stderr, _("Usage: %s disk\n"), progname);
        exit(1);
index 5869d6d..8f4b255 100644 (file)
@@ -38,7 +38,7 @@ int invalid_bitmaps = 0;
 
 struct resource_track  global_rtrack;
 
-static void usage(NOARGS)
+static void usage(void)
 {
        fprintf(stderr,
                _("Usage: %s [-F] [-I inode_buffer_blocks] device\n"),
@@ -63,12 +63,7 @@ static void PRS(int argc, char *argv[])
        while ((c = getopt (argc, argv, "FI")) != EOF)
                switch (c) {
                case 'F':
-#ifdef BLKFLSBUF
                        flush = 1;
-#else
-                       fprintf(stderr, _("-F not supported"));
-                       exit(1);
-#endif
                        break;
                case 'I':
                        inode_buffer_blocks = atoi(optarg);
@@ -78,7 +73,6 @@ static void PRS(int argc, char *argv[])
                }
        device_name = argv[optind];
        if (flush) {
-#ifdef BLKFLSBUF
                int     fd = open(device_name, O_RDONLY, 0);
 
                if (fd < 0) {
@@ -86,16 +80,12 @@ static void PRS(int argc, char *argv[])
                            _("while opening %s for flushing"), device_name);
                        exit(FSCK_ERROR);
                }
-               if (ioctl(fd, BLKFLSBUF, 0) < 0) {
-                       com_err("BLKFLSBUF", errno,
+               if ((retval = ext2fs_sync_device(fd, 1))) {
+                       com_err("ext2fs_sync_device", retval,
                                _("while trying to flush %s"), device_name);
                        exit(FSCK_ERROR);
                }
                close(fd);
-#else
-               fprintf(stderr, _("BLKFLSBUF not supported"));
-               exit(1);
-#endif /* BLKFLSBUF */
        }
 }
                                        
index cb4e583..90530c7 100644 (file)
@@ -1107,8 +1107,6 @@ static int process_block(ext2_filsys fs,
                        goto mark_dir;
                } else
                        return 0;
-               pctx->blk = 0;
-               pctx->blkcount = -1;
        }
 
        mark_block_used(ctx, blk);
index 34984e9..4e5925c 100644 (file)
@@ -393,7 +393,7 @@ static int e2fsck_update_progress(e2fsck_t ctx, int pass,
 
 #define PATH_SET "PATH=/sbin"
 
-static void reserve_stdio_fds(NOARGS)
+static void reserve_stdio_fds(void)
 {
        int     fd;
 
@@ -543,11 +543,7 @@ static errcode_t PRS(int argc, char *argv[], e2fsck_t *ret_ctx)
                        force = 1;
                        break;
                case 'F':
-#ifdef BLKFLSBUF
                        flush = 1;
-#else
-                       fatal_error(ctx, _("-F not supported"));
-#endif
                        break;
                case 'v':
                        verbose = 1;
@@ -579,7 +575,6 @@ static errcode_t PRS(int argc, char *argv[], e2fsck_t *ret_ctx)
            !cflag && !swapfs)
                ctx->options |= E2F_OPT_READONLY;
        ctx->filesystem_name = argv[optind];
-#ifdef BLKFLSBUF
        if (flush) {
                int     fd = open(ctx->filesystem_name, O_RDONLY, 0);
 
@@ -589,21 +584,14 @@ static errcode_t PRS(int argc, char *argv[], e2fsck_t *ret_ctx)
                                ctx->filesystem_name);
                        fatal_error(ctx, 0);
                }
-               if (fsync(fd) < 0) {
-                       com_err("fsync", errno,
-                               _("while trying to flush %s"),
-                               ctx->filesystem_name);
-                       fatal_error(ctx, 0);
-               }
-               if (ioctl(fd, BLKFLSBUF, 0) < 0) {
-                       com_err("BLKFLSBUF", errno,
+               if ((retval == ext2fs_sync_device(fd, 1))) {
+                       com_err("ext2fs_sync_device", retval,
                                _("while trying to flush %s"),
                                ctx->filesystem_name);
                        fatal_error(ctx, 0);
                }
                close(fd);
        }
-#endif /* BLKFLSBUF */
        if (swapfs) {
                if (cflag || bad_blocks_file) {
                        fprintf(stderr, _("Incompatible options not "