]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/xfs/xfs_vfsops.c
Merge git://git.infradead.org/~dedekind/ubi-2.6
[linux-2.6-omap-h63xx.git] / fs / xfs / xfs_vfsops.c
index 2d672f317110eceb67cf3e35c61b5fd4638f7008..a1544597bcd318c7f35a80551321c1f103b55f13 100644 (file)
@@ -211,7 +211,6 @@ xfs_cleanup(void)
  */
 STATIC int
 xfs_start_flags(
-       struct bhv_vfs          *vfs,
        struct xfs_mount_args   *ap,
        struct xfs_mount        *mp)
 {
@@ -307,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);
@@ -326,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;
 }
 
@@ -336,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)) {
@@ -438,12 +436,10 @@ xfs_mount(
        struct xfs_mount_args   *args,
        cred_t                  *credp)
 {
-       struct bhv_vfs          *vfsp = XFS_MTOVFS(mp);
-       struct bhv_desc         *p;
        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);
@@ -453,11 +449,7 @@ 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;
+       mp->m_io_ops = xfs_iocore_xfs;
 
        if (args->flags & XFSMNT_QUIET)
                flags |= XFS_MFSI_QUIET;
@@ -515,13 +507,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;
 
@@ -552,7 +544,7 @@ xfs_mount(
        if ((error = xfs_filestream_mount(mp)))
                goto error2;
 
-       error = XFS_IOINIT(vfsp, args, flags);
+       error = XFS_IOINIT(mp, args, flags);
        if (error)
                goto error2;
 
@@ -582,7 +574,6 @@ xfs_unmount(
        int             flags,
        cred_t          *credp)
 {
-       bhv_vfs_t       *vfsp = XFS_MTOVFS(mp);
        xfs_inode_t     *rip;
        bhv_vnode_t     *rvp;
        int             unmount_event_wanted = 0;
@@ -594,8 +585,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))?
@@ -652,7 +643,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) {
@@ -728,22 +719,20 @@ xfs_mntupdate(
        int                             *flags,
        struct xfs_mount_args           *args)
 {
-       struct bhv_vfs                  *vfsp = XFS_MTOVFS(mp);
-
        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;
 }
@@ -1058,7 +1047,7 @@ xfs_sync_inodes(
 
        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;
@@ -1646,9 +1635,8 @@ int
 xfs_vget(
        xfs_mount_t     *mp,
        bhv_vnode_t     **vpp,
-       fid_t           *fidp)
+       xfs_fid_t       *xfid)
 {
-       xfs_fid_t       *xfid = (struct xfs_fid *)fidp;
        xfs_inode_t     *ip;
        int             error;
        xfs_ino_t       ino;
@@ -1658,11 +1646,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.
@@ -1771,22 +1759,10 @@ xfs_parseargs(
        struct xfs_mount_args   *args,
        int                     update)
 {
-       bhv_vfs_t               *vfsp = XFS_MTOVFS(mp);
        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;
@@ -1864,10 +1840,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)) {
@@ -1917,6 +1893,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;
@@ -1977,7 +1954,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;
@@ -2015,6 +1992,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;
@@ -2030,7 +2019,7 @@ 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;
@@ -2056,7 +2045,6 @@ xfs_showargs(
                { 0, NULL }
        };
        struct proc_xfs_info    *xfs_infop;
-       struct bhv_vfs          *vfsp = XFS_MTOVFS(mp);
 
        for (xfs_infop = xfs_info; xfs_infop->flag; xfs_infop++) {
                if (mp->m_flags & xfs_infop->flag)
@@ -2089,9 +2077,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) {
@@ -2118,7 +2106,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;
 }
@@ -2128,7 +2116,7 @@ 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(
        xfs_mount_t     *mp)
 {