]> Pileus Git - ~andy/linux/commitdiff
Merge branch 'master' of git://oss.sgi.com/xfs/xfs into for-linus
authorFelix Blyakher <felixb@sgi.com>
Sat, 13 Jun 2009 02:28:59 +0000 (21:28 -0500)
committerFelix Blyakher <felixb@sgi.com>
Sat, 13 Jun 2009 02:28:59 +0000 (21:28 -0500)
1  2 
fs/xfs/linux-2.6/xfs_super.c
fs/xfs/xfs_trans.c

index 08d6bd9a39476aabf89656722b6fb17e70206656,36fb8a657c55aeb3f2460475eac4f9a18db7068e..2e09efbca8dbdeeb7cdfe9abcdb566eefb15c096
@@@ -43,7 -43,6 +43,6 @@@
  #include "xfs_itable.h"
  #include "xfs_fsops.h"
  #include "xfs_rw.h"
- #include "xfs_acl.h"
  #include "xfs_attr.h"
  #include "xfs_buf_item.h"
  #include "xfs_utils.h"
@@@ -405,6 -404,14 +404,14 @@@ xfs_parseargs
                return EINVAL;
        }
  
+ #ifndef CONFIG_XFS_QUOTA
+       if (XFS_IS_QUOTA_RUNNING(mp)) {
+               cmn_err(CE_WARN,
+                       "XFS: quota support not available in this kernel.");
+               return EINVAL;
+       }
+ #endif
        if ((mp->m_qflags & (XFS_GQUOTA_ACCT | XFS_GQUOTA_ACTIVE)) &&
            (mp->m_qflags & (XFS_PQUOTA_ACCT | XFS_PQUOTA_ACTIVE))) {
                cmn_err(CE_WARN,
@@@ -1063,7 -1070,18 +1070,18 @@@ xfs_fs_put_super
        int                     unmount_event_flags = 0;
  
        xfs_syncd_stop(mp);
-       xfs_sync_inodes(mp, SYNC_ATTR|SYNC_DELWRI);
+       if (!(sb->s_flags & MS_RDONLY)) {
+               /*
+                * XXX(hch): this should be SYNC_WAIT.
+                *
+                * Or more likely not needed at all because the VFS is already
+                * calling ->sync_fs after shutting down all filestem
+                * operations and just before calling ->put_super.
+                */
+               xfs_sync_data(mp, 0);
+               xfs_sync_attr(mp, 0);
+       }
  
  #ifdef HAVE_DMAPI
        if (mp->m_flags & XFS_MOUNT_DMAPI) {
        xfs_freesb(mp);
        xfs_icsb_destroy_counters(mp);
        xfs_close_devices(mp);
-       xfs_qmops_put(mp);
        xfs_dmops_put(mp);
        xfs_free_fsname(mp);
        kfree(mp);
  }
  
 -STATIC void
 -xfs_fs_write_super(
 -      struct super_block      *sb)
 -{
 -      if (!(sb->s_flags & MS_RDONLY))
 -              xfs_sync_fsdata(XFS_M(sb), 0);
 -      sb->s_dirt = 0;
 -}
 -
  STATIC int
  xfs_fs_sync_super(
        struct super_block      *sb,
                error = xfs_quiesce_data(mp);
        else
                error = xfs_sync_fsdata(mp, 0);
 -      sb->s_dirt = 0;
  
        if (unlikely(laptop_mode)) {
                int     prev_sync_seq = mp->m_sync_seq;
@@@ -1158,6 -1185,7 +1175,7 @@@ xfs_fs_statfs
  {
        struct xfs_mount        *mp = XFS_M(dentry->d_sb);
        xfs_sb_t                *sbp = &mp->m_sb;
+       struct xfs_inode        *ip = XFS_I(dentry->d_inode);
        __uint64_t              fakeinos, id;
        xfs_extlen_t            lsize;
  
        statp->f_ffree = statp->f_files - (sbp->sb_icount - sbp->sb_ifree);
        spin_unlock(&mp->m_sb_lock);
  
-       XFS_QM_DQSTATVFS(XFS_I(dentry->d_inode), statp);
+       if ((ip->i_d.di_flags & XFS_DIFLAG_PROJINHERIT) ||
+           ((mp->m_qflags & (XFS_PQUOTA_ACCT|XFS_OQUOTA_ENFD))) ==
+                             (XFS_PQUOTA_ACCT|XFS_OQUOTA_ENFD))
+               xfs_qm_statvfs(ip, statp);
        return 0;
  }
  
@@@ -1394,16 -1425,13 +1415,13 @@@ xfs_fs_fill_super
        error = xfs_dmops_get(mp);
        if (error)
                goto out_free_fsname;
-       error = xfs_qmops_get(mp);
-       if (error)
-               goto out_put_dmops;
  
        if (silent)
                flags |= XFS_MFSI_QUIET;
  
        error = xfs_open_devices(mp);
        if (error)
-               goto out_put_qmops;
+               goto out_put_dmops;
  
        if (xfs_icsb_init_counters(mp))
                mp->m_flags |= XFS_MOUNT_NO_PERCPU_SB;
  
        XFS_SEND_MOUNT(mp, DM_RIGHT_NULL, mtpt, mp->m_fsname);
  
 -      sb->s_dirt = 1;
        sb->s_magic = XFS_SB_MAGIC;
        sb->s_blocksize = mp->m_sb.sb_blocksize;
        sb->s_blocksize_bits = ffs(sb->s_blocksize) - 1;
   out_destroy_counters:
        xfs_icsb_destroy_counters(mp);
        xfs_close_devices(mp);
-  out_put_qmops:
-       xfs_qmops_put(mp);
   out_put_dmops:
        xfs_dmops_put(mp);
   out_free_fsname:
@@@ -1522,6 -1549,7 +1538,6 @@@ static struct super_operations xfs_supe
        .write_inode            = xfs_fs_write_inode,
        .clear_inode            = xfs_fs_clear_inode,
        .put_super              = xfs_fs_put_super,
 -      .write_super            = xfs_fs_write_super,
        .sync_fs                = xfs_fs_sync_super,
        .freeze_fs              = xfs_fs_freeze,
        .statfs                 = xfs_fs_statfs,
@@@ -1706,18 -1734,8 +1722,8 @@@ xfs_init_zones(void
        if (!xfs_ili_zone)
                goto out_destroy_inode_zone;
  
- #ifdef CONFIG_XFS_POSIX_ACL
-       xfs_acl_zone = kmem_zone_init(sizeof(xfs_acl_t), "xfs_acl");
-       if (!xfs_acl_zone)
-               goto out_destroy_ili_zone;
- #endif
        return 0;
  
- #ifdef CONFIG_XFS_POSIX_ACL
-  out_destroy_ili_zone:
- #endif
-       kmem_zone_destroy(xfs_ili_zone);
   out_destroy_inode_zone:
        kmem_zone_destroy(xfs_inode_zone);
   out_destroy_efi_zone:
  STATIC void
  xfs_destroy_zones(void)
  {
- #ifdef CONFIG_XFS_POSIX_ACL
-       kmem_zone_destroy(xfs_acl_zone);
- #endif
        kmem_zone_destroy(xfs_ili_zone);
        kmem_zone_destroy(xfs_inode_zone);
        kmem_zone_destroy(xfs_efi_zone);
diff --combined fs/xfs/xfs_trans.c
index bcc39d358ad3963e5a9d304d39c178a1df0f15b3,fffabc0aefcb347dd8c4f5c36d1f9eeaa2bb257f..66b849358e62d16e9a01fc307bc5a03dc1605ffb
@@@ -297,7 -297,7 +297,7 @@@ xfs_trans_dup
        tp->t_rtx_res = tp->t_rtx_res_used;
        ntp->t_pflags = tp->t_pflags;
  
-       XFS_TRANS_DUP_DQINFO(tp->t_mountp, tp, ntp);
+       xfs_trans_dup_dqinfo(tp, ntp);
  
        atomic_inc(&tp->t_mountp->m_active_trans);
        return ntp;
@@@ -628,6 -628,8 +628,6 @@@ xfs_trans_apply_sb_deltas
                xfs_trans_log_buf(tp, bp, offsetof(xfs_dsb_t, sb_icount),
                                  offsetof(xfs_dsb_t, sb_frextents) +
                                  sizeof(sbp->sb_frextents) - 1);
 -
 -      tp->t_mountp->m_super->s_dirt = 1;
  }
  
  /*
@@@ -829,7 -831,7 +829,7 @@@ shut_us_down
                 * means is that we have some (non-persistent) quota
                 * reservations that need to be unreserved.
                 */
-               XFS_TRANS_UNRESERVE_AND_MOD_DQUOTS(mp, tp);
+               xfs_trans_unreserve_and_mod_dquots(tp);
                if (tp->t_ticket) {
                        commit_lsn = xfs_log_done(mp, tp->t_ticket,
                                                        NULL, log_flags);
        /*
         * If we need to update the superblock, then do it now.
         */
-       if (tp->t_flags & XFS_TRANS_SB_DIRTY) {
+       if (tp->t_flags & XFS_TRANS_SB_DIRTY)
                xfs_trans_apply_sb_deltas(tp);
-       }
-       XFS_TRANS_APPLY_DQUOT_DELTAS(mp, tp);
+       xfs_trans_apply_dquot_deltas(tp);
  
        /*
         * Ask each log item how many log_vector entries it will
@@@ -1056,7 -1057,7 +1055,7 @@@ xfs_trans_uncommit
        }
  
        xfs_trans_unreserve_and_mod_sb(tp);
-       XFS_TRANS_UNRESERVE_AND_MOD_DQUOTS(tp->t_mountp, tp);
+       xfs_trans_unreserve_and_mod_dquots(tp);
  
        xfs_trans_free_items(tp, flags);
        xfs_trans_free_busy(tp);
@@@ -1181,7 -1182,7 +1180,7 @@@ xfs_trans_cancel
        }
  #endif
        xfs_trans_unreserve_and_mod_sb(tp);
-       XFS_TRANS_UNRESERVE_AND_MOD_DQUOTS(mp, tp);
+       xfs_trans_unreserve_and_mod_dquots(tp);
  
        if (tp->t_ticket) {
                if (flags & XFS_TRANS_RELEASE_LOG_RES) {
@@@ -1211,7 -1212,7 +1210,7 @@@ xfs_trans_free
        xfs_trans_t     *tp)
  {
        atomic_dec(&tp->t_mountp->m_active_trans);
-       XFS_TRANS_FREE_DQINFO(tp->t_mountp, tp);
+       xfs_trans_free_dqinfo(tp);
        kmem_zone_free(xfs_trans_zone, tp);
  }