Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[powerpc.git] / fs / xfs / xfs_vfsops.c
index febfd83..a154459 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)
 {
@@ -336,7 +335,6 @@ xfs_start_flags(
  */
 STATIC int
 xfs_finish_flags(
-       struct bhv_vfs          *vfs,
        struct xfs_mount_args   *ap,
        struct xfs_mount        *mp)
 {
@@ -438,11 +436,10 @@ xfs_mount(
        struct xfs_mount_args   *args,
        cred_t                  *credp)
 {
-       struct bhv_vfs          *vfsp = XFS_MTOVFS(mp);
        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);
@@ -510,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;
 
@@ -547,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;
 
@@ -577,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;
@@ -590,7 +586,7 @@ xfs_unmount(
 
 #ifdef HAVE_DMAPI
        if (mp->m_flags & XFS_MOUNT_DMAPI) {
-               error = XFS_SEND_PREUNMOUNT(mp, vfsp,
+               error = XFS_SEND_PREUNMOUNT(mp,
                                rvp, DM_RIGHT_NULL, rvp, DM_RIGHT_NULL,
                                NULL, NULL, 0, 0,
                                (mp->m_dmevmask & (1<<DM_EVENT_PREUNMOUNT))?
@@ -647,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) {
@@ -1639,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;
@@ -1651,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.
@@ -1767,18 +1762,7 @@ xfs_parseargs(
        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;
@@ -1909,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;
@@ -2007,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;
@@ -2119,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)
 {