]> err.no Git - linux-2.6/blobdiff - fs/xfs/xfs_vfsops.c
[XFS] Unwrap xfs_dabuf_global_lock
[linux-2.6] / fs / xfs / xfs_vfsops.c
index f62f6e486f23eeaf289eb88127b38c1baf310921..f90d95582047b2eb19de7ba4e1d46e06c80c39d6 100644 (file)
 #include "xfs_filestream.h"
 #include "xfs_fsops.h"
 #include "xfs_vnodeops.h"
+#include "xfs_vfsops.h"
 
 
-STATIC int     xfs_sync(bhv_desc_t *, int, cred_t *);
-
 int
 xfs_init(void)
 {
@@ -68,7 +67,7 @@ xfs_init(void)
        extern kmem_zone_t      *xfs_buf_item_zone;
        extern kmem_zone_t      *xfs_dabuf_zone;
 #ifdef XFS_DABUF_DEBUG
-       extern lock_t           xfs_dabuf_global_lock;
+       extern spinlock_t        xfs_dabuf_global_lock;
        spinlock_init(&xfs_dabuf_global_lock, "xfsda");
 #endif
 
@@ -212,7 +211,6 @@ xfs_cleanup(void)
  */
 STATIC int
 xfs_start_flags(
-       struct bhv_vfs          *vfs,
        struct xfs_mount_args   *ap,
        struct xfs_mount        *mp)
 {
@@ -308,7 +306,7 @@ xfs_start_flags(
         * no recovery flag requires a read-only mount
         */
        if (ap->flags & XFSMNT_NORECOVERY) {
-               if (!(vfs->vfs_flag & VFS_RDONLY)) {
+               if (!(mp->m_flags & XFS_MOUNT_RDONLY)) {
                        cmn_err(CE_WARN,
        "XFS: tried to mount a FS read-write without recovery!");
                        return XFS_ERROR(EINVAL);
@@ -327,7 +325,7 @@ xfs_start_flags(
                mp->m_flags |= XFS_MOUNT_FILESTREAMS;
 
        if (ap->flags & XFSMNT_DMAPI)
-               vfs->vfs_flag |= VFS_DMI;
+               mp->m_flags |= XFS_MOUNT_DMAPI;
        return 0;
 }
 
@@ -337,11 +335,10 @@ xfs_start_flags(
  */
 STATIC int
 xfs_finish_flags(
-       struct bhv_vfs          *vfs,
        struct xfs_mount_args   *ap,
        struct xfs_mount        *mp)
 {
-       int                     ronly = (vfs->vfs_flag & VFS_RDONLY);
+       int                     ronly = (mp->m_flags & XFS_MOUNT_RDONLY);
 
        /* Fail a mount where the logbuf is smaller then the log stripe */
        if (XFS_SB_VERSION_HASLOGV2(&mp->m_sb)) {
@@ -433,19 +430,16 @@ xfs_finish_flags(
  * they are present.  The data subvolume has already been opened by
  * get_sb_bdev() and is stored in vfsp->vfs_super->s_bdev.
  */
-STATIC int
+int
 xfs_mount(
-       struct bhv_desc         *bhvp,
+       struct xfs_mount        *mp,
        struct xfs_mount_args   *args,
        cred_t                  *credp)
 {
-       struct bhv_vfs          *vfsp = bhvtovfs(bhvp);
-       struct bhv_desc         *p;
-       struct xfs_mount        *mp = XFS_BHVTOM(bhvp);
        struct block_device     *ddev, *logdev, *rtdev;
        int                     flags = 0, error;
 
-       ddev = vfsp->vfs_super->s_bdev;
+       ddev = mp->m_super->s_bdev;
        logdev = rtdev = NULL;
 
        error = xfs_dmops_get(mp, args);
@@ -455,12 +449,6 @@ xfs_mount(
        if (error)
                return error;
 
-       /*
-        * Setup xfs_mount function vectors from available behaviors
-        */
-       p = vfs_bhv_lookup(vfsp, VFS_POSITION_IO);
-       mp->m_io_ops = p ? *(xfs_ioops_t *) vfs_bhv_custom(p) : xfs_iocore_xfs;
-
        if (args->flags & XFSMNT_QUIET)
                flags |= XFS_MFSI_QUIET;
 
@@ -517,13 +505,13 @@ xfs_mount(
        /*
         * Setup flags based on mount(2) options and then the superblock
         */
-       error = xfs_start_flags(vfsp, args, mp);
+       error = xfs_start_flags(args, mp);
        if (error)
                goto error1;
        error = xfs_readsb(mp, flags);
        if (error)
                goto error1;
-       error = xfs_finish_flags(vfsp, args, mp);
+       error = xfs_finish_flags(args, mp);
        if (error)
                goto error2;
 
@@ -554,7 +542,7 @@ xfs_mount(
        if ((error = xfs_filestream_mount(mp)))
                goto error2;
 
-       error = XFS_IOINIT(vfsp, args, flags);
+       error = xfs_mountfs(mp, flags);
        if (error)
                goto error2;
 
@@ -578,14 +566,12 @@ error0:
        return error;
 }
 
-STATIC int
+int
 xfs_unmount(
-       bhv_desc_t      *bdp,
+       xfs_mount_t     *mp,
        int             flags,
        cred_t          *credp)
 {
-       bhv_vfs_t       *vfsp = bhvtovfs(bdp);
-       xfs_mount_t     *mp = XFS_BHVTOM(bdp);
        xfs_inode_t     *rip;
        bhv_vnode_t     *rvp;
        int             unmount_event_wanted = 0;
@@ -597,8 +583,8 @@ xfs_unmount(
        rvp = XFS_ITOV(rip);
 
 #ifdef HAVE_DMAPI
-       if (vfsp->vfs_flag & VFS_DMI) {
-               error = XFS_SEND_PREUNMOUNT(mp, vfsp,
+       if (mp->m_flags & XFS_MOUNT_DMAPI) {
+               error = XFS_SEND_PREUNMOUNT(mp,
                                rvp, DM_RIGHT_NULL, rvp, DM_RIGHT_NULL,
                                NULL, NULL, 0, 0,
                                (mp->m_dmevmask & (1<<DM_EVENT_PREUNMOUNT))?
@@ -641,8 +627,7 @@ xfs_unmount(
         * referenced vnodes as well.
         */
        if (XFS_FORCED_SHUTDOWN(mp)) {
-               error = xfs_sync(&mp->m_bhv,
-                        (SYNC_WAIT | SYNC_CLOSE), credp);
+               error = xfs_sync(mp, SYNC_WAIT | SYNC_CLOSE);
                ASSERT(error != EFSCORRUPTED);
        }
        xfs_unmountfs_needed = 1;
@@ -656,7 +641,7 @@ out:
                /* Note: mp structure must still exist for
                 * XFS_SEND_UNMOUNT() call.
                 */
-               XFS_SEND_UNMOUNT(mp, vfsp, error == 0 ? rvp : NULL,
+               XFS_SEND_UNMOUNT(mp, error == 0 ? rvp : NULL,
                        DM_RIGHT_NULL, 0, error, unmount_event_flags);
        }
        if (xfs_unmountfs_needed) {
@@ -726,29 +711,26 @@ xfs_attr_quiesce(
        xfs_unmountfs_writesb(mp);
 }
 
-STATIC int
+int
 xfs_mntupdate(
-       bhv_desc_t                      *bdp,
+       struct xfs_mount                *mp,
        int                             *flags,
        struct xfs_mount_args           *args)
 {
-       bhv_vfs_t       *vfsp = bhvtovfs(bdp);
-       xfs_mount_t     *mp = XFS_BHVTOM(bdp);
-
        if (!(*flags & MS_RDONLY)) {                    /* rw/ro -> rw */
-               if (vfsp->vfs_flag & VFS_RDONLY)
-                       vfsp->vfs_flag &= ~VFS_RDONLY;
+               if (mp->m_flags & XFS_MOUNT_RDONLY)
+                       mp->m_flags &= ~XFS_MOUNT_RDONLY;
                if (args->flags & XFSMNT_BARRIER) {
                        mp->m_flags |= XFS_MOUNT_BARRIER;
                        xfs_mountfs_check_barriers(mp);
                } else {
                        mp->m_flags &= ~XFS_MOUNT_BARRIER;
                }
-       } else if (!(vfsp->vfs_flag & VFS_RDONLY)) {    /* rw -> ro */
+       } else if (!(mp->m_flags & XFS_MOUNT_RDONLY)) { /* rw -> ro */
                xfs_filestream_flush(mp);
-               bhv_vfs_sync(vfsp, SYNC_DATA_QUIESCE, NULL);
+               xfs_sync(mp, SYNC_DATA_QUIESCE);
                xfs_attr_quiesce(mp);
-               vfsp->vfs_flag |= VFS_RDONLY;
+               mp->m_flags |= XFS_MOUNT_RDONLY;
        }
        return 0;
 }
@@ -843,14 +825,14 @@ fscorrupt_out2:
  * vpp  -- address of the caller's vnode pointer which should be
  *         set to the desired fs root vnode
  */
-STATIC int
+int
 xfs_root(
-       bhv_desc_t      *bdp,
+       xfs_mount_t     *mp,
        bhv_vnode_t     **vpp)
 {
        bhv_vnode_t     *vp;
 
-       vp = XFS_ITOV((XFS_BHVTOM(bdp))->m_rootip);
+       vp = XFS_ITOV(mp->m_rootip);
        VN_HOLD(vp);
        *vpp = vp;
        return 0;
@@ -863,19 +845,17 @@ xfs_root(
  * the superblock lock in the mount structure to ensure a consistent
  * snapshot of the counters returned.
  */
-STATIC int
+int
 xfs_statvfs(
-       bhv_desc_t      *bdp,
+       xfs_mount_t     *mp,
        bhv_statvfs_t   *statp,
        bhv_vnode_t     *vp)
 {
        __uint64_t      fakeinos;
        xfs_extlen_t    lsize;
-       xfs_mount_t     *mp;
        xfs_sb_t        *sbp;
        unsigned long   s;
 
-       mp = XFS_BHVTOM(bdp);
        sbp = &(mp->m_sb);
 
        statp->f_type = XFS_SB_MAGIC;
@@ -954,14 +934,11 @@ xfs_statvfs(
  *                    filesystem.
  *
  */
-/*ARGSUSED*/
-STATIC int
+int
 xfs_sync(
-       bhv_desc_t      *bdp,
-       int             flags,
-       cred_t          *credp)
+       xfs_mount_t     *mp,
+       int             flags)
 {
-       xfs_mount_t     *mp = XFS_BHVTOM(bdp);
        int             error;
 
        /*
@@ -1002,8 +979,6 @@ xfs_sync_inodes(
        int             *bypassed)
 {
        xfs_inode_t     *ip = NULL;
-       xfs_inode_t     *ip_next;
-       xfs_buf_t       *bp;
        bhv_vnode_t     *vp = NULL;
        int             error;
        int             last_error;
@@ -1013,7 +988,6 @@ xfs_sync_inodes(
        boolean_t       mount_locked;
        boolean_t       vnode_refed;
        int             preempt;
-       xfs_dinode_t    *dip;
        xfs_iptr_t      *ipointer;
 #ifdef DEBUG
        boolean_t       ipointer_in = B_FALSE;
@@ -1066,9 +1040,11 @@ xfs_sync_inodes(
 
 #define XFS_PREEMPT_MASK       0x7f
 
+       ASSERT(!(flags & SYNC_BDFLUSH));
+
        if (bypassed)
                *bypassed = 0;
-       if (XFS_MTOVFS(mp)->vfs_flag & VFS_RDONLY)
+       if (mp->m_flags & XFS_MOUNT_RDONLY)
                return 0;
        error = 0;
        last_error = 0;
@@ -1078,7 +1054,7 @@ xfs_sync_inodes(
        ipointer = (xfs_iptr_t *)kmem_zalloc(sizeof(xfs_iptr_t), KM_SLEEP);
 
        fflag = XFS_B_ASYNC;            /* default is don't wait */
-       if (flags & (SYNC_BDFLUSH | SYNC_DELWRI))
+       if (flags & SYNC_DELWRI)
                fflag = XFS_B_DELWRI;
        if (flags & SYNC_WAIT)
                fflag = 0;              /* synchronous overrides all */
@@ -1167,24 +1143,6 @@ xfs_sync_inodes(
                        return 0;
                }
 
-               /*
-                * If this is just vfs_sync() or pflushd() calling
-                * then we can skip inodes for which it looks like
-                * there is nothing to do.  Since we don't have the
-                * inode locked this is racy, but these are periodic
-                * calls so it doesn't matter.  For the others we want
-                * to know for sure, so we at least try to lock them.
-                */
-               if (flags & SYNC_BDFLUSH) {
-                       if (((ip->i_itemp == NULL) ||
-                            !(ip->i_itemp->ili_format.ilf_fields &
-                              XFS_ILOG_ALL)) &&
-                           (ip->i_update_core == 0)) {
-                               ip = ip->i_mnext;
-                               continue;
-                       }
-               }
-
                /*
                 * Try to lock without sleeping.  We're out of order with
                 * the inode list lock here, so if we fail we need to drop
@@ -1202,7 +1160,7 @@ xfs_sync_inodes(
                 * it.
                 */
                if (xfs_ilock_nowait(ip, lock_flags) == 0) {
-                       if ((flags & SYNC_BDFLUSH) || (vp == NULL)) {
+                       if (vp == NULL) {
                                ip = ip->i_mnext;
                                continue;
                        }
@@ -1263,160 +1221,27 @@ xfs_sync_inodes(
                        xfs_ilock(ip, XFS_ILOCK_SHARED);
                }
 
-               if (flags & SYNC_BDFLUSH) {
-                       if ((flags & SYNC_ATTR) &&
-                           ((ip->i_update_core) ||
-                            ((ip->i_itemp != NULL) &&
-                             (ip->i_itemp->ili_format.ilf_fields != 0)))) {
-
-                               /* Insert marker and drop lock if not already
-                                * done.
-                                */
-                               if (mount_locked) {
-                                       IPOINTER_INSERT(ip, mp);
-                               }
-
-                               /*
-                                * We don't want the periodic flushing of the
-                                * inodes by vfs_sync() to interfere with
-                                * I/O to the file, especially read I/O
-                                * where it is only the access time stamp
-                                * that is being flushed out.  To prevent
-                                * long periods where we have both inode
-                                * locks held shared here while reading the
-                                * inode's buffer in from disk, we drop the
-                                * inode lock while reading in the inode
-                                * buffer.  We have to release the buffer
-                                * and reacquire the inode lock so that they
-                                * are acquired in the proper order (inode
-                                * locks first).  The buffer will go at the
-                                * end of the lru chain, though, so we can
-                                * expect it to still be there when we go
-                                * for it again in xfs_iflush().
-                                */
-                               if ((xfs_ipincount(ip) == 0) &&
-                                   xfs_iflock_nowait(ip)) {
-
-                                       xfs_ifunlock(ip);
-                                       xfs_iunlock(ip, XFS_ILOCK_SHARED);
-
-                                       error = xfs_itobp(mp, NULL, ip,
-                                                         &dip, &bp, 0, 0);
-                                       if (!error) {
-                                               xfs_buf_relse(bp);
-                                       } else {
-                                               /* Bailing out, remove the
-                                                * marker and free it.
-                                                */
-                                               XFS_MOUNT_ILOCK(mp);
-                                               IPOINTER_REMOVE(ip, mp);
-                                               XFS_MOUNT_IUNLOCK(mp);
-
-                                               ASSERT(!(lock_flags &
-                                                       XFS_IOLOCK_SHARED));
-
-                                               kmem_free(ipointer,
-                                                       sizeof(xfs_iptr_t));
-                                               return (0);
-                                       }
-
-                                       /*
-                                        * Since we dropped the inode lock,
-                                        * the inode may have been reclaimed.
-                                        * Therefore, we reacquire the mount
-                                        * lock and check to see if we were the
-                                        * inode reclaimed. If this happened
-                                        * then the ipointer marker will no
-                                        * longer point back at us. In this
-                                        * case, move ip along to the inode
-                                        * after the marker, remove the marker
-                                        * and continue.
-                                        */
-                                       XFS_MOUNT_ILOCK(mp);
-                                       mount_locked = B_TRUE;
-
-                                       if (ip != ipointer->ip_mprev) {
-                                               IPOINTER_REMOVE(ip, mp);
-
-                                               ASSERT(!vnode_refed);
-                                               ASSERT(!(lock_flags &
-                                                       XFS_IOLOCK_SHARED));
-                                               continue;
-                                       }
-
-                                       ASSERT(ip->i_mount == mp);
-
-                                       if (xfs_ilock_nowait(ip,
-                                                   XFS_ILOCK_SHARED) == 0) {
-                                               ASSERT(ip->i_mount == mp);
-                                               /*
-                                                * We failed to reacquire
-                                                * the inode lock without
-                                                * sleeping, so just skip
-                                                * the inode for now.  We
-                                                * clear the ILOCK bit from
-                                                * the lock_flags so that we
-                                                * won't try to drop a lock
-                                                * we don't hold below.
-                                                */
-                                               lock_flags &= ~XFS_ILOCK_SHARED;
-                                               IPOINTER_REMOVE(ip_next, mp);
-                                       } else if ((xfs_ipincount(ip) == 0) &&
-                                                  xfs_iflock_nowait(ip)) {
-                                               ASSERT(ip->i_mount == mp);
-                                               /*
-                                                * Since this is vfs_sync()
-                                                * calling we only flush the
-                                                * inode out if we can lock
-                                                * it without sleeping and
-                                                * it is not pinned.  Drop
-                                                * the mount lock here so
-                                                * that we don't hold it for
-                                                * too long. We already have
-                                                * a marker in the list here.
-                                                */
-                                               XFS_MOUNT_IUNLOCK(mp);
-                                               mount_locked = B_FALSE;
-                                               error = xfs_iflush(ip,
-                                                          XFS_IFLUSH_DELWRI);
-                                       } else {
-                                               ASSERT(ip->i_mount == mp);
-                                               IPOINTER_REMOVE(ip_next, mp);
-                                       }
-                               }
-
-                       }
+               if ((flags & SYNC_ATTR) &&
+                   (ip->i_update_core ||
+                    (ip->i_itemp && ip->i_itemp->ili_format.ilf_fields))) {
+                       if (mount_locked)
+                               IPOINTER_INSERT(ip, mp);
 
-               } else {
-                       if ((flags & SYNC_ATTR) &&
-                           ((ip->i_update_core) ||
-                            ((ip->i_itemp != NULL) &&
-                             (ip->i_itemp->ili_format.ilf_fields != 0)))) {
-                               if (mount_locked) {
-                                       IPOINTER_INSERT(ip, mp);
-                               }
+                       if (flags & SYNC_WAIT) {
+                               xfs_iflock(ip);
+                               error = xfs_iflush(ip, XFS_IFLUSH_SYNC);
 
-                               if (flags & SYNC_WAIT) {
-                                       xfs_iflock(ip);
-                                       error = xfs_iflush(ip,
-                                                          XFS_IFLUSH_SYNC);
-                               } else {
-                                       /*
-                                        * If we can't acquire the flush
-                                        * lock, then the inode is already
-                                        * being flushed so don't bother
-                                        * waiting.  If we can lock it then
-                                        * do a delwri flush so we can
-                                        * combine multiple inode flushes
-                                        * in each disk write.
-                                        */
-                                       if (xfs_iflock_nowait(ip)) {
-                                               error = xfs_iflush(ip,
-                                                          XFS_IFLUSH_DELWRI);
-                                       }
-                                       else if (bypassed)
-                                               (*bypassed)++;
-                               }
+                       /*
+                        * If we can't acquire the flush lock, then the inode
+                        * is already being flushed so don't bother waiting.
+                        *
+                        * If we can lock it then do a delwri flush so we can
+                        * combine multiple inode flushes in each disk write.
+                        */
+                       } else if (xfs_iflock_nowait(ip)) {
+                               error = xfs_iflush(ip, XFS_IFLUSH_DELWRI);
+                       } else if (bypassed) {
+                               (*bypassed)++;
                        }
                }
 
@@ -1652,14 +1477,12 @@ xfs_syncsub(
 /*
  * xfs_vget - called by DMAPI and NFSD to get vnode from file handle
  */
-STATIC int
+int
 xfs_vget(
-       bhv_desc_t      *bdp,
+       xfs_mount_t     *mp,
        bhv_vnode_t     **vpp,
-       fid_t           *fidp)
+       xfs_fid_t       *xfid)
 {
-       xfs_mount_t     *mp = XFS_BHVTOM(bdp);
-       xfs_fid_t       *xfid = (struct xfs_fid *)fidp;
        xfs_inode_t     *ip;
        int             error;
        xfs_ino_t       ino;
@@ -1669,11 +1492,11 @@ xfs_vget(
         * Invalid.  Since handles can be created in user space and passed in
         * via gethandle(), this is not cause for a panic.
         */
-       if (xfid->xfs_fid_len != sizeof(*xfid) - sizeof(xfid->xfs_fid_len))
+       if (xfid->fid_len != sizeof(*xfid) - sizeof(xfid->fid_len))
                return XFS_ERROR(EINVAL);
 
-       ino  = xfid->xfs_fid_ino;
-       igen = xfid->xfs_fid_gen;
+       ino  = xfid->fid_ino;
+       igen = xfid->fid_gen;
 
        /*
         * NFS can sometimes send requests for ino 0.  Fail them gracefully.
@@ -1775,29 +1598,17 @@ suffix_strtoul(char *s, char **endp, unsigned int base)
        return simple_strtoul((const char *)s, endp, base) << shift_left_factor;
 }
 
-STATIC int
+int
 xfs_parseargs(
-       struct bhv_desc         *bhv,
+       struct xfs_mount        *mp,
        char                    *options,
        struct xfs_mount_args   *args,
        int                     update)
 {
-       bhv_vfs_t               *vfsp = bhvtovfs(bhv);
        char                    *this_char, *value, *eov;
        int                     dsunit, dswidth, vol_dsunit, vol_dswidth;
        int                     iosize;
-
-       /*
-        * Applications using DMI filesystems often expect the
-        * inode generation number to be monotonically increasing.
-        * If we delete inode chunks we break this assumption, so
-        * keep unused inode chunks on disk for DMI filesystems
-        * until we come up with a better solution.
-        * Note that if "ikeep" or "noikeep" mount options are
-        * supplied, then they are honored.
-        */
-       if (!(args->flags & XFSMNT_DMAPI))
-               args->flags |= XFSMNT_IDELETE;
+       int                     ikeep = 0;
 
        args->flags |= XFSMNT_BARRIER;
        args->flags2 |= XFSMNT2_COMPAT_IOSIZE;
@@ -1875,10 +1686,10 @@ xfs_parseargs(
                        args->iosizelog = ffs(iosize) - 1;
                } else if (!strcmp(this_char, MNTOPT_GRPID) ||
                           !strcmp(this_char, MNTOPT_BSDGROUPS)) {
-                       vfsp->vfs_flag |= VFS_GRPID;
+                       mp->m_flags |= XFS_MOUNT_GRPID;
                } else if (!strcmp(this_char, MNTOPT_NOGRPID) ||
                           !strcmp(this_char, MNTOPT_SYSVGROUPS)) {
-                       vfsp->vfs_flag &= ~VFS_GRPID;
+                       mp->m_flags &= ~XFS_MOUNT_GRPID;
                } else if (!strcmp(this_char, MNTOPT_WSYNC)) {
                        args->flags |= XFSMNT_WSYNC;
                } else if (!strcmp(this_char, MNTOPT_OSYNCISOSYNC)) {
@@ -1928,6 +1739,7 @@ xfs_parseargs(
                } else if (!strcmp(this_char, MNTOPT_NOBARRIER)) {
                        args->flags &= ~XFSMNT_BARRIER;
                } else if (!strcmp(this_char, MNTOPT_IKEEP)) {
+                       ikeep = 1;
                        args->flags &= ~XFSMNT_IDELETE;
                } else if (!strcmp(this_char, MNTOPT_NOIKEEP)) {
                        args->flags |= XFSMNT_IDELETE;
@@ -1988,7 +1800,7 @@ xfs_parseargs(
        }
 
        if (args->flags & XFSMNT_NORECOVERY) {
-               if ((vfsp->vfs_flag & VFS_RDONLY) == 0) {
+               if ((mp->m_flags & XFS_MOUNT_RDONLY) == 0) {
                        cmn_err(CE_WARN,
                                "XFS: no-recovery mounts must be read-only.");
                        return EINVAL;
@@ -2026,6 +1838,18 @@ xfs_parseargs(
                return EINVAL;
        }
 
+       /*
+        * Applications using DMI filesystems often expect the
+        * inode generation number to be monotonically increasing.
+        * If we delete inode chunks we break this assumption, so
+        * keep unused inode chunks on disk for DMI filesystems
+        * until we come up with a better solution.
+        * Note that if "ikeep" or "noikeep" mount options are
+        * supplied, then they are honored.
+        */
+       if (!(args->flags & XFSMNT_DMAPI) && !ikeep)
+               args->flags |= XFSMNT_IDELETE;
+
        if ((args->flags & XFSMNT_NOALIGN) != XFSMNT_NOALIGN) {
                if (dsunit) {
                        args->sunit = dsunit;
@@ -2041,15 +1865,15 @@ xfs_parseargs(
 
 done:
        if (args->flags & XFSMNT_32BITINODES)
-               vfsp->vfs_flag |= VFS_32BITINODES;
+               mp->m_flags |= XFS_MOUNT_SMALL_INUMS;
        if (args->flags2)
                args->flags |= XFSMNT_FLAGS2;
        return 0;
 }
 
-STATIC int
+int
 xfs_showargs(
-       struct bhv_desc         *bhv,
+       struct xfs_mount        *mp,
        struct seq_file         *m)
 {
        static struct proc_xfs_info {
@@ -2067,8 +1891,6 @@ xfs_showargs(
                { 0, NULL }
        };
        struct proc_xfs_info    *xfs_infop;
-       struct xfs_mount        *mp = XFS_BHVTOM(bhv);
-       struct bhv_vfs          *vfsp = XFS_MTOVFS(mp);
 
        for (xfs_infop = xfs_info; xfs_infop->flag; xfs_infop++) {
                if (mp->m_flags & xfs_infop->flag)
@@ -2101,9 +1923,9 @@ xfs_showargs(
        if (!(mp->m_flags & XFS_MOUNT_COMPAT_IOSIZE))
                seq_printf(m, "," MNTOPT_LARGEIO);
 
-       if (!(vfsp->vfs_flag & VFS_32BITINODES))
+       if (!(mp->m_flags & XFS_MOUNT_SMALL_INUMS))
                seq_printf(m, "," MNTOPT_64BITINODE);
-       if (vfsp->vfs_flag & VFS_GRPID)
+       if (mp->m_flags & XFS_MOUNT_GRPID)
                seq_printf(m, "," MNTOPT_GRPID);
 
        if (mp->m_qflags & XFS_UQUOTA_ACCT) {
@@ -2130,7 +1952,7 @@ xfs_showargs(
        if (!(mp->m_qflags & XFS_ALL_QUOTA_ACCT))
                seq_puts(m, "," MNTOPT_NOQUOTA);
 
-       if (vfsp->vfs_flag & VFS_DMI)
+       if (mp->m_flags & XFS_MOUNT_DMAPI)
                seq_puts(m, "," MNTOPT_DMAPI);
        return 0;
 }
@@ -2140,30 +1962,10 @@ xfs_showargs(
  * need to take care of themetadata. Once that's done write a dummy
  * record to dirty the log in case of a crash while frozen.
  */
-STATIC void
+void
 xfs_freeze(
-       bhv_desc_t      *bdp)
+       xfs_mount_t     *mp)
 {
-       xfs_mount_t     *mp = XFS_BHVTOM(bdp);
-
        xfs_attr_quiesce(mp);
        xfs_fs_log_dummy(mp);
 }
-
-
-bhv_vfsops_t xfs_vfsops = {
-       BHV_IDENTITY_INIT(VFS_BHV_XFS,VFS_POSITION_XFS),
-       .vfs_parseargs          = xfs_parseargs,
-       .vfs_showargs           = xfs_showargs,
-       .vfs_mount              = xfs_mount,
-       .vfs_unmount            = xfs_unmount,
-       .vfs_mntupdate          = xfs_mntupdate,
-       .vfs_root               = xfs_root,
-       .vfs_statvfs            = xfs_statvfs,
-       .vfs_sync               = xfs_sync,
-       .vfs_vget               = xfs_vget,
-       .vfs_quotactl           = (vfs_quotactl_t)fs_nosys,
-       .vfs_init_vnode         = xfs_initialize_vnode,
-       .vfs_force_shutdown     = xfs_do_force_shutdown,
-       .vfs_freeze             = xfs_freeze,
-};