xfs_inode_item.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * Copyright (c) 2000,2005 Silicon Graphics, Inc.
  3. * All Rights Reserved.
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License as
  7. * published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it would be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write the Free Software Foundation,
  16. * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  17. */
  18. #ifndef __XFS_INODE_ITEM_H__
  19. #define __XFS_INODE_ITEM_H__
  20. /* kernel only definitions */
  21. struct xfs_buf;
  22. struct xfs_bmbt_rec;
  23. struct xfs_inode;
  24. struct xfs_mount;
  25. typedef struct xfs_inode_log_item {
  26. xfs_log_item_t ili_item; /* common portion */
  27. struct xfs_inode *ili_inode; /* inode ptr */
  28. xfs_lsn_t ili_flush_lsn; /* lsn at last flush */
  29. xfs_lsn_t ili_last_lsn; /* lsn at last transaction */
  30. unsigned short ili_lock_flags; /* lock flags */
  31. unsigned short ili_logged; /* flushed logged data */
  32. unsigned int ili_last_fields; /* fields when flushed */
  33. unsigned int ili_fields; /* fields to be logged */
  34. unsigned int ili_fsync_fields; /* logged since last fsync */
  35. } xfs_inode_log_item_t;
  36. static inline int xfs_inode_clean(xfs_inode_t *ip)
  37. {
  38. return !ip->i_itemp || !(ip->i_itemp->ili_fields & XFS_ILOG_ALL);
  39. }
  40. extern void xfs_inode_item_init(struct xfs_inode *, struct xfs_mount *);
  41. extern void xfs_inode_item_destroy(struct xfs_inode *);
  42. extern void xfs_iflush_done(struct xfs_buf *, struct xfs_log_item *);
  43. extern void xfs_istale_done(struct xfs_buf *, struct xfs_log_item *);
  44. extern void xfs_iflush_abort(struct xfs_inode *, bool);
  45. extern int xfs_inode_item_format_convert(xfs_log_iovec_t *,
  46. xfs_inode_log_format_t *);
  47. extern struct kmem_zone *xfs_ili_zone;
  48. #endif /* __XFS_INODE_ITEM_H__ */