linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: linux-fsdevel@vger.kernel.org
Cc: LKML <linux-kernel@vger.kernel.org>,
	bfields@fieldses.org, Al Viro <viro@ZenIV.linux.org.uk>,
	Jan Kara <jack@suse.cz>
Subject: [PATCH 5/6] quota: Use precomputed value of sb_dqopt in dquot_quota_sync
Date: Wed, 25 Apr 2012 22:57:46 +0200	[thread overview]
Message-ID: <1335387467-4928-6-git-send-email-jack@suse.cz> (raw)
In-Reply-To: <1335387467-4928-1-git-send-email-jack@suse.cz>

Signed-off-by: Jan Kara <jack@suse.cz>
---
 fs/quota/dquot.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
index d69a1d1..1b7e0fc 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -638,7 +638,7 @@ int dquot_quota_sync(struct super_block *sb, int type, int wait)
 	dqstats_inc(DQST_SYNCS);
 	mutex_unlock(&dqopt->dqonoff_mutex);
 
-	if (!wait || (sb_dqopt(sb)->flags & DQUOT_QUOTA_SYS_FILE))
+	if (!wait || (dqopt->flags & DQUOT_QUOTA_SYS_FILE))
 		return 0;
 
 	/* This is not very clever (and fast) but currently I don't know about
@@ -652,18 +652,18 @@ int dquot_quota_sync(struct super_block *sb, int type, int wait)
 	 * Now when everything is written we can discard the pagecache so
 	 * that userspace sees the changes.
 	 */
-	mutex_lock(&sb_dqopt(sb)->dqonoff_mutex);
+	mutex_lock(&dqopt->dqonoff_mutex);
 	for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
 		if (type != -1 && cnt != type)
 			continue;
 		if (!sb_has_quota_active(sb, cnt))
 			continue;
-		mutex_lock_nested(&sb_dqopt(sb)->files[cnt]->i_mutex,
+		mutex_lock_nested(&dqopt->files[cnt]->i_mutex,
 				  I_MUTEX_QUOTA);
-		truncate_inode_pages(&sb_dqopt(sb)->files[cnt]->i_data, 0);
-		mutex_unlock(&sb_dqopt(sb)->files[cnt]->i_mutex);
+		truncate_inode_pages(&dqopt->files[cnt]->i_data, 0);
+		mutex_unlock(&dqopt->files[cnt]->i_mutex);
 	}
-	mutex_unlock(&sb_dqopt(sb)->dqonoff_mutex);
+	mutex_unlock(&dqopt->dqonoff_mutex);
 
 	return 0;
 }
-- 
1.7.1


  parent reply	other threads:[~2012-04-25 20:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-25 20:57 [PATCH 0/6] Get rid of I_MUTEX_QUOTA use Jan Kara
2012-04-25 20:57 ` [PATCH 1/6] ext3: Remove i_mutex use from ext3_quota_write() Jan Kara
2012-04-25 20:57 ` [PATCH 2/6] ext4: Remove i_mutex use from ext4_quota_write() Jan Kara
2012-04-25 20:57 ` [PATCH 3/6] reiserfs: Remove i_mutex use from reiserfs_quota_write() Jan Kara
2012-04-25 20:57 ` [PATCH 4/6] ext2: Remove i_mutex use from ext2_quota_write() Jan Kara
2012-04-25 20:57 ` Jan Kara [this message]
2012-04-25 20:57 ` [PATCH 6/6] quota: Get rid of nested I_MUTEX_QUOTA locking subclass Jan Kara
2012-04-25 21:25 ` [PATCH 0/6] Get rid of I_MUTEX_QUOTA use J. Bruce Fields
2012-04-26 13:26   ` Jan Kara
2012-04-27 13:47     ` J. Bruce Fields
2012-04-30 13:54       ` Jan Kara
2012-05-09 21:34         ` J. Bruce Fields

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=1335387467-4928-6-git-send-email-jack@suse.cz \
    --to=jack@suse.cz \
    --cc=bfields@fieldses.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@ZenIV.linux.org.uk \
    /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).