xfs_reflink.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * Copyright (C) 2016 Oracle. All Rights Reserved.
  3. *
  4. * Author: Darrick J. Wong <darrick.wong@oracle.com>
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License
  8. * as published by the Free Software Foundation; either version 2
  9. * of the License, or (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it would be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write the Free Software Foundation,
  18. * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
  19. */
  20. #ifndef __XFS_REFLINK_H
  21. #define __XFS_REFLINK_H 1
  22. extern int xfs_reflink_find_shared(struct xfs_mount *mp, xfs_agnumber_t agno,
  23. xfs_agblock_t agbno, xfs_extlen_t aglen, xfs_agblock_t *fbno,
  24. xfs_extlen_t *flen, bool find_maximal);
  25. extern int xfs_reflink_trim_around_shared(struct xfs_inode *ip,
  26. struct xfs_bmbt_irec *irec, bool *shared, bool *trimmed);
  27. extern int xfs_reflink_reserve_cow(struct xfs_inode *ip,
  28. struct xfs_bmbt_irec *imap, bool *shared);
  29. extern int xfs_reflink_allocate_cow_range(struct xfs_inode *ip,
  30. xfs_off_t offset, xfs_off_t count);
  31. extern int xfs_reflink_convert_cow(struct xfs_inode *ip, xfs_off_t offset,
  32. xfs_off_t count);
  33. extern bool xfs_reflink_find_cow_mapping(struct xfs_inode *ip, xfs_off_t offset,
  34. struct xfs_bmbt_irec *imap, bool *need_alloc);
  35. extern int xfs_reflink_trim_irec_to_next_cow(struct xfs_inode *ip,
  36. xfs_fileoff_t offset_fsb, struct xfs_bmbt_irec *imap);
  37. extern int xfs_reflink_cancel_cow_blocks(struct xfs_inode *ip,
  38. struct xfs_trans **tpp, xfs_fileoff_t offset_fsb,
  39. xfs_fileoff_t end_fsb, bool cancel_real);
  40. extern int xfs_reflink_cancel_cow_range(struct xfs_inode *ip, xfs_off_t offset,
  41. xfs_off_t count, bool cancel_real);
  42. extern int xfs_reflink_end_cow(struct xfs_inode *ip, xfs_off_t offset,
  43. xfs_off_t count);
  44. extern int xfs_reflink_recover_cow(struct xfs_mount *mp);
  45. extern int xfs_reflink_remap_range(struct file *file_in, loff_t pos_in,
  46. struct file *file_out, loff_t pos_out, u64 len, bool is_dedupe);
  47. extern int xfs_reflink_clear_inode_flag(struct xfs_inode *ip,
  48. struct xfs_trans **tpp);
  49. extern int xfs_reflink_unshare(struct xfs_inode *ip, xfs_off_t offset,
  50. xfs_off_t len);
  51. #endif /* __XFS_REFLINK_H */