xref: /aosp_15_r20/external/f2fs-tools/fsck/inject.h (revision 59bfda1f02d633cd6b8b69f31eee485d40f6eef6)
1 /**
2  * inject.h
3  *
4  * Copyright (c) 2024 OPPO Mobile Comm Corp., Ltd.
5  *             http://www.oppo.com/
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License version 2 as
9  * published by the Free Software Foundation.
10  */
11 
12 #ifndef _INJECT_H_
13 #define _INJECT_H_
14 
15 #include <stdio.h>
16 #include <stdint.h>
17 #include <limits.h>
18 
19 #include "f2fs_fs.h"
20 #include "fsck.h"
21 
22 struct inject_option {
23 	const char *mb;		/* member name */
24 	unsigned int idx;	/* slot index */
25 	long long val;		/* new value */
26 	char *str;		/* new string */
27 	nid_t nid;
28 	block_t blk;
29 	int sb;			/* which sb */
30 	int cp;			/* which cp */
31 	int nat;		/* which nat pack */
32 	int sit;		/* which sit pack */
33 	bool ssa;
34 	bool node;
35 	bool dent;
36 };
37 
38 void inject_usage(void);
39 int inject_parse_options(int argc, char *argv[], struct inject_option *inject_opt);
40 int do_inject(struct f2fs_sb_info *sbi);
41 #endif
42