Whamcloud - gitweb
ChangeLog, unix.c:
authorTheodore Ts'o <tytso@mit.edu>
Thu, 14 Jun 2001 01:16:17 +0000 (01:16 +0000)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 14 Jun 2001 01:16:17 +0000 (01:16 +0000)
  unix.c (check_if_skip): Adapted patch from Andreas Dilger which prints
   the number of mounts or days elapsed since the last check when e2fsck
   is forced to check an otherwise clean filesystem.

e2fsck/ChangeLog
e2fsck/unix.c

index 7190cb8..272c640 100644 (file)
@@ -1,3 +1,10 @@
+2001-06-13  Theodore Tso  <tytso@valinux.com>
+
+       * unix.c (check_if_skip): Adapted patch from Andreas Dilger which
+               prints the number of mounts or days elapsed since the last
+               check when e2fsck is forced to check an otherwise clean
+               filesystem.
+
 2001-06-12  Theodore Tso  <tytso@valinux.com>
 
        * badblocks.c: Stop using the compatibility badblocks function,
index f7ed56d..816f3ce 100644 (file)
@@ -253,24 +253,30 @@ static void check_if_skip(e2fsck_t ctx)
 {
        ext2_filsys fs = ctx->fs;
        const char *reason = NULL;
+       unsigned int reason_arg = 0;
        
        if (force || bad_blocks_file || cflag || swapfs)
                return;
        
        if (fs->super->s_state & EXT2_ERROR_FS)
-               reason = _("contains a file system with errors");
+               reason = _(" contains a file system with errors");
        else if ((fs->super->s_state & EXT2_VALID_FS) == 0)
-               reason = _("was not cleanly unmounted");
+               reason = _(" was not cleanly unmounted");
        else if ((fs->super->s_max_mnt_count > 0) &&
                 (fs->super->s_mnt_count >=
-                 (unsigned) fs->super->s_max_mnt_count))
-               reason = _("has reached maximal mount count");
-       else if (fs->super->s_checkinterval &&
+                 (unsigned) fs->super->s_max_mnt_count)) {
+               reason = _(" has been mounted %u times without being checked");
+               reason_arg = fs->super->s_mnt_count;
+       } else if (fs->super->s_checkinterval &&
                 time(0) >= (fs->super->s_lastcheck +
-                            fs->super->s_checkinterval))
-               reason = _("has gone too long without being checked");
+                            fs->super->s_checkinterval)) {
+               reason = _(" has gone %u days without being checked");
+               reason_arg = (time(0) - fs->super->s_lastcheck)/(3600*24);
+       }
        if (reason) {
-               printf(_("%s %s, check forced.\n"), ctx->device_name, reason);
+               fputs(ctx->device_name, stdout);
+               printf(reason, reason_arg);
+               fputs(_(", check forced.\n"), stdout);
                return;
        }
        printf(_("%s: clean, %d/%d files, %d/%d blocks\n"), ctx->device_name,