Dave Chinner | 0b61f8a | 2018-06-05 19:42:14 -0700 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Darrick J. Wong | 3993bae | 2016-10-03 09:11:32 -0700 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2016 Oracle. All Rights Reserved. |
Darrick J. Wong | 3993bae | 2016-10-03 09:11:32 -0700 | [diff] [blame] | 4 | * Author: Darrick J. Wong <darrick.wong@oracle.com> |
Darrick J. Wong | 3993bae | 2016-10-03 09:11:32 -0700 | [diff] [blame] | 5 | */ |
| 6 | #ifndef __XFS_REFLINK_H |
| 7 | #define __XFS_REFLINK_H 1 |
| 8 | |
Darrick J. Wong | 92ff728 | 2017-06-16 11:00:10 -0700 | [diff] [blame] | 9 | extern int xfs_reflink_find_shared(struct xfs_mount *mp, struct xfs_trans *tp, |
| 10 | xfs_agnumber_t agno, xfs_agblock_t agbno, xfs_extlen_t aglen, |
| 11 | xfs_agblock_t *fbno, xfs_extlen_t *flen, bool find_maximal); |
Darrick J. Wong | 2a06705 | 2016-10-03 09:11:33 -0700 | [diff] [blame] | 12 | extern int xfs_reflink_trim_around_shared(struct xfs_inode *ip, |
Christoph Hellwig | d392bc8 | 2018-10-18 17:19:48 +1100 | [diff] [blame] | 13 | struct xfs_bmbt_irec *irec, bool *shared); |
Darrick J. Wong | 2a06705 | 2016-10-03 09:11:33 -0700 | [diff] [blame] | 14 | |
Christoph Hellwig | 3ba020b | 2016-10-20 15:53:50 +1100 | [diff] [blame] | 15 | extern int xfs_reflink_reserve_cow(struct xfs_inode *ip, |
Christoph Hellwig | fc43946 | 2018-10-18 17:19:37 +1100 | [diff] [blame] | 16 | struct xfs_bmbt_irec *imap); |
Christoph Hellwig | 3c68d44 | 2017-02-06 10:51:03 -0800 | [diff] [blame] | 17 | extern int xfs_reflink_allocate_cow(struct xfs_inode *ip, |
| 18 | struct xfs_bmbt_irec *imap, bool *shared, uint *lockmode); |
Darrick J. Wong | 5eda430 | 2017-02-02 15:14:02 -0800 | [diff] [blame] | 19 | extern int xfs_reflink_convert_cow(struct xfs_inode *ip, xfs_off_t offset, |
| 20 | xfs_off_t count); |
Darrick J. Wong | 2a06705 | 2016-10-03 09:11:33 -0700 | [diff] [blame] | 21 | |
Darrick J. Wong | 43caeb1 | 2016-10-03 09:11:35 -0700 | [diff] [blame] | 22 | extern int xfs_reflink_cancel_cow_blocks(struct xfs_inode *ip, |
| 23 | struct xfs_trans **tpp, xfs_fileoff_t offset_fsb, |
Christoph Hellwig | 3802a34 | 2017-03-07 16:45:58 -0800 | [diff] [blame] | 24 | xfs_fileoff_t end_fsb, bool cancel_real); |
Darrick J. Wong | 43caeb1 | 2016-10-03 09:11:35 -0700 | [diff] [blame] | 25 | extern int xfs_reflink_cancel_cow_range(struct xfs_inode *ip, xfs_off_t offset, |
Christoph Hellwig | 3802a34 | 2017-03-07 16:45:58 -0800 | [diff] [blame] | 26 | xfs_off_t count, bool cancel_real); |
Darrick J. Wong | 43caeb1 | 2016-10-03 09:11:35 -0700 | [diff] [blame] | 27 | extern int xfs_reflink_end_cow(struct xfs_inode *ip, xfs_off_t offset, |
| 28 | xfs_off_t count); |
Darrick J. Wong | 174edb0 | 2016-10-03 09:11:39 -0700 | [diff] [blame] | 29 | extern int xfs_reflink_recover_cow(struct xfs_mount *mp); |
Christoph Hellwig | 5faaf4f | 2016-10-20 15:50:07 +1100 | [diff] [blame] | 30 | extern int xfs_reflink_remap_range(struct file *file_in, loff_t pos_in, |
| 31 | struct file *file_out, loff_t pos_out, u64 len, bool is_dedupe); |
Darrick J. Wong | ea7cdd7 | 2017-06-16 11:00:11 -0700 | [diff] [blame] | 32 | extern int xfs_reflink_inode_has_shared_extents(struct xfs_trans *tp, |
| 33 | struct xfs_inode *ip, bool *has_shared); |
Darrick J. Wong | 98cc2db | 2016-10-03 09:11:43 -0700 | [diff] [blame] | 34 | extern int xfs_reflink_clear_inode_flag(struct xfs_inode *ip, |
| 35 | struct xfs_trans **tpp); |
| 36 | extern int xfs_reflink_unshare(struct xfs_inode *ip, xfs_off_t offset, |
| 37 | xfs_off_t len); |
Darrick J. Wong | 43caeb1 | 2016-10-03 09:11:35 -0700 | [diff] [blame] | 38 | |
Darrick J. Wong | 3993bae | 2016-10-03 09:11:32 -0700 | [diff] [blame] | 39 | #endif /* __XFS_REFLINK_H */ |