public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Alex Elder <aelder@sgi.com>
Cc: Christoph Hellwig <hch@infradead.org>, xfs@oss.sgi.com
Subject: Re: [PATCH 01/11] xfs: reshuffle dir2 headers
Date: Tue, 12 Jul 2011 05:06:09 -0400	[thread overview]
Message-ID: <20110712090609.GA8364@infradead.org> (raw)
In-Reply-To: <1310423560.7019.53.camel@doink>

On Mon, Jul 11, 2011 at 05:32:40PM -0500, Alex Elder wrote:
> - It looks like the three files are:
>     - external interface (just function prototypes)
>     - internal interface (just function prototypes)
>     - structures and accessors, other types, and constants
>   Did it just happen to turn out that that the two interface
>   files had nothing but prototypes?  Or was that what you
>   intended to do?

It's more or less intentional.  If actually had non-opaque data types
that weren't part of the disk format we might have them here, but the
dir2 code doesn't have any of those.

> - The contents of "xfs_dir2_format.h" comprise more than
>   just the on-disk format, it really seems to capture all
>   substantive data types and definitions related to directory
>   structures in XFS.  

The only type not part of the disk format is xfs_dir2_data_aoff_t,
which is a type that we probably should get rid of anyway.

> - None of the dir2 header files themselves #included
>   anything else.  The same is true for your (new) three
>   header files.  However, the internal interface file
>   (xfs_dir2_priv.h) seems to *always* require the data
>   types file (xfs_dir2_format.h) to be included first.
>   What are your thoughts about just putting the #include
>   of "xfs_dir2_format.h" into "xfs_dir2_priv.h".  I
>   realize that's really a philosophical question, broader
>   than this particular case.

We haven't done that for any of the XFS headers, so I don't
plan to change it with this patch.

> > +#define	XFS_DIR2_BLOCK_MAGIC	0x58443242	/* XD2B: for one block dirs */
>                                       /* XD2B: for single block dirs */
> 
> > +#define	XFS_DIR2_DATA_MAGIC	0x58443244	/* XD2D: for multiblock dirs */
> > +#define	XFS_DIR2_FREE_MAGIC	0x58443246	/* XD2F */
>                                       /* XD2F: for free index blocks */

These lines were taken as-is from the old headers, but your variants
are beter, I'll change it.

> > +typedef union {
> > +	xfs_dir2_ino8_t	i8;
> > +	xfs_dir2_ino4_t	i4;
> > +} xfs_dir2_inou_t;
> > +#define	XFS_DIR2_MAX_SHORT_INUM	((xfs_ino_t)0xffffffffULL)
> 
> I know this is historical, but I don't like the use of
> "SHORT" here to mean "4-byte," since "short" in the
> context of directories has a very different meaning
> (i.e., shortform).

We can fix this up later, but I don't want to change identifiers in
addition to the header consolidation.

> 
> > +
> > +/*
> > + * Directory layout when stored internal to an 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
>         ...of the inode.  These "shortform" directories consist...

Ok.

> > + * followed by zero or more xfs_dir2_sf_entry structures.  Due the different
> > + * inode number storage size and the variable length name field in
> > + * the xfs_dir2_sf_entry all these structure are variable length, and the
> > + * accessors in this file should be used to iterate over them.
> > + *
> > + *
> > + * The parent directory has a dedicated field, and the self-pointer must
> > + * be calculated on the fly.
> 
> This sentence is not very meaningful standing by itself here.
> I think it either needs a bit more context, or maybe it can
> just be removed.

It doesn't seem overly useful, so I'll remove it.

> 
> > + *
> > + * Entries are packed toward the top as tightly as possible, and thus may
> > + * be misaligned.  Care needs to be taken to access them through special
> > + * helpers or copy them into aligned variables first.
> 
> Can this last sentence just be deleted, since above you
> now say that the accessors here should be used?

I'll remove it.

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2011-07-12  9:06 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-10 20:49 [PATCH 00/11] a few more cleanups for Linux 3.1 Christoph Hellwig
2011-07-10 20:49 ` [PATCH 01/11] xfs: reshuffle dir2 headers Christoph Hellwig
2011-07-11 22:32   ` Alex Elder
2011-07-12  9:06     ` Christoph Hellwig [this message]
2011-07-10 20:49 ` [PATCH 02/11] xfs: cleanup struct xfs_dir2_free Christoph Hellwig
2011-07-11 22:32   ` Alex Elder
2011-07-10 20:49 ` [PATCH 03/11] xfs: factor out xfs_dir2_leaf_find_stale Christoph Hellwig
2011-07-11 22:32   ` Alex Elder
2011-07-12  9:09     ` Christoph Hellwig
2011-07-13  6:49     ` Dave Chinner
2011-07-13  7:16       ` Christoph Hellwig
2011-07-13 10:28         ` Dave Chinner
2011-07-10 20:49 ` [PATCH 04/11] xfs: factor out xfs_da_grow_inode_int Christoph Hellwig
2011-07-11  0:37   ` Dave Chinner
2011-07-11  5:24     ` Christoph Hellwig
2011-07-12  0:55       ` Dave Chinner
2011-07-11 22:32   ` Alex Elder
2011-07-10 20:49 ` [PATCH 05/11] xfs: add a proper transaction pointer to struct xfs_buf Christoph Hellwig
2011-07-11 22:33   ` Alex Elder
2011-07-12  9:12     ` Christoph Hellwig
2011-07-10 20:49 ` [PATCH 06/11] xfs: remove wrappers around b_fspriv Christoph Hellwig
2011-07-11 22:33   ` Alex Elder
2011-07-12  1:02     ` Dave Chinner
2011-07-12  9:15       ` Christoph Hellwig
2011-07-10 20:49 ` [PATCH 07/11] xfs: remove wrappers around b_iodone Christoph Hellwig
2011-07-11 22:33   ` Alex Elder
2011-07-10 20:49 ` [PATCH 08/11] xfs: remove the unused xfs_buf_delwri_sort function Christoph Hellwig
2011-07-11 22:33   ` Alex Elder
2011-07-10 20:49 ` [PATCH 09/11] xfs: remove the dead QUOTADEBUG debug Christoph Hellwig
2011-07-11 22:33   ` Alex Elder
2011-07-12  0:59     ` Dave Chinner
2011-07-10 20:49 ` [PATCH 10/11] xfs: remove leftovers of the old btree tracing code Christoph Hellwig
2011-07-12  2:52   ` Alex Elder
2011-07-10 20:49 ` [PATCH 11/11] xfs: kill the dead XFS_DABUF debug code Christoph Hellwig
2011-07-11 22:33   ` Alex Elder
2011-07-13  6:51 ` [PATCH 00/11] a few more cleanups for Linux 3.1 Dave Chinner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110712090609.GA8364@infradead.org \
    --to=hch@infradead.org \
    --cc=aelder@sgi.com \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox