Commit 73fe1ee
[nrf fromlist] zms: Initial support for 64 bit IDs
Upstream PR #: 94330
Allow the ZMS API to optionally accept 64 bit IDs. A typedef `zms_id_t`
is added, so that the maximum ID width can be controlled using Kconfig.
The current ATE structure is already large enough that it is possible to
reserve 64 bits for IDs without increasing its total size (128 bits).
This makes the feature a natural, low footprint alternative to Settings,
for cases where the supported key namespace must be larger than 32 bit
but not arbitrarily large.
The ATE format does have to be altered to accommodate larger IDs, but
the default "32 bit" format is left as is. Now, the `struct zms_ate`
describes one of two supported formats, selected based on an `#ifdef`.
In the future, it may be possible to support multiple ATE formats at
runtime, in which case the structure can be turned into a union.
In the new, "64 bit" ATEs, the `offset` and `metadata` fields are moved
into a union, because they are found to be mutually exclusive. With the
old format, the same fields are in different locations, but one of them
always gets filled with a dummy value, depending on the given ATE type.
To cover both cases, use a `memset` which the compiler can optimize away
when appropriate.
The only limitation is that the new ATE format has no room for data CRC,
but an alternative integrity check can be implemented by the caller.
Signed-off-by: Grzegorz Swiderski <[email protected]>
(cherry picked from commit 11e2cd69f89595f6eaafc74a75a78121532b8885)1 parent 4e47102 commit 73fe1ee
File tree
4 files changed
+94
-31
lines changed- include/zephyr/fs
- subsys/fs/zms
4 files changed
+94
-31
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
80 | 91 | | |
81 | 92 | | |
82 | 93 | | |
| |||
127 | 138 | | |
128 | 139 | | |
129 | 140 | | |
130 | | - | |
| 141 | + | |
131 | 142 | | |
132 | 143 | | |
133 | 144 | | |
| |||
140 | 151 | | |
141 | 152 | | |
142 | 153 | | |
143 | | - | |
| 154 | + | |
144 | 155 | | |
145 | 156 | | |
146 | 157 | | |
| |||
158 | 169 | | |
159 | 170 | | |
160 | 171 | | |
161 | | - | |
| 172 | + | |
162 | 173 | | |
163 | 174 | | |
164 | 175 | | |
| |||
178 | 189 | | |
179 | 190 | | |
180 | 191 | | |
181 | | - | |
| 192 | + | |
182 | 193 | | |
183 | 194 | | |
184 | 195 | | |
| |||
193 | 204 | | |
194 | 205 | | |
195 | 206 | | |
196 | | - | |
| 207 | + | |
197 | 208 | | |
198 | 209 | | |
199 | 210 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
18 | 27 | | |
19 | 28 | | |
20 | 29 | | |
| |||
33 | 42 | | |
34 | 43 | | |
35 | 44 | | |
| 45 | + | |
36 | 46 | | |
37 | 47 | | |
38 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | | - | |
35 | | - | |
36 | 34 | | |
37 | 35 | | |
38 | 36 | | |
| |||
52 | 50 | | |
53 | 51 | | |
54 | 52 | | |
| 53 | + | |
55 | 54 | | |
56 | 55 | | |
57 | 56 | | |
58 | 57 | | |
59 | 58 | | |
60 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
61 | 69 | | |
62 | 70 | | |
| 71 | + | |
| 72 | + | |
63 | 73 | | |
64 | 74 | | |
65 | 75 | | |
| |||
239 | 249 | | |
240 | 250 | | |
241 | 251 | | |
242 | | - | |
| 252 | + | |
243 | 253 | | |
244 | 254 | | |
245 | 255 | | |
| |||
487 | 497 | | |
488 | 498 | | |
489 | 499 | | |
490 | | - | |
| 500 | + | |
491 | 501 | | |
492 | 502 | | |
493 | 503 | | |
| |||
500 | 510 | | |
501 | 511 | | |
502 | 512 | | |
503 | | - | |
| 513 | + | |
504 | 514 | | |
505 | 515 | | |
506 | 516 | | |
| |||
536 | 546 | | |
537 | 547 | | |
538 | 548 | | |
539 | | - | |
| 549 | + | |
540 | 550 | | |
541 | 551 | | |
542 | 552 | | |
| |||
549 | 559 | | |
550 | 560 | | |
551 | 561 | | |
552 | | - | |
553 | | - | |
554 | | - | |
555 | | - | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
556 | 566 | | |
557 | 567 | | |
558 | | - | |
| 568 | + | |
559 | 569 | | |
560 | 570 | | |
561 | 571 | | |
| |||
688 | 698 | | |
689 | 699 | | |
690 | 700 | | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
691 | 704 | | |
692 | 705 | | |
693 | 706 | | |
694 | | - | |
695 | 707 | | |
696 | 708 | | |
697 | 709 | | |
| |||
740 | 752 | | |
741 | 753 | | |
742 | 754 | | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
743 | 758 | | |
744 | 759 | | |
745 | 760 | | |
746 | 761 | | |
747 | | - | |
748 | 762 | | |
749 | 763 | | |
750 | 764 | | |
| |||
793 | 807 | | |
794 | 808 | | |
795 | 809 | | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
796 | 813 | | |
797 | 814 | | |
798 | 815 | | |
799 | 816 | | |
800 | 817 | | |
801 | | - | |
802 | 818 | | |
803 | 819 | | |
804 | 820 | | |
| |||
893 | 909 | | |
894 | 910 | | |
895 | 911 | | |
896 | | - | |
| 912 | + | |
897 | 913 | | |
898 | 914 | | |
899 | 915 | | |
| |||
1044 | 1060 | | |
1045 | 1061 | | |
1046 | 1062 | | |
1047 | | - | |
| 1063 | + | |
1048 | 1064 | | |
1049 | 1065 | | |
1050 | | - | |
| 1066 | + | |
1051 | 1067 | | |
1052 | 1068 | | |
1053 | 1069 | | |
| |||
1458 | 1474 | | |
1459 | 1475 | | |
1460 | 1476 | | |
1461 | | - | |
| 1477 | + | |
1462 | 1478 | | |
1463 | 1479 | | |
1464 | 1480 | | |
| |||
1598 | 1614 | | |
1599 | 1615 | | |
1600 | 1616 | | |
1601 | | - | |
| 1617 | + | |
1602 | 1618 | | |
1603 | 1619 | | |
1604 | 1620 | | |
1605 | 1621 | | |
1606 | | - | |
| 1622 | + | |
1607 | 1623 | | |
1608 | 1624 | | |
1609 | 1625 | | |
| |||
1700 | 1716 | | |
1701 | 1717 | | |
1702 | 1718 | | |
1703 | | - | |
| 1719 | + | |
1704 | 1720 | | |
1705 | 1721 | | |
1706 | 1722 | | |
| |||
1713 | 1729 | | |
1714 | 1730 | | |
1715 | 1731 | | |
1716 | | - | |
| 1732 | + | |
1717 | 1733 | | |
1718 | 1734 | | |
1719 | 1735 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | 31 | | |
33 | 32 | | |
34 | 33 | | |
35 | 34 | | |
36 | | - | |
37 | 35 | | |
38 | 36 | | |
39 | 37 | | |
40 | 38 | | |
41 | 39 | | |
42 | | - | |
43 | 40 | | |
44 | 41 | | |
45 | 42 | | |
46 | 43 | | |
| 44 | + | |
| 45 | + | |
47 | 46 | | |
48 | 47 | | |
49 | 48 | | |
| |||
52 | 51 | | |
53 | 52 | | |
54 | 53 | | |
| 54 | + | |
| 55 | + | |
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
| |||
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
78 | 92 | | |
79 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
80 | 106 | | |
0 commit comments