]>
Commit | Line | Data |
---|---|---|
959ef981 | 1 | // SPDX-License-Identifier: GPL-2.0+ |
b364a9c0 DW |
2 | /* |
3 | * Copyright (C) 2018 Oracle. All Rights Reserved. | |
b364a9c0 | 4 | * Author: Darrick J. Wong <darrick.wong@oracle.com> |
b364a9c0 DW |
5 | */ |
6 | #ifndef XFS_SCRUB_VFS_H_ | |
7 | #define XFS_SCRUB_VFS_H_ | |
8 | ||
aeff0641 DW |
9 | /* |
10 | * Visit a subdirectory prior to iterating entries in that subdirectory. | |
f544ec31 DW |
11 | * Return 0 to continue iteration or a positive error code to stop iterating |
12 | * and return to the caller. | |
aeff0641 | 13 | */ |
f544ec31 | 14 | typedef int (*scan_fs_tree_dir_fn)(struct scrub_ctx *, const char *, |
b364a9c0 | 15 | int, void *); |
aeff0641 DW |
16 | |
17 | /* | |
f544ec31 DW |
18 | * Visit each directory entry in a directory. Return 0 to continue iteration |
19 | * or a positive error code to stop iterating and return to the caller. | |
aeff0641 | 20 | */ |
f544ec31 | 21 | typedef int (*scan_fs_tree_dirent_fn)(struct scrub_ctx *, const char *, |
b364a9c0 DW |
22 | int, struct dirent *, struct stat *, void *); |
23 | ||
f544ec31 | 24 | int scan_fs_tree(struct scrub_ctx *ctx, scan_fs_tree_dir_fn dir_fn, |
b364a9c0 DW |
25 | scan_fs_tree_dirent_fn dirent_fn, void *arg); |
26 | ||
7e36bc0f DW |
27 | void fstrim(struct scrub_ctx *ctx); |
28 | ||
b364a9c0 | 29 | #endif /* XFS_SCRUB_VFS_H_ */ |