summaryrefslogtreecommitdiff
path: root/src/kernel/vfs/backend.h
blob: bf16ee73513c4f4d97beb84b0553a845f9327c71 (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
#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_backend_finish(struct vfs_op_request *, int ret);