public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: David Chinner <dgc@sgi.com>
To: Christoph Hellwig <hch@lst.de>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH] dinode endianess annotations
Date: Mon, 23 Jul 2007 10:21:21 +1000	[thread overview]
Message-ID: <20070723002121.GK31489@sgi.com> (raw)
In-Reply-To: <20070720163026.GA6902@lst.de>

On Fri, Jul 20, 2007 at 06:30:26PM +0200, Christoph Hellwig wrote:
> Biggest bit is duplicating the dinode structure so we have one annoted
> for native endianess and one for disk endinaess.  The other significant
> change is that xfs_xlate_dinode_core is split into one helper per
> direction to allow for proper annotations, everything else is trivial.

Ok, we've needed to do that for a while....

> As a sidenode splitting out the incore dinode means we can move it into
> xfs_inode.h in a later patch and severly improving on the include hell
> in xfs.

Excellent!

Couple of comments, though....

> Index: linux-2.6-xfs/fs/xfs/xfs_dinode.h
> ===================================================================
> --- linux-2.6-xfs.orig/fs/xfs/xfs_dinode.h	2007-07-17 07:54:01.000000000 +0200
> +++ linux-2.6-xfs/fs/xfs/xfs_dinode.h	2007-07-17 07:54:35.000000000 +0200
> @@ -33,16 +33,17 @@ struct xfs_mount;
>   * with the last field expanding.  It is split into the core and "other"
>   * because we only need the core part in the in-core inode.
>   */
> -typedef struct xfs_timestamp {
> +
> +typedef struct xfs_timestamp_incore {
>  	__int32_t	t_sec;		/* timestamp seconds */
>  	__int32_t	t_nsec;		/* timestamp nanoseconds */
> -} xfs_timestamp_t;
> +} xfs_timestamp_incore_t;

This is a bit ugly - we typically use the "ic" prefix to indicate
"in-core" e.g. "l_iclogbufs", "xfs_icsb_cnts_t".

Perhaps "xfs_ictimestamp_t" or "xfs_ictstamp_t" would be more
consistent with other code. Not sure it really matters, but it would
fix up some of the formatting issues such a long variable
introduces....

>  /*
> - * Note: Coordinate changes to this structure with the XFS_DI_* #defines
> - * below and the offsets table in xfs_ialloc_log_di().
> + * Incore dinode core.  Must match xfs_dinode_core except for endianess
> + * annotations.
>   */
> -typedef struct xfs_dinode_core
> +typedef struct xfs_dinode_incore

So now we have:

	- struct inode (linux in memory inode)
	- struct xfs_inode (xfs in memory inode)
	- struct xfs_dinode_incore (xfs in memory disk inode core)
	- struct xfs_dinode_core (xfs on disk inode core)

I think the xfs_dinode_incore is badly named, because the "core"
part of xfs_dinode_core refers to the main part (or "core") of the
on disk inode. i.e. the non-literal area of the inode. IOWs, "core"
in this context has very different meaning to "incore" (see
XFS_ILOG_CORE and friends, for example).

Perhaps "struct xfs_icdinode_core" as per the above?

Cheers,

Dave.
-- 
Dave Chinner
Principal Engineer
SGI Australian Software Group

  reply	other threads:[~2007-07-23  0:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-20 16:30 [PATCH] dinode endianess annotations Christoph Hellwig
2007-07-23  0:21 ` David Chinner [this message]
2007-07-23  8:44   ` Christoph Hellwig
2007-07-28 17:59     ` Christoph Hellwig
2007-08-03  0:29       ` Christoph Hellwig

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=20070723002121.GK31489@sgi.com \
    --to=dgc@sgi.com \
    --cc=hch@lst.de \
    --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