From: Stef B. <st...@gm...> - 2010-10-13 09:14:50
|
I do not understand you. You're looking for a function in libc to extract the path from the inode?? But the conversion (that's it, nothing more nothing less) is very filesystem specific. It depends on how you've implemented your fs. I've sent you earlier a version of the determine_path function, which translates the inode to a path (relative to the mountpoint). That should be a startpoint for you to design your own "determine_path" function. There are some functions which take the parent inode yes. The path for an entry is simply constructed as: parent_entry=find_entry(parent_inode); parent_path=determine_path(parent_entry); snprintf(path, PATH_MAX, "%s/%s", parent_path, entry->name); No, no mapping between the inode and path. Just do a lookup of the path everytime you need the path, and where possible, reuse the path, as above. When you've determined the path of the parent inode, it's not necessary to create the whole path again, just append the entry->name to create the path. A mapping will need too much memory, and is difficult to maintain. Well, the create function does not has to be defined. read fuse_lowlevel.h. I think the minimum to create a fs are: lookup getattr readlink open read release opendir readdir releasedir This is necessary to have a read only lowlevel fs. For the highlevel interface there are ven less (more is done "behind the scenes"). If anyone can correct me here, please do. Stef Stef 2010/10/13 Gal Rosen <GA...@il...>: > Hi Stef, > > The still something that I do not understand. > Most of the low level interface functions are comes with fuse_ino_t, and > some like look_up, mknod, create are comes with parent fuse_ino_t and name. > Is there any syscall in libc that can extract the path from the inode, and > also extract the path from parent inode and name ? > Because in order to work on the file I must have the path, or maybe there > is syscalls in libc that work on the inode ? > If there is no such interfaces then I guess that I need to keep such a map > of inode to path or something similar, how do you do that ? > And also do I need to implement all low level interface ? I see that for > example deltafs does not implement create function. > > Thanks, > Gal. > |