2003-05-06 03:15:35

by Sumit Narayan

[permalink] [raw]
Subject: inode number

Hi,

How do I know which file has what Inode number? and its under which super block?

Thanks

Sumit


____________________________________________________________
Get advanced SPAM filtering on Webmail or POP Mail ... Get Lycos Mail!
http://login.mail.lycos.com/r/referral?aid=27005


2003-05-06 03:40:02

by Sumit Narayan

[permalink] [raw]
Subject: Re: inode number

Hi,

Actually, what I meant with this was, suppose I have a file name, how do I get the inode for that? And also suppose I have the inode number, how do I get the complete object of that inode for use and manipulation?

Thanks in advance

Sumit
--

On Mon, 05 May 2003 23:27:32
Sumit Narayan wrote:
>Hi,
>
>How do I know which file has what Inode number? and its under which super block?
>
>Thanks
>
>Sumit
>
>
>____________________________________________________________
>Get advanced SPAM filtering on Webmail or POP Mail ... Get Lycos Mail!
>http://login.mail.lycos.com/r/referral?aid=27005
>-
>To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>the body of a message to [email protected]
>More majordomo info at http://vger.kernel.org/majordomo-info.html
>Please read the FAQ at http://www.tux.org/lkml/
>


____________________________________________________________
Get advanced SPAM filtering on Webmail or POP Mail ... Get Lycos Mail!
http://login.mail.lycos.com/r/referral?aid=27005

2003-05-06 03:47:21

by Kurt Wall

[permalink] [raw]
Subject: Re: inode number

An unnamed Administration source, Sumit Narayan, wrote:
% Hi,
%
% Actually, what I meant with this was, suppose I have a file name, how do I get the inode for that? And also suppose I have the inode number, how do I get the complete object of that inode for use and manipulation?

If you have a filename, stat(2); see also lstat(2) and fstat(2).

Kurt
--
Error in operator: add beer

2003-05-06 03:57:53

by Valdis Klētnieks

[permalink] [raw]
Subject: Re: inode number

On Mon, 05 May 2003 23:27:32 EDT, Sumit Narayan <[email protected]> said:
> How do I know which file has what Inode number? and its under which super blo
ck?

There's no single answer - multiple files can have the same inode number
(they're called hard links). Finding which filesystem they are on
involves walking through the mount table..


Attachments:
(No filename) (226.00 B)

2003-05-06 06:31:25

by Lucas C. Villa Real

[permalink] [raw]
Subject: Re: inode number

Hi,

You can give a look on user_path_walk() and user_path_walk_link() (see
include/linux/fs.h), given you have the pathname.
Given you have the inode number, you can get one of the references to it by
using d_path() (see include/linux/sched.h). I just don't know how it works
when there is multiple references to the same inode number (hard links).

Lucas


On Tuesday 06 May 2003 00:52, Sumit Narayan wrote:
> Hi,
>
> Actually, what I meant with this was, suppose I have a file name, how do I
> get the inode for that? And also suppose I have the inode number, how do I
> get the complete object of that inode for use and manipulation?
>
> Thanks in advance
>
> Sumit
> --
>
> On Mon, 05 May 2003 23:27:32
>
> Sumit Narayan wrote:
> >Hi,
> >
> >How do I know which file has what Inode number? and its under which super
> > block?
> >
> >Thanks
> >
> >Sumit
> >
> >
> >____________________________________________________________
> >Get advanced SPAM filtering on Webmail or POP Mail ... Get Lycos Mail!
> >http://login.mail.lycos.com/r/referral?aid=27005
> >-
> >To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> >the body of a message to [email protected]
> >More majordomo info at http://vger.kernel.org/majordomo-info.html
> >Please read the FAQ at http://www.tux.org/lkml/
>
> ____________________________________________________________
> Get advanced SPAM filtering on Webmail or POP Mail ... Get Lycos Mail!
> http://login.mail.lycos.com/r/referral?aid=27005
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/

2003-05-06 06:38:36

by Lucas C. Villa Real

[permalink] [raw]
Subject: Re: inode number

On Tuesday 06 May 2003 03:43, Lucas Correia Villa Real wrote:

> Given you have the inode number, you can get one of the references to it by

Sorry, I mean the struct file.

Lucas