]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/xfs/xfs_vfsops.c
[XFS] merge xfs_mntupdate into xfs_fs_remount
[linux-2.6-omap-h63xx.git] / fs / xfs / xfs_vfsops.c
index ea94593b5313b7e28e0e869a4baa77b0e2a13b20..e223aeab68be3cedcea96f8222c50da268d7f26e 100644 (file)
@@ -186,6 +186,7 @@ xfs_cleanup(void)
        kmem_zone_destroy(xfs_efi_zone);
        kmem_zone_destroy(xfs_ifork_zone);
        kmem_zone_destroy(xfs_ili_zone);
+       kmem_zone_destroy(xfs_log_ticket_zone);
 }
 
 /*
@@ -283,6 +284,8 @@ xfs_start_flags(
                mp->m_flags |= XFS_MOUNT_DIRSYNC;
        if (ap->flags & XFSMNT_ATTR2)
                mp->m_flags |= XFS_MOUNT_ATTR2;
+       if (ap->flags & XFSMNT_NOATTR2)
+               mp->m_flags |= XFS_MOUNT_NOATTR2;
 
        if (ap->flags2 & XFSMNT2_COMPAT_IOSIZE)
                mp->m_flags |= XFS_MOUNT_COMPAT_IOSIZE;
@@ -345,7 +348,12 @@ xfs_finish_flags(
                }
        }
 
-       if (xfs_sb_version_hasattr2(&mp->m_sb))
+       /*
+        * mkfs'ed attr2 will turn on attr2 mount unless explicitly
+        * told by noattr2 to turn it off
+        */
+       if (xfs_sb_version_hasattr2(&mp->m_sb) &&
+           !(ap->flags & XFSMNT_NOATTR2))
                mp->m_flags |= XFS_MOUNT_ATTR2;
 
        /*
@@ -631,13 +639,13 @@ out:
                xfs_unmountfs(mp, credp);
                xfs_qmops_put(mp);
                xfs_dmops_put(mp);
-               kmem_free(mp, sizeof(xfs_mount_t));
+               kmem_free(mp);
        }
 
        return XFS_ERROR(error);
 }
 
-STATIC int
+STATIC void
 xfs_quiesce_fs(
        xfs_mount_t             *mp)
 {
@@ -661,8 +669,6 @@ xfs_quiesce_fs(
                        count++;
                }
        } while (count < 2);
-
-       return 0;
 }
 
 /*
@@ -674,6 +680,8 @@ void
 xfs_attr_quiesce(
        xfs_mount_t     *mp)
 {
+       int     error = 0;
+
        /* wait for all modifications to complete */
        while (atomic_read(&mp->m_active_trans) > 0)
                delay(100);
@@ -684,35 +692,15 @@ xfs_attr_quiesce(
        ASSERT_ALWAYS(atomic_read(&mp->m_active_trans) == 0);
 
        /* Push the superblock and write an unmount record */
-       xfs_log_sbcount(mp, 1);
+       error = xfs_log_sbcount(mp, 1);
+       if (error)
+               xfs_fs_cmn_err(CE_WARN, mp,
+                               "xfs_attr_quiesce: failed to log sb changes. "
+                               "Frozen image may not be consistent.");
        xfs_log_unmount_write(mp);
        xfs_unmountfs_writesb(mp);
 }
 
-int
-xfs_mntupdate(
-       struct xfs_mount                *mp,
-       int                             *flags,
-       struct xfs_mount_args           *args)
-{
-       if (!(*flags & MS_RDONLY)) {                    /* rw/ro -> rw */
-               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 (!(mp->m_flags & XFS_MOUNT_RDONLY)) { /* rw -> ro */
-               xfs_filestream_flush(mp);
-               xfs_sync(mp, SYNC_DATA_QUIESCE);
-               xfs_attr_quiesce(mp);
-               mp->m_flags |= XFS_MOUNT_RDONLY;
-       }
-       return 0;
-}
-
 /*
  * xfs_unmount_flush implements a set of flush operation on special
  * inodes, which are needed as a separate set of operations so that
@@ -1043,7 +1031,7 @@ xfs_sync_inodes(
 
                if (XFS_FORCED_SHUTDOWN(mp) && !(flags & SYNC_CLOSE)) {
                        XFS_MOUNT_IUNLOCK(mp);
-                       kmem_free(ipointer, sizeof(xfs_iptr_t));
+                       kmem_free(ipointer);
                        return 0;
                }
 
@@ -1189,7 +1177,7 @@ xfs_sync_inodes(
                        }
                        XFS_MOUNT_IUNLOCK(mp);
                        ASSERT(ipointer_in == B_FALSE);
-                       kmem_free(ipointer, sizeof(xfs_iptr_t));
+                       kmem_free(ipointer);
                        return XFS_ERROR(error);
                }
 
@@ -1219,7 +1207,7 @@ xfs_sync_inodes(
 
        ASSERT(ipointer_in == B_FALSE);
 
-       kmem_free(ipointer, sizeof(xfs_iptr_t));
+       kmem_free(ipointer);
        return XFS_ERROR(last_error);
 }
 
@@ -1312,19 +1300,9 @@ xfs_syncsub(
                }
        }
 
-       /*
-        * If asked, update the disk superblock with incore counter values if we
-        * are using non-persistent counters so that they don't get too far out
-        * of sync if we crash or get a forced shutdown. We don't want to force
-        * this to disk, just get a transaction into the iclogs....
-        */
-       if (flags & SYNC_SUPER)
-               xfs_log_sbcount(mp, 0);
-
        /*
         * Now check to see if the log needs a "dummy" transaction.
         */
-
        if (!(flags & SYNC_REMOUNT) && xfs_log_need_covered(mp)) {
                xfs_trans_t *tp;
                xfs_inode_t *ip;