From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kara Subject: Re: [PATCH 12/14] quota: Split off quota tree handling into a separate file Date: Wed, 29 Oct 2008 03:43:47 +0100 Message-ID: <20081029024346.GJ24732@duck.suse.cz> References: <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> <20081027225242.cad4ee18.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]:47103 "EHLO mail.suse.cz" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752081AbYJ2Cns (ORCPT ); Tue, 28 Oct 2008 22:43:48 -0400 Content-Disposition: inline In-Reply-To: <20081027225242.cad4ee18.akpm@linux-foundation.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Mon 27-10-08 22:52:42, Andrew Morton wrote: > 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? Yep, using void * instead of dqbuf_t would be sane thing to do. I already feel that for a while but never got to it. > > +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. Will try :) Thanks. Honza -- Jan Kara SUSE Labs, CR