aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2014-05-19 17:47:05 -0400
committerDave Chinner <david@fromorbit.com>2014-05-19 17:47:05 -0400
commitab3e57b53f549ad51cbdf85e846ca4eaf0f3be30 (patch)
tree49db4b1146fbef41b0a0fa512e4415e2b2527084
parent5d074a4f8005b988c9d48d29250e36ad64083252 (diff)
xfs: remove shared supberlock feature checking
We reject any filesystem that is mounted with this feature bit set, so we don't need to check for it anywhere else. Remove the function for checking if the feature bit is set and any code that uses it. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Jie Liu <jeff.liu@oracle.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
-rw-r--r--fs/xfs/xfs_fsops.c2
-rw-r--r--fs/xfs/xfs_sb.c3
-rw-r--r--fs/xfs/xfs_sb.h17
3 files changed, 6 insertions, 16 deletions
diff --git a/fs/xfs/xfs_fsops.c b/fs/xfs/xfs_fsops.c
index b19b01576944..c31ac96349d2 100644
--- a/fs/xfs/xfs_fsops.c
+++ b/fs/xfs/xfs_fsops.c
@@ -84,8 +84,6 @@ xfs_fs_geometry(
84 XFS_FSOP_GEOM_FLAGS_IALIGN : 0) | 84 XFS_FSOP_GEOM_FLAGS_IALIGN : 0) |
85 (xfs_sb_version_hasdalign(&mp->m_sb) ? 85 (xfs_sb_version_hasdalign(&mp->m_sb) ?
86 XFS_FSOP_GEOM_FLAGS_DALIGN : 0) | 86 XFS_FSOP_GEOM_FLAGS_DALIGN : 0) |
87 (xfs_sb_version_hasshared(&mp->m_sb) ?
88 XFS_FSOP_GEOM_FLAGS_SHARED : 0) |
89 (xfs_sb_version_hasextflgbit(&mp->m_sb) ? 87 (xfs_sb_version_hasextflgbit(&mp->m_sb) ?
90 XFS_FSOP_GEOM_FLAGS_EXTFLG : 0) | 88 XFS_FSOP_GEOM_FLAGS_EXTFLG : 0) |
91 (xfs_sb_version_hassector(&mp->m_sb) ? 89 (xfs_sb_version_hassector(&mp->m_sb) ?
diff --git a/fs/xfs/xfs_sb.c b/fs/xfs/xfs_sb.c
index de16dd558195..c3453b11f563 100644
--- a/fs/xfs/xfs_sb.c
+++ b/fs/xfs/xfs_sb.c
@@ -291,7 +291,8 @@ xfs_mount_validate_sb(
291 (sbp->sb_imax_pct > 100 /* zero sb_imax_pct is valid */) || 291 (sbp->sb_imax_pct > 100 /* zero sb_imax_pct is valid */) ||
292 sbp->sb_dblocks == 0 || 292 sbp->sb_dblocks == 0 ||
293 sbp->sb_dblocks > XFS_MAX_DBLOCKS(sbp) || 293 sbp->sb_dblocks > XFS_MAX_DBLOCKS(sbp) ||
294 sbp->sb_dblocks < XFS_MIN_DBLOCKS(sbp))) { 294 sbp->sb_dblocks < XFS_MIN_DBLOCKS(sbp) ||
295 sbp->sb_shared_vn != 0)) {
295 xfs_notice(mp, "SB sanity check failed"); 296 xfs_notice(mp, "SB sanity check failed");
296 return XFS_ERROR(EFSCORRUPTED); 297 return XFS_ERROR(EFSCORRUPTED);
297 } 298 }
diff --git a/fs/xfs/xfs_sb.h b/fs/xfs/xfs_sb.h
index 822e62819741..86a964cc6925 100644
--- a/fs/xfs/xfs_sb.h
+++ b/fs/xfs/xfs_sb.h
@@ -51,11 +51,12 @@ struct xfs_trans;
51 51
52/* 52/*
53 * Supported feature bit list is just all bits in the versionnum field because 53 * Supported feature bit list is just all bits in the versionnum field because
54 * we've used them all up and understand them all. 54 * we've used them all up and understand them all. Except, of course, for the
55 * shared superblock bit, which nobody knows what it does and so is unsupported.
55 */ 56 */
56#define XFS_SB_VERSION_OKBITS \ 57#define XFS_SB_VERSION_OKBITS \
57 (XFS_SB_VERSION_NUMBITS | \ 58 ((XFS_SB_VERSION_NUMBITS | XFS_SB_VERSION_ALLFBITS) & \
58 XFS_SB_VERSION_ALLFBITS) 59 ~XFS_SB_VERSION_SHAREDBIT)
59 60
60/* 61/*
61 * There are two words to hold XFS "feature" bits: the original 62 * There are two words to hold XFS "feature" bits: the original
@@ -341,10 +342,6 @@ static inline bool xfs_sb_good_v4_features(struct xfs_sb *sbp)
341 (sbp->sb_features2 & ~XFS_SB_VERSION2_OKBITS))) 342 (sbp->sb_features2 & ~XFS_SB_VERSION2_OKBITS)))
342 return false; 343 return false;
343 344
344 /* We don't support shared superblocks - nobody knows what it is */
345 if (sbp->sb_versionnum & XFS_SB_VERSION_SHAREDBIT)
346 return false;
347
348 return true; 345 return true;
349} 346}
350 347
@@ -397,12 +394,6 @@ static inline bool xfs_sb_version_hasdalign(struct xfs_sb *sbp)
397 return (sbp->sb_versionnum & XFS_SB_VERSION_DALIGNBIT); 394 return (sbp->sb_versionnum & XFS_SB_VERSION_DALIGNBIT);
398} 395}
399 396
400static inline bool xfs_sb_version_hasshared(struct xfs_sb *sbp)
401{
402 return XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4 &&
403 (sbp->sb_versionnum & XFS_SB_VERSION_SHAREDBIT);
404}
405
406static inline bool xfs_sb_version_haslogv2(struct xfs_sb *sbp) 397static inline bool xfs_sb_version_haslogv2(struct xfs_sb *sbp)
407{ 398{
408 return XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5 || 399 return XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5 ||