blob: 488d81254e28a73e26fba494fd89d21139415ac6 [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 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070037} xfs_inode_log_item_t;
38
David Chinner33540402008-03-06 13:43:59 +110039static inline int xfs_inode_clean(xfs_inode_t *ip)
40{
Christoph Hellwigf5d8d5c2012-02-29 09:53:54 +000041 return !ip->i_itemp || !(ip->i_itemp->ili_fields & XFS_ILOG_ALL);
David Chinner33540402008-03-06 13:43:59 +110042}
43
Nathan Scotta844f452005-11-02 14:38:42 +110044extern void xfs_inode_item_init(struct xfs_inode *, struct xfs_mount *);
45extern void xfs_inode_item_destroy(struct xfs_inode *);
Christoph Hellwigca30b2a2010-06-23 18:11:15 +100046extern void xfs_iflush_done(struct xfs_buf *, struct xfs_log_item *);
47extern void xfs_istale_done(struct xfs_buf *, struct xfs_log_item *);
Dave Chinner04913fd2012-04-23 15:58:41 +100048extern void xfs_iflush_abort(struct xfs_inode *, bool);
Tim Shimmin6d192a92006-06-09 14:55:38 +100049extern int xfs_inode_item_format_convert(xfs_log_iovec_t *,
50 xfs_inode_log_format_t *);
Linus Torvalds1da177e2005-04-16 15:20:36 -070051
Dave Chinner69432832013-08-12 20:49:23 +100052extern struct kmem_zone *xfs_ili_zone;
Linus Torvalds1da177e2005-04-16 15:20:36 -070053
54#endif /* __XFS_INODE_ITEM_H__ */