]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfsprog: add dirent filetype information for xfs_info
authorMark Tinguely <tinguely@sgi.com>
Thu, 17 Oct 2013 15:28:06 +0000 (15:28 +0000)
committerRich Johnston <rjohnston@sgi.com>
Wed, 23 Oct 2013 22:58:01 +0000 (17:58 -0500)
Make xfs_info aware of the directory inode type by using the
XFS_FSOP_GEOM_FLAGS_FTYPE set in the kernel.

Signed-off-by: Mark Tinguely <tinguely@sgi.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
growfs/xfs_growfs.c
include/xfs_fs.h

index cad2b7f7355622c84b4c58fe2c1da62b5fd07bd6..2df68fb852f6db84f3992190fd5a79703f16119c 100644 (file)
@@ -55,7 +55,8 @@ report_info(
        int             attrversion,
        int             projid32bit,
        int             crcs_enabled,
-       int             cimode)
+       int             cimode,
+       int             ftype_enabled)
 {
        printf(_(
            "meta-data=%-22s isize=%-6u agcount=%u, agsize=%u blks\n"
@@ -63,7 +64,7 @@ report_info(
            "         =%-22s crc=%u\n"
            "data     =%-22s bsize=%-6u blocks=%llu, imaxpct=%u\n"
            "         =%-22s sunit=%-6u swidth=%u blks\n"
-           "naming   =version %-14u bsize=%-6u ascii-ci=%d\n"
+           "naming   =version %-14u bsize=%-6u ascii-ci=%d ftype=%d\n"
            "log      =%-22s bsize=%-6u blocks=%u, version=%u\n"
            "         =%-22s sectsz=%-5u sunit=%u blks, lazy-count=%u\n"
            "realtime =%-22s extsz=%-6u blocks=%llu, rtextents=%llu\n"),
@@ -74,7 +75,7 @@ report_info(
                "", geo.blocksize, (unsigned long long)geo.datablocks,
                        geo.imaxpct,
                "", geo.sunit, geo.swidth,
-               dirversion, geo.dirblocksize, cimode,
+               dirversion, geo.dirblocksize, cimode, ftype_enabled,
                isint ? _("internal") : logname ? logname : _("external"),
                        geo.blocksize, geo.logblocks, logversion,
                "", geo.logsectsize, geo.logsunit / geo.blocksize, lazycount,
@@ -121,6 +122,7 @@ main(int argc, char **argv)
        libxfs_init_t           xi;     /* libxfs structure */
        int                     projid32bit;
        int                     crcs_enabled;
+       int                     ftype_enabled = 0;
 
        progname = basename(argv[0]);
        setlocale(LC_ALL, "");
@@ -242,10 +244,12 @@ main(int argc, char **argv)
        ci = geo.flags & XFS_FSOP_GEOM_FLAGS_DIRV2CI ? 1 : 0;
        projid32bit = geo.flags & XFS_FSOP_GEOM_FLAGS_PROJID32 ? 1 : 0;
        crcs_enabled = geo.flags & XFS_FSOP_GEOM_FLAGS_V5SB ? 1 : 0;
+       ftype_enabled = geo.flags & XFS_FSOP_GEOM_FLAGS_FTYPE ? 1 : 0;
        if (nflag) {
                report_info(geo, datadev, isint, logdev, rtdev,
                                lazycount, dirversion, logversion,
-                               attrversion, projid32bit, crcs_enabled, ci);
+                               attrversion, projid32bit, crcs_enabled, ci,
+                               ftype_enabled);
                exit(0);
        }
 
@@ -282,7 +286,7 @@ main(int argc, char **argv)
 
        report_info(geo, datadev, isint, logdev, rtdev,
                        lazycount, dirversion, logversion,
-                       attrversion, projid32bit, crcs_enabled, ci);
+                       attrversion, projid32bit, crcs_enabled, ci, ftype_enabled);
 
        ddsize = xi.dsize;
        dlsize = ( xi.logBBsize? xi.logBBsize :
index 53e33c26f53e062bd86af7a9d07d9455160c87e2..c43ba98c924deedaa31a16a1e8972394da518576 100644 (file)
@@ -233,10 +233,11 @@ typedef struct xfs_fsop_resblks {
 #define XFS_FSOP_GEOM_FLAGS_LOGV2      0x0100  /* log format version 2 */
 #define XFS_FSOP_GEOM_FLAGS_SECTOR     0x0200  /* sector sizes >1BB    */
 #define XFS_FSOP_GEOM_FLAGS_ATTR2      0x0400  /* inline attributes rework */
-#define XFS_FSOP_GEOM_FLAGS_PROJID32   0x0800  /* 32-bit project IDs   */
+#define XFS_FSOP_GEOM_FLAGS_PROJID32   0x0800  /* 32-bit project IDs   */
 #define XFS_FSOP_GEOM_FLAGS_DIRV2CI    0x1000  /* ASCII only CI names  */
 #define XFS_FSOP_GEOM_FLAGS_LAZYSB     0x4000  /* lazy superblock counters */
 #define XFS_FSOP_GEOM_FLAGS_V5SB       0x8000  /* version 5 superblock */
+#define XFS_FSOP_GEOM_FLAGS_FTYPE      0x10000 /* inode directory types */
 
 
 /*