From: Darrick J. Wong Date: Wed, 22 Jun 2022 19:28:52 +0000 (-0500) Subject: xfs: move xfs_attr_use_log_assist usage out of libxfs X-Git-Tag: v5.19.0-rc0~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f4ba72b09e303f29cbd52e1ce7ea9cbaf6d89581;p=thirdparty%2Fxfsprogs-dev.git xfs: move xfs_attr_use_log_assist usage out of libxfs Source kernel commit: efc2efeba169ff37bbd425631985064365c614e0 The LARP patchset added an awkward coupling point between libxfs and what would be libxlog, if the XFS log were actually its own library. Move the code that sets up logged xattr updates out of libxfs and into xfs_xattr.c so that libxfs no longer has to know about xlog_* functions. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner Signed-off-by: Eric Sandeen --- diff --git a/libxfs/libxfs_priv.h b/libxfs/libxfs_priv.h index 26fe7eaa1..fcdcfebf6 100644 --- a/libxfs/libxfs_priv.h +++ b/libxfs/libxfs_priv.h @@ -721,8 +721,4 @@ int xfs_bmap_last_extent(struct xfs_trans *tp, struct xfs_inode *ip, /* xfs_inode.h */ #define xfs_iflags_set(ip, flags) do { } while (0) -/* xfs_xattr.c */ -#define xfs_attr_grab_log_assist(mp) (0) -#define xfs_attr_rele_log_assist(mp) ((void) 0) - #endif /* __LIBXFS_INTERNAL_XFS_H__ */ diff --git a/libxfs/xfs_attr.c b/libxfs/xfs_attr.c index 838f2c534..dfd284c6b 100644 --- a/libxfs/xfs_attr.c +++ b/libxfs/xfs_attr.c @@ -980,7 +980,6 @@ xfs_attr_set( int error, local; int rmt_blks = 0; unsigned int total; - bool use_logging = xfs_has_larp(mp); if (xfs_is_shutdown(dp->i_mount)) return -EIO; @@ -1025,12 +1024,6 @@ xfs_attr_set( rmt_blks = xfs_attr3_rmt_blocks(mp, XFS_XATTR_SIZE_MAX); } - if (use_logging) { - error = xfs_attr_grab_log_assist(mp); - if (error) - return error; - } - /* * Root fork attributes can use reserved data blocks for this * operation if necessary @@ -1038,7 +1031,7 @@ xfs_attr_set( xfs_init_attr_trans(args, &tres, &total); error = xfs_trans_alloc_inode(dp, &tres, total, 0, rsvd, &args->trans); if (error) - goto drop_incompat; + return error; if (args->value || xfs_inode_hasattr(dp)) { error = xfs_iext_count_may_overflow(dp, XFS_ATTR_FORK, @@ -1098,9 +1091,6 @@ xfs_attr_set( error = xfs_trans_commit(args->trans); out_unlock: xfs_iunlock(dp, XFS_ILOCK_EXCL); -drop_incompat: - if (use_logging) - xfs_attr_rele_log_assist(mp); return error; out_trans_cancel: