xref: /openbmc/linux/fs/xfs/xfs_super.h (revision c900529f3d9161bfde5cca0754f83b4d3c3e0220)
10b61f8a4SDave Chinner // SPDX-License-Identifier: GPL-2.0
2c59d87c4SChristoph Hellwig /*
3c59d87c4SChristoph Hellwig  * Copyright (c) 2000-2005 Silicon Graphics, Inc.
4c59d87c4SChristoph Hellwig  * All Rights Reserved.
5c59d87c4SChristoph Hellwig  */
6c59d87c4SChristoph Hellwig #ifndef __XFS_SUPER_H__
7c59d87c4SChristoph Hellwig #define __XFS_SUPER_H__
8c59d87c4SChristoph Hellwig 
9c59d87c4SChristoph Hellwig #include <linux/exportfs.h>
10c59d87c4SChristoph Hellwig 
11c59d87c4SChristoph Hellwig #ifdef CONFIG_XFS_QUOTA
12a05931ceSChristoph Hellwig extern int xfs_qm_init(void);
13c59d87c4SChristoph Hellwig extern void xfs_qm_exit(void);
14e5e63404Syu kuai # define XFS_QUOTA_STRING	"quota, "
15c59d87c4SChristoph Hellwig #else
16a05931ceSChristoph Hellwig # define xfs_qm_init()	(0)
17a05931ceSChristoph Hellwig # define xfs_qm_exit()	do { } while (0)
18e5e63404Syu kuai # define XFS_QUOTA_STRING
19c59d87c4SChristoph Hellwig #endif
20c59d87c4SChristoph Hellwig 
21c59d87c4SChristoph Hellwig #ifdef CONFIG_XFS_POSIX_ACL
22c59d87c4SChristoph Hellwig # define XFS_ACL_STRING		"ACLs, "
231751e8a6SLinus Torvalds # define set_posix_acl_flag(sb)	((sb)->s_flags |= SB_POSIXACL)
24c59d87c4SChristoph Hellwig #else
25c59d87c4SChristoph Hellwig # define XFS_ACL_STRING
26c59d87c4SChristoph Hellwig # define set_posix_acl_flag(sb)	do { } while (0)
27c59d87c4SChristoph Hellwig #endif
28c59d87c4SChristoph Hellwig 
29c59d87c4SChristoph Hellwig #define XFS_SECURITY_STRING	"security attributes, "
30c59d87c4SChristoph Hellwig 
31c59d87c4SChristoph Hellwig #ifdef CONFIG_XFS_RT
32c59d87c4SChristoph Hellwig # define XFS_REALTIME_STRING	"realtime, "
33c59d87c4SChristoph Hellwig #else
34c59d87c4SChristoph Hellwig # define XFS_REALTIME_STRING
35c59d87c4SChristoph Hellwig #endif
36c59d87c4SChristoph Hellwig 
37494370ccSEric Sandeen #ifdef CONFIG_XFS_ONLINE_SCRUB
38494370ccSEric Sandeen # define XFS_SCRUB_STRING	"scrub, "
39494370ccSEric Sandeen #else
40494370ccSEric Sandeen # define XFS_SCRUB_STRING
41494370ccSEric Sandeen #endif
42494370ccSEric Sandeen 
43d03a2f1bSEric Sandeen #ifdef CONFIG_XFS_ONLINE_REPAIR
44d03a2f1bSEric Sandeen # define XFS_REPAIR_STRING	"repair, "
45d03a2f1bSEric Sandeen #else
46d03a2f1bSEric Sandeen # define XFS_REPAIR_STRING
47d03a2f1bSEric Sandeen #endif
48d03a2f1bSEric Sandeen 
49d03a2f1bSEric Sandeen #ifdef CONFIG_XFS_WARN
50d03a2f1bSEric Sandeen # define XFS_WARN_STRING	"verbose warnings, "
51d03a2f1bSEric Sandeen #else
52d03a2f1bSEric Sandeen # define XFS_WARN_STRING
53d03a2f1bSEric Sandeen #endif
54d03a2f1bSEric Sandeen 
55e5e63404Syu kuai #ifdef CONFIG_XFS_ASSERT_FATAL
56e5e63404Syu kuai # define XFS_ASSERT_FATAL_STRING	"fatal assert, "
57e5e63404Syu kuai #else
58e5e63404Syu kuai # define XFS_ASSERT_FATAL_STRING
59e5e63404Syu kuai #endif
60e5e63404Syu kuai 
61c59d87c4SChristoph Hellwig #ifdef DEBUG
62c59d87c4SChristoph Hellwig # define XFS_DBG_STRING		"debug"
63c59d87c4SChristoph Hellwig #else
64c59d87c4SChristoph Hellwig # define XFS_DBG_STRING		"no debug"
65c59d87c4SChristoph Hellwig #endif
66c59d87c4SChristoph Hellwig 
67c59d87c4SChristoph Hellwig #define XFS_VERSION_STRING	"SGI XFS"
68c59d87c4SChristoph Hellwig #define XFS_BUILD_OPTIONS	XFS_ACL_STRING \
69c59d87c4SChristoph Hellwig 				XFS_SECURITY_STRING \
70c59d87c4SChristoph Hellwig 				XFS_REALTIME_STRING \
71494370ccSEric Sandeen 				XFS_SCRUB_STRING \
72d03a2f1bSEric Sandeen 				XFS_REPAIR_STRING \
73d03a2f1bSEric Sandeen 				XFS_WARN_STRING \
74e5e63404Syu kuai 				XFS_QUOTA_STRING \
75e5e63404Syu kuai 				XFS_ASSERT_FATAL_STRING \
76c59d87c4SChristoph Hellwig 				XFS_DBG_STRING /* DBG must be last */
77c59d87c4SChristoph Hellwig 
7805a302a1SDarrick J. Wong #ifdef DEBUG
7905a302a1SDarrick J. Wong # define XFS_WQFLAGS(wqflags)	(WQ_SYSFS | (wqflags))
8005a302a1SDarrick J. Wong #else
8105a302a1SDarrick J. Wong # define XFS_WQFLAGS(wqflags)	(wqflags)
8205a302a1SDarrick J. Wong #endif
8305a302a1SDarrick J. Wong 
84c59d87c4SChristoph Hellwig struct xfs_inode;
85c59d87c4SChristoph Hellwig struct xfs_mount;
86c59d87c4SChristoph Hellwig struct xfs_buftarg;
87c59d87c4SChristoph Hellwig struct block_device;
88c59d87c4SChristoph Hellwig 
899aa05000SDave Chinner extern void xfs_flush_inodes(struct xfs_mount *mp);
9012c3f05cSEric Sandeen extern xfs_agnumber_t xfs_set_inode_alloc(struct xfs_mount *,
9112c3f05cSEric Sandeen 					   xfs_agnumber_t agcount);
92c59d87c4SChristoph Hellwig 
93c59d87c4SChristoph Hellwig extern const struct export_operations xfs_export_operations;
94c59d87c4SChristoph Hellwig extern const struct quotactl_ops xfs_quotactl_operations;
956f643c57SShiyang Ruan extern const struct dax_holder_operations xfs_dax_holder_operations;
96c59d87c4SChristoph Hellwig 
975681ca40SDave Chinner extern void xfs_reinit_percpu_counters(struct xfs_mount *mp);
985681ca40SDave Chinner 
994560e78fSChristoph Hellwig extern struct workqueue_struct *xfs_discard_wq;
1004560e78fSChristoph Hellwig 
101c59d87c4SChristoph Hellwig #define XFS_M(sb)		((struct xfs_mount *)((sb)->s_fs_info))
102c59d87c4SChristoph Hellwig 
103*a76dba3bSDarrick J. Wong struct dentry *xfs_debugfs_mkdir(const char *name, struct dentry *parent);
104*a76dba3bSDarrick J. Wong 
105c59d87c4SChristoph Hellwig #endif	/* __XFS_SUPER_H__ */
106