Lines Matching +full:2 +full:fs
16 #include <zephyr/fs/zms.h>
18 static struct zms_fs fs; variable
26 #define CNT_ID 2
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()
101 fs.flash_device = ZMS_PARTITION_DEVICE; in main()
102 if (!device_is_ready(fs.flash_device)) { in main()
103 printk("Storage device %s is not ready\n", fs.flash_device->name); in main()
106 fs.offset = ZMS_PARTITION_OFFSET; in main()
107 rc = flash_get_page_info_by_offs(fs.flash_device, fs.offset, &info); in main()
112 fs.sector_size = info.size; in main()
113 fs.sector_count = 3U; in main()
116 rc = zms_mount(&fs); in main()
127 rc = zms_read(&fs, IP_ADDRESS_ID, &buf, sizeof(buf)); in main()
136 rc = zms_write(&fs, IP_ADDRESS_ID, &buf, strlen(buf)); in main()
145 rc = zms_read(&fs, KEY_VALUE_ID, &key, sizeof(key)); in main()
155 rc = zms_write(&fs, KEY_VALUE_ID, &key, sizeof(key)); in main()
164 rc = zms_read(&fs, CNT_ID, &i_cnt, sizeof(i_cnt)); in main()
172 rc = zms_write(&fs, CNT_ID, &i, sizeof(i)); in main()
181 rc = zms_read(&fs, LONG_DATA_ID, &longarray, sizeof(longarray)); in main()
192 rc = zms_write(&fs, LONG_DATA_ID, &longarray, sizeof(longarray)); in main()
200 rc = delete_basic_items(&fs); in main()
214 rc = zms_write(&fs, id, &id, sizeof(uint32_t)); in main()
223 free_space = zms_calc_free_space(&fs); in main()
236 rc = delete_and_verify_items(&fs, n); in main()
242 rc = delete_basic_items(&fs); in main()
253 for (i = 0; i < fs.sector_count; i++) { in main()
254 rc = zms_sector_use_next(&fs); in main()
259 free_space = zms_calc_free_space(&fs); in main()
267 rc = zms_clear(&fs); in main()