vserver 1.9.5.x5
[linux-2.6.git] / fs / xfs / quota / xfs_qm_bhv.c
index 96b1d58..be67d9c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
+ * Copyright (c) 2000-2004 Silicon Graphics, Inc.  All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of version 2 of the GNU General Public License as
@@ -207,10 +207,9 @@ xfs_qm_syncall(
 }
 
 /*
- * When xfsquotas isn't installed and the superblock had quotas, we need to
- * clear the quotaflags from superblock.
+ * Clear the quotaflags in memory and in the superblock.
  */
-STATIC void
+void
 xfs_mount_reset_sbqflags(
        xfs_mount_t             *mp)
 {
@@ -241,6 +240,8 @@ xfs_mount_reset_sbqflags(
        if (xfs_trans_reserve(tp, 0, mp->m_sb.sb_sectsize + 128, 0, 0,
                                      XFS_DEFAULT_LOG_COUNT)) {
                xfs_trans_cancel(tp, 0);
+               xfs_fs_cmn_err(CE_ALERT, mp,
+                       "xfs_mount_reset_sbqflags: Superblock update failed!");
                return;
        }
        xfs_mod_sb(tp, XFS_SB_QFLAGS);
@@ -294,15 +295,12 @@ xfs_qm_newmount(
                 */
                if (quotaondisk && !XFS_QM_NEED_QUOTACHECK(mp)) {
                        /*
-                        * If the xfs quota code isn't installed,
-                        * we have to reset the quotachk'd bit.
                         * If an error occured, qm_mount_quotas code
                         * has already disabled quotas. So, just finish
                         * mounting, and get on with the boring life
                         * without disk quotas.
                         */
-                       if (xfs_qm_mount_quotas(mp))
-                               xfs_mount_reset_sbqflags(mp);
+                       xfs_qm_mount_quotas(mp, 0);
                } else {
                        /*
                         * Clear the quota flags, but remember them. This
@@ -324,13 +322,13 @@ STATIC int
 xfs_qm_endmount(
        xfs_mount_t     *mp,
        uint            needquotamount,
-       uint            quotaflags)
+       uint            quotaflags,
+       int             mfsi_flags)
 {
        if (needquotamount) {
                ASSERT(mp->m_qflags == 0);
                mp->m_qflags = quotaflags;
-               if (xfs_qm_mount_quotas(mp))
-                       xfs_mount_reset_sbqflags(mp);
+               xfs_qm_mount_quotas(mp, mfsi_flags);
        }
 
 #if defined(DEBUG) && defined(XFS_LOUD_RECOVERY)