Whamcloud - gitweb
LU-4017 debugfs: add support for the project id field 55/21255/6
authorTheodore Ts'o <tytso@mit.edu>
Sat, 5 Mar 2016 17:00:41 +0000 (12:00 -0500)
committerAndreas Dilger <andreas.dilger@intel.com>
Tue, 9 Aug 2016 19:32:16 +0000 (19:32 +0000)
Pick from upstream commit: f3d9ac36a021aab3d84ef7759790839f9a65a1bf

Teach the stat and set_inode_field commands to support the project ID
field

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Change-Id: Ia633d9857b3026e50308d16a91bc81bde2f3d0da
Reviewed-on: http://review.whamcloud.com/21255
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
debugfs/debugfs.c
debugfs/set_fields.c

index 73fedc4..52bb5d1 100644 (file)
@@ -828,8 +828,11 @@ void internal_dump_inode(FILE *out, const char *prefix,
                fprintf(out, "%sGeneration: %u    Version: 0x%08x\n", prefix,
                        inode->i_generation, inode->osd1.linux1.l_i_version);
        }
-       fprintf(out, "%sUser: %5d   Group: %5d   Size: ",
+       fprintf(out, "%sUser: %5d   Group: %5d",
                prefix, inode_uid(*inode), inode_gid(*inode));
+       if (is_large_inode && large_inode->i_extra_isize >= 32)
+               fprintf(out, "   Project: %5d", large_inode->i_projid);
+       fputs("   Size: ", out);
        if (LINUX_S_ISREG(inode->i_mode))
                fprintf(out, "%llu\n", EXT2_I_SIZE(inode));
        else
index 920f17d..ec19791 100644 (file)
@@ -217,7 +217,7 @@ static struct field_set_info inode_fields[] = {
        { "crtime", &set_inode.i_crtime, NULL, 4, parse_uint },
        { "crtime_extra", &set_inode.i_crtime_extra, NULL,
                4, parse_uint },
-       { "i_projid", &set_inode.i_projid, NULL, 4, parse_uint },
+       { "projid", &set_inode.i_projid, NULL, 4, parse_uint },
        { "bmap", NULL, NULL, 4, parse_bmap, FLAG_ARRAY },
        { 0, 0, 0, 0 }
 };