162306a36Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0+
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * Copyright (C) 2017 Oracle.  All Rights Reserved.
462306a36Sopenharmony_ci * Author: Darrick J. Wong <darrick.wong@oracle.com>
562306a36Sopenharmony_ci */
662306a36Sopenharmony_ci#ifndef __XFS_FSMAP_H__
762306a36Sopenharmony_ci#define __XFS_FSMAP_H__
862306a36Sopenharmony_ci
962306a36Sopenharmony_cistruct fsmap;
1062306a36Sopenharmony_ci
1162306a36Sopenharmony_ci/* internal fsmap representation */
1262306a36Sopenharmony_cistruct xfs_fsmap {
1362306a36Sopenharmony_ci	dev_t		fmr_device;	/* device id */
1462306a36Sopenharmony_ci	uint32_t	fmr_flags;	/* mapping flags */
1562306a36Sopenharmony_ci	uint64_t	fmr_physical;	/* device offset of segment */
1662306a36Sopenharmony_ci	uint64_t	fmr_owner;	/* owner id */
1762306a36Sopenharmony_ci	xfs_fileoff_t	fmr_offset;	/* file offset of segment */
1862306a36Sopenharmony_ci	xfs_filblks_t	fmr_length;	/* length of segment, blocks */
1962306a36Sopenharmony_ci};
2062306a36Sopenharmony_ci
2162306a36Sopenharmony_cistruct xfs_fsmap_head {
2262306a36Sopenharmony_ci	uint32_t	fmh_iflags;	/* control flags */
2362306a36Sopenharmony_ci	uint32_t	fmh_oflags;	/* output flags */
2462306a36Sopenharmony_ci	unsigned int	fmh_count;	/* # of entries in array incl. input */
2562306a36Sopenharmony_ci	unsigned int	fmh_entries;	/* # of entries filled in (output). */
2662306a36Sopenharmony_ci
2762306a36Sopenharmony_ci	struct xfs_fsmap fmh_keys[2];	/* low and high keys */
2862306a36Sopenharmony_ci};
2962306a36Sopenharmony_ci
3062306a36Sopenharmony_civoid xfs_fsmap_to_internal(struct xfs_fsmap *dest, struct fsmap *src);
3162306a36Sopenharmony_ci
3262306a36Sopenharmony_ciint xfs_getfsmap(struct xfs_mount *mp, struct xfs_fsmap_head *head,
3362306a36Sopenharmony_ci		struct fsmap *out_recs);
3462306a36Sopenharmony_ci
3562306a36Sopenharmony_ci#endif /* __XFS_FSMAP_H__ */
36