lkml.org 
[lkml]   [1999]   [Feb]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Directory Entry for File

Ok. Sorry for continuing to pose this question. Say I have the following
situation where there is a file called foo in the /tmp directory. How can
I given the inode for the file 'foo' get the inode for the directory,
/tmp. This is within kernel space.

:===========================================================:
: Mike Kennedy mkennedy@cs.ucr.edu :
: Systems Administrator (909) 787-2946 :
: Computer Science Department :
: University of California, Riverside :
:===========================================================:

On Sat, 20 Feb 1999, Alexander Viro wrote:

>
>
> On Sat, 20 Feb 1999, Mike Kennedy wrote:
>
> >
> > Ok... let me re phrase. I'm talking about kernel space. I need to, given
> > an inode for a file that is being read, for example, find the
> > corresponding filename string that is contained in the directory entry.
>
> Look at sys_getpwd() and do it for all dentries over your inode
> (cyclic list I've mentioned). Why not do it on open()? There you have the
> name for free and to read stuff one has to open the file.
>
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.rutgers.edu
> Please read the FAQ at http://www.tux.org/lkml/
>


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

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