summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/subvolume.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2022-11-19 22:39:08 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:09:48 -0400
commit78c0b75c34209c471616566b3978eac4c1c53e99 (patch)
treee5c64b4d5d643e6170f2acfff1f279333235b398 /fs/bcachefs/subvolume.c
parent5f659376fc1b9ad23b00a35242179b8961e0bc2d (diff)
downloadlinux-78c0b75c34209c471616566b3978eac4c1c53e99.tar.gz
linux-78c0b75c34209c471616566b3978eac4c1c53e99.tar.bz2
linux-78c0b75c34209c471616566b3978eac4c1c53e99.zip
bcachefs: More errcode cleanup
We shouldn't be overloading standard error codes now that we have provisions for bcachefs-specific errorcodes: this patch converts super.c and super-io.c to per error site errcodes, with a bit of cleanup. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/subvolume.c')
-rw-r--r--fs/bcachefs/subvolume.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/bcachefs/subvolume.c b/fs/bcachefs/subvolume.c
index e37ffaad5883..f19f6f8d3233 100644
--- a/fs/bcachefs/subvolume.c
+++ b/fs/bcachefs/subvolume.c
@@ -33,13 +33,13 @@ int bch2_snapshot_invalid(const struct bch_fs *c, struct bkey_s_c k,
if (bkey_gt(k.k->p, POS(0, U32_MAX)) ||
bkey_lt(k.k->p, POS(0, 1))) {
prt_printf(err, "bad pos");
- return -EINVAL;
+ return -BCH_ERR_invalid_bkey;
}
if (bkey_val_bytes(k.k) != sizeof(struct bch_snapshot)) {
prt_printf(err, "bad val size (%zu != %zu)",
bkey_val_bytes(k.k), sizeof(struct bch_snapshot));
- return -EINVAL;
+ return -BCH_ERR_invalid_bkey;
}
s = bkey_s_c_to_snapshot(k);
@@ -48,18 +48,18 @@ int bch2_snapshot_invalid(const struct bch_fs *c, struct bkey_s_c k,
if (id && id <= k.k->p.offset) {
prt_printf(err, "bad parent node (%u <= %llu)",
id, k.k->p.offset);
- return -EINVAL;
+ return -BCH_ERR_invalid_bkey;
}
if (le32_to_cpu(s.v->children[0]) < le32_to_cpu(s.v->children[1])) {
prt_printf(err, "children not normalized");
- return -EINVAL;
+ return -BCH_ERR_invalid_bkey;
}
if (s.v->children[0] &&
s.v->children[0] == s.v->children[1]) {
prt_printf(err, "duplicate child nodes");
- return -EINVAL;
+ return -BCH_ERR_invalid_bkey;
}
for (i = 0; i < 2; i++) {
@@ -68,7 +68,7 @@ int bch2_snapshot_invalid(const struct bch_fs *c, struct bkey_s_c k,
if (id >= k.k->p.offset) {
prt_printf(err, "bad child node (%u >= %llu)",
id, k.k->p.offset);
- return -EINVAL;
+ return -BCH_ERR_invalid_bkey;
}
}
@@ -773,13 +773,13 @@ int bch2_subvolume_invalid(const struct bch_fs *c, struct bkey_s_c k,
if (bkey_lt(k.k->p, SUBVOL_POS_MIN) ||
bkey_gt(k.k->p, SUBVOL_POS_MAX)) {
prt_printf(err, "invalid pos");
- return -EINVAL;
+ return -BCH_ERR_invalid_bkey;
}
if (bkey_val_bytes(k.k) != sizeof(struct bch_subvolume)) {
prt_printf(err, "incorrect value size (%zu != %zu)",
bkey_val_bytes(k.k), sizeof(struct bch_subvolume));
- return -EINVAL;
+ return -BCH_ERR_invalid_bkey;
}
return 0;