xfs_icache.h 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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 0x1
  33. #define XFS_IGET_UNTRUSTED 0x2
  34. #define XFS_IGET_DONTCACHE 0x4
  35. #define XFS_IGET_INCORE 0x8 /* don't read from disk or reinit */
  36. int xfs_iget(struct xfs_mount *mp, struct xfs_trans *tp, xfs_ino_t ino,
  37. uint flags, uint lock_flags, xfs_inode_t **ipp);
  38. /* recovery needs direct inode allocation capability */
  39. struct xfs_inode * xfs_inode_alloc(struct xfs_mount *mp, xfs_ino_t ino);
  40. void xfs_inode_free(struct xfs_inode *ip);
  41. void xfs_reclaim_worker(struct work_struct *work);
  42. void xfs_reclaim_inodes(struct xfs_mount *mp);
  43. long xfs_reclaim_inodes_count(struct xfs_mount *mp);
  44. long xfs_reclaim_inodes_nr(struct xfs_mount *mp, unsigned long nr_to_scan);
  45. void xfs_inode_mark_reclaimable(struct xfs_inode *ip);
  46. int xfs_blockgc_free_dquots(struct xfs_mount *mp, struct xfs_dquot *udqp,
  47. struct xfs_dquot *gdqp, struct xfs_dquot *pdqp,
  48. unsigned int iwalk_flags);
  49. int xfs_blockgc_free_quota(struct xfs_inode *ip, unsigned int iwalk_flags);
  50. int xfs_blockgc_free_space(struct xfs_mount *mp, struct xfs_icwalk *icm);
  51. void xfs_blockgc_flush_all(struct xfs_mount *mp);
  52. void xfs_inode_set_eofblocks_tag(struct xfs_inode *ip);
  53. void xfs_inode_clear_eofblocks_tag(struct xfs_inode *ip);
  54. void xfs_inode_set_cowblocks_tag(struct xfs_inode *ip);
  55. void xfs_inode_clear_cowblocks_tag(struct xfs_inode *ip);
  56. void xfs_blockgc_worker(struct work_struct *work);
  57. int xfs_icache_inode_is_allocated(struct xfs_mount *mp, struct xfs_trans *tp,
  58. xfs_ino_t ino, bool *inuse);
  59. void xfs_blockgc_stop(struct xfs_mount *mp);
  60. void xfs_blockgc_start(struct xfs_mount *mp);
  61. void xfs_inodegc_worker(struct work_struct *work);
  62. void xfs_inodegc_push(struct xfs_mount *mp);
  63. void xfs_inodegc_flush(struct xfs_mount *mp);
  64. void xfs_inodegc_stop(struct xfs_mount *mp);
  65. void xfs_inodegc_start(struct xfs_mount *mp);
  66. void xfs_inodegc_cpu_dead(struct xfs_mount *mp, unsigned int cpu);
  67. int xfs_inodegc_register_shrinker(struct xfs_mount *mp);
  68. #endif