summaryrefslogtreecommitdiff
path: root/fs/xfs/scrub/xfile.h
blob: f446e4f40d508f49a519cead7193b18a0e954484 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
 * Copyright (C) 2020 Oracle.  All Rights Reserved.
 * Author: Darrick J. Wong <darrick.wong@oracle.com>
 */
#ifndef __XFS_SCRUB_XFILE_H__
#define __XFS_SCRUB_XFILE_H__

struct xfile {
	struct file	*filp;
};

struct xfile *xfile_create(const char *description, loff_t size);
void xfile_destroy(struct xfile *xf);

int xfile_pread(struct xfile *xf, void *buf, size_t count, loff_t offset);
int xfile_pwrite(struct xfile *xf, void *buf, size_t count, loff_t offset);

void xfile_discard(struct xfile *xf, loff_t start, loff_t end);
loff_t xfile_seek_data(struct xfile *xf, loff_t pos);

#endif /* __XFS_SCRUB_XFILE_H__ */