linux/fs/xfs/libxfs/xfs_exchmaps.h

/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
 * Copyright (c) 2020-2024 Oracle.  All Rights Reserved.
 * Author: Darrick J. Wong <[email protected]>
 */
#ifndef __XFS_EXCHMAPS_H__
#define __XFS_EXCHMAPS_H__

/* In-core deferred operation info about a file mapping exchange request. */
struct xfs_exchmaps_intent {};

/* Try to convert inode2 from block to short format at the end, if possible. */
#define __XFS_EXCHMAPS_INO2_SHORTFORM

#define XFS_EXCHMAPS_INTERNAL_FLAGS

/* flags that can be passed to xfs_exchmaps_{estimate,mappings} */
#define XFS_EXCHMAPS_PARAMS

static inline int
xfs_exchmaps_whichfork(const struct xfs_exchmaps_intent *xmi)
{}

/* Parameters for a mapping exchange request. */
struct xfs_exchmaps_req {};

static inline int
xfs_exchmaps_reqfork(const struct xfs_exchmaps_req *req)
{}

int xfs_exchmaps_estimate_overhead(struct xfs_exchmaps_req *req);
int xfs_exchmaps_estimate(struct xfs_exchmaps_req *req);

extern struct kmem_cache	*xfs_exchmaps_intent_cache;

int __init xfs_exchmaps_intent_init_cache(void);
void xfs_exchmaps_intent_destroy_cache(void);

struct xfs_exchmaps_intent *xfs_exchmaps_init_intent(
		const struct xfs_exchmaps_req *req);
void xfs_exchmaps_ensure_reflink(struct xfs_trans *tp,
		const struct xfs_exchmaps_intent *xmi);
void xfs_exchmaps_upgrade_extent_counts(struct xfs_trans *tp,
		const struct xfs_exchmaps_intent *xmi);

int xfs_exchmaps_finish_one(struct xfs_trans *tp,
		struct xfs_exchmaps_intent *xmi);

int xfs_exchmaps_check_forks(struct xfs_mount *mp,
		const struct xfs_exchmaps_req *req);

void xfs_exchange_mappings(struct xfs_trans *tp,
		const struct xfs_exchmaps_req *req);

#endif /* __XFS_EXCHMAPS_H__ */