From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Morton Subject: Re: [PATCH 12/14] quota: Split off quota tree handling into a separate file Date: Mon, 27 Oct 2008 22:52:42 -0700 Message-ID: <20081027225242.cad4ee18.akpm@linux-foundation.org> References: <1225109512852-git-send-email-jack@suse.cz> <12251095123763-git-send-email-jack@suse.cz> <12251095124166-git-send-email-jack@suse.cz> <1225109512758-git-send-email-jack@suse.cz> <12251095122803-git-send-email-jack@suse.cz> <12251095124165-git-send-email-jack@suse.cz> <1225109513735-git-send-email-jack@suse.cz> <12251095131095-git-send-email-jack@suse.cz> <12251095133646-git-send-email-jack@suse.cz> <12251095133281-git-send-email-jack@suse.cz> <12251095131431-git-send-email-jack@suse.cz> <1225109513299-git-send-email-jack@suse.cz> <12251095133700-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]:48662 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752124AbYJ1FxS (ORCPT ); Tue, 28 Oct 2008 01:53:18 -0400 In-Reply-To: <12251095133700-git-send-email-jack@suse.cz> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Mon, 27 Oct 2008 13:11:50 +0100 Jan Kara wrote: > There is going to be a new version of quota format having 64-bit > quota limits and a new quota format for OCFS2. They are both > going to use the same tree structure as VFSv0 quota format. So > split out tree handling into a separate file and make size of > leaf blocks, amount of space usable in each block (needed for > checksumming) and structures contained in them configurable > so that the code can be shared. > > > ... > > + > +typedef char *dqbuf_t; This thing is fairly unpleasant. It would have been better to have open-coded `char *' everywhere - the typedef just obscures what's going on. Or void*. Also, in most cases the return value of getdqbuf() is cast to a `struct qt_disk_dqdbheader *', so why not make getdqbuf() return a pointer of that type? Anyway, that's all old code and this patch just moves it around. Please sometime take a look at whether this code is as tip-top, super-duper as we'd like? > +static inline ssize_t read_blk(struct qtree_mem_dqinfo *info, uint blk, dqbuf_t buf) > +{ > + struct super_block *sb = info->dqi_sb; > + > + memset(buf, 0, info->dqi_usable_bs); > + return sb->s_op->quota_read(sb, info->dqi_type, (char *)buf, > + info->dqi_usable_bs, blk << info->dqi_blocksize_bits); > +} > + > +static inline ssize_t write_blk(struct qtree_mem_dqinfo *info, uint blk, dqbuf_t buf) > +{ > + struct super_block *sb = info->dqi_sb; > + > + return sb->s_op->quota_write(sb, info->dqi_type, (char *)buf, > + info->dqi_usable_bs, blk << info->dqi_blocksize_bits); > +} I expect you'll get some nice code-size and cache-footprint improvements by uninlining these.