xfs_aops.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Copyright (c) 2005-2006 Silicon Graphics, Inc.
  4. * All Rights Reserved.
  5. */
  6. #ifndef __XFS_AOPS_H__
  7. #define __XFS_AOPS_H__
  8. extern struct bio_set xfs_ioend_bioset;
  9. /*
  10. * Types of I/O for bmap clustering and I/O completion tracking.
  11. */
  12. enum {
  13. XFS_IO_HOLE, /* covers region without any block allocation */
  14. XFS_IO_DELALLOC, /* covers delalloc region */
  15. XFS_IO_UNWRITTEN, /* covers allocated but uninitialized data */
  16. XFS_IO_OVERWRITE, /* covers already allocated extent */
  17. XFS_IO_COW, /* covers copy-on-write extent */
  18. };
  19. #define XFS_IO_TYPES \
  20. { XFS_IO_HOLE, "hole" }, \
  21. { XFS_IO_DELALLOC, "delalloc" }, \
  22. { XFS_IO_UNWRITTEN, "unwritten" }, \
  23. { XFS_IO_OVERWRITE, "overwrite" }, \
  24. { XFS_IO_COW, "CoW" }
  25. /*
  26. * Structure for buffered I/O completions.
  27. */
  28. struct xfs_ioend {
  29. struct list_head io_list; /* next ioend in chain */
  30. unsigned int io_type; /* delalloc / unwritten */
  31. struct inode *io_inode; /* file being written to */
  32. size_t io_size; /* size of the extent */
  33. xfs_off_t io_offset; /* offset in the file */
  34. struct work_struct io_work; /* xfsdatad work queue */
  35. struct xfs_trans *io_append_trans;/* xact. for size update */
  36. struct bio *io_bio; /* bio being built */
  37. struct bio io_inline_bio; /* MUST BE LAST! */
  38. };
  39. extern const struct address_space_operations xfs_address_space_operations;
  40. extern const struct address_space_operations xfs_dax_aops;
  41. int xfs_setfilesize(struct xfs_inode *ip, xfs_off_t offset, size_t size);
  42. extern void xfs_count_page_state(struct page *, int *, int *);
  43. extern struct block_device *xfs_find_bdev_for_inode(struct inode *);
  44. extern struct dax_device *xfs_find_daxdev_for_inode(struct inode *);
  45. #endif /* __XFS_AOPS_H__ */