diff options
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_vfs.h')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_vfs.h | 121 |
1 files changed, 2 insertions, 119 deletions
diff --git a/fs/xfs/linux-2.6/xfs_vfs.h b/fs/xfs/linux-2.6/xfs_vfs.h index e63b2d012f0c..04303cb911c7 100644 --- a/fs/xfs/linux-2.6/xfs_vfs.h +++ b/fs/xfs/linux-2.6/xfs_vfs.h | |||
@@ -29,6 +29,7 @@ struct cred; | |||
29 | struct seq_file; | 29 | struct seq_file; |
30 | struct super_block; | 30 | struct super_block; |
31 | struct xfs_inode; | 31 | struct xfs_inode; |
32 | struct xfs_mount; | ||
32 | struct xfs_mount_args; | 33 | struct xfs_mount_args; |
33 | 34 | ||
34 | typedef struct kstatfs bhv_statvfs_t; | 35 | typedef struct kstatfs bhv_statvfs_t; |
@@ -41,10 +42,10 @@ typedef struct bhv_vfs_sync_work { | |||
41 | } bhv_vfs_sync_work_t; | 42 | } bhv_vfs_sync_work_t; |
42 | 43 | ||
43 | typedef struct bhv_vfs { | 44 | typedef struct bhv_vfs { |
45 | struct xfs_mount *vfs_mount; | ||
44 | u_int vfs_flag; /* flags */ | 46 | u_int vfs_flag; /* flags */ |
45 | xfs_fsid_t vfs_fsid; /* file system ID */ | 47 | xfs_fsid_t vfs_fsid; /* file system ID */ |
46 | xfs_fsid_t *vfs_altfsid; /* An ID fixed for life of FS */ | 48 | xfs_fsid_t *vfs_altfsid; /* An ID fixed for life of FS */ |
47 | bhv_head_t vfs_bh; /* head of vfs behavior chain */ | ||
48 | struct super_block *vfs_super; /* generic superblock pointer */ | 49 | struct super_block *vfs_super; /* generic superblock pointer */ |
49 | struct task_struct *vfs_sync_task; /* generalised sync thread */ | 50 | struct task_struct *vfs_sync_task; /* generalised sync thread */ |
50 | bhv_vfs_sync_work_t vfs_sync_work; /* work item for VFS_SYNC */ | 51 | bhv_vfs_sync_work_t vfs_sync_work; /* work item for VFS_SYNC */ |
@@ -54,27 +55,6 @@ typedef struct bhv_vfs { | |||
54 | wait_queue_head_t vfs_wait_single_sync_task; | 55 | wait_queue_head_t vfs_wait_single_sync_task; |
55 | } bhv_vfs_t; | 56 | } bhv_vfs_t; |
56 | 57 | ||
57 | #define bhvtovfs(bdp) ( (struct bhv_vfs *)BHV_VOBJ(bdp) ) | ||
58 | #define bhvtovfsops(bdp) ( (struct bhv_vfsops *)BHV_OPS(bdp) ) | ||
59 | #define VFS_BHVHEAD(vfs) ( &(vfs)->vfs_bh ) | ||
60 | #define VFS_REMOVEBHV(vfs, bdp) ( bhv_remove(VFS_BHVHEAD(vfs), bdp) ) | ||
61 | |||
62 | #define VFS_POSITION_BASE BHV_POSITION_BASE /* chain bottom */ | ||
63 | #define VFS_POSITION_TOP BHV_POSITION_TOP /* chain top */ | ||
64 | #define VFS_POSITION_INVALID BHV_POSITION_INVALID /* invalid pos. num */ | ||
65 | |||
66 | typedef enum { | ||
67 | VFS_BHV_UNKNOWN, /* not specified */ | ||
68 | VFS_BHV_XFS, /* xfs */ | ||
69 | VFS_BHV_QM, /* quota manager */ | ||
70 | VFS_BHV_IO, /* IO path */ | ||
71 | VFS_BHV_END /* housekeeping end-of-range */ | ||
72 | } bhv_vfs_type_t; | ||
73 | |||
74 | #define VFS_POSITION_XFS (BHV_POSITION_BASE) | ||
75 | #define VFS_POSITION_QM (VFS_POSITION_BASE+20) | ||
76 | #define VFS_POSITION_IO (VFS_POSITION_BASE+30) | ||
77 | |||
78 | #define VFS_RDONLY 0x0001 /* read-only vfs */ | 58 | #define VFS_RDONLY 0x0001 /* read-only vfs */ |
79 | #define VFS_GRPID 0x0002 /* group-ID assigned from directory */ | 59 | #define VFS_GRPID 0x0002 /* group-ID assigned from directory */ |
80 | #define VFS_DMI 0x0004 /* filesystem has the DMI enabled */ | 60 | #define VFS_DMI 0x0004 /* filesystem has the DMI enabled */ |
@@ -114,108 +94,11 @@ typedef enum { | |||
114 | #define SHUTDOWN_REMOTE_REQ 0x0010 /* shutdown came from remote cell */ | 94 | #define SHUTDOWN_REMOTE_REQ 0x0010 /* shutdown came from remote cell */ |
115 | #define SHUTDOWN_DEVICE_REQ 0x0020 /* failed all paths to the device */ | 95 | #define SHUTDOWN_DEVICE_REQ 0x0020 /* failed all paths to the device */ |
116 | 96 | ||
117 | typedef int (*vfs_mount_t)(bhv_desc_t *, | ||
118 | struct xfs_mount_args *, struct cred *); | ||
119 | typedef int (*vfs_parseargs_t)(bhv_desc_t *, char *, | ||
120 | struct xfs_mount_args *, int); | ||
121 | typedef int (*vfs_showargs_t)(bhv_desc_t *, struct seq_file *); | ||
122 | typedef int (*vfs_unmount_t)(bhv_desc_t *, int, struct cred *); | ||
123 | typedef int (*vfs_mntupdate_t)(bhv_desc_t *, int *, | ||
124 | struct xfs_mount_args *); | ||
125 | typedef int (*vfs_root_t)(bhv_desc_t *, struct inode **); | ||
126 | typedef int (*vfs_statvfs_t)(bhv_desc_t *, bhv_statvfs_t *, | ||
127 | struct inode *); | ||
128 | typedef int (*vfs_sync_t)(bhv_desc_t *, int, struct cred *); | ||
129 | typedef int (*vfs_vget_t)(bhv_desc_t *, struct inode **, struct fid *); | ||
130 | typedef void (*vfs_init_vnode_t)(bhv_desc_t *, | ||
131 | struct inode *, struct xfs_inode *, int); | ||
132 | typedef void (*vfs_force_shutdown_t)(bhv_desc_t *, int, char *, int); | ||
133 | typedef void (*vfs_freeze_t)(bhv_desc_t *); | ||
134 | |||
135 | typedef struct bhv_vfsops { | ||
136 | bhv_position_t vf_position; /* behavior chain position */ | ||
137 | vfs_mount_t vfs_mount; /* mount file system */ | ||
138 | vfs_parseargs_t vfs_parseargs; /* parse mount options */ | ||
139 | vfs_showargs_t vfs_showargs; /* unparse mount options */ | ||
140 | vfs_unmount_t vfs_unmount; /* unmount file system */ | ||
141 | vfs_mntupdate_t vfs_mntupdate; /* update file system options */ | ||
142 | vfs_root_t vfs_root; /* get root vnode */ | ||
143 | vfs_statvfs_t vfs_statvfs; /* file system statistics */ | ||
144 | vfs_sync_t vfs_sync; /* flush files */ | ||
145 | vfs_vget_t vfs_vget; /* get vnode from fid */ | ||
146 | vfs_init_vnode_t vfs_init_vnode; /* initialize a new vnode */ | ||
147 | vfs_force_shutdown_t vfs_force_shutdown; /* crash and burn */ | ||
148 | vfs_freeze_t vfs_freeze; /* freeze fs for snapshot */ | ||
149 | } bhv_vfsops_t; | ||
150 | |||
151 | /* | ||
152 | * Virtual filesystem operations, operating from head bhv. | ||
153 | */ | ||
154 | #define VFSHEAD(v) ((v)->vfs_bh.bh_first) | ||
155 | #define bhv_vfs_mount(v, ma,cr) vfs_mount(VFSHEAD(v), ma,cr) | ||
156 | #define bhv_vfs_parseargs(v, o,ma,f) vfs_parseargs(VFSHEAD(v), o,ma,f) | ||
157 | #define bhv_vfs_showargs(v, m) vfs_showargs(VFSHEAD(v), m) | ||
158 | #define bhv_vfs_unmount(v, f,cr) vfs_unmount(VFSHEAD(v), f,cr) | ||
159 | #define bhv_vfs_mntupdate(v, fl,args) vfs_mntupdate(VFSHEAD(v), fl,args) | ||
160 | #define bhv_vfs_root(v, vpp) vfs_root(VFSHEAD(v), vpp) | ||
161 | #define bhv_vfs_statvfs(v, sp,vp) vfs_statvfs(VFSHEAD(v), sp,vp) | ||
162 | #define bhv_vfs_sync(v, flag,cr) vfs_sync(VFSHEAD(v), flag,cr) | ||
163 | #define bhv_vfs_vget(v, vpp,fidp) vfs_vget(VFSHEAD(v), vpp,fidp) | ||
164 | #define bhv_vfs_init_vnode(v, vp,b,ul) vfs_init_vnode(VFSHEAD(v), vp,b,ul) | ||
165 | #define bhv_vfs_force_shutdown(v,u,f,l) vfs_force_shutdown(VFSHEAD(v), u,f,l) | ||
166 | #define bhv_vfs_freeze(v) vfs_freeze(VFSHEAD(v)) | ||
167 | |||
168 | /* | ||
169 | * Virtual filesystem operations, operating from next bhv. | ||
170 | */ | ||
171 | #define bhv_next_vfs_mount(b, ma,cr) vfs_mount(b, ma,cr) | ||
172 | #define bhv_next_vfs_parseargs(b, o,ma,f) vfs_parseargs(b, o,ma,f) | ||
173 | #define bhv_next_vfs_showargs(b, m) vfs_showargs(b, m) | ||
174 | #define bhv_next_vfs_unmount(b, f,cr) vfs_unmount(b, f,cr) | ||
175 | #define bhv_next_vfs_mntupdate(b, fl,args) vfs_mntupdate(b, fl, args) | ||
176 | #define bhv_next_vfs_root(b, vpp) vfs_root(b, vpp) | ||
177 | #define bhv_next_vfs_statvfs(b, sp,vp) vfs_statvfs(b, sp,vp) | ||
178 | #define bhv_next_vfs_sync(b, flag,cr) vfs_sync(b, flag,cr) | ||
179 | #define bhv_next_vfs_vget(b, vpp,fidp) vfs_vget(b, vpp,fidp) | ||
180 | #define bhv_next_vfs_init_vnode(b, vp,b2,ul) vfs_init_vnode(b, vp,b2,ul) | ||
181 | #define bhv_next_force_shutdown(b, fl,f,l) vfs_force_shutdown(b, fl,f,l) | ||
182 | #define bhv_next_vfs_freeze(b) vfs_freeze(b) | ||
183 | |||
184 | extern int vfs_mount(bhv_desc_t *, struct xfs_mount_args *, struct cred *); | ||
185 | extern int vfs_parseargs(bhv_desc_t *, char *, struct xfs_mount_args *, int); | ||
186 | extern int vfs_showargs(bhv_desc_t *, struct seq_file *); | ||
187 | extern int vfs_unmount(bhv_desc_t *, int, struct cred *); | ||
188 | extern int vfs_mntupdate(bhv_desc_t *, int *, struct xfs_mount_args *); | ||
189 | extern int vfs_root(bhv_desc_t *, struct inode **); | ||
190 | extern int vfs_statvfs(bhv_desc_t *, bhv_statvfs_t *, struct inode *); | ||
191 | extern int vfs_sync(bhv_desc_t *, int, struct cred *); | ||
192 | extern int vfs_vget(bhv_desc_t *, struct inode **, struct fid *); | ||
193 | extern void vfs_init_vnode(bhv_desc_t *, struct inode *, struct xfs_inode *, int); | ||
194 | extern void vfs_force_shutdown(bhv_desc_t *, int, char *, int); | ||
195 | extern void vfs_freeze(bhv_desc_t *); | ||
196 | |||
197 | #define vfs_test_for_freeze(vfs) ((vfs)->vfs_super->s_frozen) | 97 | #define vfs_test_for_freeze(vfs) ((vfs)->vfs_super->s_frozen) |
198 | #define vfs_wait_for_freeze(vfs,l) vfs_check_frozen((vfs)->vfs_super, (l)) | 98 | #define vfs_wait_for_freeze(vfs,l) vfs_check_frozen((vfs)->vfs_super, (l)) |
199 | 99 | ||
200 | typedef struct bhv_module_vfsops { | ||
201 | struct bhv_vfsops bhv_common; | ||
202 | void * bhv_custom; | ||
203 | } bhv_module_vfsops_t; | ||
204 | |||
205 | #define vfs_bhv_lookup(v, id) (bhv_lookup_range(&(v)->vfs_bh, (id), (id))) | ||
206 | #define vfs_bhv_custom(b) (((bhv_module_vfsops_t*)BHV_OPS(b))->bhv_custom) | ||
207 | #define vfs_bhv_set_custom(b,o) ((b)->bhv_custom = (void *)(o)) | ||
208 | #define vfs_bhv_clr_custom(b) ((b)->bhv_custom = NULL) | ||
209 | |||
210 | extern bhv_vfs_t *vfs_allocate(struct super_block *); | 100 | extern bhv_vfs_t *vfs_allocate(struct super_block *); |
211 | extern bhv_vfs_t *vfs_from_sb(struct super_block *); | 101 | extern bhv_vfs_t *vfs_from_sb(struct super_block *); |
212 | extern void vfs_deallocate(bhv_vfs_t *); | 102 | extern void vfs_deallocate(bhv_vfs_t *); |
213 | extern void vfs_insertbhv(bhv_vfs_t *, bhv_desc_t *, bhv_vfsops_t *, void *); | ||
214 | |||
215 | extern void vfs_insertops(bhv_vfs_t *, bhv_module_vfsops_t *); | ||
216 | |||
217 | extern void bhv_insert_all_vfsops(struct bhv_vfs *); | ||
218 | extern void bhv_remove_all_vfsops(struct bhv_vfs *, int); | ||
219 | extern void bhv_remove_vfsops(struct bhv_vfs *, int); | ||
220 | 103 | ||
221 | #endif /* __XFS_VFS_H__ */ | 104 | #endif /* __XFS_VFS_H__ */ |