#include "xfs.h"
#include "xfs_fs.h"
#include "xfs_shared.h"
#include "xfs_format.h"
#include "xfs_log_format.h"
#include "xfs_trans_resv.h"
#include "xfs_mount.h"
#include "xfs_trans.h"
#include "xfs_alloc.h"
#include "xfs_btree.h"
#include "xfs_btree_staging.h"
#include "xfs_rmap.h"
#include "xfs_rmap_btree.h"
#include "xfs_health.h"
#include "xfs_trace.h"
#include "xfs_error.h"
#include "xfs_extent_busy.h"
#include "xfs_ag.h"
#include "xfs_ag_resv.h"
#include "xfs_buf_mem.h"
#include "xfs_btree_mem.h"
static struct kmem_cache *xfs_rmapbt_cur_cache;
static struct xfs_btree_cur *
xfs_rmapbt_dup_cursor(
struct xfs_btree_cur *cur)
{ … }
STATIC void
xfs_rmapbt_set_root(
struct xfs_btree_cur *cur,
const union xfs_btree_ptr *ptr,
int inc)
{ … }
STATIC int
xfs_rmapbt_alloc_block(
struct xfs_btree_cur *cur,
const union xfs_btree_ptr *start,
union xfs_btree_ptr *new,
int *stat)
{ … }
STATIC int
xfs_rmapbt_free_block(
struct xfs_btree_cur *cur,
struct xfs_buf *bp)
{ … }
STATIC int
xfs_rmapbt_get_minrecs(
struct xfs_btree_cur *cur,
int level)
{ … }
STATIC int
xfs_rmapbt_get_maxrecs(
struct xfs_btree_cur *cur,
int level)
{ … }
static inline __be64 ondisk_rec_offset_to_key(const union xfs_btree_rec *rec)
{ … }
STATIC void
xfs_rmapbt_init_key_from_rec(
union xfs_btree_key *key,
const union xfs_btree_rec *rec)
{ … }
STATIC void
xfs_rmapbt_init_high_key_from_rec(
union xfs_btree_key *key,
const union xfs_btree_rec *rec)
{ … }
STATIC void
xfs_rmapbt_init_rec_from_cur(
struct xfs_btree_cur *cur,
union xfs_btree_rec *rec)
{ … }
STATIC void
xfs_rmapbt_init_ptr_from_cur(
struct xfs_btree_cur *cur,
union xfs_btree_ptr *ptr)
{ … }
static inline uint64_t offset_keymask(uint64_t offset)
{ … }
STATIC int64_t
xfs_rmapbt_key_diff(
struct xfs_btree_cur *cur,
const union xfs_btree_key *key)
{ … }
STATIC int64_t
xfs_rmapbt_diff_two_keys(
struct xfs_btree_cur *cur,
const union xfs_btree_key *k1,
const union xfs_btree_key *k2,
const union xfs_btree_key *mask)
{ … }
static xfs_failaddr_t
xfs_rmapbt_verify(
struct xfs_buf *bp)
{ … }
static void
xfs_rmapbt_read_verify(
struct xfs_buf *bp)
{ … }
static void
xfs_rmapbt_write_verify(
struct xfs_buf *bp)
{ … }
const struct xfs_buf_ops xfs_rmapbt_buf_ops = …;
STATIC int
xfs_rmapbt_keys_inorder(
struct xfs_btree_cur *cur,
const union xfs_btree_key *k1,
const union xfs_btree_key *k2)
{ … }
STATIC int
xfs_rmapbt_recs_inorder(
struct xfs_btree_cur *cur,
const union xfs_btree_rec *r1,
const union xfs_btree_rec *r2)
{ … }
STATIC enum xbtree_key_contig
xfs_rmapbt_keys_contiguous(
struct xfs_btree_cur *cur,
const union xfs_btree_key *key1,
const union xfs_btree_key *key2,
const union xfs_btree_key *mask)
{ … }
const struct xfs_btree_ops xfs_rmapbt_ops = …;
struct xfs_btree_cur *
xfs_rmapbt_init_cursor(
struct xfs_mount *mp,
struct xfs_trans *tp,
struct xfs_buf *agbp,
struct xfs_perag *pag)
{ … }
#ifdef CONFIG_XFS_BTREE_IN_MEM
static inline unsigned int
xfs_rmapbt_mem_block_maxrecs(
unsigned int blocklen,
bool leaf)
{ … }
static xfs_failaddr_t
xfs_rmapbt_mem_verify(
struct xfs_buf *bp)
{ … }
static void
xfs_rmapbt_mem_rw_verify(
struct xfs_buf *bp)
{ … }
static const struct xfs_buf_ops xfs_rmapbt_mem_buf_ops = …;
const struct xfs_btree_ops xfs_rmapbt_mem_ops = …;
struct xfs_btree_cur *
xfs_rmapbt_mem_cursor(
struct xfs_perag *pag,
struct xfs_trans *tp,
struct xfbtree *xfbt)
{ … }
int
xfs_rmapbt_mem_init(
struct xfs_mount *mp,
struct xfbtree *xfbt,
struct xfs_buftarg *btp,
xfs_agnumber_t agno)
{ … }
static unsigned int
xfs_rmapbt_mem_maxlevels(void)
{ … }
#else
#define xfs_rmapbt_mem_maxlevels …
#endif
void
xfs_rmapbt_commit_staged_btree(
struct xfs_btree_cur *cur,
struct xfs_trans *tp,
struct xfs_buf *agbp)
{ … }
static inline unsigned int
xfs_rmapbt_block_maxrecs(
unsigned int blocklen,
bool leaf)
{ … }
int
xfs_rmapbt_maxrecs(
int blocklen,
int leaf)
{ … }
unsigned int
xfs_rmapbt_maxlevels_ondisk(void)
{ … }
void
xfs_rmapbt_compute_maxlevels(
struct xfs_mount *mp)
{ … }
xfs_extlen_t
xfs_rmapbt_calc_size(
struct xfs_mount *mp,
unsigned long long len)
{ … }
xfs_extlen_t
xfs_rmapbt_max_size(
struct xfs_mount *mp,
xfs_agblock_t agblocks)
{ … }
int
xfs_rmapbt_calc_reserves(
struct xfs_mount *mp,
struct xfs_trans *tp,
struct xfs_perag *pag,
xfs_extlen_t *ask,
xfs_extlen_t *used)
{ … }
int __init
xfs_rmapbt_init_cur_cache(void)
{ … }
void
xfs_rmapbt_destroy_cur_cache(void)
{ … }