xfs_inode_buf.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * Copyright (c) 2000-2003,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_BUF_H__
  19. #define __XFS_INODE_BUF_H__
  20. struct xfs_inode;
  21. struct xfs_dinode;
  22. struct xfs_icdinode;
  23. /*
  24. * Inode location information. Stored in the inode and passed to
  25. * xfs_imap_to_bp() to get a buffer and dinode for a given inode.
  26. */
  27. struct xfs_imap {
  28. xfs_daddr_t im_blkno; /* starting BB of inode chunk */
  29. ushort im_len; /* length in BBs of inode chunk */
  30. ushort im_boffset; /* inode offset in block in bytes */
  31. };
  32. int xfs_imap_to_bp(struct xfs_mount *, struct xfs_trans *,
  33. struct xfs_imap *, struct xfs_dinode **,
  34. struct xfs_buf **, uint, uint);
  35. int xfs_iread(struct xfs_mount *, struct xfs_trans *,
  36. struct xfs_inode *, uint);
  37. void xfs_dinode_calc_crc(struct xfs_mount *, struct xfs_dinode *);
  38. void xfs_dinode_to_disk(struct xfs_dinode *to, struct xfs_icdinode *from);
  39. void xfs_dinode_from_disk(struct xfs_icdinode *to, struct xfs_dinode *from);
  40. #if defined(DEBUG)
  41. void xfs_inobp_check(struct xfs_mount *, struct xfs_buf *);
  42. #else
  43. #define xfs_inobp_check(mp, bp)
  44. #endif /* DEBUG */
  45. extern const struct xfs_buf_ops xfs_inode_buf_ops;
  46. extern const struct xfs_buf_ops xfs_inode_buf_ra_ops;
  47. #endif /* __XFS_INODE_BUF_H__ */