#include <linux/sched.h>
#include <linux/bio.h>
#include <linux/slab.h>
#include <linux/blkdev.h>
#include <linux/kthread.h>
#include <linux/math64.h>
#include "misc.h"
#include "ctree.h"
#include "disk-io.h"
#include "transaction.h"
#include "volumes.h"
#include "async-thread.h"
#include "dev-replace.h"
#include "sysfs.h"
#include "zoned.h"
#include "block-group.h"
#include "fs.h"
#include "accessors.h"
#include "scrub.h"
static int btrfs_dev_replace_finishing(struct btrfs_fs_info *fs_info,
int scrub_ret);
static int btrfs_dev_replace_kthread(void *data);
int btrfs_init_dev_replace(struct btrfs_fs_info *fs_info)
{ … }
static int btrfs_init_dev_replace_tgtdev(struct btrfs_fs_info *fs_info,
const char *device_path,
struct btrfs_device *srcdev,
struct btrfs_device **device_out)
{ … }
int btrfs_run_dev_replace(struct btrfs_trans_handle *trans)
{ … }
static int mark_block_group_to_copy(struct btrfs_fs_info *fs_info,
struct btrfs_device *src_dev)
{ … }
bool btrfs_finish_block_group_to_copy(struct btrfs_device *srcdev,
struct btrfs_block_group *cache,
u64 physical)
{ … }
static int btrfs_dev_replace_start(struct btrfs_fs_info *fs_info,
const char *tgtdev_name, u64 srcdevid, const char *srcdev_name,
int read_src)
{ … }
static int btrfs_check_replace_dev_names(struct btrfs_ioctl_dev_replace_args *args)
{ … }
int btrfs_dev_replace_by_ioctl(struct btrfs_fs_info *fs_info,
struct btrfs_ioctl_dev_replace_args *args)
{ … }
static void btrfs_rm_dev_replace_blocked(struct btrfs_fs_info *fs_info)
{ … }
static void btrfs_rm_dev_replace_unblocked(struct btrfs_fs_info *fs_info)
{ … }
static int btrfs_set_target_alloc_state(struct btrfs_device *srcdev,
struct btrfs_device *tgtdev)
{ … }
static void btrfs_dev_replace_update_device_in_mapping_tree(
struct btrfs_fs_info *fs_info,
struct btrfs_device *srcdev,
struct btrfs_device *tgtdev)
{ … }
static int btrfs_dev_replace_finishing(struct btrfs_fs_info *fs_info,
int scrub_ret)
{ … }
static u64 btrfs_dev_replace_progress(struct btrfs_fs_info *fs_info)
{ … }
void btrfs_dev_replace_status(struct btrfs_fs_info *fs_info,
struct btrfs_ioctl_dev_replace_args *args)
{ … }
int btrfs_dev_replace_cancel(struct btrfs_fs_info *fs_info)
{ … }
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)
{ … }
static int btrfs_dev_replace_kthread(void *data)
{ … }
int __pure btrfs_dev_replace_is_ongoing(struct btrfs_dev_replace *dev_replace)
{ … }
void btrfs_bio_counter_sub(struct btrfs_fs_info *fs_info, s64 amount)
{ … }
void btrfs_bio_counter_inc_blocked(struct btrfs_fs_info *fs_info)
{ … }