Christoph Hellwig | 65b3da3 | 2005-09-05 08:18:12 +1000 | [diff] [blame] | 1 | /* |
Nathan Scott | ad72387 | 2006-06-09 15:29:12 +1000 | [diff] [blame] | 2 | * Copyright (c) 2005-2006 Silicon Graphics, Inc. |
Nathan Scott | 7b71876 | 2005-11-02 14:58:39 +1100 | [diff] [blame] | 3 | * All Rights Reserved. |
Christoph Hellwig | 65b3da3 | 2005-09-05 08:18:12 +1000 | [diff] [blame] | 4 | * |
Nathan Scott | 7b71876 | 2005-11-02 14:58:39 +1100 | [diff] [blame] | 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 |
Christoph Hellwig | 65b3da3 | 2005-09-05 08:18:12 +1000 | [diff] [blame] | 7 | * published by the Free Software Foundation. |
| 8 | * |
Nathan Scott | 7b71876 | 2005-11-02 14:58:39 +1100 | [diff] [blame] | 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. |
Christoph Hellwig | 65b3da3 | 2005-09-05 08:18:12 +1000 | [diff] [blame] | 13 | * |
Nathan Scott | 7b71876 | 2005-11-02 14:58:39 +1100 | [diff] [blame] | 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 |
Christoph Hellwig | 65b3da3 | 2005-09-05 08:18:12 +1000 | [diff] [blame] | 17 | */ |
| 18 | #ifndef __XFS_AOPS_H__ |
| 19 | #define __XFS_AOPS_H__ |
| 20 | |
Christoph Hellwig | 0e51a8e | 2016-04-06 08:34:30 +1000 | [diff] [blame] | 21 | extern struct bio_set *xfs_ioend_bioset; |
Christoph Hellwig | 65b3da3 | 2005-09-05 08:18:12 +1000 | [diff] [blame] | 22 | |
Christoph Hellwig | f6d6d4f | 2006-01-11 15:40:13 +1100 | [diff] [blame] | 23 | /* |
Christoph Hellwig | a206c81 | 2010-12-10 08:42:20 +0000 | [diff] [blame] | 24 | * Types of I/O for bmap clustering and I/O completion tracking. |
| 25 | */ |
| 26 | enum { |
Dave Chinner | fbcc025 | 2016-02-15 17:21:19 +1100 | [diff] [blame] | 27 | XFS_IO_INVALID, /* initial state */ |
Alain Renaud | 0d882a3 | 2012-05-22 15:56:21 -0500 | [diff] [blame] | 28 | XFS_IO_DELALLOC, /* covers delalloc region */ |
| 29 | XFS_IO_UNWRITTEN, /* covers allocated but uninitialized data */ |
| 30 | XFS_IO_OVERWRITE, /* covers already allocated extent */ |
Darrick J. Wong | ef47366 | 2016-10-03 09:11:34 -0700 | [diff] [blame] | 31 | XFS_IO_COW, /* covers copy-on-write extent */ |
Christoph Hellwig | a206c81 | 2010-12-10 08:42:20 +0000 | [diff] [blame] | 32 | }; |
| 33 | |
| 34 | #define XFS_IO_TYPES \ |
Dave Chinner | fbcc025 | 2016-02-15 17:21:19 +1100 | [diff] [blame] | 35 | { XFS_IO_INVALID, "invalid" }, \ |
Alain Renaud | 0d882a3 | 2012-05-22 15:56:21 -0500 | [diff] [blame] | 36 | { XFS_IO_DELALLOC, "delalloc" }, \ |
| 37 | { XFS_IO_UNWRITTEN, "unwritten" }, \ |
Darrick J. Wong | ef47366 | 2016-10-03 09:11:34 -0700 | [diff] [blame] | 38 | { XFS_IO_OVERWRITE, "overwrite" }, \ |
| 39 | { XFS_IO_COW, "CoW" } |
Christoph Hellwig | a206c81 | 2010-12-10 08:42:20 +0000 | [diff] [blame] | 40 | |
| 41 | /* |
Christoph Hellwig | 0e51a8e | 2016-04-06 08:34:30 +1000 | [diff] [blame] | 42 | * Structure for buffered I/O completions. |
Christoph Hellwig | f6d6d4f | 2006-01-11 15:40:13 +1100 | [diff] [blame] | 43 | */ |
Christoph Hellwig | 0e51a8e | 2016-04-06 08:34:30 +1000 | [diff] [blame] | 44 | struct xfs_ioend { |
Dave Chinner | e10de37 | 2016-02-15 17:23:12 +1100 | [diff] [blame] | 45 | struct list_head io_list; /* next ioend in chain */ |
Christoph Hellwig | f6d6d4f | 2006-01-11 15:40:13 +1100 | [diff] [blame] | 46 | unsigned int io_type; /* delalloc / unwritten */ |
Christoph Hellwig | b677c21 | 2007-08-29 11:46:28 +1000 | [diff] [blame] | 47 | struct inode *io_inode; /* file being written to */ |
Christoph Hellwig | 65b3da3 | 2005-09-05 08:18:12 +1000 | [diff] [blame] | 48 | size_t io_size; /* size of the extent */ |
| 49 | xfs_off_t io_offset; /* offset in the file */ |
| 50 | struct work_struct io_work; /* xfsdatad work queue */ |
Christoph Hellwig | 281627d | 2012-03-13 08:41:05 +0000 | [diff] [blame] | 51 | struct xfs_trans *io_append_trans;/* xact. for size update */ |
Dave Chinner | bb18782 | 2016-04-06 08:11:25 +1000 | [diff] [blame] | 52 | struct bio *io_bio; /* bio being built */ |
Christoph Hellwig | 0e51a8e | 2016-04-06 08:34:30 +1000 | [diff] [blame] | 53 | struct bio io_inline_bio; /* MUST BE LAST! */ |
| 54 | }; |
Christoph Hellwig | 65b3da3 | 2005-09-05 08:18:12 +1000 | [diff] [blame] | 55 | |
Christoph Hellwig | f5e54d6 | 2006-06-28 04:26:44 -0700 | [diff] [blame] | 56 | extern const struct address_space_operations xfs_address_space_operations; |
Dave Chinner | 6b698ed | 2015-06-04 09:18:53 +1000 | [diff] [blame] | 57 | |
| 58 | int xfs_get_blocks(struct inode *inode, sector_t offset, |
| 59 | struct buffer_head *map_bh, int create); |
| 60 | int xfs_get_blocks_direct(struct inode *inode, sector_t offset, |
| 61 | struct buffer_head *map_bh, int create); |
Dave Chinner | 3e12dbb | 2015-11-03 12:27:22 +1100 | [diff] [blame] | 62 | int xfs_get_blocks_dax_fault(struct inode *inode, sector_t offset, |
| 63 | struct buffer_head *map_bh, int create); |
Christoph Hellwig | f6d6d4f | 2006-01-11 15:40:13 +1100 | [diff] [blame] | 64 | |
Christoph Hellwig | fa8d972 | 2016-07-20 11:38:01 +1000 | [diff] [blame] | 65 | int xfs_end_io_direct_write(struct kiocb *iocb, loff_t offset, |
| 66 | ssize_t size, void *private); |
Christoph Hellwig | e372843 | 2016-09-19 11:26:41 +1000 | [diff] [blame] | 67 | int xfs_setfilesize(struct xfs_inode *ip, xfs_off_t offset, size_t size); |
Christoph Hellwig | fa8d972 | 2016-07-20 11:38:01 +1000 | [diff] [blame] | 68 | |
Christoph Hellwig | 20cb52e | 2010-06-24 09:46:01 +1000 | [diff] [blame] | 69 | extern void xfs_count_page_state(struct page *, int *, int *); |
Ross Zwisler | 20a90f5 | 2016-02-26 15:19:52 -0800 | [diff] [blame] | 70 | extern struct block_device *xfs_find_bdev_for_inode(struct inode *); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 71 | |
Nathan Scott | ad72387 | 2006-06-09 15:29:12 +1000 | [diff] [blame] | 72 | #endif /* __XFS_AOPS_H__ */ |