Skip to content

Commit

Permalink
[XFS] Sync up kernel and user-space headers
Browse files Browse the repository at this point in the history
SGI-PV: 986558

SGI-Modid: xfs-linux-melb:xfs-kern:32231a

Signed-off-by: Barry Naujok <bnaujok@sgi.com>
Signed-off-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
  • Loading branch information
Barry Naujok authored and Lachlan McIlroy committed Oct 30, 2008
1 parent 24ee0e4 commit 847fff5
Show file tree
Hide file tree
Showing 14 changed files with 383 additions and 389 deletions.
5 changes: 3 additions & 2 deletions fs/xfs/xfs_ag.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,15 +192,16 @@ typedef struct xfs_perag
xfs_agino_t pagi_freecount; /* number of free inodes */
xfs_agino_t pagi_count; /* number of allocated inodes */
int pagb_count; /* pagb slots in use */
xfs_perag_busy_t *pagb_list; /* unstable blocks */
#ifdef __KERNEL__
spinlock_t pagb_lock; /* lock for pagb_list */
#endif
xfs_perag_busy_t *pagb_list; /* unstable blocks */

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)
Expand Down
27 changes: 13 additions & 14 deletions fs/xfs/xfs_alloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,19 @@ extern ktrace_t *xfs_alloc_trace_buf;
#define XFS_ALLOC_KTRACE_BUSYSEARCH 6
#endif

void
xfs_alloc_mark_busy(xfs_trans_t *tp,
xfs_agnumber_t agno,
xfs_agblock_t bno,
xfs_extlen_t len);

void
xfs_alloc_clear_busy(xfs_trans_t *tp,
xfs_agnumber_t ag,
int idx);

#endif /* __KERNEL__ */

/*
* Compute and fill in value of m_ag_maxlevels.
*/
Expand Down Expand Up @@ -196,18 +209,4 @@ xfs_free_extent(
xfs_fsblock_t bno, /* starting block number of extent */
xfs_extlen_t len); /* length of extent */

void
xfs_alloc_mark_busy(xfs_trans_t *tp,
xfs_agnumber_t agno,
xfs_agblock_t bno,
xfs_extlen_t len);

void
xfs_alloc_clear_busy(xfs_trans_t *tp,
xfs_agnumber_t ag,
int idx);


#endif /* __KERNEL__ */

#endif /* __XFS_ALLOC_H__ */
39 changes: 27 additions & 12 deletions fs/xfs/xfs_arch.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,36 @@
#endif

#ifdef XFS_NATIVE_HOST
#define cpu_to_be16(val) ((__be16)(val))
#define cpu_to_be32(val) ((__be32)(val))
#define cpu_to_be64(val) ((__be64)(val))
#define be16_to_cpu(val) ((__uint16_t)(val))
#define be32_to_cpu(val) ((__uint32_t)(val))
#define be64_to_cpu(val) ((__uint64_t)(val))
#define cpu_to_be16(val) ((__force __be16)(__u16)(val))
#define cpu_to_be32(val) ((__force __be32)(__u32)(val))
#define cpu_to_be64(val) ((__force __be64)(__u64)(val))
#define be16_to_cpu(val) ((__force __u16)(__be16)(val))
#define be32_to_cpu(val) ((__force __u32)(__be32)(val))
#define be64_to_cpu(val) ((__force __u64)(__be64)(val))
#else
#define cpu_to_be16(val) (__swab16((__uint16_t)(val)))
#define cpu_to_be32(val) (__swab32((__uint32_t)(val)))
#define cpu_to_be64(val) (__swab64((__uint64_t)(val)))
#define be16_to_cpu(val) (__swab16((__be16)(val)))
#define be32_to_cpu(val) (__swab32((__be32)(val)))
#define be64_to_cpu(val) (__swab64((__be64)(val)))
#define cpu_to_be16(val) ((__force __be16)__swab16((__u16)(val)))
#define cpu_to_be32(val) ((__force __be32)__swab32((__u32)(val)))
#define cpu_to_be64(val) ((__force __be64)__swab64((__u64)(val)))
#define be16_to_cpu(val) (__swab16((__force __u16)(__be16)(val)))
#define be32_to_cpu(val) (__swab32((__force __u32)(__be32)(val)))
#define be64_to_cpu(val) (__swab64((__force __u64)(__be64)(val)))
#endif

static inline void be16_add_cpu(__be16 *a, __s16 b)
{
*a = cpu_to_be16(be16_to_cpu(*a) + b);
}

static inline void be32_add_cpu(__be32 *a, __s32 b)
{
*a = cpu_to_be32(be32_to_cpu(*a) + b);
}

static inline void be64_add_cpu(__be64 *a, __s64 b)
{
*a = cpu_to_be64(be64_to_cpu(*a) + b);
}

#endif /* __KERNEL__ */

/* do we need conversion? */
Expand Down
3 changes: 1 addition & 2 deletions fs/xfs/xfs_bit.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ static inline int xfs_highbit64(__uint64_t v)
/* Get low bit set out of 32-bit argument, -1 if none set */
static inline int xfs_lowbit32(__uint32_t v)
{
unsigned long t = v;
return (v) ? find_first_bit(&t, 32) : -1;
return ffs(v) - 1;
}

/* Get low bit set out of 64-bit argument, -1 if none set */
Expand Down
61 changes: 32 additions & 29 deletions fs/xfs/xfs_bmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,7 @@ typedef struct xfs_bmalloca {
char conv; /* overwriting unwritten extents */
} xfs_bmalloca_t;

#ifdef __KERNEL__

#if defined(XFS_BMAP_TRACE)
#if defined(__KERNEL__) && defined(XFS_BMAP_TRACE)
/*
* Trace operations for bmap extent tracing
*/
Expand All @@ -163,9 +161,12 @@ xfs_bmap_trace_exlist(
int whichfork); /* data or attr fork */
#define XFS_BMAP_TRACE_EXLIST(ip,c,w) \
xfs_bmap_trace_exlist(__func__,ip,c,w)
#else

#else /* __KERNEL__ && XFS_BMAP_TRACE */

#define XFS_BMAP_TRACE_EXLIST(ip,c,w)
#endif

#endif /* __KERNEL__ && XFS_BMAP_TRACE */

/*
* Convert inode from non-attributed to attributed.
Expand Down Expand Up @@ -205,20 +206,6 @@ xfs_bmap_compute_maxlevels(
struct xfs_mount *mp, /* file system mount structure */
int whichfork); /* data or attr fork */

/*
* Routine to be called at transaction's end by xfs_bmapi, xfs_bunmapi
* caller. Frees all the extents that need freeing, which must be done
* last due to locking considerations.
*
* Return 1 if the given transaction was committed and a new one allocated,
* and 0 otherwise.
*/
int /* error */
xfs_bmap_finish(
struct xfs_trans **tp, /* transaction pointer addr */
xfs_bmap_free_t *flist, /* i/o: list extents to free */
int *committed); /* xact committed or not */

/*
* Returns the file-relative block number of the first unused block in the file.
* This is the lowest-address hole if the file has holes, else the first block
Expand Down Expand Up @@ -343,6 +330,32 @@ xfs_bunmapi(
extents */
int *done); /* set if not done yet */

/*
* Check an extent list, which has just been read, for
* any bit in the extent flag field.
*/
int
xfs_check_nostate_extents(
struct xfs_ifork *ifp,
xfs_extnum_t idx,
xfs_extnum_t num);

#ifdef __KERNEL__

/*
* Routine to be called at transaction's end by xfs_bmapi, xfs_bunmapi
* caller. Frees all the extents that need freeing, which must be done
* last due to locking considerations.
*
* Return 1 if the given transaction was committed and a new one allocated,
* and 0 otherwise.
*/
int /* error */
xfs_bmap_finish(
struct xfs_trans **tp, /* transaction pointer addr */
xfs_bmap_free_t *flist, /* i/o: list extents to free */
int *committed); /* xact committed or not */

/*
* Fcntl interface to xfs_bmapi.
*/
Expand Down Expand Up @@ -374,16 +387,6 @@ xfs_bmap_count_blocks(
int whichfork,
int *count);

/*
* Check an extent list, which has just been read, for
* any bit in the extent flag field.
*/
int
xfs_check_nostate_extents(
struct xfs_ifork *ifp,
xfs_extnum_t idx,
xfs_extnum_t num);

/*
* Search the extent records for the entry containing block bno.
* If bno lies in a hole, point to the next entry. If bno lies
Expand Down
3 changes: 0 additions & 3 deletions fs/xfs/xfs_bmap_btree.h
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,6 @@ typedef struct xfs_btree_lblock xfs_bmbt_block_t;
be16_to_cpu((bb)->bb_numrecs) <= (mp)->m_bmap_dmxr[(level) != 0])


#ifdef __KERNEL__

/*
* Prototypes for xfs_bmap.c to call.
*/
Expand Down Expand Up @@ -264,6 +262,5 @@ extern void xfs_bmbt_to_bmdr(xfs_bmbt_block_t *, int, xfs_bmdr_block_t *, int);
extern struct xfs_btree_cur *xfs_bmbt_init_cursor(struct xfs_mount *,
struct xfs_trans *, struct xfs_inode *, int);

#endif /* __KERNEL__ */

#endif /* __XFS_BMAP_BTREE_H__ */
4 changes: 0 additions & 4 deletions fs/xfs/xfs_btree.h
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,6 @@ typedef struct xfs_btree_cur
#define XFS_BUF_TO_SBLOCK(bp) ((xfs_btree_sblock_t *)XFS_BUF_PTR(bp))


#ifdef __KERNEL__

/*
* Check that long form block header is ok.
*/
Expand Down Expand Up @@ -515,8 +513,6 @@ static inline int xfs_btree_get_level(struct xfs_btree_block *block)
return be16_to_cpu(block->bb_level);
}

#endif /* __KERNEL__ */


/*
* Min and max functions for extlen, agblock, fileoff, and filblks types.
Expand Down
4 changes: 1 addition & 3 deletions fs/xfs/xfs_da_btree.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,8 @@ struct xfs_nameops {
};


#ifdef __KERNEL__
/*========================================================================
* Function prototypes for the kernel.
* Function prototypes.
*========================================================================*/

/*
Expand Down Expand Up @@ -269,6 +268,5 @@ xfs_daddr_t xfs_da_blkno(xfs_dabuf_t *dabuf);

extern struct kmem_zone *xfs_da_state_zone;
extern struct kmem_zone *xfs_dabuf_zone;
#endif /* __KERNEL__ */

#endif /* __XFS_DA_BTREE_H__ */
3 changes: 0 additions & 3 deletions fs/xfs/xfs_ialloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ static inline int xfs_ialloc_find_free(xfs_inofree_t *fp)
}


#ifdef __KERNEL__
/*
* Allocate an inode on disk.
* Mode is used to tell whether the new inode will need space, and whether
Expand Down Expand Up @@ -174,6 +173,4 @@ int xfs_inobt_lookup_le(struct xfs_btree_cur *cur, xfs_agino_t ino,
extern int xfs_inobt_get_rec(struct xfs_btree_cur *cur, xfs_agino_t *ino,
__int32_t *fcnt, xfs_inofree_t *free, int *stat);

#endif /* __KERNEL__ */

#endif /* __XFS_IALLOC_H__ */
2 changes: 0 additions & 2 deletions fs/xfs/xfs_imap.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,9 @@ typedef struct xfs_imap {
ushort im_boffset; /* inode offset in block in bytes */
} xfs_imap_t;

#ifdef __KERNEL__
struct xfs_mount;
struct xfs_trans;
int xfs_imap(struct xfs_mount *, struct xfs_trans *, xfs_ino_t,
xfs_imap_t *, uint);
#endif

#endif /* __XFS_IMAP_H__ */
Loading

0 comments on commit 847fff5

Please sign in to comment.