Dave Chinner | 0b61f8a | 2018-06-05 19:42:14 -0700 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | /* |
Nathan Scott | 7b71876 | 2005-11-02 14:58:39 +1100 | [diff] [blame] | 3 | * Copyright (c) 2000,2005 Silicon Graphics, Inc. |
| 4 | * All Rights Reserved. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 5 | */ |
| 6 | #ifndef __XFS_INODE_ITEM_H__ |
| 7 | #define __XFS_INODE_ITEM_H__ |
| 8 | |
Dave Chinner | 6943283 | 2013-08-12 20:49:23 +1000 | [diff] [blame] | 9 | /* kernel only definitions */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 10 | |
| 11 | struct xfs_buf; |
Christoph Hellwig | a5f9be5 | 2009-12-04 10:19:07 +0000 | [diff] [blame] | 12 | struct xfs_bmbt_rec; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 13 | struct xfs_inode; |
| 14 | struct xfs_mount; |
| 15 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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 */ |
Christoph Hellwig | 898621d | 2010-06-24 11:36:58 +1000 | [diff] [blame] | 21 | unsigned short ili_lock_flags; /* lock flags */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 22 | unsigned short ili_logged; /* flushed logged data */ |
| 23 | unsigned int ili_last_fields; /* fields when flushed */ |
Christoph Hellwig | f5d8d5c | 2012-02-29 09:53:54 +0000 | [diff] [blame] | 24 | unsigned int ili_fields; /* fields to be logged */ |
Dave Chinner | fc0561c | 2015-11-03 13:14:59 +1100 | [diff] [blame] | 25 | unsigned int ili_fsync_fields; /* logged since last fsync */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 26 | } xfs_inode_log_item_t; |
| 27 | |
David Chinner | 3354040 | 2008-03-06 13:43:59 +1100 | [diff] [blame] | 28 | static inline int xfs_inode_clean(xfs_inode_t *ip) |
| 29 | { |
Christoph Hellwig | f5d8d5c | 2012-02-29 09:53:54 +0000 | [diff] [blame] | 30 | return !ip->i_itemp || !(ip->i_itemp->ili_fields & XFS_ILOG_ALL); |
David Chinner | 3354040 | 2008-03-06 13:43:59 +1100 | [diff] [blame] | 31 | } |
| 32 | |
Nathan Scott | a844f45 | 2005-11-02 14:38:42 +1100 | [diff] [blame] | 33 | extern void xfs_inode_item_init(struct xfs_inode *, struct xfs_mount *); |
| 34 | extern void xfs_inode_item_destroy(struct xfs_inode *); |
Christoph Hellwig | ca30b2a | 2010-06-23 18:11:15 +1000 | [diff] [blame] | 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 *); |
Dave Chinner | 04913fd | 2012-04-23 15:58:41 +1000 | [diff] [blame] | 37 | extern void xfs_iflush_abort(struct xfs_inode *, bool); |
Tim Shimmin | 6d192a9 | 2006-06-09 14:55:38 +1000 | [diff] [blame] | 38 | extern int xfs_inode_item_format_convert(xfs_log_iovec_t *, |
Darrick J. Wong | 06b1132 | 2017-10-31 12:04:24 -0700 | [diff] [blame] | 39 | struct xfs_inode_log_format *); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 40 | |
Dave Chinner | 6943283 | 2013-08-12 20:49:23 +1000 | [diff] [blame] | 41 | extern struct kmem_zone *xfs_ili_zone; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 42 | |
| 43 | #endif /* __XFS_INODE_ITEM_H__ */ |