]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
quota: Remove locking for reading from the old quota format
authorJan Kara <jack@suse.cz>
Thu, 8 Jun 2017 13:43:13 +0000 (15:43 +0200)
committerJan Kara <jack@suse.cz>
Thu, 17 Aug 2017 17:01:16 +0000 (19:01 +0200)
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 <adilger@dilger.ca>
Signed-off-by: Jan Kara <jack@suse.cz>
fs/quota/quota_v1.c

index d534c4043237d6742ed22a92318502da072ad8b2..12d69cda57cca9f25a998e88b9be38e534aa0e11 100644 (file)
@@ -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;
 }