lookup function return value in inode_operations

Sankar P sankar.curiosity at gmail.com
Mon May 27 14:08:05 EDT 2013


Hi,

What is the return value of the lookup function under the
inode_operations struct ? I see that the function gets a dentry as a
parameter, which can be used to associate an inode. For example:

If we have:

struct dentry * somefs_lookup(struct inode *parent_inode,
      struct dentry *child_dentry, unsigned int flags)
{
    d_add(child_dentry, inode);
}

so, what is the meaning of the return "struct dentry" in this lookup
function ? In some simple filesystems that I saw, they return NULL
here and it seem to work just fine. So what is that the lookup
function should do if we are implementing our own filesystem ?

Thanks.

--
Sankar P
http://psankar.blogspot.com



More information about the Kernelnewbies mailing list