Re: [PATCH 12/14] quota: Split off quota tree handling into a separate file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon 27-10-08 22:52:42, Andrew Morton wrote:
> On Mon, 27 Oct 2008 13:11:50 +0100 Jan Kara <jack@xxxxxxx> 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 <jack@xxxxxxx>
SUSE Labs, CR
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux