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 25
25
#include "xfs_trans_space.h"
26
26
#include "xfs_trace.h"
27
27
#include "xfs_attr_item.h"
28
- #include "xfs_log .h"
28
+ #include "xfs_xattr .h"
29
29
30
30
struct kmem_cache * xfs_attr_intent_cache ;
31
31
@@ -1028,7 +1028,7 @@ xfs_attr_set(
1028
1028
}
1029
1029
1030
1030
if (use_logging ) {
1031
- error = xfs_attr_use_log_assist (mp );
1031
+ error = xfs_attr_grab_log_assist (mp );
1032
1032
if (error )
1033
1033
return error ;
1034
1034
}
@@ -1102,7 +1102,7 @@ xfs_attr_set(
1102
1102
xfs_iunlock (dp , XFS_ILOCK_EXCL );
1103
1103
drop_incompat :
1104
1104
if (use_logging )
1105
- xlog_drop_incompat_feat (mp -> m_log );
1105
+ xfs_attr_rele_log_assist (mp );
1106
1106
return error ;
1107
1107
1108
1108
out_trans_cancel :
Original file line number Diff line number Diff line change @@ -3877,44 +3877,3 @@ xlog_drop_incompat_feat(
3877
3877
{
3878
3878
up_read (& log -> l_incompat_users );
3879
3879
}
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 39
39
#include "xfs_ag.h"
40
40
#include "xfs_defer.h"
41
41
#include "xfs_attr_item.h"
42
+ #include "xfs_xattr.h"
42
43
43
44
#include <linux/magic.h>
44
45
#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 *,
91
91
xfs_agnumber_t agcount );
92
92
93
93
extern const struct export_operations xfs_export_operations ;
94
- extern const struct xattr_handler * xfs_xattr_handlers [];
95
94
extern const struct quotactl_ops xfs_quotactl_operations ;
96
95
97
96
extern void xfs_reinit_percpu_counters (struct xfs_mount * mp );
Original file line number Diff line number Diff line change 15
15
#include "xfs_da_btree.h"
16
16
#include "xfs_attr.h"
17
17
#include "xfs_acl.h"
18
+ #include "xfs_log.h"
19
+ #include "xfs_xattr.h"
18
20
19
21
#include <linux/posix_acl_xattr.h>
20
22
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
+ }
21
70
22
71
static int
23
72
xfs_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