blob: 167d23f92ffe5aff8c98e4a0012b09846140bc61 [file] [log] [blame]
Dave Chinner0b61f8a2018-06-05 19:42:14 -07001// SPDX-License-Identifier: GPL-2.0
Linus Torvalds1da177e2005-04-16 15:20:36 -07002/*
Nathan Scott7b718762005-11-02 14:58:39 +11003 * Copyright (c) 2000-2005 Silicon Graphics, Inc.
4 * All Rights Reserved.
Linus Torvalds1da177e2005-04-16 15:20:36 -07005 */
6#ifndef __XFS_SUPER_H__
7#define __XFS_SUPER_H__
8
Christoph Hellwiga5694252007-07-17 04:04:28 -07009#include <linux/exportfs.h>
10
Linus Torvalds1da177e2005-04-16 15:20:36 -070011#ifdef CONFIG_XFS_QUOTA
Christoph Hellwiga05931c2012-03-13 08:52:37 +000012extern int xfs_qm_init(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -070013extern void xfs_qm_exit(void);
yu kuaie5e63402019-10-14 10:34:32 -070014# define XFS_QUOTA_STRING "quota, "
Linus Torvalds1da177e2005-04-16 15:20:36 -070015#else
Christoph Hellwiga05931c2012-03-13 08:52:37 +000016# define xfs_qm_init() (0)
17# define xfs_qm_exit() do { } while (0)
yu kuaie5e63402019-10-14 10:34:32 -070018# define XFS_QUOTA_STRING
Linus Torvalds1da177e2005-04-16 15:20:36 -070019#endif
20
21#ifdef CONFIG_XFS_POSIX_ACL
22# define XFS_ACL_STRING "ACLs, "
Linus Torvalds1751e8a2017-11-27 13:05:09 -080023# define set_posix_acl_flag(sb) ((sb)->s_flags |= SB_POSIXACL)
Linus Torvalds1da177e2005-04-16 15:20:36 -070024#else
25# define XFS_ACL_STRING
26# define set_posix_acl_flag(sb) do { } while (0)
27#endif
28
Eric Sandeenf7d3c342008-04-17 16:50:22 +100029#define XFS_SECURITY_STRING "security attributes, "
Linus Torvalds1da177e2005-04-16 15:20:36 -070030
31#ifdef CONFIG_XFS_RT
32# define XFS_REALTIME_STRING "realtime, "
33#else
34# define XFS_REALTIME_STRING
35#endif
36
Eric Sandeen494370c2018-01-31 11:31:10 -080037#ifdef CONFIG_XFS_ONLINE_SCRUB
38# define XFS_SCRUB_STRING "scrub, "
39#else
40# define XFS_SCRUB_STRING
41#endif
42
Eric Sandeend03a2f12019-06-05 11:19:48 -070043#ifdef CONFIG_XFS_ONLINE_REPAIR
44# define XFS_REPAIR_STRING "repair, "
45#else
46# define XFS_REPAIR_STRING
47#endif
48
49#ifdef CONFIG_XFS_WARN
50# define XFS_WARN_STRING "verbose warnings, "
51#else
52# define XFS_WARN_STRING
53#endif
54
yu kuaie5e63402019-10-14 10:34:32 -070055#ifdef CONFIG_XFS_ASSERT_FATAL
56# define XFS_ASSERT_FATAL_STRING "fatal assert, "
57#else
58# define XFS_ASSERT_FATAL_STRING
59#endif
60
Linus Torvalds1da177e2005-04-16 15:20:36 -070061#ifdef DEBUG
62# define XFS_DBG_STRING "debug"
63#else
64# define XFS_DBG_STRING "no debug"
65#endif
66
Christoph Hellwig668332e2010-10-06 18:41:15 +000067#define XFS_VERSION_STRING "SGI XFS"
Linus Torvalds1da177e2005-04-16 15:20:36 -070068#define XFS_BUILD_OPTIONS XFS_ACL_STRING \
69 XFS_SECURITY_STRING \
70 XFS_REALTIME_STRING \
Eric Sandeen494370c2018-01-31 11:31:10 -080071 XFS_SCRUB_STRING \
Eric Sandeend03a2f12019-06-05 11:19:48 -070072 XFS_REPAIR_STRING \
73 XFS_WARN_STRING \
yu kuaie5e63402019-10-14 10:34:32 -070074 XFS_QUOTA_STRING \
75 XFS_ASSERT_FATAL_STRING \
Linus Torvalds1da177e2005-04-16 15:20:36 -070076 XFS_DBG_STRING /* DBG must be last */
77
Darrick J. Wong05a302a2021-01-22 16:48:42 -080078#ifdef DEBUG
79# define XFS_WQFLAGS(wqflags) (WQ_SYSFS | (wqflags))
80#else
81# define XFS_WQFLAGS(wqflags) (wqflags)
82#endif
83
Linus Torvalds1da177e2005-04-16 15:20:36 -070084struct xfs_inode;
85struct xfs_mount;
86struct xfs_buftarg;
87struct block_device;
88
Dave Chinner9aa05002012-10-08 21:56:04 +110089extern void xfs_flush_inodes(struct xfs_mount *mp);
Eric Sandeen12c3f052016-03-02 09:58:09 +110090extern xfs_agnumber_t xfs_set_inode_alloc(struct xfs_mount *,
91 xfs_agnumber_t agcount);
Linus Torvalds1da177e2005-04-16 15:20:36 -070092
Christoph Hellwig39655162007-10-21 16:42:17 -070093extern const struct export_operations xfs_export_operations;
Stephen Hemminger46e58762010-05-13 17:53:20 -070094extern const struct xattr_handler *xfs_xattr_handlers[];
Alexey Dobriyan0d54b212009-09-21 17:01:09 -070095extern const struct quotactl_ops xfs_quotactl_operations;
Linus Torvalds1da177e2005-04-16 15:20:36 -070096
Dave Chinner5681ca42015-02-23 21:22:31 +110097extern void xfs_reinit_percpu_counters(struct xfs_mount *mp);
98
Christoph Hellwig4560e782017-02-07 14:07:58 -080099extern struct workqueue_struct *xfs_discard_wq;
100
Christoph Hellwigb267ce92007-08-30 17:21:30 +1000101#define XFS_M(sb) ((struct xfs_mount *)((sb)->s_fs_info))
Christoph Hellwigb09cc772007-08-30 17:19:57 +1000102
Linus Torvalds1da177e2005-04-16 15:20:36 -0700103#endif /* __XFS_SUPER_H__ */