xfs_reflink.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. // 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. extern int xfs_reflink_find_shared(struct xfs_mount *mp, struct xfs_trans *tp,
  9. xfs_agnumber_t agno, xfs_agblock_t agbno, xfs_extlen_t aglen,
  10. xfs_agblock_t *fbno, xfs_extlen_t *flen, bool find_maximal);
  11. extern int xfs_reflink_trim_around_shared(struct xfs_inode *ip,
  12. struct xfs_bmbt_irec *irec, bool *shared, bool *trimmed);
  13. extern int xfs_reflink_reserve_cow(struct xfs_inode *ip,
  14. struct xfs_bmbt_irec *imap, bool *shared);
  15. extern int xfs_reflink_allocate_cow(struct xfs_inode *ip,
  16. struct xfs_bmbt_irec *imap, bool *shared, uint *lockmode);
  17. extern int xfs_reflink_convert_cow(struct xfs_inode *ip, xfs_off_t offset,
  18. xfs_off_t count);
  19. extern int xfs_reflink_cancel_cow_blocks(struct xfs_inode *ip,
  20. struct xfs_trans **tpp, xfs_fileoff_t offset_fsb,
  21. xfs_fileoff_t end_fsb, bool cancel_real);
  22. extern int xfs_reflink_cancel_cow_range(struct xfs_inode *ip, xfs_off_t offset,
  23. xfs_off_t count, bool cancel_real);
  24. extern int xfs_reflink_end_cow(struct xfs_inode *ip, xfs_off_t offset,
  25. xfs_off_t count);
  26. extern int xfs_reflink_recover_cow(struct xfs_mount *mp);
  27. extern int xfs_reflink_remap_range(struct file *file_in, loff_t pos_in,
  28. struct file *file_out, loff_t pos_out, u64 len, bool is_dedupe);
  29. extern int xfs_reflink_inode_has_shared_extents(struct xfs_trans *tp,
  30. struct xfs_inode *ip, bool *has_shared);
  31. extern int xfs_reflink_clear_inode_flag(struct xfs_inode *ip,
  32. struct xfs_trans **tpp);
  33. extern int xfs_reflink_unshare(struct xfs_inode *ip, xfs_off_t offset,
  34. xfs_off_t len);
  35. #endif /* __XFS_REFLINK_H */