You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My English level is not good, in the process of reading source code, the shorthand of functions and variables caused me reading trouble. Do you have any plans to change or comment on the shorthand?
Functions have no comments and variable names have no explanation. As a result, I don't understand what the bd of bd_read means. I understand it as block device; The other is hint, which is even more confusing.This one is a prediction, right? Or threshold? Before looking at the code I understood it as the predicted size; Read the source code to understand as a threshold
The text was updated successfully, but these errors were encountered:
Hi @wdfk-prog, noted. There is a saying that naming things is one of the 3 hard problems in computer science.
It wouldn't hurt to add a glossary of terms, some of these don't even exist outside of littlefs (mdir, gstate, etc). Having one document with descriptions of everything is a good idea.
As for specifically hint, I think you might have been more correct with your first guess?
When you do a read with a cache, you can either read strictly the amount that fills the buffer, or read as much as possible in case of future read requests. Combining multiple reads into one reduces the number of bus transactions and can improve throughput, but if we read data that goes unused we're just wasting bus cycles.
hint controls this by allowing upper layers to specify how much they plan to read. Though it is a only a heuristic may not match the actual read pattern.
lfs_dir_fetch, for example, uses the largest hint possible (block_size), because we don't know where an mdir's log ends until after we parse it.
example:
bd
of bd_read means. I understand it as block device; The other ishint
, which is even more confusing.This one is a prediction, right? Or threshold? Before looking at the code I understood it as the predicted size; Read the source code to understand as a thresholdThe text was updated successfully, but these errors were encountered: