stef...@gmail.com wrote:
> Howard Chu wrote:
>>> What locking is required?
> 
> locking rw per directory. A directory is the group of dentries with the same 
> parent inode.
> This is a small subset of the whole list. The whole list is for all the 
> dentries of a FUSE mountpoint.
> 
>>> Keeping LMDB keysize limits in mind, it will work. But you'd probably do 
>>> better using LMDB's DUPSORT
>> feature. Use the parent inode as the key, use the name as the value.
> 
> Well, what you suggest is that the lookup does not use the name: after a 
> search for the first dentry having the desired parent inode, then step by 
> step to get to the dentry with the right name. This is not what I'm looking 
> for: then I can better use an internal hashtable.

No, not at all. And that would be stupid indeed. The MDB_GET_BOTH flag means 
both the key and the value will be looked up.
Also, using DUPSORT saves space since the inode will only be stored once 
instead of repeatedly on every entry.

> I'm hoping I can use lmdb to do a lookup using the parent ino and the name.
> Is it a bad thing to use the name next to the parent ino as well? You mention 
> the LMDB keysize.

It's not a terrible thing, it just wastes space.
> 
> S. Bon
> 


-- 
  -- Howard Chu
  CTO, Symas Corp.           http://www.symas.com
  Director, Highland Sun     http://highlandsun.com/hyc/
  Chief Architect, OpenLDAP  http://www.openldap.org/project/

Reply via email to