File tree Expand file tree Collapse file tree 6 files changed +67
-45
lines changed
Expand file tree Collapse file tree 6 files changed +67
-45
lines changed Original file line number Diff line number Diff line change 2525#include "xfs_trans_space.h"
2626#include "xfs_trace.h"
2727#include "xfs_attr_item.h"
28- #include "xfs_log .h"
28+ #include "xfs_xattr .h"
2929
3030struct kmem_cache * xfs_attr_intent_cache ;
3131
@@ -1028,7 +1028,7 @@ xfs_attr_set(
10281028 }
10291029
10301030 if (use_logging ) {
1031- error = xfs_attr_use_log_assist (mp );
1031+ error = xfs_attr_grab_log_assist (mp );
10321032 if (error )
10331033 return error ;
10341034 }
@@ -1102,7 +1102,7 @@ xfs_attr_set(
11021102 xfs_iunlock (dp , XFS_ILOCK_EXCL );
11031103drop_incompat :
11041104 if (use_logging )
1105- xlog_drop_incompat_feat (mp -> m_log );
1105+ xfs_attr_rele_log_assist (mp );
11061106 return error ;
11071107
11081108out_trans_cancel :
Original file line number Diff line number Diff line change @@ -3877,44 +3877,3 @@ xlog_drop_incompat_feat(
38773877{
38783878 up_read (& log -> l_incompat_users );
38793879}
3880-
3881- /*
3882- * Get permission to use log-assisted atomic exchange of file extents.
3883- *
3884- * Callers must not be running any transactions or hold any inode locks, and
3885- * they must release the permission by calling xlog_drop_incompat_feat
3886- * when they're done.
3887- */
3888- int
3889- xfs_attr_use_log_assist (
3890- struct xfs_mount * mp )
3891- {
3892- int error = 0 ;
3893-
3894- /*
3895- * Protect ourselves from an idle log clearing the logged xattrs log
3896- * incompat feature bit.
3897- */
3898- xlog_use_incompat_feat (mp -> m_log );
3899-
3900- /*
3901- * If log-assisted xattrs are already enabled, the caller can use the
3902- * log assisted swap functions with the log-incompat reference we got.
3903- */
3904- if (xfs_sb_version_haslogxattrs (& mp -> m_sb ))
3905- return 0 ;
3906-
3907- /* Enable log-assisted xattrs. */
3908- error = xfs_add_incompat_log_feature (mp ,
3909- XFS_SB_FEAT_INCOMPAT_LOG_XATTRS );
3910- if (error )
3911- goto drop_incompat ;
3912-
3913- xfs_warn_mount (mp , XFS_OPSTATE_WARNED_LARP ,
3914- "EXPERIMENTAL logged extended attributes feature in use. Use at your own risk!" );
3915-
3916- return 0 ;
3917- drop_incompat :
3918- xlog_drop_incompat_feat (mp -> m_log );
3919- return error ;
3920- }
Original file line number Diff line number Diff line change 3939#include "xfs_ag.h"
4040#include "xfs_defer.h"
4141#include "xfs_attr_item.h"
42+ #include "xfs_xattr.h"
4243
4344#include <linux/magic.h>
4445#include <linux/fs_context.h>
Original file line number Diff line number Diff line change @@ -91,7 +91,6 @@ extern xfs_agnumber_t xfs_set_inode_alloc(struct xfs_mount *,
9191 xfs_agnumber_t agcount );
9292
9393extern const struct export_operations xfs_export_operations ;
94- extern const struct xattr_handler * xfs_xattr_handlers [];
9594extern const struct quotactl_ops xfs_quotactl_operations ;
9695
9796extern void xfs_reinit_percpu_counters (struct xfs_mount * mp );
Original file line number Diff line number Diff line change 1515#include "xfs_da_btree.h"
1616#include "xfs_attr.h"
1717#include "xfs_acl.h"
18+ #include "xfs_log.h"
19+ #include "xfs_xattr.h"
1820
1921#include <linux/posix_acl_xattr.h>
2022
23+ /*
24+ * Get permission to use log-assisted atomic exchange of file extents.
25+ *
26+ * Callers must not be running any transactions or hold any inode locks, and
27+ * they must release the permission by calling xlog_drop_incompat_feat
28+ * when they're done.
29+ */
30+ int
31+ xfs_attr_grab_log_assist (
32+ struct xfs_mount * mp )
33+ {
34+ int error = 0 ;
35+
36+ /*
37+ * Protect ourselves from an idle log clearing the logged xattrs log
38+ * incompat feature bit.
39+ */
40+ xlog_use_incompat_feat (mp -> m_log );
41+
42+ /*
43+ * If log-assisted xattrs are already enabled, the caller can use the
44+ * log assisted swap functions with the log-incompat reference we got.
45+ */
46+ if (xfs_sb_version_haslogxattrs (& mp -> m_sb ))
47+ return 0 ;
48+
49+ /* Enable log-assisted xattrs. */
50+ error = xfs_add_incompat_log_feature (mp ,
51+ XFS_SB_FEAT_INCOMPAT_LOG_XATTRS );
52+ if (error )
53+ goto drop_incompat ;
54+
55+ xfs_warn_mount (mp , XFS_OPSTATE_WARNED_LARP ,
56+ "EXPERIMENTAL logged extended attributes feature in use. Use at your own risk!" );
57+
58+ return 0 ;
59+ drop_incompat :
60+ xlog_drop_incompat_feat (mp -> m_log );
61+ return error ;
62+ }
63+
64+ void
65+ xfs_attr_rele_log_assist (
66+ struct xfs_mount * mp )
67+ {
68+ xlog_drop_incompat_feat (mp -> m_log );
69+ }
2170
2271static int
2372xfs_xattr_get (const struct xattr_handler * handler , struct dentry * unused ,
Original file line number Diff line number Diff line change 1+ // SPDX-License-Identifier: GPL-2.0
2+ /*
3+ * Copyright (c) 2000-2005 Silicon Graphics, Inc.
4+ * All Rights Reserved.
5+ */
6+ #ifndef __XFS_XATTR_H__
7+ #define __XFS_XATTR_H__
8+
9+ int xfs_attr_grab_log_assist (struct xfs_mount * mp );
10+ void xfs_attr_rele_log_assist (struct xfs_mount * mp );
11+
12+ extern const struct xattr_handler * xfs_xattr_handlers [];
13+
14+ #endif /* __XFS_XATTR_H__ */
You can’t perform that action at this time.
0 commit comments