2 * Copyright (c) 2000-2005 Silicon Graphics, Inc. All Rights Reserved.
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of version 2 of the GNU General Public License as
6 * published by the Free Software Foundation.
8 * This program is distributed in the hope that it would be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 * Further, this software is distributed without any warranty that it is
13 * free of the rightful claim of any third person regarding infringement
14 * or the like. Any license provided herein, whether implied or
15 * otherwise, applies only to this software file. Patent licenses, if
16 * any, provided herein do not apply to combinations of this program with
17 * other software, or any other product whatsoever.
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write the Free Software Foundation, Inc., 59
21 * Temple Place - Suite 330, Boston MA 02111-1307, USA.
23 * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
24 * Mountain View, CA 94043, or:
28 * For further information regarding this notice, see:
30 * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
38 #include "xfs_trans.h"
42 #include "xfs_alloc.h"
43 #include "xfs_dmapi.h"
44 #include "xfs_quota.h"
45 #include "xfs_mount.h"
46 #include "xfs_alloc_btree.h"
47 #include "xfs_bmap_btree.h"
48 #include "xfs_ialloc_btree.h"
49 #include "xfs_btree.h"
50 #include "xfs_ialloc.h"
51 #include "xfs_attr_sf.h"
52 #include "xfs_dir_sf.h"
53 #include "xfs_dir2_sf.h"
54 #include "xfs_dinode.h"
55 #include "xfs_inode.h"
58 #include "xfs_rtalloc.h"
59 #include "xfs_error.h"
60 #include "xfs_itable.h"
66 #include "xfs_buf_item.h"
67 #include "xfs_utils.h"
68 #include "xfs_version.h"
70 #include <linux/namei.h>
71 #include <linux/init.h>
72 #include <linux/mount.h>
73 #include <linux/mempool.h>
74 #include <linux/writeback.h>
75 #include <linux/kthread.h>
77 STATIC struct quotactl_ops linvfs_qops;
78 STATIC struct super_operations linvfs_sops;
79 STATIC kmem_zone_t *xfs_vnode_zone;
80 STATIC kmem_zone_t *xfs_ioend_zone;
81 mempool_t *xfs_ioend_pool;
83 STATIC struct xfs_mount_args *
85 struct super_block *sb)
87 struct xfs_mount_args *args;
89 args = kmem_zalloc(sizeof(struct xfs_mount_args), KM_SLEEP);
90 args->logbufs = args->logbufsize = -1;
91 strncpy(args->fsname, sb->s_id, MAXNAMELEN);
93 /* Copy the already-parsed mount(2) flags we're interested in */
94 if (sb->s_flags & MS_NOATIME)
95 args->flags |= XFSMNT_NOATIME;
96 if (sb->s_flags & MS_DIRSYNC)
97 args->flags |= XFSMNT_DIRSYNC;
98 if (sb->s_flags & MS_SYNCHRONOUS)
99 args->flags |= XFSMNT_WSYNC;
101 /* Default to 32 bit inodes on Linux all the time */
102 args->flags |= XFSMNT_32BITINODES;
109 unsigned int blockshift)
111 unsigned int pagefactor = 1;
112 unsigned int bitshift = BITS_PER_LONG - 1;
114 /* Figure out maximum filesize, on Linux this can depend on
115 * the filesystem blocksize (on 32 bit platforms).
116 * __block_prepare_write does this in an [unsigned] long...
117 * page->index << (PAGE_CACHE_SHIFT - bbits)
118 * So, for page sized blocks (4K on 32 bit platforms),
119 * this wraps at around 8Tb (hence MAX_LFS_FILESIZE which is
120 * (((u64)PAGE_CACHE_SIZE << (BITS_PER_LONG-1))-1)
121 * but for smaller blocksizes it is less (bbits = log2 bsize).
122 * Note1: get_block_t takes a long (implicit cast from above)
123 * Note2: The Large Block Device (LBD and HAVE_SECTOR_T) patch
124 * can optionally convert the [unsigned] long from above into
125 * an [unsigned] long long.
128 #if BITS_PER_LONG == 32
129 # if defined(CONFIG_LBD)
130 ASSERT(sizeof(sector_t) == 8);
131 pagefactor = PAGE_CACHE_SIZE;
132 bitshift = BITS_PER_LONG;
134 pagefactor = PAGE_CACHE_SIZE >> (PAGE_CACHE_SHIFT - blockshift);
138 return (((__uint64_t)pagefactor) << bitshift) - 1;
141 STATIC __inline__ void
145 switch (inode->i_mode & S_IFMT) {
147 inode->i_op = &linvfs_file_inode_operations;
148 inode->i_fop = &linvfs_file_operations;
149 inode->i_mapping->a_ops = &linvfs_aops;
152 inode->i_op = &linvfs_dir_inode_operations;
153 inode->i_fop = &linvfs_dir_operations;
156 inode->i_op = &linvfs_symlink_inode_operations;
158 inode->i_mapping->a_ops = &linvfs_aops;
161 inode->i_op = &linvfs_file_inode_operations;
162 init_special_inode(inode, inode->i_mode, inode->i_rdev);
167 STATIC __inline__ void
168 xfs_revalidate_inode(
173 struct inode *inode = LINVFS_GET_IP(vp);
175 inode->i_mode = ip->i_d.di_mode;
176 inode->i_nlink = ip->i_d.di_nlink;
177 inode->i_uid = ip->i_d.di_uid;
178 inode->i_gid = ip->i_d.di_gid;
180 switch (inode->i_mode & S_IFMT) {
184 MKDEV(sysv_major(ip->i_df.if_u2.if_rdev) & 0x1ff,
185 sysv_minor(ip->i_df.if_u2.if_rdev));
192 inode->i_blksize = PAGE_CACHE_SIZE;
193 inode->i_generation = ip->i_d.di_gen;
194 i_size_write(inode, ip->i_d.di_size);
196 XFS_FSB_TO_BB(mp, ip->i_d.di_nblocks + ip->i_delayed_blks);
197 inode->i_atime.tv_sec = ip->i_d.di_atime.t_sec;
198 inode->i_atime.tv_nsec = ip->i_d.di_atime.t_nsec;
199 inode->i_mtime.tv_sec = ip->i_d.di_mtime.t_sec;
200 inode->i_mtime.tv_nsec = ip->i_d.di_mtime.t_nsec;
201 inode->i_ctime.tv_sec = ip->i_d.di_ctime.t_sec;
202 inode->i_ctime.tv_nsec = ip->i_d.di_ctime.t_nsec;
203 if (ip->i_d.di_flags & XFS_DIFLAG_IMMUTABLE)
204 inode->i_flags |= S_IMMUTABLE;
206 inode->i_flags &= ~S_IMMUTABLE;
207 if (ip->i_d.di_flags & XFS_DIFLAG_APPEND)
208 inode->i_flags |= S_APPEND;
210 inode->i_flags &= ~S_APPEND;
211 if (ip->i_d.di_flags & XFS_DIFLAG_SYNC)
212 inode->i_flags |= S_SYNC;
214 inode->i_flags &= ~S_SYNC;
215 if (ip->i_d.di_flags & XFS_DIFLAG_NOATIME)
216 inode->i_flags |= S_NOATIME;
218 inode->i_flags &= ~S_NOATIME;
219 vp->v_flag &= ~VMODIFIED;
223 xfs_initialize_vnode(
226 bhv_desc_t *inode_bhv,
229 xfs_inode_t *ip = XFS_BHVTOI(inode_bhv);
230 struct inode *inode = LINVFS_GET_IP(vp);
232 if (!inode_bhv->bd_vobj) {
233 vp->v_vfsp = bhvtovfs(bdp);
234 bhv_desc_init(inode_bhv, ip, vp, &xfs_vnodeops);
235 bhv_insert(VN_BHV_HEAD(vp), inode_bhv);
239 * We need to set the ops vectors, and unlock the inode, but if
240 * we have been called during the new inode create process, it is
241 * too early to fill in the Linux inode. We will get called a
242 * second time once the inode is properly set up, and then we can
245 if (ip->i_d.di_mode != 0 && unlock && (inode->i_state & I_NEW)) {
246 xfs_revalidate_inode(XFS_BHVTOM(bdp), vp, ip);
247 xfs_set_inodeops(inode);
249 ip->i_flags &= ~XFS_INEW;
252 unlock_new_inode(inode);
260 struct block_device **bdevp)
264 *bdevp = open_bdev_excl(name, 0, mp);
265 if (IS_ERR(*bdevp)) {
266 error = PTR_ERR(*bdevp);
267 printk("XFS: Invalid device [%s], error=%d\n", name, error);
275 struct block_device *bdev)
278 close_bdev_excl(bdev);
282 * Try to write out the superblock using barriers.
288 xfs_buf_t *sbp = xfs_getsb(mp, 0);
293 XFS_BUF_UNDELAYWRITE(sbp);
295 XFS_BUF_UNASYNC(sbp);
296 XFS_BUF_ORDERED(sbp);
299 error = xfs_iowait(sbp);
302 * Clear all the flags we set and possible error state in the
303 * buffer. We only did the write to try out whether barriers
304 * worked and shouldn't leave any traces in the superblock
308 XFS_BUF_ERROR(sbp, 0);
309 XFS_BUF_UNORDERED(sbp);
316 xfs_mountfs_check_barriers(xfs_mount_t *mp)
320 if (mp->m_logdev_targp != mp->m_ddev_targp) {
321 xfs_fs_cmn_err(CE_NOTE, mp,
322 "Disabling barriers, not supported with external log device");
323 mp->m_flags &= ~XFS_MOUNT_BARRIER;
326 if (mp->m_ddev_targp->pbr_bdev->bd_disk->queue->ordered ==
327 QUEUE_ORDERED_NONE) {
328 xfs_fs_cmn_err(CE_NOTE, mp,
329 "Disabling barriers, not supported by the underlying device");
330 mp->m_flags &= ~XFS_MOUNT_BARRIER;
333 error = xfs_barrier_test(mp);
335 xfs_fs_cmn_err(CE_NOTE, mp,
336 "Disabling barriers, trial barrier write failed");
337 mp->m_flags &= ~XFS_MOUNT_BARRIER;
342 xfs_blkdev_issue_flush(
343 xfs_buftarg_t *buftarg)
345 blkdev_issue_flush(buftarg->pbr_bdev, NULL);
348 STATIC struct inode *
350 struct super_block *sb)
354 vp = kmem_cache_alloc(xfs_vnode_zone, kmem_flags_convert(KM_SLEEP));
357 return LINVFS_GET_IP(vp);
361 linvfs_destroy_inode(
364 kmem_zone_free(xfs_vnode_zone, LINVFS_GET_VP(inode));
368 linvfs_inode_init_once(
370 kmem_cache_t *cachep,
373 vnode_t *vp = (vnode_t *)data;
375 if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
376 SLAB_CTOR_CONSTRUCTOR)
377 inode_init_once(LINVFS_GET_IP(vp));
381 linvfs_init_zones(void)
383 xfs_vnode_zone = kmem_cache_create("xfs_vnode",
384 sizeof(vnode_t), 0, SLAB_RECLAIM_ACCOUNT,
385 linvfs_inode_init_once, NULL);
389 xfs_ioend_zone = kmem_zone_init(sizeof(xfs_ioend_t), "xfs_ioend");
391 goto out_destroy_vnode_zone;
393 xfs_ioend_pool = mempool_create(4 * MAX_BUF_PER_PAGE,
394 mempool_alloc_slab, mempool_free_slab,
397 goto out_free_ioend_zone;
403 kmem_zone_destroy(xfs_ioend_zone);
404 out_destroy_vnode_zone:
405 kmem_zone_destroy(xfs_vnode_zone);
411 linvfs_destroy_zones(void)
413 mempool_destroy(xfs_ioend_pool);
414 kmem_zone_destroy(xfs_vnode_zone);
415 kmem_zone_destroy(xfs_ioend_zone);
419 * Attempt to flush the inode, this will actually fail
420 * if the inode is pinned, but we dirty the inode again
421 * at the point when it is unpinned after a log write,
422 * since this is when the inode itself becomes flushable.
429 vnode_t *vp = LINVFS_GET_VP(inode);
430 int error = 0, flags = FLUSH_INODE;
433 vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address);
436 VOP_IFLUSH(vp, flags, error);
437 if (error == EAGAIN) {
439 VOP_IFLUSH(vp, flags | FLUSH_LOG, error);
452 vnode_t *vp = LINVFS_GET_VP(inode);
455 vn_trace_entry(vp, "clear_inode", (inst_t *)__return_address);
457 XFS_STATS_INC(vn_rele);
458 XFS_STATS_INC(vn_remove);
459 XFS_STATS_INC(vn_reclaim);
460 XFS_STATS_DEC(vn_active);
463 * This can happen because xfs_iget_core calls xfs_idestroy if we
464 * find an inode with di_mode == 0 but without IGET_CREATE set.
467 VOP_INACTIVE(vp, NULL, cache);
470 vp->v_flag &= ~VMODIFIED;
474 VOP_RECLAIM(vp, error);
476 panic("vn_purge: cannot reclaim");
479 ASSERT(vp->v_fbhv == NULL);
481 #ifdef XFS_VNODE_TRACE
482 ktrace_free(vp->v_trace);
487 * Enqueue a work item to be picked up by the vfs xfssyncd thread.
488 * Doing this has two advantages:
489 * - It saves on stack space, which is tight in certain situations
490 * - It can be used (with care) as a mechanism to avoid deadlocks.
491 * Flushing while allocating in a full filesystem requires both.
494 xfs_syncd_queue_work(
497 void (*syncer)(vfs_t *, void *))
499 vfs_sync_work_t *work;
501 work = kmem_alloc(sizeof(struct vfs_sync_work), KM_SLEEP);
502 INIT_LIST_HEAD(&work->w_list);
503 work->w_syncer = syncer;
506 spin_lock(&vfs->vfs_sync_lock);
507 list_add_tail(&work->w_list, &vfs->vfs_sync_list);
508 spin_unlock(&vfs->vfs_sync_lock);
509 wake_up_process(vfs->vfs_sync_task);
513 * Flush delayed allocate data, attempting to free up reserved space
514 * from existing allocations. At this point a new allocation attempt
515 * has failed with ENOSPC and we are in the process of scratching our
516 * heads, looking about for more room...
519 xfs_flush_inode_work(
523 filemap_flush(((struct inode *)inode)->i_mapping);
524 iput((struct inode *)inode);
531 struct inode *inode = LINVFS_GET_IP(XFS_ITOV(ip));
532 struct vfs *vfs = XFS_MTOVFS(ip->i_mount);
535 xfs_syncd_queue_work(vfs, inode, xfs_flush_inode_work);
536 delay(msecs_to_jiffies(500));
540 * This is the "bigger hammer" version of xfs_flush_inode_work...
541 * (IOW, "If at first you don't succeed, use a Bigger Hammer").
544 xfs_flush_device_work(
548 sync_blockdev(vfs->vfs_super->s_bdev);
549 iput((struct inode *)inode);
556 struct inode *inode = LINVFS_GET_IP(XFS_ITOV(ip));
557 struct vfs *vfs = XFS_MTOVFS(ip->i_mount);
560 xfs_syncd_queue_work(vfs, inode, xfs_flush_device_work);
561 delay(msecs_to_jiffies(500));
562 xfs_log_force(ip->i_mount, (xfs_lsn_t)0, XFS_LOG_FORCE|XFS_LOG_SYNC);
565 #define SYNCD_FLAGS (SYNC_FSDATA|SYNC_BDFLUSH|SYNC_ATTR)
573 if (!(vfsp->vfs_flag & VFS_RDONLY))
574 VFS_SYNC(vfsp, SYNCD_FLAGS, NULL, error);
575 vfsp->vfs_sync_seq++;
577 wake_up(&vfsp->vfs_wait_single_sync_task);
585 vfs_t *vfsp = (vfs_t *) arg;
586 struct vfs_sync_work *work, *n;
589 timeleft = xfs_syncd_centisecs * msecs_to_jiffies(10);
591 timeleft = schedule_timeout_interruptible(timeleft);
594 if (kthread_should_stop())
597 spin_lock(&vfsp->vfs_sync_lock);
599 * We can get woken by laptop mode, to do a sync -
600 * that's the (only!) case where the list would be
601 * empty with time remaining.
603 if (!timeleft || list_empty(&vfsp->vfs_sync_list)) {
605 timeleft = xfs_syncd_centisecs *
606 msecs_to_jiffies(10);
607 INIT_LIST_HEAD(&vfsp->vfs_sync_work.w_list);
608 list_add_tail(&vfsp->vfs_sync_work.w_list,
609 &vfsp->vfs_sync_list);
611 list_for_each_entry_safe(work, n, &vfsp->vfs_sync_list, w_list)
612 list_move(&work->w_list, &tmp);
613 spin_unlock(&vfsp->vfs_sync_lock);
615 list_for_each_entry_safe(work, n, &tmp, w_list) {
616 (*work->w_syncer)(vfsp, work->w_data);
617 list_del(&work->w_list);
618 if (work == &vfsp->vfs_sync_work)
620 kmem_free(work, sizeof(struct vfs_sync_work));
631 vfsp->vfs_sync_work.w_syncer = vfs_sync_worker;
632 vfsp->vfs_sync_work.w_vfs = vfsp;
633 vfsp->vfs_sync_task = kthread_run(xfssyncd, vfsp, "xfssyncd");
634 if (IS_ERR(vfsp->vfs_sync_task))
635 return -PTR_ERR(vfsp->vfs_sync_task);
643 kthread_stop(vfsp->vfs_sync_task);
648 struct super_block *sb)
650 vfs_t *vfsp = LINVFS_GET_VFS(sb);
653 linvfs_stop_syncd(vfsp);
654 VFS_SYNC(vfsp, SYNC_ATTR|SYNC_DELWRI, NULL, error);
656 VFS_UNMOUNT(vfsp, 0, NULL, error);
658 printk("XFS unmount got error %d\n", error);
659 printk("%s: vfsp/0x%p left dangling!\n", __FUNCTION__, vfsp);
663 vfs_deallocate(vfsp);
668 struct super_block *sb)
670 vfs_t *vfsp = LINVFS_GET_VFS(sb);
673 if (sb->s_flags & MS_RDONLY) {
674 sb->s_dirt = 0; /* paranoia */
677 /* Push the log and superblock a little */
678 VFS_SYNC(vfsp, SYNC_FSDATA, NULL, error);
684 struct super_block *sb,
687 vfs_t *vfsp = LINVFS_GET_VFS(sb);
689 int flags = SYNC_FSDATA;
691 if (unlikely(sb->s_frozen == SB_FREEZE_WRITE))
692 flags = SYNC_QUIESCE;
694 flags = SYNC_FSDATA | (wait ? SYNC_WAIT : 0);
696 VFS_SYNC(vfsp, flags, NULL, error);
699 if (unlikely(laptop_mode)) {
700 int prev_sync_seq = vfsp->vfs_sync_seq;
703 * The disk must be active because we're syncing.
704 * We schedule xfssyncd now (now that the disk is
705 * active) instead of later (when it might not be).
707 wake_up_process(vfsp->vfs_sync_task);
709 * We have to wait for the sync iteration to complete.
710 * If we don't, the disk activity caused by the sync
711 * will come after the sync is completed, and that
712 * triggers another sync from laptop mode.
714 wait_event(vfsp->vfs_wait_single_sync_task,
715 vfsp->vfs_sync_seq != prev_sync_seq);
723 struct super_block *sb,
724 struct kstatfs *statp)
726 vfs_t *vfsp = LINVFS_GET_VFS(sb);
729 VFS_STATVFS(vfsp, statp, NULL, error);
735 struct super_block *sb,
739 vfs_t *vfsp = LINVFS_GET_VFS(sb);
740 struct xfs_mount_args *args = xfs_args_allocate(sb);
743 VFS_PARSEARGS(vfsp, options, args, 1, error);
745 VFS_MNTUPDATE(vfsp, flags, args, error);
746 kmem_free(args, sizeof(*args));
752 struct super_block *sb)
754 VFS_FREEZE(LINVFS_GET_VFS(sb));
760 struct vfsmount *mnt)
762 struct vfs *vfsp = LINVFS_GET_VFS(mnt->mnt_sb);
765 VFS_SHOWARGS(vfsp, m, error);
771 struct super_block *sb,
774 struct vfs *vfsp = LINVFS_GET_VFS(sb);
777 VFS_QUOTACTL(vfsp, Q_XQUOTASYNC, 0, (caddr_t)NULL, error);
783 struct super_block *sb,
784 struct fs_quota_stat *fqs)
786 struct vfs *vfsp = LINVFS_GET_VFS(sb);
789 VFS_QUOTACTL(vfsp, Q_XGETQSTAT, 0, (caddr_t)fqs, error);
795 struct super_block *sb,
799 struct vfs *vfsp = LINVFS_GET_VFS(sb);
802 VFS_QUOTACTL(vfsp, op, 0, (caddr_t)&flags, error);
808 struct super_block *sb,
811 struct fs_disk_quota *fdq)
813 struct vfs *vfsp = LINVFS_GET_VFS(sb);
816 getmode = (type == USRQUOTA) ? Q_XGETQUOTA :
817 ((type == GRPQUOTA) ? Q_XGETGQUOTA : Q_XGETPQUOTA);
818 VFS_QUOTACTL(vfsp, getmode, id, (caddr_t)fdq, error);
824 struct super_block *sb,
827 struct fs_disk_quota *fdq)
829 struct vfs *vfsp = LINVFS_GET_VFS(sb);
832 setmode = (type == USRQUOTA) ? Q_XSETQLIM :
833 ((type == GRPQUOTA) ? Q_XSETGQLIM : Q_XSETPQLIM);
834 VFS_QUOTACTL(vfsp, setmode, id, (caddr_t)fdq, error);
840 struct super_block *sb,
845 struct vfs *vfsp = vfs_allocate();
846 struct xfs_mount_args *args = xfs_args_allocate(sb);
847 struct kstatfs statvfs;
850 vfsp->vfs_super = sb;
851 LINVFS_SET_VFS(sb, vfsp);
852 if (sb->s_flags & MS_RDONLY)
853 vfsp->vfs_flag |= VFS_RDONLY;
854 bhv_insert_all_vfsops(vfsp);
856 VFS_PARSEARGS(vfsp, (char *)data, args, 0, error);
858 bhv_remove_all_vfsops(vfsp, 1);
862 sb_min_blocksize(sb, BBSIZE);
863 #ifdef CONFIG_XFS_EXPORT
864 sb->s_export_op = &linvfs_export_ops;
866 sb->s_qcop = &linvfs_qops;
867 sb->s_op = &linvfs_sops;
869 VFS_MOUNT(vfsp, args, NULL, error);
871 bhv_remove_all_vfsops(vfsp, 1);
875 VFS_STATVFS(vfsp, &statvfs, NULL, error);
880 sb->s_magic = statvfs.f_type;
881 sb->s_blocksize = statvfs.f_bsize;
882 sb->s_blocksize_bits = ffs(statvfs.f_bsize) - 1;
883 sb->s_maxbytes = xfs_max_file_offset(sb->s_blocksize_bits);
885 set_posix_acl_flag(sb);
887 VFS_ROOT(vfsp, &rootvp, error);
891 sb->s_root = d_alloc_root(LINVFS_GET_IP(rootvp));
896 if (is_bad_inode(sb->s_root->d_inode)) {
900 if ((error = linvfs_start_syncd(vfsp)))
902 vn_trace_exit(rootvp, __FUNCTION__, (inst_t *)__return_address);
904 kmem_free(args, sizeof(*args));
916 VFS_UNMOUNT(vfsp, 0, NULL, error2);
919 vfs_deallocate(vfsp);
920 kmem_free(args, sizeof(*args));
924 STATIC struct super_block *
926 struct file_system_type *fs_type,
928 const char *dev_name,
931 return get_sb_bdev(fs_type, flags, dev_name, data, linvfs_fill_super);
934 STATIC struct super_operations linvfs_sops = {
935 .alloc_inode = linvfs_alloc_inode,
936 .destroy_inode = linvfs_destroy_inode,
937 .write_inode = linvfs_write_inode,
938 .clear_inode = linvfs_clear_inode,
939 .put_super = linvfs_put_super,
940 .write_super = linvfs_write_super,
941 .sync_fs = linvfs_sync_super,
942 .write_super_lockfs = linvfs_freeze_fs,
943 .statfs = linvfs_statfs,
944 .remount_fs = linvfs_remount,
945 .show_options = linvfs_show_options,
948 STATIC struct quotactl_ops linvfs_qops = {
949 .quota_sync = linvfs_quotasync,
950 .get_xstate = linvfs_getxstate,
951 .set_xstate = linvfs_setxstate,
952 .get_xquota = linvfs_getxquota,
953 .set_xquota = linvfs_setxquota,
956 STATIC struct file_system_type xfs_fs_type = {
957 .owner = THIS_MODULE,
959 .get_sb = linvfs_get_sb,
960 .kill_sb = kill_block_super,
961 .fs_flags = FS_REQUIRES_DEV,
970 static char message[] __initdata = KERN_INFO \
971 XFS_VERSION_STRING " with " XFS_BUILD_OPTIONS " enabled\n";
976 xfs_physmem = si.totalram;
980 error = linvfs_init_zones();
984 error = pagebuf_init();
993 error = register_filesystem(&xfs_fs_type);
996 XFS_DM_INIT(&xfs_fs_type);
1000 pagebuf_terminate();
1003 linvfs_destroy_zones();
1013 XFS_DM_EXIT(&xfs_fs_type);
1014 unregister_filesystem(&xfs_fs_type);
1016 pagebuf_terminate();
1017 linvfs_destroy_zones();
1021 module_init(init_xfs_fs);
1022 module_exit(exit_xfs_fs);
1024 MODULE_AUTHOR("Silicon Graphics, Inc.");
1025 MODULE_DESCRIPTION(XFS_VERSION_STRING " with " XFS_BUILD_OPTIONS " enabled");
1026 MODULE_LICENSE("GPL");