2018-06-06 02:42:14 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0+
|
2016-10-03 16:11:32 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2016 Oracle. All Rights Reserved.
|
|
|
|
* Author: Darrick J. Wong <darrick.wong@oracle.com>
|
|
|
|
*/
|
|
|
|
#ifndef __XFS_REFLINK_H
|
|
|
|
#define __XFS_REFLINK_H 1
|
|
|
|
|
2017-06-16 18:00:10 +00:00
|
|
|
extern int xfs_reflink_find_shared(struct xfs_mount *mp, struct xfs_trans *tp,
|
|
|
|
xfs_agnumber_t agno, xfs_agblock_t agbno, xfs_extlen_t aglen,
|
|
|
|
xfs_agblock_t *fbno, xfs_extlen_t *flen, bool find_maximal);
|
2016-10-03 16:11:33 +00:00
|
|
|
extern int xfs_reflink_trim_around_shared(struct xfs_inode *ip,
|
|
|
|
struct xfs_bmbt_irec *irec, bool *shared, bool *trimmed);
|
|
|
|
|
2016-10-20 04:53:50 +00:00
|
|
|
extern int xfs_reflink_reserve_cow(struct xfs_inode *ip,
|
|
|
|
struct xfs_bmbt_irec *imap, bool *shared);
|
2017-02-06 18:51:03 +00:00
|
|
|
extern int xfs_reflink_allocate_cow(struct xfs_inode *ip,
|
|
|
|
struct xfs_bmbt_irec *imap, bool *shared, uint *lockmode);
|
2017-02-02 23:14:02 +00:00
|
|
|
extern int xfs_reflink_convert_cow(struct xfs_inode *ip, xfs_off_t offset,
|
|
|
|
xfs_off_t count);
|
2016-10-03 16:11:33 +00:00
|
|
|
|
2016-10-03 16:11:35 +00:00
|
|
|
extern int xfs_reflink_cancel_cow_blocks(struct xfs_inode *ip,
|
|
|
|
struct xfs_trans **tpp, xfs_fileoff_t offset_fsb,
|
2017-03-08 00:45:58 +00:00
|
|
|
xfs_fileoff_t end_fsb, bool cancel_real);
|
2016-10-03 16:11:35 +00:00
|
|
|
extern int xfs_reflink_cancel_cow_range(struct xfs_inode *ip, xfs_off_t offset,
|
2017-03-08 00:45:58 +00:00
|
|
|
xfs_off_t count, bool cancel_real);
|
2016-10-03 16:11:35 +00:00
|
|
|
extern int xfs_reflink_end_cow(struct xfs_inode *ip, xfs_off_t offset,
|
|
|
|
xfs_off_t count);
|
2016-10-03 16:11:39 +00:00
|
|
|
extern int xfs_reflink_recover_cow(struct xfs_mount *mp);
|
2018-10-29 23:47:06 +00:00
|
|
|
extern loff_t xfs_reflink_remap_range(struct file *file_in, loff_t pos_in,
|
2018-10-29 23:41:49 +00:00
|
|
|
struct file *file_out, loff_t pos_out, loff_t len,
|
2018-10-29 23:41:28 +00:00
|
|
|
unsigned int remap_flags);
|
2017-06-16 18:00:11 +00:00
|
|
|
extern int xfs_reflink_inode_has_shared_extents(struct xfs_trans *tp,
|
|
|
|
struct xfs_inode *ip, bool *has_shared);
|
2016-10-03 16:11:43 +00:00
|
|
|
extern int xfs_reflink_clear_inode_flag(struct xfs_inode *ip,
|
|
|
|
struct xfs_trans **tpp);
|
|
|
|
extern int xfs_reflink_unshare(struct xfs_inode *ip, xfs_off_t offset,
|
|
|
|
xfs_off_t len);
|
2016-10-03 16:11:35 +00:00
|
|
|
|
2016-10-03 16:11:32 +00:00
|
|
|
#endif /* __XFS_REFLINK_H */
|