#ifndef __XFS_RTBITMAP_H__
#define __XFS_RTBITMAP_H__
struct xfs_rtalloc_args { … };
static inline xfs_rtblock_t
xfs_rtx_to_rtb(
struct xfs_mount *mp,
xfs_rtxnum_t rtx)
{ … }
static inline xfs_extlen_t
xfs_rtxlen_to_extlen(
struct xfs_mount *mp,
xfs_rtxlen_t rtxlen)
{ … }
static inline unsigned int
xfs_extlen_to_rtxmod(
struct xfs_mount *mp,
xfs_extlen_t len)
{ … }
static inline xfs_rtxlen_t
xfs_extlen_to_rtxlen(
struct xfs_mount *mp,
xfs_extlen_t len)
{ … }
static inline xfs_rtxnum_t
xfs_rtb_to_rtx(
struct xfs_mount *mp,
xfs_rtblock_t rtbno)
{ … }
static inline xfs_extlen_t
xfs_rtb_to_rtxoff(
struct xfs_mount *mp,
xfs_rtblock_t rtbno)
{ … }
static inline xfs_rtxnum_t
xfs_rtb_to_rtxrem(
struct xfs_mount *mp,
xfs_rtblock_t rtbno,
xfs_extlen_t *off)
{ … }
static inline xfs_rtxnum_t
xfs_rtb_to_rtxup(
struct xfs_mount *mp,
xfs_rtblock_t rtbno)
{ … }
static inline xfs_rtblock_t
xfs_rtb_roundup_rtx(
struct xfs_mount *mp,
xfs_rtblock_t rtbno)
{ … }
static inline xfs_rtblock_t
xfs_rtb_rounddown_rtx(
struct xfs_mount *mp,
xfs_rtblock_t rtbno)
{ … }
static inline xfs_fileoff_t
xfs_rtx_to_rbmblock(
struct xfs_mount *mp,
xfs_rtxnum_t rtx)
{ … }
static inline unsigned int
xfs_rtx_to_rbmword(
struct xfs_mount *mp,
xfs_rtxnum_t rtx)
{ … }
static inline xfs_rtxnum_t
xfs_rbmblock_to_rtx(
struct xfs_mount *mp,
xfs_fileoff_t rbmoff)
{ … }
static inline union xfs_rtword_raw *
xfs_rbmblock_wordptr(
struct xfs_rtalloc_args *args,
unsigned int index)
{ … }
static inline xfs_rtword_t
xfs_rtbitmap_getword(
struct xfs_rtalloc_args *args,
unsigned int index)
{ … }
static inline void
xfs_rtbitmap_setword(
struct xfs_rtalloc_args *args,
unsigned int index,
xfs_rtword_t value)
{ … }
static inline xfs_rtsumoff_t
xfs_rtsumoffs(
struct xfs_mount *mp,
int log2_len,
xfs_fileoff_t rbmoff)
{ … }
static inline xfs_fileoff_t
xfs_rtsumoffs_to_block(
struct xfs_mount *mp,
xfs_rtsumoff_t rsumoff)
{ … }
static inline unsigned int
xfs_rtsumoffs_to_infoword(
struct xfs_mount *mp,
xfs_rtsumoff_t rsumoff)
{ … }
static inline union xfs_suminfo_raw *
xfs_rsumblock_infoptr(
struct xfs_rtalloc_args *args,
unsigned int index)
{ … }
static inline xfs_suminfo_t
xfs_suminfo_get(
struct xfs_rtalloc_args *args,
unsigned int index)
{ … }
static inline xfs_suminfo_t
xfs_suminfo_add(
struct xfs_rtalloc_args *args,
unsigned int index,
int delta)
{ … }
struct xfs_rtalloc_rec { … };
xfs_rtalloc_query_range_fn;
#ifdef CONFIG_XFS_RT
void xfs_rtbuf_cache_relse(struct xfs_rtalloc_args *args);
int xfs_rtbuf_get(struct xfs_rtalloc_args *args, xfs_fileoff_t block,
int issum);
static inline int
xfs_rtbitmap_read_buf(
struct xfs_rtalloc_args *args,
xfs_fileoff_t block)
{ … }
static inline int
xfs_rtsummary_read_buf(
struct xfs_rtalloc_args *args,
xfs_fileoff_t block)
{ … }
int xfs_rtcheck_range(struct xfs_rtalloc_args *args, xfs_rtxnum_t start,
xfs_rtxlen_t len, int val, xfs_rtxnum_t *new, int *stat);
int xfs_rtfind_back(struct xfs_rtalloc_args *args, xfs_rtxnum_t start,
xfs_rtxnum_t limit, xfs_rtxnum_t *rtblock);
int xfs_rtfind_forw(struct xfs_rtalloc_args *args, xfs_rtxnum_t start,
xfs_rtxnum_t limit, xfs_rtxnum_t *rtblock);
int xfs_rtmodify_range(struct xfs_rtalloc_args *args, xfs_rtxnum_t start,
xfs_rtxlen_t len, int val);
int xfs_rtget_summary(struct xfs_rtalloc_args *args, int log,
xfs_fileoff_t bbno, xfs_suminfo_t *sum);
int xfs_rtmodify_summary(struct xfs_rtalloc_args *args, int log,
xfs_fileoff_t bbno, int delta);
int xfs_rtfree_range(struct xfs_rtalloc_args *args, xfs_rtxnum_t start,
xfs_rtxlen_t len);
int xfs_rtalloc_query_range(struct xfs_mount *mp, struct xfs_trans *tp,
const struct xfs_rtalloc_rec *low_rec,
const struct xfs_rtalloc_rec *high_rec,
xfs_rtalloc_query_range_fn fn, void *priv);
int xfs_rtalloc_query_all(struct xfs_mount *mp, struct xfs_trans *tp,
xfs_rtalloc_query_range_fn fn,
void *priv);
int xfs_rtalloc_extent_is_free(struct xfs_mount *mp, struct xfs_trans *tp,
xfs_rtxnum_t start, xfs_rtxlen_t len,
bool *is_free);
int
xfs_rtfree_extent(
struct xfs_trans *tp,
xfs_rtxnum_t start,
xfs_rtxlen_t len);
int xfs_rtfree_blocks(struct xfs_trans *tp, xfs_fsblock_t rtbno,
xfs_filblks_t rtlen);
xfs_filblks_t xfs_rtbitmap_blockcount(struct xfs_mount *mp, xfs_rtbxlen_t
rtextents);
unsigned long long xfs_rtbitmap_wordcount(struct xfs_mount *mp,
xfs_rtbxlen_t rtextents);
xfs_filblks_t xfs_rtsummary_blockcount(struct xfs_mount *mp,
unsigned int rsumlevels, xfs_extlen_t rbmblocks);
unsigned long long xfs_rtsummary_wordcount(struct xfs_mount *mp,
unsigned int rsumlevels, xfs_extlen_t rbmblocks);
void xfs_rtbitmap_lock(struct xfs_trans *tp, struct xfs_mount *mp);
void xfs_rtbitmap_unlock(struct xfs_mount *mp);
#define XFS_RBMLOCK_BITMAP …
#define XFS_RBMLOCK_SUMMARY …
void xfs_rtbitmap_lock_shared(struct xfs_mount *mp,
unsigned int rbmlock_flags);
void xfs_rtbitmap_unlock_shared(struct xfs_mount *mp,
unsigned int rbmlock_flags);
#else
#define xfs_rtfree_extent …
#define xfs_rtfree_blocks …
#define xfs_rtalloc_query_range …
#define xfs_rtalloc_query_all …
#define xfs_rtbitmap_read_buf …
#define xfs_rtsummary_read_buf …
#define xfs_rtbuf_cache_relse …
#define xfs_rtalloc_extent_is_free …
static inline xfs_filblks_t
xfs_rtbitmap_blockcount(struct xfs_mount *mp, xfs_rtbxlen_t rtextents)
{
return 0;
}
#define xfs_rtbitmap_wordcount …
#define xfs_rtsummary_blockcount …
#define xfs_rtsummary_wordcount …
#define xfs_rtbitmap_lock …
#define xfs_rtbitmap_unlock …
#define xfs_rtbitmap_lock_shared …
#define xfs_rtbitmap_unlock_shared …
#endif
#endif