Commit Graph

292 Commits

Author SHA1 Message Date
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
jmmv 8d09f0278b Start inode numbers on 2 to mimic UFS tradition (and to avoid problems if
some utility relies on this).
2005-09-23 13:59:16 +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 bea9347034 fix buffer overrun for symbolic links. PR/31325. 2005-09-17 10:28:26 +00:00
yamt db59142cb3 tmpfs_dir_getdotdotdent: correct fileid. 2005-09-16 00:18:48 +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
soda a74b7aeaeb mention what is the failure case, from FreeBSD revision 1.46 cvs log 2005-09-14 15:13:19 +00:00
christos fe968d1756 PR/31312: Juan RP: Don't use negative cacheing on msdosfs, because of the
evil case preserving and case sensitive semantics. From FreeBSD.
2005-09-14 15:07:22 +00:00
yamt 7720dda14a tmpfs_read: handle requests past EOF. 2005-09-14 10:40:49 +00:00
jmmv 2ddaf8b92b Nodes cannot use the '0' identifier or they will be skipped by readdir.
E.g., the root node's '.' and '..' directory entries did not appear in
a directory list, because the root node always holds the first id.
2005-09-13 21:30:52 +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
yamt db9ffe1576 - don't keep a reference to a variable on stack.
- remove a meaningless assumption about the order of structure members.
2005-09-12 19:56:58 +00:00
yamt ffb84f0f1b fix lock/unlock mismatch. XXX this is not a real fix. 2005-09-12 19:55:22 +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
christos 54705baa2e wrong variable name. 2005-09-12 16:54:35 +00:00
christos c7d2653a66 use nanotime(). 2005-09-12 16:44:29 +00:00
christos 370f05b81d don't play with ctime directly anymore. 2005-09-12 16:43:38 +00:00
christos 1114655b16 Fix the CHANGE part too. 2005-09-12 16:42:09 +00:00
christos ce573378a6 propagate itime changes from the other filesystems. 2005-09-12 16:37:13 +00:00
christos a12024da06 Use nanotime() to update the time fields in filesystems. Convert the code
from macros to real functions. Original patch and review from chuq.
Note: ext2fs only keeps seconds in the on-disk inode, and msdosfs does not
have enough precision for all fields, so this is not very useful for those
two.
2005-09-12 16:24:41 +00:00
jmmv 7164c6807f Remove tmpfs from here, as it doesn't have a Makefile (dunno if it is
needed, yet).  Pointed out by FUKAUMI Naoki in private mail.
2005-09-12 09:11:20 +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
christos 7b1ec62c27 Make fileno calculations use ino_t variables. 2005-09-10 18:35:56 +00:00
christos a4b3d5864b PR/23773: Tero Kivinen: Cannot mount msdos filesystems if filesystem size >
128GB
PR/31287: Fabien Devaux: msdosfs now can mount >128MB filesystems
2005-09-10 17:33:45 +00:00
xtraeme 85d3711504 Remove an extra ')' 2005-08-30 19:15:11 +00:00
xtraeme 37ed0ed9df Remove __P() 2005-08-30 19:11:43 +00:00
xtraeme 08fcacf4ed Remove __P() 2005-08-30 19:01:29 +00:00
xtraeme 85be4ce6e8 Remove __P() 2005-08-30 18:47:19 +00:00
xtraeme 47216f8470 Remove __P() 2005-08-29 23:57:35 +00:00
xtraeme 529eaccb6b The maximum file size on MS-DOS filesystems is 4 GB - 1 byte, so
don't bother trying to write files bigger than this.  Just return
EFBIG to caller, rather than panic()ing later.

From OpenBSD.

This closes my PR kern/30864: "panic when copying files of >4GB on msdosfs"
2005-08-29 23:22:05 +00:00
nakayama d8c6d7b24e statvfs(2) returns bogus result from union mounted file systems with
`-r' option, since it uses uninitialized buffer in the case of no
lower-layer file system.

So, add M_ZERO to malloc(9) flags to initialize the buffer.
2005-08-24 15:21:28 +00:00
christos 5e6a1c8476 fileid is now a quad. 2005-08-19 12:24:54 +00:00
christos 2ebf2b2fc3 namlen is u_int16_t now. 2005-08-19 04:47:55 +00:00
christos b02ca699ef Add an _ to DIRENT_SIZE 2005-08-19 04:45:47 +00:00
christos 103542d3d7 fix a printf arg. 2005-08-19 04:15:02 +00:00
christos 758a209d23 64 bit inode changes. 2005-08-19 02:03:49 +00:00
jmmv db4c002235 Fix comment regarding sbp->f_favail (which was a duplicate due to a pasto). 2005-08-05 13:24:18 +00:00
jmmv e062fbf94f Let this build when MSDOSFS_DEBUG is defined (v_id disappeared a long time
ago but it was still used here).
2005-08-05 11:00:31 +00:00
christos aa112c89a9 PR/30823: Dave Huang: Panic reading files larger than 4GB on NTFS 2005-07-25 00:48:22 +00:00
yamt b7bfe82866 update file timestamps for nfsd loaned-read and mmap.
PR/25279.  discussed on tech-kern@.
2005-07-23 12:18:41 +00:00
yamt 44d128fa8e - constify genfs_ops.
- use member designators.
2005-06-28 09:30:37 +00:00
thorpej e871a0392f Remove the last references to M_NAMEI; everything should be using PNBUF_*()
now (for a long time now).  Remove M_NAMEI, and bump the kernel version to
3.99.7 to reflect its removal.
2005-06-23 17:00:30 +00:00
junyoung 6a5baa993c ANSIfy and de-__P. 2005-06-22 17:34:30 +00:00
atatat df13e3579e Change the rest of the sysctl subsystem to use const consistently.
The __UNCONST macro is now used only where necessary and the RW macros
are gone.  Most of the changes here are consumers of the
sysctl_createv(9) interface that now takes a pair of const pointers
which used not to be.
2005-06-20 02:49:18 +00:00