From: Theodore Ts'o Date: Sat, 5 Mar 2016 17:00:41 +0000 (-0500) Subject: LU-4017 debugfs: add support for the project id field X-Git-Tag: v1.42.13.wc6~6 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=7c9b7ec3c8b22a85ce5ccb6b140faeceb50cc426;p=tools%2Fe2fsprogs.git LU-4017 debugfs: add support for the project id field 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 Signed-off-by: Wang Shilong Change-Id: Ia633d9857b3026e50308d16a91bc81bde2f3d0da Reviewed-on: http://review.whamcloud.com/21255 Reviewed-by: Andreas Dilger Tested-by: Andreas Dilger Tested-by: Jenkins Tested-by: Maloo --- diff --git a/debugfs/debugfs.c b/debugfs/debugfs.c index 73fedc4..52bb5d1 100644 --- a/debugfs/debugfs.c +++ b/debugfs/debugfs.c @@ -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 diff --git a/debugfs/set_fields.c b/debugfs/set_fields.c index 920f17d..ec19791 100644 --- a/debugfs/set_fields.c +++ b/debugfs/set_fields.c @@ -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 } };