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