blob: c585ad9552b23ff375fd40c21a6aadab694b8e14 [file] [log] [blame]
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00001// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Copyright (C) 2016 Oracle. All Rights Reserved.
4 * Author: Darrick J. Wong <darrick.wong@oracle.com>
5 */
6#ifndef __XFS_REFLINK_H
7#define __XFS_REFLINK_H 1
8
9extern 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);
12extern int xfs_reflink_trim_around_shared(struct xfs_inode *ip,
13 struct xfs_bmbt_irec *irec, bool *shared, bool *trimmed);
14
15extern int xfs_reflink_reserve_cow(struct xfs_inode *ip,
16 struct xfs_bmbt_irec *imap, bool *shared);
17extern int xfs_reflink_allocate_cow(struct xfs_inode *ip,
18 struct xfs_bmbt_irec *imap, bool *shared, uint *lockmode);
19extern int xfs_reflink_convert_cow(struct xfs_inode *ip, xfs_off_t offset,
20 xfs_off_t count);
21
22extern int xfs_reflink_cancel_cow_blocks(struct xfs_inode *ip,
23 struct xfs_trans **tpp, xfs_fileoff_t offset_fsb,
24 xfs_fileoff_t end_fsb, bool cancel_real);
25extern int xfs_reflink_cancel_cow_range(struct xfs_inode *ip, xfs_off_t offset,
26 xfs_off_t count, bool cancel_real);
27extern int xfs_reflink_end_cow(struct xfs_inode *ip, xfs_off_t offset,
28 xfs_off_t count);
29extern int xfs_reflink_recover_cow(struct xfs_mount *mp);
30extern 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);
32extern int xfs_reflink_inode_has_shared_extents(struct xfs_trans *tp,
33 struct xfs_inode *ip, bool *has_shared);
34extern int xfs_reflink_clear_inode_flag(struct xfs_inode *ip,
35 struct xfs_trans **tpp);
36extern int xfs_reflink_unshare(struct xfs_inode *ip, xfs_off_t offset,
37 xfs_off_t len);
38
39#endif /* __XFS_REFLINK_H */