#include "bcachefs.h"
#include "alloc_foreground.h"
#include "bkey_methods.h"
#include "btree_gc.h"
#include "btree_update.h"
#include "btree_write_buffer.h"
#include "buckets.h"
#include "error.h"
#include "journal.h"
#include "journal_io.h"
#include "journal_reclaim.h"
#include "journal_sb.h"
#include "journal_seq_blacklist.h"
#include "trace.h"
static const char * const bch2_journal_errors[] = …;
static inline bool journal_seq_unwritten(struct journal *j, u64 seq)
{ … }
static bool __journal_entry_is_open(union journal_res_state state)
{ … }
static inline unsigned nr_unwritten_journal_entries(struct journal *j)
{ … }
static bool journal_entry_is_open(struct journal *j)
{ … }
static void bch2_journal_buf_to_text(struct printbuf *out, struct journal *j, u64 seq)
{ … }
static void bch2_journal_bufs_to_text(struct printbuf *out, struct journal *j)
{ … }
static inline struct journal_buf *
journal_seq_to_buf(struct journal *j, u64 seq)
{ … }
static void journal_pin_list_init(struct journal_entry_pin_list *p, int count)
{ … }
static inline bool
journal_error_check_stuck(struct journal *j, int error, unsigned flags)
{ … }
void bch2_journal_do_writes(struct journal *j)
{ … }
void bch2_journal_buf_put_final(struct journal *j, u64 seq)
{ … }
static void __journal_entry_close(struct journal *j, unsigned closed_val, bool trace)
{ … }
void bch2_journal_halt(struct journal *j)
{ … }
static bool journal_entry_want_write(struct journal *j)
{ … }
bool bch2_journal_entry_close(struct journal *j)
{ … }
static int journal_entry_open(struct journal *j)
{ … }
static bool journal_quiesced(struct journal *j)
{ … }
static void journal_quiesce(struct journal *j)
{ … }
static void journal_write_work(struct work_struct *work)
{ … }
static int __journal_res_get(struct journal *j, struct journal_res *res,
unsigned flags)
{ … }
int bch2_journal_res_get_slowpath(struct journal *j, struct journal_res *res,
unsigned flags)
{ … }
void bch2_journal_entry_res_resize(struct journal *j,
struct journal_entry_res *res,
unsigned new_u64s)
{ … }
int bch2_journal_flush_seq_async(struct journal *j, u64 seq,
struct closure *parent)
{ … }
int bch2_journal_flush_seq(struct journal *j, u64 seq, unsigned task_state)
{ … }
void bch2_journal_flush_async(struct journal *j, struct closure *parent)
{ … }
int bch2_journal_flush(struct journal *j)
{ … }
bool bch2_journal_noflush_seq(struct journal *j, u64 seq)
{ … }
int bch2_journal_meta(struct journal *j)
{ … }
void bch2_journal_unblock(struct journal *j)
{ … }
void bch2_journal_block(struct journal *j)
{ … }
static struct journal_buf *__bch2_next_write_buffer_flush_journal_buf(struct journal *j, u64 max_seq)
{ … }
struct journal_buf *bch2_next_write_buffer_flush_journal_buf(struct journal *j, u64 max_seq)
{ … }
static int __bch2_set_nr_journal_buckets(struct bch_dev *ca, unsigned nr,
bool new_fs, struct closure *cl)
{ … }
int bch2_set_nr_journal_buckets(struct bch_fs *c, struct bch_dev *ca,
unsigned nr)
{ … }
int bch2_dev_journal_alloc(struct bch_dev *ca, bool new_fs)
{ … }
int bch2_fs_journal_alloc(struct bch_fs *c)
{ … }
static bool bch2_journal_writing_to_device(struct journal *j, unsigned dev_idx)
{ … }
void bch2_dev_journal_stop(struct journal *j, struct bch_dev *ca)
{ … }
void bch2_fs_journal_stop(struct journal *j)
{ … }
int bch2_fs_journal_start(struct journal *j, u64 cur_seq)
{ … }
void bch2_dev_journal_exit(struct bch_dev *ca)
{ … }
int bch2_dev_journal_init(struct bch_dev *ca, struct bch_sb *sb)
{ … }
void bch2_fs_journal_exit(struct journal *j)
{ … }
int bch2_fs_journal_init(struct journal *j)
{ … }
static const char * const bch2_journal_flags_strs[] = …;
void __bch2_journal_debug_to_text(struct printbuf *out, struct journal *j)
{ … }
void bch2_journal_debug_to_text(struct printbuf *out, struct journal *j)
{ … }
bool bch2_journal_seq_pins_to_text(struct printbuf *out, struct journal *j, u64 *seq)
{ … }
void bch2_journal_pins_to_text(struct printbuf *out, struct journal *j)
{ … }