xref: /linux/fs/bcachefs/io_misc.h (revision 4412b8b23de24a94a0b78ac283db043c833a3975)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _BCACHEFS_IO_MISC_H
3 #define _BCACHEFS_IO_MISC_H
4 
5 int bch2_extent_fallocate(struct btree_trans *, subvol_inum, struct btree_iter *,
6 			  u64, struct bch_io_opts, s64 *,
7 			  struct write_point_specifier);
8 
9 int bch2_fpunch_snapshot(struct btree_trans *, struct bpos, struct bpos);
10 int bch2_fpunch_at(struct btree_trans *, struct btree_iter *,
11 		   subvol_inum, u64, s64 *);
12 int bch2_fpunch(struct bch_fs *c, subvol_inum, u64, u64, s64 *);
13 
14 void bch2_logged_op_truncate_to_text(struct printbuf *, struct bch_fs *, struct bkey_s_c);
15 
16 #define bch2_bkey_ops_logged_op_truncate ((struct bkey_ops) {	\
17 	.val_to_text	= bch2_logged_op_truncate_to_text,	\
18 	.min_val_size	= 24,					\
19 })
20 
21 int bch2_resume_logged_op_truncate(struct btree_trans *, struct bkey_i *);
22 
23 int bch2_truncate(struct bch_fs *, subvol_inum, u64, u64 *);
24 
25 void bch2_logged_op_finsert_to_text(struct printbuf *, struct bch_fs *, struct bkey_s_c);
26 
27 #define bch2_bkey_ops_logged_op_finsert ((struct bkey_ops) {	\
28 	.val_to_text	= bch2_logged_op_finsert_to_text,	\
29 	.min_val_size	= 24,					\
30 })
31 
32 int bch2_resume_logged_op_finsert(struct btree_trans *, struct bkey_i *);
33 
34 int bch2_fcollapse_finsert(struct bch_fs *, subvol_inum, u64, u64, bool, s64 *);
35 
36 #endif /* _BCACHEFS_IO_MISC_H */
37