Subject: Re: problem with tmpfs and linux emulation?
To: Jaromir Dolecek <jdolecek@NetBSD.org>
From: Christos Zoulas <christos@zoulas.com>
List: current-users
Date: 11/12/2005 23:36:24
On Nov 12, 9:20pm, jdolecek@NetBSD.org (Jaromir Dolecek) wrote:
-- Subject: Re: problem with tmpfs and linux emulation?
| On Sat, Nov 12, 2005 at 07:23:40PM +0000, Christos Zoulas wrote:
| > >> Presumably, though, the behavior of linux_sys_read would have to depend
| > >> on the underlying file system type -- it does the right thing for, say,
| > >> ffs and ext2fs, but not for tmpfs.
| > >
| > >But it only work by "accident", not intention. This method should be used for
| > >all filesystems, not just tmpfs. It's a bit more inefficient, but more correct.
| >
| > I don't think that linux uses read to read directories. I think it always
| > uses getdents. Something else must be going on. Can someone verify by using
| > ktrace?
|
| The most likely suspect is tmpfs_readdir()'s cookie handling.
|
| BTW, is there any reason tmpfs diverges significantly from the
| filesystem code style? Like ((struct vop_lookup_args *)v)->a_dvp
| assignments and --------------------- separators between functions.
|
| Jaromir
It also seems silly to special-case "." and ".." in the way it is done
now. I think that reading any directory will take at least 3 system
calls now.
christos