0001
0002
0003
0004
0005
0006 #ifndef XFS_SYNC_H
0007 #define XFS_SYNC_H 1
0008
0009 struct xfs_mount;
0010 struct xfs_perag;
0011
0012 struct xfs_icwalk {
0013 __u32 icw_flags;
0014 kuid_t icw_uid;
0015 kgid_t icw_gid;
0016 prid_t icw_prid;
0017 __u64 icw_min_file_size;
0018 long icw_scan_limit;
0019 };
0020
0021
0022 #define XFS_ICWALK_FLAG_SYNC (1U << 0)
0023 #define XFS_ICWALK_FLAG_UID (1U << 1)
0024 #define XFS_ICWALK_FLAG_GID (1U << 2)
0025 #define XFS_ICWALK_FLAG_PRID (1U << 3)
0026 #define XFS_ICWALK_FLAG_MINFILESIZE (1U << 4)
0027
0028 #define XFS_ICWALK_FLAGS_VALID (XFS_ICWALK_FLAG_SYNC | \
0029 XFS_ICWALK_FLAG_UID | \
0030 XFS_ICWALK_FLAG_GID | \
0031 XFS_ICWALK_FLAG_PRID | \
0032 XFS_ICWALK_FLAG_MINFILESIZE)
0033
0034
0035
0036
0037 #define XFS_IGET_CREATE 0x1
0038 #define XFS_IGET_UNTRUSTED 0x2
0039 #define XFS_IGET_DONTCACHE 0x4
0040 #define XFS_IGET_INCORE 0x8
0041
0042 int xfs_iget(struct xfs_mount *mp, struct xfs_trans *tp, xfs_ino_t ino,
0043 uint flags, uint lock_flags, xfs_inode_t **ipp);
0044
0045
0046 struct xfs_inode * xfs_inode_alloc(struct xfs_mount *mp, xfs_ino_t ino);
0047 void xfs_inode_free(struct xfs_inode *ip);
0048
0049 void xfs_reclaim_worker(struct work_struct *work);
0050
0051 void xfs_reclaim_inodes(struct xfs_mount *mp);
0052 long xfs_reclaim_inodes_count(struct xfs_mount *mp);
0053 long xfs_reclaim_inodes_nr(struct xfs_mount *mp, unsigned long nr_to_scan);
0054
0055 void xfs_inode_mark_reclaimable(struct xfs_inode *ip);
0056
0057 int xfs_blockgc_free_dquots(struct xfs_mount *mp, struct xfs_dquot *udqp,
0058 struct xfs_dquot *gdqp, struct xfs_dquot *pdqp,
0059 unsigned int iwalk_flags);
0060 int xfs_blockgc_free_quota(struct xfs_inode *ip, unsigned int iwalk_flags);
0061 int xfs_blockgc_free_space(struct xfs_mount *mp, struct xfs_icwalk *icm);
0062 void xfs_blockgc_flush_all(struct xfs_mount *mp);
0063
0064 void xfs_inode_set_eofblocks_tag(struct xfs_inode *ip);
0065 void xfs_inode_clear_eofblocks_tag(struct xfs_inode *ip);
0066
0067 void xfs_inode_set_cowblocks_tag(struct xfs_inode *ip);
0068 void xfs_inode_clear_cowblocks_tag(struct xfs_inode *ip);
0069
0070 void xfs_blockgc_worker(struct work_struct *work);
0071
0072 int xfs_icache_inode_is_allocated(struct xfs_mount *mp, struct xfs_trans *tp,
0073 xfs_ino_t ino, bool *inuse);
0074
0075 void xfs_blockgc_stop(struct xfs_mount *mp);
0076 void xfs_blockgc_start(struct xfs_mount *mp);
0077
0078 void xfs_inodegc_worker(struct work_struct *work);
0079 void xfs_inodegc_push(struct xfs_mount *mp);
0080 void xfs_inodegc_flush(struct xfs_mount *mp);
0081 void xfs_inodegc_stop(struct xfs_mount *mp);
0082 void xfs_inodegc_start(struct xfs_mount *mp);
0083 void xfs_inodegc_cpu_dead(struct xfs_mount *mp, unsigned int cpu);
0084 int xfs_inodegc_register_shrinker(struct xfs_mount *mp);
0085
0086 #endif