Remove conversions between VfsStat struct and IoctlStat struct

This commit is contained in:
2025-10-03 19:55:14 +02:00
parent 443cf0e4ff
commit c30d2d2ea6
6 changed files with 11 additions and 28 deletions

View File

@ -72,7 +72,7 @@ int32_t littlefs_vobj_write(struct VfsObj *vobj, const uint8_t *const buffer, si
return E_OK;
}
int32_t littlefs_stat(struct VfsMountPoint *vmp, const char *path, struct VfsStat *statbuf) {
int32_t littlefs_stat(struct VfsMountPoint *vmp, const char *path, IoctlStat *statbuf) {
struct lfs_info info;
spinlock_acquire(&vmp->spinlock);
@ -84,10 +84,10 @@ int32_t littlefs_stat(struct VfsMountPoint *vmp, const char *path, struct VfsSta
}
if (info.type == LFS_TYPE_REG) {
statbuf->type = VFS_TYPE_FILE;
statbuf->type = IOCTLSTAT_FILE;
statbuf->size = info.size;
} else if (info.type == LFS_TYPE_DIR) {
statbuf->type = VFS_TYPE_DIR;
statbuf->type = IOCTLSTAT_DIR;
statbuf->size = 0;
// TODO: find a better way than this... !!!
lfs_dir_t dir;

View File

@ -9,7 +9,6 @@
#define LITTLEFS_BLOCK_SIZE 4096
struct VfsMountPoint;
struct VfsStat;
struct VfsObj;
typedef struct {
@ -18,7 +17,7 @@ typedef struct {
int32_t littlefs_cleanup(struct VfsMountPoint *vmp);
struct VfsObj *littlefs_open(struct VfsMountPoint *vmp, const char *path, uint32_t flags);
int32_t littlefs_stat(struct VfsMountPoint *vmp, const char *path, struct VfsStat *statbuf);
int32_t littlefs_stat(struct VfsMountPoint *vmp, const char *path, IoctlStat *statbuf);
int32_t littlefs_fetchdirent(struct VfsMountPoint *vmp, const char *path, IoctlDirent *direntbuf, size_t idx);
int portlfs_read(const struct lfs_config *c, lfs_block_t block, lfs_off_t off, void *buffer, lfs_size_t size);