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? > +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. -- 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