xref: /aosp_15_r20/external/ltp/include/tst_mkfs.h (revision 49cdfc7efb34551c7342be41a7384b9c40d7cab7)
1*49cdfc7eSAndroid Build Coastguard Worker /* SPDX-License-Identifier: GPL-2.0-or-later
2*49cdfc7eSAndroid Build Coastguard Worker  * Copyright (c) 2016 Cyril Hrubis <[email protected]>
3*49cdfc7eSAndroid Build Coastguard Worker  */
4*49cdfc7eSAndroid Build Coastguard Worker 
5*49cdfc7eSAndroid Build Coastguard Worker #ifndef TST_MKFS_H__
6*49cdfc7eSAndroid Build Coastguard Worker #define TST_MKFS_H__
7*49cdfc7eSAndroid Build Coastguard Worker 
8*49cdfc7eSAndroid Build Coastguard Worker /*
9*49cdfc7eSAndroid Build Coastguard Worker  * @dev: path to a device
10*49cdfc7eSAndroid Build Coastguard Worker  * @fs_type: filesystem type
11*49cdfc7eSAndroid Build Coastguard Worker  * @fs_opts: NULL or NULL terminated array of extra mkfs options
12*49cdfc7eSAndroid Build Coastguard Worker  * @extra_opts: NULL or NULL terminated array of extra mkfs options which are
13*49cdfc7eSAndroid Build Coastguard Worker  * passed after the device name.
14*49cdfc7eSAndroid Build Coastguard Worker  */
15*49cdfc7eSAndroid Build Coastguard Worker void tst_mkfs_(const char *file, const int lineno, void (cleanup_fn)(void),
16*49cdfc7eSAndroid Build Coastguard Worker 	       const char *dev, const char *fs_type,
17*49cdfc7eSAndroid Build Coastguard Worker 	       const char *const fs_opts[], const char *const extra_opts[]);
18*49cdfc7eSAndroid Build Coastguard Worker 
19*49cdfc7eSAndroid Build Coastguard Worker #define SAFE_MKFS(device, fs_type, fs_opts, extra_opts) \
20*49cdfc7eSAndroid Build Coastguard Worker 	tst_mkfs_(__FILE__, __LINE__, NULL, device, fs_type, \
21*49cdfc7eSAndroid Build Coastguard Worker 		  fs_opts, extra_opts)
22*49cdfc7eSAndroid Build Coastguard Worker 
23*49cdfc7eSAndroid Build Coastguard Worker #endif	/* TST_MKFS_H__ */
24