]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blame - scrub/filemap.h
xfs_scrub: fix author and spdx headers on scrub/ files
[thirdparty/xfsprogs-dev.git] / scrub / filemap.h
CommitLineData
8d318d62 1// SPDX-License-Identifier: GPL-2.0-or-later
c6eb0ff2
DW
2/*
3 * Copyright (C) 2018 Oracle. All Rights Reserved.
8d318d62 4 * Author: Darrick J. Wong <djwong@kernel.org>
c6eb0ff2
DW
5 */
6#ifndef XFS_SCRUB_FILEMAP_H_
7#define XFS_SCRUB_FILEMAP_H_
8
9/* inode fork block mapping */
73ce9669 10struct file_bmap {
c6eb0ff2
DW
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
aeff0641 17/*
73ce9669
DW
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.
aeff0641 20 */
73ce9669
DW
21typedef int (*scrub_bmap_iter_fn)(struct scrub_ctx *ctx, int fd, int whichfork,
22 struct fsxattr *fsx, struct file_bmap *bmap, void *arg);
c6eb0ff2 23
73ce9669
DW
24int scrub_iterate_filemaps(struct scrub_ctx *ctx, int fd, int whichfork,
25 struct file_bmap *key, scrub_bmap_iter_fn fn, void *arg);
c6eb0ff2
DW
26
27#endif /* XFS_SCRUB_FILEMAP_H_ */