xfs_icache.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Copyright (c) 2000-2006 Silicon Graphics, Inc.
  4. * All Rights Reserved.
  5. */
  6. #ifndef XFS_SYNC_H
  7. #define XFS_SYNC_H 1
  8. struct xfs_mount;
  9. struct xfs_perag;
  10. struct xfs_icwalk {
  11. __u32 icw_flags;
  12. kuid_t icw_uid;
  13. kgid_t icw_gid;
  14. prid_t icw_prid;
  15. __u64 icw_min_file_size;
  16. long icw_scan_limit;
  17. };
  18. /* Flags that reflect xfs_fs_eofblocks functionality. */
  19. #define XFS_ICWALK_FLAG_SYNC (1U << 0) /* sync/wait mode scan */
  20. #define XFS_ICWALK_FLAG_UID (1U << 1) /* filter by uid */
  21. #define XFS_ICWALK_FLAG_GID (1U << 2) /* filter by gid */
  22. #define XFS_ICWALK_FLAG_PRID (1U << 3) /* filter by project id */
  23. #define XFS_ICWALK_FLAG_MINFILESIZE (1U << 4) /* filter by min file size */
  24. #define XFS_ICWALK_FLAGS_VALID (XFS_ICWALK_FLAG_SYNC | \
  25. XFS_ICWALK_FLAG_UID | \
  26. XFS_ICWALK_FLAG_GID | \
  27. XFS_ICWALK_FLAG_PRID | \
  28. XFS_ICWALK_FLAG_MINFILESIZE)
  29. /*
  30. * Flags for xfs_iget()
  31. */
  32. #define XFS_IGET_CREATE (1U << 0)
  33. #define XFS_IGET_UNTRUSTED (1U << 1)
  34. #define XFS_IGET_DONTCACHE (1U << 2)
  35. /* don't read from disk or reinit */
  36. #define XFS_IGET_INCORE (1U << 3)
  37. /* Return -EAGAIN immediately if the inode is unavailable. */
  38. #define XFS_IGET_NORETRY (1U << 4)
  39. int xfs_iget(struct xfs_mount *mp, struct xfs_trans *tp, xfs_ino_t ino,
  40. uint flags, uint lock_flags, xfs_inode_t **ipp);
  41. /* recovery needs direct inode allocation capability */
  42. struct xfs_inode * xfs_inode_alloc(struct xfs_mount *mp, xfs_ino_t ino);
  43. void xfs_inode_free(struct xfs_inode *ip);
  44. void xfs_reclaim_worker(struct work_struct *work);
  45. void xfs_reclaim_inodes(struct xfs_mount *mp);
  46. long xfs_reclaim_inodes_count(struct xfs_mount *mp);
  47. long xfs_reclaim_inodes_nr(struct xfs_mount *mp, unsigned long nr_to_scan);
  48. void xfs_inode_mark_reclaimable(struct xfs_inode *ip);
  49. int xfs_blockgc_free_dquots(struct xfs_mount *mp, struct xfs_dquot *udqp,
  50. struct xfs_dquot *gdqp, struct xfs_dquot *pdqp,
  51. unsigned int iwalk_flags);
  52. int xfs_blockgc_free_quota(struct xfs_inode *ip, unsigned int iwalk_flags);
  53. int xfs_blockgc_free_space(struct xfs_mount *mp, struct xfs_icwalk *icm);
  54. int xfs_blockgc_flush_all(struct xfs_mount *mp);
  55. void xfs_inode_set_eofblocks_tag(struct xfs_inode *ip);
  56. void xfs_inode_clear_eofblocks_tag(struct xfs_inode *ip);
  57. void xfs_inode_set_cowblocks_tag(struct xfs_inode *ip);
  58. void xfs_inode_clear_cowblocks_tag(struct xfs_inode *ip);
  59. void xfs_blockgc_worker(struct work_struct *work);
  60. void xfs_blockgc_stop(struct xfs_mount *mp);
  61. void xfs_blockgc_start(struct xfs_mount *mp);
  62. void xfs_inodegc_worker(struct work_struct *work);
  63. void xfs_inodegc_push(struct xfs_mount *mp);
  64. int xfs_inodegc_flush(struct xfs_mount *mp);
  65. void xfs_inodegc_stop(struct xfs_mount *mp);
  66. void xfs_inodegc_start(struct xfs_mount *mp);
  67. int xfs_inodegc_register_shrinker(struct xfs_mount *mp);
  68. #endif