Home
last modified time | relevance | path

Searched full:fs (Results 1 – 25 of 407) sorted by relevance

12345678910>>...17

/Zephyr-latest/subsys/fs/nvs/
Dnvs.c12 #include <zephyr/fs/nvs.h>
19 static int nvs_prev_ate(struct nvs_fs *fs, uint32_t *addr, struct nvs_ate *ate);
20 static int nvs_ate_valid(struct nvs_fs *fs, const struct nvs_ate *entry);
39 static int nvs_lookup_cache_rebuild(struct nvs_fs *fs) in nvs_lookup_cache_rebuild() argument
46 memset(fs->lookup_cache, 0xff, sizeof(fs->lookup_cache)); in nvs_lookup_cache_rebuild()
47 addr = fs->ate_wra; in nvs_lookup_cache_rebuild()
52 rc = nvs_prev_ate(fs, &addr, &ate); in nvs_lookup_cache_rebuild()
58 cache_entry = &fs->lookup_cache[nvs_lookup_cache_pos(ate.id)]; in nvs_lookup_cache_rebuild()
61 nvs_ate_valid(fs, &ate)) { in nvs_lookup_cache_rebuild()
65 if (addr == fs->ate_wra) { in nvs_lookup_cache_rebuild()
[all …]
/Zephyr-latest/subsys/fs/zms/
Dzms.c11 #include <zephyr/fs/zms.h>
18 static int zms_prev_ate(struct zms_fs *fs, uint64_t *addr, struct zms_ate *ate);
19 static int zms_ate_valid(struct zms_fs *fs, const struct zms_ate *entry);
20 static int zms_get_sector_cycle(struct zms_fs *fs, uint64_t addr, uint8_t *cycle_cnt);
21 static int zms_get_sector_header(struct zms_fs *fs, uint64_t addr, struct zms_ate *empty_ate,
23 static int zms_ate_valid_different_sector(struct zms_fs *fs, const struct zms_ate *entry,
43 static int zms_lookup_cache_rebuild(struct zms_fs *fs) in zms_lookup_cache_rebuild() argument
53 memset(fs->lookup_cache, 0xff, sizeof(fs->lookup_cache)); in zms_lookup_cache_rebuild()
54 addr = fs->ate_wra; in zms_lookup_cache_rebuild()
59 rc = zms_prev_ate(fs, &addr, &ate); in zms_lookup_cache_rebuild()
[all …]
/Zephyr-latest/subsys/fs/ext2/
Dext2_diskops.c9 #include <zephyr/fs/fs.h>
25 static int get_level_offsets(struct ext2_data *fs, uint32_t block, uint32_t offsets[4]);
26 static inline uint32_t get_ngroups(struct ext2_data *fs);
201 int ext2_fetch_superblock(struct ext2_data *fs) in ext2_fetch_superblock() argument
206 if (fs->block_size == 1024) { in ext2_fetch_superblock()
208 b = ext2_get_block(fs, 1); in ext2_fetch_superblock()
211 b = ext2_get_block(fs, 0); in ext2_fetch_superblock()
220 fill_sblock(&fs->sblock, disk_sb); in ext2_fetch_superblock()
226 static inline uint32_t get_ngroups(struct ext2_data *fs) in get_ngroups() argument
229 fs->sblock.s_blocks_count / fs->sblock.s_blocks_per_group; in get_ngroups()
[all …]
Dext2_ops.c9 #include <zephyr/fs/fs.h>
10 #include <zephyr/fs/fs_sys.h>
11 #include <zephyr/fs/ext2.h>
29 struct ext2_data *fs = filp->mp->fs_data; in ext2_open() local
31 if (fs->open_files >= CONFIG_MAX_FILES) { in ext2_open()
54 rc = ext2_lookup_inode(fs, &args); in ext2_open()
72 rc = ext2_inode_get(fs, 0, &new_inode); in ext2_open()
244 struct ext2_data *fs = mountp->fs_data; in ext2_mkdir() local
255 rc = ext2_lookup_inode(fs, &args); in ext2_mkdir()
271 rc = ext2_inode_get(fs, 0, &found_inode); in ext2_mkdir()
[all …]
Dext2_disk_access.c22 static int64_t disk_access_device_size(struct ext2_data *fs) in disk_access_device_size() argument
24 struct disk_data *disk = fs->backend; in disk_access_device_size()
29 static int64_t disk_access_write_size(struct ext2_data *fs) in disk_access_write_size() argument
31 struct disk_data *disk = fs->backend; in disk_access_write_size()
89 static int disk_access_read_block(struct ext2_data *fs, void *buf, uint32_t block) in disk_access_read_block() argument
92 struct disk_data *disk = fs->backend; in disk_access_read_block()
95 rc = disk_prepare_range(disk, block * fs->block_size, fs->block_size, in disk_access_read_block()
103 static int disk_access_write_block(struct ext2_data *fs, const void *buf, uint32_t block) in disk_access_write_block() argument
106 struct disk_data *disk = fs->backend; in disk_access_write_block()
109 rc = disk_prepare_range(disk, block * fs->block_size, fs->block_size, in disk_access_write_block()
[all …]
Dext2_diskops.h14 /** @brief Fetch superblock into buffer in fs structure.
19 int ext2_fetch_superblock(struct ext2_data *fs);
24 * @param fs File system data
31 int ext2_fetch_inode(struct ext2_data *fs, uint32_t ino, struct ext2_inode *inode);
45 * @brief Fetch block group into buffer in fs structure.
49 * @param fs File system data
55 int ext2_fetch_block_group(struct ext2_data *fs, uint32_t group);
101 * @param fs File system data
107 int ext2_clear_inode(struct ext2_data *fs, uint32_t ino);
141 * @param fs File system data struct
[all …]
Dext2_impl.c9 #include <zephyr/fs/fs.h>
39 void error_behavior(struct ext2_data *fs, const char *msg) in error_behavior() argument
49 switch (fs->sblock.s_errors) { in error_behavior()
55 fs->flags |= EXT2_DATA_FLAGS_RO; in error_behavior()
89 struct ext2_block *ext2_get_block(struct ext2_data *fs, uint32_t block) in ext2_get_block() argument
99 ret = fs->backend_ops->read_block(fs, b->data, block); in ext2_get_block()
108 struct ext2_block *ext2_get_empty_block(struct ext2_data *fs) in ext2_get_empty_block() argument
117 memset(b->data, 0, fs->block_size); in ext2_get_empty_block()
121 int ext2_write_block(struct ext2_data *fs, struct ext2_block *b) in ext2_write_block() argument
129 ret = fs->backend_ops->write_block(fs, b->data, b->num); in ext2_write_block()
[all …]
Dext2_impl.h10 #include <zephyr/fs/fs.h>
11 #include <zephyr/fs/ext2.h>
17 void error_behavior(struct ext2_data *fs, const char *msg);
24 int ext2_init_disk_access_backend(struct ext2_data *fs, const void *storage_dev, int flags);
29 struct ext2_block *ext2_get_block(struct ext2_data *fs, uint32_t block);
31 struct ext2_block *ext2_get_empty_block(struct ext2_data *fs);
42 * (fs::sync function).
44 int ext2_write_block(struct ext2_data *fs, struct ext2_block *b);
46 void ext2_init_blocks_slab(struct ext2_data *fs);
52 * (fs::sync function).
[all …]
/Zephyr-latest/tests/subsys/fs/zms/src/
Dmain.c23 #include <zephyr/fs/zms.h>
39 struct zms_fs fs; member
56 fixture.fs.offset = TEST_ZMS_AREA_OFFSET; in setup()
57 err = flash_get_page_info_by_offs(flash_area_get_device(fa), fixture.fs.offset, &info); in setup()
60 fixture.fs.sector_size = info.size; in setup()
61 fixture.fs.sector_count = TEST_SECTOR_COUNT; in setup()
62 fixture.fs.flash_device = flash_area_get_device(fa); in setup()
87 if (fixture->fs.ready) { in after()
90 err = zms_clear(&fixture->fs); in after()
94 fixture->fs.sector_count = TEST_SECTOR_COUNT; in after()
[all …]
/Zephyr-latest/tests/subsys/fs/nvs/src/
Dmain.c24 #include <zephyr/fs/nvs.h>
41 struct nvs_fs fs; member
58 fixture.fs.offset = TEST_NVS_FLASH_AREA_OFFSET; in setup()
59 err = flash_get_page_info_by_offs(flash_area_get_device(fa), fixture.fs.offset, in setup()
63 fixture.fs.sector_size = info.size; in setup()
64 fixture.fs.sector_count = TEST_SECTOR_COUNT; in setup()
65 fixture.fs.flash_device = flash_area_get_device(fa); in setup()
90 if (fixture->fs.ready) { in after()
93 err = nvs_clear(&fixture->fs); in after()
97 fixture->fs.sector_count = TEST_SECTOR_COUNT; in after()
[all …]
/Zephyr-latest/subsys/net/l2/ieee802154/
Dieee802154_frame.c26 #define dbg_print_fs(fs) \ argument
27 NET_DBG("fs(1): %u/%u/%u/%u/%u/%u", fs->fc.frame_type, fs->fc.security_enabled, \
28 fs->fc.frame_pending, fs->fc.ar, fs->fc.pan_id_comp, fs->fc.reserved); \
29 NET_DBG("fs(2): %u/%u/%u/%u/%u - %u", fs->fc.seq_num_suppr, fs->fc.ie_list, \
30 fs->fc.dst_addr_mode, fs->fc.frame_version, fs->fc.src_addr_mode, fs->sequence)
43 struct ieee802154_fcf_seq *fs = (struct ieee802154_fcf_seq *)buf; in ieee802154_validate_fc_seq() local
45 dbg_print_fs(fs); in ieee802154_validate_fc_seq()
48 if (fs->fc.frame_type == IEEE802154_FRAME_TYPE_RESERVED || in ieee802154_validate_fc_seq()
49 fs->fc.frame_version >= IEEE802154_VERSION_RESERVED) { in ieee802154_validate_fc_seq()
53 if (fs->fc.frame_type == IEEE802154_FRAME_TYPE_MULTIPURPOSE) { in ieee802154_validate_fc_seq()
[all …]
/Zephyr-latest/subsys/fs/
Dlittlefs_fs.c13 #include <zephyr/fs/fs.h>
14 #include <zephyr/fs/fs_sys.h>
20 #include <zephyr/fs/littlefs.h>
91 static inline void fs_lock(struct fs_littlefs *fs) in fs_lock() argument
93 k_mutex_lock(&fs->mutex, K_FOREVER); in fs_lock()
96 static inline void fs_unlock(struct fs_littlefs *fs) in fs_unlock() argument
98 k_mutex_unlock(&fs->mutex); in fs_unlock()
292 struct fs_littlefs *fs = fp->mp->fs_data; in littlefs_open() local
293 struct lfs *lfs = &fs->lfs; in littlefs_open()
314 fs_lock(fs); in littlefs_open()
[all …]
Dfs.c15 #include <zephyr/fs/fs.h>
16 #include <zephyr/fs/fs_sys.h>
22 LOG_MODULE_REGISTER(fs);
160 CHECKIF(mp->fs->open == NULL) { in fs_open()
170 CHECKIF(mp->fs->truncate == NULL) { in fs_open()
178 rc = mp->fs->open(zfp, file_name, flags); in fs_open()
190 rc = mp->fs->truncate(zfp, 0); in fs_open()
209 CHECKIF(zfp->mp->fs->close == NULL) { in fs_close()
213 rc = zfp->mp->fs->close(zfp); in fs_close()
232 CHECKIF(zfp->mp->fs->read == NULL) { in fs_read()
[all …]
DCMakeLists.txt4 zephyr_interface_library_named(FS)
9 zephyr_library_sources(fs.c fs_impl.c)
21 zephyr_library_link_libraries(FS)
23 target_link_libraries_ifdef(CONFIG_FAT_FILESYSTEM_ELM FS INTERFACE ELMFAT)
24 target_link_libraries_ifdef(CONFIG_FILE_SYSTEM_LITTLEFS FS INTERFACE LITTLEFS)
25 target_link_libraries_ifdef(CONFIG_FILE_SYSTEM_EXT2 FS INTERFACE EXT2)
/Zephyr-latest/samples/subsys/fs/zms/src/
Dmain.c16 #include <zephyr/fs/zms.h>
18 static struct zms_fs fs; variable
32 static int delete_and_verify_items(struct zms_fs *fs, uint32_t id) in delete_and_verify_items() argument
36 rc = zms_delete(fs, id); in delete_and_verify_items()
40 rc = zms_get_data_length(fs, id); in delete_and_verify_items()
54 static int delete_basic_items(struct zms_fs *fs) in delete_basic_items() argument
58 rc = delete_and_verify_items(fs, IP_ADDRESS_ID); in delete_basic_items()
63 rc = delete_and_verify_items(fs, KEY_VALUE_ID); in delete_basic_items()
68 rc = delete_and_verify_items(fs, CNT_ID); in delete_basic_items()
73 rc = delete_and_verify_items(fs, LONG_DATA_ID); in delete_basic_items()
[all …]
/Zephyr-latest/dts/bindings/sensor/
Dst,stm32-qdec.yaml60 1: Fs = F_clk, N=2
61 2: Fs = F_clk, N=4
62 3: Fs = F_clk, N=8
63 4: Fs = F_clk/2, N=6
64 5: Fs = F_clk/2, N=8
65 6: Fs = F_clk/4, N=6
66 7: Fs = F_clk/4, N=8
67 8: Fs = F_clk/8, N=6
68 9: Fs = F_clk/8, N=8
69 10: Fs = F_clk/16, N=5
[all …]
/Zephyr-latest/tests/subsys/fs/fat_fs_api/src/
Dtest_fat_rd_only_mount.c19 struct fs_file_t fs; in test_prepare() local
21 fs_file_t_init(&fs); in test_prepare()
23 zassert_equal(fs_open(&fs, FATFS_MNTP"/testfile.txt", FS_O_CREATE), in test_prepare()
25 zassert_equal(fs_close(&fs), 0); in test_prepare()
36 struct fs_file_t fs; in test_ops_on_rd() local
39 fs_file_t_init(&fs); in test_ops_on_rd()
40 /* Check fs operation on volume mounted with FS_MOUNT_FLAG_READ_ONLY */ in test_ops_on_rd()
47 ret = fs_open(&fs, FATFS_MNTP"/nosome", FS_O_CREATE); in test_ops_on_rd()
55 ret = fs_open(&fs, FATFS_MNTP"/testfile.txt", FS_O_RDWR); in test_ops_on_rd()
57 ret = fs_open(&fs, FATFS_MNTP"/testfile.txt", FS_O_READ); in test_ops_on_rd()
[all …]
/Zephyr-latest/tests/posix/fs/
Dtestcase.yaml20 portability.posix.fs: {}
21 portability.posix.fs.minimal:
24 portability.posix.fs.newlib:
28 portability.posix.fs.tls:
33 portability.posix.fs.tls.newlib:
39 portability.posix.fs.picolibc:
44 portability.posix.fs.tls.picolibc:
/Zephyr-latest/tests/subsys/fs/common/
Dtest_fs_mount_flags.c10 #include <zephyr/fs/fs.h>
19 struct fs_file_t fs; in test_fs_mount_flags() local
22 fs_file_t_init(&fs); in test_fs_mount_flags()
42 ret = fs_open(&fs, "/sml/some", FS_O_CREATE); in test_fs_mount_flags()
44 fs_close(&fs); in test_fs_mount_flags()
52 /* Check fs operation on volume mounted with FS_MOUNT_FLAG_READ_ONLY */ in test_fs_mount_flags()
59 ret = fs_open(&fs, "/sml/nosome", FS_O_CREATE); in test_fs_mount_flags()
67 ret = fs_open(&fs, "/sml/other", FS_O_CREATE); in test_fs_mount_flags()
69 ret = fs_open(&fs, "/sml/some", FS_O_RDWR); in test_fs_mount_flags()
71 ret = fs_open(&fs, "/sml/some", FS_O_READ); in test_fs_mount_flags()
[all …]
/Zephyr-latest/tests/subsys/fs/fs_api/src/
Dtest_fs_mount_flags.c21 struct fs_file_t fs; in test_mount_flags() local
23 fs_file_t_init(&fs); in test_mount_flags()
31 ret = fs_open(&fs, TEST_FS_MNTP"/some", FS_O_CREATE); in test_mount_flags()
34 ret = fs_close(&fs); in test_mount_flags()
42 /* Check fs operation on volume mounted with FS_MOUNT_FLAG_READ_ONLY */ in test_mount_flags()
49 ret = fs_open(&fs, TEST_FS_MNTP"/nosome", FS_O_CREATE); in test_mount_flags()
57 ret = fs_open(&fs, TEST_FS_MNTP"/other", FS_O_CREATE); in test_mount_flags()
59 ret = fs_open(&fs, TEST_FS_MNTP"/some", FS_O_RDWR); in test_mount_flags()
61 ret = fs_open(&fs, TEST_FS_MNTP"/some", FS_O_READ); in test_mount_flags()
63 ret = fs_close(&fs); in test_mount_flags()
/Zephyr-latest/include/zephyr/fs/
Dzms.h80 * @brief Mount a ZMS file system onto the device specified in `fs`.
82 * @param fs Pointer to the file system.
86 int zms_mount(struct zms_fs *fs);
91 * @param fs Pointer to the file system.
95 int zms_clear(struct zms_fs *fs);
104 * @param fs Pointer to the file system.
114 ssize_t zms_write(struct zms_fs *fs, uint32_t id, const void *data, size_t len);
119 * @param fs Pointer to the file system.
124 int zms_delete(struct zms_fs *fs, uint32_t id);
129 * @param fs Pointer to the file system.
[all …]
Dnvs.h79 * @brief Mount an NVS file system onto the flash device specified in @p fs.
81 * @param fs Pointer to file system
85 int nvs_mount(struct nvs_fs *fs);
90 * @param fs Pointer to file system
94 int nvs_clear(struct nvs_fs *fs);
104 * @param fs Pointer to file system
113 ssize_t nvs_write(struct nvs_fs *fs, uint16_t id, const void *data, size_t len);
118 * @param fs Pointer to file system
123 int nvs_delete(struct nvs_fs *fs, uint16_t id);
128 * @param fs Pointer to file system
[all …]
/Zephyr-latest/tests/subsys/settings/file/src/
Dsettings_test_save_one_file.c30 zassert_true(rc == 0, "can't register FS as configuration source"); in ZTEST()
34 "can't register FS as configuration destination"); in ZTEST()
38 zassert_true(rc == 0, "fs write error"); in ZTEST()
41 zassert_equal(rc, 0, "fs one item write error"); in ZTEST()
44 zassert_true(rc == 0, "fs redout error"); in ZTEST()
48 zassert_true(rc == 0, "fs one item write error"); in ZTEST()
51 zassert_true(rc == 0, "fs redout error"); in ZTEST()
/Zephyr-latest/samples/subsys/nvs/src/
Dmain.c47 #include <zephyr/fs/nvs.h>
49 static struct nvs_fs fs; variable
81 fs.flash_device = NVS_PARTITION_DEVICE; in main()
82 if (!device_is_ready(fs.flash_device)) { in main()
83 printk("Flash device %s is not ready\n", fs.flash_device->name); in main()
86 fs.offset = NVS_PARTITION_OFFSET; in main()
87 rc = flash_get_page_info_by_offs(fs.flash_device, fs.offset, &info); in main()
92 fs.sector_size = info.size; in main()
93 fs.sector_count = 3U; in main()
95 rc = nvs_mount(&fs); in main()
[all …]
/Zephyr-latest/samples/subsys/shell/fs/
DREADME.rst1 .. zephyr:code-sample:: shell-fs
26 :zephyr-app: samples/subsys/shell/fs
58 :zephyr-app: samples/subsys/shell/fs
68 :zephyr-app: samples/subsys/shell/fs
80 :zephyr-app: samples/subsys/shell/fs
97 All file system related commands are available as sub-commands of fs.
103 fs mount littlefs /lfs
148 fs mount (littlefs|fat) <path>
157 fs ls [path]
166 fs cd [path]
[all …]

12345678910>>...17