#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_bit.h"
#include "xfs_mount.h"
#include "xfs_inode.h"
#include "xfs_dir2.h"
#include "xfs_dir2_priv.h"
#include "xfs_trans.h"
#include "xfs_bmap.h"
#include "xfs_attr_leaf.h"
#include "xfs_error.h"
#include "xfs_trace.h"
#include "xfs_buf_item.h"
#include "xfs_log.h"
#include "xfs_errortag.h"
#include "xfs_health.h"
STATIC int xfs_da3_root_split(xfs_da_state_t *state,
xfs_da_state_blk_t *existing_root,
xfs_da_state_blk_t *new_child);
STATIC int xfs_da3_node_split(xfs_da_state_t *state,
xfs_da_state_blk_t *existing_blk,
xfs_da_state_blk_t *split_blk,
xfs_da_state_blk_t *blk_to_add,
int treelevel,
int *result);
STATIC void xfs_da3_node_rebalance(xfs_da_state_t *state,
xfs_da_state_blk_t *node_blk_1,
xfs_da_state_blk_t *node_blk_2);
STATIC void xfs_da3_node_add(xfs_da_state_t *state,
xfs_da_state_blk_t *old_node_blk,
xfs_da_state_blk_t *new_node_blk);
STATIC int xfs_da3_root_join(xfs_da_state_t *state,
xfs_da_state_blk_t *root_blk);
STATIC int xfs_da3_node_toosmall(xfs_da_state_t *state, int *retval);
STATIC void xfs_da3_node_remove(xfs_da_state_t *state,
xfs_da_state_blk_t *drop_blk);
STATIC void xfs_da3_node_unbalance(xfs_da_state_t *state,
xfs_da_state_blk_t *src_node_blk,
xfs_da_state_blk_t *dst_node_blk);
STATIC int xfs_da3_blk_unlink(xfs_da_state_t *state,
xfs_da_state_blk_t *drop_blk,
xfs_da_state_blk_t *save_blk);
struct kmem_cache *xfs_da_state_cache;
struct xfs_da_state *
xfs_da_state_alloc(
struct xfs_da_args *args)
{ … }
STATIC void
xfs_da_state_kill_altpath(xfs_da_state_t *state)
{ … }
void
xfs_da_state_free(xfs_da_state_t *state)
{ … }
void
xfs_da_state_reset(
struct xfs_da_state *state,
struct xfs_da_args *args)
{ … }
static inline int xfs_dabuf_nfsb(struct xfs_mount *mp, int whichfork)
{ … }
void
xfs_da3_node_hdr_from_disk(
struct xfs_mount *mp,
struct xfs_da3_icnode_hdr *to,
struct xfs_da_intnode *from)
{ … }
void
xfs_da3_node_hdr_to_disk(
struct xfs_mount *mp,
struct xfs_da_intnode *to,
struct xfs_da3_icnode_hdr *from)
{ … }
xfs_failaddr_t
xfs_da3_blkinfo_verify(
struct xfs_buf *bp,
struct xfs_da3_blkinfo *hdr3)
{ … }
static xfs_failaddr_t
xfs_da3_node_verify(
struct xfs_buf *bp)
{ … }
xfs_failaddr_t
xfs_da3_node_header_check(
struct xfs_buf *bp,
xfs_ino_t owner)
{ … }
xfs_failaddr_t
xfs_da3_header_check(
struct xfs_buf *bp,
xfs_ino_t owner)
{ … }
static void
xfs_da3_node_write_verify(
struct xfs_buf *bp)
{ … }
static void
xfs_da3_node_read_verify(
struct xfs_buf *bp)
{ … }
static xfs_failaddr_t
xfs_da3_node_verify_struct(
struct xfs_buf *bp)
{ … }
const struct xfs_buf_ops xfs_da3_node_buf_ops = …;
static int
xfs_da3_node_set_type(
struct xfs_trans *tp,
struct xfs_inode *dp,
int whichfork,
struct xfs_buf *bp)
{ … }
int
xfs_da3_node_read(
struct xfs_trans *tp,
struct xfs_inode *dp,
xfs_dablk_t bno,
struct xfs_buf **bpp,
int whichfork)
{ … }
int
xfs_da3_node_read_mapped(
struct xfs_trans *tp,
struct xfs_inode *dp,
xfs_daddr_t mappedbno,
struct xfs_buf **bpp,
int whichfork)
{ … }
void
xfs_da_buf_copy(
struct xfs_buf *dst,
struct xfs_buf *src,
size_t size)
{ … }
int
xfs_da3_node_create(
struct xfs_da_args *args,
xfs_dablk_t blkno,
int level,
struct xfs_buf **bpp,
int whichfork)
{ … }
int
xfs_da3_split(
struct xfs_da_state *state)
{ … }
STATIC int
xfs_da3_root_split(
struct xfs_da_state *state,
struct xfs_da_state_blk *blk1,
struct xfs_da_state_blk *blk2)
{ … }
STATIC int
xfs_da3_node_split(
struct xfs_da_state *state,
struct xfs_da_state_blk *oldblk,
struct xfs_da_state_blk *newblk,
struct xfs_da_state_blk *addblk,
int treelevel,
int *result)
{ … }
STATIC void
xfs_da3_node_rebalance(
struct xfs_da_state *state,
struct xfs_da_state_blk *blk1,
struct xfs_da_state_blk *blk2)
{ … }
STATIC void
xfs_da3_node_add(
struct xfs_da_state *state,
struct xfs_da_state_blk *oldblk,
struct xfs_da_state_blk *newblk)
{ … }
int
xfs_da3_join(
struct xfs_da_state *state)
{ … }
#ifdef DEBUG
static void
xfs_da_blkinfo_onlychild_validate(struct xfs_da_blkinfo *blkinfo, __u16 level)
{ … }
#else
#define xfs_da_blkinfo_onlychild_validate …
#endif
STATIC int
xfs_da3_root_join(
struct xfs_da_state *state,
struct xfs_da_state_blk *root_blk)
{ … }
STATIC int
xfs_da3_node_toosmall(
struct xfs_da_state *state,
int *action)
{ … }
STATIC uint
xfs_da3_node_lasthash(
struct xfs_inode *dp,
struct xfs_buf *bp,
int *count)
{ … }
void
xfs_da3_fixhashpath(
struct xfs_da_state *state,
struct xfs_da_state_path *path)
{ … }
STATIC void
xfs_da3_node_remove(
struct xfs_da_state *state,
struct xfs_da_state_blk *drop_blk)
{ … }
STATIC void
xfs_da3_node_unbalance(
struct xfs_da_state *state,
struct xfs_da_state_blk *drop_blk,
struct xfs_da_state_blk *save_blk)
{ … }
int
xfs_da3_node_lookup_int(
struct xfs_da_state *state,
int *result)
{ … }
STATIC int
xfs_da3_node_order(
struct xfs_inode *dp,
struct xfs_buf *node1_bp,
struct xfs_buf *node2_bp)
{ … }
int
xfs_da3_blk_link(
struct xfs_da_state *state,
struct xfs_da_state_blk *old_blk,
struct xfs_da_state_blk *new_blk)
{ … }
STATIC int
xfs_da3_blk_unlink(
struct xfs_da_state *state,
struct xfs_da_state_blk *drop_blk,
struct xfs_da_state_blk *save_blk)
{ … }
int
xfs_da3_path_shift(
struct xfs_da_state *state,
struct xfs_da_state_path *path,
int forward,
int release,
int *result)
{ … }
xfs_dahash_t
xfs_da_hashname(const uint8_t *name, int namelen)
{ … }
enum xfs_dacmp
xfs_da_compname(
struct xfs_da_args *args,
const unsigned char *name,
int len)
{ … }
int
xfs_da_grow_inode_int(
struct xfs_da_args *args,
xfs_fileoff_t *bno,
int count)
{ … }
int
xfs_da_grow_inode(
struct xfs_da_args *args,
xfs_dablk_t *new_blkno)
{ … }
STATIC int
xfs_da3_swap_lastblock(
struct xfs_da_args *args,
xfs_dablk_t *dead_blknop,
struct xfs_buf **dead_bufp)
{ … }
int
xfs_da_shrink_inode(
struct xfs_da_args *args,
xfs_dablk_t dead_blkno,
struct xfs_buf *dead_buf)
{ … }
static int
xfs_dabuf_map(
struct xfs_inode *dp,
xfs_dablk_t bno,
unsigned int flags,
int whichfork,
struct xfs_buf_map **mapp,
int *nmaps)
{ … }
int
xfs_da_get_buf(
struct xfs_trans *tp,
struct xfs_inode *dp,
xfs_dablk_t bno,
struct xfs_buf **bpp,
int whichfork)
{ … }
int
xfs_da_read_buf(
struct xfs_trans *tp,
struct xfs_inode *dp,
xfs_dablk_t bno,
unsigned int flags,
struct xfs_buf **bpp,
int whichfork,
const struct xfs_buf_ops *ops)
{ … }
int
xfs_da_reada_buf(
struct xfs_inode *dp,
xfs_dablk_t bno,
unsigned int flags,
int whichfork,
const struct xfs_buf_ops *ops)
{ … }