embox

Форк
0
/
initfs_drv.c 
44 строки · 1.4 Кб
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

25
extern struct inode *initfs_lookup(struct inode *node, char const *name, struct inode const *dir);
26

27
extern struct super_block_operations initfs_sbops;
28
extern int initfs_create(struct inode *i_new, struct inode *i_dir, int mode);
29
extern int initfs_iterate(struct inode *next, char *name, struct inode *parent, struct dir_ctx *ctx);
30

31
struct inode_operations initfs_iops = {
32
	.ino_create   = initfs_create,
33
	.ino_lookup   = initfs_lookup,
34
	.ino_iterate  = initfs_iterate,
35
};
36

37
extern int initfs_fill_sb(struct super_block *sb, const char *source);
38

39
static const struct fs_driver initfs_driver = {
40
	.name      = "initfs",
41
	.fill_sb   = initfs_fill_sb,
42
};
43

44
DECLARE_FILE_SYSTEM_DRIVER(initfs_driver);
45

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.