xfs
[Top] [All Lists]

Re: [PATCH 14/27] xfs: cleanup shortform directory inode number handling

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH 14/27] xfs: cleanup shortform directory inode number handling
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Thu, 30 Jun 2011 03:39:37 -0400
Cc: Christoph Hellwig <hch@xxxxxxxxxxxxx>, xfs@xxxxxxxxxxx
In-reply-to: <20110630063508.GH561@dastard>
References: <20110629140109.003209430@xxxxxxxxxxxxxxxxxxxxxx> <20110629140339.266356959@xxxxxxxxxxxxxxxxxxxxxx> <20110630063508.GH561@dastard>
User-agent: Mutt/1.5.21 (2010-09-15)
> > +static xfs_ino_t
> 
> Extra line there...

Fixed.

> > +}
> > +static void
> 
> And none there.

Fixed.

> > +xfs_dir2_sf_put_inumber(
> > +   struct xfs_dir2_sf      *sfp,
> > +   xfs_dir2_inou_t         *to,
> > +   xfs_ino_t               ino)
> > +{
> > +   if (sfp->hdr.i8count)
> > +           XFS_PUT_DIR_INO8(ino, to->i8);
> > +   else
> > +           XFS_PUT_DIR_INO4(ino, to->i4);
> > +}
> 
> Also, xfs_dir2_sf_get_ino() vs xfs_dir2_sf_put_inumber() - either
> use _ino or _inumber as the suffix for both. _ino is probably more
> consistent with the other functions...

xfs_dir2_sf_put_inumber already exists in the current code and I just
moved it blindly.  I've renamed it to xfs_dir2_sf_put_ino for the
next version.

> > +
> > +xfs_ino_t
> > +xfs_dir2_sf_get_parent_ino(
> > +   struct xfs_dir2_sf      *sfp)
> > +{
> > +   return xfs_dir2_sf_get_ino(sfp, &sfp->hdr.parent);
> > +}
> > +
> > +
> 
> Extra whitespace.

Fixed.

> > +static void
> > +xfs_dir2_sf_put_parent_ino(
> > +   struct xfs_dir2_sf      *sfp,
> > +   xfs_ino_t               ino)
> > +{
> > +   xfs_dir2_sf_put_inumber(sfp, &sfp->hdr.parent, ino);
> > +}
> > +
> > +
> 
> Extra whitespace.
> 

Fixed.

> > +/*
> > + * In short-form directory entries the inode numbers are stored at variable
> > + * offset behind the entry name.  The inode numbers may only be accessed
> > + * through the helpers below.
> > + */
> > +
> 
> Extra whitespace.
> 

Fixed.

> > +static xfs_dir2_inou_t *
> > +xfs_dir2_sf_inop(
> > +   struct xfs_dir2_sf_entry *sfep)
> > +{
> > +   return (xfs_dir2_inou_t *)&sfep->name[sfep->namelen];
> > +}
> 
> Probably should be called xfs_dir2_sfe_inop()  because it takes a
> xfs_dir2_sf_entry, similar to the following functions use "sfe".

Ok.

> 
> > +
> > +xfs_ino_t
> > +xfs_dir2_sfe_get_ino(
> > +   struct xfs_dir2_sf      *sfp,
> > +   struct xfs_dir2_sf_entry *sfep)
> > +{
> > +   return xfs_dir2_sf_get_ino(sfp, xfs_dir2_sf_inop(sfep));
> > +}
> > +
> > +static void
> > +xfs_dir2_sfe_put_ino(
> > +   struct xfs_dir2_sf      *sfp,
> > +   struct xfs_dir2_sf_entry *sfep,
> > +   xfs_ino_t               ino)
> > +{
> > +   xfs_dir2_sf_put_inumber(sfp, xfs_dir2_sf_inop(sfep), ino);
> > +}
> > +
> > +
> 
> Extra whitespace.

Fixed.

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