Merge branch 'linux-4.21' of git://github.com/skeggsb/linux into drm-fixes
[linux-2.6-block.git] / fs / xfs / xfs_reflink.h
CommitLineData
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
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);
2a06705c 12extern int xfs_reflink_trim_around_shared(struct xfs_inode *ip,
d392bc81 13 struct xfs_bmbt_irec *irec, bool *shared);
2a06705c 14
3ba020be 15extern int xfs_reflink_reserve_cow(struct xfs_inode *ip,
fc439464 16 struct xfs_bmbt_irec *imap);
3c68d44a
CH
17extern int xfs_reflink_allocate_cow(struct xfs_inode *ip,
18 struct xfs_bmbt_irec *imap, bool *shared, uint *lockmode);
5eda4300
DW
19extern int xfs_reflink_convert_cow(struct xfs_inode *ip, xfs_off_t offset,
20 xfs_off_t count);
2a06705c 21
43caeb18
DW
22extern int xfs_reflink_cancel_cow_blocks(struct xfs_inode *ip,
23 struct xfs_trans **tpp, xfs_fileoff_t offset_fsb,
3802a345 24 xfs_fileoff_t end_fsb, bool cancel_real);
43caeb18 25extern int xfs_reflink_cancel_cow_range(struct xfs_inode *ip, xfs_off_t offset,
3802a345 26 xfs_off_t count, bool cancel_real);
43caeb18
DW
27extern int xfs_reflink_end_cow(struct xfs_inode *ip, xfs_off_t offset,
28 xfs_off_t count);
174edb0e 29extern int xfs_reflink_recover_cow(struct xfs_mount *mp);
3f68c1f5 30extern loff_t xfs_reflink_remap_range(struct file *file_in, loff_t pos_in,
42ec3d4c 31 struct file *file_out, loff_t pos_out, loff_t len,
a91ae49b 32 unsigned int remap_flags);
ea7cdd7b
DW
33extern int xfs_reflink_inode_has_shared_extents(struct xfs_trans *tp,
34 struct xfs_inode *ip, bool *has_shared);
98cc2db5
DW
35extern int xfs_reflink_clear_inode_flag(struct xfs_inode *ip,
36 struct xfs_trans **tpp);
37extern int xfs_reflink_unshare(struct xfs_inode *ip, xfs_off_t offset,
38 xfs_off_t len);
3fc9f5e4
DW
39extern int xfs_reflink_remap_prep(struct file *file_in, loff_t pos_in,
40 struct file *file_out, loff_t pos_out, loff_t *len,
41 unsigned int remap_flags);
42extern int xfs_reflink_remap_blocks(struct xfs_inode *src, loff_t pos_in,
43 struct xfs_inode *dest, loff_t pos_out, loff_t remap_len,
44 loff_t *remapped);
45extern int xfs_reflink_update_dest(struct xfs_inode *dest, xfs_off_t newlen,
46 xfs_extlen_t cowextsize, unsigned int remap_flags);
47extern void xfs_reflink_remap_unlock(struct file *file_in,
48 struct file *file_out);
43caeb18 49
3993baeb 50#endif /* __XFS_REFLINK_H */