Commit Graph

33 Commits

Author SHA1 Message Date
chs c398ae9734 a smorgasbord of improvements to vnode locking and path lookup:
- LOCKPARENT is no longer relevant for lookup(), relookup() or VOP_LOOKUP().
   these now always return the parent vnode locked.  namei() works as before.
   lookup() and various other paths no longer acquire vnode locks in the
   wrong order via vrele().  fixes PR 32535.
   as a nice side effect, path lookup is also up to 25% faster.
 - the above allows us to get rid of PDIRUNLOCK.
 - also get rid of WANTPARENT (just use LOCKPARENT and unlock it).
 - remove an assumption in layer_node_find() that all file systems implement
   a recursive VOP_LOCK() (unionfs doesn't).
 - require that all file systems supply vfs_vptofh and vfs_fhtovp routines.
   fill in eopnotsupp() for file systems that don't support being exported
   and remove the checks for NULL.  (layerfs calls these without checking.)
 - in union_lookup1(), don't change refcounts in the ISDOTDOT case, just
   adjust which vnode is locked.  fixes PR 33374.
 - apply fixes for ufs_rename() from ufs_vnops.c rev. 1.61 to ext2fs_rename().
2006-12-09 16:11:50 +00:00
jmmv ccb670c8b8 Opening a file after it has been removed (e.g. rmdir $(pwd)) has to fail. 2006-11-09 15:36:30 +00:00
jmmv 117b5f5104 Audit kqueue notifications. The reference behavior is taken from MFS and
is represented in the regression tests.
2006-11-09 15:06:03 +00:00
jmmv 749d415179 tmpfs_open cannot assume that the node to be open is still linked to a
directory, so remove an invalid assertion.  Otherwise the kernel incorrectly
panics when accessing the current directory after it has been removed.
2006-11-07 14:08:13 +00:00
jmmv b2603104c2 Truncate directory cookies to 31 bits to avoid problems exposed in Linux
binaries which cast the returned values to 64-bits and fail due to sign
expansion.  More details are provided in the big comment in tmpfs.h that
describes how the new tmpfs_dircookie works.

This is a rather ugly hack that shall be fixed with a cleaner solution,
but this resolves the problem in an effective way.

Fixes kern PR/32034.
2006-11-05 16:59:18 +00:00
jmmv 51634dfd25 Make tmpfs_getpages behave as genfs_getpages by ignoring the input pages
array's contents and returning all the requested pages.  Otherwise there
are problems (accessing invalid memory) when the a_m vector is passed
uninitialized as the NFS server code does.  Fixes PR kern/34959.

Note that this is not a "real" fix.  While this makes tmpfs's getpages
operation consistent with the behavior of other file systems, it does
not resolve the different semantics between uvn_get and uao_get as
described in PR kern/32166.  I'm adding a comment in the code mentioning
exactly this so that it can be reviewed when this last problem is
addressed.
2006-11-02 15:35:25 +00:00
jmmv 71f9a07732 Update the file's ctime after a rename. Thanks to pooka@. 2006-10-30 15:23:20 +00:00
jmmv 2185c98874 When renaming a file, we have to modify the mtime of the directory holding
it, not the mtime of the file itself.  This fixes the problems exposed when
unpacking software under a tmpfs and trying to build it because dependencies
were not calculated properly (e.g. autoconf 2.60 as reported by tls@).
2006-10-30 15:09:47 +00:00
ad f474dceb13 Use the LWP cached credentials where sane. 2006-07-23 22:06:03 +00:00
christos fc6d984beb kauth fallout 2006-05-15 00:05:16 +00:00
elad fc9422c9d9 integrate kauth. 2006-05-14 21:31:52 +00:00
christos 61315901b1 PR/31850: Geoff Wing: tmpfs does not honor sticky directories. 2006-02-21 03:19:45 +00:00
jmmv 064fbe7e18 Do not use unnamed structures/unions without instances; they break the
build under vax because of gcc 2.95.  Found by he@.
2006-02-16 14:57:50 +00:00
jmmv 1aa1083c54 Cut a too long line introduced during the conversion to lwps. 2006-01-26 20:07:34 +00:00
christos 95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
yamt 221616873d merge yamt-readahead branch. 2005-11-29 22:52:02 +00:00
yamt a748ea88dd merge yamt-vop branch. remove following VOPs.
VOP_BLKATOFF
	VOP_VALLOC
	VOP_BALLOC
	VOP_REALLOCBLKS
	VOP_VFREE
	VOP_TRUNCATE
	VOP_UPDATE
2005-11-02 12:38:58 +00:00
jmmv ab7e099bbc Follow symlinks during lookup (i.e., don't stop too early) so that symlinks
to directories work as expected.  Diagnosed by Greg Oster.
2005-10-03 19:36:42 +00:00
jmmv b6d141c71c Implement the tmpfs_advlock operation. Makes "user-level" file locking
work (aka lockf(3)).
2005-09-29 19:48:21 +00:00
yamt 5ce7d98710 tmpfs_getattr: return up-to-date timestamps. 2005-09-28 23:42:14 +00:00
yamt 58e607b974 tmpfs_rename: fix lock/unlock mismatch. 2005-09-26 00:46:59 +00:00
jmmv b0085cab71 Kill the tmpfs(9) manual page; it was just documenting internal details of
tmpfs' "API" and was already rotting.

Instead, merge all the relevant comments into the code.  This includes
acknowledgements to Google's Summer of Code 2005 program (they were in the
AUTHORS section of tmpfs(9) before), so all the files need to be changed
to include this sentence alongside the title.  (Note that this was not a
requirement of the program.)
2005-09-23 15:36:15 +00:00
jmmv f63b58d19d Lock the source directory during the rename operation so that we are safe
to modify it (I hope this is the correct way to go).  Avoids triggering an
assertion in the tmpfs_dir_detach function, shown by the t_rename
regression test.
2005-09-23 14:27:55 +00:00
yamt 8e6209cffb change the way to handle directory "offsets" so that
they won't be changed when removing entries in the directory.
some applications like cvs rely on this.
2005-09-15 12:34:35 +00:00
yamt 20bb9654a2 tmpfs_getpages: don't create pages past eof. 2005-09-14 20:27:26 +00:00
yamt 7720dda14a tmpfs_read: handle requests past EOF. 2005-09-14 10:40:49 +00:00
jmmv 5f4b660e4e Adapt recent changes to the style of the rest of the file. 2005-09-13 20:02:05 +00:00
yamt 647aa77538 - don't waste/leak kva.
- implement getpages/putpages.  support mmap.
- eliminate meaningless memcpy.
- ubcify.
2005-09-13 14:29:18 +00:00
yamt a7ca1cc6ef tmpfs_read: return EISDIR rather than EINVAL for non-VREG files.
XXX should we follow nfs, which uses EPERM?
2005-09-13 14:27:29 +00:00
yamt 1873c5428a tmpfs_link: always free pnbuf. 2005-09-13 12:11:27 +00:00
christos b9c29c4def convert to use it nanotime, but don't call it unless it is necessary. 2005-09-12 16:55:01 +00:00
jmmv 8e0a777ab1 wiz@ remembers that the preferred way to spell file-system in NetBSD is
file system.
2005-09-10 22:28:57 +00:00
jmmv ec93365612 Initial addition of tmpfs, an efficient memory file-system. This project
was developed as part of Google's Summer of Code 2005 program.  This
change adds the kernel code, the mount_tmpfs utility, a regression test
suite and does all other related changes to integrate these.

The file-system is still *experimental*.  Therefore, it is disabled by
default in all kernels.  However, as typically done, a commented-out
entry is added in them to ease its setup.

Note that I haven't commited the required mountd(8) changes to be able
to export tmpfs file-systems because NFS support is still very unstable
and because, before enabling it, I'd like to do some other changes.

OK'ed by my project mentor, William Studenmund (wrstuden@).
2005-09-10 19:20:48 +00:00