162306a36Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * Copyright (c) 2000-2006 Silicon Graphics, Inc.
462306a36Sopenharmony_ci * All Rights Reserved.
562306a36Sopenharmony_ci */
662306a36Sopenharmony_ci#ifndef XFS_SYNC_H
762306a36Sopenharmony_ci#define XFS_SYNC_H 1
862306a36Sopenharmony_ci
962306a36Sopenharmony_cistruct xfs_mount;
1062306a36Sopenharmony_cistruct xfs_perag;
1162306a36Sopenharmony_ci
1262306a36Sopenharmony_cistruct xfs_icwalk {
1362306a36Sopenharmony_ci	__u32		icw_flags;
1462306a36Sopenharmony_ci	kuid_t		icw_uid;
1562306a36Sopenharmony_ci	kgid_t		icw_gid;
1662306a36Sopenharmony_ci	prid_t		icw_prid;
1762306a36Sopenharmony_ci	__u64		icw_min_file_size;
1862306a36Sopenharmony_ci	long		icw_scan_limit;
1962306a36Sopenharmony_ci};
2062306a36Sopenharmony_ci
2162306a36Sopenharmony_ci/* Flags that reflect xfs_fs_eofblocks functionality. */
2262306a36Sopenharmony_ci#define XFS_ICWALK_FLAG_SYNC		(1U << 0) /* sync/wait mode scan */
2362306a36Sopenharmony_ci#define XFS_ICWALK_FLAG_UID		(1U << 1) /* filter by uid */
2462306a36Sopenharmony_ci#define XFS_ICWALK_FLAG_GID		(1U << 2) /* filter by gid */
2562306a36Sopenharmony_ci#define XFS_ICWALK_FLAG_PRID		(1U << 3) /* filter by project id */
2662306a36Sopenharmony_ci#define XFS_ICWALK_FLAG_MINFILESIZE	(1U << 4) /* filter by min file size */
2762306a36Sopenharmony_ci
2862306a36Sopenharmony_ci#define XFS_ICWALK_FLAGS_VALID		(XFS_ICWALK_FLAG_SYNC | \
2962306a36Sopenharmony_ci					 XFS_ICWALK_FLAG_UID | \
3062306a36Sopenharmony_ci					 XFS_ICWALK_FLAG_GID | \
3162306a36Sopenharmony_ci					 XFS_ICWALK_FLAG_PRID | \
3262306a36Sopenharmony_ci					 XFS_ICWALK_FLAG_MINFILESIZE)
3362306a36Sopenharmony_ci
3462306a36Sopenharmony_ci/*
3562306a36Sopenharmony_ci * Flags for xfs_iget()
3662306a36Sopenharmony_ci */
3762306a36Sopenharmony_ci#define XFS_IGET_CREATE		(1U << 0)
3862306a36Sopenharmony_ci#define XFS_IGET_UNTRUSTED	(1U << 1)
3962306a36Sopenharmony_ci#define XFS_IGET_DONTCACHE	(1U << 2)
4062306a36Sopenharmony_ci/* don't read from disk or reinit */
4162306a36Sopenharmony_ci#define XFS_IGET_INCORE		(1U << 3)
4262306a36Sopenharmony_ci/* Return -EAGAIN immediately if the inode is unavailable. */
4362306a36Sopenharmony_ci#define XFS_IGET_NORETRY	(1U << 4)
4462306a36Sopenharmony_ci
4562306a36Sopenharmony_ciint xfs_iget(struct xfs_mount *mp, struct xfs_trans *tp, xfs_ino_t ino,
4662306a36Sopenharmony_ci	     uint flags, uint lock_flags, xfs_inode_t **ipp);
4762306a36Sopenharmony_ci
4862306a36Sopenharmony_ci/* recovery needs direct inode allocation capability */
4962306a36Sopenharmony_cistruct xfs_inode * xfs_inode_alloc(struct xfs_mount *mp, xfs_ino_t ino);
5062306a36Sopenharmony_civoid xfs_inode_free(struct xfs_inode *ip);
5162306a36Sopenharmony_ci
5262306a36Sopenharmony_civoid xfs_reclaim_worker(struct work_struct *work);
5362306a36Sopenharmony_ci
5462306a36Sopenharmony_civoid xfs_reclaim_inodes(struct xfs_mount *mp);
5562306a36Sopenharmony_cilong xfs_reclaim_inodes_count(struct xfs_mount *mp);
5662306a36Sopenharmony_cilong xfs_reclaim_inodes_nr(struct xfs_mount *mp, unsigned long nr_to_scan);
5762306a36Sopenharmony_ci
5862306a36Sopenharmony_civoid xfs_inode_mark_reclaimable(struct xfs_inode *ip);
5962306a36Sopenharmony_ci
6062306a36Sopenharmony_ciint xfs_blockgc_free_dquots(struct xfs_mount *mp, struct xfs_dquot *udqp,
6162306a36Sopenharmony_ci		struct xfs_dquot *gdqp, struct xfs_dquot *pdqp,
6262306a36Sopenharmony_ci		unsigned int iwalk_flags);
6362306a36Sopenharmony_ciint xfs_blockgc_free_quota(struct xfs_inode *ip, unsigned int iwalk_flags);
6462306a36Sopenharmony_ciint xfs_blockgc_free_space(struct xfs_mount *mp, struct xfs_icwalk *icm);
6562306a36Sopenharmony_ciint xfs_blockgc_flush_all(struct xfs_mount *mp);
6662306a36Sopenharmony_ci
6762306a36Sopenharmony_civoid xfs_inode_set_eofblocks_tag(struct xfs_inode *ip);
6862306a36Sopenharmony_civoid xfs_inode_clear_eofblocks_tag(struct xfs_inode *ip);
6962306a36Sopenharmony_ci
7062306a36Sopenharmony_civoid xfs_inode_set_cowblocks_tag(struct xfs_inode *ip);
7162306a36Sopenharmony_civoid xfs_inode_clear_cowblocks_tag(struct xfs_inode *ip);
7262306a36Sopenharmony_ci
7362306a36Sopenharmony_civoid xfs_blockgc_worker(struct work_struct *work);
7462306a36Sopenharmony_civoid xfs_blockgc_stop(struct xfs_mount *mp);
7562306a36Sopenharmony_civoid xfs_blockgc_start(struct xfs_mount *mp);
7662306a36Sopenharmony_ci
7762306a36Sopenharmony_civoid xfs_inodegc_worker(struct work_struct *work);
7862306a36Sopenharmony_civoid xfs_inodegc_push(struct xfs_mount *mp);
7962306a36Sopenharmony_ciint xfs_inodegc_flush(struct xfs_mount *mp);
8062306a36Sopenharmony_civoid xfs_inodegc_stop(struct xfs_mount *mp);
8162306a36Sopenharmony_civoid xfs_inodegc_start(struct xfs_mount *mp);
8262306a36Sopenharmony_ciint xfs_inodegc_register_shrinker(struct xfs_mount *mp);
8362306a36Sopenharmony_ci
8462306a36Sopenharmony_ci#endif
85