Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cfs: Store dentries in chunks of max 4k and read as needed
This changes the way a directory inode stores the dentry list. Instead of a list of all dentries followed by all the filenames we store a list of chunks, where each chunk is at most 4k of such dentries and names. Additionally we have a header in the beginning with the size and dentry count of all such chunks. On the reader side we don't read (and alloc) all the dentries with the inode, instead we read the blocks as needed, meaning we use a lot less memory per in-memory inode. We preload the chunk headers for typical size dirs (4 chunks max) as a cheap way to avoid having to re-read it. However for large dirs we read the table as needed. Since we don't read all dentries when creating the inode we now also use the st_nlink from the file rather than computing it from the dentries. Signed-off-by: Alexander Larsson <[email protected]>
- Loading branch information