aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorNathan Scott <nathans@sgi.com>2006-06-09 02:48:30 -0400
committerNathan Scott <nathans@sgi.com>2006-06-09 02:48:30 -0400
commitb83bd1388133e914c38bd31d69bc90143e6ab10c (patch)
tree3f7fecf3913d1aa8216e06f109746c63ec0ac501 /fs
parent932f2c323196c214e645d5a572a1d7b562c0f93f (diff)
[XFS] Resolve a namespace collision on vfs/vfsops for FreeBSD porters.
SGI-PV: 9533338 SGI-Modid: xfs-linux-melb:xfs-kern:26106a Signed-off-by: Nathan Scott <nathans@sgi.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/xfs/linux-2.6/xfs_export.c6
-rw-r--r--fs/xfs/linux-2.6/xfs_super.c141
-rw-r--r--fs/xfs/linux-2.6/xfs_vfs.c28
-rw-r--r--fs/xfs/linux-2.6/xfs_vfs.h126
-rw-r--r--fs/xfs/linux-2.6/xfs_vnode.c2
-rw-r--r--fs/xfs/linux-2.6/xfs_vnode.h4
-rw-r--r--fs/xfs/quota/xfs_qm_bhv.c23
-rw-r--r--fs/xfs/quota/xfs_qm_syscalls.c2
-rw-r--r--fs/xfs/xfs_dmapi.h2
-rw-r--r--fs/xfs/xfs_fsops.c2
-rw-r--r--fs/xfs/xfs_iget.c2
-rw-r--r--fs/xfs/xfs_inode.c4
-rw-r--r--fs/xfs/xfs_inode.h1
-rw-r--r--fs/xfs/xfs_iocore.c2
-rw-r--r--fs/xfs/xfs_log.c7
-rw-r--r--fs/xfs/xfs_mount.c8
-rw-r--r--fs/xfs/xfs_mount.h22
-rw-r--r--fs/xfs/xfs_quota.h2
-rw-r--r--fs/xfs/xfs_vfsops.c23
19 files changed, 183 insertions, 224 deletions
diff --git a/fs/xfs/linux-2.6/xfs_export.c b/fs/xfs/linux-2.6/xfs_export.c
index b768ea910bbe..b5c579eeb8ef 100644
--- a/fs/xfs/linux-2.6/xfs_export.c
+++ b/fs/xfs/linux-2.6/xfs_export.c
@@ -97,7 +97,7 @@ xfs_fs_encode_fh(
97 int len; 97 int len;
98 int is64 = 0; 98 int is64 = 0;
99#if XFS_BIG_INUMS 99#if XFS_BIG_INUMS
100 vfs_t *vfs = vfs_from_sb(inode->i_sb); 100 bhv_vfs_t *vfs = vfs_from_sb(inode->i_sb);
101 101
102 if (!(vfs->vfs_flag & VFS_32BITINODES)) { 102 if (!(vfs->vfs_flag & VFS_32BITINODES)) {
103 /* filesystem may contain 64bit inode numbers */ 103 /* filesystem may contain 64bit inode numbers */
@@ -139,10 +139,10 @@ xfs_fs_get_dentry(
139 vnode_t *vp; 139 vnode_t *vp;
140 struct inode *inode; 140 struct inode *inode;
141 struct dentry *result; 141 struct dentry *result;
142 vfs_t *vfsp = vfs_from_sb(sb); 142 bhv_vfs_t *vfsp = vfs_from_sb(sb);
143 int error; 143 int error;
144 144
145 VFS_VGET(vfsp, &vp, (fid_t *)data, error); 145 error = bhv_vfs_vget(vfsp, &vp, (fid_t *)data);
146 if (error || vp == NULL) 146 if (error || vp == NULL)
147 return ERR_PTR(-ESTALE) ; 147 return ERR_PTR(-ESTALE) ;
148 148
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c
index 68f4793e8a11..97dbcb68b25f 100644
--- a/fs/xfs/linux-2.6/xfs_super.c
+++ b/fs/xfs/linux-2.6/xfs_super.c
@@ -475,13 +475,13 @@ xfs_fs_clear_inode(
475 */ 475 */
476STATIC void 476STATIC void
477xfs_syncd_queue_work( 477xfs_syncd_queue_work(
478 struct vfs *vfs, 478 struct bhv_vfs *vfs,
479 void *data, 479 void *data,
480 void (*syncer)(vfs_t *, void *)) 480 void (*syncer)(bhv_vfs_t *, void *))
481{ 481{
482 vfs_sync_work_t *work; 482 struct bhv_vfs_sync_work *work;
483 483
484 work = kmem_alloc(sizeof(struct vfs_sync_work), KM_SLEEP); 484 work = kmem_alloc(sizeof(struct bhv_vfs_sync_work), KM_SLEEP);
485 INIT_LIST_HEAD(&work->w_list); 485 INIT_LIST_HEAD(&work->w_list);
486 work->w_syncer = syncer; 486 work->w_syncer = syncer;
487 work->w_data = data; 487 work->w_data = data;
@@ -500,7 +500,7 @@ xfs_syncd_queue_work(
500 */ 500 */
501STATIC void 501STATIC void
502xfs_flush_inode_work( 502xfs_flush_inode_work(
503 vfs_t *vfs, 503 bhv_vfs_t *vfs,
504 void *inode) 504 void *inode)
505{ 505{
506 filemap_flush(((struct inode *)inode)->i_mapping); 506 filemap_flush(((struct inode *)inode)->i_mapping);
@@ -512,7 +512,7 @@ xfs_flush_inode(
512 xfs_inode_t *ip) 512 xfs_inode_t *ip)
513{ 513{
514 struct inode *inode = vn_to_inode(XFS_ITOV(ip)); 514 struct inode *inode = vn_to_inode(XFS_ITOV(ip));
515 struct vfs *vfs = XFS_MTOVFS(ip->i_mount); 515 struct bhv_vfs *vfs = XFS_MTOVFS(ip->i_mount);
516 516
517 igrab(inode); 517 igrab(inode);
518 xfs_syncd_queue_work(vfs, inode, xfs_flush_inode_work); 518 xfs_syncd_queue_work(vfs, inode, xfs_flush_inode_work);
@@ -525,7 +525,7 @@ xfs_flush_inode(
525 */ 525 */
526STATIC void 526STATIC void
527xfs_flush_device_work( 527xfs_flush_device_work(
528 vfs_t *vfs, 528 bhv_vfs_t *vfs,
529 void *inode) 529 void *inode)
530{ 530{
531 sync_blockdev(vfs->vfs_super->s_bdev); 531 sync_blockdev(vfs->vfs_super->s_bdev);
@@ -537,7 +537,7 @@ xfs_flush_device(
537 xfs_inode_t *ip) 537 xfs_inode_t *ip)
538{ 538{
539 struct inode *inode = vn_to_inode(XFS_ITOV(ip)); 539 struct inode *inode = vn_to_inode(XFS_ITOV(ip));
540 struct vfs *vfs = XFS_MTOVFS(ip->i_mount); 540 struct bhv_vfs *vfs = XFS_MTOVFS(ip->i_mount);
541 541
542 igrab(inode); 542 igrab(inode);
543 xfs_syncd_queue_work(vfs, inode, xfs_flush_device_work); 543 xfs_syncd_queue_work(vfs, inode, xfs_flush_device_work);
@@ -545,16 +545,16 @@ xfs_flush_device(
545 xfs_log_force(ip->i_mount, (xfs_lsn_t)0, XFS_LOG_FORCE|XFS_LOG_SYNC); 545 xfs_log_force(ip->i_mount, (xfs_lsn_t)0, XFS_LOG_FORCE|XFS_LOG_SYNC);
546} 546}
547 547
548#define SYNCD_FLAGS (SYNC_FSDATA|SYNC_BDFLUSH|SYNC_ATTR|SYNC_REFCACHE)
549STATIC void 548STATIC void
550vfs_sync_worker( 549vfs_sync_worker(
551 vfs_t *vfsp, 550 bhv_vfs_t *vfsp,
552 void *unused) 551 void *unused)
553{ 552{
554 int error; 553 int error;
555 554
556 if (!(vfsp->vfs_flag & VFS_RDONLY)) 555 if (!(vfsp->vfs_flag & VFS_RDONLY))
557 VFS_SYNC(vfsp, SYNCD_FLAGS, NULL, error); 556 error = bhv_vfs_sync(vfsp, SYNC_FSDATA | SYNC_BDFLUSH | \
557 SYNC_ATTR | SYNC_REFCACHE, NULL);
558 vfsp->vfs_sync_seq++; 558 vfsp->vfs_sync_seq++;
559 wmb(); 559 wmb();
560 wake_up(&vfsp->vfs_wait_single_sync_task); 560 wake_up(&vfsp->vfs_wait_single_sync_task);
@@ -565,8 +565,8 @@ xfssyncd(
565 void *arg) 565 void *arg)
566{ 566{
567 long timeleft; 567 long timeleft;
568 vfs_t *vfsp = (vfs_t *) arg; 568 bhv_vfs_t *vfsp = (bhv_vfs_t *) arg;
569 struct vfs_sync_work *work, *n; 569 bhv_vfs_sync_work_t *work, *n;
570 LIST_HEAD (tmp); 570 LIST_HEAD (tmp);
571 571
572 timeleft = xfs_syncd_centisecs * msecs_to_jiffies(10); 572 timeleft = xfs_syncd_centisecs * msecs_to_jiffies(10);
@@ -600,7 +600,7 @@ xfssyncd(
600 list_del(&work->w_list); 600 list_del(&work->w_list);
601 if (work == &vfsp->vfs_sync_work) 601 if (work == &vfsp->vfs_sync_work)
602 continue; 602 continue;
603 kmem_free(work, sizeof(struct vfs_sync_work)); 603 kmem_free(work, sizeof(struct bhv_vfs_sync_work));
604 } 604 }
605 } 605 }
606 606
@@ -609,7 +609,7 @@ xfssyncd(
609 609
610STATIC int 610STATIC int
611xfs_fs_start_syncd( 611xfs_fs_start_syncd(
612 vfs_t *vfsp) 612 bhv_vfs_t *vfsp)
613{ 613{
614 vfsp->vfs_sync_work.w_syncer = vfs_sync_worker; 614 vfsp->vfs_sync_work.w_syncer = vfs_sync_worker;
615 vfsp->vfs_sync_work.w_vfs = vfsp; 615 vfsp->vfs_sync_work.w_vfs = vfsp;
@@ -621,7 +621,7 @@ xfs_fs_start_syncd(
621 621
622STATIC void 622STATIC void
623xfs_fs_stop_syncd( 623xfs_fs_stop_syncd(
624 vfs_t *vfsp) 624 bhv_vfs_t *vfsp)
625{ 625{
626 kthread_stop(vfsp->vfs_sync_task); 626 kthread_stop(vfsp->vfs_sync_task);
627} 627}
@@ -630,35 +630,26 @@ STATIC void
630xfs_fs_put_super( 630xfs_fs_put_super(
631 struct super_block *sb) 631 struct super_block *sb)
632{ 632{
633 vfs_t *vfsp = vfs_from_sb(sb); 633 bhv_vfs_t *vfsp = vfs_from_sb(sb);
634 int error; 634 int error;
635 635
636 xfs_fs_stop_syncd(vfsp); 636 xfs_fs_stop_syncd(vfsp);
637 VFS_SYNC(vfsp, SYNC_ATTR|SYNC_DELWRI, NULL, error); 637 bhv_vfs_sync(vfsp, SYNC_ATTR | SYNC_DELWRI, NULL);
638 if (!error) 638 error = bhv_vfs_unmount(vfsp, 0, NULL);
639 VFS_UNMOUNT(vfsp, 0, NULL, error);
640 if (error) { 639 if (error) {
641 printk("XFS unmount got error %d\n", error); 640 printk("XFS: unmount got error=%d\n", error);
642 printk("%s: vfsp/0x%p left dangling!\n", __FUNCTION__, vfsp); 641 printk("%s: vfs=0x%p left dangling!\n", __FUNCTION__, vfsp);
643 return; 642 } else {
643 vfs_deallocate(vfsp);
644 } 644 }
645
646 vfs_deallocate(vfsp);
647} 645}
648 646
649STATIC void 647STATIC void
650xfs_fs_write_super( 648xfs_fs_write_super(
651 struct super_block *sb) 649 struct super_block *sb)
652{ 650{
653 vfs_t *vfsp = vfs_from_sb(sb); 651 if (!(sb->s_flags & MS_RDONLY))
654 int error; 652 bhv_vfs_sync(vfs_from_sb(sb), SYNC_FSDATA, NULL);
655
656 if (sb->s_flags & MS_RDONLY) {
657 sb->s_dirt = 0; /* paranoia */
658 return;
659 }
660 /* Push the log and superblock a little */
661 VFS_SYNC(vfsp, SYNC_FSDATA, NULL, error);
662 sb->s_dirt = 0; 653 sb->s_dirt = 0;
663} 654}
664 655
@@ -667,16 +658,16 @@ xfs_fs_sync_super(
667 struct super_block *sb, 658 struct super_block *sb,
668 int wait) 659 int wait)
669{ 660{
670 vfs_t *vfsp = vfs_from_sb(sb); 661 bhv_vfs_t *vfsp = vfs_from_sb(sb);
671 int error; 662 int error;
672 int flags = SYNC_FSDATA; 663 int flags;
673 664
674 if (unlikely(sb->s_frozen == SB_FREEZE_WRITE)) 665 if (unlikely(sb->s_frozen == SB_FREEZE_WRITE))
675 flags = SYNC_QUIESCE; 666 flags = SYNC_QUIESCE;
676 else 667 else
677 flags = SYNC_FSDATA | (wait ? SYNC_WAIT : 0); 668 flags = SYNC_FSDATA | (wait ? SYNC_WAIT : 0);
678 669
679 VFS_SYNC(vfsp, flags, NULL, error); 670 error = bhv_vfs_sync(vfsp, flags, NULL);
680 sb->s_dirt = 0; 671 sb->s_dirt = 0;
681 672
682 if (unlikely(laptop_mode)) { 673 if (unlikely(laptop_mode)) {
@@ -706,11 +697,7 @@ xfs_fs_statfs(
706 struct super_block *sb, 697 struct super_block *sb,
707 struct kstatfs *statp) 698 struct kstatfs *statp)
708{ 699{
709 vfs_t *vfsp = vfs_from_sb(sb); 700 return -bhv_vfs_statvfs(vfs_from_sb(sb), statp, NULL);
710 int error;
711
712 VFS_STATVFS(vfsp, statp, NULL, error);
713 return -error;
714} 701}
715 702
716STATIC int 703STATIC int
@@ -719,13 +706,13 @@ xfs_fs_remount(
719 int *flags, 706 int *flags,
720 char *options) 707 char *options)
721{ 708{
722 vfs_t *vfsp = vfs_from_sb(sb); 709 bhv_vfs_t *vfsp = vfs_from_sb(sb);
723 struct xfs_mount_args *args = xfs_args_allocate(sb, 0); 710 struct xfs_mount_args *args = xfs_args_allocate(sb, 0);
724 int error; 711 int error;
725 712
726 VFS_PARSEARGS(vfsp, options, args, 1, error); 713 error = bhv_vfs_parseargs(vfsp, options, args, 1);
727 if (!error) 714 if (!error)
728 VFS_MNTUPDATE(vfsp, flags, args, error); 715 error = bhv_vfs_mntupdate(vfsp, flags, args);
729 kmem_free(args, sizeof(*args)); 716 kmem_free(args, sizeof(*args));
730 return -error; 717 return -error;
731} 718}
@@ -734,7 +721,7 @@ STATIC void
734xfs_fs_lockfs( 721xfs_fs_lockfs(
735 struct super_block *sb) 722 struct super_block *sb)
736{ 723{
737 VFS_FREEZE(vfs_from_sb(sb)); 724 bhv_vfs_freeze(vfs_from_sb(sb));
738} 725}
739 726
740STATIC int 727STATIC int
@@ -742,11 +729,7 @@ xfs_fs_show_options(
742 struct seq_file *m, 729 struct seq_file *m,
743 struct vfsmount *mnt) 730 struct vfsmount *mnt)
744{ 731{
745 struct vfs *vfsp = vfs_from_sb(mnt->mnt_sb); 732 return -bhv_vfs_showargs(vfs_from_sb(mnt->mnt_sb), m);
746 int error;
747
748 VFS_SHOWARGS(vfsp, m, error);
749 return error;
750} 733}
751 734
752STATIC int 735STATIC int
@@ -754,11 +737,7 @@ xfs_fs_quotasync(
754 struct super_block *sb, 737 struct super_block *sb,
755 int type) 738 int type)
756{ 739{
757 struct vfs *vfsp = vfs_from_sb(sb); 740 return -bhv_vfs_quotactl(vfs_from_sb(sb), Q_XQUOTASYNC, 0, NULL);
758 int error;
759
760 VFS_QUOTACTL(vfsp, Q_XQUOTASYNC, 0, (caddr_t)NULL, error);
761 return -error;
762} 741}
763 742
764STATIC int 743STATIC int
@@ -766,11 +745,7 @@ xfs_fs_getxstate(
766 struct super_block *sb, 745 struct super_block *sb,
767 struct fs_quota_stat *fqs) 746 struct fs_quota_stat *fqs)
768{ 747{
769 struct vfs *vfsp = vfs_from_sb(sb); 748 return -bhv_vfs_quotactl(vfs_from_sb(sb), Q_XGETQSTAT, 0, (caddr_t)fqs);
770 int error;
771
772 VFS_QUOTACTL(vfsp, Q_XGETQSTAT, 0, (caddr_t)fqs, error);
773 return -error;
774} 749}
775 750
776STATIC int 751STATIC int
@@ -779,11 +754,7 @@ xfs_fs_setxstate(
779 unsigned int flags, 754 unsigned int flags,
780 int op) 755 int op)
781{ 756{
782 struct vfs *vfsp = vfs_from_sb(sb); 757 return -bhv_vfs_quotactl(vfs_from_sb(sb), op, 0, (caddr_t)&flags);
783 int error;
784
785 VFS_QUOTACTL(vfsp, op, 0, (caddr_t)&flags, error);
786 return -error;
787} 758}
788 759
789STATIC int 760STATIC int
@@ -793,13 +764,10 @@ xfs_fs_getxquota(
793 qid_t id, 764 qid_t id,
794 struct fs_disk_quota *fdq) 765 struct fs_disk_quota *fdq)
795{ 766{
796 struct vfs *vfsp = vfs_from_sb(sb); 767 return -bhv_vfs_quotactl(vfs_from_sb(sb),
797 int error, getmode; 768 (type == USRQUOTA) ? Q_XGETQUOTA :
798 769 ((type == GRPQUOTA) ? Q_XGETGQUOTA :
799 getmode = (type == USRQUOTA) ? Q_XGETQUOTA : 770 Q_XGETPQUOTA), id, (caddr_t)fdq);
800 ((type == GRPQUOTA) ? Q_XGETGQUOTA : Q_XGETPQUOTA);
801 VFS_QUOTACTL(vfsp, getmode, id, (caddr_t)fdq, error);
802 return -error;
803} 771}
804 772
805STATIC int 773STATIC int
@@ -809,13 +777,10 @@ xfs_fs_setxquota(
809 qid_t id, 777 qid_t id,
810 struct fs_disk_quota *fdq) 778 struct fs_disk_quota *fdq)
811{ 779{
812 struct vfs *vfsp = vfs_from_sb(sb); 780 return -bhv_vfs_quotactl(vfs_from_sb(sb),
813 int error, setmode; 781 (type == USRQUOTA) ? Q_XSETQLIM :
814 782 ((type == GRPQUOTA) ? Q_XSETGQLIM :
815 setmode = (type == USRQUOTA) ? Q_XSETQLIM : 783 Q_XSETPQLIM), id, (caddr_t)fdq);
816 ((type == GRPQUOTA) ? Q_XSETGQLIM : Q_XSETPQLIM);
817 VFS_QUOTACTL(vfsp, setmode, id, (caddr_t)fdq, error);
818 return -error;
819} 784}
820 785
821STATIC int 786STATIC int
@@ -825,14 +790,14 @@ xfs_fs_fill_super(
825 int silent) 790 int silent)
826{ 791{
827 vnode_t *rootvp; 792 vnode_t *rootvp;
828 struct vfs *vfsp = vfs_allocate(sb); 793 struct bhv_vfs *vfsp = vfs_allocate(sb);
829 struct xfs_mount_args *args = xfs_args_allocate(sb, silent); 794 struct xfs_mount_args *args = xfs_args_allocate(sb, silent);
830 struct kstatfs statvfs; 795 struct kstatfs statvfs;
831 int error, error2; 796 int error;
832 797
833 bhv_insert_all_vfsops(vfsp); 798 bhv_insert_all_vfsops(vfsp);
834 799
835 VFS_PARSEARGS(vfsp, (char *)data, args, 0, error); 800 error = bhv_vfs_parseargs(vfsp, (char *)data, args, 0);
836 if (error) { 801 if (error) {
837 bhv_remove_all_vfsops(vfsp, 1); 802 bhv_remove_all_vfsops(vfsp, 1);
838 goto fail_vfsop; 803 goto fail_vfsop;
@@ -845,13 +810,13 @@ xfs_fs_fill_super(
845 sb->s_qcop = &xfs_quotactl_operations; 810 sb->s_qcop = &xfs_quotactl_operations;
846 sb->s_op = &xfs_super_operations; 811 sb->s_op = &xfs_super_operations;
847 812
848 VFS_MOUNT(vfsp, args, NULL, error); 813 error = bhv_vfs_mount(vfsp, args, NULL);
849 if (error) { 814 if (error) {
850 bhv_remove_all_vfsops(vfsp, 1); 815 bhv_remove_all_vfsops(vfsp, 1);
851 goto fail_vfsop; 816 goto fail_vfsop;
852 } 817 }
853 818
854 VFS_STATVFS(vfsp, &statvfs, NULL, error); 819 error = bhv_vfs_statvfs(vfsp, &statvfs, NULL);
855 if (error) 820 if (error)
856 goto fail_unmount; 821 goto fail_unmount;
857 822
@@ -863,7 +828,7 @@ xfs_fs_fill_super(
863 sb->s_time_gran = 1; 828 sb->s_time_gran = 1;
864 set_posix_acl_flag(sb); 829 set_posix_acl_flag(sb);
865 830
866 VFS_ROOT(vfsp, &rootvp, error); 831 error = bhv_vfs_root(vfsp, &rootvp);
867 if (error) 832 if (error)
868 goto fail_unmount; 833 goto fail_unmount;
869 834
@@ -892,7 +857,7 @@ fail_vnrele:
892 } 857 }
893 858
894fail_unmount: 859fail_unmount:
895 VFS_UNMOUNT(vfsp, 0, NULL, error2); 860 bhv_vfs_unmount(vfsp, 0, NULL);
896 861
897fail_vfsop: 862fail_vfsop:
898 vfs_deallocate(vfsp); 863 vfs_deallocate(vfsp);
diff --git a/fs/xfs/linux-2.6/xfs_vfs.c b/fs/xfs/linux-2.6/xfs_vfs.c
index 6f7c9f7a8624..9f9bc894deb9 100644
--- a/fs/xfs/linux-2.6/xfs_vfs.c
+++ b/fs/xfs/linux-2.6/xfs_vfs.c
@@ -226,13 +226,13 @@ vfs_freeze(
226 ((*bhvtovfsops(next)->vfs_freeze)(next)); 226 ((*bhvtovfsops(next)->vfs_freeze)(next));
227} 227}
228 228
229vfs_t * 229bhv_vfs_t *
230vfs_allocate( 230vfs_allocate(
231 struct super_block *sb) 231 struct super_block *sb)
232{ 232{
233 struct vfs *vfsp; 233 struct bhv_vfs *vfsp;
234 234
235 vfsp = kmem_zalloc(sizeof(vfs_t), KM_SLEEP); 235 vfsp = kmem_zalloc(sizeof(bhv_vfs_t), KM_SLEEP);
236 bhv_head_init(VFS_BHVHEAD(vfsp), "vfs"); 236 bhv_head_init(VFS_BHVHEAD(vfsp), "vfs");
237 INIT_LIST_HEAD(&vfsp->vfs_sync_list); 237 INIT_LIST_HEAD(&vfsp->vfs_sync_list);
238 spin_lock_init(&vfsp->vfs_sync_lock); 238 spin_lock_init(&vfsp->vfs_sync_lock);
@@ -247,25 +247,25 @@ vfs_allocate(
247 return vfsp; 247 return vfsp;
248} 248}
249 249
250vfs_t * 250bhv_vfs_t *
251vfs_from_sb( 251vfs_from_sb(
252 struct super_block *sb) 252 struct super_block *sb)
253{ 253{
254 return (vfs_t *)sb->s_fs_info; 254 return (bhv_vfs_t *)sb->s_fs_info;
255} 255}
256 256
257void 257void
258vfs_deallocate( 258vfs_deallocate(
259 struct vfs *vfsp) 259 struct bhv_vfs *vfsp)
260{ 260{
261 bhv_head_destroy(VFS_BHVHEAD(vfsp)); 261 bhv_head_destroy(VFS_BHVHEAD(vfsp));
262 kmem_free(vfsp, sizeof(vfs_t)); 262 kmem_free(vfsp, sizeof(bhv_vfs_t));
263} 263}
264 264
265void 265void
266vfs_insertops( 266vfs_insertops(
267 struct vfs *vfsp, 267 struct bhv_vfs *vfsp,
268 struct bhv_vfsops *vfsops) 268 struct bhv_module_vfsops *vfsops)
269{ 269{
270 struct bhv_desc *bdp; 270 struct bhv_desc *bdp;
271 271
@@ -276,9 +276,9 @@ vfs_insertops(
276 276
277void 277void
278vfs_insertbhv( 278vfs_insertbhv(
279 struct vfs *vfsp, 279 struct bhv_vfs *vfsp,
280 struct bhv_desc *bdp, 280 struct bhv_desc *bdp,
281 struct vfsops *vfsops, 281 struct bhv_vfsops *vfsops,
282 void *mount) 282 void *mount)
283{ 283{
284 bhv_desc_init(bdp, mount, vfsp, vfsops); 284 bhv_desc_init(bdp, mount, vfsp, vfsops);
@@ -287,7 +287,7 @@ vfs_insertbhv(
287 287
288void 288void
289bhv_remove_vfsops( 289bhv_remove_vfsops(
290 struct vfs *vfsp, 290 struct bhv_vfs *vfsp,
291 int pos) 291 int pos)
292{ 292{
293 struct bhv_desc *bhv; 293 struct bhv_desc *bhv;
@@ -301,7 +301,7 @@ bhv_remove_vfsops(
301 301
302void 302void
303bhv_remove_all_vfsops( 303bhv_remove_all_vfsops(
304 struct vfs *vfsp, 304 struct bhv_vfs *vfsp,
305 int freebase) 305 int freebase)
306{ 306{
307 struct xfs_mount *mp; 307 struct xfs_mount *mp;
@@ -317,7 +317,7 @@ bhv_remove_all_vfsops(
317 317
318void 318void
319bhv_insert_all_vfsops( 319bhv_insert_all_vfsops(
320 struct vfs *vfsp) 320 struct bhv_vfs *vfsp)
321{ 321{
322 struct xfs_mount *mp; 322 struct xfs_mount *mp;
323 323
diff --git a/fs/xfs/linux-2.6/xfs_vfs.h b/fs/xfs/linux-2.6/xfs_vfs.h
index 2ca05043a0fd..55f0afd3e794 100644
--- a/fs/xfs/linux-2.6/xfs_vfs.h
+++ b/fs/xfs/linux-2.6/xfs_vfs.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2000-2005 Silicon Graphics, Inc. 2 * Copyright (c) 2000-2006 Silicon Graphics, Inc.
3 * All Rights Reserved. 3 * All Rights Reserved.
4 * 4 *
5 * This program is free software; you can redistribute it and/or 5 * This program is free software; you can redistribute it and/or
@@ -21,42 +21,42 @@
21#include <linux/vfs.h> 21#include <linux/vfs.h>
22#include "xfs_fs.h" 22#include "xfs_fs.h"
23 23
24struct bhv_vfs;
24struct fid; 25struct fid;
25struct vfs;
26struct cred; 26struct cred;
27struct vnode; 27struct vnode;
28struct kstatfs; 28struct statfs;
29struct seq_file; 29struct seq_file;
30struct super_block; 30struct super_block;
31struct xfs_mount_args; 31struct xfs_mount_args;
32 32
33typedef struct kstatfs xfs_statfs_t; 33typedef struct kstatfs xfs_statfs_t;
34 34
35typedef struct vfs_sync_work { 35typedef struct bhv_vfs_sync_work {
36 struct list_head w_list; 36 struct list_head w_list;
37 struct vfs *w_vfs; 37 struct bhv_vfs *w_vfs;
38 void *w_data; /* syncer routine argument */ 38 void *w_data; /* syncer routine argument */
39 void (*w_syncer)(struct vfs *, void *); 39 void (*w_syncer)(struct bhv_vfs *, void *);
40} vfs_sync_work_t; 40} bhv_vfs_sync_work_t;
41 41
42typedef struct vfs { 42typedef struct bhv_vfs {
43 u_int vfs_flag; /* flags */ 43 u_int vfs_flag; /* flags */
44 xfs_fsid_t vfs_fsid; /* file system ID */ 44 xfs_fsid_t vfs_fsid; /* file system ID */
45 xfs_fsid_t *vfs_altfsid; /* An ID fixed for life of FS */ 45 xfs_fsid_t *vfs_altfsid; /* An ID fixed for life of FS */
46 bhv_head_t vfs_bh; /* head of vfs behavior chain */ 46 bhv_head_t vfs_bh; /* head of vfs behavior chain */
47 struct super_block *vfs_super; /* generic superblock pointer */ 47 struct super_block *vfs_super; /* generic superblock pointer */
48 struct task_struct *vfs_sync_task; /* generalised sync thread */ 48 struct task_struct *vfs_sync_task; /* generalised sync thread */
49 vfs_sync_work_t vfs_sync_work; /* work item for VFS_SYNC */ 49 bhv_vfs_sync_work_t vfs_sync_work; /* work item for VFS_SYNC */
50 struct list_head vfs_sync_list; /* sync thread work item list */ 50 struct list_head vfs_sync_list; /* sync thread work item list */
51 spinlock_t vfs_sync_lock; /* work item list lock */ 51 spinlock_t vfs_sync_lock; /* work item list lock */
52 int vfs_sync_seq; /* sync thread generation no. */ 52 int vfs_sync_seq; /* sync thread generation no. */
53 wait_queue_head_t vfs_wait_single_sync_task; 53 wait_queue_head_t vfs_wait_single_sync_task;
54} vfs_t; 54} bhv_vfs_t;
55 55
56#define vfs_fbhv vfs_bh.bh_first /* 1st on vfs behavior chain */ 56#define vfs_fbhv vfs_bh.bh_first /* 1st on vfs behavior chain */
57 57
58#define bhvtovfs(bdp) ( (struct vfs *)BHV_VOBJ(bdp) ) 58#define bhvtovfs(bdp) ( (struct bhv_vfs *)BHV_VOBJ(bdp) )
59#define bhvtovfsops(bdp) ( (struct vfsops *)BHV_OPS(bdp) ) 59#define bhvtovfsops(bdp) ( (struct bhv_vfsops *)BHV_OPS(bdp) )
60#define VFS_BHVHEAD(vfs) ( &(vfs)->vfs_bh ) 60#define VFS_BHVHEAD(vfs) ( &(vfs)->vfs_bh )
61#define VFS_REMOVEBHV(vfs, bdp) ( bhv_remove(VFS_BHVHEAD(vfs), bdp) ) 61#define VFS_REMOVEBHV(vfs, bdp) ( bhv_remove(VFS_BHVHEAD(vfs), bdp) )
62 62
@@ -71,7 +71,7 @@ typedef enum {
71 VFS_BHV_QM, /* quota manager */ 71 VFS_BHV_QM, /* quota manager */
72 VFS_BHV_IO, /* IO path */ 72 VFS_BHV_IO, /* IO path */
73 VFS_BHV_END /* housekeeping end-of-range */ 73 VFS_BHV_END /* housekeeping end-of-range */
74} vfs_bhv_t; 74} bhv_vfs_type_t;
75 75
76#define VFS_POSITION_XFS (BHV_POSITION_BASE) 76#define VFS_POSITION_XFS (BHV_POSITION_BASE)
77#define VFS_POSITION_DM (VFS_POSITION_BASE+10) 77#define VFS_POSITION_DM (VFS_POSITION_BASE+10)
@@ -81,8 +81,9 @@ typedef enum {
81#define VFS_RDONLY 0x0001 /* read-only vfs */ 81#define VFS_RDONLY 0x0001 /* read-only vfs */
82#define VFS_GRPID 0x0002 /* group-ID assigned from directory */ 82#define VFS_GRPID 0x0002 /* group-ID assigned from directory */
83#define VFS_DMI 0x0004 /* filesystem has the DMI enabled */ 83#define VFS_DMI 0x0004 /* filesystem has the DMI enabled */
84#define VFS_32BITINODES 0x0008 /* do not use inums above 32 bits */ 84#define VFS_UMOUNT 0x0008 /* unmount in progress */
85#define VFS_END 0x0008 /* max flag */ 85#define VFS_32BITINODES 0x0010 /* do not use inums above 32 bits */
86#define VFS_END 0x0010 /* max flag */
86 87
87#define SYNC_ATTR 0x0001 /* sync attributes */ 88#define SYNC_ATTR 0x0001 /* sync attributes */
88#define SYNC_CLOSE 0x0002 /* close file system down */ 89#define SYNC_CLOSE 0x0002 /* close file system down */
@@ -92,7 +93,7 @@ typedef enum {
92#define SYNC_FSDATA 0x0020 /* flush fs data (e.g. superblocks) */ 93#define SYNC_FSDATA 0x0020 /* flush fs data (e.g. superblocks) */
93#define SYNC_REFCACHE 0x0040 /* prune some of the nfs ref cache */ 94#define SYNC_REFCACHE 0x0040 /* prune some of the nfs ref cache */
94#define SYNC_REMOUNT 0x0080 /* remount readonly, no dummy LRs */ 95#define SYNC_REMOUNT 0x0080 /* remount readonly, no dummy LRs */
95#define SYNC_QUIESCE 0x0100 /* quiesce filesystem for a snapshot */ 96#define SYNC_QUIESCE 0x0100 /* quiesce fileystem for a snapshot */
96 97
97#define SHUTDOWN_META_IO_ERROR 0x0001 /* write attempt to metadata failed */ 98#define SHUTDOWN_META_IO_ERROR 0x0001 /* write attempt to metadata failed */
98#define SHUTDOWN_LOG_IO_ERROR 0x0002 /* write attempt to the log failed */ 99#define SHUTDOWN_LOG_IO_ERROR 0x0002 /* write attempt to the log failed */
@@ -120,7 +121,7 @@ typedef void (*vfs_init_vnode_t)(bhv_desc_t *,
120typedef void (*vfs_force_shutdown_t)(bhv_desc_t *, int, char *, int); 121typedef void (*vfs_force_shutdown_t)(bhv_desc_t *, int, char *, int);
121typedef void (*vfs_freeze_t)(bhv_desc_t *); 122typedef void (*vfs_freeze_t)(bhv_desc_t *);
122 123
123typedef struct vfsops { 124typedef struct bhv_vfsops {
124 bhv_position_t vf_position; /* behavior chain position */ 125 bhv_position_t vf_position; /* behavior chain position */
125 vfs_mount_t vfs_mount; /* mount file system */ 126 vfs_mount_t vfs_mount; /* mount file system */
126 vfs_parseargs_t vfs_parseargs; /* parse mount options */ 127 vfs_parseargs_t vfs_parseargs; /* parse mount options */
@@ -136,44 +137,44 @@ typedef struct vfsops {
136 vfs_init_vnode_t vfs_init_vnode; /* initialize a new vnode */ 137 vfs_init_vnode_t vfs_init_vnode; /* initialize a new vnode */
137 vfs_force_shutdown_t vfs_force_shutdown; /* crash and burn */ 138 vfs_force_shutdown_t vfs_force_shutdown; /* crash and burn */
138 vfs_freeze_t vfs_freeze; /* freeze fs for snapshot */ 139 vfs_freeze_t vfs_freeze; /* freeze fs for snapshot */
139} vfsops_t; 140} bhv_vfsops_t;
140 141
141/* 142/*
142 * VFS's. Operates on vfs structure pointers (starts at bhv head). 143 * VFS's. Operates on vfs structure pointers (starts at bhv head).
143 */ 144 */
144#define VHEAD(v) ((v)->vfs_fbhv) 145#define VHEAD(v) ((v)->vfs_fbhv)
145#define VFS_MOUNT(v, ma,cr, rv) ((rv) = vfs_mount(VHEAD(v), ma,cr)) 146#define bhv_vfs_mount(v, ma,cr) vfs_mount(VHEAD(v), ma,cr)
146#define VFS_PARSEARGS(v, o,ma,f, rv) ((rv) = vfs_parseargs(VHEAD(v), o,ma,f)) 147#define bhv_vfs_parseargs(v, o,ma,f) vfs_parseargs(VHEAD(v), o,ma,f)
147#define VFS_SHOWARGS(v, m, rv) ((rv) = vfs_showargs(VHEAD(v), m)) 148#define bhv_vfs_showargs(v, m) vfs_showargs(VHEAD(v), m)
148#define VFS_UNMOUNT(v, f, cr, rv) ((rv) = vfs_unmount(VHEAD(v), f,cr)) 149#define bhv_vfs_unmount(v, f,cr) vfs_unmount(VHEAD(v), f,cr)
149#define VFS_MNTUPDATE(v, fl, args, rv) ((rv) = vfs_mntupdate(VHEAD(v), fl, args)) 150#define bhv_vfs_mntupdate(v, fl,args) vfs_mntupdate(VHEAD(v), fl,args)
150#define VFS_ROOT(v, vpp, rv) ((rv) = vfs_root(VHEAD(v), vpp)) 151#define bhv_vfs_root(v, vpp) vfs_root(VHEAD(v), vpp)
151#define VFS_STATVFS(v, sp,vp, rv) ((rv) = vfs_statvfs(VHEAD(v), sp,vp)) 152#define bhv_vfs_statvfs(v, sp,vp) vfs_statvfs(VHEAD(v), sp,vp)
152#define VFS_SYNC(v, flag,cr, rv) ((rv) = vfs_sync(VHEAD(v), flag,cr)) 153#define bhv_vfs_sync(v, flag,cr) vfs_sync(VHEAD(v), flag,cr)
153#define VFS_VGET(v, vpp,fidp, rv) ((rv) = vfs_vget(VHEAD(v), vpp,fidp)) 154#define bhv_vfs_vget(v, vpp,fidp) vfs_vget(VHEAD(v), vpp,fidp)
154#define VFS_DMAPIOPS(v, p, rv) ((rv) = vfs_dmapiops(VHEAD(v), p)) 155#define bhv_vfs_dmapiops(v, p) vfs_dmapiops(VHEAD(v), p)
155#define VFS_QUOTACTL(v, c,id,p, rv) ((rv) = vfs_quotactl(VHEAD(v), c,id,p)) 156#define bhv_vfs_quotactl(v, c,id,p) vfs_quotactl(VHEAD(v), c,id,p)
156#define VFS_INIT_VNODE(v, vp,b,ul) ( vfs_init_vnode(VHEAD(v), vp,b,ul) ) 157#define bhv_vfs_init_vnode(v, vp,b,ul) vfs_init_vnode(VHEAD(v), vp,b,ul)
157#define VFS_FORCE_SHUTDOWN(v, fl,f,l) ( vfs_force_shutdown(VHEAD(v), fl,f,l) ) 158#define bhv_vfs_force_shutdown(v,u,f,l) vfs_force_shutdown(VHEAD(v), u,f,l)
158#define VFS_FREEZE(v) ( vfs_freeze(VHEAD(v)) ) 159#define bhv_vfs_freeze(v) vfs_freeze(VHEAD(v))
159 160
160/* 161/*
161 * PVFS's. Operates on behavior descriptor pointers. 162 * PVFS's. Operates on behavior descriptor pointers.
162 */ 163 */
163#define PVFS_MOUNT(b, ma,cr, rv) ((rv) = vfs_mount(b, ma,cr)) 164#define bhv_next_vfs_mount(b, ma,cr) vfs_mount(b, ma,cr)
164#define PVFS_PARSEARGS(b, o,ma,f, rv) ((rv) = vfs_parseargs(b, o,ma,f)) 165#define bhv_next_vfs_parseargs(b, o,ma,f) vfs_parseargs(b, o,ma,f)
165#define PVFS_SHOWARGS(b, m, rv) ((rv) = vfs_showargs(b, m)) 166#define bhv_next_vfs_showargs(b, m) vfs_showargs(b, m)
166#define PVFS_UNMOUNT(b, f,cr, rv) ((rv) = vfs_unmount(b, f,cr)) 167#define bhv_next_vfs_unmount(b, f,cr) vfs_unmount(b, f,cr)
167#define PVFS_MNTUPDATE(b, fl, args, rv) ((rv) = vfs_mntupdate(b, fl, args)) 168#define bhv_next_vfs_mntupdate(b, fl,args) vfs_mntupdate(b, fl, args)
168#define PVFS_ROOT(b, vpp, rv) ((rv) = vfs_root(b, vpp)) 169#define bhv_next_vfs_root(b, vpp) vfs_root(b, vpp)
169#define PVFS_STATVFS(b, sp,vp, rv) ((rv) = vfs_statvfs(b, sp,vp)) 170#define bhv_next_vfs_statvfs(b, sp,vp) vfs_statvfs(b, sp,vp)
170#define PVFS_SYNC(b, flag,cr, rv) ((rv) = vfs_sync(b, flag,cr)) 171#define bhv_next_vfs_sync(b, flag,cr) vfs_sync(b, flag,cr)
171#define PVFS_VGET(b, vpp,fidp, rv) ((rv) = vfs_vget(b, vpp,fidp)) 172#define bhv_next_vfs_vget(b, vpp,fidp) vfs_vget(b, vpp,fidp)
172#define PVFS_DMAPIOPS(b, p, rv) ((rv) = vfs_dmapiops(b, p)) 173#define bhv_next_vfs_dmapiops(b, p) vfs_dmapiops(b, p)
173#define PVFS_QUOTACTL(b, c,id,p, rv) ((rv) = vfs_quotactl(b, c,id,p)) 174#define bhv_next_vfs_quotactl(b, c,id,p) vfs_quotactl(b, c,id,p)
174#define PVFS_INIT_VNODE(b, vp,b2,ul) ( vfs_init_vnode(b, vp,b2,ul) ) 175#define bhv_next_vfs_init_vnode(b, vp,b2,ul) vfs_init_vnode(b, vp,b2,ul)
175#define PVFS_FORCE_SHUTDOWN(b, fl,f,l) ( vfs_force_shutdown(b, fl,f,l) ) 176#define bhv_next_force_shutdown(b, fl,f,l) vfs_force_shutdown(b, fl,f,l)
176#define PVFS_FREEZE(b) ( vfs_freeze(b) ) 177#define bhv_next_vfs_freeze(b) vfs_freeze(b)
177 178
178extern int vfs_mount(bhv_desc_t *, struct xfs_mount_args *, struct cred *); 179extern int vfs_mount(bhv_desc_t *, struct xfs_mount_args *, struct cred *);
179extern int vfs_parseargs(bhv_desc_t *, char *, struct xfs_mount_args *, int); 180extern int vfs_parseargs(bhv_desc_t *, char *, struct xfs_mount_args *, int);
@@ -190,25 +191,26 @@ extern void vfs_init_vnode(bhv_desc_t *, struct vnode *, bhv_desc_t *, int);
190extern void vfs_force_shutdown(bhv_desc_t *, int, char *, int); 191extern void vfs_force_shutdown(bhv_desc_t *, int, char *, int);
191extern void vfs_freeze(bhv_desc_t *); 192extern void vfs_freeze(bhv_desc_t *);
192 193
193typedef struct bhv_vfsops { 194typedef struct bhv_module_vfsops {
194 struct vfsops bhv_common; 195 struct bhv_vfsops bhv_common;
195 void * bhv_custom; 196 void * bhv_custom;
196} bhv_vfsops_t; 197} bhv_module_vfsops_t;
198
199#define vfs_bhv_lookup(v, id) (bhv_lookup_range(&(v)->vfs_bh, (id), (id)))
200#define vfs_bhv_custom(b) (((bhv_module_vfsops_t*)BHV_OPS(b))->bhv_custom)
201#define vfs_bhv_set_custom(b,o) ((b)->bhv_custom = (void *)(o))
202#define vfs_bhv_clr_custom(b) ((b)->bhv_custom = NULL)
197 203
198#define vfs_bhv_lookup(v, id) ( bhv_lookup_range(&(v)->vfs_bh, (id), (id)) ) 204extern bhv_vfs_t *vfs_allocate(struct super_block *);
199#define vfs_bhv_custom(b) ( ((bhv_vfsops_t *)BHV_OPS(b))->bhv_custom ) 205extern bhv_vfs_t *vfs_from_sb(struct super_block *);
200#define vfs_bhv_set_custom(b,o) ( (b)->bhv_custom = (void *)(o)) 206extern void vfs_deallocate(bhv_vfs_t *);
201#define vfs_bhv_clr_custom(b) ( (b)->bhv_custom = NULL ) 207extern void vfs_insertbhv(bhv_vfs_t *, bhv_desc_t *, bhv_vfsops_t *, void *);
202 208
203extern vfs_t *vfs_allocate(struct super_block *); 209extern void vfs_insertops(bhv_vfs_t *, bhv_module_vfsops_t *);
204extern vfs_t *vfs_from_sb(struct super_block *);
205extern void vfs_deallocate(vfs_t *);
206extern void vfs_insertops(vfs_t *, bhv_vfsops_t *);
207extern void vfs_insertbhv(vfs_t *, bhv_desc_t *, vfsops_t *, void *);
208 210
209extern void bhv_insert_all_vfsops(struct vfs *); 211extern void bhv_insert_all_vfsops(struct bhv_vfs *);
210extern void bhv_remove_all_vfsops(struct vfs *, int); 212extern void bhv_remove_all_vfsops(struct bhv_vfs *, int);
211extern void bhv_remove_vfsops(struct vfs *, int); 213extern void bhv_remove_vfsops(struct bhv_vfs *, int);
212 214
213#define fs_frozen(vfsp) ((vfsp)->vfs_super->s_frozen) 215#define fs_frozen(vfsp) ((vfsp)->vfs_super->s_frozen)
214#define fs_check_frozen(vfsp, level) \ 216#define fs_check_frozen(vfsp, level) \
diff --git a/fs/xfs/linux-2.6/xfs_vnode.c b/fs/xfs/linux-2.6/xfs_vnode.c
index f17e39cff230..82777f1a70a7 100644
--- a/fs/xfs/linux-2.6/xfs_vnode.c
+++ b/fs/xfs/linux-2.6/xfs_vnode.c
@@ -67,7 +67,7 @@ vn_ioerror(
67 int l) 67 int l)
68{ 68{
69 if (unlikely(error == -ENODEV)) 69 if (unlikely(error == -ENODEV))
70 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 * 73struct vnode *
diff --git a/fs/xfs/linux-2.6/xfs_vnode.h b/fs/xfs/linux-2.6/xfs_vnode.h
index 569a4e7b5cc1..95343637ab66 100644
--- a/fs/xfs/linux-2.6/xfs_vnode.h
+++ b/fs/xfs/linux-2.6/xfs_vnode.h
@@ -68,7 +68,7 @@ typedef enum vflags {
68 */ 68 */
69typedef struct vnode { 69typedef struct vnode {
70 vflags_t v_flag; /* vnode flags (see above) */ 70 vflags_t v_flag; /* vnode flags (see above) */
71 struct vfs *v_vfsp; /* ptr to containing VFS */ 71 struct bhv_vfs *v_vfsp; /* ptr to containing VFS */
72 vnumber_t v_number; /* in-core vnode number */ 72 vnumber_t v_number; /* in-core vnode number */
73 vn_bhv_head_t v_bh; /* behavior head */ 73 vn_bhv_head_t v_bh; /* behavior head */
74 spinlock_t v_lock; /* VN_LOCK/VN_UNLOCK */ 74 spinlock_t v_lock; /* VN_LOCK/VN_UNLOCK */
@@ -503,7 +503,7 @@ extern vnode_t *vn_initialize(struct inode *);
503 * vnode_map structures _must_ match vn_epoch and vnode structure sizes. 503 * vnode_map structures _must_ match vn_epoch and vnode structure sizes.
504 */ 504 */
505typedef struct vnode_map { 505typedef struct vnode_map {
506 vfs_t *v_vfsp; 506 bhv_vfs_t *v_vfsp;
507 vnumber_t v_number; /* in-core vnode number */ 507 vnumber_t v_number; /* in-core vnode number */
508 xfs_ino_t v_ino; /* inode # */ 508 xfs_ino_t v_ino; /* inode # */
509} vmap_t; 509} vmap_t;
diff --git a/fs/xfs/quota/xfs_qm_bhv.c b/fs/xfs/quota/xfs_qm_bhv.c
index 181dd90b29ce..78f5962e5781 100644
--- a/fs/xfs/quota/xfs_qm_bhv.c
+++ b/fs/xfs/quota/xfs_qm_bhv.c
@@ -129,7 +129,7 @@ xfs_qm_parseargs(
129 return XFS_ERROR(EINVAL); 129 return XFS_ERROR(EINVAL);
130 } 130 }
131 131
132 PVFS_PARSEARGS(BHV_NEXT(bhv), options, args, update, error); 132 error = bhv_next_vfs_parseargs(BHV_NEXT(bhv), options, args, update);
133 if (!error && !referenced) 133 if (!error && !referenced)
134 bhv_remove_vfsops(bhvtovfs(bhv), VFS_POSITION_QM); 134 bhv_remove_vfsops(bhvtovfs(bhv), VFS_POSITION_QM);
135 return error; 135 return error;
@@ -140,9 +140,8 @@ xfs_qm_showargs(
140 struct bhv_desc *bhv, 140 struct bhv_desc *bhv,
141 struct seq_file *m) 141 struct seq_file *m)
142{ 142{
143 struct vfs *vfsp = bhvtovfs(bhv); 143 struct bhv_vfs *vfsp = bhvtovfs(bhv);
144 struct xfs_mount *mp = XFS_VFSTOM(vfsp); 144 struct xfs_mount *mp = XFS_VFSTOM(vfsp);
145 int error;
146 145
147 if (mp->m_qflags & XFS_UQUOTA_ACCT) { 146 if (mp->m_qflags & XFS_UQUOTA_ACCT) {
148 (mp->m_qflags & XFS_UQUOTA_ENFD) ? 147 (mp->m_qflags & XFS_UQUOTA_ENFD) ?
@@ -165,8 +164,7 @@ xfs_qm_showargs(
165 if (!(mp->m_qflags & XFS_ALL_QUOTA_ACCT)) 164 if (!(mp->m_qflags & XFS_ALL_QUOTA_ACCT))
166 seq_puts(m, "," MNTOPT_NOQUOTA); 165 seq_puts(m, "," MNTOPT_NOQUOTA);
167 166
168 PVFS_SHOWARGS(BHV_NEXT(bhv), m, error); 167 return bhv_next_vfs_showargs(BHV_NEXT(bhv), m);
169 return error;
170} 168}
171 169
172STATIC int 170STATIC int
@@ -175,14 +173,12 @@ xfs_qm_mount(
175 struct xfs_mount_args *args, 173 struct xfs_mount_args *args,
176 struct cred *cr) 174 struct cred *cr)
177{ 175{
178 struct vfs *vfsp = bhvtovfs(bhv); 176 struct bhv_vfs *vfsp = bhvtovfs(bhv);
179 struct xfs_mount *mp = XFS_VFSTOM(vfsp); 177 struct xfs_mount *mp = XFS_VFSTOM(vfsp);
180 int error;
181 178
182 if (args->flags & (XFSMNT_UQUOTA | XFSMNT_GQUOTA | XFSMNT_PQUOTA)) 179 if (args->flags & (XFSMNT_UQUOTA | XFSMNT_GQUOTA | XFSMNT_PQUOTA))
183 xfs_qm_mount_quotainit(mp, args->flags); 180 xfs_qm_mount_quotainit(mp, args->flags);
184 PVFS_MOUNT(BHV_NEXT(bhv), args, cr, error); 181 return bhv_next_vfs_mount(BHV_NEXT(bhv), args, cr);
185 return error;
186} 182}
187 183
188/* 184/*
@@ -205,7 +201,7 @@ xfs_qm_statvfs(
205 __uint64_t limit; 201 __uint64_t limit;
206 int error; 202 int error;
207 203
208 error = PVFS_STATVFS(BHV_NEXT(bhv), statp, vnode); 204 error = bhv_next_vfs_statvfs(BHV_NEXT(bhv), statp, vnode);
209 if (error || !vnode) 205 if (error || !vnode)
210 return error; 206 return error;
211 207
@@ -246,7 +242,7 @@ xfs_qm_syncall(
246 int flags, 242 int flags,
247 cred_t *credp) 243 cred_t *credp)
248{ 244{
249 struct vfs *vfsp = bhvtovfs(bhv); 245 struct bhv_vfs *vfsp = bhvtovfs(bhv);
250 struct xfs_mount *mp = XFS_VFSTOM(vfsp); 246 struct xfs_mount *mp = XFS_VFSTOM(vfsp);
251 int error; 247 int error;
252 248
@@ -265,8 +261,7 @@ xfs_qm_syncall(
265 } 261 }
266 } 262 }
267 } 263 }
268 PVFS_SYNC(BHV_NEXT(bhv), flags, credp, error); 264 return bhv_next_vfs_sync(BHV_NEXT(bhv), flags, credp);
269 return error;
270} 265}
271 266
272STATIC int 267STATIC int
@@ -401,7 +396,7 @@ STATIC struct xfs_qmops xfs_qmcore_xfs = {
401 .xfs_dqtrxops = &xfs_trans_dquot_ops, 396 .xfs_dqtrxops = &xfs_trans_dquot_ops,
402}; 397};
403 398
404struct bhv_vfsops xfs_qmops = { { 399struct bhv_module_vfsops xfs_qmops = { {
405 BHV_IDENTITY_INIT(VFS_BHV_QM, VFS_POSITION_QM), 400 BHV_IDENTITY_INIT(VFS_BHV_QM, VFS_POSITION_QM),
406 .vfs_parseargs = xfs_qm_parseargs, 401 .vfs_parseargs = xfs_qm_parseargs,
407 .vfs_showargs = xfs_qm_showargs, 402 .vfs_showargs = xfs_qm_showargs,
diff --git a/fs/xfs/quota/xfs_qm_syscalls.c b/fs/xfs/quota/xfs_qm_syscalls.c
index c55db463bbf2..afc7c1c696b8 100644
--- a/fs/xfs/quota/xfs_qm_syscalls.c
+++ b/fs/xfs/quota/xfs_qm_syscalls.c
@@ -91,8 +91,8 @@ xfs_qm_quotactl(
91 xfs_caddr_t addr) 91 xfs_caddr_t addr)
92{ 92{
93 xfs_mount_t *mp; 93 xfs_mount_t *mp;
94 bhv_vfs_t *vfsp;
94 int error; 95 int error;
95 struct vfs *vfsp;
96 96
97 vfsp = bhvtovfs(bdp); 97 vfsp = bhvtovfs(bdp);
98 mp = XFS_VFSTOM(vfsp); 98 mp = XFS_VFSTOM(vfsp);
diff --git a/fs/xfs/xfs_dmapi.h b/fs/xfs/xfs_dmapi.h
index 00b1540f8108..4e7865ad6f0e 100644
--- a/fs/xfs/xfs_dmapi.h
+++ b/fs/xfs/xfs_dmapi.h
@@ -189,6 +189,6 @@ typedef enum {
189#define AT_DELAY_FLAG(f) ((f&ATTR_NONBLOCK) ? DM_FLAGS_NDELAY : 0) 189#define AT_DELAY_FLAG(f) ((f&ATTR_NONBLOCK) ? DM_FLAGS_NDELAY : 0)
190 190
191 191
192extern struct bhv_vfsops xfs_dmops; 192extern struct bhv_module_vfsops xfs_dmops;
193 193
194#endif /* __XFS_DMAPI_H__ */ 194#endif /* __XFS_DMAPI_H__ */
diff --git a/fs/xfs/xfs_fsops.c b/fs/xfs/xfs_fsops.c
index 96f4b3e8fa4a..502483c41f97 100644
--- a/fs/xfs/xfs_fsops.c
+++ b/fs/xfs/xfs_fsops.c
@@ -574,7 +574,7 @@ xfs_fs_goingdown(
574{ 574{
575 switch (inflags) { 575 switch (inflags) {
576 case XFS_FSOP_GOING_FLAGS_DEFAULT: { 576 case XFS_FSOP_GOING_FLAGS_DEFAULT: {
577 struct vfs *vfsp = XFS_MTOVFS(mp); 577 struct bhv_vfs *vfsp = XFS_MTOVFS(mp);
578 struct super_block *sb = freeze_bdev(vfsp->vfs_super->s_bdev); 578 struct super_block *sb = freeze_bdev(vfsp->vfs_super->s_bdev);
579 579
580 if (sb && !IS_ERR(sb)) { 580 if (sb && !IS_ERR(sb)) {
diff --git a/fs/xfs/xfs_iget.c b/fs/xfs/xfs_iget.c
index b53854325266..41f38eb60ebc 100644
--- a/fs/xfs/xfs_iget.c
+++ b/fs/xfs/xfs_iget.c
@@ -468,7 +468,7 @@ finish_inode:
468 * If we have a real type for an on-disk inode, we can set ops(&unlock) 468 * If we have a real type for an on-disk inode, we can set ops(&unlock)
469 * now. If it's a new inode being created, xfs_ialloc will handle it. 469 * now. If it's a new inode being created, xfs_ialloc will handle it.
470 */ 470 */
471 VFS_INIT_VNODE(XFS_MTOVFS(mp), vp, XFS_ITOBHV(ip), 1); 471 bhv_vfs_init_vnode(XFS_MTOVFS(mp), vp, XFS_ITOBHV(ip), 1);
472 472
473 return 0; 473 return 0;
474} 474}
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index 50119a00885b..0ed707ed664b 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -1250,8 +1250,8 @@ xfs_ialloc(
1250 */ 1250 */
1251 xfs_trans_log_inode(tp, ip, flags); 1251 xfs_trans_log_inode(tp, ip, flags);
1252 1252
1253 /* now that we have an i_mode we can set Linux inode ops (& unlock) */ 1253 /* now that we have an i_mode we can setup inode ops and unlock */
1254 VFS_INIT_VNODE(XFS_MTOVFS(tp->t_mountp), vp, XFS_ITOBHV(ip), 1); 1254 bhv_vfs_init_vnode(XFS_MTOVFS(tp->t_mountp), vp, XFS_ITOBHV(ip), 1);
1255 1255
1256 *ipp = ip; 1256 *ipp = ip;
1257 return 0; 1257 return 0;
diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h
index 3b544db1790b..233668b748f7 100644
--- a/fs/xfs/xfs_inode.h
+++ b/fs/xfs/xfs_inode.h
@@ -509,7 +509,6 @@ extern struct kmem_zone *xfs_chashlist_zone;
509extern struct kmem_zone *xfs_ifork_zone; 509extern struct kmem_zone *xfs_ifork_zone;
510extern struct kmem_zone *xfs_inode_zone; 510extern struct kmem_zone *xfs_inode_zone;
511extern struct kmem_zone *xfs_ili_zone; 511extern struct kmem_zone *xfs_ili_zone;
512extern struct vnodeops xfs_vnodeops;
513 512
514#endif /* __KERNEL__ */ 513#endif /* __KERNEL__ */
515 514
diff --git a/fs/xfs/xfs_iocore.c b/fs/xfs/xfs_iocore.c
index d3da194f8b7d..89441e69cdde 100644
--- a/fs/xfs/xfs_iocore.c
+++ b/fs/xfs/xfs_iocore.c
@@ -59,7 +59,7 @@ xfs_size_fn(
59 59
60STATIC int 60STATIC int
61xfs_ioinit( 61xfs_ioinit(
62 struct vfs *vfsp, 62 struct bhv_vfs *vfsp,
63 struct xfs_mount_args *mntargs, 63 struct xfs_mount_args *mntargs,
64 int flags) 64 int flags)
65{ 65{
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
index 7d882d6c7d49..9f70ab3e0983 100644
--- a/fs/xfs/xfs_log.c
+++ b/fs/xfs/xfs_log.c
@@ -498,9 +498,8 @@ xfs_log_mount(xfs_mount_t *mp,
498 * just worked. 498 * just worked.
499 */ 499 */
500 if (!(mp->m_flags & XFS_MOUNT_NORECOVERY)) { 500 if (!(mp->m_flags & XFS_MOUNT_NORECOVERY)) {
501 int error; 501 bhv_vfs_t *vfsp = XFS_MTOVFS(mp);
502 vfs_t *vfsp = XFS_MTOVFS(mp); 502 int error, readonly = (vfsp->vfs_flag & VFS_RDONLY);
503 int readonly = (vfsp->vfs_flag & VFS_RDONLY);
504 503
505 if (readonly) 504 if (readonly)
506 vfsp->vfs_flag &= ~VFS_RDONLY; 505 vfsp->vfs_flag &= ~VFS_RDONLY;
@@ -816,7 +815,7 @@ xfs_log_need_covered(xfs_mount_t *mp)
816 SPLDECL(s); 815 SPLDECL(s);
817 int needed = 0, gen; 816 int needed = 0, gen;
818 xlog_t *log = mp->m_log; 817 xlog_t *log = mp->m_log;
819 vfs_t *vfsp = XFS_MTOVFS(mp); 818 bhv_vfs_t *vfsp = XFS_MTOVFS(mp);
820 819
821 if (fs_frozen(vfsp) || XFS_FORCED_SHUTDOWN(mp) || 820 if (fs_frozen(vfsp) || XFS_FORCED_SHUTDOWN(mp) ||
822 (vfsp->vfs_flag & VFS_RDONLY)) 821 (vfsp->vfs_flag & VFS_RDONLY))
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
index 9378408a69d5..56c4b7e51f4d 100644
--- a/fs/xfs/xfs_mount.c
+++ b/fs/xfs/xfs_mount.c
@@ -196,7 +196,7 @@ xfs_mount_free(
196 kmem_free(mp->m_logname, strlen(mp->m_logname) + 1); 196 kmem_free(mp->m_logname, strlen(mp->m_logname) + 1);
197 197
198 if (remove_bhv) { 198 if (remove_bhv) {
199 struct vfs *vfsp = XFS_MTOVFS(mp); 199 struct bhv_vfs *vfsp = XFS_MTOVFS(mp);
200 200
201 bhv_remove_all_vfsops(vfsp, 0); 201 bhv_remove_all_vfsops(vfsp, 0);
202 VFS_REMOVEBHV(vfsp, &mp->m_bhv); 202 VFS_REMOVEBHV(vfsp, &mp->m_bhv);
@@ -337,7 +337,7 @@ xfs_mount_validate_sb(
337 337
338xfs_agnumber_t 338xfs_agnumber_t
339xfs_initialize_perag( 339xfs_initialize_perag(
340 struct vfs *vfs, 340 bhv_vfs_t *vfs,
341 xfs_mount_t *mp, 341 xfs_mount_t *mp,
342 xfs_agnumber_t agcount) 342 xfs_agnumber_t agcount)
343{ 343{
@@ -651,7 +651,7 @@ xfs_mount_common(xfs_mount_t *mp, xfs_sb_t *sbp)
651 */ 651 */
652int 652int
653xfs_mountfs( 653xfs_mountfs(
654 vfs_t *vfsp, 654 bhv_vfs_t *vfsp,
655 xfs_mount_t *mp, 655 xfs_mount_t *mp,
656 int mfsi_flags) 656 int mfsi_flags)
657{ 657{
@@ -1095,7 +1095,7 @@ xfs_mountfs(
1095int 1095int
1096xfs_unmountfs(xfs_mount_t *mp, struct cred *cr) 1096xfs_unmountfs(xfs_mount_t *mp, struct cred *cr)
1097{ 1097{
1098 struct vfs *vfsp = XFS_MTOVFS(mp); 1098 struct bhv_vfs *vfsp = XFS_MTOVFS(mp);
1099#if defined(DEBUG) || defined(INDUCE_IO_ERROR) 1099#if defined(DEBUG) || defined(INDUCE_IO_ERROR)
1100 int64_t fsid; 1100 int64_t fsid;
1101#endif 1101#endif
diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h
index 2ca211214a9c..7e612255f530 100644
--- a/fs/xfs/xfs_mount.h
+++ b/fs/xfs/xfs_mount.h
@@ -53,7 +53,7 @@ typedef struct xfs_trans_reservations {
53#else 53#else
54struct cred; 54struct cred;
55struct log; 55struct log;
56struct vfs; 56struct bhv_vfs;
57struct vnode; 57struct vnode;
58struct xfs_mount_args; 58struct xfs_mount_args;
59struct xfs_ihash; 59struct xfs_ihash;
@@ -66,7 +66,7 @@ struct xfs_bmap_free;
66struct xfs_extdelta; 66struct xfs_extdelta;
67struct xfs_swapext; 67struct xfs_swapext;
68 68
69extern struct vfsops xfs_vfsops; 69extern struct bhv_vfsops xfs_vfsops;
70extern struct vnodeops xfs_vnodeops; 70extern struct vnodeops xfs_vnodeops;
71 71
72#define AIL_LOCK_T lock_t 72#define AIL_LOCK_T lock_t
@@ -84,11 +84,11 @@ typedef int (*xfs_send_data_t)(int, struct vnode *,
84 xfs_off_t, size_t, int, vrwlock_t *); 84 xfs_off_t, size_t, int, vrwlock_t *);
85typedef int (*xfs_send_mmap_t)(struct vm_area_struct *, uint); 85typedef int (*xfs_send_mmap_t)(struct vm_area_struct *, uint);
86typedef int (*xfs_send_destroy_t)(struct vnode *, dm_right_t); 86typedef int (*xfs_send_destroy_t)(struct vnode *, dm_right_t);
87typedef int (*xfs_send_namesp_t)(dm_eventtype_t, struct vfs *, 87typedef int (*xfs_send_namesp_t)(dm_eventtype_t, struct bhv_vfs *,
88 struct vnode *, 88 struct vnode *,
89 dm_right_t, struct vnode *, dm_right_t, 89 dm_right_t, struct vnode *, dm_right_t,
90 char *, char *, mode_t, int, int); 90 char *, char *, mode_t, int, int);
91typedef void (*xfs_send_unmount_t)(struct vfs *, struct vnode *, 91typedef void (*xfs_send_unmount_t)(struct bhv_vfs *, struct vnode *,
92 dm_right_t, mode_t, int, int); 92 dm_right_t, mode_t, int, int);
93 93
94typedef struct xfs_dmops { 94typedef struct xfs_dmops {
@@ -190,7 +190,7 @@ typedef struct xfs_qmops {
190 * Prototypes and functions for I/O core modularization. 190 * Prototypes and functions for I/O core modularization.
191 */ 191 */
192 192
193typedef int (*xfs_ioinit_t)(struct vfs *, 193typedef int (*xfs_ioinit_t)(struct bhv_vfs *,
194 struct xfs_mount_args *, int); 194 struct xfs_mount_args *, int);
195typedef int (*xfs_bmapi_t)(struct xfs_trans *, void *, 195typedef int (*xfs_bmapi_t)(struct xfs_trans *, void *,
196 xfs_fileoff_t, xfs_filblks_t, int, 196 xfs_fileoff_t, xfs_filblks_t, int,
@@ -220,7 +220,7 @@ typedef void (*xfs_lock_demote_t)(void *, uint);
220typedef int (*xfs_lock_nowait_t)(void *, uint); 220typedef int (*xfs_lock_nowait_t)(void *, uint);
221typedef void (*xfs_unlk_t)(void *, unsigned int); 221typedef void (*xfs_unlk_t)(void *, unsigned int);
222typedef xfs_fsize_t (*xfs_size_t)(void *); 222typedef xfs_fsize_t (*xfs_size_t)(void *);
223typedef xfs_fsize_t (*xfs_iodone_t)(struct vfs *); 223typedef xfs_fsize_t (*xfs_iodone_t)(struct bhv_vfs *);
224typedef int (*xfs_swap_extents_t)(void *, void *, 224typedef int (*xfs_swap_extents_t)(void *, void *,
225 struct xfs_swapext*); 225 struct xfs_swapext*);
226 226
@@ -511,7 +511,7 @@ xfs_preferred_iosize(xfs_mount_t *mp)
511 511
512#define XFS_FORCED_SHUTDOWN(mp) ((mp)->m_flags & XFS_MOUNT_FS_SHUTDOWN) 512#define XFS_FORCED_SHUTDOWN(mp) ((mp)->m_flags & XFS_MOUNT_FS_SHUTDOWN)
513#define xfs_force_shutdown(m,f) \ 513#define xfs_force_shutdown(m,f) \
514 VFS_FORCE_SHUTDOWN((XFS_MTOVFS(m)), f, __FILE__, __LINE__) 514 bhv_vfs_force_shutdown((XFS_MTOVFS(m)), f, __FILE__, __LINE__)
515 515
516/* 516/*
517 * Flags for xfs_mountfs 517 * Flags for xfs_mountfs
@@ -529,7 +529,7 @@ xfs_preferred_iosize(xfs_mount_t *mp)
529 * Macros for getting from mount to vfs and back. 529 * Macros for getting from mount to vfs and back.
530 */ 530 */
531#define XFS_MTOVFS(mp) xfs_mtovfs(mp) 531#define XFS_MTOVFS(mp) xfs_mtovfs(mp)
532static inline struct vfs *xfs_mtovfs(xfs_mount_t *mp) 532static inline struct bhv_vfs *xfs_mtovfs(xfs_mount_t *mp)
533{ 533{
534 return bhvtovfs(&mp->m_bhv); 534 return bhvtovfs(&mp->m_bhv);
535} 535}
@@ -541,7 +541,7 @@ static inline xfs_mount_t *xfs_bhvtom(bhv_desc_t *bdp)
541} 541}
542 542
543#define XFS_VFSTOM(vfs) xfs_vfstom(vfs) 543#define XFS_VFSTOM(vfs) xfs_vfstom(vfs)
544static inline xfs_mount_t *xfs_vfstom(vfs_t *vfs) 544static inline xfs_mount_t *xfs_vfstom(bhv_vfs_t *vfs)
545{ 545{
546 return XFS_BHVTOM(bhv_lookup(VFS_BHVHEAD(vfs), &xfs_vfsops)); 546 return XFS_BHVTOM(bhv_lookup(VFS_BHVHEAD(vfs), &xfs_vfsops));
547} 547}
@@ -579,7 +579,7 @@ typedef struct xfs_mod_sb {
579extern xfs_mount_t *xfs_mount_init(void); 579extern xfs_mount_t *xfs_mount_init(void);
580extern void xfs_mod_sb(xfs_trans_t *, __int64_t); 580extern void xfs_mod_sb(xfs_trans_t *, __int64_t);
581extern void xfs_mount_free(xfs_mount_t *mp, int remove_bhv); 581extern void xfs_mount_free(xfs_mount_t *mp, int remove_bhv);
582extern int xfs_mountfs(struct vfs *, xfs_mount_t *mp, int); 582extern int xfs_mountfs(struct bhv_vfs *, xfs_mount_t *mp, int);
583extern void xfs_mountfs_check_barriers(xfs_mount_t *mp); 583extern void xfs_mountfs_check_barriers(xfs_mount_t *mp);
584 584
585extern int xfs_unmountfs(xfs_mount_t *, struct cred *); 585extern int xfs_unmountfs(xfs_mount_t *, struct cred *);
@@ -597,7 +597,7 @@ extern void xfs_freesb(xfs_mount_t *);
597extern void xfs_do_force_shutdown(bhv_desc_t *, int, char *, int); 597extern void xfs_do_force_shutdown(bhv_desc_t *, int, char *, int);
598extern int xfs_syncsub(xfs_mount_t *, int, int, int *); 598extern int xfs_syncsub(xfs_mount_t *, int, int, int *);
599extern int xfs_sync_inodes(xfs_mount_t *, int, int, int *); 599extern int xfs_sync_inodes(xfs_mount_t *, int, int, int *);
600extern xfs_agnumber_t xfs_initialize_perag(struct vfs *, xfs_mount_t *, 600extern xfs_agnumber_t xfs_initialize_perag(struct bhv_vfs *, xfs_mount_t *,
601 xfs_agnumber_t); 601 xfs_agnumber_t);
602extern void xfs_xlatesb(void *, struct xfs_sb *, int, __int64_t); 602extern void xfs_xlatesb(void *, struct xfs_sb *, int, __int64_t);
603 603
diff --git a/fs/xfs/xfs_quota.h b/fs/xfs/xfs_quota.h
index 7fbef974bce6..acb853b33ebb 100644
--- a/fs/xfs/xfs_quota.h
+++ b/fs/xfs/xfs_quota.h
@@ -365,7 +365,7 @@ typedef struct xfs_dqtrxops {
365extern int xfs_qm_dqcheck(xfs_disk_dquot_t *, xfs_dqid_t, uint, uint, char *); 365extern int xfs_qm_dqcheck(xfs_disk_dquot_t *, xfs_dqid_t, uint, uint, char *);
366extern int xfs_mount_reset_sbqflags(struct xfs_mount *); 366extern int xfs_mount_reset_sbqflags(struct xfs_mount *);
367 367
368extern struct bhv_vfsops xfs_qmops; 368extern struct bhv_module_vfsops xfs_qmops;
369 369
370#endif /* __KERNEL__ */ 370#endif /* __KERNEL__ */
371 371
diff --git a/fs/xfs/xfs_vfsops.c b/fs/xfs/xfs_vfsops.c
index ec85a2e24b52..57ee2bebd248 100644
--- a/fs/xfs/xfs_vfsops.c
+++ b/fs/xfs/xfs_vfsops.c
@@ -212,7 +212,7 @@ xfs_cleanup(void)
212 */ 212 */
213STATIC int 213STATIC int
214xfs_start_flags( 214xfs_start_flags(
215 struct vfs *vfs, 215 struct bhv_vfs *vfs,
216 struct xfs_mount_args *ap, 216 struct xfs_mount_args *ap,
217 struct xfs_mount *mp) 217 struct xfs_mount *mp)
218{ 218{
@@ -337,7 +337,7 @@ xfs_start_flags(
337 */ 337 */
338STATIC int 338STATIC int
339xfs_finish_flags( 339xfs_finish_flags(
340 struct vfs *vfs, 340 struct bhv_vfs *vfs,
341 struct xfs_mount_args *ap, 341 struct xfs_mount_args *ap,
342 struct xfs_mount *mp) 342 struct xfs_mount *mp)
343{ 343{
@@ -423,7 +423,7 @@ xfs_mount(
423 struct xfs_mount_args *args, 423 struct xfs_mount_args *args,
424 cred_t *credp) 424 cred_t *credp)
425{ 425{
426 struct vfs *vfsp = bhvtovfs(bhvp); 426 struct bhv_vfs *vfsp = bhvtovfs(bhvp);
427 struct bhv_desc *p; 427 struct bhv_desc *p;
428 struct xfs_mount *mp = XFS_BHVTOM(bhvp); 428 struct xfs_mount *mp = XFS_BHVTOM(bhvp);
429 struct block_device *ddev, *logdev, *rtdev; 429 struct block_device *ddev, *logdev, *rtdev;
@@ -552,7 +552,7 @@ xfs_unmount(
552 int flags, 552 int flags,
553 cred_t *credp) 553 cred_t *credp)
554{ 554{
555 struct vfs *vfsp = bhvtovfs(bdp); 555 bhv_vfs_t *vfsp = bhvtovfs(bdp);
556 xfs_mount_t *mp = XFS_BHVTOM(bdp); 556 xfs_mount_t *mp = XFS_BHVTOM(bdp);
557 xfs_inode_t *rip; 557 xfs_inode_t *rip;
558 vnode_t *rvp; 558 vnode_t *rvp;
@@ -665,9 +665,8 @@ xfs_mntupdate(
665 int *flags, 665 int *flags,
666 struct xfs_mount_args *args) 666 struct xfs_mount_args *args)
667{ 667{
668 struct vfs *vfsp = bhvtovfs(bdp); 668 bhv_vfs_t *vfsp = bhvtovfs(bdp);
669 xfs_mount_t *mp = XFS_BHVTOM(bdp); 669 xfs_mount_t *mp = XFS_BHVTOM(bdp);
670 int error;
671 670
672 if (!(*flags & MS_RDONLY)) { /* rw/ro -> rw */ 671 if (!(*flags & MS_RDONLY)) { /* rw/ro -> rw */
673 if (vfsp->vfs_flag & VFS_RDONLY) 672 if (vfsp->vfs_flag & VFS_RDONLY)
@@ -679,7 +678,7 @@ xfs_mntupdate(
679 mp->m_flags &= ~XFS_MOUNT_BARRIER; 678 mp->m_flags &= ~XFS_MOUNT_BARRIER;
680 } 679 }
681 } else if (!(vfsp->vfs_flag & VFS_RDONLY)) { /* rw -> ro */ 680 } else if (!(vfsp->vfs_flag & VFS_RDONLY)) { /* rw -> ro */
682 VFS_SYNC(vfsp, SYNC_FSDATA|SYNC_BDFLUSH|SYNC_ATTR, NULL, error); 681 bhv_vfs_sync(vfsp, SYNC_FSDATA|SYNC_BDFLUSH|SYNC_ATTR, NULL);
683 xfs_quiesce_fs(mp); 682 xfs_quiesce_fs(mp);
684 xfs_log_unmount_write(mp); 683 xfs_log_unmount_write(mp);
685 xfs_unmountfs_writesb(mp); 684 xfs_unmountfs_writesb(mp);
@@ -900,7 +899,7 @@ xfs_sync(
900/* 899/*
901 * xfs sync routine for internal use 900 * xfs sync routine for internal use
902 * 901 *
903 * This routine supports all of the flags defined for the generic VFS_SYNC 902 * This routine supports all of the flags defined for the generic vfs_sync
904 * interface as explained above under xfs_sync. In the interests of not 903 * interface as explained above under xfs_sync. In the interests of not
905 * changing interfaces within the 6.5 family, additional internally- 904 * changing interfaces within the 6.5 family, additional internally-
906 * required functions are specified within a separate xflags parameter, 905 * required functions are specified within a separate xflags parameter,
@@ -1421,7 +1420,7 @@ xfs_sync_inodes(
1421/* 1420/*
1422 * xfs sync routine for internal use 1421 * xfs sync routine for internal use
1423 * 1422 *
1424 * This routine supports all of the flags defined for the generic VFS_SYNC 1423 * This routine supports all of the flags defined for the generic vfs_sync
1425 * interface as explained above under xfs_sync. In the interests of not 1424 * interface as explained above under xfs_sync. In the interests of not
1426 * changing interfaces within the 6.5 family, additional internally- 1425 * changing interfaces within the 6.5 family, additional internally-
1427 * required functions are specified within a separate xflags parameter, 1426 * required functions are specified within a separate xflags parameter,
@@ -1686,7 +1685,7 @@ xfs_parseargs(
1686 struct xfs_mount_args *args, 1685 struct xfs_mount_args *args,
1687 int update) 1686 int update)
1688{ 1687{
1689 struct vfs *vfsp = bhvtovfs(bhv); 1688 bhv_vfs_t *vfsp = bhvtovfs(bhv);
1690 char *this_char, *value, *eov; 1689 char *this_char, *value, *eov;
1691 int dsunit, dswidth, vol_dsunit, vol_dswidth; 1690 int dsunit, dswidth, vol_dsunit, vol_dswidth;
1692 int iosize; 1691 int iosize;
@@ -1924,7 +1923,7 @@ xfs_showargs(
1924 }; 1923 };
1925 struct proc_xfs_info *xfs_infop; 1924 struct proc_xfs_info *xfs_infop;
1926 struct xfs_mount *mp = XFS_BHVTOM(bhv); 1925 struct xfs_mount *mp = XFS_BHVTOM(bhv);
1927 struct vfs *vfsp = XFS_MTOVFS(mp); 1926 struct bhv_vfs *vfsp = XFS_MTOVFS(mp);
1928 1927
1929 for (xfs_infop = xfs_info; xfs_infop->flag; xfs_infop++) { 1928 for (xfs_infop = xfs_info; xfs_infop->flag; xfs_infop++) {
1930 if (mp->m_flags & xfs_infop->flag) 1929 if (mp->m_flags & xfs_infop->flag)
@@ -1984,7 +1983,7 @@ xfs_freeze(
1984} 1983}
1985 1984
1986 1985
1987vfsops_t xfs_vfsops = { 1986bhv_vfsops_t xfs_vfsops = {
1988 BHV_IDENTITY_INIT(VFS_BHV_XFS,VFS_POSITION_XFS), 1987 BHV_IDENTITY_INIT(VFS_BHV_XFS,VFS_POSITION_XFS),
1989 .vfs_parseargs = xfs_parseargs, 1988 .vfs_parseargs = xfs_parseargs,
1990 .vfs_showargs = xfs_showargs, 1989 .vfs_showargs = xfs_showargs,