]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - scrub/filemap.h
xfs_scrub: fix reporting of EINVAL for online repairs
[thirdparty/xfsprogs-dev.git] / scrub / filemap.h
1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3 * Copyright (C) 2018 Oracle. All Rights Reserved.
4 * Author: Darrick J. Wong <darrick.wong@oracle.com>
5 */
6 #ifndef XFS_SCRUB_FILEMAP_H_
7 #define XFS_SCRUB_FILEMAP_H_
8
9 /* inode fork block mapping */
10 struct file_bmap {
11 uint64_t bm_offset; /* file offset of segment in bytes */
12 uint64_t bm_physical; /* physical starting byte */
13 uint64_t bm_length; /* length of segment, bytes */
14 uint32_t bm_flags; /* output flags */
15 };
16
17 /*
18 * Visit each inode fork mapping. Return 0 to continue iteration or a positive
19 * error code to stop iterating and return to the caller.
20 */
21 typedef int (*scrub_bmap_iter_fn)(struct scrub_ctx *ctx, int fd, int whichfork,
22 struct fsxattr *fsx, struct file_bmap *bmap, void *arg);
23
24 int scrub_iterate_filemaps(struct scrub_ctx *ctx, int fd, int whichfork,
25 struct file_bmap *key, scrub_bmap_iter_fn fn, void *arg);
26
27 #endif /* XFS_SCRUB_FILEMAP_H_ */