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_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
6 files changed, 137 insertions, 170 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;