frosted icon indicating copy to clipboard operation
frosted copied to clipboard

Find a way to reduce # of fnodes when mounting filesystems

Open danielinux opened this issue 9 years ago • 5 comments

When a filesystem is mounted, frosted scans the whol content and creates fnodes accordingly.

Perhaps the fnodes should only be allocated during lookup (fno_search), or when opendir/readdir is called, in order to decrease the number of active fnodes, and the memory required.

danielinux avatar Aug 06 '16 09:08 danielinux

@danielinux @brabo what do you think? the problem here is obvious... any feedback on how to get around this? what does readdir_r() call behind the curtain?

acardace avatar Aug 26 '17 23:08 acardace

https://github.com/insane-adding-machines/frosted/blob/master/kernel/vfs.c#L641

danielinux avatar Aug 26 '17 23:08 danielinux

and opendir does call fno_search, so before readdir the loading has happened unless I am missing something.

brabo avatar Aug 27 '17 19:08 brabo

opendir() just does fno_search on the directory file, it doesn't look for the files inside the directory, that's why it doesn't work just like this.

acardace avatar Aug 30 '17 18:08 acardace

if lookup is called with a directory it would populate that on FS level. i am not sure i see any problem. the thing i wonder is though, if opendir is called on say '/mnt/sub1/sub2/sub3/sub4', what exactly do we want/need to cache from lookup? that whole tree and their contents?

brabo avatar Aug 30 '17 19:08 brabo