From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [PATCH 2/3] quota: unify ->get_dqblk Date: Wed, 5 May 2010 12:20:31 -0400 Message-ID: <20100505162031.GB21009@infradead.org> References: <20100505103937.040319545@bombadil.infradead.org> <20100505104021.693053400@bombadil.infradead.org> <20100505160052.GE3938@quack.suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Christoph Hellwig , linux-fsdevel@vger.kernel.org To: Jan Kara Return-path: Received: from bombadil.infradead.org ([18.85.46.34]:43007 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932922Ab0EEQUb (ORCPT ); Wed, 5 May 2010 12:20:31 -0400 Content-Disposition: inline In-Reply-To: <20100505160052.GE3938@quack.suse.cz> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed, May 05, 2010 at 06:00:53PM +0200, Jan Kara wrote: > > +static void copy_to_if_dqblk(struct if_dqblk *dst, struct fs_disk_quota *src) > Could you move fs_disk_quota declaration from an XFS-specific header to > a generic one? The only XFS-specific thing in dqblk_xfs.h is the name. Feel free to rename it to whatever better name suits you. > > /* Generic routine for getting common part of quota structure */ > > -static void do_get_dqblk(struct dquot *dquot, struct if_dqblk *di) > > +static void do_get_dqblk(struct dquot *dquot, struct fs_disk_quota *di) > > { > > struct mem_dqblk *dm = &dquot->dq_dqb; > > > > + memset(di, 0, sizeof(*di)); > > + di->d_version = FS_DQUOT_VERSION; > > + di->d_flags = dquot->dq_type == USRQUOTA ? > > + XFS_USER_QUOTA : XFS_GROUP_QUOTA; > > + di->d_id = dquot->dq_id; > XFS_USER_QUOTA and XFS_GROUP_QUOTA looks awkward in the generic code... I have a patch renaming the last remaining XFS_ identifiers in dqblk_xfs.h to FS_ like the rest, but as I've just sent a gfs2 patch that touches code with these identifiers I'll hold it back until the gfs2 tree is merged. > > int vfs_get_dqblk(struct super_block *sb, int type, qid_t id, > > - struct if_dqblk *di) > > + struct fs_disk_quota *di) > > { > > struct dquot *dquot; > > > > + if (!sb_has_quota_active(sb, type)) > > + return -ESRCH; > > + > dqget() already does this check so you can just remove it.... Ok, fixed for the next version.