2022-06-13 19:07:19 -04:00
/* SPDX-License-Identifier: GPL-2.0 */
# ifndef _BCACHEFS_DATA_UPDATE_H
# define _BCACHEFS_DATA_UPDATE_H
2022-06-13 19:17:45 -04:00
# include "bkey_buf.h"
2022-06-13 19:07:19 -04:00
# include "io_types.h"
2022-06-13 19:17:45 -04:00
struct moving_context ;
2022-06-13 19:07:19 -04:00
2022-06-13 19:17:45 -04:00
struct data_update_opts {
unsigned rewrite_ptrs ;
2022-10-09 03:32:17 -04:00
unsigned kill_ptrs ;
2022-06-13 19:07:19 -04:00
u16 target ;
2022-06-13 19:17:45 -04:00
u8 extra_replicas ;
unsigned btree_insert_flags ;
unsigned write_flags ;
2022-06-13 19:07:19 -04:00
} ;
struct data_update {
2022-06-13 19:17:45 -04:00
/* extent being updated: */
2022-06-13 19:07:19 -04:00
enum btree_id btree_id ;
2022-06-13 19:17:45 -04:00
struct bkey_buf k ;
struct data_update_opts data_opts ;
2022-06-13 19:07:19 -04:00
struct moving_context * ctxt ;
struct bch_write_op op ;
} ;
int bch2_data_update_index_update ( struct bch_write_op * ) ;
2022-06-13 19:17:45 -04:00
void bch2_data_update_read_done ( struct data_update * ,
struct bch_extent_crc_unpacked ) ;
void bch2_data_update_exit ( struct data_update * ) ;
2022-11-14 01:31:10 -05:00
void bch2_update_unwritten_extent ( struct btree_trans * , struct data_update * ) ;
2022-06-13 19:07:19 -04:00
int bch2_data_update_init ( struct bch_fs * , struct data_update * ,
struct write_point_specifier ,
2022-06-13 19:17:45 -04:00
struct bch_io_opts , struct data_update_opts ,
2022-06-13 19:07:19 -04:00
enum btree_id , struct bkey_s_c ) ;
2022-10-09 03:32:17 -04:00
void bch2_data_update_opts_normalize ( struct bkey_s_c , struct data_update_opts * ) ;
2022-06-13 19:07:19 -04:00
# endif /* _BCACHEFS_DATA_UPDATE_H */