From: Sven U. <sve...@gm...> - 2010-06-18 03:29:03
|
Hello Nikolaus, > > There is a little problem with that. fuse_add_direntry seems to > > require an offset for every returned entry, not just the last > > one. Since my offsets are filenames, I would have to keep an > > offset-to-filename mapping for every single returned entry which > > is basically just as bad as copying the entire directory contents > > into a temporary table. > > I just realized that in SQLite I already have that mapping with the > rowid, I just need to make it autoincrement so that it becomes > unique. What do you use as your primary key? For me, this is the rowid anyway... > That should do nicely without any overhead. The only drawback is > that I have to require off_t to be 64bit for that to work -- but > hopefully that is the case on most systems nowaday. But are offsets allowed to be non-contiguous? What are they used for, anyway? Anything outside of readdir? Would all those extra offsets ever be used? That said, if you had to keep a table of mappings, you could easily have a timer which will clean up that table after so many seconds. I do this for a number of things which are moderately expensive to get from SQL (just the query overhead, really), but constantly needed when exporting via NFS... Sven -- _ ___ ___ ___ __| |/ __|| __|/ __| The dCache File System / _` | (__ | _| \__ \ An archive file-system for PB of data \__,_|\___||_| |___/ http://www.desy.de/~utcke/Data/ |