From: Miklos S. <mi...@sz...> - 2011-08-15 08:31:20
|
John Muir <jo...@jm...> writes: > On 2011.08.14, at 17:48 , Nikolaus Rath wrote: >> Gal Rosen <GALRO-7z/5Bg...@pu...> writes: >>> Gal Rosen <GALRO-7z/5Bg...@pu...> writes: >>>>> I read the README.NFS file and I am guessing it's related to what written >>>>> their, but I didn't really understand what does it mean to implement >>>>> lookup for "." and "..". > > When the kernel calls lookup(x, '.'), you must return the "struct > fuse_entry_param" information for the inode x (not it's parent > directory, but the inode itself). When the kernel calls lookup(x, > '..'), you must return the fuse_entry_param for _a_ parent of X (X may > have many parents - I believe that you can generally pick the first > one that you find.) Looking at the NFS export code, it uses ->get_parent() to generate a complete path from a file handle. And for non-directory handles it stores the parent info in the handle, so lookup(X, '..') will only be called if X is a directory. And this only happens if subtree checking is enabled on the export (i.e. the "no_subtree_check" option is not used). Thanks, Miklos |