From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kara Subject: Re: [PATCH 01/14] quota: Add callbacks for allocating and destroying dquot structures Date: Wed, 29 Oct 2008 04:05:57 +0100 Message-ID: <20081029030556.GL24732@duck.suse.cz> References: <1225109512852-git-send-email-jack@suse.cz> <12251095123763-git-send-email-jack@suse.cz> <20081027223357.61af3117.akpm@linux-foundation.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Jan Kara , linux-fsdevel@vger.kernel.org To: Andrew Morton Return-path: Received: from styx.suse.cz ([82.119.242.94]:47314 "EHLO mail.suse.cz" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751464AbYJ2DF6 (ORCPT ); Tue, 28 Oct 2008 23:05:58 -0400 Content-Disposition: inline In-Reply-To: <20081027223357.61af3117.akpm@linux-foundation.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Mon 27-10-08 22:33:57, Andrew Morton wrote: > On Mon, 27 Oct 2008 13:11:39 +0100 Jan Kara wrote: > > > +static void destroy_dquot(struct dquot *dquot) > > +{ > > + if (dquot->dq_sb->dq_op->destroy_dquot) > > + dquot->dq_sb->dq_op->destroy_dquot(dquot); > > + else > > + kmem_cache_free(dquot_cachep, dquot); > > +} > > Could we require that all dquot_operations.destroy_dquot() be non-NULL? > Make it point at > > void default_destroy_dquot(struct dquot *dquot) > { > kmem_cache_fre(...); > } > > (and ditto dquot_operations.alloc_qduot). > > That way the above becomes a simple inlined function with no `if'. Makes sence. Will do. Thanks. Honza -- Jan Kara SUSE Labs, CR