This commit was manufactured by cvs2svn to create branch 'vserver'.
[linux-2.6.git] / fs / xfs / linux / xfs_super.h
1 /*
2  * Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
3  *
4  * This program is free software; you can redistribute it and/or modify it
5  * under the terms of version 2 of the GNU General Public License as
6  * published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it would be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11  *
12  * Further, this software is distributed without any warranty that it is
13  * free of the rightful claim of any third person regarding infringement
14  * or the like.  Any license provided herein, whether implied or
15  * otherwise, applies only to this software file.  Patent licenses, if
16  * any, provided herein do not apply to combinations of this program with
17  * other software, or any other product whatsoever.
18  *
19  * You should have received a copy of the GNU General Public License along
20  * with this program; if not, write the Free Software Foundation, Inc., 59
21  * Temple Place - Suite 330, Boston MA 02111-1307, USA.
22  *
23  * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
24  * Mountain View, CA  94043, or:
25  *
26  * http://www.sgi.com
27  *
28  * For further information regarding this notice, see:
29  *
30  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
31  */
32 #ifndef __XFS_SUPER_H__
33 #define __XFS_SUPER_H__
34
35 #ifdef CONFIG_XFS_DMAPI
36 # define vfs_insertdmapi(vfs)   vfs_insertops(vfsp, &xfs_dmops)
37 # define vfs_initdmapi()        dmapi_init()
38 # define vfs_exitdmapi()        dmapi_uninit()
39 #else
40 # define vfs_insertdmapi(vfs)   do { } while (0)
41 # define vfs_initdmapi()        do { } while (0)
42 # define vfs_exitdmapi()        do { } while (0)
43 #endif
44
45 #ifdef CONFIG_XFS_QUOTA
46 # define vfs_insertquota(vfs)   vfs_insertops(vfsp, &xfs_qmops)
47 extern void xfs_qm_init(void);
48 extern void xfs_qm_exit(void);
49 # define vfs_initquota()        xfs_qm_init()
50 # define vfs_exitquota()        xfs_qm_exit()
51 #else
52 # define vfs_insertquota(vfs)   do { } while (0)
53 # define vfs_initquota()        do { } while (0)
54 # define vfs_exitquota()        do { } while (0)
55 #endif
56
57 #ifdef CONFIG_XFS_POSIX_ACL
58 # define XFS_ACL_STRING         "ACLs, "
59 # define set_posix_acl_flag(sb) ((sb)->s_flags |= MS_POSIXACL)
60 #else
61 # define XFS_ACL_STRING
62 # define set_posix_acl_flag(sb) do { } while (0)
63 #endif
64
65 #ifdef CONFIG_XFS_SECURITY
66 # define XFS_SECURITY_STRING    "security attributes, "
67 # define ENOSECURITY            0
68 #else
69 # define XFS_SECURITY_STRING
70 # define ENOSECURITY            EOPNOTSUPP
71 #endif
72
73 #ifdef CONFIG_XFS_RT
74 # define XFS_REALTIME_STRING    "realtime, "
75 #else
76 # define XFS_REALTIME_STRING
77 #endif
78
79 #if XFS_BIG_BLKNOS
80 # if XFS_BIG_INUMS
81 #  define XFS_BIGFS_STRING      "large block/inode numbers, "
82 # else
83 #  define XFS_BIGFS_STRING      "large block numbers, "
84 # endif
85 #else
86 # define XFS_BIGFS_STRING
87 #endif
88
89 #ifdef CONFIG_XFS_TRACE
90 # define XFS_TRACE_STRING       "tracing, "
91 #else
92 # define XFS_TRACE_STRING
93 #endif
94
95 #ifdef XFSDEBUG
96 # define XFS_DBG_STRING         "debug"
97 #else
98 # define XFS_DBG_STRING         "no debug"
99 #endif
100
101 #define XFS_BUILD_OPTIONS       XFS_ACL_STRING \
102                                 XFS_SECURITY_STRING \
103                                 XFS_REALTIME_STRING \
104                                 XFS_BIGFS_STRING \
105                                 XFS_TRACE_STRING \
106                                 XFS_DBG_STRING /* DBG must be last */
107
108 #define LINVFS_GET_VFS(s) \
109         (vfs_t *)((s)->s_fs_info)
110 #define LINVFS_SET_VFS(s, vfsp) \
111         ((s)->s_fs_info = vfsp)
112
113 struct xfs_inode;
114 struct xfs_mount;
115 struct xfs_buftarg;
116 struct block_device;
117
118 extern __uint64_t xfs_max_file_offset(unsigned int);
119
120 extern void xfs_initialize_vnode(bhv_desc_t *, vnode_t *, bhv_desc_t *, int);
121
122 extern void xfs_flush_inode(struct xfs_inode *);
123 extern void xfs_flush_device(struct xfs_inode *);
124
125 extern int  xfs_blkdev_get(struct xfs_mount *, const char *,
126                                 struct block_device **);
127 extern void xfs_blkdev_put(struct block_device *);
128
129 #endif  /* __XFS_SUPER_H__ */