diff options
Diffstat (limited to 'fs/xfs/xfs_rw.h')
-rw-r--r-- | fs/xfs/xfs_rw.h | 135 |
1 files changed, 39 insertions, 96 deletions
diff --git a/fs/xfs/xfs_rw.h b/fs/xfs/xfs_rw.h index c8b10bf8f530..de85eefb7966 100644 --- a/fs/xfs/xfs_rw.h +++ b/fs/xfs/xfs_rw.h | |||
@@ -1,33 +1,19 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved. | 2 | * Copyright (c) 2000-2003,2005 Silicon Graphics, Inc. |
3 | * All Rights Reserved. | ||
3 | * | 4 | * |
4 | * This program is free software; you can redistribute it and/or modify it | 5 | * This program is free software; you can redistribute it and/or |
5 | * under the terms of version 2 of the GNU General Public License as | 6 | * modify it under the terms of the GNU General Public License as |
6 | * published by the Free Software Foundation. | 7 | * published by the Free Software Foundation. |
7 | * | 8 | * |
8 | * This program is distributed in the hope that it would be useful, but | 9 | * This program is distributed in the hope that it would be useful, |
9 | * WITHOUT ANY WARRANTY; without even the implied warranty of | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | * GNU General Public License for more details. | ||
11 | * | 13 | * |
12 | * Further, this software is distributed without any warranty that it is | 14 | * You should have received a copy of the GNU General Public License |
13 | * free of the rightful claim of any third person regarding infringement | 15 | * along with this program; if not, write the Free Software Foundation, |
14 | * or the like. Any license provided herein, whether implied or | 16 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
15 | * otherwise, applies only to this software file. Patent licenses, if | ||
16 | * any, provided herein do not apply to combinations of this program with | ||
17 | * other software, or any other product whatsoever. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License along | ||
20 | * with this program; if not, write the Free Software Foundation, Inc., 59 | ||
21 | * Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
22 | * | ||
23 | * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, | ||
24 | * Mountain View, CA 94043, or: | ||
25 | * | ||
26 | * http://www.sgi.com | ||
27 | * | ||
28 | * For further information regarding this notice, see: | ||
29 | * | ||
30 | * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ | ||
31 | */ | 17 | */ |
32 | #ifndef __XFS_RW_H__ | 18 | #ifndef __XFS_RW_H__ |
33 | #define __XFS_RW_H__ | 19 | #define __XFS_RW_H__ |
@@ -68,87 +54,44 @@ struct xfs_mount; | |||
68 | * file is a real time file or not, because the bmap code | 54 | * file is a real time file or not, because the bmap code |
69 | * does. | 55 | * does. |
70 | */ | 56 | */ |
71 | #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_FSB_TO_DB) | ||
72 | xfs_daddr_t xfs_fsb_to_db(struct xfs_inode *ip, xfs_fsblock_t fsb); | ||
73 | #define XFS_FSB_TO_DB(ip,fsb) xfs_fsb_to_db(ip,fsb) | 57 | #define XFS_FSB_TO_DB(ip,fsb) xfs_fsb_to_db(ip,fsb) |
74 | #else | 58 | static inline xfs_daddr_t |
75 | #define XFS_FSB_TO_DB(ip,fsb) \ | 59 | xfs_fsb_to_db(struct xfs_inode *ip, xfs_fsblock_t fsb) |
76 | (((ip)->i_d.di_flags & XFS_DIFLAG_REALTIME) ? \ | 60 | { |
61 | return (((ip)->i_d.di_flags & XFS_DIFLAG_REALTIME) ? \ | ||
77 | (xfs_daddr_t)XFS_FSB_TO_BB((ip)->i_mount, (fsb)) : \ | 62 | (xfs_daddr_t)XFS_FSB_TO_BB((ip)->i_mount, (fsb)) : \ |
78 | XFS_FSB_TO_DADDR((ip)->i_mount, (fsb))) | 63 | XFS_FSB_TO_DADDR((ip)->i_mount, (fsb))); |
79 | #endif | 64 | } |
80 | 65 | #define XFS_FSB_TO_DB_IO(io,fsb) xfs_fsb_to_db_io(io,fsb) | |
81 | #define XFS_FSB_TO_DB_IO(io,fsb) \ | 66 | static inline xfs_daddr_t |
82 | (((io)->io_flags & XFS_IOCORE_RT) ? \ | 67 | xfs_fsb_to_db_io(struct xfs_iocore *io, xfs_fsblock_t fsb) |
68 | { | ||
69 | return (((io)->io_flags & XFS_IOCORE_RT) ? \ | ||
83 | XFS_FSB_TO_BB((io)->io_mount, (fsb)) : \ | 70 | XFS_FSB_TO_BB((io)->io_mount, (fsb)) : \ |
84 | XFS_FSB_TO_DADDR((io)->io_mount, (fsb))) | 71 | XFS_FSB_TO_DADDR((io)->io_mount, (fsb))); |
72 | } | ||
85 | 73 | ||
86 | /* | 74 | /* |
87 | * Prototypes for functions in xfs_rw.c. | 75 | * Prototypes for functions in xfs_rw.c. |
88 | */ | 76 | */ |
89 | 77 | extern int xfs_write_clear_setuid(struct xfs_inode *ip); | |
90 | int | 78 | extern int xfs_bwrite(struct xfs_mount *mp, struct xfs_buf *bp); |
91 | xfs_write_clear_setuid( | 79 | extern int xfs_bioerror(struct xfs_buf *bp); |
92 | struct xfs_inode *ip); | 80 | extern int xfs_bioerror_relse(struct xfs_buf *bp); |
93 | 81 | extern int xfs_read_buf(struct xfs_mount *mp, xfs_buftarg_t *btp, | |
94 | int | 82 | xfs_daddr_t blkno, int len, uint flags, |
95 | xfs_bwrite( | 83 | struct xfs_buf **bpp); |
96 | struct xfs_mount *mp, | 84 | extern void xfs_ioerror_alert(char *func, struct xfs_mount *mp, |
97 | struct xfs_buf *bp); | 85 | xfs_buf_t *bp, xfs_daddr_t blkno); |
98 | |||
99 | int | ||
100 | xfs_bioerror( | ||
101 | struct xfs_buf *b); | ||
102 | |||
103 | int | ||
104 | xfs_bioerror_relse( | ||
105 | struct xfs_buf *b); | ||
106 | |||
107 | int | ||
108 | xfs_read_buf( | ||
109 | struct xfs_mount *mp, | ||
110 | xfs_buftarg_t *target, | ||
111 | xfs_daddr_t blkno, | ||
112 | int len, | ||
113 | uint flags, | ||
114 | struct xfs_buf **bpp); | ||
115 | |||
116 | void | ||
117 | xfs_ioerror_alert( | ||
118 | char *func, | ||
119 | struct xfs_mount *mp, | ||
120 | xfs_buf_t *bp, | ||
121 | xfs_daddr_t blkno); | ||
122 | |||
123 | 86 | ||
124 | /* | 87 | /* |
125 | * Prototypes for functions in xfs_vnodeops.c. | 88 | * Prototypes for functions in xfs_vnodeops.c. |
126 | */ | 89 | */ |
127 | 90 | extern int xfs_rwlock(bhv_desc_t *bdp, vrwlock_t write_lock); | |
128 | int | 91 | extern void xfs_rwunlock(bhv_desc_t *bdp, vrwlock_t write_lock); |
129 | xfs_rwlock( | 92 | extern int xfs_change_file_space(bhv_desc_t *bdp, int cmd, xfs_flock64_t *bf, |
130 | bhv_desc_t *bdp, | 93 | xfs_off_t offset, cred_t *credp, int flags); |
131 | vrwlock_t write_lock); | 94 | extern int xfs_set_dmattrs(bhv_desc_t *bdp, u_int evmask, u_int16_t state, |
132 | 95 | cred_t *credp); | |
133 | void | ||
134 | xfs_rwunlock( | ||
135 | bhv_desc_t *bdp, | ||
136 | vrwlock_t write_lock); | ||
137 | |||
138 | int | ||
139 | xfs_change_file_space( | ||
140 | bhv_desc_t *bdp, | ||
141 | int cmd, | ||
142 | xfs_flock64_t *bf, | ||
143 | xfs_off_t offset, | ||
144 | cred_t *credp, | ||
145 | int flags); | ||
146 | |||
147 | int | ||
148 | xfs_set_dmattrs( | ||
149 | bhv_desc_t *bdp, | ||
150 | u_int evmask, | ||
151 | u_int16_t state, | ||
152 | cred_t *credp); | ||
153 | 96 | ||
154 | #endif /* __XFS_RW_H__ */ | 97 | #endif /* __XFS_RW_H__ */ |