^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) // SPDX-License-Identifier: GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * Copyright (c) 2000-2006 Silicon Graphics, Inc.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * All Rights Reserved.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) #ifndef XFS_SYNC_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) #define XFS_SYNC_H 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) struct xfs_mount;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) struct xfs_perag;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) struct xfs_eofblocks {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) __u32 eof_flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) kuid_t eof_uid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) kgid_t eof_gid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) prid_t eof_prid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) __u64 eof_min_file_size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) * tags for inode radix tree
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) #define XFS_ICI_NO_TAG (-1) /* special flag for an untagged lookup
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) in xfs_inode_walk */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) #define XFS_ICI_RECLAIM_TAG 0 /* inode is to be reclaimed */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) #define XFS_ICI_EOFBLOCKS_TAG 1 /* inode has blocks beyond EOF */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) #define XFS_ICI_COWBLOCKS_TAG 2 /* inode can have cow blocks to gc */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) * Flags for xfs_iget()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) #define XFS_IGET_CREATE 0x1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) #define XFS_IGET_UNTRUSTED 0x2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) #define XFS_IGET_DONTCACHE 0x4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) #define XFS_IGET_INCORE 0x8 /* don't read from disk or reinit */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) * flags for AG inode iterator
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) #define XFS_INODE_WALK_INEW_WAIT 0x1 /* wait on new inodes */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) int xfs_iget(struct xfs_mount *mp, struct xfs_trans *tp, xfs_ino_t ino,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) uint flags, uint lock_flags, xfs_inode_t **ipp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) /* recovery needs direct inode allocation capability */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) struct xfs_inode * xfs_inode_alloc(struct xfs_mount *mp, xfs_ino_t ino);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) void xfs_inode_free(struct xfs_inode *ip);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) void xfs_reclaim_worker(struct work_struct *work);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) void xfs_reclaim_inodes(struct xfs_mount *mp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) int xfs_reclaim_inodes_count(struct xfs_mount *mp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) long xfs_reclaim_inodes_nr(struct xfs_mount *mp, int nr_to_scan);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) void xfs_inode_set_reclaim_tag(struct xfs_inode *ip);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) void xfs_inode_set_eofblocks_tag(struct xfs_inode *ip);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) void xfs_inode_clear_eofblocks_tag(struct xfs_inode *ip);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) int xfs_icache_free_eofblocks(struct xfs_mount *, struct xfs_eofblocks *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) int xfs_inode_free_quota_eofblocks(struct xfs_inode *ip);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) void xfs_eofblocks_worker(struct work_struct *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) void xfs_queue_eofblocks(struct xfs_mount *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) void xfs_inode_set_cowblocks_tag(struct xfs_inode *ip);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) void xfs_inode_clear_cowblocks_tag(struct xfs_inode *ip);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) int xfs_icache_free_cowblocks(struct xfs_mount *, struct xfs_eofblocks *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) int xfs_inode_free_quota_cowblocks(struct xfs_inode *ip);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) void xfs_cowblocks_worker(struct work_struct *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) void xfs_queue_cowblocks(struct xfs_mount *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) int xfs_inode_walk(struct xfs_mount *mp, int iter_flags,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) int (*execute)(struct xfs_inode *ip, void *args),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) void *args, int tag);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) int xfs_icache_inode_is_allocated(struct xfs_mount *mp, struct xfs_trans *tp,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) xfs_ino_t ino, bool *inuse);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) void xfs_stop_block_reaping(struct xfs_mount *mp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) void xfs_start_block_reaping(struct xfs_mount *mp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) #endif