diff mbox series

[06/11] xfs: use helpers to extract xattr op from opflags

Message ID 170405005677.1804370.7940866102891604921.stgit@frogsfrogsfrogs (mailing list archive)
State Superseded
Headers show
Series [01/11] xfs: allow newer INCOMPAT/RO_COMPAT feature bits to protect ATTRI log items | expand

Commit Message

Darrick J. Wong Dec. 31, 2023, 11:03 p.m. UTC
From: Darrick J. Wong <djwong@kernel.org>

Create helper functions to extract the xattr op from the ondisk xattri
log item and the incore attr intent item.  These will get more use in
the patches that follow.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 libxfs/xfs_attr.h |    5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/libxfs/xfs_attr.h b/libxfs/xfs_attr.h
index 273e8dff76c..ca51b93873b 100644
--- a/libxfs/xfs_attr.h
+++ b/libxfs/xfs_attr.h
@@ -529,6 +529,11 @@  struct xfs_attr_intent {
 	struct xfs_bmbt_irec		xattri_map;
 };
 
+static inline unsigned int
+xfs_attr_intent_op(const struct xfs_attr_intent *attr)
+{
+	return attr->xattri_op_flags & XFS_ATTRI_OP_FLAGS_TYPE_MASK;
+}
 
 /*========================================================================
  * Function prototypes for the kernel.