fuse-mt icon indicating copy to clipboard operation
fuse-mt copied to clipboard

Allow access to the inode/parent id

Open dweidenfeld opened this issue 8 years ago • 1 comments
trafficstars

I am planning to implement a filesystem, that has a tag based folder structure.

So e.g. a folder has the id 001 and another folder has the id 002. In folder 001 is a file 011 and 021 etc.

If I want to resolve all folders/files in folder 001 I need to be able to execute a request like: SELECT * FROM objects WHERE parent_id = '001'

So I need the information of the parent id / object in the readdir method. Would it be possible to give access to the parents inode or store some custom id's, so that I know what the requested object actually is?

regards, Dominik

dweidenfeld avatar Aug 15 '17 11:08 dweidenfeld

Not directly possible (not even in low-level fuse code), because inodes don't store a reference to their parent. You can only look up the parent by path (by stripping off the last component of the path). In opendir and readdir, the kernel only gives the inode of the directory being opened, nothing about the parent.

wfraser avatar Oct 17 '17 21:10 wfraser