fs_init: change to_mount to block_device
Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
parent
d2c698ac0a
commit
07ea385f96
8 changed files with 73 additions and 2 deletions
52
fs/fat32/fat32.c
Normal file
52
fs/fat32/fat32.c
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
/* 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);
|
||||
2
fs/fat32/inode.c
Normal file
2
fs/fat32/inode.c
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
7
fs/fat32/inode.h
Normal file
7
fs/fat32/inode.h
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
#ifndef _INODE_H_
|
||||
#define _INODE_H_
|
||||
|
||||
|
||||
|
||||
#endif /* _INODE_H_ */
|
||||
Loading…
Reference in a new issue