embox
1/**
2* @file
3* @details Read-only filesystem with direct address space mapping.
4*
5* @date 7 May 2015
6* @author Anton Bondarev
7* - initial implementation
8* @author Nikolay Korotky
9* - rework using vfs
10* @author Eldar Abusalimov
11* - rework mount to use cpio_parse_entry
12* @author Denis Deryugin
13* - port from old VFS
14*
15* @note Initfs is based on CPIO archive format. By design, this format
16* has no directory abstraction, as all files are stored with full
17* path names. Because of this it could be tricky to handle some
18* VFS calls.
19*/
20
21#include <fs/inode.h>22#include <fs/inode_operation.h>23#include <fs/fs_driver.h>24
25extern struct inode *initfs_lookup(struct inode *node, char const *name, struct inode const *dir);26
27extern struct super_block_operations initfs_sbops;28extern int initfs_create(struct inode *i_new, struct inode *i_dir, int mode);29extern int initfs_iterate(struct inode *next, char *name, struct inode *parent, struct dir_ctx *ctx);30
31struct inode_operations initfs_iops = {32.ino_create = initfs_create,33.ino_lookup = initfs_lookup,34.ino_iterate = initfs_iterate,35};36
37extern int initfs_fill_sb(struct super_block *sb, const char *source);38
39static const struct fs_driver initfs_driver = {40.name = "initfs",41.fill_sb = initfs_fill_sb,42};43
44DECLARE_FILE_SYSTEM_DRIVER(initfs_driver);45