xfs_icache.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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_eofblocks {
  11. __u32 eof_flags;
  12. kuid_t eof_uid;
  13. kgid_t eof_gid;
  14. prid_t eof_prid;
  15. __u64 eof_min_file_size;
  16. };
  17. /*
  18. * tags for inode radix tree
  19. */
  20. #define XFS_ICI_NO_TAG (-1) /* special flag for an untagged lookup
  21. in xfs_inode_walk */
  22. #define XFS_ICI_RECLAIM_TAG 0 /* inode is to be reclaimed */
  23. #define XFS_ICI_EOFBLOCKS_TAG 1 /* inode has blocks beyond EOF */
  24. #define XFS_ICI_COWBLOCKS_TAG 2 /* inode can have cow blocks to gc */
  25. /*
  26. * Flags for xfs_iget()
  27. */
  28. #define XFS_IGET_CREATE 0x1
  29. #define XFS_IGET_UNTRUSTED 0x2
  30. #define XFS_IGET_DONTCACHE 0x4
  31. #define XFS_IGET_INCORE 0x8 /* don't read from disk or reinit */
  32. /*
  33. * flags for AG inode iterator
  34. */
  35. #define XFS_INODE_WALK_INEW_WAIT 0x1 /* wait on new inodes */
  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. int xfs_reclaim_inodes_count(struct xfs_mount *mp);
  44. long xfs_reclaim_inodes_nr(struct xfs_mount *mp, int nr_to_scan);
  45. void xfs_inode_set_reclaim_tag(struct xfs_inode *ip);
  46. void xfs_inode_set_eofblocks_tag(struct xfs_inode *ip);
  47. void xfs_inode_clear_eofblocks_tag(struct xfs_inode *ip);
  48. int xfs_icache_free_eofblocks(struct xfs_mount *, struct xfs_eofblocks *);
  49. int xfs_inode_free_quota_eofblocks(struct xfs_inode *ip);
  50. void xfs_eofblocks_worker(struct work_struct *);
  51. void xfs_queue_eofblocks(struct xfs_mount *);
  52. void xfs_inode_set_cowblocks_tag(struct xfs_inode *ip);
  53. void xfs_inode_clear_cowblocks_tag(struct xfs_inode *ip);
  54. int xfs_icache_free_cowblocks(struct xfs_mount *, struct xfs_eofblocks *);
  55. int xfs_inode_free_quota_cowblocks(struct xfs_inode *ip);
  56. void xfs_cowblocks_worker(struct work_struct *);
  57. void xfs_queue_cowblocks(struct xfs_mount *);
  58. int xfs_inode_walk(struct xfs_mount *mp, int iter_flags,
  59. int (*execute)(struct xfs_inode *ip, void *args),
  60. void *args, int tag);
  61. int xfs_icache_inode_is_allocated(struct xfs_mount *mp, struct xfs_trans *tp,
  62. xfs_ino_t ino, bool *inuse);
  63. void xfs_stop_block_reaping(struct xfs_mount *mp);
  64. void xfs_start_block_reaping(struct xfs_mount *mp);
  65. #endif