xref: /openbmc/linux/fs/xfs/xfs_inode_item.h (revision 5d331b7f)
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3  * Copyright (c) 2000,2005 Silicon Graphics, Inc.
4  * All Rights Reserved.
5  */
6 #ifndef	__XFS_INODE_ITEM_H__
7 #define	__XFS_INODE_ITEM_H__
8 
9 /* kernel only definitions */
10 
11 struct xfs_buf;
12 struct xfs_bmbt_rec;
13 struct xfs_inode;
14 struct xfs_mount;
15 
16 typedef struct xfs_inode_log_item {
17 	xfs_log_item_t		ili_item;	   /* common portion */
18 	struct xfs_inode	*ili_inode;	   /* inode ptr */
19 	xfs_lsn_t		ili_flush_lsn;	   /* lsn at last flush */
20 	xfs_lsn_t		ili_last_lsn;	   /* lsn at last transaction */
21 	unsigned short		ili_lock_flags;	   /* lock flags */
22 	unsigned short		ili_logged;	   /* flushed logged data */
23 	unsigned int		ili_last_fields;   /* fields when flushed */
24 	unsigned int		ili_fields;	   /* fields to be logged */
25 	unsigned int		ili_fsync_fields;  /* logged since last fsync */
26 } xfs_inode_log_item_t;
27 
28 static inline int xfs_inode_clean(xfs_inode_t *ip)
29 {
30 	return !ip->i_itemp || !(ip->i_itemp->ili_fields & XFS_ILOG_ALL);
31 }
32 
33 extern void xfs_inode_item_init(struct xfs_inode *, struct xfs_mount *);
34 extern void xfs_inode_item_destroy(struct xfs_inode *);
35 extern void xfs_iflush_done(struct xfs_buf *, struct xfs_log_item *);
36 extern void xfs_istale_done(struct xfs_buf *, struct xfs_log_item *);
37 extern void xfs_iflush_abort(struct xfs_inode *, bool);
38 extern int xfs_inode_item_format_convert(xfs_log_iovec_t *,
39 					 struct xfs_inode_log_format *);
40 
41 extern struct kmem_zone	*xfs_ili_zone;
42 
43 #endif	/* __XFS_INODE_ITEM_H__ */
44