aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6/xfs_super.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_super.c')
-rw-r--r--fs/xfs/linux-2.6/xfs_super.c213
1 files changed, 101 insertions, 112 deletions
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c
index f22e426d9e42..8355faf8ffde 100644
--- a/fs/xfs/linux-2.6/xfs_super.c
+++ b/fs/xfs/linux-2.6/xfs_super.c
@@ -59,8 +59,8 @@
59#include <linux/writeback.h> 59#include <linux/writeback.h>
60#include <linux/kthread.h> 60#include <linux/kthread.h>
61 61
62STATIC struct quotactl_ops linvfs_qops; 62STATIC struct quotactl_ops xfs_quotactl_operations;
63STATIC struct super_operations linvfs_sops; 63STATIC struct super_operations xfs_super_operations;
64STATIC kmem_zone_t *xfs_vnode_zone; 64STATIC kmem_zone_t *xfs_vnode_zone;
65STATIC kmem_zone_t *xfs_ioend_zone; 65STATIC kmem_zone_t *xfs_ioend_zone;
66mempool_t *xfs_ioend_pool; 66mempool_t *xfs_ioend_pool;
@@ -76,8 +76,6 @@ xfs_args_allocate(
76 strncpy(args->fsname, sb->s_id, MAXNAMELEN); 76 strncpy(args->fsname, sb->s_id, MAXNAMELEN);
77 77
78 /* Copy the already-parsed mount(2) flags we're interested in */ 78 /* Copy the already-parsed mount(2) flags we're interested in */
79 if (sb->s_flags & MS_NOATIME)
80 args->flags |= XFSMNT_NOATIME;
81 if (sb->s_flags & MS_DIRSYNC) 79 if (sb->s_flags & MS_DIRSYNC)
82 args->flags |= XFSMNT_DIRSYNC; 80 args->flags |= XFSMNT_DIRSYNC;
83 if (sb->s_flags & MS_SYNCHRONOUS) 81 if (sb->s_flags & MS_SYNCHRONOUS)
@@ -129,21 +127,21 @@ xfs_set_inodeops(
129{ 127{
130 switch (inode->i_mode & S_IFMT) { 128 switch (inode->i_mode & S_IFMT) {
131 case S_IFREG: 129 case S_IFREG:
132 inode->i_op = &linvfs_file_inode_operations; 130 inode->i_op = &xfs_inode_operations;
133 inode->i_fop = &linvfs_file_operations; 131 inode->i_fop = &xfs_file_operations;
134 inode->i_mapping->a_ops = &linvfs_aops; 132 inode->i_mapping->a_ops = &xfs_address_space_operations;
135 break; 133 break;
136 case S_IFDIR: 134 case S_IFDIR:
137 inode->i_op = &linvfs_dir_inode_operations; 135 inode->i_op = &xfs_dir_inode_operations;
138 inode->i_fop = &linvfs_dir_operations; 136 inode->i_fop = &xfs_dir_file_operations;
139 break; 137 break;
140 case S_IFLNK: 138 case S_IFLNK:
141 inode->i_op = &linvfs_symlink_inode_operations; 139 inode->i_op = &xfs_symlink_inode_operations;
142 if (inode->i_blocks) 140 if (inode->i_blocks)
143 inode->i_mapping->a_ops = &linvfs_aops; 141 inode->i_mapping->a_ops = &xfs_address_space_operations;
144 break; 142 break;
145 default: 143 default:
146 inode->i_op = &linvfs_file_inode_operations; 144 inode->i_op = &xfs_inode_operations;
147 init_special_inode(inode, inode->i_mode, inode->i_rdev); 145 init_special_inode(inode, inode->i_mode, inode->i_rdev);
148 break; 146 break;
149 } 147 }
@@ -155,7 +153,7 @@ xfs_revalidate_inode(
155 vnode_t *vp, 153 vnode_t *vp,
156 xfs_inode_t *ip) 154 xfs_inode_t *ip)
157{ 155{
158 struct inode *inode = LINVFS_GET_IP(vp); 156 struct inode *inode = vn_to_inode(vp);
159 157
160 inode->i_mode = ip->i_d.di_mode; 158 inode->i_mode = ip->i_d.di_mode;
161 inode->i_nlink = ip->i_d.di_nlink; 159 inode->i_nlink = ip->i_d.di_nlink;
@@ -212,7 +210,7 @@ xfs_initialize_vnode(
212 int unlock) 210 int unlock)
213{ 211{
214 xfs_inode_t *ip = XFS_BHVTOI(inode_bhv); 212 xfs_inode_t *ip = XFS_BHVTOI(inode_bhv);
215 struct inode *inode = LINVFS_GET_IP(vp); 213 struct inode *inode = vn_to_inode(vp);
216 214
217 if (!inode_bhv->bd_vobj) { 215 if (!inode_bhv->bd_vobj) {
218 vp->v_vfsp = bhvtovfs(bdp); 216 vp->v_vfsp = bhvtovfs(bdp);
@@ -230,7 +228,7 @@ xfs_initialize_vnode(
230 if (ip->i_d.di_mode != 0 && unlock && (inode->i_state & I_NEW)) { 228 if (ip->i_d.di_mode != 0 && unlock && (inode->i_state & I_NEW)) {
231 xfs_revalidate_inode(XFS_BHVTOM(bdp), vp, ip); 229 xfs_revalidate_inode(XFS_BHVTOM(bdp), vp, ip);
232 xfs_set_inodeops(inode); 230 xfs_set_inodeops(inode);
233 231
234 ip->i_flags &= ~XFS_INEW; 232 ip->i_flags &= ~XFS_INEW;
235 barrier(); 233 barrier();
236 234
@@ -334,43 +332,42 @@ xfs_blkdev_issue_flush(
334} 332}
335 333
336STATIC struct inode * 334STATIC struct inode *
337linvfs_alloc_inode( 335xfs_fs_alloc_inode(
338 struct super_block *sb) 336 struct super_block *sb)
339{ 337{
340 vnode_t *vp; 338 vnode_t *vp;
341 339
342 vp = kmem_cache_alloc(xfs_vnode_zone, kmem_flags_convert(KM_SLEEP)); 340 vp = kmem_zone_alloc(xfs_vnode_zone, KM_SLEEP);
343 if (!vp) 341 if (unlikely(!vp))
344 return NULL; 342 return NULL;
345 return LINVFS_GET_IP(vp); 343 return vn_to_inode(vp);
346} 344}
347 345
348STATIC void 346STATIC void
349linvfs_destroy_inode( 347xfs_fs_destroy_inode(
350 struct inode *inode) 348 struct inode *inode)
351{ 349{
352 kmem_zone_free(xfs_vnode_zone, LINVFS_GET_VP(inode)); 350 kmem_zone_free(xfs_vnode_zone, vn_from_inode(inode));
353} 351}
354 352
355STATIC void 353STATIC void
356linvfs_inode_init_once( 354xfs_fs_inode_init_once(
357 void *data, 355 void *vnode,
358 kmem_cache_t *cachep, 356 kmem_zone_t *zonep,
359 unsigned long flags) 357 unsigned long flags)
360{ 358{
361 vnode_t *vp = (vnode_t *)data;
362
363 if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) == 359 if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
364 SLAB_CTOR_CONSTRUCTOR) 360 SLAB_CTOR_CONSTRUCTOR)
365 inode_init_once(LINVFS_GET_IP(vp)); 361 inode_init_once(vn_to_inode((vnode_t *)vnode));
366} 362}
367 363
368STATIC int 364STATIC int
369linvfs_init_zones(void) 365xfs_init_zones(void)
370{ 366{
371 xfs_vnode_zone = kmem_cache_create("xfs_vnode", 367 xfs_vnode_zone = kmem_zone_init_flags(sizeof(vnode_t), "xfs_vnode_t",
372 sizeof(vnode_t), 0, SLAB_RECLAIM_ACCOUNT, 368 KM_ZONE_HWALIGN | KM_ZONE_RECLAIM |
373 linvfs_inode_init_once, NULL); 369 KM_ZONE_SPREAD,
370 xfs_fs_inode_init_once);
374 if (!xfs_vnode_zone) 371 if (!xfs_vnode_zone)
375 goto out; 372 goto out;
376 373
@@ -379,14 +376,12 @@ linvfs_init_zones(void)
379 goto out_destroy_vnode_zone; 376 goto out_destroy_vnode_zone;
380 377
381 xfs_ioend_pool = mempool_create(4 * MAX_BUF_PER_PAGE, 378 xfs_ioend_pool = mempool_create(4 * MAX_BUF_PER_PAGE,
382 mempool_alloc_slab, mempool_free_slab, 379 mempool_alloc_slab, mempool_free_slab,
383 xfs_ioend_zone); 380 xfs_ioend_zone);
384 if (!xfs_ioend_pool) 381 if (!xfs_ioend_pool)
385 goto out_free_ioend_zone; 382 goto out_free_ioend_zone;
386
387 return 0; 383 return 0;
388 384
389
390 out_free_ioend_zone: 385 out_free_ioend_zone:
391 kmem_zone_destroy(xfs_ioend_zone); 386 kmem_zone_destroy(xfs_ioend_zone);
392 out_destroy_vnode_zone: 387 out_destroy_vnode_zone:
@@ -396,7 +391,7 @@ linvfs_init_zones(void)
396} 391}
397 392
398STATIC void 393STATIC void
399linvfs_destroy_zones(void) 394xfs_destroy_zones(void)
400{ 395{
401 mempool_destroy(xfs_ioend_pool); 396 mempool_destroy(xfs_ioend_pool);
402 kmem_zone_destroy(xfs_vnode_zone); 397 kmem_zone_destroy(xfs_vnode_zone);
@@ -407,14 +402,14 @@ linvfs_destroy_zones(void)
407 * Attempt to flush the inode, this will actually fail 402 * Attempt to flush the inode, this will actually fail
408 * if the inode is pinned, but we dirty the inode again 403 * if the inode is pinned, but we dirty the inode again
409 * at the point when it is unpinned after a log write, 404 * at the point when it is unpinned after a log write,
410 * since this is when the inode itself becomes flushable. 405 * since this is when the inode itself becomes flushable.
411 */ 406 */
412STATIC int 407STATIC int
413linvfs_write_inode( 408xfs_fs_write_inode(
414 struct inode *inode, 409 struct inode *inode,
415 int sync) 410 int sync)
416{ 411{
417 vnode_t *vp = LINVFS_GET_VP(inode); 412 vnode_t *vp = vn_from_inode(inode);
418 int error = 0, flags = FLUSH_INODE; 413 int error = 0, flags = FLUSH_INODE;
419 414
420 if (vp) { 415 if (vp) {
@@ -434,13 +429,13 @@ linvfs_write_inode(
434} 429}
435 430
436STATIC void 431STATIC void
437linvfs_clear_inode( 432xfs_fs_clear_inode(
438 struct inode *inode) 433 struct inode *inode)
439{ 434{
440 vnode_t *vp = LINVFS_GET_VP(inode); 435 vnode_t *vp = vn_from_inode(inode);
441 int error, cache; 436 int error, cache;
442 437
443 vn_trace_entry(vp, "clear_inode", (inst_t *)__return_address); 438 vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address);
444 439
445 XFS_STATS_INC(vn_rele); 440 XFS_STATS_INC(vn_rele);
446 XFS_STATS_INC(vn_remove); 441 XFS_STATS_INC(vn_remove);
@@ -516,7 +511,7 @@ void
516xfs_flush_inode( 511xfs_flush_inode(
517 xfs_inode_t *ip) 512 xfs_inode_t *ip)
518{ 513{
519 struct inode *inode = LINVFS_GET_IP(XFS_ITOV(ip)); 514 struct inode *inode = vn_to_inode(XFS_ITOV(ip));
520 struct vfs *vfs = XFS_MTOVFS(ip->i_mount); 515 struct vfs *vfs = XFS_MTOVFS(ip->i_mount);
521 516
522 igrab(inode); 517 igrab(inode);
@@ -541,7 +536,7 @@ void
541xfs_flush_device( 536xfs_flush_device(
542 xfs_inode_t *ip) 537 xfs_inode_t *ip)
543{ 538{
544 struct inode *inode = LINVFS_GET_IP(XFS_ITOV(ip)); 539 struct inode *inode = vn_to_inode(XFS_ITOV(ip));
545 struct vfs *vfs = XFS_MTOVFS(ip->i_mount); 540 struct vfs *vfs = XFS_MTOVFS(ip->i_mount);
546 541
547 igrab(inode); 542 igrab(inode);
@@ -550,7 +545,7 @@ xfs_flush_device(
550 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);
551} 546}
552 547
553#define SYNCD_FLAGS (SYNC_FSDATA|SYNC_BDFLUSH|SYNC_ATTR) 548#define SYNCD_FLAGS (SYNC_FSDATA|SYNC_BDFLUSH|SYNC_ATTR|SYNC_REFCACHE)
554STATIC void 549STATIC void
555vfs_sync_worker( 550vfs_sync_worker(
556 vfs_t *vfsp, 551 vfs_t *vfsp,
@@ -613,7 +608,7 @@ xfssyncd(
613} 608}
614 609
615STATIC int 610STATIC int
616linvfs_start_syncd( 611xfs_fs_start_syncd(
617 vfs_t *vfsp) 612 vfs_t *vfsp)
618{ 613{
619 vfsp->vfs_sync_work.w_syncer = vfs_sync_worker; 614 vfsp->vfs_sync_work.w_syncer = vfs_sync_worker;
@@ -625,20 +620,20 @@ linvfs_start_syncd(
625} 620}
626 621
627STATIC void 622STATIC void
628linvfs_stop_syncd( 623xfs_fs_stop_syncd(
629 vfs_t *vfsp) 624 vfs_t *vfsp)
630{ 625{
631 kthread_stop(vfsp->vfs_sync_task); 626 kthread_stop(vfsp->vfs_sync_task);
632} 627}
633 628
634STATIC void 629STATIC void
635linvfs_put_super( 630xfs_fs_put_super(
636 struct super_block *sb) 631 struct super_block *sb)
637{ 632{
638 vfs_t *vfsp = LINVFS_GET_VFS(sb); 633 vfs_t *vfsp = vfs_from_sb(sb);
639 int error; 634 int error;
640 635
641 linvfs_stop_syncd(vfsp); 636 xfs_fs_stop_syncd(vfsp);
642 VFS_SYNC(vfsp, SYNC_ATTR|SYNC_DELWRI, NULL, error); 637 VFS_SYNC(vfsp, SYNC_ATTR|SYNC_DELWRI, NULL, error);
643 if (!error) 638 if (!error)
644 VFS_UNMOUNT(vfsp, 0, NULL, error); 639 VFS_UNMOUNT(vfsp, 0, NULL, error);
@@ -652,10 +647,10 @@ linvfs_put_super(
652} 647}
653 648
654STATIC void 649STATIC void
655linvfs_write_super( 650xfs_fs_write_super(
656 struct super_block *sb) 651 struct super_block *sb)
657{ 652{
658 vfs_t *vfsp = LINVFS_GET_VFS(sb); 653 vfs_t *vfsp = vfs_from_sb(sb);
659 int error; 654 int error;
660 655
661 if (sb->s_flags & MS_RDONLY) { 656 if (sb->s_flags & MS_RDONLY) {
@@ -668,11 +663,11 @@ linvfs_write_super(
668} 663}
669 664
670STATIC int 665STATIC int
671linvfs_sync_super( 666xfs_fs_sync_super(
672 struct super_block *sb, 667 struct super_block *sb,
673 int wait) 668 int wait)
674{ 669{
675 vfs_t *vfsp = LINVFS_GET_VFS(sb); 670 vfs_t *vfsp = vfs_from_sb(sb);
676 int error; 671 int error;
677 int flags = SYNC_FSDATA; 672 int flags = SYNC_FSDATA;
678 673
@@ -707,11 +702,11 @@ linvfs_sync_super(
707} 702}
708 703
709STATIC int 704STATIC int
710linvfs_statfs( 705xfs_fs_statfs(
711 struct super_block *sb, 706 struct super_block *sb,
712 struct kstatfs *statp) 707 struct kstatfs *statp)
713{ 708{
714 vfs_t *vfsp = LINVFS_GET_VFS(sb); 709 vfs_t *vfsp = vfs_from_sb(sb);
715 int error; 710 int error;
716 711
717 VFS_STATVFS(vfsp, statp, NULL, error); 712 VFS_STATVFS(vfsp, statp, NULL, error);
@@ -719,12 +714,12 @@ linvfs_statfs(
719} 714}
720 715
721STATIC int 716STATIC int
722linvfs_remount( 717xfs_fs_remount(
723 struct super_block *sb, 718 struct super_block *sb,
724 int *flags, 719 int *flags,
725 char *options) 720 char *options)
726{ 721{
727 vfs_t *vfsp = LINVFS_GET_VFS(sb); 722 vfs_t *vfsp = vfs_from_sb(sb);
728 struct xfs_mount_args *args = xfs_args_allocate(sb); 723 struct xfs_mount_args *args = xfs_args_allocate(sb);
729 int error; 724 int error;
730 725
@@ -736,18 +731,18 @@ linvfs_remount(
736} 731}
737 732
738STATIC void 733STATIC void
739linvfs_freeze_fs( 734xfs_fs_lockfs(
740 struct super_block *sb) 735 struct super_block *sb)
741{ 736{
742 VFS_FREEZE(LINVFS_GET_VFS(sb)); 737 VFS_FREEZE(vfs_from_sb(sb));
743} 738}
744 739
745STATIC int 740STATIC int
746linvfs_show_options( 741xfs_fs_show_options(
747 struct seq_file *m, 742 struct seq_file *m,
748 struct vfsmount *mnt) 743 struct vfsmount *mnt)
749{ 744{
750 struct vfs *vfsp = LINVFS_GET_VFS(mnt->mnt_sb); 745 struct vfs *vfsp = vfs_from_sb(mnt->mnt_sb);
751 int error; 746 int error;
752 747
753 VFS_SHOWARGS(vfsp, m, error); 748 VFS_SHOWARGS(vfsp, m, error);
@@ -755,11 +750,11 @@ linvfs_show_options(
755} 750}
756 751
757STATIC int 752STATIC int
758linvfs_quotasync( 753xfs_fs_quotasync(
759 struct super_block *sb, 754 struct super_block *sb,
760 int type) 755 int type)
761{ 756{
762 struct vfs *vfsp = LINVFS_GET_VFS(sb); 757 struct vfs *vfsp = vfs_from_sb(sb);
763 int error; 758 int error;
764 759
765 VFS_QUOTACTL(vfsp, Q_XQUOTASYNC, 0, (caddr_t)NULL, error); 760 VFS_QUOTACTL(vfsp, Q_XQUOTASYNC, 0, (caddr_t)NULL, error);
@@ -767,11 +762,11 @@ linvfs_quotasync(
767} 762}
768 763
769STATIC int 764STATIC int
770linvfs_getxstate( 765xfs_fs_getxstate(
771 struct super_block *sb, 766 struct super_block *sb,
772 struct fs_quota_stat *fqs) 767 struct fs_quota_stat *fqs)
773{ 768{
774 struct vfs *vfsp = LINVFS_GET_VFS(sb); 769 struct vfs *vfsp = vfs_from_sb(sb);
775 int error; 770 int error;
776 771
777 VFS_QUOTACTL(vfsp, Q_XGETQSTAT, 0, (caddr_t)fqs, error); 772 VFS_QUOTACTL(vfsp, Q_XGETQSTAT, 0, (caddr_t)fqs, error);
@@ -779,12 +774,12 @@ linvfs_getxstate(
779} 774}
780 775
781STATIC int 776STATIC int
782linvfs_setxstate( 777xfs_fs_setxstate(
783 struct super_block *sb, 778 struct super_block *sb,
784 unsigned int flags, 779 unsigned int flags,
785 int op) 780 int op)
786{ 781{
787 struct vfs *vfsp = LINVFS_GET_VFS(sb); 782 struct vfs *vfsp = vfs_from_sb(sb);
788 int error; 783 int error;
789 784
790 VFS_QUOTACTL(vfsp, op, 0, (caddr_t)&flags, error); 785 VFS_QUOTACTL(vfsp, op, 0, (caddr_t)&flags, error);
@@ -792,13 +787,13 @@ linvfs_setxstate(
792} 787}
793 788
794STATIC int 789STATIC int
795linvfs_getxquota( 790xfs_fs_getxquota(
796 struct super_block *sb, 791 struct super_block *sb,
797 int type, 792 int type,
798 qid_t id, 793 qid_t id,
799 struct fs_disk_quota *fdq) 794 struct fs_disk_quota *fdq)
800{ 795{
801 struct vfs *vfsp = LINVFS_GET_VFS(sb); 796 struct vfs *vfsp = vfs_from_sb(sb);
802 int error, getmode; 797 int error, getmode;
803 798
804 getmode = (type == USRQUOTA) ? Q_XGETQUOTA : 799 getmode = (type == USRQUOTA) ? Q_XGETQUOTA :
@@ -808,13 +803,13 @@ linvfs_getxquota(
808} 803}
809 804
810STATIC int 805STATIC int
811linvfs_setxquota( 806xfs_fs_setxquota(
812 struct super_block *sb, 807 struct super_block *sb,
813 int type, 808 int type,
814 qid_t id, 809 qid_t id,
815 struct fs_disk_quota *fdq) 810 struct fs_disk_quota *fdq)
816{ 811{
817 struct vfs *vfsp = LINVFS_GET_VFS(sb); 812 struct vfs *vfsp = vfs_from_sb(sb);
818 int error, setmode; 813 int error, setmode;
819 814
820 setmode = (type == USRQUOTA) ? Q_XSETQLIM : 815 setmode = (type == USRQUOTA) ? Q_XSETQLIM :
@@ -824,21 +819,17 @@ linvfs_setxquota(
824} 819}
825 820
826STATIC int 821STATIC int
827linvfs_fill_super( 822xfs_fs_fill_super(
828 struct super_block *sb, 823 struct super_block *sb,
829 void *data, 824 void *data,
830 int silent) 825 int silent)
831{ 826{
832 vnode_t *rootvp; 827 vnode_t *rootvp;
833 struct vfs *vfsp = vfs_allocate(); 828 struct vfs *vfsp = vfs_allocate(sb);
834 struct xfs_mount_args *args = xfs_args_allocate(sb); 829 struct xfs_mount_args *args = xfs_args_allocate(sb);
835 struct kstatfs statvfs; 830 struct kstatfs statvfs;
836 int error, error2; 831 int error, error2;
837 832
838 vfsp->vfs_super = sb;
839 LINVFS_SET_VFS(sb, vfsp);
840 if (sb->s_flags & MS_RDONLY)
841 vfsp->vfs_flag |= VFS_RDONLY;
842 bhv_insert_all_vfsops(vfsp); 833 bhv_insert_all_vfsops(vfsp);
843 834
844 VFS_PARSEARGS(vfsp, (char *)data, args, 0, error); 835 VFS_PARSEARGS(vfsp, (char *)data, args, 0, error);
@@ -849,10 +840,10 @@ linvfs_fill_super(
849 840
850 sb_min_blocksize(sb, BBSIZE); 841 sb_min_blocksize(sb, BBSIZE);
851#ifdef CONFIG_XFS_EXPORT 842#ifdef CONFIG_XFS_EXPORT
852 sb->s_export_op = &linvfs_export_ops; 843 sb->s_export_op = &xfs_export_operations;
853#endif 844#endif
854 sb->s_qcop = &linvfs_qops; 845 sb->s_qcop = &xfs_quotactl_operations;
855 sb->s_op = &linvfs_sops; 846 sb->s_op = &xfs_super_operations;
856 847
857 VFS_MOUNT(vfsp, args, NULL, error); 848 VFS_MOUNT(vfsp, args, NULL, error);
858 if (error) { 849 if (error) {
@@ -876,7 +867,7 @@ linvfs_fill_super(
876 if (error) 867 if (error)
877 goto fail_unmount; 868 goto fail_unmount;
878 869
879 sb->s_root = d_alloc_root(LINVFS_GET_IP(rootvp)); 870 sb->s_root = d_alloc_root(vn_to_inode(rootvp));
880 if (!sb->s_root) { 871 if (!sb->s_root) {
881 error = ENOMEM; 872 error = ENOMEM;
882 goto fail_vnrele; 873 goto fail_vnrele;
@@ -885,7 +876,7 @@ linvfs_fill_super(
885 error = EINVAL; 876 error = EINVAL;
886 goto fail_vnrele; 877 goto fail_vnrele;
887 } 878 }
888 if ((error = linvfs_start_syncd(vfsp))) 879 if ((error = xfs_fs_start_syncd(vfsp)))
889 goto fail_vnrele; 880 goto fail_vnrele;
890 vn_trace_exit(rootvp, __FUNCTION__, (inst_t *)__return_address); 881 vn_trace_exit(rootvp, __FUNCTION__, (inst_t *)__return_address);
891 882
@@ -910,41 +901,41 @@ fail_vfsop:
910} 901}
911 902
912STATIC struct super_block * 903STATIC struct super_block *
913linvfs_get_sb( 904xfs_fs_get_sb(
914 struct file_system_type *fs_type, 905 struct file_system_type *fs_type,
915 int flags, 906 int flags,
916 const char *dev_name, 907 const char *dev_name,
917 void *data) 908 void *data)
918{ 909{
919 return get_sb_bdev(fs_type, flags, dev_name, data, linvfs_fill_super); 910 return get_sb_bdev(fs_type, flags, dev_name, data, xfs_fs_fill_super);
920} 911}
921 912
922STATIC struct super_operations linvfs_sops = { 913STATIC struct super_operations xfs_super_operations = {
923 .alloc_inode = linvfs_alloc_inode, 914 .alloc_inode = xfs_fs_alloc_inode,
924 .destroy_inode = linvfs_destroy_inode, 915 .destroy_inode = xfs_fs_destroy_inode,
925 .write_inode = linvfs_write_inode, 916 .write_inode = xfs_fs_write_inode,
926 .clear_inode = linvfs_clear_inode, 917 .clear_inode = xfs_fs_clear_inode,
927 .put_super = linvfs_put_super, 918 .put_super = xfs_fs_put_super,
928 .write_super = linvfs_write_super, 919 .write_super = xfs_fs_write_super,
929 .sync_fs = linvfs_sync_super, 920 .sync_fs = xfs_fs_sync_super,
930 .write_super_lockfs = linvfs_freeze_fs, 921 .write_super_lockfs = xfs_fs_lockfs,
931 .statfs = linvfs_statfs, 922 .statfs = xfs_fs_statfs,
932 .remount_fs = linvfs_remount, 923 .remount_fs = xfs_fs_remount,
933 .show_options = linvfs_show_options, 924 .show_options = xfs_fs_show_options,
934}; 925};
935 926
936STATIC struct quotactl_ops linvfs_qops = { 927STATIC struct quotactl_ops xfs_quotactl_operations = {
937 .quota_sync = linvfs_quotasync, 928 .quota_sync = xfs_fs_quotasync,
938 .get_xstate = linvfs_getxstate, 929 .get_xstate = xfs_fs_getxstate,
939 .set_xstate = linvfs_setxstate, 930 .set_xstate = xfs_fs_setxstate,
940 .get_xquota = linvfs_getxquota, 931 .get_xquota = xfs_fs_getxquota,
941 .set_xquota = linvfs_setxquota, 932 .set_xquota = xfs_fs_setxquota,
942}; 933};
943 934
944STATIC struct file_system_type xfs_fs_type = { 935STATIC struct file_system_type xfs_fs_type = {
945 .owner = THIS_MODULE, 936 .owner = THIS_MODULE,
946 .name = "xfs", 937 .name = "xfs",
947 .get_sb = linvfs_get_sb, 938 .get_sb = xfs_fs_get_sb,
948 .kill_sb = kill_block_super, 939 .kill_sb = kill_block_super,
949 .fs_flags = FS_REQUIRES_DEV, 940 .fs_flags = FS_REQUIRES_DEV,
950}; 941};
@@ -965,7 +956,7 @@ init_xfs_fs( void )
965 956
966 ktrace_init(64); 957 ktrace_init(64);
967 958
968 error = linvfs_init_zones(); 959 error = xfs_init_zones();
969 if (error < 0) 960 if (error < 0)
970 goto undo_zones; 961 goto undo_zones;
971 962
@@ -981,14 +972,13 @@ init_xfs_fs( void )
981 error = register_filesystem(&xfs_fs_type); 972 error = register_filesystem(&xfs_fs_type);
982 if (error) 973 if (error)
983 goto undo_register; 974 goto undo_register;
984 XFS_DM_INIT(&xfs_fs_type);
985 return 0; 975 return 0;
986 976
987undo_register: 977undo_register:
988 xfs_buf_terminate(); 978 xfs_buf_terminate();
989 979
990undo_buffers: 980undo_buffers:
991 linvfs_destroy_zones(); 981 xfs_destroy_zones();
992 982
993undo_zones: 983undo_zones:
994 return error; 984 return error;
@@ -998,11 +988,10 @@ STATIC void __exit
998exit_xfs_fs( void ) 988exit_xfs_fs( void )
999{ 989{
1000 vfs_exitquota(); 990 vfs_exitquota();
1001 XFS_DM_EXIT(&xfs_fs_type);
1002 unregister_filesystem(&xfs_fs_type); 991 unregister_filesystem(&xfs_fs_type);
1003 xfs_cleanup(); 992 xfs_cleanup();
1004 xfs_buf_terminate(); 993 xfs_buf_terminate();
1005 linvfs_destroy_zones(); 994 xfs_destroy_zones();
1006 ktrace_uninit(); 995 ktrace_uninit();
1007} 996}
1008 997