Implement storedevs, prepare to port littlefs

This commit is contained in:
2025-08-16 12:34:36 +02:00
parent c936910199
commit 2b0566c56f
91 changed files with 54963 additions and 37 deletions

View File

@ -6,19 +6,24 @@
#include <stdbool.h>
#include "spinlock/spinlock.h"
#include "fs/kvfs/kvfs.h"
#include "storedev/storedev.h"
#define VFS_MOUNTPOINT_LABEL_MAX 128
#define VFS_MOUNTPOINTS_MAX 30
enum {
VFS_FATFS,
VFS_KVFS,
};
static const char *vfs_strings[] = {
"KVFS"
};
typedef struct VfsMountPoint {
bool taken;
uint8_t label[VFS_MOUNTPOINT_LABEL_MAX];
int32_t fstype;
StoreDev *backingsd;
int32_t (*read)(struct VfsMountPoint *vmp, const char *path, uint8_t *const buffer, size_t n, size_t off);
int32_t (*write)(struct VfsMountPoint *vmp, const char *path, const uint8_t *const buffer, size_t n, size_t off);