Re: stat very inefficient

Andi Kleen
2004-07-28T10:17:26Z

"David S. Miller" <davem@redhat.com> writes:

> 1) From inode to "struct kstat"
> 2) From "struct kstat" to "struct stat{,64}" on local kernel stack
> 3) From local kernel stack to userspace

[...]

> I was about to make sparc64 specific copies of all the stat
> system calls in order to optimize this properly. But that
> makes little sense, instead I think fs/stat.c should call
> upon arch-specific stat{,64} structure fillin routines that
> can do the magic, given a kstat struct.

I think wrappers are preferable to callbacks. Basically step (2)
should be eliminated.

Most architectures can use a generic wrapper for that, together
with a standard macro that clears all the padding in user space.

-Andi