#ifndef _BCACHEFS_BTREE_UPDATE_INTERIOR_H
#define _BCACHEFS_BTREE_UPDATE_INTERIOR_H
#include "btree_cache.h"
#include "btree_locking.h"
#include "btree_update.h"
#define BTREE_UPDATE_NODES_MAX …
#define BTREE_UPDATE_JOURNAL_RES …
int bch2_btree_node_check_topology(struct btree_trans *, struct btree *);
#define BTREE_UPDATE_MODES() …
enum btree_update_mode { … };
struct btree_update { … };
struct btree *__bch2_btree_node_alloc_replacement(struct btree_update *,
struct btree_trans *,
struct btree *,
struct bkey_format);
int bch2_btree_split_leaf(struct btree_trans *, btree_path_idx_t, unsigned);
int bch2_btree_increase_depth(struct btree_trans *, btree_path_idx_t, unsigned);
int __bch2_foreground_maybe_merge(struct btree_trans *, btree_path_idx_t,
unsigned, unsigned, enum btree_node_sibling);
static inline int bch2_foreground_maybe_merge_sibling(struct btree_trans *trans,
btree_path_idx_t path_idx,
unsigned level, unsigned flags,
enum btree_node_sibling sib)
{ … }
static inline int bch2_foreground_maybe_merge(struct btree_trans *trans,
btree_path_idx_t path,
unsigned level,
unsigned flags)
{ … }
int bch2_btree_node_rewrite(struct btree_trans *, struct btree_iter *,
struct btree *, unsigned);
void bch2_btree_node_rewrite_async(struct bch_fs *, struct btree *);
int bch2_btree_node_update_key(struct btree_trans *, struct btree_iter *,
struct btree *, struct bkey_i *,
unsigned, bool);
int bch2_btree_node_update_key_get_iter(struct btree_trans *, struct btree *,
struct bkey_i *, unsigned, bool);
void bch2_btree_set_root_for_read(struct bch_fs *, struct btree *);
int bch2_btree_root_alloc_fake_trans(struct btree_trans *, enum btree_id, unsigned);
void bch2_btree_root_alloc_fake(struct bch_fs *, enum btree_id, unsigned);
static inline unsigned btree_update_reserve_required(struct bch_fs *c,
struct btree *b)
{ … }
static inline void btree_node_reset_sib_u64s(struct btree *b)
{ … }
static inline void *btree_data_end(struct btree *b)
{ … }
static inline struct bkey_packed *unwritten_whiteouts_start(struct btree *b)
{ … }
static inline struct bkey_packed *unwritten_whiteouts_end(struct btree *b)
{ … }
static inline void *write_block(struct btree *b)
{ … }
static inline bool __btree_addr_written(struct btree *b, void *p)
{ … }
static inline bool bset_written(struct btree *b, struct bset *i)
{ … }
static inline bool bkey_written(struct btree *b, struct bkey_packed *k)
{ … }
static inline ssize_t __bch2_btree_u64s_remaining(struct btree *b, void *end)
{ … }
static inline size_t bch2_btree_keys_u64s_remaining(struct btree *b)
{ … }
#define BTREE_WRITE_SET_U64s_BITS …
static inline unsigned btree_write_set_buffer(struct btree *b)
{ … }
static inline struct btree_node_entry *want_new_bset(struct bch_fs *c, struct btree *b)
{ … }
static inline void push_whiteout(struct btree *b, struct bpos pos)
{ … }
static inline bool bch2_btree_node_insert_fits(struct btree *b, unsigned u64s)
{ … }
void bch2_btree_updates_to_text(struct printbuf *, struct bch_fs *);
bool bch2_btree_interior_updates_flush(struct bch_fs *);
void bch2_journal_entry_to_btree_root(struct bch_fs *, struct jset_entry *);
struct jset_entry *bch2_btree_roots_to_journal_entries(struct bch_fs *,
struct jset_entry *, unsigned long);
void bch2_do_pending_node_rewrites(struct bch_fs *);
void bch2_free_pending_node_rewrites(struct bch_fs *);
void bch2_btree_reserve_cache_to_text(struct printbuf *, struct bch_fs *);
void bch2_fs_btree_interior_update_exit(struct bch_fs *);
void bch2_fs_btree_interior_update_init_early(struct bch_fs *);
int bch2_fs_btree_interior_update_init(struct bch_fs *);
#endif