-
Notifications
You must be signed in to change notification settings - Fork 25
subsys: fs: bm_zms: remove global callbacks array #485
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
a5c5d6f to
95aaac4
Compare
|
You can find the documentation preview for this PR here. |
27aa479 to
564795f
Compare
564795f to
aa2458f
Compare
Removes global callbacks array and replaces with callback member inside `struct bm_zms_fs`. This fixes a bug where registering multiple callbacks on the same `struct bm_zms_fs` would update the user reference number incrementally and saturate the global callbacks array. When calling `bm_zms_clear`, this would only reset to NULL the last callback set, leaving the rest still set. This update makes it so that there can only be one callback per each `struct bm_zms_fs` instance, mirroring the behavior of other libraries. Due to this change, also removes the `BM_ZMS_MAX_USERS` Kconfig option. Signed-off-by: Mirko Covizzi <[email protected]>
Cleans up Doxygen. Signed-off-by: Mirko Covizzi <[email protected]>
aa2458f to
67d1e18
Compare
|
@MirkoCovizzi I do not understand this bug. |
|
I suppose that's one way to fix it. It does however add one limitation, which is that only the owner of an instance can receive callbacks from it, thus forcing a single owner for each instance. In practice, it is no longer possible to share a partition, every instance would need its own. But it may be fine, first, because there a no events that are relevant for the whole application (like GC was). And second, because the application could still be designed in a way that allows to share a partition, by wrapping NVM operations. |
Removes global callbacks array and replaces with callback
member inside
struct bm_zms_fs.This fixes a bug where registering multiple callbacks on
the same
struct bm_zms_fswould update the user referencenumber incrementally and saturate the global callbacks array.
When calling
bm_zms_clear, this would only reset to NULLthe last callback set, leaving the rest still set.
This update makes it so that there can only be one callback
per each
struct bm_zms_fsinstance, mirroring the behaviorof other libraries.
Due to this change, also removes the
BM_ZMS_MAX_USERSKconfig option.