diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-03-14 15:35:57 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-05-12 19:42:30 -0400 |
commit | 1e40d59b5340ca37edb87890db841f4a3ae72704 (patch) | |
tree | 8b2dcd06b2b8da690f2533729dba52063eb1fdf7 /fs/bcachefs/fs-io.c | |
parent | 3911ad7ded65fa58169a4d6099eba92d1e7624f8 (diff) |
bcachefs: Private error codes: ENOMEM
This adds private error codes for most (but not all) of our ENOMEM uses,
which makes it easier to track down assorted allocation failures.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/fs-io.c')
-rw-r--r-- | fs/bcachefs/fs-io.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/fs/bcachefs/fs-io.c b/fs/bcachefs/fs-io.c index 7c028e0d4142..8a4c1a5651aa 100644 --- a/fs/bcachefs/fs-io.c +++ b/fs/bcachefs/fs-io.c @@ -3707,16 +3707,22 @@ int bch2_fs_fsio_init(struct bch_fs *c) if (bioset_init(&c->writepage_bioset, 4, offsetof(struct bch_writepage_io, op.wbio.bio), - BIOSET_NEED_BVECS) || - bioset_init(&c->dio_read_bioset, + BIOSET_NEED_BVECS)) + return -BCH_ERR_ENOMEM_writepage_bioset_init; + + if (bioset_init(&c->dio_read_bioset, 4, offsetof(struct dio_read, rbio.bio), - BIOSET_NEED_BVECS) || - bioset_init(&c->dio_write_bioset, + BIOSET_NEED_BVECS)) + return -BCH_ERR_ENOMEM_dio_read_bioset_init; + + if (bioset_init(&c->dio_write_bioset, 4, offsetof(struct dio_write, op.wbio.bio), - BIOSET_NEED_BVECS) || - bioset_init(&c->nocow_flush_bioset, + BIOSET_NEED_BVECS)) + return -BCH_ERR_ENOMEM_dio_write_bioset_init; + + if (bioset_init(&c->nocow_flush_bioset, 1, offsetof(struct nocow_flush, bio), 0)) - ret = -ENOMEM; + return -BCH_ERR_ENOMEM_nocow_flush_bioset_init; pr_verbose_init(c->opts, "ret %i", ret); return ret; |