xfs
[Top] [All Lists]

Re: [PATCH 19/27] xfs: kill struct xfs_dir2_data

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: [PATCH 19/27] xfs: kill struct xfs_dir2_data
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Wed, 6 Jul 2011 13:05:43 +1000
Cc: xfs@xxxxxxxxxxx
In-reply-to: <20110701094606.199361663@xxxxxxxxxxxxxxxxxxxxxx>
References: <20110701094321.936534538@xxxxxxxxxxxxxxxxxxxxxx> <20110701094606.199361663@xxxxxxxxxxxxxxxxxxxxxx>
User-agent: Mutt/1.5.20 (2009-06-14)
On Fri, Jul 01, 2011 at 05:43:40AM -0400, Christoph Hellwig wrote:
> Remove the confusing xfs_dir2_data structure.  It is supposed to describe
> an XFS dir2 data btree block, but due to the variable sized nature of
> almost all elements in it it can't actuall do anything close to that
> job.  In addition to accessing the fixed offset header structure it was
> only used to get a pointer to the first dir or unused entry after it,
> which can be trivially replaced by pointer arithmetics on the header
> pointer.  For most users that is actually more natural anyway, as they
> don't use a typed pointer but rather a character pointer for further
> arithmetics.
> 
> Signed-off-by: Christoph Hellwig <hch@xxxxxx>
> 
> @@ -70,10 +69,9 @@ xfs_dir2_data_check(
>       struct xfs_name         name;
>  
>       mp = dp->i_mount;
> -     d = bp->data;
> -     hdr = &d->hdr;
> +     hdr = bp->data;
>       bf = hdr->bestfree;
> -     p = (char *)d->u;
> +     p = (char *)(hdr + 1);

Same comment as the previous patch about using a wrapper for this.

Otherwise looks fine.

Reviewed-by: Dave Chinner <dchinner@xxxxxxxxxx>

-- 
Dave Chinner
david@xxxxxxxxxxxxx

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