Implement storedevs, prepare to port littlefs
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user