mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-28 06:34:12 +08:00
56596d8bff
Create some new routines to exchange the contents of a temporary file created to stage a repair with another ondisk file. This will be used by the realtime summary repair function to commit atomically the new rtsummary data, which will be staged in the tempfile. The rest of XFS coordinates access to the realtime metadata inodes solely through the ILOCK. For repair to hold its exclusive access to the realtime summary file, it has to allocate a single large transaction and roll it repeatedly throughout the repair while holding the ILOCK. In turn, this means that for now there's only a partial file mapping exchange implementation for the temporary file because we can only work within an existing transaction. For now, the only tempswap functions needed here are to estimate the resource requirements of the exchange, reserve more space/quota to an existing transaction, and kick off the actual exchange. The rest will be added in a later patch in preparation for repairing xattrs and directories. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de>
22 lines
612 B
C
22 lines
612 B
C
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
/*
|
|
* Copyright (c) 2022-2024 Oracle. All Rights Reserved.
|
|
* Author: Darrick J. Wong <djwong@kernel.org>
|
|
*/
|
|
#ifndef __XFS_SCRUB_TEMPEXCH_H__
|
|
#define __XFS_SCRUB_TEMPEXCH_H__
|
|
|
|
#ifdef CONFIG_XFS_ONLINE_REPAIR
|
|
struct xrep_tempexch {
|
|
struct xfs_exchmaps_req req;
|
|
};
|
|
|
|
int xrep_tempexch_enable(struct xfs_scrub *sc);
|
|
int xrep_tempexch_trans_reserve(struct xfs_scrub *sc, int whichfork,
|
|
struct xrep_tempexch *ti);
|
|
|
|
int xrep_tempexch_contents(struct xfs_scrub *sc, struct xrep_tempexch *ti);
|
|
#endif /* CONFIG_XFS_ONLINE_REPAIR */
|
|
|
|
#endif /* __XFS_SCRUB_TEMPEXCH_H__ */
|