diff options
Diffstat (limited to 'fs/xfs/xfs_dir_leaf.h')
-rw-r--r-- | fs/xfs/xfs_dir_leaf.h | 73 |
1 files changed, 27 insertions, 46 deletions
diff --git a/fs/xfs/xfs_dir_leaf.h b/fs/xfs/xfs_dir_leaf.h index 480bffc1f29f..ab6b09eef9ab 100644 --- a/fs/xfs/xfs_dir_leaf.h +++ b/fs/xfs/xfs_dir_leaf.h | |||
@@ -1,33 +1,19 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved. | 2 | * Copyright (c) 2000-2001,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_DIR_LEAF_H__ | 18 | #ifndef __XFS_DIR_LEAF_H__ |
33 | #define __XFS_DIR_LEAF_H__ | 19 | #define __XFS_DIR_LEAF_H__ |
@@ -152,30 +138,26 @@ typedef struct xfs_dir_put_args | |||
152 | struct uio *uio; /* uio control structure */ | 138 | struct uio *uio; /* uio control structure */ |
153 | } xfs_dir_put_args_t; | 139 | } xfs_dir_put_args_t; |
154 | 140 | ||
155 | #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR_LEAF_ENTSIZE_BYNAME) | ||
156 | int xfs_dir_leaf_entsize_byname(int len); | ||
157 | #define XFS_DIR_LEAF_ENTSIZE_BYNAME(len) xfs_dir_leaf_entsize_byname(len) | 141 | #define XFS_DIR_LEAF_ENTSIZE_BYNAME(len) xfs_dir_leaf_entsize_byname(len) |
158 | #else | 142 | static inline int xfs_dir_leaf_entsize_byname(int len) |
159 | #define XFS_DIR_LEAF_ENTSIZE_BYNAME(len) /* space a name will use */ \ | 143 | { |
160 | ((uint)sizeof(xfs_dir_leaf_name_t)-1 + len) | 144 | return (uint)sizeof(xfs_dir_leaf_name_t)-1 + len; |
161 | #endif | 145 | } |
162 | #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR_LEAF_ENTSIZE_BYENTRY) | 146 | |
163 | int xfs_dir_leaf_entsize_byentry(xfs_dir_leaf_entry_t *entry); | ||
164 | #define XFS_DIR_LEAF_ENTSIZE_BYENTRY(entry) \ | 147 | #define XFS_DIR_LEAF_ENTSIZE_BYENTRY(entry) \ |
165 | xfs_dir_leaf_entsize_byentry(entry) | 148 | xfs_dir_leaf_entsize_byentry(entry) |
166 | #else | 149 | static inline int xfs_dir_leaf_entsize_byentry(xfs_dir_leaf_entry_t *entry) |
167 | #define XFS_DIR_LEAF_ENTSIZE_BYENTRY(entry) /* space an entry will use */ \ | 150 | { |
168 | ((uint)sizeof(xfs_dir_leaf_name_t)-1 + (entry)->namelen) | 151 | return (uint)sizeof(xfs_dir_leaf_name_t)-1 + (entry)->namelen; |
169 | #endif | 152 | } |
170 | #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR_LEAF_NAMESTRUCT) | 153 | |
171 | xfs_dir_leaf_name_t * | ||
172 | xfs_dir_leaf_namestruct(xfs_dir_leafblock_t *leafp, int offset); | ||
173 | #define XFS_DIR_LEAF_NAMESTRUCT(leafp,offset) \ | 154 | #define XFS_DIR_LEAF_NAMESTRUCT(leafp,offset) \ |
174 | xfs_dir_leaf_namestruct(leafp,offset) | 155 | xfs_dir_leaf_namestruct(leafp,offset) |
175 | #else | 156 | static inline xfs_dir_leaf_name_t * |
176 | #define XFS_DIR_LEAF_NAMESTRUCT(leafp,offset) /* point to name struct */ \ | 157 | xfs_dir_leaf_namestruct(xfs_dir_leafblock_t *leafp, int offset) |
177 | ((xfs_dir_leaf_name_t *)&((char *)(leafp))[offset]) | 158 | { |
178 | #endif | 159 | return (xfs_dir_leaf_name_t *)&((char *)(leafp))[offset]; |
160 | } | ||
179 | 161 | ||
180 | /*======================================================================== | 162 | /*======================================================================== |
181 | * Function prototypes for the kernel. | 163 | * Function prototypes for the kernel. |
@@ -190,7 +172,7 @@ int xfs_dir_shortform_lookup(struct xfs_da_args *args); | |||
190 | int xfs_dir_shortform_to_leaf(struct xfs_da_args *args); | 172 | int xfs_dir_shortform_to_leaf(struct xfs_da_args *args); |
191 | int xfs_dir_shortform_removename(struct xfs_da_args *args); | 173 | int xfs_dir_shortform_removename(struct xfs_da_args *args); |
192 | int xfs_dir_shortform_getdents(struct xfs_inode *dp, struct uio *uio, int *eofp, | 174 | int xfs_dir_shortform_getdents(struct xfs_inode *dp, struct uio *uio, int *eofp, |
193 | struct xfs_dirent *dbp, xfs_dir_put_t put); | 175 | struct xfs_dirent *dbp, xfs_dir_put_t put); |
194 | int xfs_dir_shortform_replace(struct xfs_da_args *args); | 176 | int xfs_dir_shortform_replace(struct xfs_da_args *args); |
195 | 177 | ||
196 | /* | 178 | /* |
@@ -237,7 +219,6 @@ int xfs_dir_put_dirent64_direct(xfs_dir_put_args_t *pa); | |||
237 | int xfs_dir_put_dirent64_uio(xfs_dir_put_args_t *pa); | 219 | int xfs_dir_put_dirent64_uio(xfs_dir_put_args_t *pa); |
238 | int xfs_dir_ino_validate(struct xfs_mount *mp, xfs_ino_t ino); | 220 | int xfs_dir_ino_validate(struct xfs_mount *mp, xfs_ino_t ino); |
239 | 221 | ||
240 | |||
241 | /* | 222 | /* |
242 | * Global data. | 223 | * Global data. |
243 | */ | 224 | */ |