xfs_aops.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. * Copyright (c) 2005-2006 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_AOPS_H__
  19. #define __XFS_AOPS_H__
  20. extern struct bio_set *xfs_ioend_bioset;
  21. /*
  22. * Types of I/O for bmap clustering and I/O completion tracking.
  23. */
  24. enum {
  25. XFS_IO_INVALID, /* initial state */
  26. XFS_IO_DELALLOC, /* covers delalloc region */
  27. XFS_IO_UNWRITTEN, /* covers allocated but uninitialized data */
  28. XFS_IO_OVERWRITE, /* covers already allocated extent */
  29. XFS_IO_COW, /* covers copy-on-write extent */
  30. };
  31. #define XFS_IO_TYPES \
  32. { XFS_IO_INVALID, "invalid" }, \
  33. { XFS_IO_DELALLOC, "delalloc" }, \
  34. { XFS_IO_UNWRITTEN, "unwritten" }, \
  35. { XFS_IO_OVERWRITE, "overwrite" }, \
  36. { XFS_IO_COW, "CoW" }
  37. /*
  38. * Structure for buffered I/O completions.
  39. */
  40. struct xfs_ioend {
  41. struct list_head io_list; /* next ioend in chain */
  42. unsigned int io_type; /* delalloc / unwritten */
  43. struct inode *io_inode; /* file being written to */
  44. size_t io_size; /* size of the extent */
  45. xfs_off_t io_offset; /* offset in the file */
  46. struct work_struct io_work; /* xfsdatad work queue */
  47. struct xfs_trans *io_append_trans;/* xact. for size update */
  48. struct bio *io_bio; /* bio being built */
  49. struct bio io_inline_bio; /* MUST BE LAST! */
  50. };
  51. extern const struct address_space_operations xfs_address_space_operations;
  52. int xfs_get_blocks(struct inode *inode, sector_t offset,
  53. struct buffer_head *map_bh, int create);
  54. int xfs_get_blocks_direct(struct inode *inode, sector_t offset,
  55. struct buffer_head *map_bh, int create);
  56. int xfs_get_blocks_dax_fault(struct inode *inode, sector_t offset,
  57. struct buffer_head *map_bh, int create);
  58. int xfs_end_io_direct_write(struct kiocb *iocb, loff_t offset,
  59. ssize_t size, void *private);
  60. int xfs_setfilesize(struct xfs_inode *ip, xfs_off_t offset, size_t size);
  61. extern void xfs_count_page_state(struct page *, int *, int *);
  62. extern struct block_device *xfs_find_bdev_for_inode(struct inode *);
  63. #endif /* __XFS_AOPS_H__ */