Return-Path: Received: from mx2.suse.de ([195.135.220.15]:32873 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753501AbdHULzV (ORCPT ); Mon, 21 Aug 2017 07:55:21 -0400 From: Jan Kara To: Cc: Wang Shilong , Andreas Dilger , Jan Kara Subject: [PATCH 07/27] quota: Remove locking for reading from the old quota format Date: Mon, 21 Aug 2017 13:54:57 +0200 Message-Id: <20170821115517.26542-8-jack@suse.cz> In-Reply-To: <20170821115517.26542-1-jack@suse.cz> References: <20170821115517.26542-1-jack@suse.cz> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: The old quota format has fixed offset in quota file based on ID so there's no locking needed against concurrent modifications of the file (locking against concurrent IO on the same dquot is still provided by dq_lock). Reviewed-by: Andreas Dilger Signed-off-by: Jan Kara --- fs/quota/quota_v1.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/fs/quota/quota_v1.c b/fs/quota/quota_v1.c index d534c4043237..12d69cda57cc 100644 --- a/fs/quota/quota_v1.c +++ b/fs/quota/quota_v1.c @@ -61,7 +61,6 @@ static int v1_read_dqblk(struct dquot *dquot) if (!dqopt->files[type]) return -EINVAL; - down_read(&dqopt->dqio_sem); /* Set structure to 0s in case read fails/is after end of file */ memset(&dqblk, 0, sizeof(struct v1_disk_dqblk)); dquot->dq_sb->s_op->quota_read(dquot->dq_sb, type, (char *)&dqblk, @@ -75,7 +74,6 @@ static int v1_read_dqblk(struct dquot *dquot) dquot->dq_dqb.dqb_isoftlimit == 0) set_bit(DQ_FAKE_B, &dquot->dq_flags); dqstats_inc(DQST_READS); - up_read(&dqopt->dqio_sem); return 0; } -- 2.12.3