* [REVIEW] Update kernel headers to compile in userspace (libxfs)
@ 2008-07-29 2:25 Barry Naujok
2008-07-29 4:19 ` Christoph Hellwig
0 siblings, 1 reply; 2+ messages in thread
From: Barry Naujok @ 2008-07-29 2:25 UTC (permalink / raw)
To: xfs@oss.sgi.com
There's been some changes in the headers that fail to compile in
user-land. This patch #ifdef __KERNEL__ these things as none of
them are actually used/required in user-space.
---
fs/xfs/xfs_ag.h | 2 ++
fs/xfs/xfs_dir2_block.h | 2 ++
fs/xfs/xfs_dir2_leaf.h | 2 ++
fs/xfs/xfs_dir2_sf.h | 2 ++
fs/xfs/xfs_inode_item.h | 5 ++---
5 files changed, 10 insertions(+), 3 deletions(-)
Index: 2.6.x-xfs/fs/xfs/xfs_ag.h
===================================================================
--- 2.6.x-xfs.orig/fs/xfs/xfs_ag.h
+++ 2.6.x-xfs/fs/xfs/xfs_ag.h
@@ -196,11 +196,13 @@ typedef struct xfs_perag
spinlock_t pagb_lock; /* lock for pagb_list */
#endif
xfs_perag_busy_t *pagb_list; /* unstable blocks */
+#ifdef __KERNEL__
atomic_t pagf_fstrms; /* # of filestreams active in this AG */
int pag_ici_init; /* incore inode cache initialised */
rwlock_t pag_ici_lock; /* incore inode lock */
struct radix_tree_root pag_ici_root; /* incore inode cache root */
+#endif
} xfs_perag_t;
#define XFS_AG_MAXLEVELS(mp) ((mp)->m_ag_maxlevels)
Index: 2.6.x-xfs/fs/xfs/xfs_dir2_block.h
===================================================================
--- 2.6.x-xfs.orig/fs/xfs/xfs_dir2_block.h
+++ 2.6.x-xfs/fs/xfs/xfs_dir2_block.h
@@ -80,8 +80,10 @@ xfs_dir2_block_leaf_p(xfs_dir2_block_tai
* Function declarations.
*/
extern int xfs_dir2_block_addname(struct xfs_da_args *args);
+#ifdef __KERNEL__
extern int xfs_dir2_block_getdents(struct xfs_inode *dp, void *dirent,
xfs_off_t *offset, filldir_t filldir);
+#endif
extern int xfs_dir2_block_lookup(struct xfs_da_args *args);
extern int xfs_dir2_block_removename(struct xfs_da_args *args);
extern int xfs_dir2_block_replace(struct xfs_da_args *args);
Index: 2.6.x-xfs/fs/xfs/xfs_dir2_leaf.h
===================================================================
--- 2.6.x-xfs.orig/fs/xfs/xfs_dir2_leaf.h
+++ 2.6.x-xfs/fs/xfs/xfs_dir2_leaf.h
@@ -232,9 +232,11 @@ extern void xfs_dir2_leaf_compact(struct
extern void xfs_dir2_leaf_compact_x1(struct xfs_dabuf *bp, int *indexp,
int *lowstalep, int *highstalep,
int *lowlogp, int *highlogp);
+#ifdef __KERNEL__
extern int xfs_dir2_leaf_getdents(struct xfs_inode *dp, void *dirent,
size_t bufsize, xfs_off_t *offset,
filldir_t filldir);
+#endif
extern int xfs_dir2_leaf_init(struct xfs_da_args *args, xfs_dir2_db_t bno,
struct xfs_dabuf **bpp, int magic);
extern void xfs_dir2_leaf_log_ents(struct xfs_trans *tp, struct xfs_dabuf
*bp,
Index: 2.6.x-xfs/fs/xfs/xfs_dir2_sf.h
===================================================================
--- 2.6.x-xfs.orig/fs/xfs/xfs_dir2_sf.h
+++ 2.6.x-xfs/fs/xfs/xfs_dir2_sf.h
@@ -169,8 +169,10 @@ extern int xfs_dir2_block_to_sf(struct x
int size, xfs_dir2_sf_hdr_t *sfhp);
extern int xfs_dir2_sf_addname(struct xfs_da_args *args);
extern int xfs_dir2_sf_create(struct xfs_da_args *args, xfs_ino_t pino);
+#ifdef __KERNEL__
extern int xfs_dir2_sf_getdents(struct xfs_inode *dp, void *dirent,
xfs_off_t *offset, filldir_t filldir);
+#endif
extern int xfs_dir2_sf_lookup(struct xfs_da_args *args);
extern int xfs_dir2_sf_removename(struct xfs_da_args *args);
extern int xfs_dir2_sf_replace(struct xfs_da_args *args);
Index: 2.6.x-xfs/fs/xfs/xfs_inode_item.h
===================================================================
--- 2.6.x-xfs.orig/fs/xfs/xfs_inode_item.h
+++ 2.6.x-xfs/fs/xfs/xfs_inode_item.h
@@ -168,6 +168,8 @@ static inline int xfs_ilog_fext(int w)
return (w == XFS_DATA_FORK ? XFS_ILOG_DEXT : XFS_ILOG_AEXT);
}
+#ifdef __KERNEL__
+
static inline int xfs_inode_clean(xfs_inode_t *ip)
{
return (!ip->i_itemp ||
@@ -175,9 +177,6 @@ static inline int xfs_inode_clean(xfs_in
!ip->i_update_core;
}
-
-#ifdef __KERNEL__
-
extern void xfs_inode_item_init(struct xfs_inode *, struct xfs_mount *);
extern void xfs_inode_item_destroy(struct xfs_inode *);
extern void xfs_iflush_done(struct xfs_buf *, xfs_inode_log_item_t *);
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [REVIEW] Update kernel headers to compile in userspace (libxfs)
2008-07-29 2:25 [REVIEW] Update kernel headers to compile in userspace (libxfs) Barry Naujok
@ 2008-07-29 4:19 ` Christoph Hellwig
0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2008-07-29 4:19 UTC (permalink / raw)
To: Barry Naujok; +Cc: xfs@oss.sgi.com
On Tue, Jul 29, 2008 at 12:25:45PM +1000, Barry Naujok wrote:
> +#ifdef __KERNEL__
> atomic_t pagf_fstrms; /* # of filestreams active in this AG */
>
> int pag_ici_init; /* incore inode cache initialised */
> rwlock_t pag_ici_lock; /* incore inode lock */
> struct radix_tree_root pag_ici_root; /* incore inode cache root */
> +#endif
I gues this does indeed not make much sense in userspace.
> +#ifdef __KERNEL__
> extern int xfs_dir2_block_getdents(struct xfs_inode *dp, void *dirent,
> xfs_off_t *offset, filldir_t filldir);
> +#endif
Instead of all these ifdefs in the dir code wouldn't it be better
to just provide a filldir_t in userspace? getdents into a user
formatted buffers sounds at least like a theoretically useful
functionality for libxfs.
> Index: 2.6.x-xfs/fs/xfs/xfs_inode_item.h
> ===================================================================
> --- 2.6.x-xfs.orig/fs/xfs/xfs_inode_item.h
> +++ 2.6.x-xfs/fs/xfs/xfs_inode_item.h
> @@ -168,6 +168,8 @@ static inline int xfs_ilog_fext(int w)
> return (w == XFS_DATA_FORK ? XFS_ILOG_DEXT : XFS_ILOG_AEXT);
> }
>
> +#ifdef __KERNEL__
> +
> static inline int xfs_inode_clean(xfs_inode_t *ip)
> {
> return (!ip->i_itemp ||
> @@ -175,9 +177,6 @@ static inline int xfs_inode_clean(xfs_in
> !ip->i_update_core;
> }
>
> -
> -#ifdef __KERNEL__
> -
> extern void xfs_inode_item_init(struct xfs_inode *, struct xfs_mount *);
> extern void xfs_inode_item_destroy(struct xfs_inode *);
> extern void xfs_iflush_done(struct xfs_buf *, xfs_inode_log_item_t *);
Makes sense, too.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-07-29 4:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-29 2:25 [REVIEW] Update kernel headers to compile in userspace (libxfs) Barry Naujok
2008-07-29 4:19 ` Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox