Hi,
I am trying to find a way to get the full pathname from a dentry
refering a file. I tried d_path(), and in one occasion I got
nothing, and in the other I got rubbish, then the path
I was expecting, and then (deleted).
Also, I am trying to find a way to detect if the buffer
was too small.
Is there a general introduction on dentries somewhere ?
I am persuaded it's going to be useful. Especially for
the locking issues.
This is under 2.2.12.
PS: I *already* (gasp!) found the way to print it
backwards by following d_parent until it's
equal to dentry, however a standard function
would presumably be better.
Here is a code example:
d_path(dentry,
rq->request.path_name,
sizeof(rq->request.path_name)); /* @@@ res ignored @@@ */
#if 0
if (some_cond_on_dpath_return_value()) {
printk("mfs: mfs_com: pathname too long %d at %s.\n",
this_length,
dentry->d_name.name); /* @@@ really NUL term? @@@ */
result = MFS_STATUS_OBJECT_NOT_FOUND;
goto out_abort;
}
#endif
printk("mfs_com: complete name: %s.\n",
rq->request.path_name);
thanks for any idea.