#include "bcachefs.h"
#include "bcachefs_ioctl.h"
#include "btree_cache.h"
#include "btree_journal_iter.h"
#include "btree_update.h"
#include "btree_write_buffer.h"
#include "buckets.h"
#include "compress.h"
#include "disk_accounting.h"
#include "error.h"
#include "journal_io.h"
#include "replicas.h"
static const char * const disk_accounting_type_strs[] = …;
static inline void accounting_key_init(struct bkey_i *k, struct disk_accounting_pos *pos,
s64 *d, unsigned nr)
{ … }
int bch2_disk_accounting_mod(struct btree_trans *trans,
struct disk_accounting_pos *k,
s64 *d, unsigned nr, bool gc)
{ … }
int bch2_mod_dev_cached_sectors(struct btree_trans *trans,
unsigned dev, s64 sectors,
bool gc)
{ … }
static inline bool is_zero(char *start, char *end)
{ … }
#define field_end(p, member) …
int bch2_accounting_validate(struct bch_fs *c, struct bkey_s_c k,
enum bch_validate_flags flags)
{ … }
void bch2_accounting_key_to_text(struct printbuf *out, struct disk_accounting_pos *k)
{ … }
void bch2_accounting_to_text(struct printbuf *out, struct bch_fs *c, struct bkey_s_c k)
{ … }
void bch2_accounting_swab(struct bkey_s k)
{ … }
static inline void __accounting_to_replicas(struct bch_replicas_entry_v1 *r,
struct disk_accounting_pos acc)
{ … }
static inline bool accounting_to_replicas(struct bch_replicas_entry_v1 *r, struct bpos p)
{ … }
static int bch2_accounting_update_sb_one(struct bch_fs *c, struct bpos p)
{ … }
int bch2_accounting_update_sb(struct btree_trans *trans)
{ … }
static int __bch2_accounting_mem_insert(struct bch_fs *c, struct bkey_s_c_accounting a)
{ … }
int bch2_accounting_mem_insert(struct bch_fs *c, struct bkey_s_c_accounting a,
enum bch_accounting_mode mode)
{ … }
static bool accounting_mem_entry_is_zero(struct accounting_mem_entry *e)
{ … }
void bch2_accounting_mem_gc(struct bch_fs *c)
{ … }
int bch2_fs_replicas_usage_read(struct bch_fs *c, darray_char *usage)
{ … }
int bch2_fs_accounting_read(struct bch_fs *c, darray_char *out_buf, unsigned accounting_types_mask)
{ … }
void bch2_fs_accounting_to_text(struct printbuf *out, struct bch_fs *c)
{ … }
static void bch2_accounting_free_counters(struct bch_accounting_mem *acc, bool gc)
{ … }
int bch2_gc_accounting_start(struct bch_fs *c)
{ … }
int bch2_gc_accounting_done(struct bch_fs *c)
{ … }
static int accounting_read_key(struct btree_trans *trans, struct bkey_s_c k)
{ … }
static int bch2_disk_accounting_validate_late(struct btree_trans *trans,
struct disk_accounting_pos acc,
u64 *v, unsigned nr)
{ … }
int bch2_accounting_read(struct bch_fs *c)
{ … }
int bch2_dev_usage_remove(struct bch_fs *c, unsigned dev)
{ … }
int bch2_dev_usage_init(struct bch_dev *ca, bool gc)
{ … }
void bch2_verify_accounting_clean(struct bch_fs *c)
{ … }
void bch2_accounting_gc_free(struct bch_fs *c)
{ … }
void bch2_fs_accounting_exit(struct bch_fs *c)
{ … }