On Fri, Sep 09, 2011 at 03:23:46PM -0500, Alex Elder wrote:
> On Wed, 2011-08-24 at 02:04 -0400, Christoph Hellwig wrote:
> > plain text document attachment (xfs-simplify-xfs_bmap_isaeof)
> > Add a common helper for finding the last extent in a file.
> > Largely based on a patch from Dave Chinner.
> The new version of xfs_bmap_isaeof() no longer asserts
> that the data fork is the one being operated on. Why?
Because it would work perfectly fine for the attr fork, too - even
if it's fairly useless for it.
> fork is empty, so mention that case in the comment header:
> Returns 0 in *aeof if the file (fork) is empty.
> (Maybe you could explain why this is true at a more
> abstract level though.)
I've done both.
> This logic could be shortened:
> *aeof = off >= rec.br_startoff + rec.br_blockcount ||
> (off >= rec.br_startoff &&
Done (including a comment update)
> > + return 0;
> > +}
> > +
> > +/*
> > + * Check if the endoff is outside the last extent. If so the caller will
> > grow
> > + * the allocation to a stripe unit boundary.
> All offsets are considered outside the end of file for an
> empty file (fork), so 1 is returned in *eof in that case.