linux/fs/xfs/scrub/rcbag_btree.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Copyright (c) 2022-2024 Oracle.  All Rights Reserved.
 * Author: Darrick J. Wong <[email protected]>
 */
#include "xfs.h"
#include "xfs_fs.h"
#include "xfs_shared.h"
#include "xfs_format.h"
#include "xfs_trans_resv.h"
#include "xfs_mount.h"
#include "xfs_defer.h"
#include "xfs_btree.h"
#include "xfs_buf_mem.h"
#include "xfs_btree_mem.h"
#include "xfs_error.h"
#include "scrub/rcbag_btree.h"
#include "scrub/trace.h"

static struct kmem_cache	*rcbagbt_cur_cache;

STATIC void
rcbagbt_init_key_from_rec(
	union xfs_btree_key		*key,
	const union xfs_btree_rec	*rec)
{}

STATIC void
rcbagbt_init_rec_from_cur(
	struct xfs_btree_cur	*cur,
	union xfs_btree_rec	*rec)
{}

STATIC int64_t
rcbagbt_key_diff(
	struct xfs_btree_cur		*cur,
	const union xfs_btree_key	*key)
{}

STATIC int64_t
rcbagbt_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 int
rcbagbt_keys_inorder(
	struct xfs_btree_cur		*cur,
	const union xfs_btree_key	*k1,
	const union xfs_btree_key	*k2)
{}

STATIC int
rcbagbt_recs_inorder(
	struct xfs_btree_cur		*cur,
	const union xfs_btree_rec	*r1,
	const union xfs_btree_rec	*r2)
{}

static xfs_failaddr_t
rcbagbt_verify(
	struct xfs_buf		*bp)
{}

static void
rcbagbt_rw_verify(
	struct xfs_buf	*bp)
{}

/* skip crc checks on in-memory btrees to save time */
static const struct xfs_buf_ops rcbagbt_mem_buf_ops =;

static const struct xfs_btree_ops rcbagbt_mem_ops =;

/* Create a cursor for an in-memory btree. */
struct xfs_btree_cur *
rcbagbt_mem_cursor(
	struct xfs_mount	*mp,
	struct xfs_trans	*tp,
	struct xfbtree		*xfbtree)
{}

/* Create an in-memory refcount bag btree. */
int
rcbagbt_mem_init(
	struct xfs_mount	*mp,
	struct xfbtree		*xfbt,
	struct xfs_buftarg	*btp)
{}

/* Calculate number of records in a refcount bag btree block. */
static inline unsigned int
rcbagbt_block_maxrecs(
	unsigned int		blocklen,
	bool			leaf)
{}

/*
 * Calculate number of records in an refcount bag btree block.
 */
unsigned int
rcbagbt_maxrecs(
	struct xfs_mount	*mp,
	unsigned int		blocklen,
	bool			leaf)
{}

/* Compute the max possible height for refcount bag btrees. */
unsigned int
rcbagbt_maxlevels_possible(void)
{}

/* Calculate the refcount bag btree size for some records. */
unsigned long long
rcbagbt_calc_size(
	unsigned long long	nr_records)
{}

int __init
rcbagbt_init_cur_cache(void)
{}

void
rcbagbt_destroy_cur_cache(void)
{}

/* Look up the refcount bag record corresponding to this reverse mapping. */
int
rcbagbt_lookup_eq(
	struct xfs_btree_cur		*cur,
	const struct xfs_rmap_irec	*rmap,
	int				*success)
{}

/* Get the data from the pointed-to record. */
int
rcbagbt_get_rec(
	struct xfs_btree_cur	*cur,
	struct rcbag_rec	*rec,
	int			*has)
{}

/* Update the record referred to by cur to the value given. */
int
rcbagbt_update(
	struct xfs_btree_cur	*cur,
	const struct rcbag_rec	*rec)
{}

/* Update the record referred to by cur to the value given. */
int
rcbagbt_insert(
	struct xfs_btree_cur	*cur,
	const struct rcbag_rec	*rec,
	int			*success)
{}