52 lines
916 B
C
52 lines
916 B
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
#include <kernel/common.h>
|
|
|
|
#include <fs/vfs.h>
|
|
|
|
#include <lib/string.h>
|
|
|
|
#include "inode.h"
|
|
|
|
static struct fs_driver fat32_driver = {0};
|
|
|
|
static int alloc_inode(fs_t *fs, u64 mode, inode_t **out)
|
|
{
|
|
return -ENOSYS;
|
|
}
|
|
|
|
static int free_inode(fs_t *fs, inode_t *inode)
|
|
{
|
|
return -ENOSYS;
|
|
}
|
|
|
|
static int open_inode(fs_t *fs, u64 id, dirent_t *dirent, inode_t **out)
|
|
{
|
|
return -ENOSYS;
|
|
}
|
|
|
|
static int fs_init(int flags, struct block_device *bdev, fs_t **out)
|
|
{
|
|
fs_t *fs = kalloc(sizeof(fs_t), ALLOC_KERN);
|
|
if (!fs)
|
|
return -ENOMEM;
|
|
*out = fs;
|
|
|
|
fs->fs_ops.alloc_inode = alloc_inode;
|
|
fs->fs_ops.free_inode = free_inode;
|
|
fs->fs_ops.open_inode = open_inode;
|
|
|
|
return 0;
|
|
}
|
|
|
|
static int fs_deinit(fs_t *fs)
|
|
{
|
|
return -EINVAL;
|
|
}
|
|
|
|
void fat32_init()
|
|
{
|
|
strcpy(fat32_driver.name, "fat32");
|
|
fat32_driver.init = fs_init;
|
|
fat32_driver.deinit = fs_deinit;
|
|
}
|
|
DRIVER_ENTRY(fat32_init);
|