diff options
Diffstat (limited to 'fs/xfs/xfs_dir2_data.h')
-rw-r--r-- | fs/xfs/xfs_dir2_data.h | 93 |
1 files changed, 35 insertions, 58 deletions
diff --git a/fs/xfs/xfs_dir2_data.h b/fs/xfs/xfs_dir2_data.h index 476cac920bf5..eeff85570723 100644 --- a/fs/xfs/xfs_dir2_data.h +++ b/fs/xfs/xfs_dir2_data.h | |||
@@ -137,88 +137,65 @@ typedef struct xfs_dir2_data { | |||
137 | /* | 137 | /* |
138 | * Size of a data entry. | 138 | * Size of a data entry. |
139 | */ | 139 | */ |
140 | #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_DATA_ENTSIZE) | ||
141 | int xfs_dir2_data_entsize(int n); | ||
142 | #define XFS_DIR2_DATA_ENTSIZE(n) xfs_dir2_data_entsize(n) | 140 | #define XFS_DIR2_DATA_ENTSIZE(n) xfs_dir2_data_entsize(n) |
143 | #else | 141 | static inline int xfs_dir2_data_entsize(int n) |
144 | #define XFS_DIR2_DATA_ENTSIZE(n) \ | 142 | { |
145 | ((int)(roundup(offsetof(xfs_dir2_data_entry_t, name[0]) + (n) + \ | 143 | return (int)roundup(offsetof(xfs_dir2_data_entry_t, name[0]) + (n) + \ |
146 | (uint)sizeof(xfs_dir2_data_off_t), XFS_DIR2_DATA_ALIGN))) | 144 | (uint)sizeof(xfs_dir2_data_off_t), XFS_DIR2_DATA_ALIGN); |
147 | #endif | 145 | } |
148 | 146 | ||
149 | /* | 147 | /* |
150 | * Pointer to an entry's tag word. | 148 | * Pointer to an entry's tag word. |
151 | */ | 149 | */ |
152 | #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_DATA_ENTRY_TAG_P) | ||
153 | xfs_dir2_data_off_t *xfs_dir2_data_entry_tag_p(xfs_dir2_data_entry_t *dep); | ||
154 | #define XFS_DIR2_DATA_ENTRY_TAG_P(dep) xfs_dir2_data_entry_tag_p(dep) | 150 | #define XFS_DIR2_DATA_ENTRY_TAG_P(dep) xfs_dir2_data_entry_tag_p(dep) |
155 | #else | 151 | static inline xfs_dir2_data_off_t * |
156 | #define XFS_DIR2_DATA_ENTRY_TAG_P(dep) \ | 152 | xfs_dir2_data_entry_tag_p(xfs_dir2_data_entry_t *dep) |
157 | ((xfs_dir2_data_off_t *)\ | 153 | { |
158 | ((char *)(dep) + XFS_DIR2_DATA_ENTSIZE((dep)->namelen) - \ | 154 | return (xfs_dir2_data_off_t *) \ |
159 | (uint)sizeof(xfs_dir2_data_off_t))) | 155 | ((char *)(dep) + XFS_DIR2_DATA_ENTSIZE((dep)->namelen) - \ |
160 | #endif | 156 | (uint)sizeof(xfs_dir2_data_off_t)); |
157 | } | ||
161 | 158 | ||
162 | /* | 159 | /* |
163 | * Pointer to a freespace's tag word. | 160 | * Pointer to a freespace's tag word. |
164 | */ | 161 | */ |
165 | #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_DATA_UNUSED_TAG_P) | ||
166 | xfs_dir2_data_off_t *xfs_dir2_data_unused_tag_p(xfs_dir2_data_unused_t *dup); | ||
167 | #define XFS_DIR2_DATA_UNUSED_TAG_P(dup) \ | 162 | #define XFS_DIR2_DATA_UNUSED_TAG_P(dup) \ |
168 | xfs_dir2_data_unused_tag_p(dup) | 163 | xfs_dir2_data_unused_tag_p(dup) |
169 | #else | 164 | static inline xfs_dir2_data_off_t * |
170 | #define XFS_DIR2_DATA_UNUSED_TAG_P(dup) \ | 165 | xfs_dir2_data_unused_tag_p(xfs_dir2_data_unused_t *dup) |
171 | ((xfs_dir2_data_off_t *)\ | 166 | { |
172 | ((char *)(dup) + INT_GET((dup)->length, ARCH_CONVERT) \ | 167 | return (xfs_dir2_data_off_t *) \ |
173 | - (uint)sizeof(xfs_dir2_data_off_t))) | 168 | ((char *)(dup) + INT_GET((dup)->length, ARCH_CONVERT) \ |
174 | #endif | 169 | - (uint)sizeof(xfs_dir2_data_off_t)); |
170 | } | ||
175 | 171 | ||
176 | /* | 172 | /* |
177 | * Function declarations. | 173 | * Function declarations. |
178 | */ | 174 | */ |
179 | |||
180 | #ifdef DEBUG | 175 | #ifdef DEBUG |
181 | extern void | 176 | extern void xfs_dir2_data_check(struct xfs_inode *dp, struct xfs_dabuf *bp); |
182 | xfs_dir2_data_check(struct xfs_inode *dp, struct xfs_dabuf *bp); | ||
183 | #else | 177 | #else |
184 | #define xfs_dir2_data_check(dp,bp) | 178 | #define xfs_dir2_data_check(dp,bp) |
185 | #endif | 179 | #endif |
186 | 180 | extern xfs_dir2_data_free_t *xfs_dir2_data_freefind(xfs_dir2_data_t *d, | |
187 | extern xfs_dir2_data_free_t * | 181 | xfs_dir2_data_unused_t *dup); |
188 | xfs_dir2_data_freefind(xfs_dir2_data_t *d, | 182 | extern xfs_dir2_data_free_t *xfs_dir2_data_freeinsert(xfs_dir2_data_t *d, |
189 | xfs_dir2_data_unused_t *dup); | 183 | xfs_dir2_data_unused_t *dup, int *loghead); |
190 | 184 | extern void xfs_dir2_data_freescan(struct xfs_mount *mp, xfs_dir2_data_t *d, | |
191 | extern xfs_dir2_data_free_t * | 185 | int *loghead, char *aendp); |
192 | xfs_dir2_data_freeinsert(xfs_dir2_data_t *d, | 186 | extern int xfs_dir2_data_init(struct xfs_da_args *args, xfs_dir2_db_t blkno, |
193 | xfs_dir2_data_unused_t *dup, int *loghead); | 187 | struct xfs_dabuf **bpp); |
194 | 188 | extern void xfs_dir2_data_log_entry(struct xfs_trans *tp, struct xfs_dabuf *bp, | |
195 | extern void | ||
196 | xfs_dir2_data_freescan(struct xfs_mount *mp, xfs_dir2_data_t *d, | ||
197 | int *loghead, char *aendp); | ||
198 | |||
199 | extern int | ||
200 | xfs_dir2_data_init(struct xfs_da_args *args, xfs_dir2_db_t blkno, | ||
201 | struct xfs_dabuf **bpp); | ||
202 | |||
203 | extern void | ||
204 | xfs_dir2_data_log_entry(struct xfs_trans *tp, struct xfs_dabuf *bp, | ||
205 | xfs_dir2_data_entry_t *dep); | 189 | xfs_dir2_data_entry_t *dep); |
206 | 190 | extern void xfs_dir2_data_log_header(struct xfs_trans *tp, | |
207 | extern void | 191 | struct xfs_dabuf *bp); |
208 | xfs_dir2_data_log_header(struct xfs_trans *tp, struct xfs_dabuf *bp); | 192 | extern void xfs_dir2_data_log_unused(struct xfs_trans *tp, struct xfs_dabuf *bp, |
209 | 193 | xfs_dir2_data_unused_t *dup); | |
210 | extern void | 194 | extern void xfs_dir2_data_make_free(struct xfs_trans *tp, struct xfs_dabuf *bp, |
211 | xfs_dir2_data_log_unused(struct xfs_trans *tp, struct xfs_dabuf *bp, | ||
212 | xfs_dir2_data_unused_t *dup); | ||
213 | |||
214 | extern void | ||
215 | xfs_dir2_data_make_free(struct xfs_trans *tp, struct xfs_dabuf *bp, | ||
216 | xfs_dir2_data_aoff_t offset, | 195 | xfs_dir2_data_aoff_t offset, |
217 | xfs_dir2_data_aoff_t len, int *needlogp, | 196 | xfs_dir2_data_aoff_t len, int *needlogp, |
218 | int *needscanp); | 197 | int *needscanp); |
219 | 198 | extern void xfs_dir2_data_use_free(struct xfs_trans *tp, struct xfs_dabuf *bp, | |
220 | extern void | ||
221 | xfs_dir2_data_use_free(struct xfs_trans *tp, struct xfs_dabuf *bp, | ||
222 | xfs_dir2_data_unused_t *dup, | 199 | xfs_dir2_data_unused_t *dup, |
223 | xfs_dir2_data_aoff_t offset, | 200 | xfs_dir2_data_aoff_t offset, |
224 | xfs_dir2_data_aoff_t len, int *needlogp, | 201 | xfs_dir2_data_aoff_t len, int *needlogp, |