Re: [AVFS] Caching content of extfs archives
Miklos Szeredi <[email protected]> Wed, 22 Feb 2006 10:33:40 +0100
| Newsgroups | gmane.comp.file-systems.avfs.user |
|---|---|
| Message-ID | <[email protected]> |
> > So you basically want to unify 'cache' and 'filecache'? That makes > > sense, since the current interface is quite difficult to use. > > I have thought about it the last days and tested several implementations > but finally decided against building it on top of filecache like in > filter.c. > In filter.c the cobj remains in the "filecache" forever no matter what > the "cache" does so there's no cyclic dependency. But if you want to > remove it from the "filecache" when it's not in the "cache" anymore (and > not used by any open file) then it's a nightmare to maintain. You are right. I realize now the caching interface is not very well designed. > One have to take care of the cyclic dependency and possible race > condition when inserting/removing it into/from the "cache" and the > "filecache". Having two entries in different data structures for > each temporary object is not very good too. > > Keeping everything in the cache it's a clearer solution although it > means some duplicate code. > > I attached a patch with a working solution. Basically the new interface > (currently called av_cache2_*) keeps the cacheobj internally and uses > the name for accessing it (just like the filecache). The extfs module > uses this interface to put an object in the cache. When there are no > open files anymore and the cache decided to remove it from the cache, > the temp file will be removed. > It works fine so far but I want to discuss it first before checking it in. Looks good. It makes lots of sense to unify these two interfaces. Thanks, Miklos ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642