Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 847fff5c authored by Barry Naujok's avatar Barry Naujok Committed by Lachlan McIlroy
Browse files

[XFS] Sync up kernel and user-space headers



SGI-PV: 986558

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

Signed-off-by: default avatarBarry Naujok <bnaujok@sgi.com>
Signed-off-by: default avatarChristoph Hellwig <hch@infradead.org>
Signed-off-by: default avatarLachlan McIlroy <lachlan@sgi.com>
parent 24ee0e49
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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)
+13 −14
Original line number Diff line number Diff line
@@ -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.
 */
@@ -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__ */
+27 −12
Original line number Diff line number Diff line
@@ -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? */
+1 −2
Original line number Diff line number Diff line
@@ -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 */
+32 −29
Original line number Diff line number Diff line
@@ -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
 */
@@ -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.
@@ -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
@@ -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.
 */
@@ -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
Loading