]> www.infradead.org Git - users/hch/xfsprogs.git/commitdiff
xfs: Add the parent pointer support to the superblock version 5.
authorAllison Henderson <allison.henderson@oracle.com>
Tue, 9 Jan 2024 17:41:46 +0000 (09:41 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Wed, 10 Apr 2024 00:21:30 +0000 (17:21 -0700)
Add the parent pointer superblock flag so that we can actually mount
filesystems with this feature enabled.

Signed-off-by: Mark Tinguely <mark.tinguely@oracle.com>
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Allison Henderson <allison.henderson@oracle.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
libfrog/fsgeom.c
libxfs/xfs_format.h
libxfs/xfs_fs.h
libxfs/xfs_sb.c

index 71a8e4bb998084ede1488ea15db75c7fea009f17..597c38b11402505b5eca198bb22e01f80f70f6fc 100644 (file)
@@ -32,6 +32,7 @@ xfs_report_geom(
        int                     inobtcount;
        int                     nrext64;
        int                     exchangerange;
+       int                     parent;
 
        isint = geo->logstart > 0;
        lazycount = geo->flags & XFS_FSOP_GEOM_FLAGS_LAZYSB ? 1 : 0;
@@ -51,6 +52,7 @@ xfs_report_geom(
        inobtcount = geo->flags & XFS_FSOP_GEOM_FLAGS_INOBTCNT ? 1 : 0;
        nrext64 = geo->flags & XFS_FSOP_GEOM_FLAGS_NREXT64 ? 1 : 0;
        exchangerange = geo->flags & XFS_FSOP_GEOM_FLAGS_EXCHANGE_RANGE ? 1 : 0;
+       parent = geo->flags & XFS_FSOP_GEOM_FLAGS_PARENT ? 1 : 0;
 
        printf(_(
 "meta-data=%-22s isize=%-6d agcount=%u, agsize=%u blks\n"
@@ -60,7 +62,7 @@ xfs_report_geom(
 "         =%-22s exchange=%-3u\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, ftype=%d\n"
+"naming   =version %-14u bsize=%-6u ascii-ci=%d, ftype=%d, parent=%d\n"
 "log      =%-22s bsize=%-6d blocks=%u, version=%d\n"
 "         =%-22s sectsz=%-5u sunit=%d blks, lazy-count=%d\n"
 "realtime =%-22s extsz=%-6d blocks=%lld, rtextents=%lld\n"),
@@ -72,7 +74,7 @@ xfs_report_geom(
                "", geo->blocksize, (unsigned long long)geo->datablocks,
                        geo->imaxpct,
                "", geo->sunit, geo->swidth,
-               dirversion, geo->dirblocksize, cimode, ftype_enabled,
+               dirversion, geo->dirblocksize, cimode, ftype_enabled, parent,
                isint ? _("internal log") : logname ? logname : _("external"),
                        geo->blocksize, geo->logblocks, logversion,
                "", geo->logsectsize, geo->logsunit / geo->blocksize, lazycount,
index f1818c54af6f80a3824000f8cf5a4d8c08a42540..b457e457e1f713f1eb691431e06a4fdf84133128 100644 (file)
@@ -374,6 +374,7 @@ xfs_sb_has_ro_compat_feature(
 #define XFS_SB_FEAT_INCOMPAT_NEEDSREPAIR (1 << 4) /* needs xfs_repair */
 #define XFS_SB_FEAT_INCOMPAT_NREXT64   (1 << 5)  /* large extent counters */
 #define XFS_SB_FEAT_INCOMPAT_EXCHRANGE (1 << 6)  /* exchangerange supported */
+#define XFS_SB_FEAT_INCOMPAT_PARENT    (1 << 7)  /* parent pointers */
 #define XFS_SB_FEAT_INCOMPAT_ALL \
                (XFS_SB_FEAT_INCOMPAT_FTYPE | \
                 XFS_SB_FEAT_INCOMPAT_SPINODES | \
index fa28c18e521bf6c2fdc04147ccf948c7bab11d17..90e1d0cc04e4bc56f143f5a33da3025cc4c003c7 100644 (file)
@@ -241,6 +241,8 @@ typedef struct xfs_fsop_resblks {
 #define XFS_FSOP_GEOM_FLAGS_NREXT64    (1 << 23) /* large extent counters */
 #define XFS_FSOP_GEOM_FLAGS_EXCHANGE_RANGE (1 << 24) /* exchange range */
 
+#define XFS_FSOP_GEOM_FLAGS_PARENT     (1U << 30) /* parent pointers */
+
 /*
  * Minimum and maximum sizes need for growth checks.
  *
index 2db43b8056639f90ea8dba67bb7ba2dc682baddb..f45ffd994155867fa9cf7e3a8dd78ffc4ae1ee7a 100644 (file)
@@ -175,6 +175,8 @@ xfs_sb_version_to_features(
                features |= XFS_FEAT_NREXT64;
        if (sbp->sb_features_incompat & XFS_SB_FEAT_INCOMPAT_EXCHRANGE)
                features |= XFS_FEAT_EXCHANGE_RANGE;
+       if (sbp->sb_features_incompat & XFS_SB_FEAT_INCOMPAT_PARENT)
+               features |= XFS_FEAT_PARENT;
 
        return features;
 }
@@ -1251,6 +1253,8 @@ xfs_fs_geometry(
                geo->flags |= XFS_FSOP_GEOM_FLAGS_BIGTIME;
        if (xfs_has_inobtcounts(mp))
                geo->flags |= XFS_FSOP_GEOM_FLAGS_INOBTCNT;
+       if (xfs_has_parent(mp))
+               geo->flags |= XFS_FSOP_GEOM_FLAGS_PARENT;
        if (xfs_has_sector(mp)) {
                geo->flags |= XFS_FSOP_GEOM_FLAGS_SECTOR;
                geo->logsectsize = sbp->sb_logsectsize;