xfs_btree.h

来自「Linux Kernel 2.6.9 for OMAP1710」· C头文件 代码 · 共 593 行 · 第 1/2 页

H
593
字号
	xfs_agblock_t		ptr,	/* btree block disk address */	int			level);	/* btree block level *//* * Delete the btree cursor. */voidxfs_btree_del_cursor(	xfs_btree_cur_t		*cur,	/* btree cursor */	int			error);	/* del because of error *//* * Duplicate the btree cursor. * Allocate a new one, copy the record, re-get the buffers. */int					/* error */xfs_btree_dup_cursor(	xfs_btree_cur_t		*cur,	/* input cursor */	xfs_btree_cur_t		**ncur);/* output cursor *//* * Change the cursor to point to the first record in the current block * at the given level.  Other levels are unaffected. */int					/* success=1, failure=0 */xfs_btree_firstrec(	xfs_btree_cur_t		*cur,	/* btree cursor */	int			level);	/* level to change *//* * Retrieve the block pointer from the cursor at the given level. * This may be a bmap btree root or from a buffer. */xfs_btree_block_t *			/* generic btree block pointer */xfs_btree_get_block(	xfs_btree_cur_t		*cur,	/* btree cursor */	int			level,	/* level in btree */	struct xfs_buf		**bpp);	/* buffer containing the block *//* * Get a buffer for the block, return it with no data read. * Long-form addressing. */struct xfs_buf *				/* buffer for fsbno */xfs_btree_get_bufl(	struct xfs_mount	*mp,	/* file system mount point */	struct xfs_trans	*tp,	/* transaction pointer */	xfs_fsblock_t		fsbno,	/* file system block number */	uint			lock);	/* lock flags for get_buf *//* * Get a buffer for the block, return it with no data read. * Short-form addressing. */struct xfs_buf *				/* buffer for agno/agbno */xfs_btree_get_bufs(	struct xfs_mount	*mp,	/* file system mount point */	struct xfs_trans	*tp,	/* transaction pointer */	xfs_agnumber_t		agno,	/* allocation group number */	xfs_agblock_t		agbno,	/* allocation group block number */	uint			lock);	/* lock flags for get_buf *//* * Allocate a new btree cursor. * The cursor is either for allocation (A) or bmap (B). */xfs_btree_cur_t *			/* new btree cursor */xfs_btree_init_cursor(	struct xfs_mount	*mp,	/* file system mount point */	struct xfs_trans	*tp,	/* transaction pointer */	struct xfs_buf		*agbp,	/* (A only) buffer for agf structure */	xfs_agnumber_t		agno,	/* (A only) allocation group number */	xfs_btnum_t		btnum,	/* btree identifier */	struct xfs_inode	*ip,	/* (B only) inode owning the btree */	int			whichfork); /* (B only) data/attr fork *//* * Check for the cursor referring to the last block at the given level. */int					/* 1=is last block, 0=not last block */xfs_btree_islastblock(	xfs_btree_cur_t		*cur,	/* btree cursor */	int			level);	/* level to check *//* * Change the cursor to point to the last record in the current block * at the given level.  Other levels are unaffected. */int					/* success=1, failure=0 */xfs_btree_lastrec(	xfs_btree_cur_t		*cur,	/* btree cursor */	int			level);	/* level to change *//* * Compute first and last byte offsets for the fields given. * Interprets the offsets table, which contains struct field offsets. */voidxfs_btree_offsets(	__int64_t		fields,	/* bitmask of fields */	const short		*offsets,/* table of field offsets */	int			nbits,	/* number of bits to inspect */	int			*first,	/* output: first byte offset */	int			*last);	/* output: last byte offset *//* * Get a buffer for the block, return it read in. * Long-form addressing. */int					/* error */xfs_btree_read_bufl(	struct xfs_mount	*mp,	/* file system mount point */	struct xfs_trans	*tp,	/* transaction pointer */	xfs_fsblock_t		fsbno,	/* file system block number */	uint			lock,	/* lock flags for read_buf */	struct xfs_buf		**bpp,	/* buffer for fsbno */	int			refval);/* ref count value for buffer *//* * Get a buffer for the block, return it read in. * Short-form addressing. */int					/* error */xfs_btree_read_bufs(	struct xfs_mount	*mp,	/* file system mount point */	struct xfs_trans	*tp,	/* transaction pointer */	xfs_agnumber_t		agno,	/* allocation group number */	xfs_agblock_t		agbno,	/* allocation group block number */	uint			lock,	/* lock flags for read_buf */	struct xfs_buf		**bpp,	/* buffer for agno/agbno */	int			refval);/* ref count value for buffer *//* * Read-ahead the block, don't wait for it, don't return a buffer. * Long-form addressing. */void					/* error */xfs_btree_reada_bufl(	struct xfs_mount	*mp,	/* file system mount point */	xfs_fsblock_t		fsbno,	/* file system block number */	xfs_extlen_t		count);	/* count of filesystem blocks *//* * Read-ahead the block, don't wait for it, don't return a buffer. * Short-form addressing. */void					/* error */xfs_btree_reada_bufs(	struct xfs_mount	*mp,	/* file system mount point */	xfs_agnumber_t		agno,	/* allocation group number */	xfs_agblock_t		agbno,	/* allocation group block number */	xfs_extlen_t		count);	/* count of filesystem blocks *//* * Read-ahead btree blocks, at the given level. * Bits in lr are set from XFS_BTCUR_{LEFT,RIGHT}RA. */int					/* readahead block count */xfs_btree_readahead_core(	xfs_btree_cur_t		*cur,	/* btree cursor */	int			lev,	/* level in btree */	int			lr);	/* left/right bits */static inline int			/* readahead block count */xfs_btree_readahead(	xfs_btree_cur_t		*cur,	/* btree cursor */	int			lev,	/* level in btree */	int			lr)	/* left/right bits */{	if ((cur->bc_ra[lev] | lr) == cur->bc_ra[lev])		return 0;	return xfs_btree_readahead_core(cur, lev, lr);}/* * Set the buffer for level "lev" in the cursor to bp, releasing * any previous buffer. */voidxfs_btree_setbuf(	xfs_btree_cur_t		*cur,	/* btree cursor */	int			lev,	/* level in btree */	struct xfs_buf		*bp);	/* new buffer to set */#endif	/* __KERNEL__ *//* * Min and max functions for extlen, agblock, fileoff, and filblks types. */#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_EXTLEN_MIN)xfs_extlen_t xfs_extlen_min(xfs_extlen_t a, xfs_extlen_t b);#define	XFS_EXTLEN_MIN(a,b)	xfs_extlen_min(a,b)#else#define	XFS_EXTLEN_MIN(a,b)	\	((xfs_extlen_t)(a) < (xfs_extlen_t)(b) ? \	 (xfs_extlen_t)(a) : (xfs_extlen_t)(b))#endif#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_EXTLEN_MAX)xfs_extlen_t xfs_extlen_max(xfs_extlen_t a, xfs_extlen_t b);#define	XFS_EXTLEN_MAX(a,b)	xfs_extlen_max(a,b)#else#define	XFS_EXTLEN_MAX(a,b)	\	((xfs_extlen_t)(a) > (xfs_extlen_t)(b) ? \	 (xfs_extlen_t)(a) : (xfs_extlen_t)(b))#endif#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_AGBLOCK_MIN)xfs_agblock_t xfs_agblock_min(xfs_agblock_t a, xfs_agblock_t b);#define	XFS_AGBLOCK_MIN(a,b)	xfs_agblock_min(a,b)#else#define	XFS_AGBLOCK_MIN(a,b)	\	((xfs_agblock_t)(a) < (xfs_agblock_t)(b) ? \	 (xfs_agblock_t)(a) : (xfs_agblock_t)(b))#endif#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_AGBLOCK_MAX)xfs_agblock_t xfs_agblock_max(xfs_agblock_t a, xfs_agblock_t b);#define	XFS_AGBLOCK_MAX(a,b)	xfs_agblock_max(a,b)#else#define	XFS_AGBLOCK_MAX(a,b)	\	((xfs_agblock_t)(a) > (xfs_agblock_t)(b) ? \	 (xfs_agblock_t)(a) : (xfs_agblock_t)(b))#endif#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_FILEOFF_MIN)xfs_fileoff_t xfs_fileoff_min(xfs_fileoff_t a, xfs_fileoff_t b);#define	XFS_FILEOFF_MIN(a,b)	xfs_fileoff_min(a,b)#else#define	XFS_FILEOFF_MIN(a,b)	\	((xfs_fileoff_t)(a) < (xfs_fileoff_t)(b) ? \	 (xfs_fileoff_t)(a) : (xfs_fileoff_t)(b))#endif#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_FILEOFF_MAX)xfs_fileoff_t xfs_fileoff_max(xfs_fileoff_t a, xfs_fileoff_t b);#define	XFS_FILEOFF_MAX(a,b)	xfs_fileoff_max(a,b)#else#define	XFS_FILEOFF_MAX(a,b)	\	((xfs_fileoff_t)(a) > (xfs_fileoff_t)(b) ? \	 (xfs_fileoff_t)(a) : (xfs_fileoff_t)(b))#endif#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_FILBLKS_MIN)xfs_filblks_t xfs_filblks_min(xfs_filblks_t a, xfs_filblks_t b);#define	XFS_FILBLKS_MIN(a,b)	xfs_filblks_min(a,b)#else#define	XFS_FILBLKS_MIN(a,b)	\	((xfs_filblks_t)(a) < (xfs_filblks_t)(b) ? \	 (xfs_filblks_t)(a) : (xfs_filblks_t)(b))#endif#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_FILBLKS_MAX)xfs_filblks_t xfs_filblks_max(xfs_filblks_t a, xfs_filblks_t b);#define	XFS_FILBLKS_MAX(a,b)	xfs_filblks_max(a,b)#else#define	XFS_FILBLKS_MAX(a,b)	\	((xfs_filblks_t)(a) > (xfs_filblks_t)(b) ? \	 (xfs_filblks_t)(a) : (xfs_filblks_t)(b))#endif#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_FSB_SANITY_CHECK)int xfs_fsb_sanity_check(struct xfs_mount *mp, xfs_fsblock_t fsb);#define	XFS_FSB_SANITY_CHECK(mp,fsb)	xfs_fsb_sanity_check(mp,fsb)#else#define	XFS_FSB_SANITY_CHECK(mp,fsb)	\	(XFS_FSB_TO_AGNO(mp, fsb) < mp->m_sb.sb_agcount && \	 XFS_FSB_TO_AGBNO(mp, fsb) < mp->m_sb.sb_agblocks)#endif/* * Macros to set EFSCORRUPTED & return/branch. */#define	XFS_WANT_CORRUPTED_GOTO(x,l)	\	{ \		int fs_is_ok = (x); \		ASSERT(fs_is_ok); \		if (unlikely(!fs_is_ok)) { \			XFS_ERROR_REPORT("XFS_WANT_CORRUPTED_GOTO", \					 XFS_ERRLEVEL_LOW, NULL); \			error = XFS_ERROR(EFSCORRUPTED); \			goto l; \		} \	}#define	XFS_WANT_CORRUPTED_RETURN(x)	\	{ \		int fs_is_ok = (x); \		ASSERT(fs_is_ok); \		if (unlikely(!fs_is_ok)) { \			XFS_ERROR_REPORT("XFS_WANT_CORRUPTED_RETURN", \					 XFS_ERRLEVEL_LOW, NULL); \			return XFS_ERROR(EFSCORRUPTED); \		} \	}#endif	/* __XFS_BTREE_H__ */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?