[Top] [All Lists]

Re: [PATCH 15/27] xfs: reshuffle dir2 definitions around for userspace

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: [PATCH 15/27] xfs: reshuffle dir2 definitions around for userspace
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Wed, 19 Jun 2013 07:12:57 +1000
Cc: xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <20130617160515.GC26043@xxxxxxxxxxxxx>
References: <1371032567-21772-1-git-send-email-david@xxxxxxxxxxxxx> <1371032567-21772-16-git-send-email-david@xxxxxxxxxxxxx> <20130617160515.GC26043@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Mon, Jun 17, 2013 at 09:05:15AM -0700, Christoph Hellwig wrote:
> On Wed, Jun 12, 2013 at 08:22:35PM +1000, Dave Chinner wrote:
> > From: Dave Chinner <dchinner@xxxxxxxxxx>
> > 
> > Many of the definitions within xfs_dir2_priv.h are needed in
> > userspace outside libxfs. Definitions within xfs_dir2_priv.h are
> > wholly contained within libxfs, so we need to shuffle some of the
> > definitions around to keep consistency across files shared between
> > user and kernel space.
> I created the xfs_dir2_format.h header so that it would be self
> contained.  Despite not mentioning it in the description this patch
> also moves typedefs out of xfs_dir2_format.h which is something I'd
> rather avoid.  Where in userspace would we need these defintions but
> can't include xfs_dir2_format.h?

They are needed by the declarations of the public dir2 functions
used by userspace. i.e. they aren't just on-disk format definitions
- they are API definitions as well.

This was one of the problems I had with the previous libxfs/kernel
sync - converting all the userspace code to use xfs_dir2_format.h.
I had no idea exactly how you intended to structure the usrespace
code, and so I was really flying blind.

The separation of dir2.h/format.h/priv.h is fine from the kernel
side, but I found that a significant number of functions declared in
xfs_dir2_priv.h are actually public functions in userspace and so
need to be in xfs_dir2.h, not xfs_dir2_priv.h. And then that
requires the definitions from xfs_fir2_format.h for the function
prototypes in xfs_dir2.h....

Having just done all the other __KERNEL__ changes, I see this
dir2 change in a different light now. I can probably rework the
userspace includes to include xfs_dir2_format.h before xfs_dir2.h
and hence remove the need to modify xfs_dir2_format.h...


Dave Chinner

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