Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 /*
0003  * Copyright (c) 2000,2005 Silicon Graphics, Inc.
0004  * All Rights Reserved.
0005  */
0006 #ifndef __XFS_INODE_ITEM_H__
0007 #define __XFS_INODE_ITEM_H__
0008 
0009 /* kernel only definitions */
0010 
0011 struct xfs_buf;
0012 struct xfs_bmbt_rec;
0013 struct xfs_inode;
0014 struct xfs_mount;
0015 
0016 struct xfs_inode_log_item {
0017     struct xfs_log_item ili_item;      /* common portion */
0018     struct xfs_inode    *ili_inode;    /* inode ptr */
0019     unsigned short      ili_lock_flags;    /* inode lock flags */
0020     /*
0021      * The ili_lock protects the interactions between the dirty state and
0022      * the flush state of the inode log item. This allows us to do atomic
0023      * modifications of multiple state fields without having to hold a
0024      * specific inode lock to serialise them.
0025      *
0026      * We need atomic changes between inode dirtying, inode flushing and
0027      * inode completion, but these all hold different combinations of
0028      * ILOCK and IFLUSHING and hence we need some other method of
0029      * serialising updates to the flush state.
0030      */
0031     spinlock_t      ili_lock;      /* flush state lock */
0032     unsigned int        ili_last_fields;   /* fields when flushed */
0033     unsigned int        ili_fields;    /* fields to be logged */
0034     unsigned int        ili_fsync_fields;  /* logged since last fsync */
0035     xfs_lsn_t       ili_flush_lsn;     /* lsn at last flush */
0036     xfs_csn_t       ili_commit_seq;    /* last transaction commit */
0037 };
0038 
0039 static inline int xfs_inode_clean(struct xfs_inode *ip)
0040 {
0041     return !ip->i_itemp || !(ip->i_itemp->ili_fields & XFS_ILOG_ALL);
0042 }
0043 
0044 extern void xfs_inode_item_init(struct xfs_inode *, struct xfs_mount *);
0045 extern void xfs_inode_item_destroy(struct xfs_inode *);
0046 extern void xfs_iflush_abort(struct xfs_inode *);
0047 extern void xfs_iflush_shutdown_abort(struct xfs_inode *);
0048 extern int xfs_inode_item_format_convert(xfs_log_iovec_t *,
0049                      struct xfs_inode_log_format *);
0050 
0051 extern struct kmem_cache    *xfs_ili_cache;
0052 
0053 #endif  /* __XFS_INODE_ITEM_H__ */