xfs_lrw.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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_LRW_H__
  19. #define __XFS_LRW_H__
  20. struct vnode;
  21. struct bhv_desc;
  22. struct xfs_mount;
  23. struct xfs_iocore;
  24. struct xfs_inode;
  25. struct xfs_bmbt_irec;
  26. struct xfs_buf;
  27. struct xfs_iomap;
  28. #if defined(XFS_RW_TRACE)
  29. /*
  30. * Defines for the trace mechanisms in xfs_lrw.c.
  31. */
  32. #define XFS_RW_KTRACE_SIZE 128
  33. #define XFS_READ_ENTER 1
  34. #define XFS_WRITE_ENTER 2
  35. #define XFS_IOMAP_READ_ENTER 3
  36. #define XFS_IOMAP_WRITE_ENTER 4
  37. #define XFS_IOMAP_READ_MAP 5
  38. #define XFS_IOMAP_WRITE_MAP 6
  39. #define XFS_IOMAP_WRITE_NOSPACE 7
  40. #define XFS_ITRUNC_START 8
  41. #define XFS_ITRUNC_FINISH1 9
  42. #define XFS_ITRUNC_FINISH2 10
  43. #define XFS_CTRUNC1 11
  44. #define XFS_CTRUNC2 12
  45. #define XFS_CTRUNC3 13
  46. #define XFS_CTRUNC4 14
  47. #define XFS_CTRUNC5 15
  48. #define XFS_CTRUNC6 16
  49. #define XFS_BUNMAPI 17
  50. #define XFS_INVAL_CACHED 18
  51. #define XFS_DIORD_ENTER 19
  52. #define XFS_DIOWR_ENTER 20
  53. #define XFS_SENDFILE_ENTER 21
  54. #define XFS_WRITEPAGE_ENTER 22
  55. #define XFS_RELEASEPAGE_ENTER 23
  56. #define XFS_INVALIDPAGE_ENTER 24
  57. #define XFS_IOMAP_ALLOC_ENTER 25
  58. #define XFS_IOMAP_ALLOC_MAP 26
  59. #define XFS_IOMAP_UNWRITTEN 27
  60. #define XFS_SPLICE_READ_ENTER 28
  61. #define XFS_SPLICE_WRITE_ENTER 29
  62. extern void xfs_rw_enter_trace(int, struct xfs_iocore *,
  63. void *, size_t, loff_t, int);
  64. extern void xfs_inval_cached_trace(struct xfs_iocore *,
  65. xfs_off_t, xfs_off_t, xfs_off_t, xfs_off_t);
  66. #else
  67. #define xfs_rw_enter_trace(tag, io, data, size, offset, ioflags)
  68. #define xfs_inval_cached_trace(io, offset, len, first, last)
  69. #endif
  70. /*
  71. * Maximum count of bmaps used by read and write paths.
  72. */
  73. #define XFS_MAX_RW_NBMAPS 4
  74. extern int xfs_bmap(struct bhv_desc *, xfs_off_t, ssize_t, int,
  75. struct xfs_iomap *, int *);
  76. extern int xfsbdstrat(struct xfs_mount *, struct xfs_buf *);
  77. extern int xfs_bdstrat_cb(struct xfs_buf *);
  78. extern int xfs_dev_is_read_only(struct xfs_mount *, char *);
  79. extern int xfs_zero_eof(struct vnode *, struct xfs_iocore *, xfs_off_t,
  80. xfs_fsize_t, xfs_fsize_t);
  81. extern ssize_t xfs_read(struct bhv_desc *, struct kiocb *,
  82. const struct iovec *, unsigned int,
  83. loff_t *, int, struct cred *);
  84. extern ssize_t xfs_write(struct bhv_desc *, struct kiocb *,
  85. const struct iovec *, unsigned int,
  86. loff_t *, int, struct cred *);
  87. extern ssize_t xfs_sendfile(struct bhv_desc *, struct file *,
  88. loff_t *, int, size_t, read_actor_t,
  89. void *, struct cred *);
  90. extern ssize_t xfs_splice_read(struct bhv_desc *, struct file *, loff_t *,
  91. struct pipe_inode_info *, size_t, int, int,
  92. struct cred *);
  93. extern ssize_t xfs_splice_write(struct bhv_desc *, struct pipe_inode_info *,
  94. struct file *, loff_t *, size_t, int, int,
  95. struct cred *);
  96. #endif /* __XFS_LRW_H__ */