diff options
author | Christoph Hellwig <hch@infradead.org> | 2007-08-28 20:58:01 -0400 |
---|---|---|
committer | Tim Shimmin <tes@chook.melbourne.sgi.com> | 2007-10-15 20:40:00 -0400 |
commit | 739bfb2a7dfa369324f74aad1d020d6e0775e4f0 (patch) | |
tree | 8fbe3e739e0d550137e3f148a36ce5c083f5ef2c /fs/xfs/linux-2.6/xfs_vnode.h | |
parent | 993386c19afa53fa54d00c7721e56ba820b3400d (diff) |
[XFS] call common xfs vnode-level helpers directly and remove vnode operations
SGI-PV: 969608
SGI-Modid: xfs-linux-melb:xfs-kern:29493a
Signed-off-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_vnode.h')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_vnode.h | 217 |
1 files changed, 1 insertions, 216 deletions
diff --git a/fs/xfs/linux-2.6/xfs_vnode.h b/fs/xfs/linux-2.6/xfs_vnode.h index bddbdb904234..5abcbd198d73 100644 --- a/fs/xfs/linux-2.6/xfs_vnode.h +++ b/fs/xfs/linux-2.6/xfs_vnode.h | |||
@@ -41,7 +41,6 @@ typedef struct bhv_vnode { | |||
41 | bhv_vflags_t v_flag; /* vnode flags (see above) */ | 41 | bhv_vflags_t v_flag; /* vnode flags (see above) */ |
42 | bhv_vfs_t *v_vfsp; /* ptr to containing VFS */ | 42 | bhv_vfs_t *v_vfsp; /* ptr to containing VFS */ |
43 | bhv_vnumber_t v_number; /* in-core vnode number */ | 43 | bhv_vnumber_t v_number; /* in-core vnode number */ |
44 | bhv_head_t v_bh; /* behavior head */ | ||
45 | spinlock_t v_lock; /* VN_LOCK/VN_UNLOCK */ | 44 | spinlock_t v_lock; /* VN_LOCK/VN_UNLOCK */ |
46 | atomic_t v_iocount; /* outstanding I/O count */ | 45 | atomic_t v_iocount; /* outstanding I/O count */ |
47 | #ifdef XFS_VNODE_TRACE | 46 | #ifdef XFS_VNODE_TRACE |
@@ -57,34 +56,6 @@ typedef struct bhv_vnode { | |||
57 | #define VN_ISCHR(vp) S_ISCHR((vp)->v_inode.i_mode) | 56 | #define VN_ISCHR(vp) S_ISCHR((vp)->v_inode.i_mode) |
58 | #define VN_ISBLK(vp) S_ISBLK((vp)->v_inode.i_mode) | 57 | #define VN_ISBLK(vp) S_ISBLK((vp)->v_inode.i_mode) |
59 | 58 | ||
60 | #define VNODE_POSITION_BASE BHV_POSITION_BASE /* chain bottom */ | ||
61 | #define VNODE_POSITION_TOP BHV_POSITION_TOP /* chain top */ | ||
62 | #define VNODE_POSITION_INVALID BHV_POSITION_INVALID /* invalid pos. num */ | ||
63 | |||
64 | typedef enum { | ||
65 | VN_BHV_UNKNOWN, /* not specified */ | ||
66 | VN_BHV_XFS, /* xfs */ | ||
67 | VN_BHV_DM, /* data migration */ | ||
68 | VN_BHV_QM, /* quota manager */ | ||
69 | VN_BHV_IO, /* IO path */ | ||
70 | VN_BHV_END /* housekeeping end-of-range */ | ||
71 | } vn_bhv_t; | ||
72 | |||
73 | #define VNODE_POSITION_XFS (VNODE_POSITION_BASE) | ||
74 | #define VNODE_POSITION_DM (VNODE_POSITION_BASE+10) | ||
75 | #define VNODE_POSITION_QM (VNODE_POSITION_BASE+20) | ||
76 | #define VNODE_POSITION_IO (VNODE_POSITION_BASE+30) | ||
77 | |||
78 | /* | ||
79 | * Macros for dealing with the behavior descriptor inside of the vnode. | ||
80 | */ | ||
81 | #define BHV_TO_VNODE(bdp) ((bhv_vnode_t *)BHV_VOBJ(bdp)) | ||
82 | #define BHV_TO_VNODE_NULL(bdp) ((bhv_vnode_t *)BHV_VOBJNULL(bdp)) | ||
83 | |||
84 | #define VN_BHV_HEAD(vp) ((bhv_head_t *)(&((vp)->v_bh))) | ||
85 | #define vn_bhv_head_init(bhp,name) bhv_head_init(bhp,name) | ||
86 | #define vn_bhv_remove(bhp,bdp) bhv_remove(bhp,bdp) | ||
87 | |||
88 | /* | 59 | /* |
89 | * Vnode to Linux inode mapping. | 60 | * Vnode to Linux inode mapping. |
90 | */ | 61 | */ |
@@ -110,7 +81,7 @@ typedef enum bhv_vrwlock { | |||
110 | } bhv_vrwlock_t; | 81 | } bhv_vrwlock_t; |
111 | 82 | ||
112 | /* | 83 | /* |
113 | * Return values for bhv_vop_inactive. A return value of | 84 | * Return values for xfs_inactive. A return value of |
114 | * VN_INACTIVE_NOCACHE implies that the file system behavior | 85 | * VN_INACTIVE_NOCACHE implies that the file system behavior |
115 | * has disassociated its state and bhv_desc_t from the vnode. | 86 | * has disassociated its state and bhv_desc_t from the vnode. |
116 | */ | 87 | */ |
@@ -118,192 +89,6 @@ typedef enum bhv_vrwlock { | |||
118 | #define VN_INACTIVE_NOCACHE 1 | 89 | #define VN_INACTIVE_NOCACHE 1 |
119 | 90 | ||
120 | /* | 91 | /* |
121 | * Values for the cmd code given to vop_vnode_change. | ||
122 | */ | ||
123 | typedef enum bhv_vchange { | ||
124 | VCHANGE_FLAGS_FRLOCKS = 0, | ||
125 | VCHANGE_FLAGS_ENF_LOCKING = 1, | ||
126 | VCHANGE_FLAGS_TRUNCATED = 2, | ||
127 | VCHANGE_FLAGS_PAGE_DIRTY = 3, | ||
128 | VCHANGE_FLAGS_IOEXCL_COUNT = 4 | ||
129 | } bhv_vchange_t; | ||
130 | |||
131 | typedef int (*vop_open_t)(bhv_desc_t *, struct cred *); | ||
132 | typedef ssize_t (*vop_read_t)(bhv_desc_t *, struct kiocb *, | ||
133 | const struct iovec *, unsigned int, | ||
134 | loff_t *, int, struct cred *); | ||
135 | typedef ssize_t (*vop_write_t)(bhv_desc_t *, struct kiocb *, | ||
136 | const struct iovec *, unsigned int, | ||
137 | loff_t *, int, struct cred *); | ||
138 | typedef ssize_t (*vop_splice_read_t)(bhv_desc_t *, struct file *, loff_t *, | ||
139 | struct pipe_inode_info *, size_t, int, int, | ||
140 | struct cred *); | ||
141 | typedef ssize_t (*vop_splice_write_t)(bhv_desc_t *, struct pipe_inode_info *, | ||
142 | struct file *, loff_t *, size_t, int, int, | ||
143 | struct cred *); | ||
144 | typedef int (*vop_ioctl_t)(bhv_desc_t *, struct inode *, struct file *, | ||
145 | int, unsigned int, void __user *); | ||
146 | typedef int (*vop_getattr_t)(bhv_desc_t *, struct bhv_vattr *, int, | ||
147 | struct cred *); | ||
148 | typedef int (*vop_setattr_t)(bhv_desc_t *, struct bhv_vattr *, int, | ||
149 | struct cred *); | ||
150 | typedef int (*vop_access_t)(bhv_desc_t *, int, struct cred *); | ||
151 | typedef int (*vop_lookup_t)(bhv_desc_t *, bhv_vname_t *, bhv_vnode_t **, | ||
152 | int, bhv_vnode_t *, struct cred *); | ||
153 | typedef int (*vop_create_t)(bhv_desc_t *, bhv_vname_t *, struct bhv_vattr *, | ||
154 | bhv_vnode_t **, struct cred *); | ||
155 | typedef int (*vop_remove_t)(bhv_desc_t *, bhv_vname_t *, struct cred *); | ||
156 | typedef int (*vop_link_t)(bhv_desc_t *, bhv_vnode_t *, bhv_vname_t *, | ||
157 | struct cred *); | ||
158 | typedef int (*vop_rename_t)(bhv_desc_t *, bhv_vname_t *, bhv_vnode_t *, | ||
159 | bhv_vname_t *, struct cred *); | ||
160 | typedef int (*vop_mkdir_t)(bhv_desc_t *, bhv_vname_t *, struct bhv_vattr *, | ||
161 | bhv_vnode_t **, struct cred *); | ||
162 | typedef int (*vop_rmdir_t)(bhv_desc_t *, bhv_vname_t *, struct cred *); | ||
163 | typedef int (*vop_readdir_t)(bhv_desc_t *, void *dirent, size_t bufsize, | ||
164 | xfs_off_t *offset, filldir_t filldir); | ||
165 | typedef int (*vop_symlink_t)(bhv_desc_t *, bhv_vname_t *, struct bhv_vattr*, | ||
166 | char *, bhv_vnode_t **, struct cred *); | ||
167 | typedef int (*vop_readlink_t)(bhv_desc_t *, char *); | ||
168 | typedef int (*vop_fsync_t)(bhv_desc_t *, int, struct cred *, | ||
169 | xfs_off_t, xfs_off_t); | ||
170 | typedef int (*vop_inactive_t)(bhv_desc_t *, struct cred *); | ||
171 | typedef int (*vop_fid2_t)(bhv_desc_t *, struct fid *); | ||
172 | typedef int (*vop_release_t)(bhv_desc_t *); | ||
173 | typedef int (*vop_rwlock_t)(bhv_desc_t *, bhv_vrwlock_t); | ||
174 | typedef void (*vop_rwunlock_t)(bhv_desc_t *, bhv_vrwlock_t); | ||
175 | typedef int (*vop_bmap_t)(bhv_desc_t *, xfs_off_t, ssize_t, int, | ||
176 | struct xfs_iomap *, int *); | ||
177 | typedef int (*vop_reclaim_t)(bhv_desc_t *); | ||
178 | typedef int (*vop_attr_get_t)(bhv_desc_t *, const char *, char *, int *, | ||
179 | int, struct cred *); | ||
180 | typedef int (*vop_attr_set_t)(bhv_desc_t *, const char *, char *, int, | ||
181 | int, struct cred *); | ||
182 | typedef int (*vop_attr_remove_t)(bhv_desc_t *, const char *, | ||
183 | int, struct cred *); | ||
184 | typedef int (*vop_attr_list_t)(bhv_desc_t *, char *, int, int, | ||
185 | struct attrlist_cursor_kern *, struct cred *); | ||
186 | typedef void (*vop_link_removed_t)(bhv_desc_t *, bhv_vnode_t *, int); | ||
187 | typedef void (*vop_vnode_change_t)(bhv_desc_t *, bhv_vchange_t, __psint_t); | ||
188 | typedef void (*vop_ptossvp_t)(bhv_desc_t *, xfs_off_t, xfs_off_t, int); | ||
189 | typedef int (*vop_pflushinvalvp_t)(bhv_desc_t *, xfs_off_t, xfs_off_t, int); | ||
190 | typedef int (*vop_pflushvp_t)(bhv_desc_t *, xfs_off_t, xfs_off_t, | ||
191 | uint64_t, int); | ||
192 | typedef int (*vop_iflush_t)(bhv_desc_t *, int); | ||
193 | |||
194 | |||
195 | typedef struct bhv_vnodeops { | ||
196 | bhv_position_t vn_position; /* position within behavior chain */ | ||
197 | vop_open_t vop_open; | ||
198 | vop_read_t vop_read; | ||
199 | vop_write_t vop_write; | ||
200 | vop_splice_read_t vop_splice_read; | ||
201 | vop_splice_write_t vop_splice_write; | ||
202 | vop_ioctl_t vop_ioctl; | ||
203 | vop_getattr_t vop_getattr; | ||
204 | vop_setattr_t vop_setattr; | ||
205 | vop_access_t vop_access; | ||
206 | vop_lookup_t vop_lookup; | ||
207 | vop_create_t vop_create; | ||
208 | vop_remove_t vop_remove; | ||
209 | vop_link_t vop_link; | ||
210 | vop_rename_t vop_rename; | ||
211 | vop_mkdir_t vop_mkdir; | ||
212 | vop_rmdir_t vop_rmdir; | ||
213 | vop_readdir_t vop_readdir; | ||
214 | vop_symlink_t vop_symlink; | ||
215 | vop_readlink_t vop_readlink; | ||
216 | vop_fsync_t vop_fsync; | ||
217 | vop_inactive_t vop_inactive; | ||
218 | vop_fid2_t vop_fid2; | ||
219 | vop_rwlock_t vop_rwlock; | ||
220 | vop_rwunlock_t vop_rwunlock; | ||
221 | vop_bmap_t vop_bmap; | ||
222 | vop_reclaim_t vop_reclaim; | ||
223 | vop_attr_get_t vop_attr_get; | ||
224 | vop_attr_set_t vop_attr_set; | ||
225 | vop_attr_remove_t vop_attr_remove; | ||
226 | vop_attr_list_t vop_attr_list; | ||
227 | vop_link_removed_t vop_link_removed; | ||
228 | vop_vnode_change_t vop_vnode_change; | ||
229 | vop_ptossvp_t vop_tosspages; | ||
230 | vop_pflushinvalvp_t vop_flushinval_pages; | ||
231 | vop_pflushvp_t vop_flush_pages; | ||
232 | vop_release_t vop_release; | ||
233 | vop_iflush_t vop_iflush; | ||
234 | } bhv_vnodeops_t; | ||
235 | |||
236 | /* | ||
237 | * Virtual node operations, operating from head bhv. | ||
238 | */ | ||
239 | #define VNHEAD(vp) ((vp)->v_bh.bh_first) | ||
240 | #define VOP(op, vp) (*((bhv_vnodeops_t *)VNHEAD(vp)->bd_ops)->op) | ||
241 | #define bhv_vop_open(vp, cr) VOP(vop_open, vp)(VNHEAD(vp),cr) | ||
242 | #define bhv_vop_read(vp,file,iov,segs,offset,ioflags,cr) \ | ||
243 | VOP(vop_read, vp)(VNHEAD(vp),file,iov,segs,offset,ioflags,cr) | ||
244 | #define bhv_vop_write(vp,file,iov,segs,offset,ioflags,cr) \ | ||
245 | VOP(vop_write, vp)(VNHEAD(vp),file,iov,segs,offset,ioflags,cr) | ||
246 | #define bhv_vop_splice_read(vp,f,o,pipe,cnt,fl,iofl,cr) \ | ||
247 | VOP(vop_splice_read, vp)(VNHEAD(vp),f,o,pipe,cnt,fl,iofl,cr) | ||
248 | #define bhv_vop_splice_write(vp,f,o,pipe,cnt,fl,iofl,cr) \ | ||
249 | VOP(vop_splice_write, vp)(VNHEAD(vp),f,o,pipe,cnt,fl,iofl,cr) | ||
250 | #define bhv_vop_bmap(vp,of,sz,rw,b,n) \ | ||
251 | VOP(vop_bmap, vp)(VNHEAD(vp),of,sz,rw,b,n) | ||
252 | #define bhv_vop_getattr(vp, vap,f,cr) \ | ||
253 | VOP(vop_getattr, vp)(VNHEAD(vp), vap,f,cr) | ||
254 | #define bhv_vop_setattr(vp, vap,f,cr) \ | ||
255 | VOP(vop_setattr, vp)(VNHEAD(vp), vap,f,cr) | ||
256 | #define bhv_vop_access(vp, mode,cr) VOP(vop_access, vp)(VNHEAD(vp), mode,cr) | ||
257 | #define bhv_vop_lookup(vp,d,vpp,f,rdir,cr) \ | ||
258 | VOP(vop_lookup, vp)(VNHEAD(vp),d,vpp,f,rdir,cr) | ||
259 | #define bhv_vop_create(dvp,d,vap,vpp,cr) \ | ||
260 | VOP(vop_create, dvp)(VNHEAD(dvp),d,vap,vpp,cr) | ||
261 | #define bhv_vop_remove(dvp,d,cr) VOP(vop_remove, dvp)(VNHEAD(dvp),d,cr) | ||
262 | #define bhv_vop_link(dvp,fvp,d,cr) VOP(vop_link, dvp)(VNHEAD(dvp),fvp,d,cr) | ||
263 | #define bhv_vop_rename(fvp,fnm,tdvp,tnm,cr) \ | ||
264 | VOP(vop_rename, fvp)(VNHEAD(fvp),fnm,tdvp,tnm,cr) | ||
265 | #define bhv_vop_mkdir(dp,d,vap,vpp,cr) \ | ||
266 | VOP(vop_mkdir, dp)(VNHEAD(dp),d,vap,vpp,cr) | ||
267 | #define bhv_vop_rmdir(dp,d,cr) VOP(vop_rmdir, dp)(VNHEAD(dp),d,cr) | ||
268 | #define bhv_vop_readdir(vp,dirent,bufsize,offset,filldir) \ | ||
269 | VOP(vop_readdir, vp)(VNHEAD(vp),dirent,bufsize,offset,filldir) | ||
270 | #define bhv_vop_symlink(dvp,d,vap,tnm,vpp,cr) \ | ||
271 | VOP(vop_symlink, dvp)(VNHEAD(dvp),d,vap,tnm,vpp,cr) | ||
272 | #define bhv_vop_readlink(vp,link) \ | ||
273 | VOP(vop_readlink, vp)(VNHEAD(vp), link) | ||
274 | #define bhv_vop_fsync(vp,f,cr,b,e) VOP(vop_fsync, vp)(VNHEAD(vp),f,cr,b,e) | ||
275 | #define bhv_vop_inactive(vp,cr) VOP(vop_inactive, vp)(VNHEAD(vp),cr) | ||
276 | #define bhv_vop_release(vp) VOP(vop_release, vp)(VNHEAD(vp)) | ||
277 | #define bhv_vop_fid2(vp,fidp) VOP(vop_fid2, vp)(VNHEAD(vp),fidp) | ||
278 | #define bhv_vop_rwlock(vp,i) VOP(vop_rwlock, vp)(VNHEAD(vp),i) | ||
279 | #define bhv_vop_rwlock_try(vp,i) VOP(vop_rwlock, vp)(VNHEAD(vp),i) | ||
280 | #define bhv_vop_rwunlock(vp,i) VOP(vop_rwunlock, vp)(VNHEAD(vp),i) | ||
281 | #define bhv_vop_frlock(vp,c,fl,flags,offset,fr) \ | ||
282 | VOP(vop_frlock, vp)(VNHEAD(vp),c,fl,flags,offset,fr) | ||
283 | #define bhv_vop_reclaim(vp) VOP(vop_reclaim, vp)(VNHEAD(vp)) | ||
284 | #define bhv_vop_attr_get(vp, name, val, vallenp, fl, cred) \ | ||
285 | VOP(vop_attr_get, vp)(VNHEAD(vp),name,val,vallenp,fl,cred) | ||
286 | #define bhv_vop_attr_set(vp, name, val, vallen, fl, cred) \ | ||
287 | VOP(vop_attr_set, vp)(VNHEAD(vp),name,val,vallen,fl,cred) | ||
288 | #define bhv_vop_attr_remove(vp, name, flags, cred) \ | ||
289 | VOP(vop_attr_remove, vp)(VNHEAD(vp),name,flags,cred) | ||
290 | #define bhv_vop_attr_list(vp, buf, buflen, fl, cursor, cred) \ | ||
291 | VOP(vop_attr_list, vp)(VNHEAD(vp),buf,buflen,fl,cursor,cred) | ||
292 | #define bhv_vop_link_removed(vp, dvp, linkzero) \ | ||
293 | VOP(vop_link_removed, vp)(VNHEAD(vp), dvp, linkzero) | ||
294 | #define bhv_vop_vnode_change(vp, cmd, val) \ | ||
295 | VOP(vop_vnode_change, vp)(VNHEAD(vp), cmd, val) | ||
296 | #define bhv_vop_toss_pages(vp, first, last, fiopt) \ | ||
297 | VOP(vop_tosspages, vp)(VNHEAD(vp), first, last, fiopt) | ||
298 | #define bhv_vop_flushinval_pages(vp, first, last, fiopt) \ | ||
299 | VOP(vop_flushinval_pages, vp)(VNHEAD(vp),first,last,fiopt) | ||
300 | #define bhv_vop_flush_pages(vp, first, last, flags, fiopt) \ | ||
301 | VOP(vop_flush_pages, vp)(VNHEAD(vp),first,last,flags,fiopt) | ||
302 | #define bhv_vop_ioctl(vp, inode, filp, fl, cmd, arg) \ | ||
303 | VOP(vop_ioctl, vp)(VNHEAD(vp),inode,filp,fl,cmd,arg) | ||
304 | #define bhv_vop_iflush(vp, flags) VOP(vop_iflush, vp)(VNHEAD(vp), flags) | ||
305 | |||
306 | /* | ||
307 | * Flags for read/write calls - same values as IRIX | 92 | * Flags for read/write calls - same values as IRIX |
308 | */ | 93 | */ |
309 | #define IO_ISAIO 0x00001 /* don't wait for completion */ | 94 | #define IO_ISAIO 0x00001 /* don't wait for completion */ |