Skip to content

lfs_disk_entry #22

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

Closed
aldot opened this issue Jan 30, 2018 · 5 comments
Closed

lfs_disk_entry #22

aldot opened this issue Jan 30, 2018 · 5 comments

Comments

@aldot
Copy link
Contributor

aldot commented Jan 30, 2018

alen and elen seem to be a bit superfluous.
I'd fold them in some spare bits in type
or trim nlen (and thus LFS_NAME_MAX) to put them there.
Eventually.

@geky
Copy link
Member

geky commented Jan 30, 2018

Ah, these are good ideas. Though this turns into a tradeoff between storage-consumption and flexibility.

alen is reserved for potential future use. The original goal was to allow entries to have a section for custom attributes as an alternative to the fixed set of attributes you find in most filesystems (timestamps, permissions, etc). However, adding attributes would require significant changes to the driver, so I don't think they will be supported anytime soon.

elen is independent from the type so that new entry types could be added without breaking older versions of the driver. Though squishing elen down to fit in the type is a good idea.

One idea I do want to get to is storing files inline in dir entries. At the moment each file takes a minimum of one erase unit, which is usually 512B-4KB. For small files, say <256B, you could save a lot of overhead and erase cycles by storing the data in the dir entry. In this case you could use elen as the file size directly.

That's sort of what elen and alen were intended for. Flash memory is cheap, so my thinking is that it's better to leave room for future improvements. Thoughts?

@guillaumerems
Copy link

I confirm that alen is very useful, for example on my side I use attributes to store the modification data of an entry.

@geky
Copy link
Member

geky commented Jan 30, 2018

Oh! @guillaumerems, did you modify littlefs to get attributes working? Or was this on a different filesystem?

@guillaumerems
Copy link

I modified littlefs and it works very well ;) see the new issue I opened with the modification I made

@geky
Copy link
Member

geky commented Feb 4, 2018

I'm going to close this but feel free to reopen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants