Merge tag 'pwm/for-6.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry...
[linux-block.git] / fs / xfs / xfs_inode_item.h
CommitLineData
0b61f8a4 1// SPDX-License-Identifier: GPL-2.0
1da177e4 2/*
7b718769
NS
3 * Copyright (c) 2000,2005 Silicon Graphics, Inc.
4 * All Rights Reserved.
1da177e4
LT
5 */
6#ifndef __XFS_INODE_ITEM_H__
7#define __XFS_INODE_ITEM_H__
8
69432832 9/* kernel only definitions */
1da177e4
LT
10
11struct xfs_buf;
a5f9be58 12struct xfs_bmbt_rec;
1da177e4
LT
13struct xfs_inode;
14struct xfs_mount;
15
fd9cbe51 16struct xfs_inode_log_item {
efe2330f 17 struct xfs_log_item ili_item; /* common portion */
1da177e4 18 struct xfs_inode *ili_inode; /* inode ptr */
1319ebef
DC
19 unsigned short ili_lock_flags; /* inode lock flags */
20 /*
21 * The ili_lock protects the interactions between the dirty state and
22 * the flush state of the inode log item. This allows us to do atomic
23 * modifications of multiple state fields without having to hold a
24 * specific inode lock to serialise them.
25 *
26 * We need atomic changes between inode dirtying, inode flushing and
27 * inode completion, but these all hold different combinations of
718ecc50
DC
28 * ILOCK and IFLUSHING and hence we need some other method of
29 * serialising updates to the flush state.
1319ebef
DC
30 */
31 spinlock_t ili_lock; /* flush state lock */
1da177e4 32 unsigned int ili_last_fields; /* fields when flushed */
f5d8d5c4 33 unsigned int ili_fields; /* fields to be logged */
fc0561ce 34 unsigned int ili_fsync_fields; /* logged since last fsync */
1319ebef 35 xfs_lsn_t ili_flush_lsn; /* lsn at last flush */
5f9b4b0d 36 xfs_csn_t ili_commit_seq; /* last transaction commit */
fd9cbe51 37};
1da177e4 38
aac855ab 39static inline int xfs_inode_clean(struct xfs_inode *ip)
33540408 40{
f5d8d5c4 41 return !ip->i_itemp || !(ip->i_itemp->ili_fields & XFS_ILOG_ALL);
33540408
DC
42}
43
a844f451
NS
44extern void xfs_inode_item_init(struct xfs_inode *, struct xfs_mount *);
45extern void xfs_inode_item_destroy(struct xfs_inode *);
88fc1879 46extern void xfs_iflush_abort(struct xfs_inode *);
d2d7c047 47extern void xfs_iflush_shutdown_abort(struct xfs_inode *);
6d192a9b 48extern int xfs_inode_item_format_convert(xfs_log_iovec_t *,
06b11321 49 struct xfs_inode_log_format *);
1da177e4 50
182696fb 51extern struct kmem_cache *xfs_ili_cache;
1da177e4
LT
52
53#endif /* __XFS_INODE_ITEM_H__ */