Unify VFS status codes and normal system status codes
All checks were successful
Build documentation / build-and-deploy (push) Successful in 24s
All checks were successful
Build documentation / build-and-deploy (push) Successful in 24s
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include <libk/string.h>
|
||||
#include <limine/requests.h>
|
||||
#include <m/fs_desc_buffer.h>
|
||||
#include <m/status.h>
|
||||
|
||||
struct ramdisk_tar_header {
|
||||
char filename[100];
|
||||
@@ -102,17 +103,17 @@ int ramdiskfs_describe (struct vfs_mountpoint* mountpoint, const char* path,
|
||||
const char* filename = path_basename (path);
|
||||
|
||||
if (filename == NULL)
|
||||
return -VFS_BAD_PATH;
|
||||
return -ST_BAD_PATH;
|
||||
|
||||
struct ramdisk_tar_file* file = ramdisk_get_file (filename);
|
||||
|
||||
if (file == NULL)
|
||||
return -VFS_NOT_FOUND;
|
||||
return -ST_NOT_FOUND;
|
||||
|
||||
desc->size = file->size;
|
||||
desc->type = FS_FILE;
|
||||
|
||||
return VFS_OK;
|
||||
return ST_OK;
|
||||
}
|
||||
|
||||
int ramdiskfs_read (struct vfs_mountpoint* mountpoint, const char* path, uint8_t* buffer,
|
||||
@@ -122,17 +123,17 @@ int ramdiskfs_read (struct vfs_mountpoint* mountpoint, const char* path, uint8_t
|
||||
const char* filename = path_basename (path);
|
||||
|
||||
if (filename == NULL)
|
||||
return -VFS_BAD_PATH;
|
||||
return -ST_BAD_PATH;
|
||||
|
||||
struct ramdisk_tar_file* file = ramdisk_get_file (filename);
|
||||
|
||||
if (file == NULL)
|
||||
return -VFS_NOT_FOUND;
|
||||
return -ST_NOT_FOUND;
|
||||
|
||||
if (off + size > file->size)
|
||||
return -VFS_OOB_ERROR;
|
||||
return -ST_OOB_ERROR;
|
||||
|
||||
memcpy (buffer, (void*)((uintptr_t)file->content + off), size);
|
||||
|
||||
return VFS_OK;
|
||||
return ST_OK;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user