Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
Nathan Scott | 7b71876 | 2005-11-02 14:58:39 +1100 | [diff] [blame] | 2 | * Copyright (c) 2000,2005 Silicon Graphics, Inc. |
| 3 | * All Rights Reserved. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 4 | * |
Nathan Scott | 7b71876 | 2005-11-02 14:58:39 +1100 | [diff] [blame] | 5 | * 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 Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 7 | * published by the Free Software Foundation. |
| 8 | * |
Nathan Scott | 7b71876 | 2005-11-02 14:58:39 +1100 | [diff] [blame] | 9 | * 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 Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 13 | * |
Nathan Scott | 7b71876 | 2005-11-02 14:58:39 +1100 | [diff] [blame] | 14 | * 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 Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 17 | */ |
| 18 | #ifndef __XFS_INODE_ITEM_H__ |
| 19 | #define __XFS_INODE_ITEM_H__ |
| 20 | |
Dave Chinner | 6943283 | 2013-08-12 20:49:23 +1000 | [diff] [blame] | 21 | /* kernel only definitions */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 22 | |
| 23 | struct xfs_buf; |
Christoph Hellwig | a5f9be5 | 2009-12-04 10:19:07 +0000 | [diff] [blame] | 24 | struct xfs_bmbt_rec; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 25 | struct xfs_inode; |
| 26 | struct xfs_mount; |
| 27 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 28 | typedef 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 Hellwig | 898621d | 2010-06-24 11:36:58 +1000 | [diff] [blame] | 33 | unsigned short ili_lock_flags; /* lock flags */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 34 | unsigned short ili_logged; /* flushed logged data */ |
| 35 | unsigned int ili_last_fields; /* fields when flushed */ |
Christoph Hellwig | f5d8d5c | 2012-02-29 09:53:54 +0000 | [diff] [blame] | 36 | unsigned int ili_fields; /* fields to be logged */ |
Dave Chinner | fc0561c | 2015-11-03 13:14:59 +1100 | [diff] [blame] | 37 | unsigned int ili_fsync_fields; /* logged since last fsync */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 38 | } xfs_inode_log_item_t; |
| 39 | |
David Chinner | 3354040 | 2008-03-06 13:43:59 +1100 | [diff] [blame] | 40 | static inline int xfs_inode_clean(xfs_inode_t *ip) |
| 41 | { |
Christoph Hellwig | f5d8d5c | 2012-02-29 09:53:54 +0000 | [diff] [blame] | 42 | return !ip->i_itemp || !(ip->i_itemp->ili_fields & XFS_ILOG_ALL); |
David Chinner | 3354040 | 2008-03-06 13:43:59 +1100 | [diff] [blame] | 43 | } |
| 44 | |
Nathan Scott | a844f45 | 2005-11-02 14:38:42 +1100 | [diff] [blame] | 45 | extern void xfs_inode_item_init(struct xfs_inode *, struct xfs_mount *); |
| 46 | extern void xfs_inode_item_destroy(struct xfs_inode *); |
Christoph Hellwig | ca30b2a | 2010-06-23 18:11:15 +1000 | [diff] [blame] | 47 | extern void xfs_iflush_done(struct xfs_buf *, struct xfs_log_item *); |
| 48 | extern void xfs_istale_done(struct xfs_buf *, struct xfs_log_item *); |
Dave Chinner | 04913fd | 2012-04-23 15:58:41 +1000 | [diff] [blame] | 49 | extern void xfs_iflush_abort(struct xfs_inode *, bool); |
Tim Shimmin | 6d192a9 | 2006-06-09 14:55:38 +1000 | [diff] [blame] | 50 | extern int xfs_inode_item_format_convert(xfs_log_iovec_t *, |
| 51 | xfs_inode_log_format_t *); |
Dave Chinner | f8d55aa052 | 2016-02-09 16:54:58 +1100 | [diff] [blame^] | 52 | extern void xfs_log_dinode_to_icdinode(struct xfs_log_dinode *from, |
| 53 | struct xfs_icdinode *to); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 54 | |
Dave Chinner | 6943283 | 2013-08-12 20:49:23 +1000 | [diff] [blame] | 55 | extern struct kmem_zone *xfs_ili_zone; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 56 | |
| 57 | #endif /* __XFS_INODE_ITEM_H__ */ |