xfs_inode_item.h 2.0 KB
Newer Older
L
Linus Torvalds 已提交
1
/*
2 3
 * Copyright (c) 2000,2005 Silicon Graphics, Inc.
 * All Rights Reserved.
L
Linus Torvalds 已提交
4
 *
5 6
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
L
Linus Torvalds 已提交
7 8
 * published by the Free Software Foundation.
 *
9 10 11 12
 * This program is distributed in the hope that it would be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
L
Linus Torvalds 已提交
13
 *
14 15 16
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write the Free Software Foundation,
 * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
L
Linus Torvalds 已提交
17 18 19 20
 */
#ifndef	__XFS_INODE_ITEM_H__
#define	__XFS_INODE_ITEM_H__

21
/* kernel only definitions */
L
Linus Torvalds 已提交
22 23

struct xfs_buf;
24
struct xfs_bmbt_rec;
L
Linus Torvalds 已提交
25 26 27 28 29 30 31 32
struct xfs_inode;
struct xfs_mount;

typedef struct xfs_inode_log_item {
	xfs_log_item_t		ili_item;	   /* common portion */
	struct xfs_inode	*ili_inode;	   /* inode ptr */
	xfs_lsn_t		ili_flush_lsn;	   /* lsn at last flush */
	xfs_lsn_t		ili_last_lsn;	   /* lsn at last transaction */
33
	unsigned short		ili_lock_flags;	   /* lock flags */
L
Linus Torvalds 已提交
34 35
	unsigned short		ili_logged;	   /* flushed logged data */
	unsigned int		ili_last_fields;   /* fields when flushed */
36
	unsigned int		ili_fields;	   /* fields to be logged */
37
	unsigned int		ili_fsync_fields;  /* logged since last fsync */
L
Linus Torvalds 已提交
38 39
} xfs_inode_log_item_t;

40 41
static inline int xfs_inode_clean(xfs_inode_t *ip)
{
42
	return !ip->i_itemp || !(ip->i_itemp->ili_fields & XFS_ILOG_ALL);
43 44
}

45 46
extern void xfs_inode_item_init(struct xfs_inode *, struct xfs_mount *);
extern void xfs_inode_item_destroy(struct xfs_inode *);
47 48
extern void xfs_iflush_done(struct xfs_buf *, struct xfs_log_item *);
extern void xfs_istale_done(struct xfs_buf *, struct xfs_log_item *);
49
extern void xfs_iflush_abort(struct xfs_inode *, bool);
50 51
extern int xfs_inode_item_format_convert(xfs_log_iovec_t *,
					 xfs_inode_log_format_t *);
L
Linus Torvalds 已提交
52

53
extern struct kmem_zone	*xfs_ili_zone;
L
Linus Torvalds 已提交
54 55

#endif	/* __XFS_INODE_ITEM_H__ */