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

Christoph Hellwig
2011-06-30T07:39:39Z

> > +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.