]>
Commit | Line | Data |
---|---|---|
0b61f8a4 | 1 | // SPDX-License-Identifier: GPL-2.0+ |
3993baeb DW |
2 | /* |
3 | * Copyright (C) 2016 Oracle. All Rights Reserved. | |
3993baeb | 4 | * Author: Darrick J. Wong <darrick.wong@oracle.com> |
3993baeb DW |
5 | */ |
6 | #ifndef __XFS_REFLINK_H | |
7 | #define __XFS_REFLINK_H 1 | |
8 | ||
92ff7285 DW |
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); | |
2a06705c DW |
12 | extern int xfs_reflink_trim_around_shared(struct xfs_inode *ip, |
13 | struct xfs_bmbt_irec *irec, bool *shared, bool *trimmed); | |
14 | ||
3ba020be CH |
15 | extern int xfs_reflink_reserve_cow(struct xfs_inode *ip, |
16 | struct xfs_bmbt_irec *imap, bool *shared); | |
3c68d44a CH |
17 | extern int xfs_reflink_allocate_cow(struct xfs_inode *ip, |
18 | struct xfs_bmbt_irec *imap, bool *shared, uint *lockmode); | |
5eda4300 DW |
19 | extern int xfs_reflink_convert_cow(struct xfs_inode *ip, xfs_off_t offset, |
20 | xfs_off_t count); | |
ef473667 | 21 | extern bool xfs_reflink_find_cow_mapping(struct xfs_inode *ip, xfs_off_t offset, |
092d5d9d | 22 | struct xfs_bmbt_irec *imap); |
86f12ab0 | 23 | extern void xfs_reflink_trim_irec_to_next_cow(struct xfs_inode *ip, |
ef473667 | 24 | xfs_fileoff_t offset_fsb, struct xfs_bmbt_irec *imap); |
2a06705c | 25 | |
43caeb18 DW |
26 | extern int xfs_reflink_cancel_cow_blocks(struct xfs_inode *ip, |
27 | struct xfs_trans **tpp, xfs_fileoff_t offset_fsb, | |
3802a345 | 28 | xfs_fileoff_t end_fsb, bool cancel_real); |
43caeb18 | 29 | extern int xfs_reflink_cancel_cow_range(struct xfs_inode *ip, xfs_off_t offset, |
3802a345 | 30 | xfs_off_t count, bool cancel_real); |
43caeb18 DW |
31 | extern int xfs_reflink_end_cow(struct xfs_inode *ip, xfs_off_t offset, |
32 | xfs_off_t count); | |
174edb0e | 33 | extern int xfs_reflink_recover_cow(struct xfs_mount *mp); |
5faaf4fa CH |
34 | extern int xfs_reflink_remap_range(struct file *file_in, loff_t pos_in, |
35 | struct file *file_out, loff_t pos_out, u64 len, bool is_dedupe); | |
ea7cdd7b DW |
36 | extern int xfs_reflink_inode_has_shared_extents(struct xfs_trans *tp, |
37 | struct xfs_inode *ip, bool *has_shared); | |
98cc2db5 DW |
38 | extern int xfs_reflink_clear_inode_flag(struct xfs_inode *ip, |
39 | struct xfs_trans **tpp); | |
40 | extern int xfs_reflink_unshare(struct xfs_inode *ip, xfs_off_t offset, | |
41 | xfs_off_t len); | |
43caeb18 | 42 | |
3993baeb | 43 | #endif /* __XFS_REFLINK_H */ |