File: tempfile.h

package info (click to toggle)
linux 6.18.14-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,742,508 kB
  • sloc: ansic: 26,787,389; asm: 272,134; sh: 148,804; python: 79,243; makefile: 57,755; perl: 36,527; xml: 19,542; cpp: 5,913; yacc: 4,939; lex: 2,950; awk: 1,607; sed: 30; ruby: 25
file content (51 lines) | stat: -rw-r--r-- 1,752 bytes parent folder | download | duplicates (17)
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Copyright (c) 2021-2024 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);

int xrep_tempfile_adjust_directory_tree(struct xfs_scrub *sc);

bool xrep_tempfile_iolock_nowait(struct xfs_scrub *sc);
int xrep_tempfile_iolock_polled(struct xfs_scrub *sc);
void xrep_tempfile_iounlock(struct xfs_scrub *sc);

void xrep_tempfile_ilock(struct xfs_scrub *sc);
bool xrep_tempfile_ilock_nowait(struct xfs_scrub *sc);
void xrep_tempfile_iunlock(struct xfs_scrub *sc);
void xrep_tempfile_iunlock_both(struct xfs_scrub *sc);
void xrep_tempfile_ilock_both(struct xfs_scrub *sc);

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

enum xfs_blft;

typedef int (*xrep_tempfile_copyin_fn)(struct xfs_scrub *sc,
		struct xfs_buf *bp, void *data);

int xrep_tempfile_copyin(struct xfs_scrub *sc, xfs_fileoff_t off,
		xfs_filblks_t len, xrep_tempfile_copyin_fn fn, void *data);

int xrep_tempfile_set_isize(struct xfs_scrub *sc, unsigned long long isize);

int xrep_tempfile_roll_trans(struct xfs_scrub *sc);
void xrep_tempfile_copyout_local(struct xfs_scrub *sc, int whichfork);
bool xrep_is_tempfile(const struct xfs_inode *ip);
#else
static inline void xrep_tempfile_iolock_both(struct xfs_scrub *sc)
{
	xchk_ilock(sc, XFS_IOLOCK_EXCL);
}
# define xrep_is_tempfile(ip)		(false)
# define xrep_tempfile_adjust_directory_tree(sc)	(0)
# define xrep_tempfile_rele(sc)
#endif /* CONFIG_XFS_ONLINE_REPAIR */

#endif /* __XFS_SCRUB_TEMPFILE_H__ */