OSDN Git Service

debugfs: add support for the project id field
authorTheodore Ts'o <tytso@mit.edu>
Sat, 5 Mar 2016 17:00:41 +0000 (12:00 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 7 Mar 2016 01:08:52 +0000 (20:08 -0500)
Teach the stat and set_inode_field commands to support the project ID
field.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
debugfs/debugfs.c
debugfs/set_fields.c
tests/d_fallocate_blkmap/expect
tests/f_create_symlinks/expect

index 735117e..d5c3e1f 100644 (file)
@@ -826,8 +826,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 29e8996..973afa7 100644 (file)
@@ -231,7 +231,7 @@ static struct field_set_info inode_fields[] = {
                4, parse_time },
        { "crtime_extra", &set_inode.i_crtime_extra, NULL,
                4, parse_uint, FLAG_ALIAS },
-       { "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 }
 };
index a66b06a..8ce79ff 100644 (file)
@@ -17,7 +17,7 @@ debugfs write files
 debugfs: stat /a
 Inode: 12   Type: regular    Mode:  0666   Flags: 0x0
 Generation: 0    Version: 0x00000000:00000000
-User:     0   Group:     0   Size: 40960
+User:     0   Group:     0   Project:     0   Size: 40960
 File ACL: 0    Directory ACL: 0
 Links: 1   Blockcount: 82
 Fragment:  Address: 0    Number: 0    Size: 0
@@ -29,7 +29,7 @@ TOTAL: 41
 debugfs: stat /b
 Inode: 13   Type: regular    Mode:  0666   Flags: 0x0
 Generation: 0    Version: 0x00000000:00000000
-User:     0   Group:     0   Size: 10240000
+User:     0   Group:     0   Project:     0   Size: 10240000
 File ACL: 0    Directory ACL: 0
 Links: 1   Blockcount: 20082
 Fragment:  Address: 0    Number: 0    Size: 0
index 6e1553c..dca6e92 100644 (file)
@@ -19,7 +19,7 @@ symlink: Invalid argument passed to ext2 library
 debugfs -R "stat /l_30" test.img
 Inode: 12   Type: symlink    Mode:  0777   Flags: 0x0
 Generation: 0    Version: 0x00000000:00000000
-User:     0   Group:     0   Size: 31
+User:     0   Group:     0   Project:     0   Size: 31
 File ACL: 0    Directory ACL: 0
 Links: 1   Blockcount: 0
 Fragment:  Address: 0    Number: 0    Size: 0
@@ -28,7 +28,7 @@ Fast link dest: "/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
 debugfs -R "stat /l_70" test.img
 Inode: 13   Type: symlink    Mode:  0777   Flags: 0x10000000
 Generation: 0    Version: 0x00000000:00000000
-User:     0   Group:     0   Size: 71
+User:     0   Group:     0   Project:     0   Size: 71
 File ACL: 0    Directory ACL: 0
 Links: 1   Blockcount: 0
 Fragment:  Address: 0    Number: 0    Size: 0
@@ -39,7 +39,7 @@ Fast link dest: "/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 debugfs -R "stat /l_500" test.img
 Inode: 14   Type: symlink    Mode:  0777   Flags: 0x80000
 Generation: 0    Version: 0x00000000:00000000
-User:     0   Group:     0   Size: 501
+User:     0   Group:     0   Project:     0   Size: 501
 File ACL: 0    Directory ACL: 0
 Links: 1   Blockcount: 2
 Fragment:  Address: 0    Number: 0    Size: 0
@@ -49,7 +49,7 @@ EXTENTS:
 debugfs -R "stat /l_1023" test.img
 Inode: 15   Type: symlink    Mode:  0777   Flags: 0x80000
 Generation: 0    Version: 0x00000000:00000000
-User:     0   Group:     0   Size: 1024
+User:     0   Group:     0   Project:     0   Size: 1024
 File ACL: 0    Directory ACL: 0
 Links: 1   Blockcount: 2
 Fragment:  Address: 0    Number: 0    Size: 0