blob: 27081eba220c95247a24a417e00ace8d574e3d44 [file] [log] [blame]
Dave Chinner0b61f8a2018-06-05 19:42:14 -07001// SPDX-License-Identifier: GPL-2.0
Linus Torvalds1da177e2005-04-16 15:20:36 -07002/*
Nathan Scott7b718762005-11-02 14:58:39 +11003 * Copyright (c) 2000,2005 Silicon Graphics, Inc.
4 * All Rights Reserved.
Linus Torvalds1da177e2005-04-16 15:20:36 -07005 */
6#ifndef __XFS_INODE_ITEM_H__
7#define __XFS_INODE_ITEM_H__
8
Dave Chinner69432832013-08-12 20:49:23 +10009/* kernel only definitions */
Linus Torvalds1da177e2005-04-16 15:20:36 -070010
11struct xfs_buf;
Christoph Hellwiga5f9be52009-12-04 10:19:07 +000012struct xfs_bmbt_rec;
Linus Torvalds1da177e2005-04-16 15:20:36 -070013struct xfs_inode;
14struct xfs_mount;
15
Linus Torvalds1da177e2005-04-16 15:20:36 -070016typedef 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 Hellwig898621d2010-06-24 11:36:58 +100021 unsigned short ili_lock_flags; /* lock flags */
Linus Torvalds1da177e2005-04-16 15:20:36 -070022 unsigned short ili_logged; /* flushed logged data */
23 unsigned int ili_last_fields; /* fields when flushed */
Christoph Hellwigf5d8d5c2012-02-29 09:53:54 +000024 unsigned int ili_fields; /* fields to be logged */
Dave Chinnerfc0561c2015-11-03 13:14:59 +110025 unsigned int ili_fsync_fields; /* logged since last fsync */
Linus Torvalds1da177e2005-04-16 15:20:36 -070026} xfs_inode_log_item_t;
27
David Chinner33540402008-03-06 13:43:59 +110028static inline int xfs_inode_clean(xfs_inode_t *ip)
29{
Christoph Hellwigf5d8d5c2012-02-29 09:53:54 +000030 return !ip->i_itemp || !(ip->i_itemp->ili_fields & XFS_ILOG_ALL);
David Chinner33540402008-03-06 13:43:59 +110031}
32
Nathan Scotta844f452005-11-02 14:38:42 +110033extern void xfs_inode_item_init(struct xfs_inode *, struct xfs_mount *);
34extern void xfs_inode_item_destroy(struct xfs_inode *);
Christoph Hellwigca30b2a2010-06-23 18:11:15 +100035extern void xfs_iflush_done(struct xfs_buf *, struct xfs_log_item *);
36extern void xfs_istale_done(struct xfs_buf *, struct xfs_log_item *);
Dave Chinner04913fd2012-04-23 15:58:41 +100037extern void xfs_iflush_abort(struct xfs_inode *, bool);
Tim Shimmin6d192a92006-06-09 14:55:38 +100038extern int xfs_inode_item_format_convert(xfs_log_iovec_t *,
Darrick J. Wong06b11322017-10-31 12:04:24 -070039 struct xfs_inode_log_format *);
Linus Torvalds1da177e2005-04-16 15:20:36 -070040
Dave Chinner69432832013-08-12 20:49:23 +100041extern struct kmem_zone *xfs_ili_zone;
Linus Torvalds1da177e2005-04-16 15:20:36 -070042
43#endif /* __XFS_INODE_ITEM_H__ */