backpointers.c (7c057d35098613b2936c361aa8289590fef987ba) backpointers.c (facafdcbc157686311dbe58649ef9d29fcf8e610)
1// SPDX-License-Identifier: GPL-2.0
2#include "bcachefs.h"
3#include "bbpos.h"
4#include "alloc_background.h"
5#include "backpointers.h"
6#include "btree_cache.h"
7#include "btree_update.h"
8#include "btree_write_buffer.h"

--- 24 unchanged lines hidden (view full) ---

33 !memcmp(&bp, &bp2, sizeof(bp)))
34 return true;
35 }
36
37 return false;
38}
39
40int bch2_backpointer_invalid(const struct bch_fs *c, struct bkey_s_c k,
1// SPDX-License-Identifier: GPL-2.0
2#include "bcachefs.h"
3#include "bbpos.h"
4#include "alloc_background.h"
5#include "backpointers.h"
6#include "btree_cache.h"
7#include "btree_update.h"
8#include "btree_write_buffer.h"

--- 24 unchanged lines hidden (view full) ---

33 !memcmp(&bp, &bp2, sizeof(bp)))
34 return true;
35 }
36
37 return false;
38}
39
40int bch2_backpointer_invalid(const struct bch_fs *c, struct bkey_s_c k,
41 int rw, struct printbuf *err)
41 unsigned flags, struct printbuf *err)
42{
43 struct bkey_s_c_backpointer bp = bkey_s_c_to_backpointer(k);
44 struct bpos bucket = bp_pos_to_bucket(c, bp.k->p);
45
46 if (bkey_val_bytes(bp.k) < sizeof(*bp.v)) {
47 prt_str(err, "incorrect value size");
48 return -BCH_ERR_invalid_bkey;
49 }

--- 995 unchanged lines hidden ---
42{
43 struct bkey_s_c_backpointer bp = bkey_s_c_to_backpointer(k);
44 struct bpos bucket = bp_pos_to_bucket(c, bp.k->p);
45
46 if (bkey_val_bytes(bp.k) < sizeof(*bp.v)) {
47 prt_str(err, "incorrect value size");
48 return -BCH_ERR_invalid_bkey;
49 }

--- 995 unchanged lines hidden ---