#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_btree_staging.h"
#include "xfs_bit.h"
#include "xfs_log_format.h"
#include "xfs_trans.h"
#include "xfs_sb.h"
#include "xfs_inode.h"
#include "xfs_inode_fork.h"
#include "xfs_alloc.h"
#include "xfs_rtalloc.h"
#include "xfs_bmap.h"
#include "xfs_bmap_util.h"
#include "xfs_bmap_btree.h"
#include "xfs_rmap.h"
#include "xfs_rmap_btree.h"
#include "xfs_refcount.h"
#include "xfs_quota.h"
#include "xfs_ialloc.h"
#include "xfs_ag.h"
#include "xfs_reflink.h"
#include "scrub/xfs_scrub.h"
#include "scrub/scrub.h"
#include "scrub/common.h"
#include "scrub/btree.h"
#include "scrub/trace.h"
#include "scrub/repair.h"
#include "scrub/bitmap.h"
#include "scrub/fsb_bitmap.h"
#include "scrub/xfile.h"
#include "scrub/xfarray.h"
#include "scrub/newbt.h"
#include "scrub/reap.h"
enum reflink_scan_state { … };
struct xrep_bmap { … };
STATIC int
xrep_bmap_discover_shared(
struct xrep_bmap *rb,
xfs_fsblock_t startblock,
xfs_filblks_t blockcount)
{ … }
STATIC int
xrep_bmap_from_rmap(
struct xrep_bmap *rb,
xfs_fileoff_t startoff,
xfs_fsblock_t startblock,
xfs_filblks_t blockcount,
bool unwritten)
{ … }
STATIC int
xrep_bmap_check_fork_rmap(
struct xrep_bmap *rb,
struct xfs_btree_cur *cur,
const struct xfs_rmap_irec *rec)
{ … }
STATIC int
xrep_bmap_walk_rmap(
struct xfs_btree_cur *cur,
const struct xfs_rmap_irec *rec,
void *priv)
{ … }
static int
xrep_bmap_extent_cmp(
const void *a,
const void *b)
{ … }
STATIC int
xrep_bmap_sort_records(
struct xrep_bmap *rb)
{ … }
STATIC int
xrep_bmap_scan_ag(
struct xrep_bmap *rb,
struct xfs_perag *pag)
{ … }
STATIC int
xrep_bmap_find_delalloc(
struct xrep_bmap *rb)
{ … }
STATIC int
xrep_bmap_find_mappings(
struct xrep_bmap *rb)
{ … }
STATIC int
xrep_bmap_get_records(
struct xfs_btree_cur *cur,
unsigned int idx,
struct xfs_btree_block *block,
unsigned int nr_wanted,
void *priv)
{ … }
STATIC int
xrep_bmap_claim_block(
struct xfs_btree_cur *cur,
union xfs_btree_ptr *ptr,
void *priv)
{ … }
STATIC size_t
xrep_bmap_iroot_size(
struct xfs_btree_cur *cur,
unsigned int level,
unsigned int nr_this_level,
void *priv)
{ … }
STATIC int
xrep_bmap_reset_counters(
struct xrep_bmap *rb)
{ … }
STATIC int
xrep_bmap_extents_load(
struct xrep_bmap *rb)
{ … }
STATIC int
xrep_bmap_btree_load(
struct xrep_bmap *rb,
struct xfs_btree_cur *bmap_cur)
{ … }
STATIC int
xrep_bmap_build_new_fork(
struct xrep_bmap *rb)
{ … }
STATIC int
xrep_bmap_remove_old_tree(
struct xrep_bmap *rb)
{ … }
STATIC int
xrep_bmap_check_inputs(
struct xfs_scrub *sc,
int whichfork)
{ … }
static inline enum reflink_scan_state
xrep_bmap_init_reflink_scan(
struct xfs_scrub *sc,
int whichfork)
{ … }
int
xrep_bmap(
struct xfs_scrub *sc,
int whichfork,
bool allow_unwritten)
{ … }
int
xrep_bmap_data(
struct xfs_scrub *sc)
{ … }
int
xrep_bmap_attr(
struct xfs_scrub *sc)
{ … }