]> git.ipfire.org Git - thirdparty/e2fsprogs.git/blobdiff - e2fsck/message.c
e2fsck: remove get_filename_hash() prototype
[thirdparty/e2fsprogs.git] / e2fsck / message.c
index 9c1433fd15a33813801597d0b39afa787453c342..30ce620aa123aecffcc0d73f7febfeaeeb31a5e6 100644 (file)
@@ -48,6 +48,9 @@
  *                     the containing directory.
  *     %r      <blkcount>              interpret blkcount as refcount
  *     %s      <str>                   miscellaneous string
+ *     %t      time (in <num>)
+ *     %T      current time
+ *     %U      quota type (in <num>)
  *     %S      backup superblock
  *     %X      <num> hexadecimal format
  *
@@ -92,9 +95,9 @@
 #include <string.h>
 #include <ctype.h>
 #include <termios.h>
+#include "support/quotaio.h"
 
 #include "e2fsck.h"
-
 #include "problem.h"
 
 #ifdef __GNUC__
@@ -221,7 +224,7 @@ static void print_time(FILE *f, time_t t)
        static int              do_gmt = -1;
 
 #ifdef __dietlibc__
-               /* The diet libc doesn't respect the TZ environemnt variable */
+               /* The diet libc doesn't respect the TZ environment variable */
                if (do_gmt == -1) {
                        time_str = getenv("TZ");
                        if (!time_str)
@@ -296,8 +299,7 @@ static _INLINE_ void expand_inode_expression(FILE *f, ext2_filsys fs, char ch,
                fprintf(f, "%u", large_inode->i_extra_isize);
                break;
        case 'b':
-               if (fs->super->s_feature_ro_compat &
-                   EXT4_FEATURE_RO_COMPAT_HUGE_FILE) 
+               if (ext2fs_has_feature_huge_file(fs->super))
                        fprintf(f, "%llu", inode->i_blocks +
                                (((long long) inode->osd2.linux2.l_i_blocks_hi)
                                 << 32));
@@ -501,6 +503,27 @@ static _INLINE_ void expand_percent_expression(FILE *f, ext2_filsys fs,
        case 'T':
                print_time(f, e2fsck_ctx ? e2fsck_ctx->now : time(0));
                break;
+       case 'U':
+               switch (ctx->num) {
+               case USRQUOTA:
+                       m = _("user");
+                       break;
+               case GRPQUOTA:
+                       m = _("group");
+                       break;
+               case PRJQUOTA:
+                       m = _("project");
+                       break;
+               default:
+                       m = _("unknown quota type");
+                       break;
+               }
+               if (*first && islower(m[0]))
+                       fputc(toupper(*m++), f);
+               fputs(m, f);
+               if (ctx->num > PRJQUOTA)
+                       fprintf(f, " %d", (int) ctx->num);
+               break;
        case 'x':
                fprintf(f, "0x%0*x", width, ctx->csum1);
                break;