2018-04-04 01:16:55 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
2012-11-06 18:43:11 +08:00
|
|
|
/*
|
|
|
|
* Copyright (C) STRATO AG 2012. All rights reserved.
|
|
|
|
*/
|
|
|
|
|
2018-04-04 01:16:55 +08:00
|
|
|
#ifndef BTRFS_DEV_REPLACE_H
|
|
|
|
#define BTRFS_DEV_REPLACE_H
|
2012-11-06 18:43:11 +08:00
|
|
|
|
2012-11-06 00:33:06 +08:00
|
|
|
struct btrfs_ioctl_dev_replace_args;
|
2022-09-15 07:04:51 +08:00
|
|
|
struct btrfs_fs_info;
|
|
|
|
struct btrfs_trans_handle;
|
|
|
|
struct btrfs_dev_replace;
|
|
|
|
struct btrfs_block_group;
|
2012-11-06 00:33:06 +08:00
|
|
|
|
|
|
|
int btrfs_init_dev_replace(struct btrfs_fs_info *fs_info);
|
2019-03-20 23:51:44 +08:00
|
|
|
int btrfs_run_dev_replace(struct btrfs_trans_handle *trans);
|
2016-06-23 06:54:24 +08:00
|
|
|
int btrfs_dev_replace_by_ioctl(struct btrfs_fs_info *fs_info,
|
2012-11-06 00:33:06 +08:00
|
|
|
struct btrfs_ioctl_dev_replace_args *args);
|
|
|
|
void btrfs_dev_replace_status(struct btrfs_fs_info *fs_info,
|
|
|
|
struct btrfs_ioctl_dev_replace_args *args);
|
2018-02-12 23:33:31 +08:00
|
|
|
int btrfs_dev_replace_cancel(struct btrfs_fs_info *fs_info);
|
2012-11-06 00:33:06 +08:00
|
|
|
void btrfs_dev_replace_suspend_for_unmount(struct btrfs_fs_info *fs_info);
|
|
|
|
int btrfs_resume_dev_replace_async(struct btrfs_fs_info *fs_info);
|
2019-10-02 01:57:39 +08:00
|
|
|
int __pure btrfs_dev_replace_is_ongoing(struct btrfs_dev_replace *dev_replace);
|
2021-02-04 18:22:11 +08:00
|
|
|
bool btrfs_finish_block_group_to_copy(struct btrfs_device *srcdev,
|
|
|
|
struct btrfs_block_group *cache,
|
|
|
|
u64 physical);
|
2022-10-27 03:08:36 +08:00
|
|
|
void btrfs_bio_counter_inc_blocked(struct btrfs_fs_info *fs_info);
|
|
|
|
void btrfs_bio_counter_sub(struct btrfs_fs_info *fs_info, s64 amount);
|
|
|
|
|
|
|
|
static inline void btrfs_bio_counter_dec(struct btrfs_fs_info *fs_info)
|
|
|
|
{
|
|
|
|
btrfs_bio_counter_sub(fs_info, 1);
|
|
|
|
}
|
|
|
|
|
2012-11-06 00:33:06 +08:00
|
|
|
|
2012-11-06 18:43:11 +08:00
|
|
|
#endif
|