diff options
author | Darrick J. Wong <djwong@kernel.org> | 2021-09-01 11:25:38 -0700 |
---|---|---|
committer | Darrick J. Wong <djwong@kernel.org> | 2021-12-15 17:29:29 -0800 |
commit | a4fbafd73ae38184176b024b0eb2d36b3061d239 (patch) | |
tree | d4565a4e6c406ea18d95c1174e614454417e6cd6 /fs/xfs/xfs_fsrefs.h | |
parent | bb8092d02d822601113897de29384972342ed1e8 (diff) |
xfs: export reference count information to userspacereport-refcounts_2021-12-15
Export refcount info to userspace so we can prototype a sharing-aware
defrag/fs rearranging tool.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Diffstat (limited to 'fs/xfs/xfs_fsrefs.h')
-rw-r--r-- | fs/xfs/xfs_fsrefs.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/fs/xfs/xfs_fsrefs.h b/fs/xfs/xfs_fsrefs.h new file mode 100644 index 000000000000..66728755f74a --- /dev/null +++ b/fs/xfs/xfs_fsrefs.h @@ -0,0 +1,34 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2021 Oracle. All Rights Reserved. + * Author: Darrick J. Wong <djwong@kernel.org> + */ +#ifndef __XFS_FSREFS_H__ +#define __XFS_FSREFS_H__ + +struct fsrefs; + +/* internal fsrefs representation */ +struct xfs_fsrefs { + dev_t fcr_device; /* device id */ + uint32_t fcr_flags; /* mapping flags */ + uint64_t fcr_physical; /* device offset of segment */ + uint64_t fcr_owners; /* number of owners */ + xfs_filblks_t fcr_length; /* length of segment, blocks */ +}; + +struct xfs_fsrefs_head { + uint32_t fch_iflags; /* control flags */ + uint32_t fch_oflags; /* output flags */ + unsigned int fch_count; /* # of entries in array incl. input */ + unsigned int fch_entries; /* # of entries filled in (output). */ + + struct xfs_fsrefs fch_keys[2]; /* low and high keys */ +}; + +void xfs_fsrefs_to_internal(struct xfs_fsrefs *dest, struct fsrefs *src); + +int xfs_getfsrefs(struct xfs_mount *mp, struct xfs_fsrefs_head *head, + struct fsrefs *out_recs); + +#endif /* __XFS_FSREFS_H__ */ |