From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Morton Subject: Re: [PATCH 01/14] quota: Add callbacks for allocating and destroying dquot structures Date: Mon, 27 Oct 2008 22:33:57 -0700 Message-ID: <20081027223357.61af3117.akpm@linux-foundation.org> References: <1225109512852-git-send-email-jack@suse.cz> <12251095123763-git-send-email-jack@suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: linux-fsdevel@vger.kernel.org To: Jan Kara Return-path: Received: from smtp1.linux-foundation.org ([140.211.169.13]:53029 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752108AbYJ1Fee (ORCPT ); Tue, 28 Oct 2008 01:34:34 -0400 In-Reply-To: <12251095123763-git-send-email-jack@suse.cz> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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'.