@@ -9,7 +9,7 @@
const struct bkey_format bch2_bkey_format_current = BKEY_FORMAT_CURRENT;
-void bch2_bkey_packed_to_binary_text(struct printbuf *out,
+static void bch2_bkey_packed_to_binary_text(struct printbuf *out,
const struct bkey_format *f,
const struct bkey_packed *k)
{
@@ -27,10 +27,6 @@ enum bkey_invalid_flags {
#endif
#endif
-void bch2_bkey_packed_to_binary_text(struct printbuf *,
- const struct bkey_format *,
- const struct bkey_packed *);
-
/* bkey with split value, const */
struct bkey_s_c {
const struct bkey *k;
@@ -152,7 +152,7 @@ static u64 bch2_key_types_allowed[] = {
#undef x
};
-const char *bch2_btree_node_type_str(enum btree_node_type type)
+static const char *bch2_btree_node_type_str(enum btree_node_type type)
{
return type == BKEY_TYPE_btree ? "internal btree node" : bch2_btree_id_str(type - 1);
}
@@ -307,7 +307,7 @@ void bch2_bkey_val_to_text(struct printbuf *out, struct bch_fs *c,
}
}
-void bch2_bkey_swab_val(struct bkey_s k)
+static void bch2_bkey_swab_val(struct bkey_s k)
{
const struct bkey_ops *ops = bch2_bkey_type_ops(k.k->type);
@@ -354,7 +354,7 @@ static const struct old_bkey_type {
{BKEY_TYPE_quotas, 128, KEY_TYPE_quota },
};
-void bch2_bkey_renumber(enum btree_node_type btree_node_type,
+static void bch2_bkey_renumber(enum btree_node_type btree_node_type,
struct bkey_packed *k,
int write)
{
@@ -63,8 +63,6 @@ void bch2_val_to_text(struct printbuf *, struct bch_fs *,
void bch2_bkey_val_to_text(struct printbuf *, struct bch_fs *,
struct bkey_s_c);
-void bch2_bkey_swab_val(struct bkey_s);
-
bool bch2_bkey_normalize(struct bch_fs *, struct bkey_s);
static inline bool bch2_bkey_maybe_mergable(const struct bkey *l, const struct bkey *r)
@@ -160,8 +158,6 @@ static inline int bch2_key_trigger_new(struct btree_trans *trans,
BTREE_TRIGGER_INSERT|flags);
}
-void bch2_bkey_renumber(enum btree_node_type, struct bkey_packed *, int);
-
void __bch2_bkey_compat(unsigned, enum btree_id, unsigned, unsigned,
int, struct bkey_format *, struct bkey_packed *);
@@ -440,7 +440,7 @@ void bch2_btree_and_journal_iter_init_node_iter(struct btree_trans *trans,
/* sort and dedup all keys in the journal: */
-void bch2_journal_entries_free(struct bch_fs *c)
+static void bch2_journal_entries_free(struct bch_fs *c)
{
struct journal_replay **i;
struct genradix_iter iter;
@@ -62,8 +62,6 @@ static inline void bch2_journal_keys_put_initial(struct bch_fs *c)
c->journal_keys.initial_ref_held = false;
}
-void bch2_journal_entries_free(struct bch_fs *);
-
int bch2_journal_keys_sort(struct bch_fs *);
#endif /* _BCACHEFS_BTREE_JOURNAL_ITER_H */
@@ -652,8 +652,6 @@ static inline enum btree_node_type btree_node_type(struct btree *b)
return __btree_node_type(b->c.level, b->c.btree_id);
}
-const char *bch2_btree_node_type_str(enum btree_node_type);
-
#define BTREE_NODE_TYPE_HAS_TRANS_TRIGGERS \
(BIT_ULL(BKEY_TYPE_extents)| \
BIT_ULL(BKEY_TYPE_alloc)| \
@@ -442,7 +442,7 @@ int bch2_btree_write_buffer_flush_sync(struct btree_trans *trans)
return btree_write_buffer_flush_seq(trans, journal_cur_seq(&c->journal));
}
-int bch2_btree_write_buffer_flush_nocheck_rw(struct btree_trans *trans)
+static int bch2_btree_write_buffer_flush_nocheck_rw(struct btree_trans *trans)
{
struct bch_fs *c = trans->c;
struct btree_write_buffer *wb = &c->btree_write_buffer;
@@ -20,7 +20,6 @@ static inline bool bch2_btree_write_buffer_must_wait(struct bch_fs *c)
struct btree_trans;
int bch2_btree_write_buffer_flush_sync(struct btree_trans *);
-int bch2_btree_write_buffer_flush_nocheck_rw(struct btree_trans *);
int bch2_btree_write_buffer_tryflush(struct btree_trans *);
struct journal_keys_to_wb {
@@ -98,7 +98,7 @@ void bch2_dev_usage_read_fast(struct bch_dev *ca, struct bch_dev_usage *usage)
} while (read_seqcount_retry(&c->usage_lock, seq));
}
-u64 bch2_fs_usage_read_one(struct bch_fs *c, u64 *v)
+static u64 bch2_fs_usage_read_one(struct bch_fs *c, u64 *v)
{
ssize_t offset = v - (u64 *) c->usage_base;
unsigned i, seq;
@@ -288,8 +288,6 @@ static inline unsigned dev_usage_u64s(void)
return sizeof(struct bch_dev_usage) / sizeof(u64);
}
-u64 bch2_fs_usage_read_one(struct bch_fs *, u64 *);
-
struct bch_fs_usage_online *bch2_fs_usage_read(struct bch_fs *);
void bch2_fs_usage_acc_to_base(struct bch_fs *, unsigned);
@@ -152,7 +152,7 @@ static inline int do_encrypt(struct crypto_sync_skcipher *tfm,
}
}
-int bch2_chacha_encrypt_key(struct bch_key *key, struct nonce nonce,
+static int bch2_chacha_encrypt_key(struct bch_key *key, struct nonce nonce,
void *buf, size_t len)
{
struct crypto_sync_skcipher *chacha20 =
@@ -608,7 +608,7 @@ int bch2_revoke_key(struct bch_sb *sb)
}
#endif
-int bch2_decrypt_sb_key(struct bch_fs *c,
+static int bch2_decrypt_sb_key(struct bch_fs *c,
struct bch_sb_field_crypt *crypt,
struct bch_key *key)
{
@@ -68,7 +68,6 @@ static inline void bch2_csum_err_msg(struct printbuf *out,
prt_printf(out, " type %s", bch2_csum_types[type]);
}
-int bch2_chacha_encrypt_key(struct bch_key *, struct nonce, void *, size_t);
int bch2_request_key(struct bch_sb *, struct bch_key *);
#ifndef __KERNEL__
int bch2_revoke_key(struct bch_sb *);
@@ -99,9 +98,6 @@ static inline int bch2_encrypt_bio(struct bch_fs *c, unsigned type,
extern const struct bch_sb_field_ops bch_sb_field_ops_crypt;
-int bch2_decrypt_sb_key(struct bch_fs *, struct bch_sb_field_crypt *,
- struct bch_key *);
-
int bch2_disable_encryption(struct bch_fs *);
int bch2_enable_encryption(struct bch_fs *, bool);
@@ -13,7 +13,7 @@ static inline long io_timer_cmp(io_timer_heap *h,
return l->expire - r->expire;
}
-void bch2_io_timer_add(struct io_clock *clock, struct io_timer *timer)
+static void bch2_io_timer_add(struct io_clock *clock, struct io_timer *timer)
{
size_t i;
@@ -35,7 +35,7 @@ void bch2_io_timer_add(struct io_clock *clock, struct io_timer *timer)
spin_unlock(&clock->timer_lock);
}
-void bch2_io_timer_del(struct io_clock *clock, struct io_timer *timer)
+static void bch2_io_timer_del(struct io_clock *clock, struct io_timer *timer)
{
size_t i;
@@ -2,8 +2,6 @@
#ifndef _BCACHEFS_CLOCK_H
#define _BCACHEFS_CLOCK_H
-void bch2_io_timer_add(struct io_clock *, struct io_timer *);
-void bch2_io_timer_del(struct io_clock *, struct io_timer *);
void bch2_kthread_io_clock_wait(struct io_clock *, unsigned long,
unsigned long);
@@ -330,7 +330,7 @@ static int __bch2_disk_group_add(struct bch_sb_handle *sb, unsigned parent,
return i;
}
-int bch2_disk_path_find(struct bch_sb_handle *sb, const char *name)
+static int bch2_disk_path_find(struct bch_sb_handle *sb, const char *name)
{
struct bch_sb_field_disk_groups *groups =
bch2_sb_field_get(sb->sb, disk_groups);
@@ -80,8 +80,6 @@ static inline bool bch2_target_accepts_data(struct bch_fs *c,
bool bch2_dev_in_target(struct bch_fs *, unsigned, unsigned);
-int bch2_disk_path_find(struct bch_sb_handle *, const char *);
-
/* Exported for userspace bcachefs-tools: */
int bch2_disk_path_find_or_create(struct bch_sb_handle *, const char *);
@@ -102,7 +102,7 @@ static int count_iters_for_insert(struct btree_trans *trans,
#define EXTENT_ITERS_MAX (BTREE_ITER_INITIAL / 3)
-int bch2_extent_atomic_end(struct btree_trans *trans,
+static int bch2_extent_atomic_end(struct btree_trans *trans,
struct btree_iter *iter,
struct bkey_i *insert,
struct bpos *end)
@@ -4,8 +4,6 @@
#include "bcachefs.h"
-int bch2_extent_atomic_end(struct btree_trans *, struct btree_iter *,
- struct bkey_i *, struct bpos *);
int bch2_extent_trim_atomic(struct btree_trans *, struct btree_iter *,
struct bkey_i *);
@@ -128,7 +128,7 @@ static int inode_set_size(struct btree_trans *trans,
return 0;
}
-int __must_check bch2_write_inode_size(struct bch_fs *c,
+static int __must_check bch2_write_inode_size(struct bch_fs *c,
struct bch_inode_info *inode,
loff_t new_size, unsigned fields)
{
@@ -159,10 +159,6 @@ static inline bool fdm_dropped_locks(void)
void bch2_inode_flush_nocow_writes_async(struct bch_fs *,
struct bch_inode_info *, struct closure *);
-int __must_check bch2_write_inode_size(struct bch_fs *,
- struct bch_inode_info *,
- loff_t, unsigned);
-
int bch2_fsync(struct file *, loff_t, loff_t, int);
int bchfs_truncate(struct mnt_idmap *,
@@ -17,7 +17,7 @@
#include "sb-clean.h"
#include "trace.h"
-void bch2_journal_ptrs_to_text(struct printbuf *out, struct bch_fs *c,
+static void bch2_journal_ptrs_to_text(struct printbuf *out, struct bch_fs *c,
struct journal_replay *j)
{
darray_for_each(j->ptrs, i) {
@@ -58,9 +58,6 @@ int bch2_journal_entry_validate(struct bch_fs *, struct jset *,
void bch2_journal_entry_to_text(struct printbuf *, struct bch_fs *,
struct jset_entry *);
-void bch2_journal_ptrs_to_text(struct printbuf *, struct bch_fs *,
- struct journal_replay *);
-
int bch2_journal_read(struct bch_fs *, u64 *, u64 *, u64 *);
CLOSURE_CALLBACK(bch2_journal_write);
@@ -49,7 +49,7 @@ static int __bch2_lru_set(struct btree_trans *trans, u16 lru_id,
: 0;
}
-int bch2_lru_del(struct btree_trans *trans, u16 lru_id, u64 dev_bucket, u64 time)
+static int bch2_lru_del(struct btree_trans *trans, u16 lru_id, u64 dev_bucket, u64 time)
{
return __bch2_lru_set(trans, lru_id, dev_bucket, time, KEY_TYPE_deleted);
}
@@ -60,7 +60,6 @@ void bch2_lru_pos_to_text(struct printbuf *, struct bpos);
.min_val_size = 8, \
})
-int bch2_lru_del(struct btree_trans *, u16, u64, u64);
int bch2_lru_set(struct btree_trans *, u16, u64, u64);
int bch2_lru_change(struct btree_trans *, u16, u64, u64, u64);
@@ -409,7 +409,7 @@ int bch2_move_extent(struct moving_context *ctxt,
return ret;
}
-struct bch_io_opts *bch2_move_get_io_opts(struct btree_trans *trans,
+static struct bch_io_opts *bch2_move_get_io_opts(struct btree_trans *trans,
struct per_snapshot_io_opts *io_opts,
struct bkey_s_c extent_k)
{
@@ -110,8 +110,6 @@ static inline void per_snapshot_io_opts_exit(struct per_snapshot_io_opts *io_opt
darray_exit(&io_opts->d);
}
-struct bch_io_opts *bch2_move_get_io_opts(struct btree_trans *,
- struct per_snapshot_io_opts *, struct bkey_s_c);
int bch2_move_get_io_opts_one(struct btree_trans *, struct bch_io_opts *, struct bkey_s_c);
int bch2_scan_old_btree_nodes(struct bch_fs *, struct bch_move_stats *);
@@ -143,7 +143,7 @@ u64 BCH2_NO_SB_OPT(const struct bch_sb *sb)
BUG();
}
-void SET_BCH2_NO_SB_OPT(struct bch_sb *sb, u64 v)
+static void SET_BCH2_NO_SB_OPT(struct bch_sb *sb, u64 v)
{
BUG();
}
@@ -549,7 +549,7 @@ int bch2_opts_from_sb(struct bch_opts *opts, struct bch_sb *sb)
return 0;
}
-void __bch2_opt_set_sb(struct bch_sb *sb, const struct bch_option *opt, u64 v)
+static void __bch2_opt_set_sb(struct bch_sb *sb, const struct bch_option *opt, u64 v)
{
if (opt->set_sb == SET_BCH2_NO_SB_OPT)
return;
@@ -47,7 +47,6 @@ static inline const char *bch2_d_type_str(unsigned d_type)
/* dummy option, for options that aren't stored in the superblock */
u64 BCH2_NO_SB_OPT(const struct bch_sb *);
-void SET_BCH2_NO_SB_OPT(struct bch_sb *, u64);
/* When can be set: */
enum opt_flags {
@@ -543,7 +542,6 @@ void bch2_opt_set_by_id(struct bch_opts *, enum bch_opt_id, u64);
u64 bch2_opt_from_sb(struct bch_sb *, enum bch_opt_id);
int bch2_opts_from_sb(struct bch_opts *, struct bch_sb *);
-void __bch2_opt_set_sb(struct bch_sb *, const struct bch_option *, u64);
void bch2_opt_set_sb(struct bch_fs *, const struct bch_option *, u64);
int bch2_opt_lookup(const char *);
@@ -20,7 +20,7 @@
* as they would be in the journal:
*/
-int bch2_sb_clean_validate_late(struct bch_fs *c, struct bch_sb_field_clean *clean,
+static int bch2_sb_clean_validate_late(struct bch_fs *c, struct bch_sb_field_clean *clean,
int write)
{
struct jset_entry *entry;
@@ -2,7 +2,6 @@
#ifndef _BCACHEFS_SB_CLEAN_H
#define _BCACHEFS_SB_CLEAN_H
-int bch2_sb_clean_validate_late(struct bch_fs *, struct bch_sb_field_clean *, int);
int bch2_verify_superblock_clean(struct bch_fs *, struct bch_sb_field_clean **,
struct jset *);
struct bch_sb_field_clean *bch2_read_superblock_clean(struct bch_fs *);
@@ -46,7 +46,7 @@ static void bch2_sb_counters_to_text(struct printbuf *out, struct bch_sb *sb,
}
};
-int bch2_sb_counters_to_cpu(struct bch_fs *c)
+static int bch2_sb_counters_to_cpu(struct bch_fs *c)
{
struct bch_sb_field_counters *ctrs = bch2_sb_field_get(c->disk_sb.sb, counters);
unsigned int i;
@@ -5,7 +5,6 @@
#include "bcachefs.h"
#include "super-io.h"
-int bch2_sb_counters_to_cpu(struct bch_fs *);
int bch2_sb_counters_from_cpu(struct bch_fs *);
void bch2_fs_counters_exit(struct bch_fs *);
@@ -55,7 +55,7 @@ int bch2_snapshot_tree_lookup(struct btree_trans *trans, u32 id,
return ret;
}
-struct bkey_i_snapshot_tree *
+static struct bkey_i_snapshot_tree *
__bch2_snapshot_tree_create(struct btree_trans *trans)
{
struct btree_iter iter;
@@ -617,7 +617,7 @@ static int snapshot_tree_ptr_good(struct btree_trans *trans,
return bch2_snapshot_is_ancestor_early(trans->c, snap_id, le32_to_cpu(s_t.root_snapshot));
}
-u32 bch2_snapshot_skiplist_get(struct bch_fs *c, u32 id)
+static u32 bch2_snapshot_skiplist_get(struct bch_fs *c, u32 id)
{
const struct snapshot_t *s;
@@ -1359,7 +1359,7 @@ static int bch2_fix_child_of_deleted_snapshot(struct btree_trans *trans,
return bch2_trans_update(trans, iter, &s->k_i, 0);
}
-int bch2_delete_dead_snapshots(struct bch_fs *c)
+static int bch2_delete_dead_snapshots(struct bch_fs *c)
{
struct btree_trans *trans;
snapshot_id_list deleted = { 0 };
@@ -14,8 +14,6 @@ int bch2_snapshot_tree_invalid(struct bch_fs *, struct bkey_s_c,
.min_val_size = 8, \
})
-struct bkey_i_snapshot_tree *__bch2_snapshot_tree_create(struct btree_trans *);
-
int bch2_snapshot_tree_lookup(struct btree_trans *, u32, struct bch_snapshot_tree *);
void bch2_snapshot_to_text(struct printbuf *, struct bch_fs *, struct bkey_s_c);
@@ -100,8 +98,6 @@ static inline u32 bch2_snapshot_nth_parent(struct bch_fs *c, u32 id, u32 n)
return id;
}
-u32 bch2_snapshot_skiplist_get(struct bch_fs *, u32);
-
static inline u32 bch2_snapshot_root(struct bch_fs *c, u32 id)
{
u32 parent;
@@ -30,7 +30,6 @@ int bch2_subvolume_get_snapshot(struct btree_trans *, u32, u32 *);
int bch2_subvol_is_ro_trans(struct btree_trans *, u32);
int bch2_subvol_is_ro(struct bch_fs *, u32);
-int bch2_delete_dead_snapshots(struct bch_fs *);
void bch2_delete_dead_snapshots_async(struct bch_fs *);
int bch2_subvolume_unlink(struct btree_trans *, u32);
@@ -151,7 +151,7 @@ void bch2_free_super(struct bch_sb_handle *sb)
memset(sb, 0, sizeof(*sb));
}
-int bch2_sb_realloc(struct bch_sb_handle *sb, unsigned u64s)
+static int bch2_sb_realloc(struct bch_sb_handle *sb, unsigned u64s)
{
size_t new_bytes = __vstruct_bytes(struct bch_sb, u64s);
size_t new_buffer_size;
@@ -1226,7 +1226,7 @@ void bch2_sb_field_to_text(struct printbuf *out, struct bch_sb *sb,
__bch2_sb_field_to_text(out, sb, f);
}
-void bch2_sb_layout_to_text(struct printbuf *out, struct bch_sb_layout *l)
+static void bch2_sb_layout_to_text(struct printbuf *out, struct bch_sb_layout *l)
{
unsigned i;
@@ -77,7 +77,6 @@ int bch2_sb_to_fs(struct bch_fs *, struct bch_sb *);
int bch2_sb_from_fs(struct bch_fs *, struct bch_dev *);
void bch2_free_super(struct bch_sb_handle *);
-int bch2_sb_realloc(struct bch_sb_handle *, unsigned);
int bch2_read_super(const char *, struct bch_opts *, struct bch_sb_handle *);
int bch2_read_super_silent(const char *, struct bch_opts *, struct bch_sb_handle *);
@@ -97,7 +96,6 @@ void __bch2_sb_field_to_text(struct printbuf *, struct bch_sb *,
struct bch_sb_field *);
void bch2_sb_field_to_text(struct printbuf *, struct bch_sb *,
struct bch_sb_field *);
-void bch2_sb_layout_to_text(struct printbuf *, struct bch_sb_layout *);
void bch2_sb_to_text(struct printbuf *, struct bch_sb *, bool, unsigned);
#endif /* _BCACHEFS_SUPER_IO_H */
@@ -272,7 +272,7 @@ void bch2_print_string_as_lines(const char *prefix, const char *lines)
console_unlock();
}
-int bch2_save_backtrace(bch_stacktrace *stack, struct task_struct *task, unsigned skipnr,
+static int bch2_save_backtrace(bch_stacktrace *stack, struct task_struct *task, unsigned skipnr,
gfp_t gfp)
{
#ifdef CONFIG_STACKTRACE
@@ -300,7 +300,7 @@ int bch2_save_backtrace(bch_stacktrace *stack, struct task_struct *task, unsigne
#endif
}
-void bch2_prt_backtrace(struct printbuf *out, bch_stacktrace *stack)
+static void bch2_prt_backtrace(struct printbuf *out, bch_stacktrace *stack)
{
darray_for_each(*stack, i) {
prt_printf(out, "[<0>] %pB", (void *) *i);
@@ -315,8 +315,6 @@ void bch2_prt_u64_base2(struct printbuf *, u64);
void bch2_print_string_as_lines(const char *prefix, const char *lines);
typedef DARRAY(unsigned long) bch_stacktrace;
-int bch2_save_backtrace(bch_stacktrace *stack, struct task_struct *, unsigned, gfp_t);
-void bch2_prt_backtrace(struct printbuf *, bch_stacktrace *);
int bch2_prt_task_backtrace(struct printbuf *, struct task_struct *, unsigned, gfp_t);
static inline void prt_bdevname(struct printbuf *out, struct block_device *bdev)