xfs_buf_item.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Copyright (c) 2000-2001,2005 Silicon Graphics, Inc.
  4. * All Rights Reserved.
  5. */
  6. #ifndef __XFS_BUF_ITEM_H__
  7. #define __XFS_BUF_ITEM_H__
  8. /* kernel only definitions */
  9. /* buf log item flags */
  10. #define XFS_BLI_HOLD 0x01
  11. #define XFS_BLI_DIRTY 0x02
  12. #define XFS_BLI_STALE 0x04
  13. #define XFS_BLI_LOGGED 0x08
  14. #define XFS_BLI_INODE_ALLOC_BUF 0x10
  15. #define XFS_BLI_STALE_INODE 0x20
  16. #define XFS_BLI_INODE_BUF 0x40
  17. #define XFS_BLI_ORDERED 0x80
  18. #define XFS_BLI_FLAGS \
  19. { XFS_BLI_HOLD, "HOLD" }, \
  20. { XFS_BLI_DIRTY, "DIRTY" }, \
  21. { XFS_BLI_STALE, "STALE" }, \
  22. { XFS_BLI_LOGGED, "LOGGED" }, \
  23. { XFS_BLI_INODE_ALLOC_BUF, "INODE_ALLOC" }, \
  24. { XFS_BLI_STALE_INODE, "STALE_INODE" }, \
  25. { XFS_BLI_INODE_BUF, "INODE_BUF" }, \
  26. { XFS_BLI_ORDERED, "ORDERED" }
  27. struct xfs_buf;
  28. struct xfs_mount;
  29. struct xfs_buf_log_item;
  30. /*
  31. * This is the in core log item structure used to track information
  32. * needed to log buffers. It tracks how many times the lock has been
  33. * locked, and which 128 byte chunks of the buffer are dirty.
  34. */
  35. struct xfs_buf_log_item {
  36. xfs_log_item_t bli_item; /* common item structure */
  37. struct xfs_buf *bli_buf; /* real buffer pointer */
  38. unsigned int bli_flags; /* misc flags */
  39. unsigned int bli_recur; /* lock recursion count */
  40. atomic_t bli_refcount; /* cnt of tp refs */
  41. int bli_format_count; /* count of headers */
  42. struct xfs_buf_log_format *bli_formats; /* array of in-log header ptrs */
  43. struct xfs_buf_log_format __bli_format; /* embedded in-log header */
  44. };
  45. int xfs_buf_item_init(struct xfs_buf *, struct xfs_mount *);
  46. void xfs_buf_item_relse(struct xfs_buf *);
  47. bool xfs_buf_item_put(struct xfs_buf_log_item *);
  48. void xfs_buf_item_log(struct xfs_buf_log_item *, uint, uint);
  49. bool xfs_buf_item_dirty_format(struct xfs_buf_log_item *);
  50. void xfs_buf_attach_iodone(struct xfs_buf *,
  51. void(*)(struct xfs_buf *, xfs_log_item_t *),
  52. xfs_log_item_t *);
  53. void xfs_buf_iodone_callbacks(struct xfs_buf *);
  54. void xfs_buf_iodone(struct xfs_buf *, struct xfs_log_item *);
  55. bool xfs_buf_resubmit_failed_buffers(struct xfs_buf *,
  56. struct list_head *);
  57. extern kmem_zone_t *xfs_buf_item_zone;
  58. #endif /* __XFS_BUF_ITEM_H__ */