aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_btree.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_btree.h')
-rw-r--r--fs/xfs/xfs_btree.h97
1 files changed, 54 insertions, 43 deletions
diff --git a/fs/xfs/xfs_btree.h b/fs/xfs/xfs_btree.h
index 8be838f0154a..a57918276d9f 100644
--- a/fs/xfs/xfs_btree.h
+++ b/fs/xfs/xfs_btree.h
@@ -215,81 +215,92 @@ typedef struct xfs_btree_cur
215 215
216#ifdef __KERNEL__ 216#ifdef __KERNEL__
217 217
218#ifdef DEBUG
219/* 218/*
220 * Debug routine: check that block header is ok. 219 * Check that long form block header is ok.
221 */ 220 */
222void 221int /* error (0 or EFSCORRUPTED) */
223xfs_btree_check_block( 222xfs_btree_check_lblock(
224 xfs_btree_cur_t *cur, /* btree cursor */ 223 struct xfs_btree_cur *cur, /* btree cursor */
225 xfs_btree_block_t *block, /* generic btree block pointer */ 224 struct xfs_btree_lblock *block, /* btree long form block pointer */
226 int level, /* level of the btree block */ 225 int level, /* level of the btree block */
227 struct xfs_buf *bp); /* buffer containing block, if any */ 226 struct xfs_buf *bp); /* buffer containing block, if any */
228 227
229/* 228/*
230 * Debug routine: check that keys are in the right order. 229 * Check that short form block header is ok.
231 */ 230 */
232void 231int /* error (0 or EFSCORRUPTED) */
233xfs_btree_check_key( 232xfs_btree_check_sblock(
234 xfs_btnum_t btnum, /* btree identifier */ 233 struct xfs_btree_cur *cur, /* btree cursor */
235 void *ak1, /* pointer to left (lower) key */ 234 struct xfs_btree_sblock *block, /* btree short form block pointer */
236 void *ak2); /* pointer to right (higher) key */ 235 int level, /* level of the btree block */
237 236 struct xfs_buf *bp); /* buffer containing block */
238/*
239 * Debug routine: check that records are in the right order.
240 */
241void
242xfs_btree_check_rec(
243 xfs_btnum_t btnum, /* btree identifier */
244 void *ar1, /* pointer to left (lower) record */
245 void *ar2); /* pointer to right (higher) record */
246#else
247#define xfs_btree_check_block(a,b,c,d)
248#define xfs_btree_check_key(a,b,c)
249#define xfs_btree_check_rec(a,b,c)
250#endif /* DEBUG */
251 237
252/* 238/*
253 * Checking routine: check that long form block header is ok. 239 * Check that block header is ok.
254 */ 240 */
255int /* error (0 or EFSCORRUPTED) */ 241int
256xfs_btree_check_lblock( 242xfs_btree_check_block(
257 xfs_btree_cur_t *cur, /* btree cursor */ 243 struct xfs_btree_cur *cur, /* btree cursor */
258 xfs_btree_lblock_t *block, /* btree long form block pointer */ 244 struct xfs_btree_block *block, /* generic btree block pointer */
259 int level, /* level of the btree block */ 245 int level, /* level of the btree block */
260 struct xfs_buf *bp); /* buffer containing block, if any */ 246 struct xfs_buf *bp); /* buffer containing block, if any */
261 247
262/* 248/*
263 * Checking routine: check that (long) pointer is ok. 249 * Check that (long) pointer is ok.
264 */ 250 */
265int /* error (0 or EFSCORRUPTED) */ 251int /* error (0 or EFSCORRUPTED) */
266xfs_btree_check_lptr( 252xfs_btree_check_lptr(
267 xfs_btree_cur_t *cur, /* btree cursor */ 253 struct xfs_btree_cur *cur, /* btree cursor */
268 xfs_dfsbno_t ptr, /* btree block disk address */ 254 xfs_dfsbno_t ptr, /* btree block disk address */
269 int level); /* btree block level */ 255 int level); /* btree block level */
270 256
271#define xfs_btree_check_lptr_disk(cur, ptr, level) \ 257#define xfs_btree_check_lptr_disk(cur, ptr, level) \
272 xfs_btree_check_lptr(cur, be64_to_cpu(ptr), level) 258 xfs_btree_check_lptr(cur, be64_to_cpu(ptr), level)
273 259
260
274/* 261/*
275 * Checking routine: check that short form block header is ok. 262 * Check that (short) pointer is ok.
276 */ 263 */
277int /* error (0 or EFSCORRUPTED) */ 264int /* error (0 or EFSCORRUPTED) */
278xfs_btree_check_sblock( 265xfs_btree_check_sptr(
279 xfs_btree_cur_t *cur, /* btree cursor */ 266 struct xfs_btree_cur *cur, /* btree cursor */
280 xfs_btree_sblock_t *block, /* btree short form block pointer */ 267 xfs_agblock_t ptr, /* btree block disk address */
281 int level, /* level of the btree block */ 268 int level); /* btree block level */
282 struct xfs_buf *bp); /* buffer containing block */
283 269
284/* 270/*
285 * Checking routine: check that (short) pointer is ok. 271 * Check that (short) pointer is ok.
286 */ 272 */
287int /* error (0 or EFSCORRUPTED) */ 273int /* error (0 or EFSCORRUPTED) */
288xfs_btree_check_sptr( 274xfs_btree_check_ptr(
289 xfs_btree_cur_t *cur, /* btree cursor */ 275 struct xfs_btree_cur *cur, /* btree cursor */
290 xfs_agblock_t ptr, /* btree block disk address */ 276 union xfs_btree_ptr *ptr, /* btree block disk address */
277 int index, /* offset from ptr to check */
291 int level); /* btree block level */ 278 int level); /* btree block level */
292 279
280#ifdef DEBUG
281
282/*
283 * Debug routine: check that keys are in the right order.
284 */
285void
286xfs_btree_check_key(
287 xfs_btnum_t btnum, /* btree identifier */
288 void *ak1, /* pointer to left (lower) key */
289 void *ak2); /* pointer to right (higher) key */
290
291/*
292 * Debug routine: check that records are in the right order.
293 */
294void
295xfs_btree_check_rec(
296 xfs_btnum_t btnum, /* btree identifier */
297 void *ar1, /* pointer to left (lower) record */
298 void *ar2); /* pointer to right (higher) record */
299#else
300#define xfs_btree_check_key(a, b, c)
301#define xfs_btree_check_rec(a, b, c)
302#endif /* DEBUG */
303
293/* 304/*
294 * Delete the btree cursor. 305 * Delete the btree cursor.
295 */ 306 */