Patch for FileSystemAPIImpl and FSEntryCache

Project:JNode Core
Component:Code
Category:task
Priority:normal
Assigned:Unassigned
Status:closed
Description

Patch modified:

Class FileSystemAPIImpl
MEthod : list . All the entries fetched in this method are put in cache.
Method : getEntry . I've added an if that verifies if the entry doesn't exist in the directory.

Class FSEntryCache :
I've modified the implementation of the entries member . I've changed from HashMap to LinkedHashMap. Now the cache is limited to a fixed number. When an entry is put in the cache and if the size exceed the limit the oldest cache are deleted . This is important for non physical file system (ftp,nfs,etc) if they want to use this cache because otherwise the cache would grow to infinite in the following case:

1. I've have mounted a nfs file system to a server.
2. I've run a dir in the directory
3. All the entries are put in cache
4. Another user, from another computer, deletes one file
5. I've run another dir command . All the entries are overwritten in cache

But the entry for the deleted file will remain cache and it will not be deleted( even it is invalid) because no one will call method getEntry

This dynamic cache could be implemented in many ways. I've chosen the easiest way

Best regards
Andrei Dore

AttachmentSize
issues_882.42 KB

#1

Status:active» closed

It looks OK. Commited.

#2