summaryrefslogtreecommitdiff
path: root/src/kernel/vfs/backend.h
blob: bc0dc45f5499fc5a4a4c85c3ca6d3a82f7022906 (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
#pragma once
#include <shared/vfs.h>

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;
};

// describes an in-progress vfs call
struct vfs_op_request {
	struct vfs_op op;
	struct process *caller;
	struct vfs_backend *backend;
};


// these can switch processes
_Noreturn void vfs_backend_dispatch(struct vfs_backend *backend, struct vfs_op op);
_Noreturn void vfs_request_pass2handler(struct vfs_op_request *);
_Noreturn void vfs_backend_finish(struct vfs_op_request *, int ret);