Skip to content

Commit 02ec2d4

Browse files
jmichalski-antfkokosinski
authored andcommitted
fs: implement zephyr fs api for virtiofs
This commit implements zephyr filesystem operations for virtiofs Signed-off-by: Jakub Michalski <[email protected]> Signed-off-by: Filip Kokosinski <[email protected]>
1 parent e5631e9 commit 02ec2d4

File tree

4 files changed

+681
-0
lines changed

4 files changed

+681
-0
lines changed

include/zephyr/fs/fs.h

+3
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ enum {
6161
/** Identifier for in-tree Ext2 file system. */
6262
FS_EXT2,
6363

64+
/** Identifier for in-tree Virtiofs file system. */
65+
FS_VIRTIOFS,
66+
6467
/** Base identifier for external file systems. */
6568
FS_TYPE_EXTERNAL_BASE,
6669
};

include/zephyr/fs/fs_interface.h

+4
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ extern "C" {
5050
#define MAX_FILE_NAME 255
5151
#endif
5252

53+
#if !defined(MAX_FILE_NAME) && defined(CONFIG_FILE_SYSTEM_VIRTIOFS)
54+
#define MAX_FILE_NAME 255
55+
#endif
56+
5357
#if !defined(MAX_FILE_NAME) /* filesystem selection */
5458
/* Use standard 8.3 when no filesystem is explicitly selected */
5559
#define MAX_FILE_NAME 12

include/zephyr/fs/virtiofs.h

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*
2+
* Copyright (c) 2025 Antmicro <www.antmicro.com>
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#ifndef ZEPHYR_INCLUDE_FS_VIRTIOFS_H_
8+
#define ZEPHYR_INCLUDE_FS_VIRTIOFS_H_
9+
10+
#include <stdint.h>
11+
12+
struct virtiofs_fs_data {
13+
uint32_t max_write;
14+
};
15+
16+
#endif /* ZEPHYR_INCLUDE_FS_VIRTIOFS_H_ */

0 commit comments

Comments
 (0)