#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_inode.h"
#include "xfs_bmap.h"
#include "xfs_dir2.h"
#include "xfs_dir2_priv.h"
#include "xfs_error.h"
#include "xfs_trace.h"
#include "xfs_trans.h"
#include "xfs_buf_item.h"
#include "xfs_health.h"
static int xfs_dir2_leaf_lookup_int(xfs_da_args_t *args, struct xfs_buf **lbpp,
int *indexp, struct xfs_buf **dbpp,
struct xfs_dir3_icleaf_hdr *leafhdr);
static void xfs_dir3_leaf_log_bests(struct xfs_da_args *args,
struct xfs_buf *bp, int first, int last);
static void xfs_dir3_leaf_log_tail(struct xfs_da_args *args,
struct xfs_buf *bp);
void
xfs_dir2_leaf_hdr_from_disk(
struct xfs_mount *mp,
struct xfs_dir3_icleaf_hdr *to,
struct xfs_dir2_leaf *from)
{ … }
void
xfs_dir2_leaf_hdr_to_disk(
struct xfs_mount *mp,
struct xfs_dir2_leaf *to,
struct xfs_dir3_icleaf_hdr *from)
{ … }
#ifdef DEBUG
static xfs_failaddr_t
xfs_dir3_leaf1_check(
struct xfs_inode *dp,
struct xfs_buf *bp)
{ … }
static inline void
xfs_dir3_leaf_check(
struct xfs_inode *dp,
struct xfs_buf *bp)
{ … }
#else
#define xfs_dir3_leaf_check …
#endif
xfs_failaddr_t
xfs_dir3_leaf_check_int(
struct xfs_mount *mp,
struct xfs_dir3_icleaf_hdr *hdr,
struct xfs_dir2_leaf *leaf,
bool expensive_checking)
{ … }
static xfs_failaddr_t
xfs_dir3_leaf_verify(
struct xfs_buf *bp)
{ … }
xfs_failaddr_t
xfs_dir3_leaf_header_check(
struct xfs_buf *bp,
xfs_ino_t owner)
{ … }
static void
xfs_dir3_leaf_read_verify(
struct xfs_buf *bp)
{ … }
static void
xfs_dir3_leaf_write_verify(
struct xfs_buf *bp)
{ … }
const struct xfs_buf_ops xfs_dir3_leaf1_buf_ops = …;
const struct xfs_buf_ops xfs_dir3_leafn_buf_ops = …;
int
xfs_dir3_leaf_read(
struct xfs_trans *tp,
struct xfs_inode *dp,
xfs_ino_t owner,
xfs_dablk_t fbno,
struct xfs_buf **bpp)
{ … }
int
xfs_dir3_leafn_read(
struct xfs_trans *tp,
struct xfs_inode *dp,
xfs_ino_t owner,
xfs_dablk_t fbno,
struct xfs_buf **bpp)
{ … }
static void
xfs_dir3_leaf_init(
struct xfs_da_args *args,
struct xfs_buf *bp,
uint16_t type)
{ … }
int
xfs_dir3_leaf_get_buf(
xfs_da_args_t *args,
xfs_dir2_db_t bno,
struct xfs_buf **bpp,
uint16_t magic)
{ … }
int
xfs_dir2_block_to_leaf(
xfs_da_args_t *args,
struct xfs_buf *dbp)
{ … }
STATIC void
xfs_dir3_leaf_find_stale(
struct xfs_dir3_icleaf_hdr *leafhdr,
struct xfs_dir2_leaf_entry *ents,
int index,
int *lowstale,
int *highstale)
{ … }
struct xfs_dir2_leaf_entry *
xfs_dir3_leaf_find_entry(
struct xfs_dir3_icleaf_hdr *leafhdr,
struct xfs_dir2_leaf_entry *ents,
int index,
int compact,
int lowstale,
int highstale,
int *lfloglow,
int *lfloghigh)
{ … }
int
xfs_dir2_leaf_addname(
struct xfs_da_args *args)
{ … }
void
xfs_dir3_leaf_compact(
xfs_da_args_t *args,
struct xfs_dir3_icleaf_hdr *leafhdr,
struct xfs_buf *bp)
{ … }
void
xfs_dir3_leaf_compact_x1(
struct xfs_dir3_icleaf_hdr *leafhdr,
struct xfs_dir2_leaf_entry *ents,
int *indexp,
int *lowstalep,
int *highstalep,
int *lowlogp,
int *highlogp)
{ … }
static void
xfs_dir3_leaf_log_bests(
struct xfs_da_args *args,
struct xfs_buf *bp,
int first,
int last)
{ … }
void
xfs_dir3_leaf_log_ents(
struct xfs_da_args *args,
struct xfs_dir3_icleaf_hdr *hdr,
struct xfs_buf *bp,
int first,
int last)
{ … }
void
xfs_dir3_leaf_log_header(
struct xfs_da_args *args,
struct xfs_buf *bp)
{ … }
STATIC void
xfs_dir3_leaf_log_tail(
struct xfs_da_args *args,
struct xfs_buf *bp)
{ … }
int
xfs_dir2_leaf_lookup(
xfs_da_args_t *args)
{ … }
static int
xfs_dir2_leaf_lookup_int(
xfs_da_args_t *args,
struct xfs_buf **lbpp,
int *indexp,
struct xfs_buf **dbpp,
struct xfs_dir3_icleaf_hdr *leafhdr)
{ … }
int
xfs_dir2_leaf_removename(
xfs_da_args_t *args)
{ … }
int
xfs_dir2_leaf_replace(
xfs_da_args_t *args)
{ … }
int
xfs_dir2_leaf_search_hash(
xfs_da_args_t *args,
struct xfs_buf *lbp)
{ … }
int
xfs_dir2_leaf_trim_data(
xfs_da_args_t *args,
struct xfs_buf *lbp,
xfs_dir2_db_t db)
{ … }
static inline size_t
xfs_dir3_leaf_size(
struct xfs_dir3_icleaf_hdr *hdr,
int counts)
{ … }
int
xfs_dir2_node_to_leaf(
xfs_da_state_t *state)
{ … }