From: Christoph Hellwig <hch@infradead.org>
To: Barry Naujok <bnaujok@sgi.com>
Cc: "xfs@oss.sgi.com" <xfs@oss.sgi.com>
Subject: Re: [REVIEW #2] Update kernel code to compile in userspace (libxfs)
Date: Fri, 29 Aug 2008 14:11:20 -0400 [thread overview]
Message-ID: <20080829181120.GA9455@infradead.org> (raw)
In-Reply-To: <op.ugm1ttzb3jf8g2@pc-bnaujok.melbourne.sgi.com>
On Fri, Aug 29, 2008 at 05:59:43PM +1000, Barry Naujok wrote:
> On Fri, 29 Aug 2008 17:00:56 +1000, Barry Naujok <bnaujok@sgi.com> wrote:
>
>> Mostly header changes associated with #ifdef __KERNEL__ stuff.
>>
>> Some function prototypes had to be reordered to separate
>> shared and kernel only functions.
>
> fs/xfs/xfs_inode.h patch looked pretty horrid (and there was a missing
> declaration), here's a better version:
I still don't like it very much :) What about just moving the
xfs_ictimestamp and xfs_icdinode defintions next to the ifork
so that we can save one ifdef __KERNEL__? Also might be worth
to move the xfs_iflock & co inlines before the end of that __KERNEL__
block to save another ifdef.
>
> Index: 2.6.x-xfs/fs/xfs/xfs_inode.h
> ===================================================================
> --- 2.6.x-xfs.orig/fs/xfs/xfs_inode.h
> +++ 2.6.x-xfs/fs/xfs/xfs_inode.h
> @@ -131,6 +131,8 @@ typedef struct dm_attrs_s {
> __uint16_t da_pad; /* DMIG extra padding */
> } dm_attrs_t;
>
> +#endif /* __KERNEL__ */
> +
> /*
> * This is the xfs in-core inode structure.
> * Most of the on-disk inode is embedded in the i_d field.
> @@ -191,6 +193,8 @@ typedef struct xfs_icdinode {
> __uint32_t di_gen; /* generation number */
> } xfs_icdinode_t;
>
> +#ifdef __KERNEL__
> +
> typedef struct {
> struct xfs_inode *ip_mnext; /* next inode in mount list */
> struct xfs_inode *ip_mprev; /* ptr to prev inode */
> @@ -490,19 +494,12 @@ int xfs_finish_reclaim_all(struct xfs_m
> /*
> * xfs_inode.c prototypes.
> */
> -int xfs_itobp(struct xfs_mount *, struct xfs_trans *,
> - xfs_inode_t *, struct xfs_dinode **, struct xfs_buf **,
> - xfs_daddr_t, uint, uint);
> int xfs_iread(struct xfs_mount *, struct xfs_trans *, xfs_ino_t,
> xfs_inode_t **, xfs_daddr_t, uint);
> int xfs_iread_extents(struct xfs_trans *, xfs_inode_t *, int);
> int xfs_ialloc(struct xfs_trans *, xfs_inode_t *, mode_t,
> xfs_nlink_t, xfs_dev_t, struct cred *, xfs_prid_t,
> int, struct xfs_buf **, boolean_t *, xfs_inode_t **);
> -void xfs_dinode_from_disk(struct xfs_icdinode *,
> - struct xfs_dinode_core *);
> -void xfs_dinode_to_disk(struct xfs_dinode_core *,
> - struct xfs_icdinode *);
>
> uint xfs_ip2xflags(struct xfs_inode *);
> uint xfs_dic2xflags(struct xfs_dinode *);
> @@ -514,15 +511,11 @@ int xfs_itruncate_finish(struct xfs_tra
> int xfs_iunlink(struct xfs_trans *, xfs_inode_t *);
>
> struct xfs_inode * xfs_inode_alloc(struct xfs_mount *, xfs_ino_t);
> -void xfs_idestroy_fork(xfs_inode_t *, int);
> void xfs_idestroy(xfs_inode_t *);
> -void xfs_idata_realloc(xfs_inode_t *, int, int);
> void xfs_iextract(xfs_inode_t *);
> void xfs_iext_realloc(xfs_inode_t *, int, int);
> -void xfs_iroot_realloc(xfs_inode_t *, int, int);
> void xfs_ipin(xfs_inode_t *);
> void xfs_iunpin(xfs_inode_t *);
> -int xfs_iextents_copy(xfs_inode_t *, xfs_bmbt_rec_t *, int);
> int xfs_iflush(xfs_inode_t *, uint);
> void xfs_iflush_all(struct xfs_mount *);
> void xfs_ichgtime(xfs_inode_t *, int);
> @@ -532,6 +525,19 @@ void xfs_lock_two_inodes(xfs_inode_t *,
>
> void xfs_synchronize_atime(xfs_inode_t *);
> void xfs_mark_inode_dirty_sync(xfs_inode_t *);
> +#endif /* __KERNEL__ */
> +
> +int xfs_itobp(struct xfs_mount *, struct xfs_trans *,
> + xfs_inode_t *, struct xfs_dinode **, struct xfs_buf **,
> + xfs_daddr_t, uint, uint);
> +void xfs_dinode_from_disk(struct xfs_icdinode *,
> + struct xfs_dinode_core *);
> +void xfs_dinode_to_disk(struct xfs_dinode_core *,
> + struct xfs_icdinode *);
> +void xfs_idestroy_fork(xfs_inode_t *, int);
> +void xfs_idata_realloc(xfs_inode_t *, int, int);
> +void xfs_iroot_realloc(xfs_inode_t *, int, int);
> +int xfs_iextents_copy(xfs_inode_t *, xfs_bmbt_rec_t *, int);
>
> xfs_bmbt_rec_host_t *xfs_iext_get_ext(xfs_ifork_t *, xfs_extnum_t);
> void xfs_iext_insert(xfs_ifork_t *, xfs_extnum_t, xfs_extnum_t,
> @@ -577,6 +583,8 @@ extern struct kmem_zone *xfs_ifork_zone;
> extern struct kmem_zone *xfs_inode_zone;
> extern struct kmem_zone *xfs_ili_zone;
>
> +#ifdef __KERNEL__
> +
> /*
> * Manage the i_flush queue embedded in the inode. This completion
> * queue synchronizes processes attempting to flush the in-core
>
>
---end quoted text---
next prev parent reply other threads:[~2008-08-29 18:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-29 7:00 [REVIEW #2] Update kernel code to compile in userspace (libxfs) Barry Naujok
2008-08-29 7:59 ` Barry Naujok
2008-08-29 18:11 ` Christoph Hellwig [this message]
2008-09-01 1:56 ` Barry Naujok
2008-09-01 1:59 ` Christoph Hellwig
2008-09-01 2:06 ` Barry Naujok
2008-09-01 2:08 ` Christoph Hellwig
2008-09-01 4:55 ` Barry Naujok
2008-09-01 5:00 ` 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=20080829181120.GA9455@infradead.org \
--to=hch@infradead.org \
--cc=bnaujok@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