]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux...
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 7 Aug 2010 19:57:07 +0000 (12:57 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 7 Aug 2010 19:57:07 +0000 (12:57 -0700)
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6:
  ext3: Fix dirtying of journalled buffers in data=journal mode
  ext3: default to ordered mode
  quota: Use mark_inode_dirty_sync instead of mark_inode_dirty
  quota: Change quota error message to print out disk and function name
  MAINTAINERS: Update entries of ext2 and ext3
  MAINTAINERS: Update address of Andreas Dilger
  ext3: Avoid filesystem corruption after a crash under heavy delete load
  ext3: remove vestiges of nobh support
  ext3: Fix set but unused variables
  quota: clean up quota active checks
  quota: Clean up the namespace in dqblk_xfs.h
  quota: check quota reservation on remove_dquot_ref

1  2 
MAINTAINERS
fs/gfs2/quota.c
fs/quota/dquot.c
fs/xfs/linux-2.6/xfs_quotaops.c
fs/xfs/quota/xfs_qm_syscalls.c

diff --combined MAINTAINERS
index 100a3f535c9f579be993d6833b1a5939cc158b91,e04e9d62b7666fef1893b7e4d0e12a8aea97aeab..1349d1cb5aca49570271e3eb2dd77df8a9902f4c
@@@ -313,9 -313,11 +313,9 @@@ S:        Maintaine
  F:    drivers/hwmon/adm1029.c
  
  ADM8211 WIRELESS DRIVER
 -M:    Michael Wu <flamingice@sourmilk.net>
  L:    linux-wireless@vger.kernel.org
  W:    http://linuxwireless.org/
 -T:    git git://git.kernel.org/pub/scm/linux/kernel/git/mwu/mac80211-drivers.git
 -S:    Maintained
 +S:    Orphan
  F:    drivers/net/wireless/adm8211.*
  
  ADT746X FAN DRIVER
@@@ -1367,7 -1369,7 +1367,7 @@@ BROADCOM BNX2X 10 GIGABIT ETHERNET DRIV
  M:    Eilon Greenstein <eilong@broadcom.com>
  L:    netdev@vger.kernel.org
  S:    Supported
 -F:    drivers/net/bnx2x*
 +F:    drivers/net/bnx2x/
  
  BROADCOM TG3 GIGABIT ETHERNET DRIVER
  M:    Matt Carlson <mcarlson@broadcom.com>
@@@ -1569,16 -1571,6 +1569,16 @@@ L:    platform-driver-x86@vger.kernel.or
  S:    Supported
  F:    drivers/platform/x86/classmate-laptop.c
  
 +COCCINELLE/Semantic Patches (SmPL)
 +M:    Julia Lawall <julia@diku.dk>
 +M:    Gilles Muller <Gilles.Muller@lip6.fr>
 +M:    Nicolas Palix <npalix@diku.dk>
 +L:    cocci@diku.dk (moderated for non-subscribers)
 +W:    http://coccinelle.lip6.fr/
 +S:    Supported
 +F:    scripts/coccinelle/
 +F:    scripts/coccicheck
 +
  CODA FILE SYSTEM
  M:    Jan Harkes <jaharkes@cs.cmu.edu>
  M:    coda@cs.cmu.edu
@@@ -1779,13 -1771,6 +1779,13 @@@ W:    http://www.openfabrics.or
  S:    Supported
  F:    drivers/infiniband/hw/cxgb4/
  
 +CXGB4VF ETHERNET DRIVER (CXGB4VF)
 +M:    Casey Leedom <leedom@chelsio.com>
 +L:    netdev@vger.kernel.org
 +W:    http://www.chelsio.com
 +S:    Supported
 +F:    drivers/net/cxgb4vf/
 +
  CYBERPRO FB DRIVER
  M:    Russell King <linux@arm.linux.org.uk>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
@@@ -2237,6 -2222,7 +2237,7 @@@ S:      Maintaine
  F:    drivers/net/eth16i.c
  
  EXT2 FILE SYSTEM
+ M:    Jan Kara <jack@suse.cz>
  L:    linux-ext4@vger.kernel.org
  S:    Maintained
  F:    Documentation/filesystems/ext2.txt
@@@ -2244,8 -2230,9 +2245,9 @@@ F:      fs/ext2
  F:    include/linux/ext2*
  
  EXT3 FILE SYSTEM
+ M:    Jan Kara <jack@suse.cz>
  M:    Andrew Morton <akpm@linux-foundation.org>
- M:    Andreas Dilger <adilger@sun.com>
+ M:    Andreas Dilger <adilger.kernel@dilger.ca>
  L:    linux-ext4@vger.kernel.org
  S:    Maintained
  F:    Documentation/filesystems/ext3.txt
@@@ -2254,7 -2241,7 +2256,7 @@@ F:      include/linux/ext3
  
  EXT4 FILE SYSTEM
  M:    "Theodore Ts'o" <tytso@mit.edu>
- M:    Andreas Dilger <adilger@sun.com>
+ M:    Andreas Dilger <adilger.kernel@dilger.ca>
  L:    linux-ext4@vger.kernel.org
  W:    http://ext4.wiki.kernel.org
  Q:    http://patchwork.ozlabs.org/project/linux-ext4/list/
@@@ -2635,14 -2622,6 +2637,14 @@@ S:    Maintaine
  F:    Documentation/blockdev/cpqarray.txt
  F:    drivers/block/cpqarray.*
  
 +HEWLETT-PACKARD SMART ARRAY RAID DRIVER (hpsa)
 +M:    Stephen M. Cameron <scameron@beardog.cce.hp.com>
 +L:    iss_storagedev@hp.com
 +S:    Supported
 +F:    Documentation/scsi/hpsa.txt
 +F:    drivers/scsi/hpsa*.[ch]
 +F:    include/linux/cciss*.h
 +
  HEWLETT-PACKARD SMART CISS RAID DRIVER (cciss)
  M:    Mike Miller <mike.miller@hp.com>
  L:    iss_storagedev@hp.com
@@@ -3276,8 -3255,8 +3278,8 @@@ F:      fs/autofs4
  
  KERNEL BUILD + files below scripts/ (unless maintained elsewhere)
  M:    Michal Marek <mmarek@suse.cz>
 -T:    git git://repo.or.cz/linux-kbuild.git for-next
 -T:    git git://repo.or.cz/linux-kbuild.git for-linus
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6.git for-next
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6.git rc-fixes
  L:    linux-kbuild@vger.kernel.org
  S:    Maintained
  F:    Documentation/kbuild/
@@@ -3403,6 -3382,13 +3405,6 @@@ F:     include/linux/kmemleak.
  F:    mm/kmemleak.c
  F:    mm/kmemleak-test.c
  
 -KMEMTRACE
 -M:    Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
 -S:    Maintained
 -F:    Documentation/trace/kmemtrace.txt
 -F:    include/linux/kmemtrace.h
 -F:    kernel/trace/kmemtrace.c
 -
  KPROBES
  M:    Ananth N Mavinakayanahalli <ananth@in.ibm.com>
  M:    Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
@@@ -3702,7 -3688,7 +3704,7 @@@ F:      include/linux/mv643xx.
  MARVELL MWL8K WIRELESS DRIVER
  M:    Lennert Buytenhek <buytenh@wantstofly.org>
  L:    linux-wireless@vger.kernel.org
 -S:    Maintained
 +S:    Odd Fixes
  F:    drivers/net/wireless/mwl8k.c
  
  MARVELL SOC MMC/SD/SDIO CONTROLLER DRIVER
@@@ -3931,19 -3917,17 +3933,19 @@@ L:   netem@lists.linux-foundation.or
  S:    Maintained
  F:    net/sched/sch_netem.c
  
 -NETERION (S2IO) 10GbE DRIVER (xframe/vxge)
 -M:    Ramkrishna Vepa <ram.vepa@neterion.com>
 -M:    Rastapur Santosh <santosh.rastapur@neterion.com>
 -M:    Sivakumar Subramani <sivakumar.subramani@neterion.com>
 -M:    Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
 +NETERION 10GbE DRIVERS (s2io/vxge)
 +M:    Ramkrishna Vepa <ramkrishna.vepa@exar.com>
 +M:    Sivakumar Subramani <sivakumar.subramani@exar.com>
 +M:    Sreenivasa Honnur <sreenivasa.honnur@exar.com>
 +M:    Jon Mason <jon.mason@exar.com>
  L:    netdev@vger.kernel.org
  W:    http://trac.neterion.com/cgi-bin/trac.cgi/wiki/Linux?Anonymous
  W:    http://trac.neterion.com/cgi-bin/trac.cgi/wiki/X3100Linux?Anonymous
  S:    Supported
  F:    Documentation/networking/s2io.txt
  F:    drivers/net/s2io*
 +F:    Documentation/networking/vxge.txt
 +F:    drivers/net/vxge/
  
  NETFILTER/IPTABLES/IPCHAINS
  P:    Rusty Russell
@@@ -4290,9 -4274,10 +4292,9 @@@ F:     include/scsi/osd_
  F:    fs/exofs/
  
  P54 WIRELESS DRIVER
 -M:    Michael Wu <flamingice@sourmilk.net>
 +M:    Christian Lamparter <chunkeey@googlemail.com>
  L:    linux-wireless@vger.kernel.org
 -W:    http://prism54.org
 -T:    git git://git.kernel.org/pub/scm/linux/kernel/git/mwu/mac80211-drivers.git
 +W:    http://wireless.kernel.org/en/users/Drivers/p54
  S:    Maintained
  F:    drivers/net/wireless/p54/
  
@@@ -4554,7 -4539,7 +4556,7 @@@ PRISM54 WIRELESS DRIVE
  M:    "Luis R. Rodriguez" <mcgrof@gmail.com>
  L:    linux-wireless@vger.kernel.org
  W:    http://prism54.org
 -S:    Maintained
 +S:    Obsolete
  F:    drivers/net/wireless/prism54/
  
  PROMISE DC4030 CACHING DISK CONTROLLER DRIVER
@@@ -4734,7 -4719,7 +4736,7 @@@ T:      git git://git.kernel.org/pub/scm/lin
  F:    drivers/net/wireless/rt2x00/
  
  RAMDISK RAM BLOCK DEVICE DRIVER
 -M:    Nick Piggin <npiggin@suse.de>
 +M:    Nick Piggin <npiggin@kernel.dk>
  S:    Maintained
  F:    Documentation/blockdev/ramdisk.txt
  F:    drivers/block/brd.c
@@@ -4750,8 -4735,9 +4752,8 @@@ S:      Maintaine
  F:    drivers/rapidio/
  
  RAYLINK/WEBGEAR 802.11 WIRELESS LAN DRIVER
 -M:    Corey Thomas <coreythomas@charter.net>
  L:    linux-wireless@vger.kernel.org
 -S:    Maintained
 +S:    Orphan
  F:    drivers/net/wireless/ray*
  
  RCUTORTURE MODULE
@@@ -5077,14 -5063,6 +5079,14 @@@ S:    Supporte
  F:    include/linux/selinux*
  F:    security/selinux/
  
 +APPARMOR SECURITY MODULE
 +M:    John Johansen <john.johansen@canonical.com>
 +L:    apparmor@lists.ubuntu.com (subscribers-only, general discussion)
 +W:    apparmor.wiki.kernel.org
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/jj/apparmor-dev.git
 +S:    Supported
 +F:    security/apparmor/
 +
  SENSABLE PHANTOM
  M:    Jiri Slaby <jirislaby@gmail.com>
  S:    Maintained
@@@ -5360,7 -5338,6 +5362,7 @@@ T:      git git://git.kernel.org/pub/scm/lin
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next-2.6.git
  S:    Maintained
  F:    arch/sparc/
 +F:    drivers/sbus/
  
  SPARC SERIAL DRIVERS
  M:    "David S. Miller" <davem@davemloft.net>
@@@ -5629,7 -5606,7 +5631,7 @@@ L:      tomoyo-users-en@lists.sourceforge.j
  L:    tomoyo-dev@lists.sourceforge.jp (subscribers-only, for developers in Japanese)
  L:    tomoyo-users@lists.sourceforge.jp (subscribers-only, for users in Japanese)
  W:    http://tomoyo.sourceforge.jp/
 -T:    quilt http://svn.sourceforge.jp/svnroot/tomoyo/trunk/2.2.x/tomoyo-lsm/patches/
 +T:    quilt http://svn.sourceforge.jp/svnroot/tomoyo/trunk/2.3.x/tomoyo-lsm/patches/
  S:    Maintained
  F:    security/tomoyo/
  
@@@ -5678,7 -5655,7 +5680,7 @@@ TRACIN
  M:    Steven Rostedt <rostedt@goodmis.org>
  M:    Frederic Weisbecker <fweisbec@gmail.com>
  M:    Ingo Molnar <mingo@redhat.com>
 -T:    git git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git tracing/core
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git perf/core
  S:    Maintained
  F:    Documentation/trace/ftrace.txt
  F:    arch/*/*/*/ftrace.h
@@@ -6084,9 -6061,10 +6086,9 @@@ F:     Documentation/video4linux/zc0301.tx
  F:    drivers/media/video/zc0301/
  
  USB ZD1201 DRIVER
 -M:    Jeroen Vreeken <pe1rxq@amsat.org>
 -L:    linux-usb@vger.kernel.org
 +L:    linux-wireless@vger.kernel.org
  W:    http://linux-lc100020.sourceforge.net
 -S:    Maintained
 +S:    Orphan
  F:    drivers/net/wireless/zd1201.*
  
  USB ZR364XX DRIVER
@@@ -6266,14 -6244,20 +6268,14 @@@ F:   drivers/mmc/host/wbsd.
  
  WATCHDOG DEVICE DRIVERS
  M:    Wim Van Sebroeck <wim@iguana.be>
 +L:    linux-watchdog@vger.kernel.org
 +W:    http://www.linux-watchdog.org/
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog.git
  S:    Maintained
  F:    Documentation/watchdog/
  F:    drivers/watchdog/
  F:    include/linux/watchdog.h
  
 -WAVELAN NETWORK DRIVER & WIRELESS EXTENSIONS
 -M:    Jean Tourrilhes <jt@hpl.hp.com>
 -L:    linux-wireless@vger.kernel.org
 -W:    http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/
 -S:    Maintained
 -F:    Documentation/networking/wavelan.txt
 -F:    drivers/staging/wavelan/
 -
  WD7000 SCSI DRIVER
  M:    Miroslav Zagorac <zaga@fly.cc.fer.hr>
  L:    linux-scsi@vger.kernel.org
diff --combined fs/gfs2/quota.c
index 8bb643cb2658615cf7c00e7083850c619953875a,ce345f8c69c24472d93bf1b9020a22e5fd3f9130..1bc6b5695e6dfb34870810b87bd09c819f25c93f
@@@ -77,7 -77,7 +77,7 @@@ static LIST_HEAD(qd_lru_list)
  static atomic_t qd_lru_count = ATOMIC_INIT(0);
  static DEFINE_SPINLOCK(qd_lru_lock);
  
 -int gfs2_shrink_qd_memory(int nr, gfp_t gfp_mask)
 +int gfs2_shrink_qd_memory(struct shrinker *shrink, int nr, gfp_t gfp_mask)
  {
        struct gfs2_quota_data *qd;
        struct gfs2_sbd *sdp;
@@@ -787,9 -787,15 +787,9 @@@ static int do_sync(unsigned int num_qd
                goto out;
  
        for (x = 0; x < num_qd; x++) {
 -              int alloc_required;
 -
                offset = qd2offset(qda[x]);
 -              error = gfs2_write_alloc_required(ip, offset,
 -                                                sizeof(struct gfs2_quota),
 -                                                &alloc_required);
 -              if (error)
 -                      goto out_gunlock;
 -              if (alloc_required)
 +              if (gfs2_write_alloc_required(ip, offset,
 +                                            sizeof(struct gfs2_quota)))
                        nalloc++;
        }
  
@@@ -1449,10 -1455,10 +1449,10 @@@ static int gfs2_quota_get_xstate(struc
  
        switch (sdp->sd_args.ar_quota) {
        case GFS2_QUOTA_ON:
-               fqs->qs_flags |= (XFS_QUOTA_UDQ_ENFD | XFS_QUOTA_GDQ_ENFD);
+               fqs->qs_flags |= (FS_QUOTA_UDQ_ENFD | FS_QUOTA_GDQ_ENFD);
                /*FALLTHRU*/
        case GFS2_QUOTA_ACCOUNT:
-               fqs->qs_flags |= (XFS_QUOTA_UDQ_ACCT | XFS_QUOTA_GDQ_ACCT);
+               fqs->qs_flags |= (FS_QUOTA_UDQ_ACCT | FS_QUOTA_GDQ_ACCT);
                break;
        case GFS2_QUOTA_OFF:
                break;
@@@ -1498,7 -1504,7 +1498,7 @@@ static int gfs2_get_dqblk(struct super_
  
        qlvb = (struct gfs2_quota_lvb *)qd->qd_gl->gl_lvb;
        fdq->d_version = FS_DQUOT_VERSION;
-       fdq->d_flags = (type == QUOTA_USER) ? XFS_USER_QUOTA : XFS_GROUP_QUOTA;
+       fdq->d_flags = (type == QUOTA_USER) ? FS_USER_QUOTA : FS_GROUP_QUOTA;
        fdq->d_id = id;
        fdq->d_blk_hardlimit = be64_to_cpu(qlvb->qb_limit);
        fdq->d_blk_softlimit = be64_to_cpu(qlvb->qb_warn);
@@@ -1533,12 -1539,12 +1533,12 @@@ static int gfs2_set_dqblk(struct super_
        switch(type) {
        case USRQUOTA:
                type = QUOTA_USER;
-               if (fdq->d_flags != XFS_USER_QUOTA)
+               if (fdq->d_flags != FS_USER_QUOTA)
                        return -EINVAL;
                break;
        case GRPQUOTA:
                type = QUOTA_GROUP;
-               if (fdq->d_flags != XFS_GROUP_QUOTA)
+               if (fdq->d_flags != FS_GROUP_QUOTA)
                        return -EINVAL;
                break;
        default:
                goto out_i;
  
        offset = qd2offset(qd);
 -      error = gfs2_write_alloc_required(ip, offset, sizeof(struct gfs2_quota),
 -                                        &alloc_required);
 -      if (error)
 -              goto out_i;
 +      alloc_required = gfs2_write_alloc_required(ip, offset, sizeof(struct gfs2_quota));
        if (alloc_required) {
                al = gfs2_alloc_get(ip);
                if (al == NULL)
diff --combined fs/quota/dquot.c
index 437d2ca2de973d1027109b038e895e31a68b3a63,a7023bcfae4f8c78340f5e00d4bb17857b062a0c..ef72b1699429e856f711504cf7c818642926483a
@@@ -132,6 -132,22 +132,22 @@@ static __cacheline_aligned_in_smp DEFIN
  __cacheline_aligned_in_smp DEFINE_SPINLOCK(dq_data_lock);
  EXPORT_SYMBOL(dq_data_lock);
  
+ void __quota_error(struct super_block *sb, const char *func,
+                 const char *fmt, ...)
+ {
+       va_list args;
+       if (printk_ratelimit()) {
+               va_start(args, fmt);
+               printk(KERN_ERR "Quota error (device %s): %s: ",
+                      sb->s_id, func);
+               vprintk(fmt, args);
+               printk("\n");
+               va_end(args);
+       }
+ }
+ EXPORT_SYMBOL(__quota_error);
  #if defined(CONFIG_QUOTA_DEBUG) || defined(CONFIG_PRINT_QUOTA_WARNING)
  static char *quotatypes[] = INITQFNAMES;
  #endif
@@@ -676,7 -692,7 +692,7 @@@ static void prune_dqcache(int count
   * This is called from kswapd when we think we need some
   * more memory
   */
 -static int shrink_dqcache_memory(int nr, gfp_t gfp_mask)
 +static int shrink_dqcache_memory(struct shrinker *shrink, int nr, gfp_t gfp_mask)
  {
        if (nr) {
                spin_lock(&dq_list_lock);
@@@ -705,11 -721,8 +721,8 @@@ void dqput(struct dquot *dquot
                return;
  #ifdef CONFIG_QUOTA_DEBUG
        if (!atomic_read(&dquot->dq_count)) {
-               printk("VFS: dqput: trying to free free dquot\n");
-               printk("VFS: device %s, dquot of %s %d\n",
-                       dquot->dq_sb->s_id,
-                       quotatypes[dquot->dq_type],
-                       dquot->dq_id);
+               quota_error(dquot->dq_sb, "trying to free free dquot of %s %d",
+                           quotatypes[dquot->dq_type], dquot->dq_id);
                BUG();
        }
  #endif
@@@ -732,9 -745,9 +745,9 @@@ we_slept
                /* Commit dquot before releasing */
                ret = dquot->dq_sb->dq_op->write_dquot(dquot);
                if (ret < 0) {
-                       printk(KERN_ERR "VFS: cannot write quota structure on "
-                               "device %s (error %d). Quota may get out of "
-                               "sync!\n", dquot->dq_sb->s_id, ret);
+                       quota_error(dquot->dq_sb, "Can't write quota structure"
+                                   " (error %d). Quota may get out of sync!",
+                                   ret);
                        /*
                         * We clear dirty bit anyway, so that we avoid
                         * infinite loop here
@@@ -914,9 -927,9 +927,9 @@@ static void add_dquot_ref(struct super_
  
  #ifdef CONFIG_QUOTA_DEBUG
        if (reserved) {
-               printk(KERN_WARNING "VFS (%s): Writes happened before quota"
-                       " was turned on thus quota information is probably "
-                       "inconsistent. Please run quotacheck(8).\n", sb->s_id);
+               quota_error(sb, "Writes happened before quota was turned on "
+                       "thus quota information is probably inconsistent. "
+                       "Please run quotacheck(8)");
        }
  #endif
  }
@@@ -947,7 -960,9 +960,9 @@@ static int remove_inode_dquot_ref(struc
                if (dqput_blocks(dquot)) {
  #ifdef CONFIG_QUOTA_DEBUG
                        if (atomic_read(&dquot->dq_count) != 1)
-                               printk(KERN_WARNING "VFS: Adding dquot with dq_count %d to dispose list.\n", atomic_read(&dquot->dq_count));
+                               quota_error(inode->i_sb, "Adding dquot with "
+                                           "dq_count %d to dispose list",
+                                           atomic_read(&dquot->dq_count));
  #endif
                        spin_lock(&dq_list_lock);
                        /* As dquot must have currently users it can't be on
@@@ -986,6 -1001,7 +1001,7 @@@ static void remove_dquot_ref(struct sup
                struct list_head *tofree_head)
  {
        struct inode *inode;
+       int reserved = 0;
  
        spin_lock(&inode_lock);
        list_for_each_entry(inode, &sb->s_inodes, i_sb_list) {
                 *  only quota pointers and these have separate locking
                 *  (dqptr_sem).
                 */
-               if (!IS_NOQUOTA(inode))
+               if (!IS_NOQUOTA(inode)) {
+                       if (unlikely(inode_get_rsv_space(inode) > 0))
+                               reserved = 1;
                        remove_inode_dquot_ref(inode, type, tofree_head);
+               }
        }
        spin_unlock(&inode_lock);
+ #ifdef CONFIG_QUOTA_DEBUG
+       if (reserved) {
+               printk(KERN_WARNING "VFS (%s): Writes happened after quota"
+                       " was disabled thus quota information is probably "
+                       "inconsistent. Please run quotacheck(8).\n", sb->s_id);
+       }
+ #endif
  }
  
  /* Gather all references from inodes and drop them */
@@@ -1304,6 -1330,15 +1330,15 @@@ static int info_bdq_free(struct dquot *
        return QUOTA_NL_NOWARN;
  }
  
+ static int dquot_active(const struct inode *inode)
+ {
+       struct super_block *sb = inode->i_sb;
+       if (IS_NOQUOTA(inode))
+               return 0;
+       return sb_any_quota_loaded(sb) & ~sb_any_quota_suspended(sb);
+ }
  /*
   * Initialize quota pointers in inode
   *
@@@ -1323,7 -1358,7 +1358,7 @@@ static void __dquot_initialize(struct i
  
        /* First test before acquiring mutex - solves deadlocks when we
           * re-enter the quota code and are already holding the mutex */
-       if (!sb_any_quota_active(inode->i_sb) || IS_NOQUOTA(inode))
+       if (!dquot_active(inode))
                return;
  
        /* First get references to structures we might need. */
@@@ -1507,7 -1542,7 +1542,7 @@@ int __dquot_alloc_space(struct inode *i
         * First test before acquiring mutex - solves deadlocks when we
         * re-enter the quota code and are already holding the mutex
         */
-       if (!sb_any_quota_active(inode->i_sb) || IS_NOQUOTA(inode)) {
+       if (!dquot_active(inode)) {
                inode_incr_space(inode, number, reserve);
                goto out;
        }
@@@ -1559,7 -1594,7 +1594,7 @@@ int dquot_alloc_inode(const struct inod
  
        /* First test before acquiring mutex - solves deadlocks when we
           * re-enter the quota code and are already holding the mutex */
-       if (!sb_any_quota_active(inode->i_sb) || IS_NOQUOTA(inode))
+       if (!dquot_active(inode))
                return 0;
        for (cnt = 0; cnt < MAXQUOTAS; cnt++)
                warntype[cnt] = QUOTA_NL_NOWARN;
@@@ -1596,7 -1631,7 +1631,7 @@@ int dquot_claim_space_nodirty(struct in
  {
        int cnt;
  
-       if (!sb_any_quota_active(inode->i_sb) || IS_NOQUOTA(inode)) {
+       if (!dquot_active(inode)) {
                inode_claim_rsv_space(inode, number);
                return 0;
        }
@@@ -1629,7 -1664,7 +1664,7 @@@ void __dquot_free_space(struct inode *i
  
        /* First test before acquiring mutex - solves deadlocks when we
           * re-enter the quota code and are already holding the mutex */
-       if (!sb_any_quota_active(inode->i_sb) || IS_NOQUOTA(inode)) {
+       if (!dquot_active(inode)) {
                inode_decr_space(inode, number, reserve);
                return;
        }
@@@ -1667,7 -1702,7 +1702,7 @@@ void dquot_free_inode(const struct inod
  
        /* First test before acquiring mutex - solves deadlocks when we
           * re-enter the quota code and are already holding the mutex */
-       if (!sb_any_quota_active(inode->i_sb) || IS_NOQUOTA(inode))
+       if (!dquot_active(inode))
                return;
  
        down_read(&sb_dqopt(inode->i_sb)->dqptr_sem);
@@@ -1790,7 -1825,7 +1825,7 @@@ int dquot_transfer(struct inode *inode
        struct super_block *sb = inode->i_sb;
        int ret;
  
-       if (!sb_any_quota_active(sb) || IS_NOQUOTA(inode))
+       if (!dquot_active(inode))
                return 0;
  
        if (iattr->ia_valid & ATTR_UID && iattr->ia_uid != inode->i_uid)
@@@ -1957,7 -1992,7 +1992,7 @@@ int dquot_disable(struct super_block *s
                                truncate_inode_pages(&toputinode[cnt]->i_data,
                                                     0);
                                mutex_unlock(&toputinode[cnt]->i_mutex);
-                               mark_inode_dirty(toputinode[cnt]);
+                               mark_inode_dirty_sync(toputinode[cnt]);
                        }
                        mutex_unlock(&dqopt->dqonoff_mutex);
                }
@@@ -2270,7 -2305,7 +2305,7 @@@ static void do_get_dqblk(struct dquot *
        memset(di, 0, sizeof(*di));
        di->d_version = FS_DQUOT_VERSION;
        di->d_flags = dquot->dq_type == USRQUOTA ?
-                       XFS_USER_QUOTA : XFS_GROUP_QUOTA;
+                       FS_USER_QUOTA : FS_GROUP_QUOTA;
        di->d_id = dquot->dq_id;
  
        spin_lock(&dq_data_lock);
index bfd5ac9d1f6f774c49a58588ecc3d6f881bb04aa,b9ba7536f4b43a47cfd289c1228844df449810b6..29b9d642e93d08123ddf1db5a01e1edddd1ee17b
@@@ -16,6 -16,7 +16,6 @@@
   * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
   */
  #include "xfs.h"
 -#include "xfs_dmapi.h"
  #include "xfs_sb.h"
  #include "xfs_inum.h"
  #include "xfs_log.h"
@@@ -68,15 -69,15 +68,15 @@@ xfs_fs_set_xstate
        if (op != Q_XQUOTARM && !XFS_IS_QUOTA_RUNNING(mp))
                return -ENOSYS;
  
-       if (uflags & XFS_QUOTA_UDQ_ACCT)
+       if (uflags & FS_QUOTA_UDQ_ACCT)
                flags |= XFS_UQUOTA_ACCT;
-       if (uflags & XFS_QUOTA_PDQ_ACCT)
+       if (uflags & FS_QUOTA_PDQ_ACCT)
                flags |= XFS_PQUOTA_ACCT;
-       if (uflags & XFS_QUOTA_GDQ_ACCT)
+       if (uflags & FS_QUOTA_GDQ_ACCT)
                flags |= XFS_GQUOTA_ACCT;
-       if (uflags & XFS_QUOTA_UDQ_ENFD)
+       if (uflags & FS_QUOTA_UDQ_ENFD)
                flags |= XFS_UQUOTA_ENFD;
-       if (uflags & (XFS_QUOTA_PDQ_ENFD|XFS_QUOTA_GDQ_ENFD))
+       if (uflags & (FS_QUOTA_PDQ_ENFD|FS_QUOTA_GDQ_ENFD))
                flags |= XFS_OQUOTA_ENFD;
  
        switch (op) {
index d257eb8557c43a873644ea6481ec5611b9a0051f,41b04b96975b27a0b48fae6d826b077a9496b8a8..45e5849df238c1b80f6ea19b438f065f1c185d79
  #include "xfs_trans.h"
  #include "xfs_sb.h"
  #include "xfs_ag.h"
 -#include "xfs_dir2.h"
  #include "xfs_alloc.h"
 -#include "xfs_dmapi.h"
  #include "xfs_quota.h"
  #include "xfs_mount.h"
  #include "xfs_bmap_btree.h"
 -#include "xfs_alloc_btree.h"
 -#include "xfs_ialloc_btree.h"
 -#include "xfs_dir2_sf.h"
 -#include "xfs_attr_sf.h"
 -#include "xfs_dinode.h"
  #include "xfs_inode.h"
 -#include "xfs_ialloc.h"
  #include "xfs_itable.h"
  #include "xfs_bmap.h"
 -#include "xfs_btree.h"
  #include "xfs_rtalloc.h"
  #include "xfs_error.h"
 -#include "xfs_rw.h"
  #include "xfs_attr.h"
  #include "xfs_buf_item.h"
  #include "xfs_utils.h"
@@@ -238,74 -248,40 +238,74 @@@ out_unlock
        return error;
  }
  
 +STATIC int
 +xfs_qm_scall_trunc_qfile(
 +      struct xfs_mount        *mp,
 +      xfs_ino_t               ino)
 +{
 +      struct xfs_inode        *ip;
 +      struct xfs_trans        *tp;
 +      int                     error;
 +
 +      if (ino == NULLFSINO)
 +              return 0;
 +
 +      error = xfs_iget(mp, NULL, ino, 0, 0, &ip);
 +      if (error)
 +              return error;
 +
 +      xfs_ilock(ip, XFS_IOLOCK_EXCL);
 +
 +      tp = xfs_trans_alloc(mp, XFS_TRANS_TRUNCATE_FILE);
 +      error = xfs_trans_reserve(tp, 0, XFS_ITRUNCATE_LOG_RES(mp), 0,
 +                                XFS_TRANS_PERM_LOG_RES,
 +                                XFS_ITRUNCATE_LOG_COUNT);
 +      if (error) {
 +              xfs_trans_cancel(tp, 0);
 +              xfs_iunlock(ip, XFS_IOLOCK_EXCL);
 +              goto out_put;
 +      }
 +
 +      xfs_ilock(ip, XFS_ILOCK_EXCL);
 +      xfs_trans_ijoin(tp, ip);
 +
 +      error = xfs_itruncate_finish(&tp, ip, 0, XFS_DATA_FORK, 1);
 +      if (error) {
 +              xfs_trans_cancel(tp, XFS_TRANS_RELEASE_LOG_RES |
 +                                   XFS_TRANS_ABORT);
 +              goto out_unlock;
 +      }
 +
 +      xfs_ichgtime(ip, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
 +      error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES);
 +
 +out_unlock:
 +      xfs_iunlock(ip, XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL);
 +out_put:
 +      IRELE(ip);
 +      return error;
 +}
 +
  int
  xfs_qm_scall_trunc_qfiles(
        xfs_mount_t     *mp,
        uint            flags)
  {
        int             error = 0, error2 = 0;
 -      xfs_inode_t     *qip;
  
        if (!xfs_sb_version_hasquota(&mp->m_sb) || flags == 0) {
                qdprintk("qtrunc flags=%x m_qflags=%x\n", flags, mp->m_qflags);
                return XFS_ERROR(EINVAL);
        }
  
 -      if ((flags & XFS_DQ_USER) && mp->m_sb.sb_uquotino != NULLFSINO) {
 -              error = xfs_iget(mp, NULL, mp->m_sb.sb_uquotino, 0, 0, &qip);
 -              if (!error) {
 -                      error = xfs_truncate_file(mp, qip);
 -                      IRELE(qip);
 -              }
 -      }
 -
 -      if ((flags & (XFS_DQ_GROUP|XFS_DQ_PROJ)) &&
 -          mp->m_sb.sb_gquotino != NULLFSINO) {
 -              error2 = xfs_iget(mp, NULL, mp->m_sb.sb_gquotino, 0, 0, &qip);
 -              if (!error2) {
 -                      error2 = xfs_truncate_file(mp, qip);
 -                      IRELE(qip);
 -              }
 -      }
 +      if (flags & XFS_DQ_USER)
 +              error = xfs_qm_scall_trunc_qfile(mp, mp->m_sb.sb_uquotino);
 +      if (flags & (XFS_DQ_GROUP|XFS_DQ_PROJ))
 +              error2 = xfs_qm_scall_trunc_qfile(mp, mp->m_sb.sb_gquotino);
  
        return error ? error : error2;
  }
  
 -
  /*
   * Switch on (a given) quota enforcement for a filesystem.  This takes
   * effect immediately.
@@@ -810,9 -786,9 +810,9 @@@ xfs_qm_export_dquot
        }
  
  #ifdef DEBUG
-       if (((XFS_IS_UQUOTA_ENFORCED(mp) && dst->d_flags == XFS_USER_QUOTA) ||
+       if (((XFS_IS_UQUOTA_ENFORCED(mp) && dst->d_flags == FS_USER_QUOTA) ||
             (XFS_IS_OQUOTA_ENFORCED(mp) &&
-                       (dst->d_flags & (XFS_PROJ_QUOTA | XFS_GROUP_QUOTA)))) &&
+                       (dst->d_flags & (FS_PROJ_QUOTA | FS_GROUP_QUOTA)))) &&
            dst->d_id != 0) {
                if (((int) dst->d_bcount >= (int) dst->d_blk_softlimit) &&
                    (dst->d_blk_softlimit > 0)) {
@@@ -833,17 -809,17 +833,17 @@@ xfs_qm_export_qtype_flags
        /*
         * Can't be more than one, or none.
         */
-       ASSERT((flags & (XFS_PROJ_QUOTA | XFS_USER_QUOTA)) !=
-               (XFS_PROJ_QUOTA | XFS_USER_QUOTA));
-       ASSERT((flags & (XFS_PROJ_QUOTA | XFS_GROUP_QUOTA)) !=
-               (XFS_PROJ_QUOTA | XFS_GROUP_QUOTA));
-       ASSERT((flags & (XFS_USER_QUOTA | XFS_GROUP_QUOTA)) !=
-               (XFS_USER_QUOTA | XFS_GROUP_QUOTA));
-       ASSERT((flags & (XFS_PROJ_QUOTA|XFS_USER_QUOTA|XFS_GROUP_QUOTA)) != 0);
+       ASSERT((flags & (FS_PROJ_QUOTA | FS_USER_QUOTA)) !=
+               (FS_PROJ_QUOTA | FS_USER_QUOTA));
+       ASSERT((flags & (FS_PROJ_QUOTA | FS_GROUP_QUOTA)) !=
+               (FS_PROJ_QUOTA | FS_GROUP_QUOTA));
+       ASSERT((flags & (FS_USER_QUOTA | FS_GROUP_QUOTA)) !=
+               (FS_USER_QUOTA | FS_GROUP_QUOTA));
+       ASSERT((flags & (FS_PROJ_QUOTA|FS_USER_QUOTA|FS_GROUP_QUOTA)) != 0);
  
        return (flags & XFS_DQ_USER) ?
-               XFS_USER_QUOTA : (flags & XFS_DQ_PROJ) ?
-                       XFS_PROJ_QUOTA : XFS_GROUP_QUOTA;
+               FS_USER_QUOTA : (flags & XFS_DQ_PROJ) ?
+                       FS_PROJ_QUOTA : FS_GROUP_QUOTA;
  }
  
  STATIC uint
@@@ -854,16 -830,16 +854,16 @@@ xfs_qm_export_flags
  
        uflags = 0;
        if (flags & XFS_UQUOTA_ACCT)
-               uflags |= XFS_QUOTA_UDQ_ACCT;
+               uflags |= FS_QUOTA_UDQ_ACCT;
        if (flags & XFS_PQUOTA_ACCT)
-               uflags |= XFS_QUOTA_PDQ_ACCT;
+               uflags |= FS_QUOTA_PDQ_ACCT;
        if (flags & XFS_GQUOTA_ACCT)
-               uflags |= XFS_QUOTA_GDQ_ACCT;
+               uflags |= FS_QUOTA_GDQ_ACCT;
        if (flags & XFS_UQUOTA_ENFD)
-               uflags |= XFS_QUOTA_UDQ_ENFD;
+               uflags |= FS_QUOTA_UDQ_ENFD;
        if (flags & (XFS_OQUOTA_ENFD)) {
                uflags |= (flags & XFS_GQUOTA_ACCT) ?
-                       XFS_QUOTA_GDQ_ENFD : XFS_QUOTA_PDQ_ENFD;
+                       FS_QUOTA_GDQ_ENFD : FS_QUOTA_PDQ_ENFD;
        }
        return (uflags);
  }
@@@ -899,9 -875,8 +899,9 @@@ xfs_dqrele_inode
                xfs_qm_dqrele(ip->i_gdquot);
                ip->i_gdquot = NULL;
        }
 -      xfs_iput(ip, XFS_ILOCK_EXCL);
 +      xfs_iunlock(ip, XFS_ILOCK_EXCL);
  
 +      IRELE(ip);
        return 0;
  }
  
@@@ -1168,8 -1143,7 +1168,8 @@@ xfs_qm_internalqcheck_adjust
         * of those now.
         */
        if (! ipreleased) {
 -              xfs_iput(ip, lock_flags);
 +              xfs_iunlock(ip, lock_flags);
 +              IRELE(ip);
                ipreleased = B_TRUE;
                goto again;
        }
                ASSERT(gd);
                xfs_qm_internalqcheck_dqadjust(ip, gd);
        }
 -      xfs_iput(ip, lock_flags);
 +      xfs_iunlock(ip, lock_flags);
 +      IRELE(ip);
        *res = BULKSTAT_RV_DIDONE;
        return (0);
  }