blob: 52af5449989496de1138e180ac4fe775c18bd8a7 (
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
#pragma once
enum vfs_backend_type {
VFS_BACK_ROOT,
VFS_BACK_USER,
};
// describes something which can act as an access function
struct vfs_backend {
enum vfs_backend_type type;
// only used with VFS_BACK_USER
struct process *handler;
struct process *queue;
};
enum vfs_operation {
VFSOP_OPEN,
VFSOP_WRITE,
};
// describes an in-process vfs call
struct vfs_request {
enum vfs_operation type;
struct { // TODO maybe this should be a separate type
bool kern; // if false: use .buf ; if true: use .buf_kern
union {
char __user *buf;
char *buf_kern;
};
int len;
} input;
struct {
bool kern; // if false: use .buf ; if true: use .buf_kern
union {
char __user *buf;
char *buf_kern;
};
int len;
} output;
int id; // handle.file.id
struct process *caller;
struct vfs_backend *backend;
};
_Noreturn void vfs_request_create(struct vfs_request);
_Noreturn void vfs_request_pass2handler(struct vfs_request *);
_Noreturn void vfs_request_finish(struct vfs_request *, int ret);
|