1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36 #ifndef _xfs_vnodeops_h
37 #define _xfs_vnodeops_h
38
39
40
41
42
43
44
45 #ifdef __osf__
46
47 #define xfs_vfs_readlock(vp, proc) VREF((vp))
48 #define xfs_vfs_writelock(vp, proc) VREF((vp))
49 #define xfs_vfs_unlock(vp, proc) vrele((vp))
50
51
52
53 #define xfs_vfs_vn_lock(vp, flags, proc) (0)
54
55 #elif defined(HAVE_TWO_ARGUMENT_VOP_LOCK)
56
57 #define xfs_vfs_readlock(vp, proc) vn_lock((vp), LK_SHARED | LK_RETRY)
58 #define xfs_vfs_writelock(vp, proc) vn_lock((vp), LK_EXCLUSIVE | LK_RETRY)
59 #define xfs_vfs_unlock(vp, proc) VOP_UNLOCK((vp), 0)
60 #define xfs_vfs_vn_lock(vp, flags, proc) vn_lock((vp), (flags))
61
62 #elif defined(HAVE_THREE_ARGUMENT_VOP_LOCK)
63
64 #define xfs_vfs_readlock(vp, proc) vn_lock((vp), LK_SHARED | LK_RETRY, (proc))
65 #define xfs_vfs_writelock(vp, proc) vn_lock((vp), LK_EXCLUSIVE | LK_RETRY, (proc))
66 #define xfs_vfs_unlock(vp, proc) VOP_UNLOCK((vp), 0, (proc))
67 #define xfs_vfs_vn_lock(vp, flags, proc) vn_lock((vp), (flags), (proc))
68
69 #elif defined(HAVE_ONE_ARGUMENT_VOP_LOCK)
70
71 #define xfs_vfs_readlock(vp, proc) VOP_LOCK((vp))
72 #define xfs_vfs_writelock(vp, proc) VOP_LOCK((vp))
73 #define xfs_vfs_unlock(vp, proc) VOP_UNLOCK((vp))
74
75
76
77 #define xfs_vfs_vn_lock(vp, flags, proc) (0)
78
79 #else
80
81 #error what kind of VOP_LOCK?
82
83 #endif
84
85 int
86 xfs_open_valid(struct vnode *vp, struct ucred *cred, d_thread_t *p,
87 u_int tok);
88
89 int
90 xfs_attr_valid(struct vnode *vp, struct ucred *cred, d_thread_t *p,
91 u_int tok);
92
93 int
94 xfs_fetch_rights(struct vnode *vp, struct ucred *cred, d_thread_t *p);
95
96 int
97 xfs_data_valid(struct vnode *vp, struct ucred *cred, d_thread_t *p,
98 u_int tok, uint32_t offset);
99
100 int
101 xfs_open_common(struct vnode *vp,
102 int mode,
103 struct ucred *cred,
104 d_thread_t *p);
105
106 int
107 xfs_fsync_common(struct vnode *vp, struct ucred *cred,
108 int waitfor, d_thread_t *proc);
109
110 int
111 xfs_close_common(struct vnode *vp, int fflag,
112 d_thread_t *proc, struct ucred *cred);
113
114 int
115 xfs_read_common(struct vnode *vp, struct uio *uio, int ioflag,
116 struct ucred *cred);
117
118 int
119 xfs_write_common(struct vnode *vp, struct uio *uiop, int ioflag,
120 struct ucred *cred);
121
122 int
123 xfs_getattr_common(struct vnode *vp, struct vattr *vap,
124 struct ucred *cred, d_thread_t *p);
125
126 int
127 xfs_setattr_common(struct vnode *vp, struct vattr *vap,
128 struct ucred *cred, d_thread_t *p);
129
130 int
131 xfs_access_common(struct vnode *vp, int mode,
132 struct ucred *cred, d_thread_t *p);
133
134 int
135 xfs_lookup_common(struct vnode *dvp,
136 xfs_componentname *cnp,
137 struct vnode **vpp);
138
139 int
140 xfs_create_common(struct vnode *dvp,
141 const char *name,
142 struct vattr *vap,
143 struct ucred *cred,
144 d_thread_t *p);
145
146 int
147 xfs_remove_common(struct vnode *dvp,
148 struct vnode *vp,
149 const char *name,
150 struct ucred *cred,
151 d_thread_t *p);
152
153 int
154 xfs_rename_common(struct vnode *fdvp,
155 struct vnode *fvp,
156 const char *fname,
157 struct vnode *tdvp,
158 struct vnode *tvp,
159 const char *tname,
160 struct ucred *cred,
161 d_thread_t *p);
162
163 int
164 xfs_mkdir_common(struct vnode *dvp,
165 const char *name,
166 struct vattr *vap,
167 struct ucred *cred,
168 d_thread_t *p);
169
170 int
171 xfs_rmdir_common(struct vnode *dvp,
172 struct vnode *vp,
173 const char *name,
174 struct ucred *cred,
175 d_thread_t *p);
176
177 int
178 xfs_readdir_common(struct vnode *vp,
179 struct uio *uiop,
180 struct ucred *cred,
181 d_thread_t *p,
182 int *eofflag);
183
184 int
185 xfs_link_common(struct vnode *dvp,
186 struct vnode *vp,
187 const char *name,
188 struct ucred *cred,
189 d_thread_t *p);
190
191 int
192 xfs_symlink_common(struct vnode *dvp,
193 struct vnode **vpp,
194 xfs_componentname *cnp,
195 struct vattr *vap,
196 char *target);
197
198 int
199 xfs_readlink_common(struct vnode *vp, struct uio *uiop, struct ucred *cred);
200
201 int
202 xfs_inactive_common(struct vnode *vp, d_thread_t *p);
203
204 int
205 xfs_reclaim_common(struct vnode *vp);
206
207 int
208 xfs_eopnotsupp (struct vop_generic_args *ap);
209
210 int
211 xfs_returnzero (struct vop_generic_args *ap);
212
213 void
214 xfs_printnode_common (struct vnode *vp);
215
216 size_t
217 xfs_uio_end_length (struct uio *uio);
218
219
220 #endif