lkml.org 
[lkml]   [1997]   [Dec]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: /proc/memmap [name from inode?]
Hi!

> >The one thing I haven't figured out is how to get from the inode to the
> >filename which would be nice ... you comment that this should be possible
> >given the dentry stuff in 2.1 but I can't see an obvious path to do this
> >looking at the 2.1 structures and code in the kernel.
>
> Have a look at how /proc/<pid>/maps does it in fs/proc/array.c
> Basically:
>
> buffer = (char *) __get_free_page(GFP_KERNEL);
> if (buffer && pdentry)
> {
> line = d_path(pdentry, buffer, PAGE_SIZE);
> free_page((unsigned long) buffer);
> }
> else
> /* show dev, ino instead */

But they are doing lookup of name from dentry. I *think* that you can
*not* get name from inode - inode may have 0, 1, 2, 3, ... names!
(Think of deleted files - 0 names. Think of hardlinks - many names).

Pavel

--
I'm really pavel@atrey.karlin.mff.cuni.cz. Pavel
Look at http://atrey.karlin.mff.cuni.cz/~pavel/ ;-).

\
 
 \ /
  Last update: 2005-03-22 13:40    [W:0.057 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site