diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2022-11-20 00:15:11 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2022-11-20 00:15:11 -0500 |
commit | f1f88825c371f84edb85a156de5e1962503d23b2 (patch) | |
tree | fa9336aedc01b4fe8fbf3744e4ff77e496e6cdad /libbcachefs/subvolume.c | |
parent | 7e0fbb0144960197a53f188908afdf85cf15f446 (diff) |
Update bcachefs sources to ea47add37d bcachefs: More errcode cleanup
Diffstat (limited to 'libbcachefs/subvolume.c')
-rw-r--r-- | libbcachefs/subvolume.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libbcachefs/subvolume.c b/libbcachefs/subvolume.c index 1133783..d5c5754 100644 --- a/libbcachefs/subvolume.c +++ b/libbcachefs/subvolume.c @@ -33,13 +33,13 @@ int bch2_snapshot_invalid(const struct bch_fs *c, struct bkey_s_c k, if (bkey_cmp(k.k->p, POS(0, U32_MAX)) > 0 || bkey_cmp(k.k->p, POS(0, 1)) < 0) { 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_cmp(k.k->p, SUBVOL_POS_MIN) < 0 || bkey_cmp(k.k->p, SUBVOL_POS_MAX) > 0) { 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; |