#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_log.h"
#include "xfs_health.h"
static int xfs_dir2_leafn_add(struct xfs_buf *bp, xfs_da_args_t *args,
int index);
static void xfs_dir2_leafn_rebalance(xfs_da_state_t *state,
xfs_da_state_blk_t *blk1,
xfs_da_state_blk_t *blk2);
static int xfs_dir2_leafn_remove(xfs_da_args_t *args, struct xfs_buf *bp,
int index, xfs_da_state_blk_t *dblk,
int *rval);
static xfs_dir2_db_t
xfs_dir2_db_to_fdb(struct xfs_da_geometry *geo, xfs_dir2_db_t db)
{ … }
static int
xfs_dir2_db_to_fdindex(struct xfs_da_geometry *geo, xfs_dir2_db_t db)
{ … }
#ifdef DEBUG
static xfs_failaddr_t
xfs_dir3_leafn_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
static xfs_failaddr_t
xfs_dir3_free_verify(
struct xfs_buf *bp)
{ … }
static void
xfs_dir3_free_read_verify(
struct xfs_buf *bp)
{ … }
static void
xfs_dir3_free_write_verify(
struct xfs_buf *bp)
{ … }
const struct xfs_buf_ops xfs_dir3_free_buf_ops = …;
static xfs_failaddr_t
xfs_dir3_free_header_check(
struct xfs_buf *bp,
xfs_ino_t owner,
xfs_dablk_t fbno)
{ … }
static int
__xfs_dir3_free_read(
struct xfs_trans *tp,
struct xfs_inode *dp,
xfs_ino_t owner,
xfs_dablk_t fbno,
unsigned int flags,
struct xfs_buf **bpp)
{ … }
void
xfs_dir2_free_hdr_from_disk(
struct xfs_mount *mp,
struct xfs_dir3_icfree_hdr *to,
struct xfs_dir2_free *from)
{ … }
static void
xfs_dir2_free_hdr_to_disk(
struct xfs_mount *mp,
struct xfs_dir2_free *to,
struct xfs_dir3_icfree_hdr *from)
{ … }
int
xfs_dir2_free_read(
struct xfs_trans *tp,
struct xfs_inode *dp,
xfs_ino_t owner,
xfs_dablk_t fbno,
struct xfs_buf **bpp)
{ … }
static int
xfs_dir2_free_try_read(
struct xfs_trans *tp,
struct xfs_inode *dp,
xfs_ino_t owner,
xfs_dablk_t fbno,
struct xfs_buf **bpp)
{ … }
static int
xfs_dir3_free_get_buf(
xfs_da_args_t *args,
xfs_dir2_db_t fbno,
struct xfs_buf **bpp)
{ … }
STATIC void
xfs_dir2_free_log_bests(
struct xfs_da_args *args,
struct xfs_dir3_icfree_hdr *hdr,
struct xfs_buf *bp,
int first,
int last)
{ … }
static void
xfs_dir2_free_log_header(
struct xfs_da_args *args,
struct xfs_buf *bp)
{ … }
int
xfs_dir2_leaf_to_node(
xfs_da_args_t *args,
struct xfs_buf *lbp)
{ … }
static int
xfs_dir2_leafn_add(
struct xfs_buf *bp,
struct xfs_da_args *args,
int index)
{ … }
#ifdef DEBUG
static void
xfs_dir2_free_hdr_check(
struct xfs_inode *dp,
struct xfs_buf *bp,
xfs_dir2_db_t db)
{ … }
#else
#define xfs_dir2_free_hdr_check …
#endif
xfs_dahash_t
xfs_dir2_leaf_lasthash(
struct xfs_inode *dp,
struct xfs_buf *bp,
int *count)
{ … }
STATIC int
xfs_dir2_leafn_lookup_for_addname(
struct xfs_buf *bp,
xfs_da_args_t *args,
int *indexp,
xfs_da_state_t *state)
{ … }
STATIC int
xfs_dir2_leafn_lookup_for_entry(
struct xfs_buf *bp,
xfs_da_args_t *args,
int *indexp,
xfs_da_state_t *state)
{ … }
int
xfs_dir2_leafn_lookup_int(
struct xfs_buf *bp,
xfs_da_args_t *args,
int *indexp,
xfs_da_state_t *state)
{ … }
static void
xfs_dir3_leafn_moveents(
xfs_da_args_t *args,
struct xfs_buf *bp_s,
struct xfs_dir3_icleaf_hdr *shdr,
struct xfs_dir2_leaf_entry *sents,
int start_s,
struct xfs_buf *bp_d,
struct xfs_dir3_icleaf_hdr *dhdr,
struct xfs_dir2_leaf_entry *dents,
int start_d,
int count)
{ … }
int
xfs_dir2_leafn_order(
struct xfs_inode *dp,
struct xfs_buf *leaf1_bp,
struct xfs_buf *leaf2_bp)
{ … }
static void
xfs_dir2_leafn_rebalance(
xfs_da_state_t *state,
xfs_da_state_blk_t *blk1,
xfs_da_state_blk_t *blk2)
{ … }
static int
xfs_dir3_data_block_free(
xfs_da_args_t *args,
struct xfs_dir2_data_hdr *hdr,
struct xfs_dir2_free *free,
xfs_dir2_db_t fdb,
int findex,
struct xfs_buf *fbp,
int longest)
{ … }
static int
xfs_dir2_leafn_remove(
xfs_da_args_t *args,
struct xfs_buf *bp,
int index,
xfs_da_state_blk_t *dblk,
int *rval)
{ … }
int
xfs_dir2_leafn_split(
xfs_da_state_t *state,
xfs_da_state_blk_t *oldblk,
xfs_da_state_blk_t *newblk)
{ … }
int
xfs_dir2_leafn_toosmall(
xfs_da_state_t *state,
int *action)
{ … }
void
xfs_dir2_leafn_unbalance(
xfs_da_state_t *state,
xfs_da_state_blk_t *drop_blk,
xfs_da_state_blk_t *save_blk)
{ … }
static int
xfs_dir2_node_add_datablk(
struct xfs_da_args *args,
struct xfs_da_state_blk *fblk,
xfs_dir2_db_t *dbno,
struct xfs_buf **dbpp,
struct xfs_buf **fbpp,
struct xfs_dir3_icfree_hdr *hdr,
int *findex)
{ … }
static int
xfs_dir2_node_find_freeblk(
struct xfs_da_args *args,
struct xfs_da_state_blk *fblk,
xfs_dir2_db_t *dbnop,
struct xfs_buf **fbpp,
struct xfs_dir3_icfree_hdr *hdr,
int *findexp,
int length)
{ … }
static int
xfs_dir2_node_addname_int(
struct xfs_da_args *args,
struct xfs_da_state_blk *fblk)
{ … }
int
xfs_dir2_node_addname(
xfs_da_args_t *args)
{ … }
int
xfs_dir2_node_lookup(
xfs_da_args_t *args)
{ … }
int
xfs_dir2_node_removename(
struct xfs_da_args *args)
{ … }
int
xfs_dir2_node_replace(
xfs_da_args_t *args)
{ … }
int
xfs_dir2_node_trim_free(
xfs_da_args_t *args,
xfs_fileoff_t fo,
int *rvalp)
{ … }