]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blame - repair/da_util.h
libxfs: refactor manage_zones()
[thirdparty/xfsprogs-dev.git] / repair / da_util.h
CommitLineData
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
10struct da_level_state {
11 xfs_buf_t *bp; /* block bp */
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
18typedef struct da_bt_cursor {
19 int active; /* highest level in tree (# levels-1) */
20 xfs_ino_t ino;
21 xfs_dablk_t greatest_bno;
22 xfs_dinode_t *dip;
23 struct da_level_state level[XFS_DA_NODE_MAXDEPTH];
24 struct blkmap *blkmap;
25} da_bt_cursor_t;
26
27int
28namecheck(
29 char *name,
45571fd5
ES
30 int length,
31 bool isadir);
360f4a2e
ES
32
33struct xfs_buf *
34da_read_buf(
35 xfs_mount_t *mp,
36 int nex,
37 bmap_ext_t *bmp,
38 const struct xfs_buf_ops *ops);
39
40void
41release_da_cursor(
42 xfs_mount_t *mp,
43 da_bt_cursor_t *cursor,
44 int prev_level);
45
46void
47err_release_da_cursor(
48 xfs_mount_t *mp,
49 da_bt_cursor_t *cursor,
50 int prev_level);
51
52int
53traverse_int_dablock(
54 xfs_mount_t *mp,
55 da_bt_cursor_t *da_cursor,
56 xfs_dablk_t *rbno,
57 int whichfork);
58
59int
60verify_da_path(
61 xfs_mount_t *mp,
62 da_bt_cursor_t *cursor,
63 const int p_level,
64 int whichfork);
65
66int
67verify_final_da_path(
68 xfs_mount_t *mp,
69 da_bt_cursor_t *cursor,
5cd3b070
ES
70 const int p_level,
71 int whichfork);
360f4a2e 72#endif /* _XR_DA_UTIL_H */