xfs
[Top] [All Lists]

Re: [PATCH 14/27] xfs: kill struct xfs_dir2_sf

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: [PATCH 14/27] xfs: kill struct xfs_dir2_sf
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Wed, 6 Jul 2011 11:57:05 +1000
Cc: xfs@xxxxxxxxxxx
In-reply-to: <20110701094605.197942925@xxxxxxxxxxxxxxxxxxxxxx>
References: <20110701094321.936534538@xxxxxxxxxxxxxxxxxxxxxx> <20110701094605.197942925@xxxxxxxxxxxxxxxxxxxxxx>
User-agent: Mutt/1.5.20 (2009-06-14)
On Fri, Jul 01, 2011 at 05:43:35AM -0400, Christoph Hellwig wrote:
> The list field of it is never cactually used, so all uses can simply be
> replaced with the xfs_dir2_sf_hdr_t type that it has as first member.
> 
> Signed-off-by: Christoph Hellwig <hch@xxxxxx>
> 
> - * fit into the literal area of the inode.
> + * Small directories are packed as tightly as possible so as to fit into the
> + * literal area of the inode.  They consist of a single xfs_dir2_sf_hdr 
> header
> + * followed by zero or more xfs_dir2_sf_entry structures.  Due the different
> + * inode number storage sized and the variable length name filed in
                           size                               field
> + * the xfs_dir2_sf_entry all these structure are variable length, and the
                                      structures
> + * accessors in this file need to be used to iterate over them.
                             should be

>  static inline int
> -xfs_dir2_sf_entsize_byentry(xfs_dir2_sf_t *sfp, xfs_dir2_sf_entry_t *sfep)
> +xfs_dir2_sf_entsize_byentry(xfs_dir2_sf_hdr_t *sfp, xfs_dir2_sf_entry_t 
> *sfep)
>  {
>       return ((uint)sizeof(xfs_dir2_sf_entry_t) - 1 + (sfep)->namelen - \
> -             ((sfp)->hdr.i8count == 0) * \
> +             ((sfp)->i8count == 0) * \
>               ((uint)sizeof(xfs_dir2_ino8_t) - 
> (uint)sizeof(xfs_dir2_ino4_t)));
>  }
>  
> -static inline xfs_dir2_sf_entry_t *xfs_dir2_sf_firstentry(xfs_dir2_sf_t *sfp)
> +static inline xfs_dir2_sf_entry_t *xfs_dir2_sf_firstentry(xfs_dir2_sf_hdr_t 
> *sfp)

Probably should split this onto two lines.

Otherwise looks good.

Reviewed-by: Dave Chinner <dchinner@xxxxxxxxxx>
-- 
Dave Chinner
david@xxxxxxxxxxxxx

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