[XFS] sort out opening and closing of the block devices
[linux-2.6-block.git] / fs / xfs / linux-2.6 / xfs_super.h
CommitLineData
1da177e4 1/*
7b718769
NS
2 * Copyright (c) 2000-2005 Silicon Graphics, Inc.
3 * All Rights Reserved.
1da177e4 4 *
7b718769
NS
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
1da177e4
LT
7 * published by the Free Software Foundation.
8 *
7b718769
NS
9 * This program is distributed in the hope that it would be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
1da177e4 13 *
7b718769
NS
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1da177e4
LT
17 */
18#ifndef __XFS_SUPER_H__
19#define __XFS_SUPER_H__
20
a5694255
CH
21#include <linux/exportfs.h>
22
1da177e4
LT
23#ifdef CONFIG_XFS_DMAPI
24# define vfs_insertdmapi(vfs) vfs_insertops(vfsp, &xfs_dmops)
25# define vfs_initdmapi() dmapi_init()
26# define vfs_exitdmapi() dmapi_uninit()
27#else
28# define vfs_insertdmapi(vfs) do { } while (0)
29# define vfs_initdmapi() do { } while (0)
30# define vfs_exitdmapi() do { } while (0)
31#endif
32
33#ifdef CONFIG_XFS_QUOTA
34# define vfs_insertquota(vfs) vfs_insertops(vfsp, &xfs_qmops)
35extern void xfs_qm_init(void);
36extern void xfs_qm_exit(void);
37# define vfs_initquota() xfs_qm_init()
38# define vfs_exitquota() xfs_qm_exit()
39#else
40# define vfs_insertquota(vfs) do { } while (0)
41# define vfs_initquota() do { } while (0)
42# define vfs_exitquota() do { } while (0)
43#endif
44
45#ifdef CONFIG_XFS_POSIX_ACL
46# define XFS_ACL_STRING "ACLs, "
47# define set_posix_acl_flag(sb) ((sb)->s_flags |= MS_POSIXACL)
48#else
49# define XFS_ACL_STRING
50# define set_posix_acl_flag(sb) do { } while (0)
51#endif
52
f7d3c347 53#define XFS_SECURITY_STRING "security attributes, "
1da177e4
LT
54
55#ifdef CONFIG_XFS_RT
56# define XFS_REALTIME_STRING "realtime, "
57#else
58# define XFS_REALTIME_STRING
59#endif
60
61#if XFS_BIG_BLKNOS
62# if XFS_BIG_INUMS
63# define XFS_BIGFS_STRING "large block/inode numbers, "
64# else
65# define XFS_BIGFS_STRING "large block numbers, "
66# endif
67#else
68# define XFS_BIGFS_STRING
69#endif
70
71#ifdef CONFIG_XFS_TRACE
72# define XFS_TRACE_STRING "tracing, "
73#else
74# define XFS_TRACE_STRING
75#endif
76
77#ifdef CONFIG_XFS_DMAPI
78# define XFS_DMAPI_STRING "dmapi support, "
79#else
80# define XFS_DMAPI_STRING
81#endif
82
83#ifdef DEBUG
84# define XFS_DBG_STRING "debug"
85#else
86# define XFS_DBG_STRING "no debug"
87#endif
88
89#define XFS_BUILD_OPTIONS XFS_ACL_STRING \
90 XFS_SECURITY_STRING \
91 XFS_REALTIME_STRING \
92 XFS_BIGFS_STRING \
93 XFS_TRACE_STRING \
94 XFS_DMAPI_STRING \
95 XFS_DBG_STRING /* DBG must be last */
96
1da177e4
LT
97struct xfs_inode;
98struct xfs_mount;
99struct xfs_buftarg;
100struct block_device;
101
102extern __uint64_t xfs_max_file_offset(unsigned int);
103
745f6919
CH
104extern void xfs_initialize_vnode(struct xfs_mount *mp, bhv_vnode_t *vp,
105 struct xfs_inode *ip);
106
1da177e4
LT
107extern void xfs_flush_inode(struct xfs_inode *);
108extern void xfs_flush_device(struct xfs_inode *);
109
f538d4da 110extern void xfs_blkdev_issue_flush(struct xfs_buftarg *);
1da177e4 111
39655164 112extern const struct export_operations xfs_export_operations;
1da177e4 113
b267ce99 114#define XFS_M(sb) ((struct xfs_mount *)((sb)->s_fs_info))
b09cc771 115
1da177e4 116#endif /* __XFS_SUPER_H__ */