[PATCH 21/23] xfs: allow adding multiple log incompat feature bits

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Darrick J. Wong <djwong@xxxxxxxxxx>

Make it so that we can set multiple log incompat feature bits at once.

Signed-off-by: Darrick J. Wong <djwong@xxxxxxxxxx>
---
 .../filesystems/xfs/xfs-online-fsck-design.rst     |    2 +-
 fs/xfs/xfs_exchrange.c                             |    2 +-
 fs/xfs/xfs_mount.c                                 |   13 ++++++-------
 fs/xfs/xfs_mount.h                                 |    2 +-
 fs/xfs/xfs_xattr.c                                 |    2 +-
 5 files changed, 10 insertions(+), 11 deletions(-)


diff --git a/Documentation/filesystems/xfs/xfs-online-fsck-design.rst b/Documentation/filesystems/xfs/xfs-online-fsck-design.rst
index 1b454282ea9cf..f2f8509fa8540 100644
--- a/Documentation/filesystems/xfs/xfs-online-fsck-design.rst
+++ b/Documentation/filesystems/xfs/xfs-online-fsck-design.rst
@@ -4055,7 +4055,7 @@ series.
 | clear the bit; if the lock attempt fails, the feature bit remains set.   |
 | The code supporting a log incompat feature should create wrapper         |
 | functions to obtain the log feature and call                             |
-| ``xfs_add_incompat_log_feature`` to set the feature bits in the primary  |
+| ``xfs_add_incompat_log_features`` to set the feature bits in the primary |
 | superblock.                                                              |
 | The superblock update is performed transactionally, so the wrapper to    |
 | obtain log assistance must be called just prior to the creation of the   |
diff --git a/fs/xfs/xfs_exchrange.c b/fs/xfs/xfs_exchrange.c
index 73eae27a23016..3a68957c72d28 100644
--- a/fs/xfs/xfs_exchrange.c
+++ b/fs/xfs/xfs_exchrange.c
@@ -72,7 +72,7 @@ xfs_exchrange_enable(
 	if (!xfs_exchrange_upgradeable(mp))
 		return -EOPNOTSUPP;
 
-	error = xfs_add_incompat_log_feature(mp,
+	error = xfs_add_incompat_log_features(mp,
 			XFS_SB_FEAT_INCOMPAT_LOG_EXCHMAPS);
 	if (error)
 		return error;
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
index 49d6c6de7b33b..8d56ec1779f26 100644
--- a/fs/xfs/xfs_mount.c
+++ b/fs/xfs/xfs_mount.c
@@ -1305,15 +1305,14 @@ xfs_can_add_incompat_log_features(
  * cannot have any other transactions in progress.
  */
 int
-xfs_add_incompat_log_feature(
+xfs_add_incompat_log_features(
 	struct xfs_mount	*mp,
-	uint32_t		feature)
+	uint32_t		features)
 {
 	struct xfs_dsb		*dsb;
 	int			error;
 
-	ASSERT(hweight32(feature) == 1);
-	ASSERT(!(feature & XFS_SB_FEAT_INCOMPAT_LOG_UNKNOWN));
+	ASSERT(!(features & XFS_SB_FEAT_INCOMPAT_LOG_UNKNOWN));
 
 	/*
 	 * Force the log to disk and kick the background AIL thread to reduce
@@ -1338,7 +1337,7 @@ xfs_add_incompat_log_feature(
 		goto rele;
 	}
 
-	if (xfs_sb_has_incompat_log_feature(&mp->m_sb, feature))
+	if ((mp->m_sb.sb_features_log_incompat & features) == features)
 		goto rele;
 
 	if (!xfs_can_add_incompat_log_features(mp, true)) {
@@ -1353,7 +1352,7 @@ xfs_add_incompat_log_feature(
 	 */
 	dsb = mp->m_sb_bp->b_addr;
 	xfs_sb_to_disk(dsb, &mp->m_sb);
-	dsb->sb_features_log_incompat |= cpu_to_be32(feature);
+	dsb->sb_features_log_incompat |= cpu_to_be32(features);
 	error = xfs_bwrite(mp->m_sb_bp);
 	if (error)
 		goto shutdown;
@@ -1362,7 +1361,7 @@ xfs_add_incompat_log_feature(
 	 * Add the feature bits to the incore superblock before we unlock the
 	 * buffer.
 	 */
-	xfs_sb_add_incompat_log_features(&mp->m_sb, feature);
+	xfs_sb_add_incompat_log_features(&mp->m_sb, features);
 	xfs_buf_relse(mp->m_sb_bp);
 
 	/* Log the superblock to disk. */
diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h
index 0d9f66ac50af2..fc812bad57b84 100644
--- a/fs/xfs/xfs_mount.h
+++ b/fs/xfs/xfs_mount.h
@@ -577,7 +577,7 @@ int	xfs_zero_extent(struct xfs_inode *ip, xfs_fsblock_t start_fsb,
 struct xfs_error_cfg * xfs_error_get_cfg(struct xfs_mount *mp,
 		int error_class, int error);
 void xfs_force_summary_recalc(struct xfs_mount *mp);
-int xfs_add_incompat_log_feature(struct xfs_mount *mp, uint32_t feature);
+int xfs_add_incompat_log_features(struct xfs_mount *mp, uint32_t feature);
 bool xfs_clear_incompat_log_features(struct xfs_mount *mp);
 void xfs_mod_delalloc(struct xfs_mount *mp, int64_t delta);
 
diff --git a/fs/xfs/xfs_xattr.c b/fs/xfs/xfs_xattr.c
index 055283fb147ae..6fb41705a10fb 100644
--- a/fs/xfs/xfs_xattr.c
+++ b/fs/xfs/xfs_xattr.c
@@ -44,7 +44,7 @@ xfs_attr_grab_log_assist(
 		return -EOPNOTSUPP;
 
 	/* Enable log-assisted xattrs. */
-	error = xfs_add_incompat_log_feature(mp,
+	error = xfs_add_incompat_log_features(mp,
 			XFS_SB_FEAT_INCOMPAT_LOG_XATTRS);
 	if (error)
 		return error;





[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux