move compressible_filetype out of find.c and apply those filters to open aswell when deciding on choosing compressor in fuse_open.
- modify compressible_filetype, it can't check size and such on new files in fuse_open.
- remember to check rsync's temporary filenames for example, to apply filters to those .bz2 files aswell.
remove find.c
remove lists.c (and or replace 99% of it, keep the ignorelist part, but we dont need lock on it, set it up on init and let it be read only after that)
direct_open should not clean from database compressor is unset even if accesses = 0
if accesses = 0
if (!compressor && not in ignore list) {
entry->accessess++; // means it wont be cleaned, and compressor thread expects accesses = 1 for itself.
lock_compressor_db;
list_add_tail(this entry,to_be_compressed database);
unlock_compressor_db;
signal(compressor thread);
} else // clean from database only if we have a compressor OR the file should be ignored.
clean from database
}
compressor_thread:
sleep(1); // sleep 1 second, incase a decompressed file is reopened very quickly.
lock_compressor_db;
for_every_entry_in_list
lock_entry;
assert(accessess > 0);
if (accesses == 1) {
// We're the only one with access, great.
choose compressor and compress file
set entry-> data to the right compressor and size and such :)
// does NOT remove us from the direct_database, if we do that we need lock_database BEFORE lock_entry (or we risk hardlock), and the next open loop will flush it anyway.
}
remove_from_compressor_db(entry);
unlock_entry; // remove_from_compressor_db doesn't screw with the entry, it just removes it from our local list.
unlock_compressor_db;