Re: Inode access !

Steve Dodd (dirk@loth.demon.co.uk)
Tue, 16 Feb 1999 10:47:33 +0000


Hi,

I've re-cc'd linux-kernel in case anyone else has thoughts..

On Tue, Feb 16, 1999 at 04:24:24AM -0500, Sampath Peechu wrote:

> well, i guess u r right because i was indeed calling namei() from
> the kernel space...
>
> can u suggest what i should do to access(modify) inode information
> about a file, given the name of the file....and i have to do this
> from within a system call....

Well, if the file name was originally passed to you from user space, you
should be able to pass it to namei / lnamei / __namei without problems, as
this will pull it into kernel space.

If for some reason you bring the filename into kernel space yourself, and
'fiddle' with it (or are generating the pathname by hand?), either
i) use dentry stuff if you're getting parent directories, etc.;
ii) call lookup_dentry yourself (look at namei() source to see how it does it).

It might help if we knew what you were trying to achieve :) Are you writing
a new syscall or modifying an existing one? What's your code (trying to) do?

Cheers,
Steve

-- 
"Apathy is not the problem, it's the solution"

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