diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/bcachefs/btree_cache.c | 19 | ||||
-rw-r--r-- | fs/bcachefs/checksum.c | 3 | ||||
-rw-r--r-- | fs/bcachefs/compress.c | 13 | ||||
-rw-r--r-- | fs/bcachefs/fs-io.c | 7 | ||||
-rw-r--r-- | fs/bcachefs/journal.c | 20 | ||||
-rw-r--r-- | fs/bcachefs/recovery.c | 2 | ||||
-rw-r--r-- | fs/bcachefs/super-io.c | 3 | ||||
-rw-r--r-- | fs/bcachefs/super.c | 14 |
8 files changed, 17 insertions, 64 deletions
diff --git a/fs/bcachefs/btree_cache.c b/fs/bcachefs/btree_cache.c index b36bed3e1348..f1494bd3c4ee 100644 --- a/fs/bcachefs/btree_cache.c +++ b/fs/bcachefs/btree_cache.c @@ -457,21 +457,17 @@ int bch2_fs_btree_cache_init(struct bch_fs *c) unsigned i; int ret = 0; - pr_verbose_init(c->opts, ""); - ret = rhashtable_init(&bc->table, &bch_btree_cache_params); if (ret) - goto out; + goto err; bc->table_init_done = true; bch2_recalc_btree_reserve(c); for (i = 0; i < bc->reserve; i++) - if (!__bch2_btree_node_mem_alloc(c)) { - ret = -BCH_ERR_ENOMEM_fs_btree_cache_init; - goto out; - } + if (!__bch2_btree_node_mem_alloc(c)) + goto err; list_splice_init(&bc->live, &bc->freeable); @@ -481,9 +477,12 @@ int bch2_fs_btree_cache_init(struct bch_fs *c) bc->shrink.scan_objects = bch2_btree_cache_scan; bc->shrink.seeks = 4; ret = register_shrinker(&bc->shrink, "%s/btree_cache", c->name); -out: - pr_verbose_init(c->opts, "ret %i", ret); - return ret; + if (ret) + goto err; + + return 0; +err: + return -BCH_ERR_ENOMEM_fs_btree_cache_init; } void bch2_fs_btree_cache_init_early(struct btree_cache *bc) diff --git a/fs/bcachefs/checksum.c b/fs/bcachefs/checksum.c index f2a56d786024..20d0e8afc1ad 100644 --- a/fs/bcachefs/checksum.c +++ b/fs/bcachefs/checksum.c @@ -680,8 +680,6 @@ int bch2_fs_encryption_init(struct bch_fs *c) struct bch_key key; int ret = 0; - pr_verbose_init(c->opts, ""); - c->sha256 = crypto_alloc_shash("sha256", 0, 0); ret = PTR_ERR_OR_ZERO(c->sha256); if (ret) { @@ -707,6 +705,5 @@ int bch2_fs_encryption_init(struct bch_fs *c) goto out; out: memzero_explicit(&key, sizeof(key)); - pr_verbose_init(c->opts, "ret %i", ret); return ret; } diff --git a/fs/bcachefs/compress.c b/fs/bcachefs/compress.c index 38a3475b1897..48427a270840 100644 --- a/fs/bcachefs/compress.c +++ b/fs/bcachefs/compress.c @@ -542,7 +542,7 @@ void bch2_fs_compress_exit(struct bch_fs *c) mempool_exit(&c->compression_bounce[READ]); } -static int _bch2_fs_compress_init(struct bch_fs *c, u64 features) +static int __bch2_fs_compress_init(struct bch_fs *c, u64 features) { size_t decompress_workspace_size = 0; bool decompress_workspace_needed; @@ -612,17 +612,6 @@ static int _bch2_fs_compress_init(struct bch_fs *c, u64 features) return 0; } -static int __bch2_fs_compress_init(struct bch_fs *c, u64 features) -{ - int ret; - - pr_verbose_init(c->opts, ""); - ret = _bch2_fs_compress_init(c, features); - pr_verbose_init(c->opts, "ret %i", ret); - - return ret; -} - int bch2_fs_compress_init(struct bch_fs *c) { u64 f = c->sb.features; diff --git a/fs/bcachefs/fs-io.c b/fs/bcachefs/fs-io.c index 513ffb5d968b..cb654cfecfb9 100644 --- a/fs/bcachefs/fs-io.c +++ b/fs/bcachefs/fs-io.c @@ -3915,10 +3915,6 @@ void bch2_fs_fsio_exit(struct bch_fs *c) int bch2_fs_fsio_init(struct bch_fs *c) { - int ret = 0; - - pr_verbose_init(c->opts, ""); - if (bioset_init(&c->writepage_bioset, 4, offsetof(struct bch_writepage_io, op.wbio.bio), BIOSET_NEED_BVECS)) @@ -3938,8 +3934,7 @@ int bch2_fs_fsio_init(struct bch_fs *c) 1, offsetof(struct nocow_flush, bio), 0)) return -BCH_ERR_ENOMEM_nocow_flush_bioset_init; - pr_verbose_init(c->opts, "ret %i", ret); - return ret; + return 0; } #endif /* NO_BCACHEFS_FS */ diff --git a/fs/bcachefs/journal.c b/fs/bcachefs/journal.c index f33ab45b7944..9c4f61ab33e4 100644 --- a/fs/bcachefs/journal.c +++ b/fs/bcachefs/journal.c @@ -1220,12 +1220,8 @@ void bch2_fs_journal_exit(struct journal *j) int bch2_fs_journal_init(struct journal *j) { - struct bch_fs *c = container_of(j, struct bch_fs, journal); static struct lock_class_key res_key; unsigned i; - int ret = 0; - - pr_verbose_init(c->opts, ""); spin_lock_init(&j->lock); spin_lock_init(&j->err_lock); @@ -1242,24 +1238,18 @@ int bch2_fs_journal_init(struct journal *j) ((union journal_res_state) { .cur_entry_offset = JOURNAL_ENTRY_CLOSED_VAL }).v); - if (!(init_fifo(&j->pin, JOURNAL_PIN, GFP_KERNEL))) { - ret = -BCH_ERR_ENOMEM_journal_pin_fifo; - goto out; - } + if (!(init_fifo(&j->pin, JOURNAL_PIN, GFP_KERNEL))) + return -BCH_ERR_ENOMEM_journal_pin_fifo; for (i = 0; i < ARRAY_SIZE(j->buf); i++) { j->buf[i].buf_size = JOURNAL_ENTRY_SIZE_MIN; j->buf[i].data = kvpmalloc(j->buf[i].buf_size, GFP_KERNEL); - if (!j->buf[i].data) { - ret = -BCH_ERR_ENOMEM_journal_buf; - goto out; - } + if (!j->buf[i].data) + return -BCH_ERR_ENOMEM_journal_buf; } j->pin.front = j->pin.back = 1; -out: - pr_verbose_init(c->opts, "ret %i", ret); - return ret; + return 0; } /* debug: */ diff --git a/fs/bcachefs/recovery.c b/fs/bcachefs/recovery.c index 9b49a6bc6702..9ea85b097e8d 100644 --- a/fs/bcachefs/recovery.c +++ b/fs/bcachefs/recovery.c @@ -1504,8 +1504,6 @@ out: if (ret) bch_err_fn(c, ret); - else - bch_verbose(c, "ret %s", bch2_err_str(ret)); return ret; err: fsck_err: diff --git a/fs/bcachefs/super-io.c b/fs/bcachefs/super-io.c index 71764e008e3e..7f3e358d6203 100644 --- a/fs/bcachefs/super-io.c +++ b/fs/bcachefs/super-io.c @@ -615,8 +615,6 @@ int bch2_read_super(const char *path, struct bch_opts *opts, __le64 *i; int ret; - pr_verbose_init(*opts, ""); - memset(sb, 0, sizeof(*sb)); sb->mode = BLK_OPEN_READ; sb->have_bio = true; @@ -726,7 +724,6 @@ got_super: goto err_no_print; } out: - pr_verbose_init(*opts, "ret %i", ret); printbuf_exit(&err); return ret; err: diff --git a/fs/bcachefs/super.c b/fs/bcachefs/super.c index 061a1518f28c..06d461423da5 100644 --- a/fs/bcachefs/super.c +++ b/fs/bcachefs/super.c @@ -651,8 +651,6 @@ static struct bch_fs *bch2_fs_alloc(struct bch_sb *sb, struct bch_opts opts) unsigned i, iter_size; int ret = 0; - pr_verbose_init(opts, ""); - c = kvpmalloc(sizeof(struct bch_fs), GFP_KERNEL|__GFP_ZERO); if (!c) { c = ERR_PTR(-BCH_ERR_ENOMEM_fs_alloc); @@ -863,7 +861,6 @@ static struct bch_fs *bch2_fs_alloc(struct bch_sb *sb, struct bch_opts opts) if (ret) goto err; out: - pr_verbose_init(opts, "ret %i", PTR_ERR_OR_ZERO(c)); return c; err: bch2_fs_free(c); @@ -1179,8 +1176,6 @@ static int bch2_dev_alloc(struct bch_fs *c, unsigned dev_idx) struct bch_dev *ca = NULL; int ret = 0; - pr_verbose_init(c->opts, ""); - if (bch2_fs_init_fault("dev_alloc")) goto err; @@ -1191,14 +1186,11 @@ static int bch2_dev_alloc(struct bch_fs *c, unsigned dev_idx) ca->fs = c; bch2_dev_attach(c, ca, dev_idx); -out: - pr_verbose_init(c->opts, "ret %i", ret); return ret; err: if (ca) bch2_dev_free(ca); - ret = -BCH_ERR_ENOMEM_dev_alloc; - goto out; + return -BCH_ERR_ENOMEM_dev_alloc; } static int __bch2_dev_attach_bdev(struct bch_dev *ca, struct bch_sb_handle *sb) @@ -1874,8 +1866,6 @@ struct bch_fs *bch2_fs_open(char * const *devices, unsigned nr_devices, if (!try_module_get(THIS_MODULE)) return ERR_PTR(-ENODEV); - pr_verbose_init(opts, ""); - if (!nr_devices) { ret = -EINVAL; goto err; @@ -1947,8 +1937,6 @@ out: kfree(sb); printbuf_exit(&errbuf); module_put(THIS_MODULE); - pr_verbose_init(opts, "ret %s (%i)", bch2_err_str(PTR_ERR_OR_ZERO(c)), - PTR_ERR_OR_ZERO(c)); return c; err_print: pr_err("bch_fs_open err opening %s: %s", |