Ticket #4411 (new defect)
datastore needs to limit number of files stored in each directory
| Reported by: | krstic | Owned by: | tomeu |
|---|---|---|---|
| Priority: | high | Milestone: | Future Release |
| Component: | sugar-datastore | Version: | |
| Keywords: | Cc: | krstic | |
| Action Needed: | Verified: | no | |
| Deployments affected: | Blocked By: | ||
| Blocking: |
Description (last modified by krstic) (diff)
Currently, the datastore puts all the binary objects associated with datastore entries in a single directory. The same happens with thumbnails.
Having too many files in a single directory isn't pretty on most filesystems, and JFFS2 is no exception. In fact, because of the semantics of deletion dirents on JFFS2, the datastore situation is doubly bad, since all the filenames for the binary objects have the same length as they're UUIDs.
The solution is to add a directory level, with directory names being the first two characters of the UUID. e.g. the file 397a8f20-ad13-42e0-ac5d-b3b5191ccdf2 should be stored in datastore/store/39/7a8f20-ad13-42e0-ac5d-b3b5191ccdf2. Thumbnails should work the same way.


