]>
Commit | Line | Data |
---|---|---|
959ef981 | 1 | // SPDX-License-Identifier: GPL-2.0 |
360f4a2e ES |
2 | /* |
3 | * Copyright (c) 2015 Red Hat, Inc. | |
4 | * All Rights Reserved. | |
360f4a2e ES |
5 | */ |
6 | ||
7 | #ifndef _XR_DA_UTIL_H | |
8 | #define _XR_DA_UTIL_H | |
9 | ||
10 | struct da_level_state { | |
167137fe | 11 | struct xfs_buf *bp; /* block bp */ |
360f4a2e ES |
12 | xfs_dablk_t bno; /* file block number */ |
13 | xfs_dahash_t hashval; /* last verified hashval */ | |
14 | int index; /* current index in block */ | |
15 | int dirty; /* is buffer dirty ? (1 == yes) */ | |
16 | }; | |
17 | ||
18 | typedef struct da_bt_cursor { | |
19 | int active; /* highest level in tree (# levels-1) */ | |
20 | xfs_ino_t ino; | |
21 | xfs_dablk_t greatest_bno; | |
7328ea6e | 22 | struct xfs_dinode *dip; |
360f4a2e ES |
23 | struct da_level_state level[XFS_DA_NODE_MAXDEPTH]; |
24 | struct blkmap *blkmap; | |
25 | } da_bt_cursor_t; | |
26 | ||
360f4a2e ES |
27 | struct xfs_buf * |
28 | da_read_buf( | |
29 | xfs_mount_t *mp, | |
30 | int nex, | |
31 | bmap_ext_t *bmp, | |
32 | const struct xfs_buf_ops *ops); | |
33 | ||
34 | void | |
35 | release_da_cursor( | |
36 | xfs_mount_t *mp, | |
37 | da_bt_cursor_t *cursor, | |
38 | int prev_level); | |
39 | ||
40 | void | |
41 | err_release_da_cursor( | |
42 | xfs_mount_t *mp, | |
43 | da_bt_cursor_t *cursor, | |
44 | int prev_level); | |
45 | ||
46 | int | |
47 | traverse_int_dablock( | |
48 | xfs_mount_t *mp, | |
49 | da_bt_cursor_t *da_cursor, | |
50 | xfs_dablk_t *rbno, | |
51 | int whichfork); | |
52 | ||
53 | int | |
54 | verify_da_path( | |
55 | xfs_mount_t *mp, | |
56 | da_bt_cursor_t *cursor, | |
57 | const int p_level, | |
58 | int whichfork); | |
59 | ||
60 | int | |
61 | verify_final_da_path( | |
62 | xfs_mount_t *mp, | |
63 | da_bt_cursor_t *cursor, | |
5cd3b070 ES |
64 | const int p_level, |
65 | int whichfork); | |
360f4a2e | 66 | #endif /* _XR_DA_UTIL_H */ |