#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_btree.h"
#include "xfs_btree_staging.h"
#include "xfs_alloc_btree.h"
#include "xfs_alloc.h"
#include "xfs_extent_busy.h"
#include "xfs_error.h"
#include "xfs_health.h"
#include "xfs_trace.h"
#include "xfs_trans.h"
#include "xfs_ag.h"
static struct kmem_cache *xfs_allocbt_cur_cache;
STATIC struct xfs_btree_cur *
xfs_bnobt_dup_cursor(
struct xfs_btree_cur *cur)
{ … }
STATIC struct xfs_btree_cur *
xfs_cntbt_dup_cursor(
struct xfs_btree_cur *cur)
{ … }
STATIC void
xfs_allocbt_set_root(
struct xfs_btree_cur *cur,
const union xfs_btree_ptr *ptr,
int inc)
{ … }
STATIC int
xfs_allocbt_alloc_block(
struct xfs_btree_cur *cur,
const union xfs_btree_ptr *start,
union xfs_btree_ptr *new,
int *stat)
{ … }
STATIC int
xfs_allocbt_free_block(
struct xfs_btree_cur *cur,
struct xfs_buf *bp)
{ … }
STATIC int
xfs_allocbt_get_minrecs(
struct xfs_btree_cur *cur,
int level)
{ … }
STATIC int
xfs_allocbt_get_maxrecs(
struct xfs_btree_cur *cur,
int level)
{ … }
STATIC void
xfs_allocbt_init_key_from_rec(
union xfs_btree_key *key,
const union xfs_btree_rec *rec)
{ … }
STATIC void
xfs_bnobt_init_high_key_from_rec(
union xfs_btree_key *key,
const union xfs_btree_rec *rec)
{ … }
STATIC void
xfs_cntbt_init_high_key_from_rec(
union xfs_btree_key *key,
const union xfs_btree_rec *rec)
{ … }
STATIC void
xfs_allocbt_init_rec_from_cur(
struct xfs_btree_cur *cur,
union xfs_btree_rec *rec)
{ … }
STATIC void
xfs_allocbt_init_ptr_from_cur(
struct xfs_btree_cur *cur,
union xfs_btree_ptr *ptr)
{ … }
STATIC int64_t
xfs_bnobt_key_diff(
struct xfs_btree_cur *cur,
const union xfs_btree_key *key)
{ … }
STATIC int64_t
xfs_cntbt_key_diff(
struct xfs_btree_cur *cur,
const union xfs_btree_key *key)
{ … }
STATIC int64_t
xfs_bnobt_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 int64_t
xfs_cntbt_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_allocbt_verify(
struct xfs_buf *bp)
{ … }
static void
xfs_allocbt_read_verify(
struct xfs_buf *bp)
{ … }
static void
xfs_allocbt_write_verify(
struct xfs_buf *bp)
{ … }
const struct xfs_buf_ops xfs_bnobt_buf_ops = …;
const struct xfs_buf_ops xfs_cntbt_buf_ops = …;
STATIC int
xfs_bnobt_keys_inorder(
struct xfs_btree_cur *cur,
const union xfs_btree_key *k1,
const union xfs_btree_key *k2)
{ … }
STATIC int
xfs_bnobt_recs_inorder(
struct xfs_btree_cur *cur,
const union xfs_btree_rec *r1,
const union xfs_btree_rec *r2)
{ … }
STATIC int
xfs_cntbt_keys_inorder(
struct xfs_btree_cur *cur,
const union xfs_btree_key *k1,
const union xfs_btree_key *k2)
{ … }
STATIC int
xfs_cntbt_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_allocbt_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_bnobt_ops = …;
const struct xfs_btree_ops xfs_cntbt_ops = …;
struct xfs_btree_cur *
xfs_bnobt_init_cursor(
struct xfs_mount *mp,
struct xfs_trans *tp,
struct xfs_buf *agbp,
struct xfs_perag *pag)
{ … }
struct xfs_btree_cur *
xfs_cntbt_init_cursor(
struct xfs_mount *mp,
struct xfs_trans *tp,
struct xfs_buf *agbp,
struct xfs_perag *pag)
{ … }
void
xfs_allocbt_commit_staged_btree(
struct xfs_btree_cur *cur,
struct xfs_trans *tp,
struct xfs_buf *agbp)
{ … }
static inline unsigned int
xfs_allocbt_block_maxrecs(
unsigned int blocklen,
bool leaf)
{ … }
unsigned int
xfs_allocbt_maxrecs(
struct xfs_mount *mp,
unsigned int blocklen,
bool leaf)
{ … }
#define XFS_MAX_FREESP_RECORDS …
unsigned int
xfs_allocbt_maxlevels_ondisk(void)
{ … }
xfs_extlen_t
xfs_allocbt_calc_size(
struct xfs_mount *mp,
unsigned long long len)
{ … }
int __init
xfs_allocbt_init_cur_cache(void)
{ … }
void
xfs_allocbt_destroy_cur_cache(void)
{ … }