extents.h (a8b3a677e786fa869d220a6a78b5532a36dc2f4d) extents.h (facafdcbc157686311dbe58649ef9d29fcf8e610)
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _BCACHEFS_EXTENTS_H
3#define _BCACHEFS_EXTENTS_H
4
5#include "bcachefs.h"
6#include "bkey.h"
7#include "extents_types.h"
8

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

366void bch2_mark_io_failure(struct bch_io_failures *,
367 struct extent_ptr_decoded *);
368int bch2_bkey_pick_read_device(struct bch_fs *, struct bkey_s_c,
369 struct bch_io_failures *,
370 struct extent_ptr_decoded *);
371
372/* KEY_TYPE_btree_ptr: */
373
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _BCACHEFS_EXTENTS_H
3#define _BCACHEFS_EXTENTS_H
4
5#include "bcachefs.h"
6#include "bkey.h"
7#include "extents_types.h"
8

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

366void bch2_mark_io_failure(struct bch_io_failures *,
367 struct extent_ptr_decoded *);
368int bch2_bkey_pick_read_device(struct bch_fs *, struct bkey_s_c,
369 struct bch_io_failures *,
370 struct extent_ptr_decoded *);
371
372/* KEY_TYPE_btree_ptr: */
373
374int bch2_btree_ptr_invalid(const struct bch_fs *, struct bkey_s_c, int, struct printbuf *);
374int bch2_btree_ptr_invalid(const struct bch_fs *, struct bkey_s_c, unsigned, struct printbuf *);
375void bch2_btree_ptr_to_text(struct printbuf *, struct bch_fs *,
376 struct bkey_s_c);
377
375void bch2_btree_ptr_to_text(struct printbuf *, struct bch_fs *,
376 struct bkey_s_c);
377
378int bch2_btree_ptr_v2_invalid(const struct bch_fs *, struct bkey_s_c, int, struct printbuf *);
378int bch2_btree_ptr_v2_invalid(const struct bch_fs *, struct bkey_s_c, unsigned, struct printbuf *);
379void bch2_btree_ptr_v2_to_text(struct printbuf *, struct bch_fs *, struct bkey_s_c);
380void bch2_btree_ptr_v2_compat(enum btree_id, unsigned, unsigned,
381 int, struct bkey_s);
382
383#define bch2_bkey_ops_btree_ptr ((struct bkey_ops) { \
384 .key_invalid = bch2_btree_ptr_invalid, \
385 .val_to_text = bch2_btree_ptr_to_text, \
386 .swab = bch2_ptr_swab, \

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

409 .key_merge = bch2_extent_merge, \
410 .trans_trigger = bch2_trans_mark_extent, \
411 .atomic_trigger = bch2_mark_extent, \
412})
413
414/* KEY_TYPE_reservation: */
415
416int bch2_reservation_invalid(const struct bch_fs *, struct bkey_s_c,
379void bch2_btree_ptr_v2_to_text(struct printbuf *, struct bch_fs *, struct bkey_s_c);
380void bch2_btree_ptr_v2_compat(enum btree_id, unsigned, unsigned,
381 int, struct bkey_s);
382
383#define bch2_bkey_ops_btree_ptr ((struct bkey_ops) { \
384 .key_invalid = bch2_btree_ptr_invalid, \
385 .val_to_text = bch2_btree_ptr_to_text, \
386 .swab = bch2_ptr_swab, \

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

409 .key_merge = bch2_extent_merge, \
410 .trans_trigger = bch2_trans_mark_extent, \
411 .atomic_trigger = bch2_mark_extent, \
412})
413
414/* KEY_TYPE_reservation: */
415
416int bch2_reservation_invalid(const struct bch_fs *, struct bkey_s_c,
417 int, struct printbuf *);
417 unsigned, struct printbuf *);
418void bch2_reservation_to_text(struct printbuf *, struct bch_fs *, struct bkey_s_c);
419bool bch2_reservation_merge(struct bch_fs *, struct bkey_s, struct bkey_s_c);
420
421#define bch2_bkey_ops_reservation ((struct bkey_ops) { \
422 .key_invalid = bch2_reservation_invalid, \
423 .val_to_text = bch2_reservation_to_text, \
424 .key_merge = bch2_reservation_merge, \
425 .trans_trigger = bch2_trans_mark_reservation, \

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

654 struct bch_extent_ptr, u64);
655bool bch2_extents_match(struct bkey_s_c, struct bkey_s_c);
656bool bch2_extent_has_ptr(struct bkey_s_c, struct extent_ptr_decoded, struct bkey_s_c);
657
658bool bch2_extent_normalize(struct bch_fs *, struct bkey_s);
659void bch2_bkey_ptrs_to_text(struct printbuf *, struct bch_fs *,
660 struct bkey_s_c);
661int bch2_bkey_ptrs_invalid(const struct bch_fs *, struct bkey_s_c,
418void bch2_reservation_to_text(struct printbuf *, struct bch_fs *, struct bkey_s_c);
419bool bch2_reservation_merge(struct bch_fs *, struct bkey_s, struct bkey_s_c);
420
421#define bch2_bkey_ops_reservation ((struct bkey_ops) { \
422 .key_invalid = bch2_reservation_invalid, \
423 .val_to_text = bch2_reservation_to_text, \
424 .key_merge = bch2_reservation_merge, \
425 .trans_trigger = bch2_trans_mark_reservation, \

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

654 struct bch_extent_ptr, u64);
655bool bch2_extents_match(struct bkey_s_c, struct bkey_s_c);
656bool bch2_extent_has_ptr(struct bkey_s_c, struct extent_ptr_decoded, struct bkey_s_c);
657
658bool bch2_extent_normalize(struct bch_fs *, struct bkey_s);
659void bch2_bkey_ptrs_to_text(struct printbuf *, struct bch_fs *,
660 struct bkey_s_c);
661int bch2_bkey_ptrs_invalid(const struct bch_fs *, struct bkey_s_c,
662 int, struct printbuf *);
662 unsigned, struct printbuf *);
663
664void bch2_ptr_swab(struct bkey_s);
665
666/* Generic extent code: */
667
668enum bch_extent_overlap {
669 BCH_EXTENT_OVERLAP_ALL = 0,
670 BCH_EXTENT_OVERLAP_BACK = 1,

--- 58 unchanged lines hidden ---
663
664void bch2_ptr_swab(struct bkey_s);
665
666/* Generic extent code: */
667
668enum bch_extent_overlap {
669 BCH_EXTENT_OVERLAP_ALL = 0,
670 BCH_EXTENT_OVERLAP_BACK = 1,

--- 58 unchanged lines hidden ---