RE: Getting full pathname for dentry (fwd)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Meanwhile i came to the conclusion that i can't use user_path_walk and 
> therefore have to use d_path like this:
> 
> pathname = d_path( dentry, current->fs->rootmnt, buffer, namelen );
> 
> Unfortunately this doesn't get across mount points, meaning if /usr is a 
> mountpoint then touch /usr/test gives "/test" as the full pathname.
> 
> Any hints are welcome!

try saving a pointer to the _real_ root you wish to reference, 
make the locks d_path perform (dcache_lock), and then call __d_path with 
the appropriate parameters.

you can also try the code here: http://www.cs.bgu.ac.il/~tzachar/file.c
i wrote it a while back, and sure, its a little _misguided_, but it 
worked for me (so everyone, please dont torch me .... ;) 

cheers,


========================================================================
nir.

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux