VFS can now reschedule the calling process
All checks were successful
Build documentation / build-and-deploy (push) Successful in 2m48s

This commit is contained in:
2026-03-11 19:07:22 +01:00
parent e765855309
commit 04b7355a3d
10 changed files with 196 additions and 120 deletions

View File

@@ -27,26 +27,32 @@ struct vfs_volume {
bool locked;
struct proc_suspension_q sq;
struct {
int (*mount) (struct vfs_volume* volume, bool format);
int (*mount) (struct vfs_volume* volume, struct proc* proc, struct reschedule_ctx* rctx,
bool format);
int (*format) (struct vfs_volume* volume);
int (*format) (struct vfs_volume* volume, struct proc* proc, struct reschedule_ctx* rctx);
int (*describe) (struct vfs_volume* volume, const char* path, struct desc* desc);
int (*describe) (struct vfs_volume* volume, struct proc* proc, struct reschedule_ctx* rctx,
const char* path, struct desc* desc);
int (*read_file) (struct vfs_volume* volume, const char* path, uint8_t* buffer, size_t off,
size_t size);
int (*read_file) (struct vfs_volume* volume, struct proc* proc, struct reschedule_ctx* rctx,
const char* path, uint8_t* buffer, size_t off, size_t size);
int (*write_file) (struct vfs_volume* volume, const char* path, uint8_t* buffer, size_t off,
size_t size, uint32_t flags);
int (*write_file) (struct vfs_volume* volume, struct proc* proc, struct reschedule_ctx* rctx,
const char* path, uint8_t* buffer, size_t off, size_t size, uint32_t flags);
int (*read_dir_entry) (struct vfs_volume* volume, const char* path, struct dir_entry* entry,
int (*read_dir_entry) (struct vfs_volume* volume, struct proc* proc,
struct reschedule_ctx* rctx, const char* path, struct dir_entry* entry,
size_t entry_num);
int (*create_file) (struct vfs_volume* volume, const char* path);
int (*create_file) (struct vfs_volume* volume, struct proc* proc, struct reschedule_ctx* rctx,
const char* path);
int (*create_dir) (struct vfs_volume* volume, const char* path);
int (*create_dir) (struct vfs_volume* volume, struct proc* proc, struct reschedule_ctx* rctx,
const char* path);
int (*remove) (struct vfs_volume* volume, const char* path);
int (*remove) (struct vfs_volume* volume, struct proc* proc, struct reschedule_ctx* rctx,
const char* path);
} driver_ops;
struct device* back_device;
void* udata
@@ -57,30 +63,35 @@ struct vfs_volume_table {
spin_lock_t lock;
};
int vfs_create_volume (const char* key, int fs_type, struct device* back_device, bool format);
int vfs_create_volume (struct proc* proc, struct reschedule_ctx* rctx, const char* key, int fs_type,
struct device* back_device, bool format);
int vfs_volume_open (struct proc* proc, const char* volume, struct reschedule_ctx* rctx);
int vfs_volume_close (struct proc* proc, const char* volume, struct reschedule_ctx* rctx);
int vfs_format (struct proc* proc, const char* volume_name);
int vfs_format (struct proc* proc, struct reschedule_ctx* rctx, const char* volume_name);
int vfs_read_file (struct proc* proc, const char* volume, const char* path, uint8_t* buffer,
size_t off, size_t size);
int vfs_read_file (struct proc* proc, struct reschedule_ctx* rctx, const char* volume,
const char* path, uint8_t* buffer, size_t off, size_t size);
int vfs_write_file (struct proc* proc, const char* volume, const char* path, uint8_t* buffer,
size_t off, size_t size, uint32_t flags);
int vfs_write_file (struct proc* proc, struct reschedule_ctx* rctx, const char* volume,
const char* path, uint8_t* buffer, size_t off, size_t size, uint32_t flags);
int vfs_describe (struct proc* proc, const char* volume, const char* path, struct desc* desc);
int vfs_describe (struct proc* proc, struct reschedule_ctx* rctx, const char* volume,
const char* path, struct desc* desc);
int vfs_read_dir_entry (struct proc* proc, const char* volume, const char* path,
struct dir_entry* entry, size_t entry_num);
int vfs_read_dir_entry (struct proc* proc, struct reschedule_ctx* rctx, const char* volume,
const char* path, struct dir_entry* entry, size_t entry_num);
int vfs_create_file (struct proc* proc, const char* volume_name, const char* path);
int vfs_create_file (struct proc* proc, struct reschedule_ctx* rctx, const char* volume_name,
const char* path);
int vfs_create_dir (struct proc* proc, const char* volume_name, const char* path);
int vfs_create_dir (struct proc* proc, struct reschedule_ctx* rctx, const char* volume_name,
const char* path);
int vfs_remove (struct proc* proc, const char* volume_name, const char* path);
int vfs_remove (struct proc* proc, struct reschedule_ctx* rctx, const char* volume_name,
const char* path);
void vfs_init (void);