diff options
Diffstat (limited to 'fs/xfs/xfs_rtalloc.h')
| -rw-r--r-- | fs/xfs/xfs_rtalloc.h | 79 | 
1 files changed, 27 insertions, 52 deletions
diff --git a/fs/xfs/xfs_rtalloc.h b/fs/xfs/xfs_rtalloc.h index ff614c29b44..752b63d1030 100644 --- a/fs/xfs/xfs_rtalloc.h +++ b/fs/xfs/xfs_rtalloc.h @@ -18,58 +18,11 @@  #ifndef __XFS_RTALLOC_H__  #define	__XFS_RTALLOC_H__ +/* kernel only definitions and functions */ +  struct xfs_mount;  struct xfs_trans; -/* Min and max rt extent sizes, specified in bytes */ -#define	XFS_MAX_RTEXTSIZE	(1024 * 1024 * 1024)	/* 1GB */ -#define	XFS_DFL_RTEXTSIZE	(64 * 1024)	        /* 64kB */ -#define	XFS_MIN_RTEXTSIZE	(4 * 1024)		/* 4kB */ - -/* - * Constants for bit manipulations. - */ -#define	XFS_NBBYLOG	3		/* log2(NBBY) */ -#define	XFS_WORDLOG	2		/* log2(sizeof(xfs_rtword_t)) */ -#define	XFS_NBWORDLOG	(XFS_NBBYLOG + XFS_WORDLOG) -#define	XFS_NBWORD	(1 << XFS_NBWORDLOG) -#define	XFS_WORDMASK	((1 << XFS_WORDLOG) - 1) - -#define	XFS_BLOCKSIZE(mp)	((mp)->m_sb.sb_blocksize) -#define	XFS_BLOCKMASK(mp)	((mp)->m_blockmask) -#define	XFS_BLOCKWSIZE(mp)	((mp)->m_blockwsize) -#define	XFS_BLOCKWMASK(mp)	((mp)->m_blockwmask) - -/* - * Summary and bit manipulation macros. - */ -#define	XFS_SUMOFFS(mp,ls,bb)	((int)((ls) * (mp)->m_sb.sb_rbmblocks + (bb))) -#define	XFS_SUMOFFSTOBLOCK(mp,s)	\ -	(((s) * (uint)sizeof(xfs_suminfo_t)) >> (mp)->m_sb.sb_blocklog) -#define	XFS_SUMPTR(mp,bp,so)	\ -	((xfs_suminfo_t *)((char *)XFS_BUF_PTR(bp) + \ -		(((so) * (uint)sizeof(xfs_suminfo_t)) & XFS_BLOCKMASK(mp)))) - -#define	XFS_BITTOBLOCK(mp,bi)	((bi) >> (mp)->m_blkbit_log) -#define	XFS_BLOCKTOBIT(mp,bb)	((bb) << (mp)->m_blkbit_log) -#define	XFS_BITTOWORD(mp,bi)	\ -	((int)(((bi) >> XFS_NBWORDLOG) & XFS_BLOCKWMASK(mp))) - -#define	XFS_RTMIN(a,b)	((a) < (b) ? (a) : (b)) -#define	XFS_RTMAX(a,b)	((a) > (b) ? (a) : (b)) - -#define	XFS_RTLOBIT(w)	xfs_lowbit32(w) -#define	XFS_RTHIBIT(w)	xfs_highbit32(w) - -#if XFS_BIG_BLKNOS -#define	XFS_RTBLOCKLOG(b)	xfs_highbit64(b) -#else -#define	XFS_RTBLOCKLOG(b)	xfs_highbit32(b) -#endif - - -#ifdef __KERNEL__ -  #ifdef CONFIG_XFS_RT  /*   * Function prototypes for exported functions. @@ -142,6 +95,30 @@ xfs_growfs_rt(  	struct xfs_mount	*mp,	/* file system mount structure */  	xfs_growfs_rt_t		*in);	/* user supplied growfs struct */ +/* + * From xfs_rtbitmap.c + */ +int xfs_rtbuf_get(struct xfs_mount *mp, struct xfs_trans *tp, +		  xfs_rtblock_t block, int issum, struct xfs_buf **bpp); +int xfs_rtcheck_range(struct xfs_mount *mp, struct xfs_trans *tp, +		      xfs_rtblock_t start, xfs_extlen_t len, int val, +		      xfs_rtblock_t *new, int *stat); +int xfs_rtfind_back(struct xfs_mount *mp, struct xfs_trans *tp, +		    xfs_rtblock_t start, xfs_rtblock_t limit, +		    xfs_rtblock_t *rtblock); +int xfs_rtfind_forw(struct xfs_mount *mp, struct xfs_trans *tp, +		    xfs_rtblock_t start, xfs_rtblock_t limit, +		    xfs_rtblock_t *rtblock); +int xfs_rtmodify_range(struct xfs_mount *mp, struct xfs_trans *tp, +		       xfs_rtblock_t start, xfs_extlen_t len, int val); +int xfs_rtmodify_summary(struct xfs_mount *mp, struct xfs_trans *tp, int log, +			 xfs_rtblock_t bbno, int delta, xfs_buf_t **rbpp, +			 xfs_fsblock_t *rsb); +int xfs_rtfree_range(struct xfs_mount *mp, struct xfs_trans *tp, +		     xfs_rtblock_t start, xfs_extlen_t len, +		     struct xfs_buf **rbpp, xfs_fsblock_t *rsb); + +  #else  # define xfs_rtallocate_extent(t,b,min,max,l,a,f,p,rb)  (ENOSYS)  # define xfs_rtfree_extent(t,b,l)                       (ENOSYS) @@ -154,13 +131,11 @@ xfs_rtmount_init(  	if (mp->m_sb.sb_rblocks == 0)  		return 0; -	cmn_err(CE_WARN, "XFS: Not built with CONFIG_XFS_RT"); +	xfs_warn(mp, "Not built with CONFIG_XFS_RT");  	return ENOSYS;  }  # define xfs_rtmount_inodes(m)  (((mp)->m_sb.sb_rblocks == 0)? 0 : (ENOSYS))  # define xfs_rtunmount_inodes(m)  #endif	/* CONFIG_XFS_RT */ -#endif	/* __KERNEL__ */ -  #endif	/* __XFS_RTALLOC_H__ */  | 
