19888c340SDavid Sterba /* SPDX-License-Identifier: GPL-2.0 */ 2ff023aacSStefan Behrens /* 3ff023aacSStefan Behrens * Copyright (C) STRATO AG 2012. All rights reserved. 4ff023aacSStefan Behrens */ 5ff023aacSStefan Behrens 69888c340SDavid Sterba #ifndef BTRFS_DEV_REPLACE_H 79888c340SDavid Sterba #define BTRFS_DEV_REPLACE_H 8ff023aacSStefan Behrens 9*22b46bdcSDavid Sterba #include <linux/types.h> 10*22b46bdcSDavid Sterba #include <linux/compiler_types.h> 11*22b46bdcSDavid Sterba 12e93c89c1SStefan Behrens struct btrfs_ioctl_dev_replace_args; 13d6921739SJosef Bacik struct btrfs_fs_info; 14d6921739SJosef Bacik struct btrfs_trans_handle; 15d6921739SJosef Bacik struct btrfs_dev_replace; 16d6921739SJosef Bacik struct btrfs_block_group; 17*22b46bdcSDavid Sterba struct btrfs_device; 18e93c89c1SStefan Behrens 19e93c89c1SStefan Behrens int btrfs_init_dev_replace(struct btrfs_fs_info *fs_info); 202b584c68SDavid Sterba int btrfs_run_dev_replace(struct btrfs_trans_handle *trans); 212ff7e61eSJeff Mahoney int btrfs_dev_replace_by_ioctl(struct btrfs_fs_info *fs_info, 22e93c89c1SStefan Behrens struct btrfs_ioctl_dev_replace_args *args); 23e93c89c1SStefan Behrens void btrfs_dev_replace_status(struct btrfs_fs_info *fs_info, 24e93c89c1SStefan Behrens struct btrfs_ioctl_dev_replace_args *args); 2518e67c73SAnand Jain int btrfs_dev_replace_cancel(struct btrfs_fs_info *fs_info); 26e93c89c1SStefan Behrens void btrfs_dev_replace_suspend_for_unmount(struct btrfs_fs_info *fs_info); 27e93c89c1SStefan Behrens int btrfs_resume_dev_replace_async(struct btrfs_fs_info *fs_info); 28e1f60a65SDavid Sterba int __pure btrfs_dev_replace_is_ongoing(struct btrfs_dev_replace *dev_replace); 2978ce9fc2SNaohiro Aota bool btrfs_finish_block_group_to_copy(struct btrfs_device *srcdev, 3078ce9fc2SNaohiro Aota struct btrfs_block_group *cache, 3178ce9fc2SNaohiro Aota u64 physical); 3277407dc0SJosef Bacik void btrfs_bio_counter_inc_blocked(struct btrfs_fs_info *fs_info); 3377407dc0SJosef Bacik void btrfs_bio_counter_sub(struct btrfs_fs_info *fs_info, s64 amount); 3477407dc0SJosef Bacik btrfs_bio_counter_dec(struct btrfs_fs_info * fs_info)3577407dc0SJosef Bacikstatic inline void btrfs_bio_counter_dec(struct btrfs_fs_info *fs_info) 3677407dc0SJosef Bacik { 3777407dc0SJosef Bacik btrfs_bio_counter_sub(fs_info, 1); 3877407dc0SJosef Bacik } 3977407dc0SJosef Bacik 40e93c89c1SStefan Behrens 41ff023aacSStefan Behrens #endif 42