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 3/6] reiserfs: Remove i_mutex use from reiserfs_quota_write()
Date: Wed, 25 Apr 2012 22:57:44 +0200	[thread overview]
Message-ID: <1335387467-4928-4-git-send-email-jack@suse.cz> (raw)
In-Reply-To: <1335387467-4928-1-git-send-email-jack@suse.cz>

We don't need i_mutex in reiserfs_quota_write() because writes to quota file
are serialized by dqio_mutex anyway. Changes to quota files outside of quota
code are forbidded and enforced by NOATIME and IMMUTABLE bits.

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

diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
index 8b7616e..c07b7d7 100644
--- a/fs/reiserfs/super.c
+++ b/fs/reiserfs/super.c
@@ -2270,7 +2270,6 @@ static ssize_t reiserfs_quota_write(struct super_block *sb, int type,
 			(unsigned long long)off, (unsigned long long)len);
 		return -EIO;
 	}
-	mutex_lock_nested(&inode->i_mutex, I_MUTEX_QUOTA);
 	while (towrite > 0) {
 		tocopy = sb->s_blocksize - offset < towrite ?
 		    sb->s_blocksize - offset : towrite;
@@ -2302,16 +2301,13 @@ static ssize_t reiserfs_quota_write(struct super_block *sb, int type,
 		blk++;
 	}
 out:
-	if (len == towrite) {
-		mutex_unlock(&inode->i_mutex);
+	if (len == towrite)
 		return err;
-	}
 	if (inode->i_size < off + len - towrite)
 		i_size_write(inode, off + len - towrite);
 	inode->i_version++;
 	inode->i_mtime = inode->i_ctime = CURRENT_TIME;
 	mark_inode_dirty(inode);
-	mutex_unlock(&inode->i_mutex);
 	return len - towrite;
 }
 
-- 
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 ` Jan Kara [this message]
2012-04-25 20:57 ` [PATCH 4/6] ext2: Remove i_mutex use from ext2_quota_write() Jan Kara
2012-04-25 20:57 ` [PATCH 5/6] quota: Use precomputed value of sb_dqopt in dquot_quota_sync Jan Kara
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-4-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).