diff options
author | Brian Foster <bfoster@redhat.com> | 2014-04-24 02:00:52 -0400 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2014-04-24 02:00:52 -0400 |
commit | 8e2c84df20aa66ae9a6ee32831a9c622f4823118 (patch) | |
tree | 8bd22beb613b809dbf75531b56fbb6c9ad0f6d6a | |
parent | 57bd3dbe4059c6fff7e39927e5aa789dfb2585b9 (diff) |
xfs: reserve v5 superblock read-only compat. feature bit for finobt
Reserve a v5 read-only compatibility feature bit for the finobt and
create the xfs_sb_version_hasfinobt() helper to determine whether
an fs has the feature enabled.
The finobt does not change existing on-disk structures, but must
remain consistent with the ialloc btree. Modifications from older
kernels would violate that constrant. Therefore, we restrict older
kernels to read-only mounts of finobt-enabled filesystems.
Note that this does not yet enable the ability to rw mount a finobt
fs (by setting the feature bit in the XFS_SB_FEAT_RO_COMPAT_ALL
mask).
Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
-rw-r--r-- | fs/xfs/xfs_sb.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/xfs/xfs_sb.h b/fs/xfs/xfs_sb.h index f7b2fe77c5a5..7f53a858e85b 100644 --- a/fs/xfs/xfs_sb.h +++ b/fs/xfs/xfs_sb.h | |||
@@ -587,6 +587,7 @@ xfs_sb_has_compat_feature( | |||
587 | return (sbp->sb_features_compat & feature) != 0; | 587 | return (sbp->sb_features_compat & feature) != 0; |
588 | } | 588 | } |
589 | 589 | ||
590 | #define XFS_SB_FEAT_RO_COMPAT_FINOBT (1 << 0) /* free inode btree */ | ||
590 | #define XFS_SB_FEAT_RO_COMPAT_ALL 0 | 591 | #define XFS_SB_FEAT_RO_COMPAT_ALL 0 |
591 | #define XFS_SB_FEAT_RO_COMPAT_UNKNOWN ~XFS_SB_FEAT_RO_COMPAT_ALL | 592 | #define XFS_SB_FEAT_RO_COMPAT_UNKNOWN ~XFS_SB_FEAT_RO_COMPAT_ALL |
592 | static inline bool | 593 | static inline bool |
@@ -641,6 +642,12 @@ static inline int xfs_sb_version_hasftype(struct xfs_sb *sbp) | |||
641 | (sbp->sb_features2 & XFS_SB_VERSION2_FTYPE)); | 642 | (sbp->sb_features2 & XFS_SB_VERSION2_FTYPE)); |
642 | } | 643 | } |
643 | 644 | ||
645 | static inline int xfs_sb_version_hasfinobt(xfs_sb_t *sbp) | ||
646 | { | ||
647 | return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5) && | ||
648 | (sbp->sb_features_ro_compat & XFS_SB_FEAT_RO_COMPAT_FINOBT); | ||
649 | } | ||
650 | |||
644 | /* | 651 | /* |
645 | * end of superblock version macros | 652 | * end of superblock version macros |
646 | */ | 653 | */ |