xfs_inode_item.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Copyright (c) 2000,2005 Silicon Graphics, Inc.
  4. * All Rights Reserved.
  5. */
  6. #ifndef __XFS_INODE_ITEM_H__
  7. #define __XFS_INODE_ITEM_H__
  8. /* kernel only definitions */
  9. struct xfs_buf;
  10. struct xfs_bmbt_rec;
  11. struct xfs_inode;
  12. struct xfs_mount;
  13. struct xfs_inode_log_item {
  14. struct xfs_log_item ili_item; /* common portion */
  15. struct xfs_inode *ili_inode; /* inode ptr */
  16. unsigned short ili_lock_flags; /* inode lock flags */
  17. /*
  18. * The ili_lock protects the interactions between the dirty state and
  19. * the flush state of the inode log item. This allows us to do atomic
  20. * modifications of multiple state fields without having to hold a
  21. * specific inode lock to serialise them.
  22. *
  23. * We need atomic changes between inode dirtying, inode flushing and
  24. * inode completion, but these all hold different combinations of
  25. * ILOCK and IFLUSHING and hence we need some other method of
  26. * serialising updates to the flush state.
  27. */
  28. spinlock_t ili_lock; /* flush state lock */
  29. unsigned int ili_last_fields; /* fields when flushed */
  30. unsigned int ili_fields; /* fields to be logged */
  31. unsigned int ili_fsync_fields; /* logged since last fsync */
  32. xfs_lsn_t ili_flush_lsn; /* lsn at last flush */
  33. xfs_lsn_t ili_last_lsn; /* lsn at last transaction */
  34. };
  35. static inline int xfs_inode_clean(struct xfs_inode *ip)
  36. {
  37. return !ip->i_itemp || !(ip->i_itemp->ili_fields & XFS_ILOG_ALL);
  38. }
  39. extern void xfs_inode_item_init(struct xfs_inode *, struct xfs_mount *);
  40. extern void xfs_inode_item_destroy(struct xfs_inode *);
  41. extern void xfs_iflush_abort(struct xfs_inode *);
  42. extern int xfs_inode_item_format_convert(xfs_log_iovec_t *,
  43. struct xfs_inode_log_format *);
  44. extern struct kmem_zone *xfs_ili_zone;
  45. #endif /* __XFS_INODE_ITEM_H__ */