Re: Patch to implement getattr [patch]

Alexander Viro (viro@math.psu.edu)
Wed, 14 Jul 1999 00:34:19 -0400 (EDT)


On 14 Jul 1999, Magnus Ahltorp wrote:

> The Linux VFS requires the file system to use unique inode numbers.
> This is not always possible, especially when these must be mapped from
> larger numbers (e.g. 128-bit AFS identifiers).
>
> I presented this problem to the list about a year ago, and the
> response I got was to use the integer value of pointers to my
> extra-data structures. This produces inode numbers that are unique
> within a machine at any given point in time. They are not, however,
> persistent with respect to given file.
>
> This would not be a problem if there was a way for the file system to
> control what inode number is passed to userland. This is not possible
> in the current kernel, since stat only copies the information from the
> struct inode. The below patch implements an inode operation that lets
> the file system decide what the stat system call should return.

1. Having getattr is nice, but I'ld rather turned the old code into
generic_getattr() and let the filesystems refer to it.

2. I think that having a wrapper around the thing (vfs_getattr()) would be
the right thing. Just look how arch/*/* stuff does stat() emulation for
personalities with different struct stat layout. set_fs();sys_stat();set_fs();
and then reshuffle the stuff...<shudder>

3. As for inode numbers - look at the stuff in fs/fat/inode.c. You can do
constant inumbers during the life of *open* file.
Cheers,
Al

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