-
Notifications
You must be signed in to change notification settings - Fork 0
/
apfs_buf.h
39 lines (32 loc) · 906 Bytes
/
apfs_buf.h
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
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2022 Su Yue <[email protected]>
* All Rights Reserved.
*/
#ifndef __APFS_BUF_H__
#define __APFS_BUF_H__
#include <linux/types.h>
#include <linux/completion.h>
#define ABF_READ 0
#define ABF_WRITE 1
struct apfs_fs_info;
struct apfs_buf {
struct apfs_fs_info *fs_info;
struct page **pages;
unsigned int page_count;
int io_errors;
atomic_t io_remaining;
u64 bno; /* block number for I/O */
size_t len; /* size of I/O */
u32 offset;
int error;
int op;
struct completion io_wait; /* queue for I/O waiters */
};
void apfs_buf_free(struct apfs_buf *bp);
struct apfs_buf *apfs_buf_alloc(void);
int apfs_buf_alloc_pages(struct apfs_buf *bp, u32 flags);
int apfs_buf_submit(struct apfs_buf *bp, bool wait);
void apfs_buf_init(struct apfs_fs_info *fs_info, struct apfs_buf *bp, int op,
u64 bytenr, size_t size);
#endif /* __APFS_BUF_H__ */