Commit Graph

24 Commits

Author SHA1 Message Date
jmmv 52b7ca57d3 Fix typo in comment. 2006-11-13 11:47:37 +00:00
jmmv 1a3e8c3caa Protect the dircookie stuff with _KERNEL. Fixes build problems of
mount_tmpfs as reported by Hisashi T Fujinaka in private mail.
2006-11-05 19:36:07 +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
ad f474dceb13 Use the LWP cached credentials where sane. 2006-07-23 22:06:03 +00:00
yamt 725fa55be5 hide more by ifdef _KERNEL. 2006-05-27 09:12:31 +00:00
elad fc9422c9d9 integrate kauth. 2006-05-14 21:31:52 +00:00
riz 9f6ad5fff1 Swap the order of the tf_gen and tf_id members of struct tmpfs_fid,
since tf_id needs 8-byte alignment on some architectures (like amd64).
struct tmpfs_fid now fits in 16 bytes on amd64 again.
OK matt@
2006-03-31 20:27:49 +00:00
martin 625f1bbe61 Restrict generation numbers to 32bit values - we would have had to bump
_VFS_MAXFIDSZ to 24 otherwise for 64bit archs.
2006-03-26 20:18:58 +00:00
perry fbae48b901 Change "inline" back to "__inline" in .h files -- C99 is still too
new, and some apps compile things in C89 mode. C89 keywords stay.

As per core@.
2006-02-16 20:17:12 +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
christos 6547cf74f3 make the include files usable from userland. 2006-02-10 16:00:02 +00:00
jmmv f37f56be99 Remove a conditional by always using inlined functions in favour of macros.
This way, the code is clearer and there shouldn't be any performance
difference (if the compiler DTRT).  Suggested by chs@.
2005-12-24 12:31:57 +00:00
christos 95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
yamt 1fa8bcda47 VFS_TO_TMPFS: remove a wrong assertion.
it's wrong because TMPFS_PAGES_MAX can be decreased.
2005-12-06 21:46:34 +00:00
christos 4bffed72de - protect userland exported files against multiple inclusion.
- make sure that kernel only files don't compile in userland using #error
- XXX: some kernel only files still get installed.
- XXX: some files used in userland, don't get installed.
2005-12-03 17:34:43 +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 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
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 2a3e5eeb7c Apply the NFS exports list rototill patch:
- Remove all NFS related stuff from file system specific code.
- Drop the vfs_checkexp hook and generalize it in the new nfs_check_export
  function, thus removing redundancy from all file systems.
- Move all NFS export-related stuff from kern/vfs_subr.c to the new
  file sys/nfs/nfs_export.c.  The former was becoming large and its code
  is always compiled, regardless of the build options.  Using the latter,
  the code is only compiled in when NFSSERVER is enabled.  While doing this,
  also make some functions in nfs_subs.c conditional to NFSSERVER.
- Add a new command in nfssvc(2), called NFSSVC_SETEXPORTSLIST, that takes a
  path and a set of export entries.  At the moment it can only clear the
  exports list or append entries, one by one, but it is done in a way that
  allows setting the whole set of entries atomically in the future (see the
  comment in mountd_set_exports_list or in doc/TODO).
- Change mountd(8) to use the nfssvc(2) system call instead of mount(2) so
  that it becomes file system agnostic.  In fact, all this whole thing was
  done to remove a 'XXX' block from this utility!
- Change the mount*, newfs and fsck* userland utilities to not deal with NFS
  exports initialization; done internally by the kernel when initializing
  the NFS support for each file system.
- Implement an interface for VFS (called VFS hooks) so that several kernel
  subsystems can run arbitrary code upon receipt of specific VFS events.
  At the moment, this only provides support for unmount and is used to
  destroy NFS exports lists from the file systems being unmounted, though it
  has room for extension.

Thanks go to yamt@, chs@, thorpej@, wrstuden@ and others for their comments
and advice in the development of this patch.
2005-09-23 12:10:31 +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 647aa77538 - don't waste/leak kva.
- implement getpages/putpages.  support mmap.
- eliminate meaningless memcpy.
- ubcify.
2005-09-13 14:29:18 +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