blob: 4c7722e325b369332d381c8435edfc33728a4067 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
Nathan Scott7b718762005-11-02 14:58:39 +11002 * Copyright (c) 2000,2005 Silicon Graphics, Inc.
3 * All Rights Reserved.
Linus Torvalds1da177e2005-04-16 15:20:36 -07004 *
Nathan Scott7b718762005-11-02 14:58:39 +11005 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
Linus Torvalds1da177e2005-04-16 15:20:36 -07007 * published by the Free Software Foundation.
8 *
Nathan Scott7b718762005-11-02 14:58:39 +11009 * This program is distributed in the hope that it would be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
Linus Torvalds1da177e2005-04-16 15:20:36 -070013 *
Nathan Scott7b718762005-11-02 14:58:39 +110014 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Linus Torvalds1da177e2005-04-16 15:20:36 -070017 */
18#ifndef __XFS_INODE_ITEM_H__
19#define __XFS_INODE_ITEM_H__
20
Dave Chinner69432832013-08-12 20:49:23 +100021/* kernel only definitions */
Linus Torvalds1da177e2005-04-16 15:20:36 -070022
23struct xfs_buf;
Christoph Hellwiga5f9be52009-12-04 10:19:07 +000024struct xfs_bmbt_rec;
Linus Torvalds1da177e2005-04-16 15:20:36 -070025struct xfs_inode;
26struct xfs_mount;
27
Linus Torvalds1da177e2005-04-16 15:20:36 -070028typedef struct xfs_inode_log_item {
29 xfs_log_item_t ili_item; /* common portion */
30 struct xfs_inode *ili_inode; /* inode ptr */
31 xfs_lsn_t ili_flush_lsn; /* lsn at last flush */
32 xfs_lsn_t ili_last_lsn; /* lsn at last transaction */
Christoph Hellwig898621d2010-06-24 11:36:58 +100033 unsigned short ili_lock_flags; /* lock flags */
Linus Torvalds1da177e2005-04-16 15:20:36 -070034 unsigned short ili_logged; /* flushed logged data */
35 unsigned int ili_last_fields; /* fields when flushed */
Christoph Hellwigf5d8d5c2012-02-29 09:53:54 +000036 unsigned int ili_fields; /* fields to be logged */
Dave Chinnerfc0561c2015-11-03 13:14:59 +110037 unsigned int ili_fsync_fields; /* logged since last fsync */
Linus Torvalds1da177e2005-04-16 15:20:36 -070038} xfs_inode_log_item_t;
39
David Chinner33540402008-03-06 13:43:59 +110040static inline int xfs_inode_clean(xfs_inode_t *ip)
41{
Christoph Hellwigf5d8d5c2012-02-29 09:53:54 +000042 return !ip->i_itemp || !(ip->i_itemp->ili_fields & XFS_ILOG_ALL);
David Chinner33540402008-03-06 13:43:59 +110043}
44
Nathan Scotta844f452005-11-02 14:38:42 +110045extern void xfs_inode_item_init(struct xfs_inode *, struct xfs_mount *);
46extern void xfs_inode_item_destroy(struct xfs_inode *);
Christoph Hellwigca30b2a2010-06-23 18:11:15 +100047extern void xfs_iflush_done(struct xfs_buf *, struct xfs_log_item *);
48extern void xfs_istale_done(struct xfs_buf *, struct xfs_log_item *);
Dave Chinner04913fd2012-04-23 15:58:41 +100049extern void xfs_iflush_abort(struct xfs_inode *, bool);
Tim Shimmin6d192a92006-06-09 14:55:38 +100050extern int xfs_inode_item_format_convert(xfs_log_iovec_t *,
51 xfs_inode_log_format_t *);
Linus Torvalds1da177e2005-04-16 15:20:36 -070052
Dave Chinner69432832013-08-12 20:49:23 +100053extern struct kmem_zone *xfs_ili_zone;
Linus Torvalds1da177e2005-04-16 15:20:36 -070054
55#endif /* __XFS_INODE_ITEM_H__ */