0001
0002
0003
0004
0005
0006 #ifndef __XFS_BUF_ITEM_H__
0007 #define __XFS_BUF_ITEM_H__
0008
0009
0010
0011 struct xfs_buf;
0012 struct xfs_mount;
0013
0014
0015 #define XFS_BLI_HOLD (1u << 0)
0016 #define XFS_BLI_DIRTY (1u << 1)
0017 #define XFS_BLI_STALE (1u << 2)
0018 #define XFS_BLI_LOGGED (1u << 3)
0019 #define XFS_BLI_INODE_ALLOC_BUF (1u << 4)
0020 #define XFS_BLI_STALE_INODE (1u << 5)
0021 #define XFS_BLI_INODE_BUF (1u << 6)
0022 #define XFS_BLI_ORDERED (1u << 7)
0023
0024 #define XFS_BLI_FLAGS \
0025 { XFS_BLI_HOLD, "HOLD" }, \
0026 { XFS_BLI_DIRTY, "DIRTY" }, \
0027 { XFS_BLI_STALE, "STALE" }, \
0028 { XFS_BLI_LOGGED, "LOGGED" }, \
0029 { XFS_BLI_INODE_ALLOC_BUF, "INODE_ALLOC" }, \
0030 { XFS_BLI_STALE_INODE, "STALE_INODE" }, \
0031 { XFS_BLI_INODE_BUF, "INODE_BUF" }, \
0032 { XFS_BLI_ORDERED, "ORDERED" }
0033
0034
0035
0036
0037
0038
0039 struct xfs_buf_log_item {
0040 struct xfs_log_item bli_item;
0041 struct xfs_buf *bli_buf;
0042 unsigned int bli_flags;
0043 unsigned int bli_recur;
0044 atomic_t bli_refcount;
0045 int bli_format_count;
0046 struct xfs_buf_log_format *bli_formats;
0047 struct xfs_buf_log_format __bli_format;
0048 };
0049
0050 int xfs_buf_item_init(struct xfs_buf *, struct xfs_mount *);
0051 void xfs_buf_item_done(struct xfs_buf *bp);
0052 void xfs_buf_item_relse(struct xfs_buf *);
0053 bool xfs_buf_item_put(struct xfs_buf_log_item *);
0054 void xfs_buf_item_log(struct xfs_buf_log_item *, uint, uint);
0055 bool xfs_buf_item_dirty_format(struct xfs_buf_log_item *);
0056 void xfs_buf_inode_iodone(struct xfs_buf *);
0057 void xfs_buf_inode_io_fail(struct xfs_buf *bp);
0058 #ifdef CONFIG_XFS_QUOTA
0059 void xfs_buf_dquot_iodone(struct xfs_buf *);
0060 void xfs_buf_dquot_io_fail(struct xfs_buf *bp);
0061 #else
0062 static inline void xfs_buf_dquot_iodone(struct xfs_buf *bp)
0063 {
0064 }
0065 static inline void xfs_buf_dquot_io_fail(struct xfs_buf *bp)
0066 {
0067 }
0068 #endif
0069 void xfs_buf_iodone(struct xfs_buf *);
0070 bool xfs_buf_log_check_iovec(struct xfs_log_iovec *iovec);
0071
0072 extern struct kmem_cache *xfs_buf_item_cache;
0073
0074 #endif