[Top] [All Lists]

Re: [PATCH 03/11] xfs: factor out xfs_dir2_leaf_find_stale

To: Alex Elder <aelder@xxxxxxx>
Subject: Re: [PATCH 03/11] xfs: factor out xfs_dir2_leaf_find_stale
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Tue, 12 Jul 2011 05:09:54 -0400
Cc: Christoph Hellwig <hch@xxxxxxxxxxxxx>, xfs@xxxxxxxxxxx
In-reply-to: <1310423573.7019.55.camel@doink>
References: <20110710204916.856267100@xxxxxxxxxxxxxxxxxxxxxx> <20110710205017.293539533@xxxxxxxxxxxxxxxxxxxxxx> <1310423573.7019.55.camel@doink>
User-agent: Mutt/1.5.21 (2010-09-15)
On Mon, Jul 11, 2011 at 05:32:53PM -0500, Alex Elder wrote:
> > +           continue;
> > +
> > +   /*
> > +    * Find the first stale entry at or after our index, if any.
> > +    * Stop if the answer would be worse than lowstale.
>               Stop if the result would require moving more
>               entries than using lowstale.
> (I realize you didn't change this comment, you just moved
> it into this helper function.)

I'll change it.

> Actually it seems like this searching of the stale
> entries and moving things around among them could
> be broken into a few even finer-grained utility
> routines.  It just seems like what this code is
> doing is simpler than what the code complexity
> suggests (though I haven't really looked at this
> stuff much before).

Some of this code could use some refactoring, but it's going to be
more complex than this patch.  Additionally a lot of the logic is
duplicate in the block format code, but that format has the freespace
"header" at the end in struct xfs_dir2_block_tail, which for the fun
of it uses 32-bit count and stale fields instead of the 16-bit values
in struct xfs_dir2_leaf_hdr.

<Prev in Thread] Current Thread [Next in Thread>