File Index
Files and directories
Sign in
FILE

xfs_inode_item.h

File preview with syntax highlighting.

linux-6.19.14/fs/xfs/xfs_inode_item.h OBJECTIVE-C
 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
11struct xfs_buf;
12struct xfs_bmbt_rec;
13struct xfs_inode;
14struct xfs_mount;
15
16struct xfs_inode_log_item {
17	struct xfs_log_item	ili_item;	   /* common portion */
18	struct xfs_inode	*ili_inode;	   /* inode ptr */
19	unsigned short		ili_lock_flags;	   /* inode lock flags */
20	unsigned int		ili_dirty_flags;   /* dirty in current tx */
21	/*
22	 * The ili_lock protects the interactions between the dirty state and
23	 * the flush state of the inode log item. This allows us to do atomic
24	 * modifications of multiple state fields without having to hold a
25	 * specific inode lock to serialise them.
26	 *
27	 * We need atomic changes between inode dirtying, inode flushing and
28	 * inode completion, but these all hold different combinations of
29	 * ILOCK and IFLUSHING and hence we need some other method of
30	 * serialising updates to the flush state.
31	 */
32	spinlock_t		ili_lock;	   /* flush state lock */
33	unsigned int		ili_last_fields;   /* fields when flushed */
34	unsigned int		ili_fields;	   /* fields to be logged */
35	xfs_lsn_t		ili_flush_lsn;	   /* lsn at last flush */
36
37	/*
38	 * We record the sequence number for every inode modification, as
39	 * well as those that only require fdatasync operations for data
40	 * integrity. This allows optimisation of the O_DSYNC/fdatasync path
41	 * without needing to track what modifications the journal is currently
42	 * carrying for the inode. These are protected by the above ili_lock.
43	 */
44	xfs_csn_t		ili_commit_seq;	   /* last transaction commit */
45	xfs_csn_t		ili_datasync_seq;  /* for datasync optimisation */
46};
47
48static inline int xfs_inode_clean(struct xfs_inode *ip)
49{
50	return !ip->i_itemp || !(ip->i_itemp->ili_fields & XFS_ILOG_ALL);
51}
52
53extern void xfs_inode_item_init(struct xfs_inode *, struct xfs_mount *);
54extern void xfs_inode_item_destroy(struct xfs_inode *);
55extern void xfs_iflush_abort(struct xfs_inode *);
56extern void xfs_iflush_shutdown_abort(struct xfs_inode *);
57int xfs_inode_item_format_convert(struct kvec *buf,
58		struct xfs_inode_log_format *in_f);
59
60extern struct kmem_cache	*xfs_ili_cache;
61
62#endif	/* __XFS_INODE_ITEM_H__ */
~/ Read-only file preview.