]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blame - db/type.h
xfs_db: check should deal with cow staging extents correctly
[thirdparty/xfsprogs-dev.git] / db / type.h
CommitLineData
2bd0ea18 1/*
da23017d
NS
2 * Copyright (c) 2000-2001,2005 Silicon Graphics, Inc.
3 * All Rights Reserved.
dfc130f3 4 *
da23017d
NS
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
2bd0ea18 7 * published by the Free Software Foundation.
dfc130f3 8 *
da23017d
NS
9 * This program is distributed in the hope that it would be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
dfc130f3 13 *
da23017d
NS
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2bd0ea18
NS
17 */
18
19struct field;
20
21#define szof(x,y) sizeof(((x *)0)->y)
22#define szcount(x,y) (szof(x,y) / szof(x,y[0]))
23
24typedef enum typnm
25{
26 TYP_AGF, TYP_AGFL, TYP_AGI, TYP_ATTR, TYP_BMAPBTA,
9fb2cb27 27 TYP_BMAPBTD, TYP_BNOBT, TYP_CNTBT, TYP_RMAPBT, TYP_REFCBT, TYP_DATA,
2bd0ea18
NS
28 TYP_DIR2, TYP_DQBLK, TYP_INOBT, TYP_INODATA, TYP_INODE,
29 TYP_LOG, TYP_RTBITMAP, TYP_RTSUMMARY, TYP_SB, TYP_SYMLINK,
20f35ef4 30 TYP_TEXT, TYP_FINOBT, TYP_NONE
2bd0ea18
NS
31} typnm_t;
32
984af2e1 33#define DB_FUZZ 2
2bd0ea18
NS
34#define DB_WRITE 1
35#define DB_READ 0
36
37typedef void (*opfunc_t)(const struct field *fld, int argc, char **argv);
38typedef void (*pfunc_t)(int action, const struct field *fld, int argc, char **argv);
39
40typedef struct typ
41{
42 typnm_t typnm;
43 char *name;
44 pfunc_t pfunc;
45 const struct field *fields;
6fea8f83 46 const struct xfs_buf_ops *bops;
86769b32
DC
47 unsigned long crc_off;
48#define TYP_F_NO_CRC_OFF (-1UL)
89baf918
DW
49#define TYP_F_CRC_FUNC (-2UL)
50 void (*set_crc)(struct xfs_buf *);
2bd0ea18 51} typ_t;
c2907bd7 52extern const typ_t *typtab, *cur_typ;
2bd0ea18
NS
53
54extern void type_init(void);
c2907bd7 55extern void type_set_tab_crc(void);
061e316e 56extern void type_set_tab_spcrc(void);
2bd0ea18
NS
57extern void handle_block(int action, const struct field *fields, int argc,
58 char **argv);
59extern void handle_string(int action, const struct field *fields, int argc,
60 char **argv);
61extern void handle_struct(int action, const struct field *fields, int argc,
62 char **argv);
c6b24b3b
NS
63extern void handle_text(int action, const struct field *fields, int argc,
64 char **argv);