summaryrefslogtreecommitdiff
path: root/fs/xfs/scrub/tempfile.h
blob: 2b9a9e6fa9d97d3e30804f0b438000520bb13fc9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Copyright (C) 2021 Oracle.  All Rights Reserved.
 * Author: Darrick J. Wong <djwong@kernel.org>
 */
#ifndef __XFS_SCRUB_TEMPFILE_H__
#define __XFS_SCRUB_TEMPFILE_H__

#ifdef CONFIG_XFS_ONLINE_REPAIR
int xrep_tempfile_create(struct xfs_scrub *sc, uint16_t mode);
void xrep_tempfile_rele(struct xfs_scrub *sc);

void xrep_tempfile_ilock(struct xfs_scrub *sc, unsigned int ilock_flags);
bool xrep_tempfile_ilock_nowait(struct xfs_scrub *sc, unsigned int ilock_flags);
void xrep_tempfile_iunlock(struct xfs_scrub *sc, unsigned int ilock_flags);

int xrep_tempfile_prealloc(struct xfs_scrub *sc, xfs_fileoff_t off,
		xfs_filblks_t len);

enum xfs_blft;

int xrep_tempfile_copyin_xfile(struct xfs_scrub *sc,
		const struct xfs_buf_ops *ops, enum xfs_blft type,
		xfs_fileoff_t isize);

struct xfs_swapext_req;
int xrep_tempfile_swapext_prep_request(struct xfs_scrub *sc, int whichfork,
		struct xfs_swapext_req *req);
int xrep_tempfile_swapext(struct xfs_scrub *sc, struct xfs_swapext_req *req);
#else
# define xrep_tempfile_rele(sc)
#endif /* CONFIG_XFS_ONLINE_REPAIR */

#endif /* __XFS_SCRUB_TEMPFILE_H__ */