aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6/xfs_super.c
diff options
context:
space:
mode:
authorNathan Scott <nathans@sgi.com>2006-06-09 03:00:52 -0400
committerNathan Scott <nathans@sgi.com>2006-06-09 03:00:52 -0400
commit67fcaa73adafb19139a7cd8ab133592b6a0a0901 (patch)
tree6e7b83e7c8b0a1d8b4776af1537d6f07ebe9435d /fs/xfs/linux-2.6/xfs_super.c
parentb83bd1388133e914c38bd31d69bc90143e6ab10c (diff)
[XFS] Resolve a namespace collision on vnode/vnodeops for FreeBSD porters.
SGI-PV: 953338 SGI-Modid: xfs-linux-melb:xfs-kern:26107a Signed-off-by: Nathan Scott <nathans@sgi.com>
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_super.c')
-rw-r--r--fs/xfs/linux-2.6/xfs_super.c42
1 files changed, 17 insertions, 25 deletions
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;