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


On Sat, 20 Feb 1999, Mike Kennedy wrote:

>
> 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.

Erm? Are you dealing with 2.0 or 2.2? On 2.2 you are looking for a
dentry of file and then look for ->d_parent - it will be dentry of parent
directory. For root directory (of filesystem) ->d_parent points to itself.
To find the dentry of mountpoint under it use ->d_covers.


-
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.146 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site