Wrap filesystem op in macros
All checks were successful
Build documentation / build-and-deploy (push) Successful in 2m32s

This commit is contained in:
2026-03-15 14:50:13 +01:00
parent cd5604da43
commit d7bfc5c8fd
5 changed files with 85 additions and 93 deletions

45
kernel/fs/def_vfs_op.h Normal file
View File

@@ -0,0 +1,45 @@
#ifndef _KERNEL_FS_DEF_VFS_OP_H
#define _KERNEL_FS_DEF_VFS_OP_H
#include <aux/compiler.h>
#define DEFINE_VFS_MOUNT(name) \
int name (struct vfs_volume* UNUSED volume, struct proc* UNUSED proc, \
struct reschedule_ctx* UNUSED rctx, bool UNUSED format)
#define DEFINE_VFS_FORMAT(name) \
int name (struct vfs_volume* UNUSED volume, struct proc* UNUSED proc, \
struct reschedule_ctx* UNUSED rctx)
#define DEFINE_VFS_DESCRIBE(name) \
int name (struct vfs_volume* UNUSED volume, struct proc* UNUSED proc, \
struct reschedule_ctx* UNUSED rctx, const char* UNUSED path, struct desc* UNUSED desc)
#define DEFINE_VFS_READ_FILE(name) \
int name (struct vfs_volume* UNUSED volume, struct proc* UNUSED proc, \
struct reschedule_ctx* UNUSED rctx, const char* UNUSED path, uint8_t* UNUSED buffer, \
size_t UNUSED off, size_t UNUSED size)
#define DEFINE_VFS_WRITE_FILE(name) \
int name (struct vfs_volume* UNUSED volume, struct proc* UNUSED proc, \
struct reschedule_ctx* UNUSED rctx, const char* UNUSED path, uint8_t* UNUSED buffer, \
size_t UNUSED off, size_t UNUSED size, uint32_t UNUSED flags)
#define DEFINE_VFS_READ_DIR_ENTRY(name) \
int name (struct vfs_volume* UNUSED volume, struct proc* UNUSED proc, \
struct reschedule_ctx* UNUSED rctx, const char* UNUSED path, \
struct dir_entry* UNUSED entry, size_t UNUSED entry_num)
#define DEFINE_VFS_CREATE_FILE(name) \
int name (struct vfs_volume* UNUSED volume, struct proc* UNUSED proc, \
struct reschedule_ctx* UNUSED rctx, const char* UNUSED path)
#define DEFINE_VFS_CREATE_DIR(name) \
int name (struct vfs_volume* UNUSED volume, struct proc* UNUSED proc, \
struct reschedule_ctx* UNUSED rctx, const char* UNUSED path)
#define DEFINE_VFS_REMOVE(name) \
int name (struct vfs_volume* UNUSED volume, struct proc* UNUSED proc, \
struct reschedule_ctx* UNUSED rctx, const char* UNUSED path)
#endif // _KERNEL_FS_DEF_VFS_OP_H