2021-03-16 04:42:25 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
|
#ifndef _BCACHEFS_SUBVOLUME_H
|
|
|
|
#define _BCACHEFS_SUBVOLUME_H
|
|
|
|
|
2022-03-29 19:48:45 +00:00
|
|
|
#include "darray.h"
|
2021-10-11 16:03:19 +00:00
|
|
|
#include "subvolume_types.h"
|
|
|
|
|
2023-07-07 01:16:10 +00:00
|
|
|
enum bkey_invalid_flags;
|
|
|
|
|
2023-07-07 06:42:28 +00:00
|
|
|
int bch2_check_subvols(struct bch_fs *);
|
2022-07-14 05:10:24 +00:00
|
|
|
|
2022-04-04 01:50:25 +00:00
|
|
|
int bch2_subvolume_invalid(const struct bch_fs *, struct bkey_s_c,
|
2022-12-21 00:58:16 +00:00
|
|
|
unsigned, struct printbuf *);
|
2021-03-16 04:42:25 +00:00
|
|
|
void bch2_subvolume_to_text(struct printbuf *, struct bch_fs *, struct bkey_s_c);
|
|
|
|
|
2022-10-22 19:59:53 +00:00
|
|
|
#define bch2_bkey_ops_subvolume ((struct bkey_ops) { \
|
2021-03-16 04:42:25 +00:00
|
|
|
.key_invalid = bch2_subvolume_invalid, \
|
|
|
|
.val_to_text = bch2_subvolume_to_text, \
|
2023-04-29 17:24:18 +00:00
|
|
|
.min_val_size = 16, \
|
2022-10-22 19:59:53 +00:00
|
|
|
})
|
2021-03-16 04:42:25 +00:00
|
|
|
|
2021-09-30 23:46:23 +00:00
|
|
|
int bch2_subvolume_get(struct btree_trans *, unsigned,
|
|
|
|
bool, int, struct bch_subvolume *);
|
2021-03-16 04:42:25 +00:00
|
|
|
int bch2_subvolume_get_snapshot(struct btree_trans *, u32, u32 *);
|
|
|
|
|
2022-07-14 05:10:24 +00:00
|
|
|
int bch2_delete_dead_snapshots(struct bch_fs *);
|
|
|
|
void bch2_delete_dead_snapshots_async(struct bch_fs *);
|
|
|
|
|
2021-10-11 16:03:19 +00:00
|
|
|
int bch2_subvolume_unlink(struct btree_trans *, u32);
|
2021-03-16 04:42:25 +00:00
|
|
|
int bch2_subvolume_create(struct btree_trans *, u64, u32,
|
|
|
|
u32 *, u32 *, bool);
|
|
|
|
|
|
|
|
int bch2_fs_subvolumes_init(struct bch_fs *);
|
|
|
|
|
|
|
|
#endif /* _BCACHEFS_SUBVOLUME_H */
|