]>
git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - repair/dir2.h
2 * Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved.
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of version 2 of the GNU General Public License as
6 * published by the Free Software Foundation.
8 * This program is distributed in the hope that it would be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 * Further, this software is distributed without any warranty that it is
13 * free of the rightful claim of any third person regarding infringement
14 * or the like. Any license provided herein, whether implied or
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.
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.
23 * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
24 * Mountain View, CA 94043, or:
28 * For further information regarding this notice, see:
30 * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
40 * the cursor gets passed up and down the da btree processing
41 * routines. The interior block processing routines use the
42 * cursor to determine if the pointers to and from the preceding
43 * and succeeding sibling blocks are ok and whether the values in
44 * the current block are consistent with the entries in the parent
45 * nodes. When a block is traversed, a parent-verification routine
46 * is called to verify if the next logical entry in the next level up
47 * is consistent with the greatest hashval in the next block of the
48 * current level. The verification routine is itself recursive and
49 * calls itself if it has to traverse an interior block to get
50 * the next logical entry. The routine recurses upwards through
51 * the tree until it finds a block where it can simply step to
52 * the next entry. The hashval in that entry should be equal to
53 * the hashval being passed to it (the greatest hashval in the block
54 * that the entry points to). If that isn't true, then the tree
55 * is blown and we need to trash it, salvage and trash it, or fix it.
56 * Currently, we just trash it.
58 typedef struct dir2_level_state
{
59 xfs_dabuf_t
*bp
; /* block bp */
60 xfs_dablk_t bno
; /* file block number */
61 xfs_dahash_t hashval
; /* last verified hashval */
62 int index
; /* current index in block */
63 int dirty
; /* is buffer dirty ? (1 == yes) */
66 typedef struct dir2_bt_cursor
{
67 int active
; /* highest level in tree (# levels-1) */
68 int type
; /* 0 if dir, 1 if attr */
70 xfs_dablk_t greatest_bno
;
72 dir2_level_state_t level
[XFS_DA_NODE_MAXDEPTH
];
73 struct blkmap
*blkmap
;
80 err_release_dir2_cursor(
82 dir2_bt_cursor_t
*cursor
,
89 struct bmap_ext
*bmp
);
109 struct blkmap
*blkmap
);
112 process_sf_dir2_fixi8(
114 xfs_dir2_sf_entry_t
**next_sfep
);
124 #endif /* _XR_DIR2_H */