Whamcloud - gitweb
Print an error if more than one of the -p/-a, -n or -y options
[tools/e2fsprogs.git] / e2fsck / message.c
index 210c659..6c81eeb 100644 (file)
  *     %b      <blk>                   block number
  *     %B      <blkcount>              integer
  *     %c      <blk2>                  block number
- *     %di     <dirent>->ino           inode number
- *     %dn     <dirent>->name          string
- *     %dr     <dirent>->rec_len
- *     %dl     <dirent>->name_len
- *     %dt     <dirent>->filetype
- *     %D      <dir>                   inode number
+ *     %Di     <dirent>->ino           inode number
+ *     %Dn     <dirent>->name          string
+ *     %Dr     <dirent>->rec_len
+ *     %Dl     <dirent>->name_len
+ *     %Dt     <dirent>->filetype
+ *     %d      <dir>                   inode number
  *     %g      <group>                 integer
  *     %i      <ino>                   inode number
  *     %Is     <inode> -> i_size
  *
  * The following '@' expansions are supported:
  *
+ *     @a      extended attribute
  *     @A      error allocating
  *     @b      block
  *     @B      bitmap
  *     @c      compress
  *     @C      conflicts with some other fs block
- *     @d      device
- *     @i      inode
- *     @I      illegal
- *     @j      journal
  *     @D      deleted
  *     @d      directory
  *     @e      entry
  *     @f      filesystem
  *     @F      for @i %i (%Q) is
  *     @g      group
+ *     @h      HTREE directory inode
+ *     @i      inode
+ *     @I      illegal
+ *     @j      journal
  *     @l      lost+found
  *     @L      is a link
  *     @o      orphaned
+ *     @p      problem in
  *     @r      root inode
  *     @s      should be 
  *     @S      superblock
  *     @u      unattached
+ *     @v      device
  *     @z      zero-length
  */
 
  * letter <i> in the table below.
  */
 static const char *abbrevs[] = {
+       N_("aextended attribute"),
        N_("Aerror allocating"),
        N_("bblock"),
        N_("Bbitmap"),
        N_("ccompress"),
        N_("Cconflicts with some other fs @b"),
-       N_("ddevice"),
        N_("iinode"),
        N_("Iillegal"),
        N_("jjournal"),
@@ -115,13 +118,16 @@ static const char *abbrevs[] = {
        N_("ffilesystem"),
        N_("Ffor @i %i (%Q) is"),
        N_("ggroup"),
+       N_("hHTREE @d @i"),
        N_("llost+found"),
        N_("Lis a link"),
        N_("oorphaned"),
+       N_("pproblem in"),
        N_("rroot @i"),
        N_("sshould be"),
        N_("Ssuper@b"),
        N_("uunattached"),
+       N_("vdevice"),
        N_("zzero-length"),
        "@@",
        0
@@ -130,7 +136,7 @@ static const char *abbrevs[] = {
 /*
  * Give more user friendly names to the "special" inodes.
  */
-#define num_special_inodes     7
+#define num_special_inodes     11
 static const char *special_inode_name[] =
 {
        N_("<The NULL inode>"),                 /* 0 */
@@ -139,7 +145,11 @@ static const char *special_inode_name[] =
        N_("<The ACL index inode>"),            /* 3 */
        N_("<The ACL data inode>"),             /* 4 */
        N_("<The boot loader inode>"),          /* 5 */
-       N_("<The undelete directory inode>")    /* 6 */
+       N_("<The undelete directory inode>"),   /* 6 */
+       N_("<The group descriptor inode>"),     /* 7 */
+       N_("<The journal inode>"),              /* 8 */
+       N_("<Reserved inode 9>"),               /* 9 */
+       N_("<Reserved inode 10>"),              /* 10 */
 };
 
 /*
@@ -172,7 +182,7 @@ static void safe_print(const char *cp, int len)
  * This function prints a pathname, using the ext2fs_get_pathname
  * function
  */
-static void print_pathname(ext2_filsys fs, ino_t dir, ino_t ino)
+static void print_pathname(ext2_filsys fs, ext2_ino_t dir, ext2_ino_t ino)
 {
        errcode_t       retval;
        char            *path;
@@ -355,16 +365,16 @@ static _INLINE_ void expand_percent_expression(ext2_filsys fs, char ch,
                printf("%u", ctx->blk2);
                break;
        case 'd':
-               printf("%lu", ctx->dir);
+               printf("%u", ctx->dir);
                break;
        case 'g':
                printf("%d", ctx->group);
                break;
        case 'i':
-               printf("%lu", ctx->ino);
+               printf("%u", ctx->ino);
                break;
        case 'j':
-               printf("%lu", ctx->ino2);
+               printf("%u", ctx->ino2);
                break;
        case 'm':
                printf("%s", error_message(ctx->errcode));
@@ -390,7 +400,7 @@ static _INLINE_ void expand_percent_expression(ext2_filsys fs, char ch,
                print_pathname(fs, ctx->dir, ctx->ino);
                break;
        case 'S':
-               printf("%d", get_backup_sb(fs));
+               printf("%d", get_backup_sb(NULL, fs, NULL, NULL));
                break;
        case 's':
                printf("%s", ctx->str ? ctx->str : "NULL");