162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 262306a36Sopenharmony_ci 362306a36Sopenharmony_ci#ifndef BTRFS_DEFRAG_H 462306a36Sopenharmony_ci#define BTRFS_DEFRAG_H 562306a36Sopenharmony_ci 662306a36Sopenharmony_ciint btrfs_defrag_file(struct inode *inode, struct file_ra_state *ra, 762306a36Sopenharmony_ci struct btrfs_ioctl_defrag_range_args *range, 862306a36Sopenharmony_ci u64 newer_than, unsigned long max_to_defrag); 962306a36Sopenharmony_ciint __init btrfs_auto_defrag_init(void); 1062306a36Sopenharmony_civoid __cold btrfs_auto_defrag_exit(void); 1162306a36Sopenharmony_ciint btrfs_add_inode_defrag(struct btrfs_trans_handle *trans, 1262306a36Sopenharmony_ci struct btrfs_inode *inode, u32 extent_thresh); 1362306a36Sopenharmony_ciint btrfs_run_defrag_inodes(struct btrfs_fs_info *fs_info); 1462306a36Sopenharmony_civoid btrfs_cleanup_defrag_inodes(struct btrfs_fs_info *fs_info); 1562306a36Sopenharmony_ciint btrfs_defrag_leaves(struct btrfs_trans_handle *trans, struct btrfs_root *root); 1662306a36Sopenharmony_ci 1762306a36Sopenharmony_cistatic inline int btrfs_defrag_cancelled(struct btrfs_fs_info *fs_info) 1862306a36Sopenharmony_ci{ 1962306a36Sopenharmony_ci return signal_pending(current); 2062306a36Sopenharmony_ci} 2162306a36Sopenharmony_ci 2262306a36Sopenharmony_ci#endif 23