aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/linux-2.6')
-rw-r--r--fs/xfs/linux-2.6/xfs_aops.c33
-rw-r--r--fs/xfs/linux-2.6/xfs_aops.h2
-rw-r--r--fs/xfs/linux-2.6/xfs_export.c6
-rw-r--r--fs/xfs/linux-2.6/xfs_file.c120
-rw-r--r--fs/xfs/linux-2.6/xfs_fs_subr.c6
-rw-r--r--fs/xfs/linux-2.6/xfs_ioctl.c61
-rw-r--r--fs/xfs/linux-2.6/xfs_ioctl32.c4
-rw-r--r--fs/xfs/linux-2.6/xfs_iops.c99
-rw-r--r--fs/xfs/linux-2.6/xfs_lrw.c10
-rw-r--r--fs/xfs/linux-2.6/xfs_lrw.h4
-rw-r--r--fs/xfs/linux-2.6/xfs_super.c42
-rw-r--r--fs/xfs/linux-2.6/xfs_super.h2
-rw-r--r--fs/xfs/linux-2.6/xfs_vfs.c8
-rw-r--r--fs/xfs/linux-2.6/xfs_vfs.h55
-rw-r--r--fs/xfs/linux-2.6/xfs_vnode.c32
-rw-r--r--fs/xfs/linux-2.6/xfs_vnode.h305
16 files changed, 330 insertions, 459 deletions
diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c
index c0a904316854..c5ea26d73bea 100644
--- a/fs/xfs/linux-2.6/xfs_aops.c
+++ b/fs/xfs/linux-2.6/xfs_aops.c
@@ -76,7 +76,7 @@ xfs_page_trace(
76 int mask) 76 int mask)
77{ 77{
78 xfs_inode_t *ip; 78 xfs_inode_t *ip;
79 vnode_t *vp = vn_from_inode(inode); 79 bhv_vnode_t *vp = vn_from_inode(inode);
80 loff_t isize = i_size_read(inode); 80 loff_t isize = i_size_read(inode);
81 loff_t offset = page_offset(page); 81 loff_t offset = page_offset(page);
82 int delalloc = -1, unmapped = -1, unwritten = -1; 82 int delalloc = -1, unmapped = -1, unwritten = -1;
@@ -181,13 +181,12 @@ xfs_end_bio_unwritten(
181 void *data) 181 void *data)
182{ 182{
183 xfs_ioend_t *ioend = data; 183 xfs_ioend_t *ioend = data;
184 vnode_t *vp = ioend->io_vnode; 184 bhv_vnode_t *vp = ioend->io_vnode;
185 xfs_off_t offset = ioend->io_offset; 185 xfs_off_t offset = ioend->io_offset;
186 size_t size = ioend->io_size; 186 size_t size = ioend->io_size;
187 int error;
188 187
189 if (likely(!ioend->io_error)) 188 if (likely(!ioend->io_error))
190 VOP_BMAP(vp, offset, size, BMAPI_UNWRITTEN, NULL, NULL, error); 189 bhv_vop_bmap(vp, offset, size, BMAPI_UNWRITTEN, NULL, NULL);
191 xfs_destroy_ioend(ioend); 190 xfs_destroy_ioend(ioend);
192} 191}
193 192
@@ -240,10 +239,10 @@ xfs_map_blocks(
240 xfs_iomap_t *mapp, 239 xfs_iomap_t *mapp,
241 int flags) 240 int flags)
242{ 241{
243 vnode_t *vp = vn_from_inode(inode); 242 bhv_vnode_t *vp = vn_from_inode(inode);
244 int error, nmaps = 1; 243 int error, nmaps = 1;
245 244
246 VOP_BMAP(vp, offset, count, flags, mapp, &nmaps, error); 245 error = bhv_vop_bmap(vp, offset, count, flags, mapp, &nmaps);
247 if (!error && (flags & (BMAPI_WRITE|BMAPI_ALLOCATE))) 246 if (!error && (flags & (BMAPI_WRITE|BMAPI_ALLOCATE)))
248 VMODIFY(vp); 247 VMODIFY(vp);
249 return -error; 248 return -error;
@@ -1162,7 +1161,7 @@ xfs_vm_writepages(
1162 struct address_space *mapping, 1161 struct address_space *mapping,
1163 struct writeback_control *wbc) 1162 struct writeback_control *wbc)
1164{ 1163{
1165 struct vnode *vp = vn_from_inode(mapping->host); 1164 struct bhv_vnode *vp = vn_from_inode(mapping->host);
1166 1165
1167 if (VN_TRUNC(vp)) 1166 if (VN_TRUNC(vp))
1168 VUNTRUNCATE(vp); 1167 VUNTRUNCATE(vp);
@@ -1242,7 +1241,7 @@ __xfs_get_blocks(
1242 int direct, 1241 int direct,
1243 bmapi_flags_t flags) 1242 bmapi_flags_t flags)
1244{ 1243{
1245 vnode_t *vp = vn_from_inode(inode); 1244 bhv_vnode_t *vp = vn_from_inode(inode);
1246 xfs_iomap_t iomap; 1245 xfs_iomap_t iomap;
1247 xfs_off_t offset; 1246 xfs_off_t offset;
1248 ssize_t size; 1247 ssize_t size;
@@ -1252,8 +1251,8 @@ __xfs_get_blocks(
1252 offset = (xfs_off_t)iblock << inode->i_blkbits; 1251 offset = (xfs_off_t)iblock << inode->i_blkbits;
1253 ASSERT(bh_result->b_size >= (1 << inode->i_blkbits)); 1252 ASSERT(bh_result->b_size >= (1 << inode->i_blkbits));
1254 size = bh_result->b_size; 1253 size = bh_result->b_size;
1255 VOP_BMAP(vp, offset, size, 1254 error = bhv_vop_bmap(vp, offset, size,
1256 create ? flags : BMAPI_READ, &iomap, &niomap, error); 1255 create ? flags : BMAPI_READ, &iomap, &niomap);
1257 if (error) 1256 if (error)
1258 return -error; 1257 return -error;
1259 if (niomap == 0) 1258 if (niomap == 0)
@@ -1381,13 +1380,13 @@ xfs_vm_direct_IO(
1381{ 1380{
1382 struct file *file = iocb->ki_filp; 1381 struct file *file = iocb->ki_filp;
1383 struct inode *inode = file->f_mapping->host; 1382 struct inode *inode = file->f_mapping->host;
1384 vnode_t *vp = vn_from_inode(inode); 1383 bhv_vnode_t *vp = vn_from_inode(inode);
1385 xfs_iomap_t iomap; 1384 xfs_iomap_t iomap;
1386 int maps = 1; 1385 int maps = 1;
1387 int error; 1386 int error;
1388 ssize_t ret; 1387 ssize_t ret;
1389 1388
1390 VOP_BMAP(vp, offset, 0, BMAPI_DEVICE, &iomap, &maps, error); 1389 error = bhv_vop_bmap(vp, offset, 0, BMAPI_DEVICE, &iomap, &maps);
1391 if (error) 1390 if (error)
1392 return -error; 1391 return -error;
1393 1392
@@ -1420,14 +1419,12 @@ xfs_vm_bmap(
1420 sector_t block) 1419 sector_t block)
1421{ 1420{
1422 struct inode *inode = (struct inode *)mapping->host; 1421 struct inode *inode = (struct inode *)mapping->host;
1423 vnode_t *vp = vn_from_inode(inode); 1422 bhv_vnode_t *vp = vn_from_inode(inode);
1424 int error;
1425 1423
1426 vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address); 1424 vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address);
1427 1425 bhv_vop_rwlock(vp, VRWLOCK_READ);
1428 VOP_RWLOCK(vp, VRWLOCK_READ); 1426 bhv_vop_flush_pages(vp, (xfs_off_t)0, -1, 0, FI_REMAPF);
1429 VOP_FLUSH_PAGES(vp, (xfs_off_t)0, -1, 0, FI_REMAPF, error); 1427 bhv_vop_rwunlock(vp, VRWLOCK_READ);
1430 VOP_RWUNLOCK(vp, VRWLOCK_READ);
1431 return generic_block_bmap(mapping, block, xfs_get_blocks); 1428 return generic_block_bmap(mapping, block, xfs_get_blocks);
1432} 1429}
1433 1430
diff --git a/fs/xfs/linux-2.6/xfs_aops.h b/fs/xfs/linux-2.6/xfs_aops.h
index 62c1d49025fd..706d8c781b8a 100644
--- a/fs/xfs/linux-2.6/xfs_aops.h
+++ b/fs/xfs/linux-2.6/xfs_aops.h
@@ -32,7 +32,7 @@ typedef struct xfs_ioend {
32 unsigned int io_type; /* delalloc / unwritten */ 32 unsigned int io_type; /* delalloc / unwritten */
33 int io_error; /* I/O error code */ 33 int io_error; /* I/O error code */
34 atomic_t io_remaining; /* hold count */ 34 atomic_t io_remaining; /* hold count */
35 struct vnode *io_vnode; /* file being written to */ 35 struct bhv_vnode *io_vnode; /* file being written to */
36 struct buffer_head *io_buffer_head;/* buffer linked list head */ 36 struct buffer_head *io_buffer_head;/* buffer linked list head */
37 struct buffer_head *io_buffer_tail;/* buffer linked list tail */ 37 struct buffer_head *io_buffer_tail;/* buffer linked list tail */
38 size_t io_size; /* size of the extent */ 38 size_t io_size; /* size of the extent */
diff --git a/fs/xfs/linux-2.6/xfs_export.c b/fs/xfs/linux-2.6/xfs_export.c
index b5c579eeb8ef..d32a9edc43a9 100644
--- a/fs/xfs/linux-2.6/xfs_export.c
+++ b/fs/xfs/linux-2.6/xfs_export.c
@@ -136,7 +136,7 @@ xfs_fs_get_dentry(
136 struct super_block *sb, 136 struct super_block *sb,
137 void *data) 137 void *data)
138{ 138{
139 vnode_t *vp; 139 bhv_vnode_t *vp;
140 struct inode *inode; 140 struct inode *inode;
141 struct dentry *result; 141 struct dentry *result;
142 bhv_vfs_t *vfsp = vfs_from_sb(sb); 142 bhv_vfs_t *vfsp = vfs_from_sb(sb);
@@ -160,12 +160,12 @@ xfs_fs_get_parent(
160 struct dentry *child) 160 struct dentry *child)
161{ 161{
162 int error; 162 int error;
163 vnode_t *vp, *cvp; 163 bhv_vnode_t *vp, *cvp;
164 struct dentry *parent; 164 struct dentry *parent;
165 165
166 cvp = NULL; 166 cvp = NULL;
167 vp = vn_from_inode(child->d_inode); 167 vp = vn_from_inode(child->d_inode);
168 VOP_LOOKUP(vp, &dotdot, &cvp, 0, NULL, NULL, error); 168 error = bhv_vop_lookup(vp, &dotdot, &cvp, 0, NULL, NULL);
169 if (unlikely(error)) 169 if (unlikely(error))
170 return ERR_PTR(-error); 170 return ERR_PTR(-error);
171 171
diff --git a/fs/xfs/linux-2.6/xfs_file.c b/fs/xfs/linux-2.6/xfs_file.c
index 97615cc74ef5..89b1a7421357 100644
--- a/fs/xfs/linux-2.6/xfs_file.c
+++ b/fs/xfs/linux-2.6/xfs_file.c
@@ -58,15 +58,12 @@ __xfs_file_read(
58{ 58{
59 struct iovec iov = {buf, count}; 59 struct iovec iov = {buf, count};
60 struct file *file = iocb->ki_filp; 60 struct file *file = iocb->ki_filp;
61 vnode_t *vp = vn_from_inode(file->f_dentry->d_inode); 61 bhv_vnode_t *vp = vn_from_inode(file->f_dentry->d_inode);
62 ssize_t rval;
63 62
64 BUG_ON(iocb->ki_pos != pos); 63 BUG_ON(iocb->ki_pos != pos);
65
66 if (unlikely(file->f_flags & O_DIRECT)) 64 if (unlikely(file->f_flags & O_DIRECT))
67 ioflags |= IO_ISDIRECT; 65 ioflags |= IO_ISDIRECT;
68 VOP_READ(vp, iocb, &iov, 1, &iocb->ki_pos, ioflags, NULL, rval); 66 return bhv_vop_read(vp, iocb, &iov, 1, &iocb->ki_pos, ioflags, NULL);
69 return rval;
70} 67}
71 68
72STATIC ssize_t 69STATIC ssize_t
@@ -100,15 +97,12 @@ __xfs_file_write(
100 struct iovec iov = {(void __user *)buf, count}; 97 struct iovec iov = {(void __user *)buf, count};
101 struct file *file = iocb->ki_filp; 98 struct file *file = iocb->ki_filp;
102 struct inode *inode = file->f_mapping->host; 99 struct inode *inode = file->f_mapping->host;
103 vnode_t *vp = vn_from_inode(inode); 100 bhv_vnode_t *vp = vn_from_inode(inode);
104 ssize_t rval;
105 101
106 BUG_ON(iocb->ki_pos != pos); 102 BUG_ON(iocb->ki_pos != pos);
107 if (unlikely(file->f_flags & O_DIRECT)) 103 if (unlikely(file->f_flags & O_DIRECT))
108 ioflags |= IO_ISDIRECT; 104 ioflags |= IO_ISDIRECT;
109 105 return bhv_vop_write(vp, iocb, &iov, 1, &iocb->ki_pos, ioflags, NULL);
110 VOP_WRITE(vp, iocb, &iov, 1, &iocb->ki_pos, ioflags, NULL, rval);
111 return rval;
112} 106}
113 107
114STATIC ssize_t 108STATIC ssize_t
@@ -140,7 +134,7 @@ __xfs_file_readv(
140 loff_t *ppos) 134 loff_t *ppos)
141{ 135{
142 struct inode *inode = file->f_mapping->host; 136 struct inode *inode = file->f_mapping->host;
143 vnode_t *vp = vn_from_inode(inode); 137 bhv_vnode_t *vp = vn_from_inode(inode);
144 struct kiocb kiocb; 138 struct kiocb kiocb;
145 ssize_t rval; 139 ssize_t rval;
146 140
@@ -149,7 +143,8 @@ __xfs_file_readv(
149 143
150 if (unlikely(file->f_flags & O_DIRECT)) 144 if (unlikely(file->f_flags & O_DIRECT))
151 ioflags |= IO_ISDIRECT; 145 ioflags |= IO_ISDIRECT;
152 VOP_READ(vp, &kiocb, iov, nr_segs, &kiocb.ki_pos, ioflags, NULL, rval); 146 rval = bhv_vop_read(vp, &kiocb, iov, nr_segs,
147 &kiocb.ki_pos, ioflags, NULL);
153 148
154 *ppos = kiocb.ki_pos; 149 *ppos = kiocb.ki_pos;
155 return rval; 150 return rval;
@@ -184,7 +179,7 @@ __xfs_file_writev(
184 loff_t *ppos) 179 loff_t *ppos)
185{ 180{
186 struct inode *inode = file->f_mapping->host; 181 struct inode *inode = file->f_mapping->host;
187 vnode_t *vp = vn_from_inode(inode); 182 bhv_vnode_t *vp = vn_from_inode(inode);
188 struct kiocb kiocb; 183 struct kiocb kiocb;
189 ssize_t rval; 184 ssize_t rval;
190 185
@@ -193,7 +188,8 @@ __xfs_file_writev(
193 if (unlikely(file->f_flags & O_DIRECT)) 188 if (unlikely(file->f_flags & O_DIRECT))
194 ioflags |= IO_ISDIRECT; 189 ioflags |= IO_ISDIRECT;
195 190
196 VOP_WRITE(vp, &kiocb, iov, nr_segs, &kiocb.ki_pos, ioflags, NULL, rval); 191 rval = bhv_vop_write(vp, &kiocb, iov, nr_segs,
192 &kiocb.ki_pos, ioflags, NULL);
197 193
198 *ppos = kiocb.ki_pos; 194 *ppos = kiocb.ki_pos;
199 return rval; 195 return rval;
@@ -227,11 +223,8 @@ xfs_file_sendfile(
227 read_actor_t actor, 223 read_actor_t actor,
228 void *target) 224 void *target)
229{ 225{
230 vnode_t *vp = vn_from_inode(filp->f_dentry->d_inode); 226 return bhv_vop_sendfile(vn_from_inode(filp->f_dentry->d_inode),
231 ssize_t rval; 227 filp, pos, 0, count, actor, target, NULL);
232
233 VOP_SENDFILE(vp, filp, pos, 0, count, actor, target, NULL, rval);
234 return rval;
235} 228}
236 229
237STATIC ssize_t 230STATIC ssize_t
@@ -242,11 +235,8 @@ xfs_file_sendfile_invis(
242 read_actor_t actor, 235 read_actor_t actor,
243 void *target) 236 void *target)
244{ 237{
245 vnode_t *vp = vn_from_inode(filp->f_dentry->d_inode); 238 return bhv_vop_sendfile(vn_from_inode(filp->f_dentry->d_inode),
246 ssize_t rval; 239 filp, pos, IO_INVIS, count, actor, target, NULL);
247
248 VOP_SENDFILE(vp, filp, pos, IO_INVIS, count, actor, target, NULL, rval);
249 return rval;
250} 240}
251 241
252STATIC ssize_t 242STATIC ssize_t
@@ -257,11 +247,8 @@ xfs_file_splice_read(
257 size_t len, 247 size_t len,
258 unsigned int flags) 248 unsigned int flags)
259{ 249{
260 vnode_t *vp = vn_from_inode(infilp->f_dentry->d_inode); 250 return bhv_vop_splice_read(vn_from_inode(infilp->f_dentry->d_inode),
261 ssize_t rval; 251 infilp, ppos, pipe, len, flags, 0, NULL);
262
263 VOP_SPLICE_READ(vp, infilp, ppos, pipe, len, flags, 0, NULL, rval);
264 return rval;
265} 252}
266 253
267STATIC ssize_t 254STATIC ssize_t
@@ -272,11 +259,9 @@ xfs_file_splice_read_invis(
272 size_t len, 259 size_t len,
273 unsigned int flags) 260 unsigned int flags)
274{ 261{
275 vnode_t *vp = vn_from_inode(infilp->f_dentry->d_inode); 262 return bhv_vop_splice_read(vn_from_inode(infilp->f_dentry->d_inode),
276 ssize_t rval; 263 infilp, ppos, pipe, len, flags, IO_INVIS,
277 264 NULL);
278 VOP_SPLICE_READ(vp, infilp, ppos, pipe, len, flags, IO_INVIS, NULL, rval);
279 return rval;
280} 265}
281 266
282STATIC ssize_t 267STATIC ssize_t
@@ -287,11 +272,8 @@ xfs_file_splice_write(
287 size_t len, 272 size_t len,
288 unsigned int flags) 273 unsigned int flags)
289{ 274{
290 vnode_t *vp = vn_from_inode(outfilp->f_dentry->d_inode); 275 return bhv_vop_splice_write(vn_from_inode(outfilp->f_dentry->d_inode),
291 ssize_t rval; 276 pipe, outfilp, ppos, len, flags, 0, NULL);
292
293 VOP_SPLICE_WRITE(vp, pipe, outfilp, ppos, len, flags, 0, NULL, rval);
294 return rval;
295} 277}
296 278
297STATIC ssize_t 279STATIC ssize_t
@@ -302,11 +284,9 @@ xfs_file_splice_write_invis(
302 size_t len, 284 size_t len,
303 unsigned int flags) 285 unsigned int flags)
304{ 286{
305 vnode_t *vp = vn_from_inode(outfilp->f_dentry->d_inode); 287 return bhv_vop_splice_write(vn_from_inode(outfilp->f_dentry->d_inode),
306 ssize_t rval; 288 pipe, outfilp, ppos, len, flags, IO_INVIS,
307 289 NULL);
308 VOP_SPLICE_WRITE(vp, pipe, outfilp, ppos, len, flags, IO_INVIS, NULL, rval);
309 return rval;
310} 290}
311 291
312STATIC int 292STATIC int
@@ -314,24 +294,17 @@ xfs_file_open(
314 struct inode *inode, 294 struct inode *inode,
315 struct file *filp) 295 struct file *filp)
316{ 296{
317 vnode_t *vp = vn_from_inode(inode);
318 int error;
319
320 if (!(filp->f_flags & O_LARGEFILE) && i_size_read(inode) > MAX_NON_LFS) 297 if (!(filp->f_flags & O_LARGEFILE) && i_size_read(inode) > MAX_NON_LFS)
321 return -EFBIG; 298 return -EFBIG;
322 VOP_OPEN(vp, NULL, error); 299 return -bhv_vop_open(vn_from_inode(inode), NULL);
323 return -error;
324} 300}
325 301
326STATIC int 302STATIC int
327xfs_file_close( 303xfs_file_close(
328 struct file *filp) 304 struct file *filp)
329{ 305{
330 vnode_t *vp = vn_from_inode(filp->f_dentry->d_inode); 306 return -bhv_vop_close(vn_from_inode(filp->f_dentry->d_inode), 0,
331 int error; 307 file_count(filp) > 1 ? L_FALSE : L_TRUE, NULL);
332
333 VOP_CLOSE(vp, 0, file_count(filp) > 1 ? L_FALSE : L_TRUE, NULL, error);
334 return -error;
335} 308}
336 309
337STATIC int 310STATIC int
@@ -339,12 +312,11 @@ xfs_file_release(
339 struct inode *inode, 312 struct inode *inode,
340 struct file *filp) 313 struct file *filp)
341{ 314{
342 vnode_t *vp = vn_from_inode(inode); 315 bhv_vnode_t *vp = vn_from_inode(inode);
343 int error = 0;
344 316
345 if (vp) 317 if (vp)
346 VOP_RELEASE(vp, error); 318 return -bhv_vop_release(vp);
347 return -error; 319 return 0;
348} 320}
349 321
350STATIC int 322STATIC int
@@ -353,17 +325,14 @@ xfs_file_fsync(
353 struct dentry *dentry, 325 struct dentry *dentry,
354 int datasync) 326 int datasync)
355{ 327{
356 struct inode *inode = dentry->d_inode; 328 bhv_vnode_t *vp = vn_from_inode(dentry->d_inode);
357 vnode_t *vp = vn_from_inode(inode);
358 int error;
359 int flags = FSYNC_WAIT; 329 int flags = FSYNC_WAIT;
360 330
361 if (datasync) 331 if (datasync)
362 flags |= FSYNC_DATA; 332 flags |= FSYNC_DATA;
363 if (VN_TRUNC(vp)) 333 if (VN_TRUNC(vp))
364 VUNTRUNCATE(vp); 334 VUNTRUNCATE(vp);
365 VOP_FSYNC(vp, flags, NULL, (xfs_off_t)0, (xfs_off_t)-1, error); 335 return -bhv_vop_fsync(vp, flags, NULL, (xfs_off_t)0, (xfs_off_t)-1);
366 return -error;
367} 336}
368 337
369#ifdef CONFIG_XFS_DMAPI 338#ifdef CONFIG_XFS_DMAPI
@@ -374,7 +343,7 @@ xfs_vm_nopage(
374 int *type) 343 int *type)
375{ 344{
376 struct inode *inode = area->vm_file->f_dentry->d_inode; 345 struct inode *inode = area->vm_file->f_dentry->d_inode;
377 vnode_t *vp = vn_from_inode(inode); 346 bhv_vnode_t *vp = vn_from_inode(inode);
378 347
379 ASSERT_ALWAYS(vp->v_vfsp->vfs_flag & VFS_DMI); 348 ASSERT_ALWAYS(vp->v_vfsp->vfs_flag & VFS_DMI);
380 if (XFS_SEND_MMAP(XFS_VFSTOM(vp->v_vfsp), area, 0)) 349 if (XFS_SEND_MMAP(XFS_VFSTOM(vp->v_vfsp), area, 0))
@@ -390,7 +359,7 @@ xfs_file_readdir(
390 filldir_t filldir) 359 filldir_t filldir)
391{ 360{
392 int error = 0; 361 int error = 0;
393 vnode_t *vp = vn_from_inode(filp->f_dentry->d_inode); 362 bhv_vnode_t *vp = vn_from_inode(filp->f_dentry->d_inode);
394 uio_t uio; 363 uio_t uio;
395 iovec_t iov; 364 iovec_t iov;
396 int eof = 0; 365 int eof = 0;
@@ -425,7 +394,7 @@ xfs_file_readdir(
425 394
426 start_offset = uio.uio_offset; 395 start_offset = uio.uio_offset;
427 396
428 VOP_READDIR(vp, &uio, NULL, &eof, error); 397 error = bhv_vop_readdir(vp, &uio, NULL, &eof);
429 if ((uio.uio_offset == start_offset) || error) { 398 if ((uio.uio_offset == start_offset) || error) {
430 size = 0; 399 size = 0;
431 break; 400 break;
@@ -475,18 +444,17 @@ xfs_file_mmap(
475 return 0; 444 return 0;
476} 445}
477 446
478
479STATIC long 447STATIC long
480xfs_file_ioctl( 448xfs_file_ioctl(
481 struct file *filp, 449 struct file *filp,
482 unsigned int cmd, 450 unsigned int cmd,
483 unsigned long arg) 451 unsigned long p)
484{ 452{
485 int error; 453 int error;
486 struct inode *inode = filp->f_dentry->d_inode; 454 struct inode *inode = filp->f_dentry->d_inode;
487 vnode_t *vp = vn_from_inode(inode); 455 bhv_vnode_t *vp = vn_from_inode(inode);
488 456
489 VOP_IOCTL(vp, inode, filp, 0, cmd, (void __user *)arg, error); 457 error = bhv_vop_ioctl(vp, inode, filp, 0, cmd, (void __user *)p);
490 VMODIFY(vp); 458 VMODIFY(vp);
491 459
492 /* NOTE: some of the ioctl's return positive #'s as a 460 /* NOTE: some of the ioctl's return positive #'s as a
@@ -502,13 +470,13 @@ STATIC long
502xfs_file_ioctl_invis( 470xfs_file_ioctl_invis(
503 struct file *filp, 471 struct file *filp,
504 unsigned int cmd, 472 unsigned int cmd,
505 unsigned long arg) 473 unsigned long p)
506{ 474{
507 struct inode *inode = filp->f_dentry->d_inode;
508 vnode_t *vp = vn_from_inode(inode);
509 int error; 475 int error;
476 struct inode *inode = filp->f_dentry->d_inode;
477 bhv_vnode_t *vp = vn_from_inode(inode);
510 478
511 VOP_IOCTL(vp, inode, filp, IO_INVIS, cmd, (void __user *)arg, error); 479 error = bhv_vop_ioctl(vp, inode, filp, IO_INVIS, cmd, (void __user *)p);
512 VMODIFY(vp); 480 VMODIFY(vp);
513 481
514 /* NOTE: some of the ioctl's return positive #'s as a 482 /* NOTE: some of the ioctl's return positive #'s as a
@@ -527,7 +495,7 @@ xfs_vm_mprotect(
527 struct vm_area_struct *vma, 495 struct vm_area_struct *vma,
528 unsigned int newflags) 496 unsigned int newflags)
529{ 497{
530 vnode_t *vp = vn_from_inode(vma->vm_file->f_dentry->d_inode); 498 bhv_vnode_t *vp = vn_from_inode(vma->vm_file->f_dentry->d_inode);
531 int error = 0; 499 int error = 0;
532 500
533 if (vp->v_vfsp->vfs_flag & VFS_DMI) { 501 if (vp->v_vfsp->vfs_flag & VFS_DMI) {
@@ -553,7 +521,7 @@ STATIC int
553xfs_file_open_exec( 521xfs_file_open_exec(
554 struct inode *inode) 522 struct inode *inode)
555{ 523{
556 vnode_t *vp = vn_from_inode(inode); 524 bhv_vnode_t *vp = vn_from_inode(inode);
557 xfs_mount_t *mp = XFS_VFSTOM(vp->v_vfsp); 525 xfs_mount_t *mp = XFS_VFSTOM(vp->v_vfsp);
558 int error = 0; 526 int error = 0;
559 xfs_inode_t *ip; 527 xfs_inode_t *ip;
diff --git a/fs/xfs/linux-2.6/xfs_fs_subr.c b/fs/xfs/linux-2.6/xfs_fs_subr.c
index f0c56daf4d6d..dc0562828e76 100644
--- a/fs/xfs/linux-2.6/xfs_fs_subr.c
+++ b/fs/xfs/linux-2.6/xfs_fs_subr.c
@@ -28,7 +28,7 @@ fs_tosspages(
28 xfs_off_t last, 28 xfs_off_t last,
29 int fiopt) 29 int fiopt)
30{ 30{
31 vnode_t *vp = BHV_TO_VNODE(bdp); 31 bhv_vnode_t *vp = BHV_TO_VNODE(bdp);
32 struct inode *ip = vn_to_inode(vp); 32 struct inode *ip = vn_to_inode(vp);
33 33
34 if (VN_CACHED(vp)) 34 if (VN_CACHED(vp))
@@ -42,7 +42,7 @@ fs_flushinval_pages(
42 xfs_off_t last, 42 xfs_off_t last,
43 int fiopt) 43 int fiopt)
44{ 44{
45 vnode_t *vp = BHV_TO_VNODE(bdp); 45 bhv_vnode_t *vp = BHV_TO_VNODE(bdp);
46 struct inode *ip = vn_to_inode(vp); 46 struct inode *ip = vn_to_inode(vp);
47 47
48 if (VN_CACHED(vp)) { 48 if (VN_CACHED(vp)) {
@@ -61,7 +61,7 @@ fs_flush_pages(
61 uint64_t flags, 61 uint64_t flags,
62 int fiopt) 62 int fiopt)
63{ 63{
64 vnode_t *vp = BHV_TO_VNODE(bdp); 64 bhv_vnode_t *vp = BHV_TO_VNODE(bdp);
65 struct inode *ip = vn_to_inode(vp); 65 struct inode *ip = vn_to_inode(vp);
66 66
67 if (VN_DIRTY(vp)) { 67 if (VN_DIRTY(vp)) {
diff --git a/fs/xfs/linux-2.6/xfs_ioctl.c b/fs/xfs/linux-2.6/xfs_ioctl.c
index 84478491609b..73182503c16e 100644
--- a/fs/xfs/linux-2.6/xfs_ioctl.c
+++ b/fs/xfs/linux-2.6/xfs_ioctl.c
@@ -78,7 +78,7 @@ xfs_find_handle(
78 xfs_handle_t handle; 78 xfs_handle_t handle;
79 xfs_fsop_handlereq_t hreq; 79 xfs_fsop_handlereq_t hreq;
80 struct inode *inode; 80 struct inode *inode;
81 struct vnode *vp; 81 bhv_vnode_t *vp;
82 82
83 if (copy_from_user(&hreq, arg, sizeof(hreq))) 83 if (copy_from_user(&hreq, arg, sizeof(hreq)))
84 return -XFS_ERROR(EFAULT); 84 return -XFS_ERROR(EFAULT);
@@ -192,7 +192,7 @@ xfs_vget_fsop_handlereq(
192 xfs_mount_t *mp, 192 xfs_mount_t *mp,
193 struct inode *parinode, /* parent inode pointer */ 193 struct inode *parinode, /* parent inode pointer */
194 xfs_fsop_handlereq_t *hreq, 194 xfs_fsop_handlereq_t *hreq,
195 vnode_t **vp, 195 bhv_vnode_t **vp,
196 struct inode **inode) 196 struct inode **inode)
197{ 197{
198 void __user *hanp; 198 void __user *hanp;
@@ -202,7 +202,7 @@ xfs_vget_fsop_handlereq(
202 xfs_handle_t handle; 202 xfs_handle_t handle;
203 xfs_inode_t *ip; 203 xfs_inode_t *ip;
204 struct inode *inodep; 204 struct inode *inodep;
205 vnode_t *vpp; 205 bhv_vnode_t *vpp;
206 xfs_ino_t ino; 206 xfs_ino_t ino;
207 __u32 igen; 207 __u32 igen;
208 int error; 208 int error;
@@ -277,7 +277,7 @@ xfs_open_by_handle(
277 struct file *filp; 277 struct file *filp;
278 struct inode *inode; 278 struct inode *inode;
279 struct dentry *dentry; 279 struct dentry *dentry;
280 vnode_t *vp; 280 bhv_vnode_t *vp;
281 xfs_fsop_handlereq_t hreq; 281 xfs_fsop_handlereq_t hreq;
282 282
283 if (!capable(CAP_SYS_ADMIN)) 283 if (!capable(CAP_SYS_ADMIN))
@@ -362,7 +362,7 @@ xfs_readlink_by_handle(
362 struct uio auio; 362 struct uio auio;
363 struct inode *inode; 363 struct inode *inode;
364 xfs_fsop_handlereq_t hreq; 364 xfs_fsop_handlereq_t hreq;
365 vnode_t *vp; 365 bhv_vnode_t *vp;
366 __u32 olen; 366 __u32 olen;
367 367
368 if (!capable(CAP_SYS_ADMIN)) 368 if (!capable(CAP_SYS_ADMIN))
@@ -393,9 +393,11 @@ xfs_readlink_by_handle(
393 auio.uio_segflg = UIO_USERSPACE; 393 auio.uio_segflg = UIO_USERSPACE;
394 auio.uio_resid = olen; 394 auio.uio_resid = olen;
395 395
396 VOP_READLINK(vp, &auio, IO_INVIS, NULL, error); 396 error = bhv_vop_readlink(vp, &auio, IO_INVIS, NULL);
397
398 VN_RELE(vp); 397 VN_RELE(vp);
398 if (error)
399 return -error;
400
399 return (olen - auio.uio_resid); 401 return (olen - auio.uio_resid);
400} 402}
401 403
@@ -411,7 +413,7 @@ xfs_fssetdm_by_handle(
411 xfs_fsop_setdm_handlereq_t dmhreq; 413 xfs_fsop_setdm_handlereq_t dmhreq;
412 struct inode *inode; 414 struct inode *inode;
413 bhv_desc_t *bdp; 415 bhv_desc_t *bdp;
414 vnode_t *vp; 416 bhv_vnode_t *vp;
415 417
416 if (!capable(CAP_MKNOD)) 418 if (!capable(CAP_MKNOD))
417 return -XFS_ERROR(EPERM); 419 return -XFS_ERROR(EPERM);
@@ -452,7 +454,7 @@ xfs_attrlist_by_handle(
452 attrlist_cursor_kern_t *cursor; 454 attrlist_cursor_kern_t *cursor;
453 xfs_fsop_attrlist_handlereq_t al_hreq; 455 xfs_fsop_attrlist_handlereq_t al_hreq;
454 struct inode *inode; 456 struct inode *inode;
455 vnode_t *vp; 457 bhv_vnode_t *vp;
456 char *kbuf; 458 char *kbuf;
457 459
458 if (!capable(CAP_SYS_ADMIN)) 460 if (!capable(CAP_SYS_ADMIN))
@@ -472,8 +474,8 @@ xfs_attrlist_by_handle(
472 goto out_vn_rele; 474 goto out_vn_rele;
473 475
474 cursor = (attrlist_cursor_kern_t *)&al_hreq.pos; 476 cursor = (attrlist_cursor_kern_t *)&al_hreq.pos;
475 VOP_ATTR_LIST(vp, kbuf, al_hreq.buflen, al_hreq.flags, 477 error = bhv_vop_attr_list(vp, kbuf, al_hreq.buflen, al_hreq.flags,
476 cursor, NULL, error); 478 cursor, NULL);
477 if (error) 479 if (error)
478 goto out_kfree; 480 goto out_kfree;
479 481
@@ -490,7 +492,7 @@ xfs_attrlist_by_handle(
490 492
491STATIC int 493STATIC int
492xfs_attrmulti_attr_get( 494xfs_attrmulti_attr_get(
493 struct vnode *vp, 495 bhv_vnode_t *vp,
494 char *name, 496 char *name,
495 char __user *ubuf, 497 char __user *ubuf,
496 __uint32_t *len, 498 __uint32_t *len,
@@ -505,7 +507,7 @@ xfs_attrmulti_attr_get(
505 if (!kbuf) 507 if (!kbuf)
506 return ENOMEM; 508 return ENOMEM;
507 509
508 VOP_ATTR_GET(vp, name, kbuf, len, flags, NULL, error); 510 error = bhv_vop_attr_get(vp, name, kbuf, len, flags, NULL);
509 if (error) 511 if (error)
510 goto out_kfree; 512 goto out_kfree;
511 513
@@ -519,7 +521,7 @@ xfs_attrmulti_attr_get(
519 521
520STATIC int 522STATIC int
521xfs_attrmulti_attr_set( 523xfs_attrmulti_attr_set(
522 struct vnode *vp, 524 bhv_vnode_t *vp,
523 char *name, 525 char *name,
524 const char __user *ubuf, 526 const char __user *ubuf,
525 __uint32_t len, 527 __uint32_t len,
@@ -542,7 +544,7 @@ xfs_attrmulti_attr_set(
542 if (copy_from_user(kbuf, ubuf, len)) 544 if (copy_from_user(kbuf, ubuf, len))
543 goto out_kfree; 545 goto out_kfree;
544 546
545 VOP_ATTR_SET(vp, name, kbuf, len, flags, NULL, error); 547 error = bhv_vop_attr_set(vp, name, kbuf, len, flags, NULL);
546 548
547 out_kfree: 549 out_kfree:
548 kfree(kbuf); 550 kfree(kbuf);
@@ -551,20 +553,15 @@ xfs_attrmulti_attr_set(
551 553
552STATIC int 554STATIC int
553xfs_attrmulti_attr_remove( 555xfs_attrmulti_attr_remove(
554 struct vnode *vp, 556 bhv_vnode_t *vp,
555 char *name, 557 char *name,
556 __uint32_t flags) 558 __uint32_t flags)
557{ 559{
558 int error;
559
560
561 if (IS_RDONLY(&vp->v_inode)) 560 if (IS_RDONLY(&vp->v_inode))
562 return -EROFS; 561 return -EROFS;
563 if (IS_IMMUTABLE(&vp->v_inode) || IS_APPEND(&vp->v_inode)) 562 if (IS_IMMUTABLE(&vp->v_inode) || IS_APPEND(&vp->v_inode))
564 return EPERM; 563 return EPERM;
565 564 return bhv_vop_attr_remove(vp, name, flags, NULL);
566 VOP_ATTR_REMOVE(vp, name, flags, NULL, error);
567 return error;
568} 565}
569 566
570STATIC int 567STATIC int
@@ -578,7 +575,7 @@ xfs_attrmulti_by_handle(
578 xfs_attr_multiop_t *ops; 575 xfs_attr_multiop_t *ops;
579 xfs_fsop_attrmulti_handlereq_t am_hreq; 576 xfs_fsop_attrmulti_handlereq_t am_hreq;
580 struct inode *inode; 577 struct inode *inode;
581 vnode_t *vp; 578 bhv_vnode_t *vp;
582 unsigned int i, size; 579 unsigned int i, size;
583 char *attr_name; 580 char *attr_name;
584 581
@@ -658,7 +655,7 @@ xfs_attrmulti_by_handle(
658STATIC int 655STATIC int
659xfs_ioc_space( 656xfs_ioc_space(
660 bhv_desc_t *bdp, 657 bhv_desc_t *bdp,
661 vnode_t *vp, 658 bhv_vnode_t *vp,
662 struct file *filp, 659 struct file *filp,
663 int flags, 660 int flags,
664 unsigned int cmd, 661 unsigned int cmd,
@@ -682,7 +679,7 @@ xfs_ioc_fsgeometry(
682 679
683STATIC int 680STATIC int
684xfs_ioc_xattr( 681xfs_ioc_xattr(
685 vnode_t *vp, 682 bhv_vnode_t *vp,
686 xfs_inode_t *ip, 683 xfs_inode_t *ip,
687 struct file *filp, 684 struct file *filp,
688 unsigned int cmd, 685 unsigned int cmd,
@@ -711,7 +708,7 @@ xfs_ioctl(
711 void __user *arg) 708 void __user *arg)
712{ 709{
713 int error; 710 int error;
714 vnode_t *vp; 711 bhv_vnode_t *vp;
715 xfs_inode_t *ip; 712 xfs_inode_t *ip;
716 xfs_mount_t *mp; 713 xfs_mount_t *mp;
717 714
@@ -962,7 +959,7 @@ xfs_ioctl(
962STATIC int 959STATIC int
963xfs_ioc_space( 960xfs_ioc_space(
964 bhv_desc_t *bdp, 961 bhv_desc_t *bdp,
965 vnode_t *vp, 962 bhv_vnode_t *vp,
966 struct file *filp, 963 struct file *filp,
967 int ioflags, 964 int ioflags,
968 unsigned int cmd, 965 unsigned int cmd,
@@ -1153,7 +1150,7 @@ xfs_di2lxflags(
1153 1150
1154STATIC int 1151STATIC int
1155xfs_ioc_xattr( 1152xfs_ioc_xattr(
1156 vnode_t *vp, 1153 bhv_vnode_t *vp,
1157 xfs_inode_t *ip, 1154 xfs_inode_t *ip,
1158 struct file *filp, 1155 struct file *filp,
1159 unsigned int cmd, 1156 unsigned int cmd,
@@ -1173,7 +1170,7 @@ xfs_ioc_xattr(
1173 case XFS_IOC_FSGETXATTR: { 1170 case XFS_IOC_FSGETXATTR: {
1174 vattr->va_mask = XFS_AT_XFLAGS | XFS_AT_EXTSIZE | \ 1171 vattr->va_mask = XFS_AT_XFLAGS | XFS_AT_EXTSIZE | \
1175 XFS_AT_NEXTENTS | XFS_AT_PROJID; 1172 XFS_AT_NEXTENTS | XFS_AT_PROJID;
1176 VOP_GETATTR(vp, vattr, 0, NULL, error); 1173 error = bhv_vop_getattr(vp, vattr, 0, NULL);
1177 if (unlikely(error)) { 1174 if (unlikely(error)) {
1178 error = -error; 1175 error = -error;
1179 break; 1176 break;
@@ -1206,7 +1203,7 @@ xfs_ioc_xattr(
1206 vattr->va_extsize = fa.fsx_extsize; 1203 vattr->va_extsize = fa.fsx_extsize;
1207 vattr->va_projid = fa.fsx_projid; 1204 vattr->va_projid = fa.fsx_projid;
1208 1205
1209 VOP_SETATTR(vp, vattr, attr_flags, NULL, error); 1206 error = bhv_vop_setattr(vp, vattr, attr_flags, NULL);
1210 if (likely(!error)) 1207 if (likely(!error))
1211 __vn_revalidate(vp, vattr); /* update flags */ 1208 __vn_revalidate(vp, vattr); /* update flags */
1212 error = -error; 1209 error = -error;
@@ -1216,7 +1213,7 @@ xfs_ioc_xattr(
1216 case XFS_IOC_FSGETXATTRA: { 1213 case XFS_IOC_FSGETXATTRA: {
1217 vattr->va_mask = XFS_AT_XFLAGS | XFS_AT_EXTSIZE | \ 1214 vattr->va_mask = XFS_AT_XFLAGS | XFS_AT_EXTSIZE | \
1218 XFS_AT_ANEXTENTS | XFS_AT_PROJID; 1215 XFS_AT_ANEXTENTS | XFS_AT_PROJID;
1219 VOP_GETATTR(vp, vattr, 0, NULL, error); 1216 error = bhv_vop_getattr(vp, vattr, 0, NULL);
1220 if (unlikely(error)) { 1217 if (unlikely(error)) {
1221 error = -error; 1218 error = -error;
1222 break; 1219 break;
@@ -1262,7 +1259,7 @@ xfs_ioc_xattr(
1262 vattr->va_xflags = xfs_merge_ioc_xflags(flags, 1259 vattr->va_xflags = xfs_merge_ioc_xflags(flags,
1263 xfs_ip2xflags(ip)); 1260 xfs_ip2xflags(ip));
1264 1261
1265 VOP_SETATTR(vp, vattr, attr_flags, NULL, error); 1262 error = bhv_vop_setattr(vp, vattr, attr_flags, NULL);
1266 if (likely(!error)) 1263 if (likely(!error))
1267 __vn_revalidate(vp, vattr); /* update flags */ 1264 __vn_revalidate(vp, vattr); /* update flags */
1268 error = -error; 1265 error = -error;
diff --git a/fs/xfs/linux-2.6/xfs_ioctl32.c b/fs/xfs/linux-2.6/xfs_ioctl32.c
index 251bfe451a3f..601f01c92f7f 100644
--- a/fs/xfs/linux-2.6/xfs_ioctl32.c
+++ b/fs/xfs/linux-2.6/xfs_ioctl32.c
@@ -114,7 +114,7 @@ xfs_compat_ioctl(
114 unsigned long arg) 114 unsigned long arg)
115{ 115{
116 struct inode *inode = file->f_dentry->d_inode; 116 struct inode *inode = file->f_dentry->d_inode;
117 vnode_t *vp = vn_from_inode(inode); 117 bhv_vnode_t *vp = vn_from_inode(inode);
118 int error; 118 int error;
119 119
120 switch (cmd) { 120 switch (cmd) {
@@ -193,7 +193,7 @@ xfs_compat_ioctl(
193 return -ENOIOCTLCMD; 193 return -ENOIOCTLCMD;
194 } 194 }
195 195
196 VOP_IOCTL(vp, inode, file, mode, cmd, (void __user *)arg, error); 196 error = bhv_vop_ioctl(vp, inode, file, mode, cmd, (void __user *)arg);
197 VMODIFY(vp); 197 VMODIFY(vp);
198 198
199 return error; 199 return error;
diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c
index 0da1d6b081e7..0857658882e0 100644
--- a/fs/xfs/linux-2.6/xfs_iops.c
+++ b/fs/xfs/linux-2.6/xfs_iops.c
@@ -61,7 +61,7 @@
61 */ 61 */
62xfs_inode_t * 62xfs_inode_t *
63xfs_vtoi( 63xfs_vtoi(
64 struct vnode *vp) 64 bhv_vnode_t *vp)
65{ 65{
66 bhv_desc_t *bdp; 66 bhv_desc_t *bdp;
67 67
@@ -80,7 +80,7 @@ void
80xfs_synchronize_atime( 80xfs_synchronize_atime(
81 xfs_inode_t *ip) 81 xfs_inode_t *ip)
82{ 82{
83 vnode_t *vp; 83 bhv_vnode_t *vp;
84 84
85 vp = XFS_ITOV_NULL(ip); 85 vp = XFS_ITOV_NULL(ip);
86 if (vp) { 86 if (vp) {
@@ -202,12 +202,8 @@ xfs_validate_fields(
202 struct inode *ip, 202 struct inode *ip,
203 struct vattr *vattr) 203 struct vattr *vattr)
204{ 204{
205 vnode_t *vp = vn_from_inode(ip);
206 int error;
207
208 vattr->va_mask = XFS_AT_NLINK|XFS_AT_SIZE|XFS_AT_NBLOCKS; 205 vattr->va_mask = XFS_AT_NLINK|XFS_AT_SIZE|XFS_AT_NBLOCKS;
209 VOP_GETATTR(vp, vattr, ATTR_LAZY, NULL, error); 206 if (!bhv_vop_getattr(vn_from_inode(ip), vattr, ATTR_LAZY, NULL)) {
210 if (likely(!error)) {
211 ip->i_nlink = vattr->va_nlink; 207 ip->i_nlink = vattr->va_nlink;
212 ip->i_blocks = vattr->va_nblocks; 208 ip->i_blocks = vattr->va_nblocks;
213 209
@@ -225,7 +221,7 @@ xfs_validate_fields(
225 */ 221 */
226STATIC int 222STATIC int
227xfs_init_security( 223xfs_init_security(
228 struct vnode *vp, 224 bhv_vnode_t *vp,
229 struct inode *dir) 225 struct inode *dir)
230{ 226{
231 struct inode *ip = vn_to_inode(vp); 227 struct inode *ip = vn_to_inode(vp);
@@ -241,7 +237,7 @@ xfs_init_security(
241 return -error; 237 return -error;
242 } 238 }
243 239
244 VOP_ATTR_SET(vp, name, value, length, ATTR_SECURE, NULL, error); 240 error = bhv_vop_attr_set(vp, name, value, length, ATTR_SECURE, NULL);
245 if (!error) 241 if (!error)
246 VMODIFY(vp); 242 VMODIFY(vp);
247 243
@@ -264,13 +260,12 @@ xfs_has_fs_struct(struct task_struct *task)
264 260
265STATIC inline void 261STATIC inline void
266xfs_cleanup_inode( 262xfs_cleanup_inode(
267 vnode_t *dvp, 263 bhv_vnode_t *dvp,
268 vnode_t *vp, 264 bhv_vnode_t *vp,
269 struct dentry *dentry, 265 struct dentry *dentry,
270 int mode) 266 int mode)
271{ 267{
272 struct dentry teardown = {}; 268 struct dentry teardown = {};
273 int error;
274 269
275 /* Oh, the horror. 270 /* Oh, the horror.
276 * If we can't add the ACL or we fail in 271 * If we can't add the ACL or we fail in
@@ -281,9 +276,9 @@ xfs_cleanup_inode(
281 teardown.d_name = dentry->d_name; 276 teardown.d_name = dentry->d_name;
282 277
283 if (S_ISDIR(mode)) 278 if (S_ISDIR(mode))
284 VOP_RMDIR(dvp, &teardown, NULL, error); 279 bhv_vop_rmdir(dvp, &teardown, NULL);
285 else 280 else
286 VOP_REMOVE(dvp, &teardown, NULL, error); 281 bhv_vop_remove(dvp, &teardown, NULL);
287 VN_RELE(vp); 282 VN_RELE(vp);
288} 283}
289 284
@@ -296,7 +291,7 @@ xfs_vn_mknod(
296{ 291{
297 struct inode *ip; 292 struct inode *ip;
298 vattr_t vattr = { 0 }; 293 vattr_t vattr = { 0 };
299 vnode_t *vp = NULL, *dvp = vn_from_inode(dir); 294 bhv_vnode_t *vp = NULL, *dvp = vn_from_inode(dir);
300 xfs_acl_t *default_acl = NULL; 295 xfs_acl_t *default_acl = NULL;
301 attrexists_t test_default_acl = _ACL_DEFAULT_EXISTS; 296 attrexists_t test_default_acl = _ACL_DEFAULT_EXISTS;
302 int error; 297 int error;
@@ -330,10 +325,10 @@ xfs_vn_mknod(
330 vattr.va_mask |= XFS_AT_RDEV; 325 vattr.va_mask |= XFS_AT_RDEV;
331 /*FALLTHROUGH*/ 326 /*FALLTHROUGH*/
332 case S_IFREG: 327 case S_IFREG:
333 VOP_CREATE(dvp, dentry, &vattr, &vp, NULL, error); 328 error = bhv_vop_create(dvp, dentry, &vattr, &vp, NULL);
334 break; 329 break;
335 case S_IFDIR: 330 case S_IFDIR:
336 VOP_MKDIR(dvp, dentry, &vattr, &vp, NULL, error); 331 error = bhv_vop_mkdir(dvp, dentry, &vattr, &vp, NULL);
337 break; 332 break;
338 default: 333 default:
339 error = EINVAL; 334 error = EINVAL;
@@ -396,14 +391,14 @@ xfs_vn_lookup(
396 struct dentry *dentry, 391 struct dentry *dentry,
397 struct nameidata *nd) 392 struct nameidata *nd)
398{ 393{
399 struct vnode *vp = vn_from_inode(dir), *cvp; 394 bhv_vnode_t *vp = vn_from_inode(dir), *cvp;
400 int error; 395 int error;
401 396
402 if (dentry->d_name.len >= MAXNAMELEN) 397 if (dentry->d_name.len >= MAXNAMELEN)
403 return ERR_PTR(-ENAMETOOLONG); 398 return ERR_PTR(-ENAMETOOLONG);
404 399
405 VOP_LOOKUP(vp, dentry, &cvp, 0, NULL, NULL, error); 400 error = bhv_vop_lookup(vp, dentry, &cvp, 0, NULL, NULL);
406 if (error) { 401 if (unlikely(error)) {
407 if (unlikely(error != ENOENT)) 402 if (unlikely(error != ENOENT))
408 return ERR_PTR(-error); 403 return ERR_PTR(-error);
409 d_add(dentry, NULL); 404 d_add(dentry, NULL);
@@ -420,8 +415,8 @@ xfs_vn_link(
420 struct dentry *dentry) 415 struct dentry *dentry)
421{ 416{
422 struct inode *ip; /* inode of guy being linked to */ 417 struct inode *ip; /* inode of guy being linked to */
423 vnode_t *tdvp; /* target directory for new name/link */ 418 bhv_vnode_t *tdvp; /* target directory for new name/link */
424 vnode_t *vp; /* vp of name being linked */ 419 bhv_vnode_t *vp; /* vp of name being linked */
425 vattr_t vattr; 420 vattr_t vattr;
426 int error; 421 int error;
427 422
@@ -432,7 +427,7 @@ xfs_vn_link(
432 tdvp = vn_from_inode(dir); 427 tdvp = vn_from_inode(dir);
433 vp = vn_from_inode(ip); 428 vp = vn_from_inode(ip);
434 429
435 VOP_LINK(tdvp, vp, dentry, NULL, error); 430 error = bhv_vop_link(tdvp, vp, dentry, NULL);
436 if (likely(!error)) { 431 if (likely(!error)) {
437 VMODIFY(tdvp); 432 VMODIFY(tdvp);
438 VN_HOLD(vp); 433 VN_HOLD(vp);
@@ -448,14 +443,14 @@ xfs_vn_unlink(
448 struct dentry *dentry) 443 struct dentry *dentry)
449{ 444{
450 struct inode *inode; 445 struct inode *inode;
451 vnode_t *dvp; /* directory containing name to remove */ 446 bhv_vnode_t *dvp; /* directory containing name to remove */
452 vattr_t vattr; 447 vattr_t vattr;
453 int error; 448 int error;
454 449
455 inode = dentry->d_inode; 450 inode = dentry->d_inode;
456 dvp = vn_from_inode(dir); 451 dvp = vn_from_inode(dir);
457 452
458 VOP_REMOVE(dvp, dentry, NULL, error); 453 error = bhv_vop_remove(dvp, dentry, NULL);
459 if (likely(!error)) { 454 if (likely(!error)) {
460 xfs_validate_fields(dir, &vattr); /* size needs update */ 455 xfs_validate_fields(dir, &vattr); /* size needs update */
461 xfs_validate_fields(inode, &vattr); 456 xfs_validate_fields(inode, &vattr);
@@ -470,27 +465,26 @@ xfs_vn_symlink(
470 const char *symname) 465 const char *symname)
471{ 466{
472 struct inode *ip; 467 struct inode *ip;
473 vattr_t vattr = { 0 }; 468 vattr_t va = { 0 };
474 vnode_t *dvp; /* directory containing name of symlink */ 469 bhv_vnode_t *dvp; /* directory containing name of symlink */
475 vnode_t *cvp; /* used to lookup symlink to put in dentry */ 470 bhv_vnode_t *cvp; /* used to lookup symlink to put in dentry */
476 int error; 471 int error;
477 472
478 dvp = vn_from_inode(dir); 473 dvp = vn_from_inode(dir);
479 cvp = NULL; 474 cvp = NULL;
480 475
481 vattr.va_mode = S_IFLNK | 476 va.va_mode = S_IFLNK |
482 (irix_symlink_mode ? 0777 & ~current->fs->umask : S_IRWXUGO); 477 (irix_symlink_mode ? 0777 & ~current->fs->umask : S_IRWXUGO);
483 vattr.va_mask = XFS_AT_TYPE|XFS_AT_MODE; 478 va.va_mask = XFS_AT_TYPE|XFS_AT_MODE;
484 479
485 error = 0; 480 error = bhv_vop_symlink(dvp, dentry, &va, (char *)symname, &cvp, NULL);
486 VOP_SYMLINK(dvp, dentry, &vattr, (char *)symname, &cvp, NULL, error);
487 if (likely(!error && cvp)) { 481 if (likely(!error && cvp)) {
488 error = xfs_init_security(cvp, dir); 482 error = xfs_init_security(cvp, dir);
489 if (likely(!error)) { 483 if (likely(!error)) {
490 ip = vn_to_inode(cvp); 484 ip = vn_to_inode(cvp);
491 d_instantiate(dentry, ip); 485 d_instantiate(dentry, ip);
492 xfs_validate_fields(dir, &vattr); 486 xfs_validate_fields(dir, &va);
493 xfs_validate_fields(ip, &vattr); 487 xfs_validate_fields(ip, &va);
494 } else { 488 } else {
495 xfs_cleanup_inode(dvp, cvp, dentry, 0); 489 xfs_cleanup_inode(dvp, cvp, dentry, 0);
496 } 490 }
@@ -504,11 +498,11 @@ xfs_vn_rmdir(
504 struct dentry *dentry) 498 struct dentry *dentry)
505{ 499{
506 struct inode *inode = dentry->d_inode; 500 struct inode *inode = dentry->d_inode;
507 vnode_t *dvp = vn_from_inode(dir); 501 bhv_vnode_t *dvp = vn_from_inode(dir);
508 vattr_t vattr; 502 vattr_t vattr;
509 int error; 503 int error;
510 504
511 VOP_RMDIR(dvp, dentry, NULL, error); 505 error = bhv_vop_rmdir(dvp, dentry, NULL);
512 if (likely(!error)) { 506 if (likely(!error)) {
513 xfs_validate_fields(inode, &vattr); 507 xfs_validate_fields(inode, &vattr);
514 xfs_validate_fields(dir, &vattr); 508 xfs_validate_fields(dir, &vattr);
@@ -524,15 +518,15 @@ xfs_vn_rename(
524 struct dentry *ndentry) 518 struct dentry *ndentry)
525{ 519{
526 struct inode *new_inode = ndentry->d_inode; 520 struct inode *new_inode = ndentry->d_inode;
527 vnode_t *fvp; /* from directory */ 521 bhv_vnode_t *fvp; /* from directory */
528 vnode_t *tvp; /* target directory */ 522 bhv_vnode_t *tvp; /* target directory */
529 vattr_t vattr; 523 vattr_t vattr;
530 int error; 524 int error;
531 525
532 fvp = vn_from_inode(odir); 526 fvp = vn_from_inode(odir);
533 tvp = vn_from_inode(ndir); 527 tvp = vn_from_inode(ndir);
534 528
535 VOP_RENAME(fvp, odentry, tvp, ndentry, NULL, error); 529 error = bhv_vop_rename(fvp, odentry, tvp, ndentry, NULL);
536 if (likely(!error)) { 530 if (likely(!error)) {
537 if (new_inode) 531 if (new_inode)
538 xfs_validate_fields(new_inode, &vattr); 532 xfs_validate_fields(new_inode, &vattr);
@@ -553,7 +547,7 @@ xfs_vn_follow_link(
553 struct dentry *dentry, 547 struct dentry *dentry,
554 struct nameidata *nd) 548 struct nameidata *nd)
555{ 549{
556 vnode_t *vp; 550 bhv_vnode_t *vp;
557 uio_t *uio; 551 uio_t *uio;
558 iovec_t iov; 552 iovec_t iov;
559 int error; 553 int error;
@@ -586,8 +580,8 @@ xfs_vn_follow_link(
586 uio->uio_resid = MAXPATHLEN; 580 uio->uio_resid = MAXPATHLEN;
587 uio->uio_iovcnt = 1; 581 uio->uio_iovcnt = 1;
588 582
589 VOP_READLINK(vp, uio, 0, NULL, error); 583 error = bhv_vop_readlink(vp, uio, 0, NULL);
590 if (error) { 584 if (unlikely(error)) {
591 kfree(link); 585 kfree(link);
592 link = ERR_PTR(-error); 586 link = ERR_PTR(-error);
593 } else { 587 } else {
@@ -618,12 +612,7 @@ xfs_vn_permission(
618 int mode, 612 int mode,
619 struct nameidata *nd) 613 struct nameidata *nd)
620{ 614{
621 vnode_t *vp = vn_from_inode(inode); 615 return -bhv_vop_access(vn_from_inode(inode), mode << 6, NULL);
622 int error;
623
624 mode <<= 6; /* convert from linux to vnode access bits */
625 VOP_ACCESS(vp, mode, NULL, error);
626 return -error;
627} 616}
628#else 617#else
629#define xfs_vn_permission NULL 618#define xfs_vn_permission NULL
@@ -636,7 +625,7 @@ xfs_vn_getattr(
636 struct kstat *stat) 625 struct kstat *stat)
637{ 626{
638 struct inode *inode = dentry->d_inode; 627 struct inode *inode = dentry->d_inode;
639 vnode_t *vp = vn_from_inode(inode); 628 bhv_vnode_t *vp = vn_from_inode(inode);
640 int error = 0; 629 int error = 0;
641 630
642 if (unlikely(vp->v_flag & VMODIFIED)) 631 if (unlikely(vp->v_flag & VMODIFIED))
@@ -653,7 +642,7 @@ xfs_vn_setattr(
653{ 642{
654 struct inode *inode = dentry->d_inode; 643 struct inode *inode = dentry->d_inode;
655 unsigned int ia_valid = attr->ia_valid; 644 unsigned int ia_valid = attr->ia_valid;
656 vnode_t *vp = vn_from_inode(inode); 645 bhv_vnode_t *vp = vn_from_inode(inode);
657 vattr_t vattr = { 0 }; 646 vattr_t vattr = { 0 };
658 int flags = 0; 647 int flags = 0;
659 int error; 648 int error;
@@ -697,7 +686,7 @@ xfs_vn_setattr(
697 flags |= ATTR_NONBLOCK; 686 flags |= ATTR_NONBLOCK;
698#endif 687#endif
699 688
700 VOP_SETATTR(vp, &vattr, flags, NULL, error); 689 error = bhv_vop_setattr(vp, &vattr, flags, NULL);
701 if (likely(!error)) 690 if (likely(!error))
702 __vn_revalidate(vp, &vattr); 691 __vn_revalidate(vp, &vattr);
703 return -error; 692 return -error;
@@ -718,7 +707,7 @@ xfs_vn_setxattr(
718 size_t size, 707 size_t size,
719 int flags) 708 int flags)
720{ 709{
721 vnode_t *vp = vn_from_inode(dentry->d_inode); 710 bhv_vnode_t *vp = vn_from_inode(dentry->d_inode);
722 char *attr = (char *)name; 711 char *attr = (char *)name;
723 attrnames_t *namesp; 712 attrnames_t *namesp;
724 int xflags = 0; 713 int xflags = 0;
@@ -748,7 +737,7 @@ xfs_vn_getxattr(
748 void *data, 737 void *data,
749 size_t size) 738 size_t size)
750{ 739{
751 vnode_t *vp = vn_from_inode(dentry->d_inode); 740 bhv_vnode_t *vp = vn_from_inode(dentry->d_inode);
752 char *attr = (char *)name; 741 char *attr = (char *)name;
753 attrnames_t *namesp; 742 attrnames_t *namesp;
754 int xflags = 0; 743 int xflags = 0;
@@ -777,7 +766,7 @@ xfs_vn_listxattr(
777 char *data, 766 char *data,
778 size_t size) 767 size_t size)
779{ 768{
780 vnode_t *vp = vn_from_inode(dentry->d_inode); 769 bhv_vnode_t *vp = vn_from_inode(dentry->d_inode);
781 int error, xflags = ATTR_KERNAMELS; 770 int error, xflags = ATTR_KERNAMELS;
782 ssize_t result; 771 ssize_t result;
783 772
@@ -796,7 +785,7 @@ xfs_vn_removexattr(
796 struct dentry *dentry, 785 struct dentry *dentry,
797 const char *name) 786 const char *name)
798{ 787{
799 vnode_t *vp = vn_from_inode(dentry->d_inode); 788 bhv_vnode_t *vp = vn_from_inode(dentry->d_inode);
800 char *attr = (char *)name; 789 char *attr = (char *)name;
801 attrnames_t *namesp; 790 attrnames_t *namesp;
802 int xflags = 0; 791 int xflags = 0;
diff --git a/fs/xfs/linux-2.6/xfs_lrw.c b/fs/xfs/linux-2.6/xfs_lrw.c
index 6fbdca3eaa7a..a9b83018f0fb 100644
--- a/fs/xfs/linux-2.6/xfs_lrw.c
+++ b/fs/xfs/linux-2.6/xfs_lrw.c
@@ -206,7 +206,7 @@ xfs_read(
206 xfs_fsize_t n; 206 xfs_fsize_t n;
207 xfs_inode_t *ip; 207 xfs_inode_t *ip;
208 xfs_mount_t *mp; 208 xfs_mount_t *mp;
209 vnode_t *vp; 209 bhv_vnode_t *vp;
210 unsigned long seg; 210 unsigned long seg;
211 211
212 ip = XFS_BHVTOI(bdp); 212 ip = XFS_BHVTOI(bdp);
@@ -271,7 +271,7 @@ xfs_read(
271 } 271 }
272 272
273 if (unlikely((ioflags & IO_ISDIRECT) && VN_CACHED(vp))) 273 if (unlikely((ioflags & IO_ISDIRECT) && VN_CACHED(vp)))
274 VOP_FLUSHINVAL_PAGES(vp, ctooff(offtoct(*offset)), 274 bhv_vop_flushinval_pages(vp, ctooff(offtoct(*offset)),
275 -1, FI_REMAPF_LOCKED); 275 -1, FI_REMAPF_LOCKED);
276 276
277 xfs_rw_enter_trace(XFS_READ_ENTER, &ip->i_iocore, 277 xfs_rw_enter_trace(XFS_READ_ENTER, &ip->i_iocore,
@@ -499,7 +499,7 @@ xfs_zero_last_block(
499 499
500int /* error (positive) */ 500int /* error (positive) */
501xfs_zero_eof( 501xfs_zero_eof(
502 vnode_t *vp, 502 bhv_vnode_t *vp,
503 xfs_iocore_t *io, 503 xfs_iocore_t *io,
504 xfs_off_t offset, /* starting I/O offset */ 504 xfs_off_t offset, /* starting I/O offset */
505 xfs_fsize_t isize, /* current inode size */ 505 xfs_fsize_t isize, /* current inode size */
@@ -626,7 +626,7 @@ xfs_write(
626 ssize_t ret = 0, error = 0; 626 ssize_t ret = 0, error = 0;
627 xfs_fsize_t isize, new_size; 627 xfs_fsize_t isize, new_size;
628 xfs_iocore_t *io; 628 xfs_iocore_t *io;
629 vnode_t *vp; 629 bhv_vnode_t *vp;
630 unsigned long seg; 630 unsigned long seg;
631 int iolock; 631 int iolock;
632 int eventsent = 0; 632 int eventsent = 0;
@@ -803,7 +803,7 @@ retry:
803 if (need_flush) { 803 if (need_flush) {
804 xfs_inval_cached_trace(io, pos, -1, 804 xfs_inval_cached_trace(io, pos, -1,
805 ctooff(offtoct(pos)), -1); 805 ctooff(offtoct(pos)), -1);
806 VOP_FLUSHINVAL_PAGES(vp, ctooff(offtoct(pos)), 806 bhv_vop_flushinval_pages(vp, ctooff(offtoct(pos)),
807 -1, FI_REMAPF_LOCKED); 807 -1, FI_REMAPF_LOCKED);
808 } 808 }
809 809
diff --git a/fs/xfs/linux-2.6/xfs_lrw.h b/fs/xfs/linux-2.6/xfs_lrw.h
index dc49050688ca..c77e62efb742 100644
--- a/fs/xfs/linux-2.6/xfs_lrw.h
+++ b/fs/xfs/linux-2.6/xfs_lrw.h
@@ -18,8 +18,8 @@
18#ifndef __XFS_LRW_H__ 18#ifndef __XFS_LRW_H__
19#define __XFS_LRW_H__ 19#define __XFS_LRW_H__
20 20
21struct vnode;
22struct bhv_desc; 21struct bhv_desc;
22struct bhv_vnode;
23struct xfs_mount; 23struct xfs_mount;
24struct xfs_iocore; 24struct xfs_iocore;
25struct xfs_inode; 25struct xfs_inode;
@@ -82,7 +82,7 @@ extern int xfsbdstrat(struct xfs_mount *, struct xfs_buf *);
82extern int xfs_bdstrat_cb(struct xfs_buf *); 82extern int xfs_bdstrat_cb(struct xfs_buf *);
83extern int xfs_dev_is_read_only(struct xfs_mount *, char *); 83extern int xfs_dev_is_read_only(struct xfs_mount *, char *);
84 84
85extern int xfs_zero_eof(struct vnode *, struct xfs_iocore *, xfs_off_t, 85extern int xfs_zero_eof(struct bhv_vnode *, struct xfs_iocore *, xfs_off_t,
86 xfs_fsize_t, xfs_fsize_t); 86 xfs_fsize_t, xfs_fsize_t);
87extern ssize_t xfs_read(struct bhv_desc *, struct kiocb *, 87extern ssize_t xfs_read(struct bhv_desc *, struct kiocb *,
88 const struct iovec *, unsigned int, 88 const struct iovec *, unsigned int,
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c
index 97dbcb68b25f..b7aad3cfdfeb 100644
--- a/fs/xfs/linux-2.6/xfs_super.c
+++ b/fs/xfs/linux-2.6/xfs_super.c
@@ -151,7 +151,7 @@ xfs_set_inodeops(
151STATIC __inline__ void 151STATIC __inline__ void
152xfs_revalidate_inode( 152xfs_revalidate_inode(
153 xfs_mount_t *mp, 153 xfs_mount_t *mp,
154 vnode_t *vp, 154 bhv_vnode_t *vp,
155 xfs_inode_t *ip) 155 xfs_inode_t *ip)
156{ 156{
157 struct inode *inode = vn_to_inode(vp); 157 struct inode *inode = vn_to_inode(vp);
@@ -206,7 +206,7 @@ xfs_revalidate_inode(
206void 206void
207xfs_initialize_vnode( 207xfs_initialize_vnode(
208 bhv_desc_t *bdp, 208 bhv_desc_t *bdp,
209 vnode_t *vp, 209 bhv_vnode_t *vp,
210 bhv_desc_t *inode_bhv, 210 bhv_desc_t *inode_bhv,
211 int unlock) 211 int unlock)
212{ 212{
@@ -336,7 +336,7 @@ STATIC struct inode *
336xfs_fs_alloc_inode( 336xfs_fs_alloc_inode(
337 struct super_block *sb) 337 struct super_block *sb)
338{ 338{
339 vnode_t *vp; 339 bhv_vnode_t *vp;
340 340
341 vp = kmem_zone_alloc(xfs_vnode_zone, KM_SLEEP); 341 vp = kmem_zone_alloc(xfs_vnode_zone, KM_SLEEP);
342 if (unlikely(!vp)) 342 if (unlikely(!vp))
@@ -359,13 +359,13 @@ xfs_fs_inode_init_once(
359{ 359{
360 if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) == 360 if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
361 SLAB_CTOR_CONSTRUCTOR) 361 SLAB_CTOR_CONSTRUCTOR)
362 inode_init_once(vn_to_inode((vnode_t *)vnode)); 362 inode_init_once(vn_to_inode((bhv_vnode_t *)vnode));
363} 363}
364 364
365STATIC int 365STATIC int
366xfs_init_zones(void) 366xfs_init_zones(void)
367{ 367{
368 xfs_vnode_zone = kmem_zone_init_flags(sizeof(vnode_t), "xfs_vnode_t", 368 xfs_vnode_zone = kmem_zone_init_flags(sizeof(bhv_vnode_t), "xfs_vnode",
369 KM_ZONE_HWALIGN | KM_ZONE_RECLAIM | 369 KM_ZONE_HWALIGN | KM_ZONE_RECLAIM |
370 KM_ZONE_SPREAD, 370 KM_ZONE_SPREAD,
371 xfs_fs_inode_init_once); 371 xfs_fs_inode_init_once);
@@ -409,22 +409,17 @@ xfs_fs_write_inode(
409 struct inode *inode, 409 struct inode *inode,
410 int sync) 410 int sync)
411{ 411{
412 vnode_t *vp = vn_from_inode(inode); 412 bhv_vnode_t *vp = vn_from_inode(inode);
413 int error = 0, flags = FLUSH_INODE; 413 int error = 0, flags = FLUSH_INODE;
414 414
415 if (vp) { 415 if (vp) {
416 vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address); 416 vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address);
417 if (sync) 417 if (sync)
418 flags |= FLUSH_SYNC; 418 flags |= FLUSH_SYNC;
419 VOP_IFLUSH(vp, flags, error); 419 error = bhv_vop_iflush(vp, flags);
420 if (error == EAGAIN) { 420 if (error == EAGAIN)
421 if (sync) 421 error = sync? bhv_vop_iflush(vp, flags | FLUSH_LOG) : 0;
422 VOP_IFLUSH(vp, flags | FLUSH_LOG, error);
423 else
424 error = 0;
425 }
426 } 422 }
427
428 return -error; 423 return -error;
429} 424}
430 425
@@ -432,8 +427,7 @@ STATIC void
432xfs_fs_clear_inode( 427xfs_fs_clear_inode(
433 struct inode *inode) 428 struct inode *inode)
434{ 429{
435 vnode_t *vp = vn_from_inode(inode); 430 bhv_vnode_t *vp = vn_from_inode(inode);
436 int error, cache;
437 431
438 vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address); 432 vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address);
439 433
@@ -446,20 +440,18 @@ xfs_fs_clear_inode(
446 * This can happen because xfs_iget_core calls xfs_idestroy if we 440 * This can happen because xfs_iget_core calls xfs_idestroy if we
447 * find an inode with di_mode == 0 but without IGET_CREATE set. 441 * find an inode with di_mode == 0 but without IGET_CREATE set.
448 */ 442 */
449 if (vp->v_fbhv) 443 if (VNHEAD(vp))
450 VOP_INACTIVE(vp, NULL, cache); 444 bhv_vop_inactive(vp, NULL);
451 445
452 VN_LOCK(vp); 446 VN_LOCK(vp);
453 vp->v_flag &= ~VMODIFIED; 447 vp->v_flag &= ~VMODIFIED;
454 VN_UNLOCK(vp, 0); 448 VN_UNLOCK(vp, 0);
455 449
456 if (vp->v_fbhv) { 450 if (VNHEAD(vp))
457 VOP_RECLAIM(vp, error); 451 if (bhv_vop_reclaim(vp))
458 if (error) 452 panic("%s: cannot reclaim 0x%p\n", __FUNCTION__, vp);
459 panic("vn_purge: cannot reclaim");
460 }
461 453
462 ASSERT(vp->v_fbhv == NULL); 454 ASSERT(VNHEAD(vp) == NULL);
463 455
464#ifdef XFS_VNODE_TRACE 456#ifdef XFS_VNODE_TRACE
465 ktrace_free(vp->v_trace); 457 ktrace_free(vp->v_trace);
@@ -789,7 +781,7 @@ xfs_fs_fill_super(
789 void *data, 781 void *data,
790 int silent) 782 int silent)
791{ 783{
792 vnode_t *rootvp; 784 struct bhv_vnode *rootvp;
793 struct bhv_vfs *vfsp = vfs_allocate(sb); 785 struct bhv_vfs *vfsp = vfs_allocate(sb);
794 struct xfs_mount_args *args = xfs_args_allocate(sb, silent); 786 struct xfs_mount_args *args = xfs_args_allocate(sb, silent);
795 struct kstatfs statvfs; 787 struct kstatfs statvfs;
diff --git a/fs/xfs/linux-2.6/xfs_super.h b/fs/xfs/linux-2.6/xfs_super.h
index 376b96cb513a..33dd1ca13245 100644
--- a/fs/xfs/linux-2.6/xfs_super.h
+++ b/fs/xfs/linux-2.6/xfs_super.h
@@ -105,7 +105,7 @@ struct block_device;
105 105
106extern __uint64_t xfs_max_file_offset(unsigned int); 106extern __uint64_t xfs_max_file_offset(unsigned int);
107 107
108extern void xfs_initialize_vnode(bhv_desc_t *, vnode_t *, bhv_desc_t *, int); 108extern void xfs_initialize_vnode(bhv_desc_t *, bhv_vnode_t *, bhv_desc_t *, int);
109 109
110extern void xfs_flush_inode(struct xfs_inode *); 110extern void xfs_flush_inode(struct xfs_inode *);
111extern void xfs_flush_device(struct xfs_inode *); 111extern void xfs_flush_device(struct xfs_inode *);
diff --git a/fs/xfs/linux-2.6/xfs_vfs.c b/fs/xfs/linux-2.6/xfs_vfs.c
index 9f9bc894deb9..a91ecfa9c8aa 100644
--- a/fs/xfs/linux-2.6/xfs_vfs.c
+++ b/fs/xfs/linux-2.6/xfs_vfs.c
@@ -104,7 +104,7 @@ vfs_mntupdate(
104int 104int
105vfs_root( 105vfs_root(
106 struct bhv_desc *bdp, 106 struct bhv_desc *bdp,
107 struct vnode **vpp) 107 struct bhv_vnode **vpp)
108{ 108{
109 struct bhv_desc *next = bdp; 109 struct bhv_desc *next = bdp;
110 110
@@ -118,7 +118,7 @@ int
118vfs_statvfs( 118vfs_statvfs(
119 struct bhv_desc *bdp, 119 struct bhv_desc *bdp,
120 xfs_statfs_t *sp, 120 xfs_statfs_t *sp,
121 struct vnode *vp) 121 struct bhv_vnode *vp)
122{ 122{
123 struct bhv_desc *next = bdp; 123 struct bhv_desc *next = bdp;
124 124
@@ -145,7 +145,7 @@ vfs_sync(
145int 145int
146vfs_vget( 146vfs_vget(
147 struct bhv_desc *bdp, 147 struct bhv_desc *bdp,
148 struct vnode **vpp, 148 struct bhv_vnode **vpp,
149 struct fid *fidp) 149 struct fid *fidp)
150{ 150{
151 struct bhv_desc *next = bdp; 151 struct bhv_desc *next = bdp;
@@ -187,7 +187,7 @@ vfs_quotactl(
187void 187void
188vfs_init_vnode( 188vfs_init_vnode(
189 struct bhv_desc *bdp, 189 struct bhv_desc *bdp,
190 struct vnode *vp, 190 struct bhv_vnode *vp,
191 struct bhv_desc *bp, 191 struct bhv_desc *bp,
192 int unlock) 192 int unlock)
193{ 193{
diff --git a/fs/xfs/linux-2.6/xfs_vfs.h b/fs/xfs/linux-2.6/xfs_vfs.h
index 55f0afd3e794..1a3a2dd4b97e 100644
--- a/fs/xfs/linux-2.6/xfs_vfs.h
+++ b/fs/xfs/linux-2.6/xfs_vfs.h
@@ -22,9 +22,9 @@
22#include "xfs_fs.h" 22#include "xfs_fs.h"
23 23
24struct bhv_vfs; 24struct bhv_vfs;
25struct bhv_vnode;
25struct fid; 26struct fid;
26struct cred; 27struct cred;
27struct vnode;
28struct statfs; 28struct statfs;
29struct seq_file; 29struct seq_file;
30struct super_block; 30struct super_block;
@@ -53,8 +53,6 @@ typedef struct bhv_vfs {
53 wait_queue_head_t vfs_wait_single_sync_task; 53 wait_queue_head_t vfs_wait_single_sync_task;
54} bhv_vfs_t; 54} bhv_vfs_t;
55 55
56#define vfs_fbhv vfs_bh.bh_first /* 1st on vfs behavior chain */
57
58#define bhvtovfs(bdp) ( (struct bhv_vfs *)BHV_VOBJ(bdp) ) 56#define bhvtovfs(bdp) ( (struct bhv_vfs *)BHV_VOBJ(bdp) )
59#define bhvtovfsops(bdp) ( (struct bhv_vfsops *)BHV_OPS(bdp) ) 57#define bhvtovfsops(bdp) ( (struct bhv_vfsops *)BHV_OPS(bdp) )
60#define VFS_BHVHEAD(vfs) ( &(vfs)->vfs_bh ) 58#define VFS_BHVHEAD(vfs) ( &(vfs)->vfs_bh )
@@ -110,14 +108,15 @@ typedef int (*vfs_showargs_t)(bhv_desc_t *, struct seq_file *);
110typedef int (*vfs_unmount_t)(bhv_desc_t *, int, struct cred *); 108typedef int (*vfs_unmount_t)(bhv_desc_t *, int, struct cred *);
111typedef int (*vfs_mntupdate_t)(bhv_desc_t *, int *, 109typedef int (*vfs_mntupdate_t)(bhv_desc_t *, int *,
112 struct xfs_mount_args *); 110 struct xfs_mount_args *);
113typedef int (*vfs_root_t)(bhv_desc_t *, struct vnode **); 111typedef int (*vfs_root_t)(bhv_desc_t *, struct bhv_vnode **);
114typedef int (*vfs_statvfs_t)(bhv_desc_t *, xfs_statfs_t *, struct vnode *); 112typedef int (*vfs_statvfs_t)(bhv_desc_t *, xfs_statfs_t *,
113 struct bhv_vnode *);
115typedef int (*vfs_sync_t)(bhv_desc_t *, int, struct cred *); 114typedef int (*vfs_sync_t)(bhv_desc_t *, int, struct cred *);
116typedef int (*vfs_vget_t)(bhv_desc_t *, struct vnode **, struct fid *); 115typedef int (*vfs_vget_t)(bhv_desc_t *, struct bhv_vnode **, struct fid *);
117typedef int (*vfs_dmapiops_t)(bhv_desc_t *, caddr_t); 116typedef int (*vfs_dmapiops_t)(bhv_desc_t *, caddr_t);
118typedef int (*vfs_quotactl_t)(bhv_desc_t *, int, int, caddr_t); 117typedef int (*vfs_quotactl_t)(bhv_desc_t *, int, int, caddr_t);
119typedef void (*vfs_init_vnode_t)(bhv_desc_t *, 118typedef void (*vfs_init_vnode_t)(bhv_desc_t *,
120 struct vnode *, bhv_desc_t *, int); 119 struct bhv_vnode *, bhv_desc_t *, int);
121typedef void (*vfs_force_shutdown_t)(bhv_desc_t *, int, char *, int); 120typedef void (*vfs_force_shutdown_t)(bhv_desc_t *, int, char *, int);
122typedef void (*vfs_freeze_t)(bhv_desc_t *); 121typedef void (*vfs_freeze_t)(bhv_desc_t *);
123 122
@@ -140,26 +139,26 @@ typedef struct bhv_vfsops {
140} bhv_vfsops_t; 139} bhv_vfsops_t;
141 140
142/* 141/*
143 * VFS's. Operates on vfs structure pointers (starts at bhv head). 142 * Virtual filesystem operations, operating from head bhv.
144 */ 143 */
145#define VHEAD(v) ((v)->vfs_fbhv) 144#define VFSHEAD(v) ((v)->vfs_bh.bh_first)
146#define bhv_vfs_mount(v, ma,cr) vfs_mount(VHEAD(v), ma,cr) 145#define bhv_vfs_mount(v, ma,cr) vfs_mount(VFSHEAD(v), ma,cr)
147#define bhv_vfs_parseargs(v, o,ma,f) vfs_parseargs(VHEAD(v), o,ma,f) 146#define bhv_vfs_parseargs(v, o,ma,f) vfs_parseargs(VFSHEAD(v), o,ma,f)
148#define bhv_vfs_showargs(v, m) vfs_showargs(VHEAD(v), m) 147#define bhv_vfs_showargs(v, m) vfs_showargs(VFSHEAD(v), m)
149#define bhv_vfs_unmount(v, f,cr) vfs_unmount(VHEAD(v), f,cr) 148#define bhv_vfs_unmount(v, f,cr) vfs_unmount(VFSHEAD(v), f,cr)
150#define bhv_vfs_mntupdate(v, fl,args) vfs_mntupdate(VHEAD(v), fl,args) 149#define bhv_vfs_mntupdate(v, fl,args) vfs_mntupdate(VFSHEAD(v), fl,args)
151#define bhv_vfs_root(v, vpp) vfs_root(VHEAD(v), vpp) 150#define bhv_vfs_root(v, vpp) vfs_root(VFSHEAD(v), vpp)
152#define bhv_vfs_statvfs(v, sp,vp) vfs_statvfs(VHEAD(v), sp,vp) 151#define bhv_vfs_statvfs(v, sp,vp) vfs_statvfs(VFSHEAD(v), sp,vp)
153#define bhv_vfs_sync(v, flag,cr) vfs_sync(VHEAD(v), flag,cr) 152#define bhv_vfs_sync(v, flag,cr) vfs_sync(VFSHEAD(v), flag,cr)
154#define bhv_vfs_vget(v, vpp,fidp) vfs_vget(VHEAD(v), vpp,fidp) 153#define bhv_vfs_vget(v, vpp,fidp) vfs_vget(VFSHEAD(v), vpp,fidp)
155#define bhv_vfs_dmapiops(v, p) vfs_dmapiops(VHEAD(v), p) 154#define bhv_vfs_dmapiops(v, p) vfs_dmapiops(VFSHEAD(v), p)
156#define bhv_vfs_quotactl(v, c,id,p) vfs_quotactl(VHEAD(v), c,id,p) 155#define bhv_vfs_quotactl(v, c,id,p) vfs_quotactl(VFSHEAD(v), c,id,p)
157#define bhv_vfs_init_vnode(v, vp,b,ul) vfs_init_vnode(VHEAD(v), vp,b,ul) 156#define bhv_vfs_init_vnode(v, vp,b,ul) vfs_init_vnode(VFSHEAD(v), vp,b,ul)
158#define bhv_vfs_force_shutdown(v,u,f,l) vfs_force_shutdown(VHEAD(v), u,f,l) 157#define bhv_vfs_force_shutdown(v,u,f,l) vfs_force_shutdown(VFSHEAD(v), u,f,l)
159#define bhv_vfs_freeze(v) vfs_freeze(VHEAD(v)) 158#define bhv_vfs_freeze(v) vfs_freeze(VFSHEAD(v))
160 159
161/* 160/*
162 * PVFS's. Operates on behavior descriptor pointers. 161 * Virtual filesystem operations, operating from next bhv.
163 */ 162 */
164#define bhv_next_vfs_mount(b, ma,cr) vfs_mount(b, ma,cr) 163#define bhv_next_vfs_mount(b, ma,cr) vfs_mount(b, ma,cr)
165#define bhv_next_vfs_parseargs(b, o,ma,f) vfs_parseargs(b, o,ma,f) 164#define bhv_next_vfs_parseargs(b, o,ma,f) vfs_parseargs(b, o,ma,f)
@@ -181,13 +180,13 @@ extern int vfs_parseargs(bhv_desc_t *, char *, struct xfs_mount_args *, int);
181extern int vfs_showargs(bhv_desc_t *, struct seq_file *); 180extern int vfs_showargs(bhv_desc_t *, struct seq_file *);
182extern int vfs_unmount(bhv_desc_t *, int, struct cred *); 181extern int vfs_unmount(bhv_desc_t *, int, struct cred *);
183extern int vfs_mntupdate(bhv_desc_t *, int *, struct xfs_mount_args *); 182extern int vfs_mntupdate(bhv_desc_t *, int *, struct xfs_mount_args *);
184extern int vfs_root(bhv_desc_t *, struct vnode **); 183extern int vfs_root(bhv_desc_t *, struct bhv_vnode **);
185extern int vfs_statvfs(bhv_desc_t *, xfs_statfs_t *, struct vnode *); 184extern int vfs_statvfs(bhv_desc_t *, xfs_statfs_t *, struct bhv_vnode *);
186extern int vfs_sync(bhv_desc_t *, int, struct cred *); 185extern int vfs_sync(bhv_desc_t *, int, struct cred *);
187extern int vfs_vget(bhv_desc_t *, struct vnode **, struct fid *); 186extern int vfs_vget(bhv_desc_t *, struct bhv_vnode **, struct fid *);
188extern int vfs_dmapiops(bhv_desc_t *, caddr_t); 187extern int vfs_dmapiops(bhv_desc_t *, caddr_t);
189extern int vfs_quotactl(bhv_desc_t *, int, int, caddr_t); 188extern int vfs_quotactl(bhv_desc_t *, int, int, caddr_t);
190extern void vfs_init_vnode(bhv_desc_t *, struct vnode *, bhv_desc_t *, int); 189extern void vfs_init_vnode(bhv_desc_t *, struct bhv_vnode *, bhv_desc_t *, int);
191extern void vfs_force_shutdown(bhv_desc_t *, int, char *, int); 190extern void vfs_force_shutdown(bhv_desc_t *, int, char *, int);
192extern void vfs_freeze(bhv_desc_t *); 191extern void vfs_freeze(bhv_desc_t *);
193 192
diff --git a/fs/xfs/linux-2.6/xfs_vnode.c b/fs/xfs/linux-2.6/xfs_vnode.c
index 82777f1a70a7..66e36e195f29 100644
--- a/fs/xfs/linux-2.6/xfs_vnode.c
+++ b/fs/xfs/linux-2.6/xfs_vnode.c
@@ -39,7 +39,7 @@ vn_init(void)
39 39
40void 40void
41vn_iowait( 41vn_iowait(
42 struct vnode *vp) 42 bhv_vnode_t *vp)
43{ 43{
44 wait_queue_head_t *wq = vptosync(vp); 44 wait_queue_head_t *wq = vptosync(vp);
45 45
@@ -48,7 +48,7 @@ vn_iowait(
48 48
49void 49void
50vn_iowake( 50vn_iowake(
51 struct vnode *vp) 51 bhv_vnode_t *vp)
52{ 52{
53 if (atomic_dec_and_test(&vp->v_iocount)) 53 if (atomic_dec_and_test(&vp->v_iocount))
54 wake_up(vptosync(vp)); 54 wake_up(vptosync(vp));
@@ -61,7 +61,7 @@ vn_iowake(
61 */ 61 */
62void 62void
63vn_ioerror( 63vn_ioerror(
64 struct vnode *vp, 64 bhv_vnode_t *vp,
65 int error, 65 int error,
66 char *f, 66 char *f,
67 int l) 67 int l)
@@ -70,11 +70,11 @@ vn_ioerror(
70 bhv_vfs_force_shutdown(vp->v_vfsp, SHUTDOWN_DEVICE_REQ, f, l); 70 bhv_vfs_force_shutdown(vp->v_vfsp, SHUTDOWN_DEVICE_REQ, f, l);
71} 71}
72 72
73struct vnode * 73bhv_vnode_t *
74vn_initialize( 74vn_initialize(
75 struct inode *inode) 75 struct inode *inode)
76{ 76{
77 struct vnode *vp = vn_from_inode(inode); 77 bhv_vnode_t *vp = vn_from_inode(inode);
78 78
79 XFS_STATS_INC(vn_active); 79 XFS_STATS_INC(vn_active);
80 XFS_STATS_INC(vn_alloc); 80 XFS_STATS_INC(vn_alloc);
@@ -110,7 +110,7 @@ vn_initialize(
110 */ 110 */
111void 111void
112vn_revalidate_core( 112vn_revalidate_core(
113 struct vnode *vp, 113 bhv_vnode_t *vp,
114 vattr_t *vap) 114 vattr_t *vap)
115{ 115{
116 struct inode *inode = vn_to_inode(vp); 116 struct inode *inode = vn_to_inode(vp);
@@ -146,14 +146,14 @@ vn_revalidate_core(
146 */ 146 */
147int 147int
148__vn_revalidate( 148__vn_revalidate(
149 struct vnode *vp, 149 bhv_vnode_t *vp,
150 struct vattr *vattr) 150 struct vattr *vattr)
151{ 151{
152 int error; 152 int error;
153 153
154 vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address); 154 vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address);
155 vattr->va_mask = XFS_AT_STAT | XFS_AT_XFLAGS; 155 vattr->va_mask = XFS_AT_STAT | XFS_AT_XFLAGS;
156 VOP_GETATTR(vp, vattr, 0, NULL, error); 156 error = bhv_vop_getattr(vp, vattr, 0, NULL);
157 if (likely(!error)) { 157 if (likely(!error)) {
158 vn_revalidate_core(vp, vattr); 158 vn_revalidate_core(vp, vattr);
159 VUNMODIFY(vp); 159 VUNMODIFY(vp);
@@ -163,7 +163,7 @@ __vn_revalidate(
163 163
164int 164int
165vn_revalidate( 165vn_revalidate(
166 struct vnode *vp) 166 bhv_vnode_t *vp)
167{ 167{
168 vattr_t vattr; 168 vattr_t vattr;
169 169
@@ -173,9 +173,9 @@ vn_revalidate(
173/* 173/*
174 * Add a reference to a referenced vnode. 174 * Add a reference to a referenced vnode.
175 */ 175 */
176struct vnode * 176bhv_vnode_t *
177vn_hold( 177vn_hold(
178 struct vnode *vp) 178 bhv_vnode_t *vp)
179{ 179{
180 struct inode *inode; 180 struct inode *inode;
181 181
@@ -208,31 +208,31 @@ vn_hold(
208 * Vnode tracing code. 208 * Vnode tracing code.
209 */ 209 */
210void 210void
211vn_trace_entry(vnode_t *vp, const char *func, inst_t *ra) 211vn_trace_entry(bhv_vnode_t *vp, const char *func, inst_t *ra)
212{ 212{
213 KTRACE_ENTER(vp, VNODE_KTRACE_ENTRY, func, 0, ra); 213 KTRACE_ENTER(vp, VNODE_KTRACE_ENTRY, func, 0, ra);
214} 214}
215 215
216void 216void
217vn_trace_exit(vnode_t *vp, const char *func, inst_t *ra) 217vn_trace_exit(bhv_vnode_t *vp, const char *func, inst_t *ra)
218{ 218{
219 KTRACE_ENTER(vp, VNODE_KTRACE_EXIT, func, 0, ra); 219 KTRACE_ENTER(vp, VNODE_KTRACE_EXIT, func, 0, ra);
220} 220}
221 221
222void 222void
223vn_trace_hold(vnode_t *vp, char *file, int line, inst_t *ra) 223vn_trace_hold(bhv_vnode_t *vp, char *file, int line, inst_t *ra)
224{ 224{
225 KTRACE_ENTER(vp, VNODE_KTRACE_HOLD, file, line, ra); 225 KTRACE_ENTER(vp, VNODE_KTRACE_HOLD, file, line, ra);
226} 226}
227 227
228void 228void
229vn_trace_ref(vnode_t *vp, char *file, int line, inst_t *ra) 229vn_trace_ref(bhv_vnode_t *vp, char *file, int line, inst_t *ra)
230{ 230{
231 KTRACE_ENTER(vp, VNODE_KTRACE_REF, file, line, ra); 231 KTRACE_ENTER(vp, VNODE_KTRACE_REF, file, line, ra);
232} 232}
233 233
234void 234void
235vn_trace_rele(vnode_t *vp, char *file, int line, inst_t *ra) 235vn_trace_rele(bhv_vnode_t *vp, char *file, int line, inst_t *ra)
236{ 236{
237 KTRACE_ENTER(vp, VNODE_KTRACE_RELE, file, line, ra); 237 KTRACE_ENTER(vp, VNODE_KTRACE_RELE, file, line, ra);
238} 238}
diff --git a/fs/xfs/linux-2.6/xfs_vnode.h b/fs/xfs/linux-2.6/xfs_vnode.h
index 95343637ab66..cb16774aea73 100644
--- a/fs/xfs/linux-2.6/xfs_vnode.h
+++ b/fs/xfs/linux-2.6/xfs_vnode.h
@@ -14,33 +14,6 @@
14 * You should have received a copy of the GNU General Public License 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, 15 * along with this program; if not, write the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 *
18 * Portions Copyright (c) 1989, 1993
19 * The Regents of the University of California. All rights reserved.
20 *
21 * Redistribution and use in source and binary forms, with or without
22 * modification, are permitted provided that the following conditions
23 * are met:
24 * 1. Redistributions of source code must retain the above copyright
25 * notice, this list of conditions and the following disclaimer.
26 * 2. Redistributions in binary form must reproduce the above copyright
27 * notice, this list of conditions and the following disclaimer in the
28 * documentation and/or other materials provided with the distribution.
29 * 3. Neither the name of the University nor the names of its contributors
30 * may be used to endorse or promote products derived from this software
31 * without specific prior written permission.
32 *
33 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
34 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
35 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
36 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
37 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
38 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
39 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
40 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
41 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
42 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
43 * SUCH DAMAGE.
44 */ 17 */
45#ifndef __XFS_VNODE_H__ 18#ifndef __XFS_VNODE_H__
46#define __XFS_VNODE_H__ 19#define __XFS_VNODE_H__
@@ -51,7 +24,6 @@ struct vattr;
51struct xfs_iomap; 24struct xfs_iomap;
52struct attrlist_cursor_kern; 25struct attrlist_cursor_kern;
53 26
54
55typedef xfs_ino_t vnumber_t; 27typedef xfs_ino_t vnumber_t;
56typedef struct dentry vname_t; 28typedef struct dentry vname_t;
57typedef bhv_head_t vn_bhv_head_t; 29typedef bhv_head_t vn_bhv_head_t;
@@ -66,7 +38,7 @@ typedef enum vflags {
66 * MP locking protocols: 38 * MP locking protocols:
67 * v_flag, v_vfsp VN_LOCK/VN_UNLOCK 39 * v_flag, v_vfsp VN_LOCK/VN_UNLOCK
68 */ 40 */
69typedef struct vnode { 41typedef struct bhv_vnode {
70 vflags_t v_flag; /* vnode flags (see above) */ 42 vflags_t v_flag; /* vnode flags (see above) */
71 struct bhv_vfs *v_vfsp; /* ptr to containing VFS */ 43 struct bhv_vfs *v_vfsp; /* ptr to containing VFS */
72 vnumber_t v_number; /* in-core vnode number */ 44 vnumber_t v_number; /* in-core vnode number */
@@ -78,7 +50,7 @@ typedef struct vnode {
78#endif 50#endif
79 struct inode v_inode; /* Linux inode */ 51 struct inode v_inode; /* Linux inode */
80 /* inode MUST be last */ 52 /* inode MUST be last */
81} vnode_t; 53} bhv_vnode_t;
82 54
83#define VN_ISLNK(vp) S_ISLNK((vp)->v_inode.i_mode) 55#define VN_ISLNK(vp) S_ISLNK((vp)->v_inode.i_mode)
84#define VN_ISREG(vp) S_ISREG((vp)->v_inode.i_mode) 56#define VN_ISREG(vp) S_ISREG((vp)->v_inode.i_mode)
@@ -86,9 +58,6 @@ typedef struct vnode {
86#define VN_ISCHR(vp) S_ISCHR((vp)->v_inode.i_mode) 58#define VN_ISCHR(vp) S_ISCHR((vp)->v_inode.i_mode)
87#define VN_ISBLK(vp) S_ISBLK((vp)->v_inode.i_mode) 59#define VN_ISBLK(vp) S_ISBLK((vp)->v_inode.i_mode)
88 60
89#define v_fbhv v_bh.bh_first /* first behavior */
90#define v_fops v_bh.bh_first->bd_ops /* first behavior ops */
91
92#define VNODE_POSITION_BASE BHV_POSITION_BASE /* chain bottom */ 61#define VNODE_POSITION_BASE BHV_POSITION_BASE /* chain bottom */
93#define VNODE_POSITION_TOP BHV_POSITION_TOP /* chain top */ 62#define VNODE_POSITION_TOP BHV_POSITION_TOP /* chain top */
94#define VNODE_POSITION_INVALID BHV_POSITION_INVALID /* invalid pos. num */ 63#define VNODE_POSITION_INVALID BHV_POSITION_INVALID /* invalid pos. num */
@@ -110,8 +79,8 @@ typedef enum {
110/* 79/*
111 * Macros for dealing with the behavior descriptor inside of the vnode. 80 * Macros for dealing with the behavior descriptor inside of the vnode.
112 */ 81 */
113#define BHV_TO_VNODE(bdp) ((vnode_t *)BHV_VOBJ(bdp)) 82#define BHV_TO_VNODE(bdp) ((bhv_vnode_t *)BHV_VOBJ(bdp))
114#define BHV_TO_VNODE_NULL(bdp) ((vnode_t *)BHV_VOBJNULL(bdp)) 83#define BHV_TO_VNODE_NULL(bdp) ((bhv_vnode_t *)BHV_VOBJNULL(bdp))
115 84
116#define VN_BHV_HEAD(vp) ((bhv_head_t *)(&((vp)->v_bh))) 85#define VN_BHV_HEAD(vp) ((bhv_head_t *)(&((vp)->v_bh)))
117#define vn_bhv_head_init(bhp,name) bhv_head_init(bhp,name) 86#define vn_bhv_head_init(bhp,name) bhv_head_init(bhp,name)
@@ -122,17 +91,17 @@ typedef enum {
122/* 91/*
123 * Vnode to Linux inode mapping. 92 * Vnode to Linux inode mapping.
124 */ 93 */
125static inline struct vnode *vn_from_inode(struct inode *inode) 94static inline struct bhv_vnode *vn_from_inode(struct inode *inode)
126{ 95{
127 return (vnode_t *)list_entry(inode, vnode_t, v_inode); 96 return (bhv_vnode_t *)list_entry(inode, bhv_vnode_t, v_inode);
128} 97}
129static inline struct inode *vn_to_inode(struct vnode *vnode) 98static inline struct inode *vn_to_inode(struct bhv_vnode *vnode)
130{ 99{
131 return &vnode->v_inode; 100 return &vnode->v_inode;
132} 101}
133 102
134/* 103/*
135 * Values for the VOP_RWLOCK and VOP_RWUNLOCK flags parameter. 104 * Values for the vop_rwlock/rwunlock flags parameter.
136 */ 105 */
137typedef enum vrwlock { 106typedef enum vrwlock {
138 VRWLOCK_NONE, 107 VRWLOCK_NONE,
@@ -144,7 +113,7 @@ typedef enum vrwlock {
144} vrwlock_t; 113} vrwlock_t;
145 114
146/* 115/*
147 * Return values for VOP_INACTIVE. A return value of 116 * Return values for bhv_vop_inactive. A return value of
148 * VN_INACTIVE_NOCACHE implies that the file system behavior 117 * VN_INACTIVE_NOCACHE implies that the file system behavior
149 * has disassociated its state and bhv_desc_t from the vnode. 118 * has disassociated its state and bhv_desc_t from the vnode.
150 */ 119 */
@@ -152,7 +121,7 @@ typedef enum vrwlock {
152#define VN_INACTIVE_NOCACHE 1 121#define VN_INACTIVE_NOCACHE 1
153 122
154/* 123/*
155 * Values for the cmd code given to VOP_VNODE_CHANGE. 124 * Values for the cmd code given to vop_vnode_change.
156 */ 125 */
157typedef enum vchange { 126typedef enum vchange {
158 VCHANGE_FLAGS_FRLOCKS = 0, 127 VCHANGE_FLAGS_FRLOCKS = 0,
@@ -188,22 +157,22 @@ typedef int (*vop_getattr_t)(bhv_desc_t *, struct vattr *, int,
188typedef int (*vop_setattr_t)(bhv_desc_t *, struct vattr *, int, 157typedef int (*vop_setattr_t)(bhv_desc_t *, struct vattr *, int,
189 struct cred *); 158 struct cred *);
190typedef int (*vop_access_t)(bhv_desc_t *, int, struct cred *); 159typedef int (*vop_access_t)(bhv_desc_t *, int, struct cred *);
191typedef int (*vop_lookup_t)(bhv_desc_t *, vname_t *, vnode_t **, 160typedef int (*vop_lookup_t)(bhv_desc_t *, vname_t *, bhv_vnode_t **,
192 int, vnode_t *, struct cred *); 161 int, bhv_vnode_t *, struct cred *);
193typedef int (*vop_create_t)(bhv_desc_t *, vname_t *, struct vattr *, 162typedef int (*vop_create_t)(bhv_desc_t *, vname_t *, struct vattr *,
194 vnode_t **, struct cred *); 163 bhv_vnode_t **, struct cred *);
195typedef int (*vop_remove_t)(bhv_desc_t *, vname_t *, struct cred *); 164typedef int (*vop_remove_t)(bhv_desc_t *, vname_t *, struct cred *);
196typedef int (*vop_link_t)(bhv_desc_t *, vnode_t *, vname_t *, 165typedef int (*vop_link_t)(bhv_desc_t *, bhv_vnode_t *, vname_t *,
197 struct cred *);
198typedef int (*vop_rename_t)(bhv_desc_t *, vname_t *, vnode_t *, vname_t *,
199 struct cred *); 166 struct cred *);
167typedef int (*vop_rename_t)(bhv_desc_t *, vname_t *, bhv_vnode_t *,
168 vname_t *, struct cred *);
200typedef int (*vop_mkdir_t)(bhv_desc_t *, vname_t *, struct vattr *, 169typedef int (*vop_mkdir_t)(bhv_desc_t *, vname_t *, struct vattr *,
201 vnode_t **, struct cred *); 170 bhv_vnode_t **, struct cred *);
202typedef int (*vop_rmdir_t)(bhv_desc_t *, vname_t *, struct cred *); 171typedef int (*vop_rmdir_t)(bhv_desc_t *, vname_t *, struct cred *);
203typedef int (*vop_readdir_t)(bhv_desc_t *, struct uio *, struct cred *, 172typedef int (*vop_readdir_t)(bhv_desc_t *, struct uio *, struct cred *,
204 int *); 173 int *);
205typedef int (*vop_symlink_t)(bhv_desc_t *, vname_t *, struct vattr *, 174typedef int (*vop_symlink_t)(bhv_desc_t *, vname_t *, struct vattr *,
206 char *, vnode_t **, struct cred *); 175 char *, bhv_vnode_t **, struct cred *);
207typedef int (*vop_readlink_t)(bhv_desc_t *, struct uio *, int, 176typedef int (*vop_readlink_t)(bhv_desc_t *, struct uio *, int,
208 struct cred *); 177 struct cred *);
209typedef int (*vop_fsync_t)(bhv_desc_t *, int, struct cred *, 178typedef int (*vop_fsync_t)(bhv_desc_t *, int, struct cred *,
@@ -224,7 +193,7 @@ typedef int (*vop_attr_remove_t)(bhv_desc_t *, const char *,
224 int, struct cred *); 193 int, struct cred *);
225typedef int (*vop_attr_list_t)(bhv_desc_t *, char *, int, int, 194typedef int (*vop_attr_list_t)(bhv_desc_t *, char *, int, int,
226 struct attrlist_cursor_kern *, struct cred *); 195 struct attrlist_cursor_kern *, struct cred *);
227typedef void (*vop_link_removed_t)(bhv_desc_t *, vnode_t *, int); 196typedef void (*vop_link_removed_t)(bhv_desc_t *, bhv_vnode_t *, int);
228typedef void (*vop_vnode_change_t)(bhv_desc_t *, vchange_t, __psint_t); 197typedef void (*vop_vnode_change_t)(bhv_desc_t *, vchange_t, __psint_t);
229typedef void (*vop_ptossvp_t)(bhv_desc_t *, xfs_off_t, xfs_off_t, int); 198typedef void (*vop_ptossvp_t)(bhv_desc_t *, xfs_off_t, xfs_off_t, int);
230typedef void (*vop_pflushinvalvp_t)(bhv_desc_t *, xfs_off_t, xfs_off_t, int); 199typedef void (*vop_pflushinvalvp_t)(bhv_desc_t *, xfs_off_t, xfs_off_t, int);
@@ -233,7 +202,7 @@ typedef int (*vop_pflushvp_t)(bhv_desc_t *, xfs_off_t, xfs_off_t,
233typedef int (*vop_iflush_t)(bhv_desc_t *, int); 202typedef int (*vop_iflush_t)(bhv_desc_t *, int);
234 203
235 204
236typedef struct vnodeops { 205typedef struct bhv_vnodeops {
237 bhv_position_t vn_position; /* position within behavior chain */ 206 bhv_position_t vn_position; /* position within behavior chain */
238 vop_open_t vop_open; 207 vop_open_t vop_open;
239 vop_close_t vop_close; 208 vop_close_t vop_close;
@@ -274,105 +243,80 @@ typedef struct vnodeops {
274 vop_pflushvp_t vop_flush_pages; 243 vop_pflushvp_t vop_flush_pages;
275 vop_release_t vop_release; 244 vop_release_t vop_release;
276 vop_iflush_t vop_iflush; 245 vop_iflush_t vop_iflush;
277} vnodeops_t; 246} bhv_vnodeops_t;
278 247
279/* 248/*
280 * VOP's. 249 * Virtual node operations, operating from head bhv.
281 */
282#define _VOP_(op, vp) (*((vnodeops_t *)(vp)->v_fops)->op)
283
284#define VOP_OPEN(vp, cr, rv) \
285 rv = _VOP_(vop_open, vp)((vp)->v_fbhv, cr)
286#define VOP_CLOSE(vp, f, last, cr, rv) \
287 rv = _VOP_(vop_close, vp)((vp)->v_fbhv, f, last, cr)
288#define VOP_READ(vp,file,iov,segs,offset,ioflags,cr,rv) \
289 rv = _VOP_(vop_read, vp)((vp)->v_fbhv,file,iov,segs,offset,ioflags,cr)
290#define VOP_WRITE(vp,file,iov,segs,offset,ioflags,cr,rv) \
291 rv = _VOP_(vop_write, vp)((vp)->v_fbhv,file,iov,segs,offset,ioflags,cr)
292#define VOP_SENDFILE(vp,f,off,ioflags,cnt,act,targ,cr,rv) \
293 rv = _VOP_(vop_sendfile, vp)((vp)->v_fbhv,f,off,ioflags,cnt,act,targ,cr)
294#define VOP_SPLICE_READ(vp,f,o,pipe,cnt,fl,iofl,cr,rv) \
295 rv = _VOP_(vop_splice_read, vp)((vp)->v_fbhv,f,o,pipe,cnt,fl,iofl,cr)
296#define VOP_SPLICE_WRITE(vp,f,o,pipe,cnt,fl,iofl,cr,rv) \
297 rv = _VOP_(vop_splice_write, vp)((vp)->v_fbhv,f,o,pipe,cnt,fl,iofl,cr)
298#define VOP_BMAP(vp,of,sz,rw,b,n,rv) \
299 rv = _VOP_(vop_bmap, vp)((vp)->v_fbhv,of,sz,rw,b,n)
300#define VOP_GETATTR(vp, vap, f, cr, rv) \
301 rv = _VOP_(vop_getattr, vp)((vp)->v_fbhv, vap, f, cr)
302#define VOP_SETATTR(vp, vap, f, cr, rv) \
303 rv = _VOP_(vop_setattr, vp)((vp)->v_fbhv, vap, f, cr)
304#define VOP_ACCESS(vp, mode, cr, rv) \
305 rv = _VOP_(vop_access, vp)((vp)->v_fbhv, mode, cr)
306#define VOP_LOOKUP(vp,d,vpp,f,rdir,cr,rv) \
307 rv = _VOP_(vop_lookup, vp)((vp)->v_fbhv,d,vpp,f,rdir,cr)
308#define VOP_CREATE(dvp,d,vap,vpp,cr,rv) \
309 rv = _VOP_(vop_create, dvp)((dvp)->v_fbhv,d,vap,vpp,cr)
310#define VOP_REMOVE(dvp,d,cr,rv) \
311 rv = _VOP_(vop_remove, dvp)((dvp)->v_fbhv,d,cr)
312#define VOP_LINK(tdvp,fvp,d,cr,rv) \
313 rv = _VOP_(vop_link, tdvp)((tdvp)->v_fbhv,fvp,d,cr)
314#define VOP_RENAME(fvp,fnm,tdvp,tnm,cr,rv) \
315 rv = _VOP_(vop_rename, fvp)((fvp)->v_fbhv,fnm,tdvp,tnm,cr)
316#define VOP_MKDIR(dp,d,vap,vpp,cr,rv) \
317 rv = _VOP_(vop_mkdir, dp)((dp)->v_fbhv,d,vap,vpp,cr)
318#define VOP_RMDIR(dp,d,cr,rv) \
319 rv = _VOP_(vop_rmdir, dp)((dp)->v_fbhv,d,cr)
320#define VOP_READDIR(vp,uiop,cr,eofp,rv) \
321 rv = _VOP_(vop_readdir, vp)((vp)->v_fbhv,uiop,cr,eofp)
322#define VOP_SYMLINK(dvp,d,vap,tnm,vpp,cr,rv) \
323 rv = _VOP_(vop_symlink, dvp) ((dvp)->v_fbhv,d,vap,tnm,vpp,cr)
324#define VOP_READLINK(vp,uiop,fl,cr,rv) \
325 rv = _VOP_(vop_readlink, vp)((vp)->v_fbhv,uiop,fl,cr)
326#define VOP_FSYNC(vp,f,cr,b,e,rv) \
327 rv = _VOP_(vop_fsync, vp)((vp)->v_fbhv,f,cr,b,e)
328#define VOP_INACTIVE(vp, cr, rv) \
329 rv = _VOP_(vop_inactive, vp)((vp)->v_fbhv, cr)
330#define VOP_RELEASE(vp, rv) \
331 rv = _VOP_(vop_release, vp)((vp)->v_fbhv)
332#define VOP_FID2(vp, fidp, rv) \
333 rv = _VOP_(vop_fid2, vp)((vp)->v_fbhv, fidp)
334#define VOP_RWLOCK(vp,i) \
335 (void)_VOP_(vop_rwlock, vp)((vp)->v_fbhv, i)
336#define VOP_RWLOCK_TRY(vp,i) \
337 _VOP_(vop_rwlock, vp)((vp)->v_fbhv, i)
338#define VOP_RWUNLOCK(vp,i) \
339 (void)_VOP_(vop_rwunlock, vp)((vp)->v_fbhv, i)
340#define VOP_FRLOCK(vp,c,fl,flags,offset,fr,rv) \
341 rv = _VOP_(vop_frlock, vp)((vp)->v_fbhv,c,fl,flags,offset,fr)
342#define VOP_RECLAIM(vp, rv) \
343 rv = _VOP_(vop_reclaim, vp)((vp)->v_fbhv)
344#define VOP_ATTR_GET(vp, name, val, vallenp, fl, cred, rv) \
345 rv = _VOP_(vop_attr_get, vp)((vp)->v_fbhv,name,val,vallenp,fl,cred)
346#define VOP_ATTR_SET(vp, name, val, vallen, fl, cred, rv) \
347 rv = _VOP_(vop_attr_set, vp)((vp)->v_fbhv,name,val,vallen,fl,cred)
348#define VOP_ATTR_REMOVE(vp, name, flags, cred, rv) \
349 rv = _VOP_(vop_attr_remove, vp)((vp)->v_fbhv,name,flags,cred)
350#define VOP_ATTR_LIST(vp, buf, buflen, fl, cursor, cred, rv) \
351 rv = _VOP_(vop_attr_list, vp)((vp)->v_fbhv,buf,buflen,fl,cursor,cred)
352#define VOP_LINK_REMOVED(vp, dvp, linkzero) \
353 (void)_VOP_(vop_link_removed, vp)((vp)->v_fbhv, dvp, linkzero)
354#define VOP_VNODE_CHANGE(vp, cmd, val) \
355 (void)_VOP_(vop_vnode_change, vp)((vp)->v_fbhv,cmd,val)
356/*
357 * These are page cache functions that now go thru VOPs.
358 * 'last' parameter is unused and left in for IRIX compatibility
359 */
360#define VOP_TOSS_PAGES(vp, first, last, fiopt) \
361 _VOP_(vop_tosspages, vp)((vp)->v_fbhv,first, last, fiopt)
362/*
363 * 'last' parameter is unused and left in for IRIX compatibility
364 */
365#define VOP_FLUSHINVAL_PAGES(vp, first, last, fiopt) \
366 _VOP_(vop_flushinval_pages, vp)((vp)->v_fbhv,first,last,fiopt)
367/*
368 * 'last' parameter is unused and left in for IRIX compatibility
369 */ 250 */
370#define VOP_FLUSH_PAGES(vp, first, last, flags, fiopt, rv) \ 251#define VNHEAD(vp) ((vp)->v_bh.bh_first)
371 rv = _VOP_(vop_flush_pages, vp)((vp)->v_fbhv,first,last,flags,fiopt) 252#define VOP(op, vp) (*((bhv_vnodeops_t *)VNHEAD(vp)->bd_ops)->op)
372#define VOP_IOCTL(vp, inode, filp, fl, cmd, arg, rv) \ 253#define bhv_vop_open(vp, cr) VOP(vop_open, vp)(VNHEAD(vp),cr)
373 rv = _VOP_(vop_ioctl, vp)((vp)->v_fbhv,inode,filp,fl,cmd,arg) 254#define bhv_vop_close(vp, f,last,cr) VOP(vop_close, vp)(VNHEAD(vp),f,last,cr)
374#define VOP_IFLUSH(vp, flags, rv) \ 255#define bhv_vop_read(vp,file,iov,segs,offset,ioflags,cr) \
375 rv = _VOP_(vop_iflush, vp)((vp)->v_fbhv, flags) 256 VOP(vop_read, vp)(VNHEAD(vp),file,iov,segs,offset,ioflags,cr)
257#define bhv_vop_write(vp,file,iov,segs,offset,ioflags,cr) \
258 VOP(vop_write, vp)(VNHEAD(vp),file,iov,segs,offset,ioflags,cr)
259#define bhv_vop_sendfile(vp,f,off,ioflags,cnt,act,targ,cr) \
260 VOP(vop_sendfile, vp)(VNHEAD(vp),f,off,ioflags,cnt,act,targ,cr)
261#define bhv_vop_splice_read(vp,f,o,pipe,cnt,fl,iofl,cr) \
262 VOP(vop_splice_read, vp)(VNHEAD(vp),f,o,pipe,cnt,fl,iofl,cr)
263#define bhv_vop_splice_write(vp,f,o,pipe,cnt,fl,iofl,cr) \
264 VOP(vop_splice_write, vp)(VNHEAD(vp),f,o,pipe,cnt,fl,iofl,cr)
265#define bhv_vop_bmap(vp,of,sz,rw,b,n) \
266 VOP(vop_bmap, vp)(VNHEAD(vp),of,sz,rw,b,n)
267#define bhv_vop_getattr(vp, vap,f,cr) \
268 VOP(vop_getattr, vp)(VNHEAD(vp), vap,f,cr)
269#define bhv_vop_setattr(vp, vap,f,cr) \
270 VOP(vop_setattr, vp)(VNHEAD(vp), vap,f,cr)
271#define bhv_vop_access(vp, mode,cr) VOP(vop_access, vp)(VNHEAD(vp), mode,cr)
272#define bhv_vop_lookup(vp,d,vpp,f,rdir,cr) \
273 VOP(vop_lookup, vp)(VNHEAD(vp),d,vpp,f,rdir,cr)
274#define bhv_vop_create(dvp,d,vap,vpp,cr) \
275 VOP(vop_create, dvp)(VNHEAD(dvp),d,vap,vpp,cr)
276#define bhv_vop_remove(dvp,d,cr) VOP(vop_remove, dvp)(VNHEAD(dvp),d,cr)
277#define bhv_vop_link(dvp,fvp,d,cr) VOP(vop_link, dvp)(VNHEAD(dvp),fvp,d,cr)
278#define bhv_vop_rename(fvp,fnm,tdvp,tnm,cr) \
279 VOP(vop_rename, fvp)(VNHEAD(fvp),fnm,tdvp,tnm,cr)
280#define bhv_vop_mkdir(dp,d,vap,vpp,cr) \
281 VOP(vop_mkdir, dp)(VNHEAD(dp),d,vap,vpp,cr)
282#define bhv_vop_rmdir(dp,d,cr) VOP(vop_rmdir, dp)(VNHEAD(dp),d,cr)
283#define bhv_vop_readdir(vp,uiop,cr,eofp) \
284 VOP(vop_readdir, vp)(VNHEAD(vp),uiop,cr,eofp)
285#define bhv_vop_symlink(dvp,d,vap,tnm,vpp,cr) \
286 VOP(vop_symlink, dvp)(VNHEAD(dvp),d,vap,tnm,vpp,cr)
287#define bhv_vop_readlink(vp,uiop,fl,cr) \
288 VOP(vop_readlink, vp)(VNHEAD(vp),uiop,fl,cr)
289#define bhv_vop_fsync(vp,f,cr,b,e) VOP(vop_fsync, vp)(VNHEAD(vp),f,cr,b,e)
290#define bhv_vop_inactive(vp,cr) VOP(vop_inactive, vp)(VNHEAD(vp),cr)
291#define bhv_vop_release(vp) VOP(vop_release, vp)(VNHEAD(vp))
292#define bhv_vop_fid2(vp,fidp) VOP(vop_fid2, vp)(VNHEAD(vp),fidp)
293#define bhv_vop_rwlock(vp,i) VOP(vop_rwlock, vp)(VNHEAD(vp),i)
294#define bhv_vop_rwlock_try(vp,i) VOP(vop_rwlock, vp)(VNHEAD(vp),i)
295#define bhv_vop_rwunlock(vp,i) VOP(vop_rwunlock, vp)(VNHEAD(vp),i)
296#define bhv_vop_frlock(vp,c,fl,flags,offset,fr) \
297 VOP(vop_frlock, vp)(VNHEAD(vp),c,fl,flags,offset,fr)
298#define bhv_vop_reclaim(vp) VOP(vop_reclaim, vp)(VNHEAD(vp))
299#define bhv_vop_attr_get(vp, name, val, vallenp, fl, cred) \
300 VOP(vop_attr_get, vp)(VNHEAD(vp),name,val,vallenp,fl,cred)
301#define bhv_vop_attr_set(vp, name, val, vallen, fl, cred) \
302 VOP(vop_attr_set, vp)(VNHEAD(vp),name,val,vallen,fl,cred)
303#define bhv_vop_attr_remove(vp, name, flags, cred) \
304 VOP(vop_attr_remove, vp)(VNHEAD(vp),name,flags,cred)
305#define bhv_vop_attr_list(vp, buf, buflen, fl, cursor, cred) \
306 VOP(vop_attr_list, vp)(VNHEAD(vp),buf,buflen,fl,cursor,cred)
307#define bhv_vop_link_removed(vp, dvp, linkzero) \
308 VOP(vop_link_removed, vp)(VNHEAD(vp), dvp, linkzero)
309#define bhv_vop_vnode_change(vp, cmd, val) \
310 VOP(vop_vnode_change, vp)(VNHEAD(vp), cmd, val)
311#define bhv_vop_toss_pages(vp, first, last, fiopt) \
312 VOP(vop_tosspages, vp)(VNHEAD(vp), first, last, fiopt)
313#define bhv_vop_flushinval_pages(vp, first, last, fiopt) \
314 VOP(vop_flushinval_pages, vp)(VNHEAD(vp),first,last,fiopt)
315#define bhv_vop_flush_pages(vp, first, last, flags, fiopt) \
316 VOP(vop_flush_pages, vp)(VNHEAD(vp),first,last,flags,fiopt)
317#define bhv_vop_ioctl(vp, inode, filp, fl, cmd, arg) \
318 VOP(vop_ioctl, vp)(VNHEAD(vp),inode,filp,fl,cmd,arg)
319#define bhv_vop_iflush(vp, flags) VOP(vop_iflush, vp)(VNHEAD(vp), flags)
376 320
377/* 321/*
378 * Flags for read/write calls - same values as IRIX 322 * Flags for read/write calls - same values as IRIX
@@ -382,7 +326,7 @@ typedef struct vnodeops {
382#define IO_INVIS 0x00020 /* don't update inode timestamps */ 326#define IO_INVIS 0x00020 /* don't update inode timestamps */
383 327
384/* 328/*
385 * Flags for VOP_IFLUSH call 329 * Flags for vop_iflush call
386 */ 330 */
387#define FLUSH_SYNC 1 /* wait for flush to complete */ 331#define FLUSH_SYNC 1 /* wait for flush to complete */
388#define FLUSH_INODE 2 /* flush the inode itself */ 332#define FLUSH_INODE 2 /* flush the inode itself */
@@ -390,8 +334,7 @@ typedef struct vnodeops {
390 * this inode out to disk */ 334 * this inode out to disk */
391 335
392/* 336/*
393 * Flush/Invalidate options for VOP_TOSS_PAGES, VOP_FLUSHINVAL_PAGES and 337 * Flush/Invalidate options for vop_toss/flush/flushinval_pages.
394 * VOP_FLUSH_PAGES.
395 */ 338 */
396#define FI_NONE 0 /* none */ 339#define FI_NONE 0 /* none */
397#define FI_REMAPF 1 /* Do a remapf prior to the operation */ 340#define FI_REMAPF 1 /* Do a remapf prior to the operation */
@@ -497,31 +440,17 @@ typedef struct vattr {
497 (VN_ISREG(vp) && ((mode) & (VSGID|(VEXEC>>3))) == VSGID) 440 (VN_ISREG(vp) && ((mode) & (VSGID|(VEXEC>>3))) == VSGID)
498 441
499extern void vn_init(void); 442extern void vn_init(void);
500extern vnode_t *vn_initialize(struct inode *); 443extern bhv_vnode_t *vn_initialize(struct inode *);
501 444extern int vn_revalidate(struct bhv_vnode *);
502/* 445extern int __vn_revalidate(struct bhv_vnode *, vattr_t *);
503 * vnode_map structures _must_ match vn_epoch and vnode structure sizes. 446extern void vn_revalidate_core(struct bhv_vnode *, vattr_t *);
504 */
505typedef struct vnode_map {
506 bhv_vfs_t *v_vfsp;
507 vnumber_t v_number; /* in-core vnode number */
508 xfs_ino_t v_ino; /* inode # */
509} vmap_t;
510
511#define VMAP(vp, vmap) {(vmap).v_vfsp = (vp)->v_vfsp, \
512 (vmap).v_number = (vp)->v_number, \
513 (vmap).v_ino = (vp)->v_inode.i_ino; }
514
515extern int vn_revalidate(struct vnode *);
516extern int __vn_revalidate(struct vnode *, vattr_t *);
517extern void vn_revalidate_core(struct vnode *, vattr_t *);
518 447
519extern void vn_iowait(struct vnode *vp); 448extern void vn_iowait(struct bhv_vnode *vp);
520extern void vn_iowake(struct vnode *vp); 449extern void vn_iowake(struct bhv_vnode *vp);
521 450
522extern void vn_ioerror(struct vnode *vp, int error, char *f, int l); 451extern void vn_ioerror(struct bhv_vnode *vp, int error, char *f, int l);
523 452
524static inline int vn_count(struct vnode *vp) 453static inline int vn_count(struct bhv_vnode *vp)
525{ 454{
526 return atomic_read(&vn_to_inode(vp)->i_count); 455 return atomic_read(&vn_to_inode(vp)->i_count);
527} 456}
@@ -529,7 +458,7 @@ static inline int vn_count(struct vnode *vp)
529/* 458/*
530 * Vnode reference counting functions (and macros for compatibility). 459 * Vnode reference counting functions (and macros for compatibility).
531 */ 460 */
532extern vnode_t *vn_hold(struct vnode *); 461extern bhv_vnode_t *vn_hold(struct bhv_vnode *);
533 462
534#if defined(XFS_VNODE_TRACE) 463#if defined(XFS_VNODE_TRACE)
535#define VN_HOLD(vp) \ 464#define VN_HOLD(vp) \
@@ -543,7 +472,7 @@ extern vnode_t *vn_hold(struct vnode *);
543#define VN_RELE(vp) (iput(vn_to_inode(vp))) 472#define VN_RELE(vp) (iput(vn_to_inode(vp)))
544#endif 473#endif
545 474
546static inline struct vnode *vn_grab(struct vnode *vp) 475static inline struct bhv_vnode *vn_grab(struct bhv_vnode *vp)
547{ 476{
548 struct inode *inode = igrab(vn_to_inode(vp)); 477 struct inode *inode = igrab(vn_to_inode(vp));
549 return inode ? vn_from_inode(inode) : NULL; 478 return inode ? vn_from_inode(inode) : NULL;
@@ -562,14 +491,14 @@ static inline struct vnode *vn_grab(struct vnode *vp)
562#define VN_LOCK(vp) mutex_spinlock(&(vp)->v_lock) 491#define VN_LOCK(vp) mutex_spinlock(&(vp)->v_lock)
563#define VN_UNLOCK(vp, s) mutex_spinunlock(&(vp)->v_lock, s) 492#define VN_UNLOCK(vp, s) mutex_spinunlock(&(vp)->v_lock, s)
564 493
565static __inline__ void vn_flagset(struct vnode *vp, uint flag) 494static __inline__ void vn_flagset(struct bhv_vnode *vp, uint flag)
566{ 495{
567 spin_lock(&vp->v_lock); 496 spin_lock(&vp->v_lock);
568 vp->v_flag |= flag; 497 vp->v_flag |= flag;
569 spin_unlock(&vp->v_lock); 498 spin_unlock(&vp->v_lock);
570} 499}
571 500
572static __inline__ uint vn_flagclr(struct vnode *vp, uint flag) 501static __inline__ uint vn_flagclr(struct bhv_vnode *vp, uint flag)
573{ 502{
574 uint cleared; 503 uint cleared;
575 504
@@ -588,12 +517,12 @@ static __inline__ uint vn_flagclr(struct vnode *vp, uint flag)
588/* 517/*
589 * Dealing with bad inodes 518 * Dealing with bad inodes
590 */ 519 */
591static inline void vn_mark_bad(struct vnode *vp) 520static inline void vn_mark_bad(struct bhv_vnode *vp)
592{ 521{
593 make_bad_inode(vn_to_inode(vp)); 522 make_bad_inode(vn_to_inode(vp));
594} 523}
595 524
596static inline int VN_BAD(struct vnode *vp) 525static inline int VN_BAD(struct bhv_vnode *vp)
597{ 526{
598 return is_bad_inode(vn_to_inode(vp)); 527 return is_bad_inode(vn_to_inode(vp));
599} 528}
@@ -601,18 +530,18 @@ static inline int VN_BAD(struct vnode *vp)
601/* 530/*
602 * Extracting atime values in various formats 531 * Extracting atime values in various formats
603 */ 532 */
604static inline void vn_atime_to_bstime(struct vnode *vp, xfs_bstime_t *bs_atime) 533static inline void vn_atime_to_bstime(bhv_vnode_t *vp, xfs_bstime_t *bs_atime)
605{ 534{
606 bs_atime->tv_sec = vp->v_inode.i_atime.tv_sec; 535 bs_atime->tv_sec = vp->v_inode.i_atime.tv_sec;
607 bs_atime->tv_nsec = vp->v_inode.i_atime.tv_nsec; 536 bs_atime->tv_nsec = vp->v_inode.i_atime.tv_nsec;
608} 537}
609 538
610static inline void vn_atime_to_timespec(struct vnode *vp, struct timespec *ts) 539static inline void vn_atime_to_timespec(bhv_vnode_t *vp, struct timespec *ts)
611{ 540{
612 *ts = vp->v_inode.i_atime; 541 *ts = vp->v_inode.i_atime;
613} 542}
614 543
615static inline void vn_atime_to_time_t(struct vnode *vp, time_t *tt) 544static inline void vn_atime_to_time_t(bhv_vnode_t *vp, time_t *tt)
616{ 545{
617 *tt = vp->v_inode.i_atime.tv_sec; 546 *tt = vp->v_inode.i_atime.tv_sec;
618} 547}
@@ -627,7 +556,7 @@ static inline void vn_atime_to_time_t(struct vnode *vp, time_t *tt)
627#define VN_TRUNC(vp) ((vp)->v_flag & VTRUNCATED) 556#define VN_TRUNC(vp) ((vp)->v_flag & VTRUNCATED)
628 557
629/* 558/*
630 * Flags to VOP_SETATTR/VOP_GETATTR. 559 * Flags to vop_setattr/getattr.
631 */ 560 */
632#define ATTR_UTIME 0x01 /* non-default utime(2) request */ 561#define ATTR_UTIME 0x01 /* non-default utime(2) request */
633#define ATTR_DMI 0x08 /* invocation from a DMI function */ 562#define ATTR_DMI 0x08 /* invocation from a DMI function */
@@ -637,7 +566,7 @@ static inline void vn_atime_to_time_t(struct vnode *vp, time_t *tt)
637#define ATTR_NOSIZETOK 0x400 /* Don't get the SIZE token */ 566#define ATTR_NOSIZETOK 0x400 /* Don't get the SIZE token */
638 567
639/* 568/*
640 * Flags to VOP_FSYNC and VOP_RECLAIM. 569 * Flags to vop_fsync/reclaim.
641 */ 570 */
642#define FSYNC_NOWAIT 0 /* asynchronous flush */ 571#define FSYNC_NOWAIT 0 /* asynchronous flush */
643#define FSYNC_WAIT 0x1 /* synchronous fsync or forced reclaim */ 572#define FSYNC_WAIT 0x1 /* synchronous fsync or forced reclaim */
@@ -656,11 +585,11 @@ static inline void vn_atime_to_time_t(struct vnode *vp, time_t *tt)
656#define VNODE_KTRACE_REF 4 585#define VNODE_KTRACE_REF 4
657#define VNODE_KTRACE_RELE 5 586#define VNODE_KTRACE_RELE 5
658 587
659extern void vn_trace_entry(struct vnode *, const char *, inst_t *); 588extern void vn_trace_entry(struct bhv_vnode *, const char *, inst_t *);
660extern void vn_trace_exit(struct vnode *, const char *, inst_t *); 589extern void vn_trace_exit(struct bhv_vnode *, const char *, inst_t *);
661extern void vn_trace_hold(struct vnode *, char *, int, inst_t *); 590extern void vn_trace_hold(struct bhv_vnode *, char *, int, inst_t *);
662extern void vn_trace_ref(struct vnode *, char *, int, inst_t *); 591extern void vn_trace_ref(struct bhv_vnode *, char *, int, inst_t *);
663extern void vn_trace_rele(struct vnode *, char *, int, inst_t *); 592extern void vn_trace_rele(struct bhv_vnode *, char *, int, inst_t *);
664 593
665#define VN_TRACE(vp) \ 594#define VN_TRACE(vp) \
666 vn_trace_ref(vp, __FILE__, __LINE__, (inst_t *)__return_address) 595 vn_trace_ref(vp, __FILE__, __LINE__, (inst_t *)__return_address)