Return-Path: Received: from mx2.suse.de ([195.135.220.15]:58495 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753455AbdHQRNF (ORCPT ); Thu, 17 Aug 2017 13:13:05 -0400 Date: Thu, 17 Aug 2017 19:13:02 +0200 From: Jan Kara To: Andreas Dilger Cc: Jan Kara , linux-fsdevel , Wang Shilong , Joel Becker Subject: Re: [PATCH 13/27] quota: Push dqio_sem down to ->write_file_info() Message-ID: <20170817171302.GF28850@quack2.suse.cz> References: <20170816154127.7048-1-jack@suse.cz> <20170816154127.7048-14-jack@suse.cz> <167B5B66-31A6-435A-BE61-BE5AD47A6E66@dilger.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <167B5B66-31A6-435A-BE61-BE5AD47A6E66@dilger.ca> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed 16-08-17 11:33:37, Andreas Dilger wrote: > On Aug 16, 2017, at 9:41 AM, Jan Kara wrote: > > > > Push down acquisition of dqio_sem into ->write_file_info() callback. > > Mostly for consistency with other operations. > > > > Signed-off-by: Jan Kara > > --- > > fs/ocfs2/quota_global.c | 9 +++++++-- > > fs/quota/dquot.c | 10 +--------- > > fs/quota/quota_v1.c | 2 ++ > > fs/quota/quota_v2.c | 5 ++++- > > 4 files changed, 14 insertions(+), 12 deletions(-) > > > > diff --git a/fs/ocfs2/quota_global.c b/fs/ocfs2/quota_global.c > > index 4134d557a8e5..6f7c5bd3cbc6 100644 > > --- a/fs/ocfs2/quota_global.c > > +++ b/fs/ocfs2/quota_global.c > > @@ -443,13 +443,18 @@ static int __ocfs2_global_write_info(struct super_block *sb, int type) > > int ocfs2_global_write_info(struct super_block *sb, int type) > > Would be nice if this was named ocfs2_global_write_file_info() so that > it showed up in searches more easily, though not a huge deal. I guess > the same for ocfs2_local_read_file_info() and ocfs2_local_free_file_info(), > if we wanted to be consistent here, but that should go into a separate > patch. Well, rather than adding 'file' into the name I would add 'quota' somewhere. But yes, the name seems too generic. > > { > > int err; > > - struct ocfs2_mem_dqinfo *info = sb_dqinfo(sb, type)->dqi_priv; > > + struct quota_info *dqopt = sb_dqopt(sb); > > + struct ocfs2_mem_dqinfo *info = dqopt->info[type].dqi_priv; > > > > + down_write(&dqopt->dqio_sem); > > err = ocfs2_qinfo_lock(info, 1); > > - if (err < 0) > > + if (err < 0) { > > + up_write(&dqopt->dqio_sem); > > return err; > > + } > > goto out_sem? > > > err = __ocfs2_global_write_info(sb, type); > > ocfs2_qinfo_unlock(info, 1); > > out_sem: Thanks, done. Honza -- Jan Kara SUSE Labs, CR