]> err.no Git - linux-2.6/blobdiff - fs/xfs/xfs_vfsops.c
[XFS] Update valid fields in xfs_mount_log_sb()
[linux-2.6] / fs / xfs / xfs_vfsops.c
index c21e4d168297b8fd49aede086456cab48f1321f1..a005cebf50412437c958d35a0caabd4a0337a24e 100644 (file)
@@ -69,15 +69,17 @@ xfs_init(void)
        /*
         * Initialize all of the zone allocators we use.
         */
+       xfs_log_ticket_zone = kmem_zone_init(sizeof(xlog_ticket_t),
+                                               "xfs_log_ticket");
        xfs_bmap_free_item_zone = kmem_zone_init(sizeof(xfs_bmap_free_item_t),
-                                                "xfs_bmap_free_item");
+                                               "xfs_bmap_free_item");
        xfs_btree_cur_zone = kmem_zone_init(sizeof(xfs_btree_cur_t),
-                                           "xfs_btree_cur");
-       xfs_trans_zone = kmem_zone_init(sizeof(xfs_trans_t), "xfs_trans");
-       xfs_da_state_zone =
-               kmem_zone_init(sizeof(xfs_da_state_t), "xfs_da_state");
+                                               "xfs_btree_cur");
+       xfs_da_state_zone = kmem_zone_init(sizeof(xfs_da_state_t),
+                                               "xfs_da_state");
        xfs_dabuf_zone = kmem_zone_init(sizeof(xfs_dabuf_t), "xfs_dabuf");
        xfs_ifork_zone = kmem_zone_init(sizeof(xfs_ifork_t), "xfs_ifork");
+       xfs_trans_zone = kmem_zone_init(sizeof(xfs_trans_t), "xfs_trans");
        xfs_acl_zone_init(xfs_acl_zone, "xfs_acl");
        xfs_mru_cache_init();
        xfs_filestream_init();
@@ -184,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);
 }
 
 /*
@@ -281,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;
@@ -343,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;
 
        /*
@@ -629,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)
 {
@@ -659,8 +669,6 @@ xfs_quiesce_fs(
                        count++;
                }
        } while (count < 2);
-
-       return 0;
 }
 
 /*
@@ -672,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);
@@ -682,7 +692,11 @@ 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);
 }
@@ -1041,7 +1055,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;
                }
 
@@ -1187,7 +1201,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);
                }
 
@@ -1217,7 +1231,7 @@ xfs_sync_inodes(
 
        ASSERT(ipointer_in == B_FALSE);
 
-       kmem_free(ipointer, sizeof(xfs_iptr_t));
+       kmem_free(ipointer);
        return XFS_ERROR(last_error);
 }
 
@@ -1310,19 +1324,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;