| .. | .. |
|---|
| 13 | 13 | struct xfs_inode; |
|---|
| 14 | 14 | struct xfs_mount; |
|---|
| 15 | 15 | |
|---|
| 16 | | -typedef struct xfs_inode_log_item { |
|---|
| 17 | | - xfs_log_item_t ili_item; /* common portion */ |
|---|
| 16 | +struct xfs_inode_log_item { |
|---|
| 17 | + struct xfs_log_item ili_item; /* common portion */ |
|---|
| 18 | 18 | struct xfs_inode *ili_inode; /* inode ptr */ |
|---|
| 19 | | - xfs_lsn_t ili_flush_lsn; /* lsn at last flush */ |
|---|
| 20 | | - xfs_lsn_t ili_last_lsn; /* lsn at last transaction */ |
|---|
| 21 | | - unsigned short ili_lock_flags; /* lock flags */ |
|---|
| 22 | | - unsigned short ili_logged; /* flushed logged data */ |
|---|
| 19 | + unsigned short ili_lock_flags; /* inode lock flags */ |
|---|
| 20 | + /* |
|---|
| 21 | + * The ili_lock protects the interactions between the dirty state and |
|---|
| 22 | + * the flush state of the inode log item. This allows us to do atomic |
|---|
| 23 | + * modifications of multiple state fields without having to hold a |
|---|
| 24 | + * specific inode lock to serialise them. |
|---|
| 25 | + * |
|---|
| 26 | + * We need atomic changes between inode dirtying, inode flushing and |
|---|
| 27 | + * inode completion, but these all hold different combinations of |
|---|
| 28 | + * ILOCK and IFLUSHING and hence we need some other method of |
|---|
| 29 | + * serialising updates to the flush state. |
|---|
| 30 | + */ |
|---|
| 31 | + spinlock_t ili_lock; /* flush state lock */ |
|---|
| 23 | 32 | unsigned int ili_last_fields; /* fields when flushed */ |
|---|
| 24 | 33 | unsigned int ili_fields; /* fields to be logged */ |
|---|
| 25 | 34 | unsigned int ili_fsync_fields; /* logged since last fsync */ |
|---|
| 26 | | -} xfs_inode_log_item_t; |
|---|
| 35 | + xfs_lsn_t ili_flush_lsn; /* lsn at last flush */ |
|---|
| 36 | + xfs_csn_t ili_commit_seq; /* last transaction commit */ |
|---|
| 37 | +}; |
|---|
| 27 | 38 | |
|---|
| 28 | | -static inline int xfs_inode_clean(xfs_inode_t *ip) |
|---|
| 39 | +static inline int xfs_inode_clean(struct xfs_inode *ip) |
|---|
| 29 | 40 | { |
|---|
| 30 | 41 | return !ip->i_itemp || !(ip->i_itemp->ili_fields & XFS_ILOG_ALL); |
|---|
| 31 | 42 | } |
|---|
| 32 | 43 | |
|---|
| 33 | 44 | extern void xfs_inode_item_init(struct xfs_inode *, struct xfs_mount *); |
|---|
| 34 | 45 | extern void xfs_inode_item_destroy(struct xfs_inode *); |
|---|
| 35 | | -extern void xfs_iflush_done(struct xfs_buf *, struct xfs_log_item *); |
|---|
| 36 | | -extern void xfs_istale_done(struct xfs_buf *, struct xfs_log_item *); |
|---|
| 37 | | -extern void xfs_iflush_abort(struct xfs_inode *, bool); |
|---|
| 46 | +extern void xfs_iflush_abort(struct xfs_inode *); |
|---|
| 38 | 47 | extern int xfs_inode_item_format_convert(xfs_log_iovec_t *, |
|---|
| 39 | 48 | struct xfs_inode_log_format *); |
|---|
| 40 | 49 | |
|---|