~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/fs/bcachefs/reflink.h

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 #ifndef _BCACHEFS_REFLINK_H
  3 #define _BCACHEFS_REFLINK_H
  4 
  5 enum bch_validate_flags;
  6 
  7 int bch2_reflink_p_invalid(struct bch_fs *, struct bkey_s_c,
  8                            enum bch_validate_flags, struct printbuf *);
  9 void bch2_reflink_p_to_text(struct printbuf *, struct bch_fs *,
 10                             struct bkey_s_c);
 11 bool bch2_reflink_p_merge(struct bch_fs *, struct bkey_s, struct bkey_s_c);
 12 int bch2_trigger_reflink_p(struct btree_trans *, enum btree_id, unsigned,
 13                            struct bkey_s_c, struct bkey_s,
 14                            enum btree_iter_update_trigger_flags);
 15 
 16 #define bch2_bkey_ops_reflink_p ((struct bkey_ops) {            \
 17         .key_invalid    = bch2_reflink_p_invalid,               \
 18         .val_to_text    = bch2_reflink_p_to_text,               \
 19         .key_merge      = bch2_reflink_p_merge,                 \
 20         .trigger        = bch2_trigger_reflink_p,               \
 21         .min_val_size   = 16,                                   \
 22 })
 23 
 24 int bch2_reflink_v_invalid(struct bch_fs *, struct bkey_s_c,
 25                            enum bch_validate_flags, struct printbuf *);
 26 void bch2_reflink_v_to_text(struct printbuf *, struct bch_fs *,
 27                             struct bkey_s_c);
 28 int bch2_trigger_reflink_v(struct btree_trans *, enum btree_id, unsigned,
 29                            struct bkey_s_c, struct bkey_s,
 30                            enum btree_iter_update_trigger_flags);
 31 
 32 #define bch2_bkey_ops_reflink_v ((struct bkey_ops) {            \
 33         .key_invalid    = bch2_reflink_v_invalid,               \
 34         .val_to_text    = bch2_reflink_v_to_text,               \
 35         .swab           = bch2_ptr_swab,                        \
 36         .trigger        = bch2_trigger_reflink_v,               \
 37         .min_val_size   = 8,                                    \
 38 })
 39 
 40 int bch2_indirect_inline_data_invalid(struct bch_fs *, struct bkey_s_c,
 41                                       enum bch_validate_flags, struct printbuf *);
 42 void bch2_indirect_inline_data_to_text(struct printbuf *,
 43                                 struct bch_fs *, struct bkey_s_c);
 44 int bch2_trigger_indirect_inline_data(struct btree_trans *,
 45                                          enum btree_id, unsigned,
 46                               struct bkey_s_c, struct bkey_s,
 47                               enum btree_iter_update_trigger_flags);
 48 
 49 #define bch2_bkey_ops_indirect_inline_data ((struct bkey_ops) { \
 50         .key_invalid    = bch2_indirect_inline_data_invalid,    \
 51         .val_to_text    = bch2_indirect_inline_data_to_text,    \
 52         .trigger        = bch2_trigger_indirect_inline_data,    \
 53         .min_val_size   = 8,                                    \
 54 })
 55 
 56 static inline const __le64 *bkey_refcount_c(struct bkey_s_c k)
 57 {
 58         switch (k.k->type) {
 59         case KEY_TYPE_reflink_v:
 60                 return &bkey_s_c_to_reflink_v(k).v->refcount;
 61         case KEY_TYPE_indirect_inline_data:
 62                 return &bkey_s_c_to_indirect_inline_data(k).v->refcount;
 63         default:
 64                 return NULL;
 65         }
 66 }
 67 
 68 static inline __le64 *bkey_refcount(struct bkey_s k)
 69 {
 70         switch (k.k->type) {
 71         case KEY_TYPE_reflink_v:
 72                 return &bkey_s_to_reflink_v(k).v->refcount;
 73         case KEY_TYPE_indirect_inline_data:
 74                 return &bkey_s_to_indirect_inline_data(k).v->refcount;
 75         default:
 76                 return NULL;
 77         }
 78 }
 79 
 80 s64 bch2_remap_range(struct bch_fs *, subvol_inum, u64,
 81                      subvol_inum, u64, u64, u64, s64 *);
 82 
 83 #endif /* _BCACHEFS_REFLINK_H */
 84 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php