Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
Nathan Scott | 7b71876 | 2005-11-02 14:58:39 +1100 | [diff] [blame] | 2 | * Copyright (c) 2000-2003,2005 Silicon Graphics, Inc. |
| 3 | * All Rights Reserved. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [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 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [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. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [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 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 17 | */ |
| 18 | #ifndef __XFS_LRW_H__ |
| 19 | #define __XFS_LRW_H__ |
| 20 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 21 | struct xfs_mount; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 22 | struct xfs_inode; |
| 23 | struct xfs_bmbt_irec; |
| 24 | struct xfs_buf; |
| 25 | struct xfs_iomap; |
| 26 | |
| 27 | #if defined(XFS_RW_TRACE) |
| 28 | /* |
| 29 | * Defines for the trace mechanisms in xfs_lrw.c. |
| 30 | */ |
| 31 | #define XFS_RW_KTRACE_SIZE 128 |
| 32 | |
| 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 |
Olaf Weber | 3e57ecf | 2006-06-09 14:48:12 +1000 | [diff] [blame] | 49 | #define XFS_BUNMAP 17 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 50 | #define XFS_INVAL_CACHED 18 |
| 51 | #define XFS_DIORD_ENTER 19 |
| 52 | #define XFS_DIOWR_ENTER 20 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 53 | #define XFS_WRITEPAGE_ENTER 22 |
| 54 | #define XFS_RELEASEPAGE_ENTER 23 |
Nathan Scott | bcec2b7 | 2005-09-02 16:40:17 +1000 | [diff] [blame] | 55 | #define XFS_INVALIDPAGE_ENTER 24 |
| 56 | #define XFS_IOMAP_ALLOC_ENTER 25 |
| 57 | #define XFS_IOMAP_ALLOC_MAP 26 |
| 58 | #define XFS_IOMAP_UNWRITTEN 27 |
Nathan Scott | 1b89584 | 2006-03-31 13:08:59 +1000 | [diff] [blame] | 59 | #define XFS_SPLICE_READ_ENTER 28 |
| 60 | #define XFS_SPLICE_WRITE_ENTER 29 |
Christoph Hellwig | 613d704 | 2007-10-11 17:44:08 +1000 | [diff] [blame] | 61 | extern void xfs_rw_enter_trace(int, struct xfs_inode *, |
| 62 | void *, size_t, loff_t, int); |
| 63 | extern void xfs_inval_cached_trace(struct xfs_inode *, |
| 64 | xfs_off_t, xfs_off_t, xfs_off_t, xfs_off_t); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 65 | #else |
Christoph Hellwig | 613d704 | 2007-10-11 17:44:08 +1000 | [diff] [blame] | 66 | #define xfs_rw_enter_trace(tag, ip, data, size, offset, ioflags) |
| 67 | #define xfs_inval_cached_trace(ip, offset, len, first, last) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 68 | #endif |
| 69 | |
David Chinner | d64e31a | 2008-04-10 12:22:17 +1000 | [diff] [blame] | 70 | /* errors from xfsbdstrat() must be extracted from the buffer */ |
| 71 | extern void xfsbdstrat(struct xfs_mount *, struct xfs_buf *); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 72 | extern int xfs_bdstrat_cb(struct xfs_buf *); |
Nathan Scott | 1b89584 | 2006-03-31 13:08:59 +1000 | [diff] [blame] | 73 | extern int xfs_dev_is_read_only(struct xfs_mount *, char *); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 74 | |
Lachlan McIlroy | 541d7d3 | 2007-10-11 17:34:33 +1000 | [diff] [blame] | 75 | extern int xfs_zero_eof(struct xfs_inode *, xfs_off_t, xfs_fsize_t); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 76 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 77 | #endif /* __XFS_LRW_H__ */ |