diff options
Diffstat (limited to 'libbcachefs/alloc_background.c')
-rw-r--r-- | libbcachefs/alloc_background.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/libbcachefs/alloc_background.c b/libbcachefs/alloc_background.c index 742313c2..727e5057 100644 --- a/libbcachefs/alloc_background.c +++ b/libbcachefs/alloc_background.c @@ -230,7 +230,7 @@ int bch2_alloc_v1_invalid(const struct bch_fs *c, struct bkey_s_c k, if (bkey_val_u64s(a.k) < bch_alloc_v1_val_u64s(a.v)) { prt_printf(err, "incorrect value size (%zu < %u)", bkey_val_u64s(a.k), bch_alloc_v1_val_u64s(a.v)); - return -EINVAL; + return -BCH_ERR_invalid_bkey; } return 0; @@ -243,7 +243,7 @@ int bch2_alloc_v2_invalid(const struct bch_fs *c, struct bkey_s_c k, if (bch2_alloc_unpack_v2(&u, k)) { prt_printf(err, "unpack error"); - return -EINVAL; + return -BCH_ERR_invalid_bkey; } return 0; @@ -256,7 +256,7 @@ int bch2_alloc_v3_invalid(const struct bch_fs *c, struct bkey_s_c k, if (bch2_alloc_unpack_v3(&u, k)) { prt_printf(err, "unpack error"); - return -EINVAL; + return -BCH_ERR_invalid_bkey; } return 0; @@ -270,13 +270,13 @@ int bch2_alloc_v4_invalid(const struct bch_fs *c, struct bkey_s_c k, if (alloc_v4_u64s(a.v) != bkey_val_u64s(k.k)) { prt_printf(err, "bad val size (%lu != %u)", bkey_val_u64s(k.k), alloc_v4_u64s(a.v)); - return -EINVAL; + return -BCH_ERR_invalid_bkey; } if (!BCH_ALLOC_V4_BACKPOINTERS_START(a.v) && BCH_ALLOC_V4_NR_BACKPOINTERS(a.v)) { prt_printf(err, "invalid backpointers_start"); - return -EINVAL; + return -BCH_ERR_invalid_bkey; } /* @@ -291,7 +291,7 @@ int bch2_alloc_v4_invalid(const struct bch_fs *c, struct bkey_s_c k, if (bp_len > a.v->dirty_sectors) { prt_printf(err, "too many backpointers"); - return -EINVAL; + return -BCH_ERR_invalid_bkey; } } @@ -299,7 +299,7 @@ int bch2_alloc_v4_invalid(const struct bch_fs *c, struct bkey_s_c k, if (alloc_data_type(*a.v, a.v->data_type) != a.v->data_type) { prt_printf(err, "invalid data type (got %u should be %u)", a.v->data_type, alloc_data_type(*a.v, a.v->data_type)); - return -EINVAL; + return -BCH_ERR_invalid_bkey; } switch (a.v->data_type) { @@ -310,7 +310,7 @@ int bch2_alloc_v4_invalid(const struct bch_fs *c, struct bkey_s_c k, a.v->cached_sectors || a.v->stripe) { prt_printf(err, "empty data type free but have data"); - return -EINVAL; + return -BCH_ERR_invalid_bkey; } break; case BCH_DATA_sb: @@ -321,7 +321,7 @@ int bch2_alloc_v4_invalid(const struct bch_fs *c, struct bkey_s_c k, if (!a.v->dirty_sectors) { prt_printf(err, "data_type %s but dirty_sectors==0", bch2_data_types[a.v->data_type]); - return -EINVAL; + return -BCH_ERR_invalid_bkey; } break; case BCH_DATA_cached: @@ -329,20 +329,20 @@ int bch2_alloc_v4_invalid(const struct bch_fs *c, struct bkey_s_c k, a.v->dirty_sectors || a.v->stripe) { prt_printf(err, "data type inconsistency"); - return -EINVAL; + return -BCH_ERR_invalid_bkey; } if (!a.v->io_time[READ] && test_bit(BCH_FS_CHECK_ALLOC_TO_LRU_REFS_DONE, &c->flags)) { prt_printf(err, "cached bucket with read_time == 0"); - return -EINVAL; + return -BCH_ERR_invalid_bkey; } break; case BCH_DATA_stripe: if (!a.v->stripe) { prt_printf(err, "data_type %s but stripe==0", bch2_data_types[a.v->data_type]); - return -EINVAL; + return -BCH_ERR_invalid_bkey; } break; } |