linux/fs/bcachefs/btree_key_cache.h

/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _BCACHEFS_BTREE_KEY_CACHE_H
#define _BCACHEFS_BTREE_KEY_CACHE_H

static inline size_t bch2_nr_btree_keys_need_flush(struct bch_fs *c)
{}

static inline bool bch2_btree_key_cache_must_wait(struct bch_fs *c)
{}

int bch2_btree_key_cache_journal_flush(struct journal *,
				struct journal_entry_pin *, u64);

struct bkey_cached *
bch2_btree_key_cache_find(struct bch_fs *, enum btree_id, struct bpos);

int bch2_btree_path_traverse_cached(struct btree_trans *, struct btree_path *,
				    unsigned);

bool bch2_btree_insert_key_cached(struct btree_trans *, unsigned,
			struct btree_insert_entry *);
void bch2_btree_key_cache_drop(struct btree_trans *,
			       struct btree_path *);

void bch2_fs_btree_key_cache_exit(struct btree_key_cache *);
void bch2_fs_btree_key_cache_init_early(struct btree_key_cache *);
int bch2_fs_btree_key_cache_init(struct btree_key_cache *);

void bch2_btree_key_cache_to_text(struct printbuf *, struct btree_key_cache *);

void bch2_btree_key_cache_exit(void);
int __init bch2_btree_key_cache_init(void);

#endif /* _BCACHEFS_BTREE_KEY_CACHE_H */