linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: jack@suse.cz
Cc: swhiteho@redhat.com, linux-fsdevel@vger.kernel.org, xfs@oss.sgi.com
Subject: [PATCH 07/10] quota: remove invalid optimization from quota_sync_all
Date: Tue, 16 Feb 2010 03:44:53 -0500	[thread overview]
Message-ID: <20100216084652.167390973@bombadil.infradead.org> (raw)
In-Reply-To: 20100216084446.377980079@bombadil.infradead.org

[-- Attachment #1: make-quota_sync_all-generic --]
[-- Type: text/plain, Size: 1311 bytes --]

Checking the "VFS" quota enabled and dirty bits from generic code means
this code will never get called for other implementations, e.g. XFS and
GFS2.  Grabbing the reference on the superblock really isn't much overhead
for a global Q_SYNC call, so just drop this optimization.

Signed-off-by: Christoph Hellwig <hch@lst.de>

Index: linux-2.6/fs/quota/quota.c
===================================================================
--- linux-2.6.orig/fs/quota/quota.c	2010-02-16 00:24:14.432004170 +0100
+++ linux-2.6/fs/quota/quota.c	2010-02-16 00:24:58.589255532 +0100
@@ -51,7 +51,6 @@ static int check_quotactl_permission(str
 static int quota_sync_all(int type)
 {
 	struct super_block *sb;
-	int cnt;
 	int ret;
 
 	if (type >= MAXQUOTAS)
@@ -66,20 +65,6 @@ restart:
 		if (!sb->s_qcop || !sb->s_qcop->quota_sync)
 			continue;
 
-		/* This test just improves performance so it needn't be
-		 * reliable... */
-		for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
-			if (type != -1 && type != cnt)
-				continue;
-			if (!sb_has_quota_active(sb, cnt))
-				continue;
-			if (!info_dirty(&sb_dqopt(sb)->info[cnt]) &&
-			   list_empty(&sb_dqopt(sb)->info[cnt].dqi_dirty_list))
-				continue;
-			break;
-		}
-		if (cnt == MAXQUOTAS)
-			continue;
 		sb->s_count++;
 		spin_unlock(&sb_lock);
 		down_read(&sb->s_umount);


  parent reply	other threads:[~2010-02-16  8:46 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-16  8:44 [PATCH 00/10] quotactl fixed and cleanups Christoph Hellwig
2010-02-16  8:44 ` [PATCH 01/10] quota: split do_quotactl Christoph Hellwig
2010-02-16  8:44 ` [PATCH 02/10] quota: clean up checks for supported quota methods Christoph Hellwig
2010-02-16  8:44 ` [PATCH 03/10] quota: special case Q_SYNC without device name Christoph Hellwig
2010-02-16  8:44 ` [PATCH 04/10] quota: simplify permission checking Christoph Hellwig
2010-02-16  8:44 ` [PATCH 05/10] quota: clean up Q_XQUOTASYNC Christoph Hellwig
2010-02-16  8:44 ` [PATCH 06/10] quota: move code from sync_quota_sb into vfs_quota_sync Christoph Hellwig
2010-02-16  8:44 ` Christoph Hellwig [this message]
2010-02-16  8:44 ` [PATCH 08/10] quota: split out netlink notification support from quota.c Christoph Hellwig
2010-02-16  8:44 ` [PATCH 09/10] quota: split out compat_sys_quotactl " Christoph Hellwig
2010-02-16  8:44 ` [PATCH 10/10] quota: drop permission checks from xfs_fs_set_xstate/xfs_fs_set_xquota Christoph Hellwig
2010-02-16  8:48 ` [PATCH 00/10] quotactl fixed and cleanups Christoph Hellwig
2010-02-16 10:37 ` Steven Whitehouse
2010-02-16 18:36 ` Jan Kara
2010-02-16 19:12   ` Christoph Hellwig
2010-02-16 21:26     ` Jan Kara
2010-02-16 21:54       ` Christoph Hellwig
2010-02-17 19:37   ` Christoph Hellwig
2010-02-17 23:34     ` Jan Kara
2010-02-25 22:04 ` Alex Elder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100216084652.167390973@bombadil.infradead.org \
    --to=hch@infradead.org \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=swhiteho@redhat.com \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).