Home | History | Annotate | only in /src/sys/fs/hfs
History log of /src/sys/fs/hfs
RevisionDateAuthorComments
 1.2 06-Mar-2007  dillo branches: 1.2.4; 1.2.20;
Complete rename of hfsp to hfs, requested by thorpej.
 1.1 06-Mar-2007  dillo branches: 1.1.1;
Initial revision
 1.1.1.1 06-Mar-2007  dillo nitial import of (experimental read-only) implementation of Apple
HFS+ file system.

Originally developed for Google Summer of Code 2005 by Yevgeny Binder,
updated and enhanced by me.
 1.2.20.2 03-Sep-2007  yamt sync with head.
 1.2.20.1 06-Mar-2007  yamt file Makefile was added on branch yamt-lazymbuf on 2007-09-03 14:40:18 +0000
 1.2.4.2 12-Mar-2007  rmind Sync with HEAD (missed new files in previous).
 1.2.4.1 06-Mar-2007  rmind file Makefile was added on branch yamt-idlelwp on 2007-03-12 06:14:51 +0000
 1.3 22-Mar-2007  dillo branches: 1.3.12;
Add a few.
 1.2 06-Mar-2007  dillo branches: 1.2.2; 1.2.4; 1.2.6; 1.2.8;
Complete rename of hfsp to hfs, requested by thorpej.
 1.1 06-Mar-2007  dillo branches: 1.1.1;
Initial revision
 1.1.1.1 06-Mar-2007  dillo nitial import of (experimental read-only) implementation of Apple
HFS+ file system.

Originally developed for Google Summer of Code 2005 by Yevgeny Binder,
updated and enhanced by me.
 1.2.8.1 29-Mar-2007  reinoud Pullup to -current
 1.2.6.1 11-Jul-2007  mjf Sync with head.
 1.2.4.3 24-Mar-2007  yamt sync with head.
 1.2.4.2 12-Mar-2007  rmind Sync with HEAD (missed new files in previous).
 1.2.4.1 06-Mar-2007  rmind file TODO was added on branch yamt-idlelwp on 2007-03-12 06:14:51 +0000
 1.2.2.1 10-Apr-2007  ad Sync with head.
 1.3.12.2 03-Sep-2007  yamt sync with head.
 1.3.12.1 22-Mar-2007  yamt file TODO was added on branch yamt-lazymbuf on 2007-09-03 14:40:18 +0000
 1.4 11-Oct-2014  uebayasi Define filesystem attributes with vfs dependency.
 1.3 10-Aug-2014  hannken Change hfs from hashlist to vcache.
- use (cnid, fork) as key.
- use pool for hfs nodes.
 1.2 06-Mar-2007  dillo branches: 1.2.4; 1.2.20; 1.2.90;
Complete rename of hfsp to hfs, requested by thorpej.
 1.1 06-Mar-2007  dillo Rename files from hfsp to hfs.
 1.2.90.2 03-Dec-2017  jdolecek update from HEAD
 1.2.90.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.20.2 03-Sep-2007  yamt sync with head.
 1.2.20.1 06-Mar-2007  yamt file files.hfs was added on branch yamt-lazymbuf on 2007-09-03 14:40:19 +0000
 1.2.4.2 12-Mar-2007  rmind Sync with HEAD (missed new files in previous).
 1.2.4.1 06-Mar-2007  rmind file files.hfs was added on branch yamt-idlelwp on 2007-03-12 06:14:52 +0000
 1.2 06-Mar-2007  dillo Rename files from hfsp to hfs.
 1.1 06-Mar-2007  dillo branches: 1.1.1;
Initial revision
 1.1.1.1 06-Mar-2007  dillo nitial import of (experimental read-only) implementation of Apple
HFS+ file system.

Originally developed for Google Summer of Code 2005 by Yevgeny Binder,
updated and enhanced by me.
 1.12 24-Jul-2020  skrll Replace the */ I accidentally removed in the last commit
 1.11 23-Jul-2020  skrll unifdef -U_LKM
 1.10 23-Jul-2020  skrll Trailing whitespace
 1.9 10-Aug-2014  hannken Change hfs from hashlist to vcache.
- use (cnid, fork) as key.
- use pool for hfs nodes.
 1.8 28-Jan-2012  joerg branches: 1.8.6;
Include sys/malloc.h for MALLOC_DECLARE.
 1.7 03-Sep-2008  gmcgarry branches: 1.7.28; 1.7.32;
Don't use unnamed structures.
 1.6 08-Aug-2007  pooka branches: 1.6.4; 1.6.24; 1.6.28; 1.6.30; 1.6.34;
sprinkle #ifdef _KERNEL
 1.5 31-Jul-2007  pooka branches: 1.5.2; 1.5.4;
* nuke the nameidata parameter from VFS_MOUNT(). Nobody on tech-kern
knew what it was supposed to be used for and wrstuden gave a go-ahead
* while rototilling, convert file systems which went easily to
use VFS_PROTOS() instead of manually prototyping the methods
 1.4 12-Jul-2007  dsl branches: 1.4.2;
Change the VFS_MOUNT() interface so that the 'data' buffer passed to the
fs code is a kernel buffer, pass though the length of the buffer as well.
Since the length of the userspace buffer isn'it (yet) passed through the mount
system call, add a field to the vfsops structure containing the default length.
Split sys_mount() for calls from compat code.
Ride one of the recent kernel version changes - old fs LKMs will load, but
sys_mount() will reject any attempt to use them.
 1.3 22-Mar-2007  dillo Add support for HFS Wrapper (HFS+ volume inside an HFS volume).
Remove offset argument, we should now find an HFS+ volume in any
of its standard places.
 1.2 06-Mar-2007  dillo branches: 1.2.2; 1.2.4; 1.2.6; 1.2.8;
Complete rename of hfsp to hfs, requested by thorpej.
 1.1 06-Mar-2007  dillo Rename files from hfsp to hfs.
 1.2.8.1 29-Mar-2007  reinoud Pullup to -current
 1.2.6.1 11-Jul-2007  mjf Sync with head.
 1.2.4.3 24-Mar-2007  yamt sync with head.
 1.2.4.2 12-Mar-2007  rmind Sync with HEAD (missed new files in previous).
 1.2.4.1 06-Mar-2007  rmind file hfs.h was added on branch yamt-idlelwp on 2007-03-12 06:14:52 +0000
 1.2.2.3 20-Aug-2007  ad Sync with HEAD.
 1.2.2.2 15-Jul-2007  ad Sync with head.
 1.2.2.1 10-Apr-2007  ad Sync with head.
 1.4.2.1 15-Aug-2007  skrll Sync with HEAD.
 1.5.4.2 31-Jul-2007  pooka * nuke the nameidata parameter from VFS_MOUNT(). Nobody on tech-kern
knew what it was supposed to be used for and wrstuden gave a go-ahead
* while rototilling, convert file systems which went easily to
use VFS_PROTOS() instead of manually prototyping the methods
 1.5.4.1 31-Jul-2007  pooka file hfs.h was added on branch matt-mips64 on 2007-07-31 21:14:18 +0000
 1.5.2.1 09-Aug-2007  jmcneill Sync with HEAD.
 1.6.34.1 19-Oct-2008  haad Sync with HEAD.
 1.6.30.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.6.28.1 04-May-2009  yamt sync with head.
 1.6.24.1 28-Sep-2008  mjf Sync with HEAD.
 1.6.4.2 03-Sep-2007  yamt sync with head.
 1.6.4.1 08-Aug-2007  yamt file hfs.h was added on branch yamt-lazymbuf on 2007-09-03 14:40:19 +0000
 1.7.32.1 18-Feb-2012  mrg merge to -current.
 1.7.28.1 17-Apr-2012  yamt sync with head
 1.8.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.14 10-Aug-2014  hannken Change hfs from hashlist to vcache.
- use (cnid, fork) as key.
- use pool for hfs nodes.
 1.13 27-Feb-2014  hannken The current implementation of vn_lock() is racy. Modification of
the vnode operations vector for active vnodes is unsafe because it
is not known whether deadfs or the original file system will be
called.

- Pass down LK_RETRY to the lock operation (hint for deadfs only).

- Change deadfs lock operation to return ENOENT if LK_RETRY is unset.

- Change all other lock operations to check for dead vnode once
the vnode is locked and unlock and return ENOENT in this case.

With these changes in place vnode lock operations will never succeed
after vclean() has marked the vnode as VI_XLOCK and before vclean()
has changed the operations vector.

Adresses PR kern/37706 (Forced unmount of file systems is unsafe)

Discussed on tech-kern.

Welcome to 6.99.33
 1.12 12-Jun-2011  rmind branches: 1.12.2; 1.12.12; 1.12.16;
Welcome to 5.99.53! Merge rmind-uvmplock branch:

- Reorganize locking in UVM and provide extra serialisation for pmap(9).
New lock order: [vmpage-owner-lock] -> pmap-lock.

- Simplify locking in some pmap(9) modules by removing P->V locking.

- Use lock object on vmobjlock (and thus vnode_t::v_interlock) to share
the locks amongst UVM objects where necessary (tmpfs, layerfs, unionfs).

- Rewrite and optimise x86 TLB shootdown code, make it simpler and cleaner.
Add TLBSTATS option for x86 to collect statistics about TLB shootdowns.

- Unify /dev/mem et al in MI code and provide required locking (removes
kernel-lock on some ports). Also, avoid cache-aliasing issues.

Thanks to Andrew Doran and Joerg Sonnenberger, as their initial patches
formed the core changes of this branch.
 1.11 21-Jul-2010  hannken branches: 1.11.6;
Make holding v_interlock mandatory for callers of vget().

Announced some time ago on tech-kern.
 1.10 01-Jul-2010  hannken Remove vlockmgr(). Generic vnode lock operations now use a rwlock located
in the vnode. All LK_* flags move from sys/lock.h to sys/vnode.h. Calls
to vlockmgr() in file systems get replaced with VOP_LOCK() or VOP_UNLOCK().

Welcome to 5.99.34.

Discussed on tech-kern.
 1.9 03-Sep-2008  gmcgarry branches: 1.9.14; 1.9.16;
Don't use unnamed structures.
 1.8 05-May-2008  ad branches: 1.8.2; 1.8.6;
- Convert hashinit() to use kmem_alloc(). The hash tables can be large
and it's better to not have them in kmem_map.
- Convert a couple of minor items along the way to kmem_alloc().
- Fix some memory leaks.
 1.7 30-Jan-2008  ad branches: 1.7.6; 1.7.8; 1.7.10;
Replace struct lock on vnodes with a simpler lock object built on
krwlock_t. This is a step towards removing lockmgr and simplifying
vnode locking. Discussed on tech-kern.
 1.6 25-Jan-2008  ad - Fix probelms with inode hash: make MPSAFE, don't allocate with held locks.
- Replace use of lockmgr().
 1.5 04-Jan-2008  ad Start detangling lock.h from intr.h. This is likely to cause short term
breakage, but the mess of dependencies has been regularly breaking the
build recently anyhow.
 1.4 02-Jan-2008  ad Merge vmlocking2 to head.
 1.3 11-Dec-2007  lukem use __KERNEL_RCSID()
 1.2 06-Mar-2007  dillo branches: 1.2.2; 1.2.4; 1.2.18; 1.2.20; 1.2.26; 1.2.28; 1.2.30; 1.2.32;
Complete rename of hfsp to hfs, requested by thorpej.
 1.1 06-Mar-2007  dillo Rename files from hfsp to hfs.
 1.2.32.3 08-Jan-2008  bouyer Sync with HEAD
 1.2.32.2 02-Jan-2008  bouyer Sync with HEAD
 1.2.32.1 13-Dec-2007  bouyer Sync with HEAD
 1.2.30.1 11-Dec-2007  yamt sync with head.
 1.2.28.2 26-Dec-2007  ad Sync with head.
 1.2.28.1 04-Dec-2007  ad Pull the vmlocking changes into a new branch.
 1.2.26.1 18-Feb-2008  mjf Sync with HEAD.
 1.2.20.4 04-Feb-2008  yamt sync with head.
 1.2.20.3 21-Jan-2008  yamt sync with head
 1.2.20.2 03-Sep-2007  yamt sync with head.
 1.2.20.1 06-Mar-2007  yamt file hfs_nhash.c was added on branch yamt-lazymbuf on 2007-09-03 14:40:20 +0000
 1.2.18.2 23-Mar-2008  matt sync with HEAD
 1.2.18.1 09-Jan-2008  matt sync with HEAD
 1.2.4.2 12-Mar-2007  rmind Sync with HEAD (missed new files in previous).
 1.2.4.1 06-Mar-2007  rmind file hfs_nhash.c was added on branch yamt-idlelwp on 2007-03-12 06:14:52 +0000
 1.2.2.1 05-Apr-2007  ad Compile fixes.
 1.7.10.3 11-Aug-2010  yamt sync with head.
 1.7.10.2 04-May-2009  yamt sync with head.
 1.7.10.1 16-May-2008  yamt sync with head.
 1.7.8.1 18-May-2008  yamt sync with head.
 1.7.6.2 28-Sep-2008  mjf Sync with HEAD.
 1.7.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.8.6.1 19-Oct-2008  haad Sync with HEAD.
 1.8.2.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.9.16.3 05-Mar-2011  rmind sync with head
 1.9.16.2 03-Jul-2010  rmind sync with head
 1.9.16.1 16-Mar-2010  rmind Change struct uvm_object::vmobjlock to be dynamically allocated with
mutex_obj_alloc(). It allows us to share the locks among UVM objects.
 1.9.14.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.11.6.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.12.16.1 18-May-2014  rmind sync with head
 1.12.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.12.2.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.19 21-Jun-2015  maxv KNF
 1.18 28-Mar-2015  maxv Remove the 'cred' argument from bread(). Remove a now unused var in
ffs_snapshot.c. Update the man page accordingly.

ok hannken@
 1.17 14-Nov-2011  hannken branches: 1.17.10; 1.17.28;
VOP_OPEN() needs a locked vnode. All these copy-and-pasted xxxfs_mount()
implementations need more review.
 1.16 13-Nov-2011  christos use getdisksize()
 1.15 24-Feb-2011  christos branches: 1.15.4;
simplify and handle unaligned pointer access.
 1.14 24-Jun-2010  hannken branches: 1.14.2; 1.14.4;
Clean up vnode lock operations pass 2:

VOP_UNLOCK(vp, flags) -> VOP_UNLOCK(vp): Remove the unneeded flags argument.

Welcome to 5.99.32.

Discussed on tech-kern.
 1.13 27-Nov-2009  pooka branches: 1.13.2; 1.13.4;
Yes, you need a VOP_UNLOCK() there.
 1.12 26-Mar-2009  pooka pretend to do some sort of cleanup in error branches
 1.11 16-Nov-2008  pooka branches: 1.11.4;
more <sys/buf.h> police
 1.10 03-Sep-2008  gmcgarry branches: 1.10.2;
Don't use unnamed structures.
 1.9 16-May-2008  hannken branches: 1.9.4;
Make sure all cached buffers with valid, not yet written data have been
run through copy-on-write. Call fscow_run() with valid data where possible.

The LP_UFSCOW hack is no longer needed to protect ffs_copyonwrite() against
endless recursion.

- Add a flag B_MODIFY to bread(), breada() and breadn(). If set the caller
intends to modify the buffer returned.

- Always run copy-on-write on buffers returned from ffs_balloc().

- Add new function ffs_getblk() that gets a buffer, assigns a new blkno,
may clear the buffer and runs copy-on-write. Process possible errors
from getblk() or fscow_run(). Part of PR kern/38664.

Welcome to 4.99.63

Reviewed by: YAMAMOTO Takashi <yamt@netbsd.org>
 1.8 24-Jan-2008  ad branches: 1.8.6; 1.8.8; 1.8.10; 1.8.12;
specfs changes for PR kern/37717 (raidclose() is no longer called on
shutdown). There are still problems with device access and a PR will be
filed.

- Kill checkalias(). Allow multiple vnodes to reference a single device.

- Don't play dangerous tricks with block vnodes to ensure that only one
vnode can describe a block device. Instead, prohibit concurrent opens of
block devices. As a bonus remove the unreliable code that prevents
multiple file system mounts on the same device. It's no longer needed.

- Track opens by vnode and by device. Issue cdev_close() when the last open
goes away, instead of abusing vnode::v_usecount to tell if the device is
open.
 1.7 02-Jan-2008  ad Merge vmlocking2 to head.
 1.6 26-Nov-2007  pooka branches: 1.6.2; 1.6.6;
Remove the "struct lwp *" argument from all VFS and VOP interfaces.
The general trend is to remove it from all kernel interfaces and
this is a start. In case the calling lwp is desired, curlwp should
be used.

quick consensus on tech-kern
 1.5 10-Oct-2007  ad branches: 1.5.4;
Merge from vmlocking:

- Split vnode::v_flag into three fields, depending on field locking.
- simple_lock -> kmutex in a few places.
- Fix some simple locking problems.
 1.4 08-Oct-2007  ad Merge brelse() changes from the vmlocking branch.
 1.3 22-Mar-2007  dillo branches: 1.3.8; 1.3.10; 1.3.12; 1.3.14;
Add support for HFS Wrapper (HFS+ volume inside an HFS volume).
Remove offset argument, we should now find an HFS+ volume in any
of its standard places.

Based on work from and test image provided by Pelle Johansson.
 1.2 06-Mar-2007  dillo branches: 1.2.2; 1.2.4; 1.2.6; 1.2.8;
Complete rename of hfsp to hfs, requested by thorpej.
 1.1 06-Mar-2007  dillo Rename files from hfsp to hfs.
 1.2.8.1 29-Mar-2007  reinoud Pullup to -current
 1.2.6.1 11-Jul-2007  mjf Sync with head.
 1.2.4.3 24-Mar-2007  yamt sync with head.
 1.2.4.2 12-Mar-2007  rmind Sync with HEAD (missed new files in previous).
 1.2.4.1 06-Mar-2007  rmind file hfs_subr.c was added on branch yamt-idlelwp on 2007-03-12 06:14:52 +0000
 1.2.2.5 23-Oct-2007  ad Sync with head.
 1.2.2.4 16-Sep-2007  ad Checkpoint work in progress on the vnode lifecycle and reference counting
stuff. This makes it work properly without kernel_lock and fixes a few
quite old bugs. See vfs_subr.c 1.283.2.17 for details.
 1.2.2.3 17-Jun-2007  ad - Increase the number of thread priorities from 128 to 256. How the space
is set up is to be revisited.
- Implement soft interrupts as kernel threads. A generic implementation
is provided, with hooks for fast-path MD code that can run the interrupt
threads over the top of other threads executing in the kernel.
- Split vnode::v_flag into three fields, depending on how the flag is
locked (by the interlock, by the vnode lock, by the file system).
- Miscellaneous locking fixes and improvements.
 1.2.2.2 13-May-2007  ad - Pass the error number and residual count to biodone(), and let it handle
setting error indicators. Prepare to eliminate B_ERROR.
- Add a flag argument to brelse() to be set into the buf's flags, instead
of doing it directly. Typically used to set B_INVAL.
- Add a "struct cpu_info *" argument to kthread_create(), to be used to
create bound threads. Change "bool mpsafe" to "int flags".
- Allow exit of LWPs in the IDL state when (l != curlwp).
- More locking fixes & conversion to the new API.
 1.2.2.1 10-Apr-2007  ad Sync with head.
 1.3.14.1 14-Oct-2007  yamt sync with head.
 1.3.12.6 04-Feb-2008  yamt sync with head.
 1.3.12.5 21-Jan-2008  yamt sync with head
 1.3.12.4 07-Dec-2007  yamt sync with head
 1.3.12.3 27-Oct-2007  yamt sync with head.
 1.3.12.2 03-Sep-2007  yamt sync with head.
 1.3.12.1 22-Mar-2007  yamt file hfs_subr.c was added on branch yamt-lazymbuf on 2007-09-03 14:40:20 +0000
 1.3.10.3 23-Mar-2008  matt sync with HEAD
 1.3.10.2 09-Jan-2008  matt sync with HEAD
 1.3.10.1 06-Nov-2007  matt sync with HEAD
 1.3.8.2 27-Nov-2007  joerg Sync with HEAD. amd64 Xen support needs testing.
 1.3.8.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.5.4.2 18-Feb-2008  mjf Sync with HEAD.
 1.5.4.1 08-Dec-2007  mjf Sync with HEAD.
 1.6.6.1 02-Jan-2008  bouyer Sync with HEAD
 1.6.2.1 04-Dec-2007  ad Pull the vmlocking changes into a new branch.
 1.8.12.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.8.12.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.8.10.3 11-Aug-2010  yamt sync with head.
 1.8.10.2 11-Mar-2010  yamt sync with head
 1.8.10.1 04-May-2009  yamt sync with head.
 1.8.8.1 18-May-2008  yamt sync with head.
 1.8.6.3 17-Jan-2009  mjf Sync with HEAD.
 1.8.6.2 28-Sep-2008  mjf Sync with HEAD.
 1.8.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.9.4.2 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.9.4.1 19-Oct-2008  haad Sync with HEAD.
 1.10.2.2 28-Apr-2009  skrll Sync with HEAD.
 1.10.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.11.4.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.13.4.2 05-Mar-2011  rmind sync with head
 1.13.4.1 03-Jul-2010  rmind sync with head
 1.13.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.14.4.1 05-Mar-2011  bouyer Sync with HEAD
 1.14.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.15.4.1 17-Apr-2012  yamt sync with head
 1.17.28.2 22-Sep-2015  skrll Sync with HEAD
 1.17.28.1 06-Apr-2015  skrll Sync with HEAD
 1.17.10.1 03-Dec-2017  jdolecek update from HEAD
 1.38 19-Mar-2022  hannken Remove now unused VV_LOCKSWORK, all file systems support locking.

Remove unused predicates vn_locked() and vn_anylocked().

Welcome to 9.99.95
 1.37 28-Feb-2020  kamil Avoid undefined behavior in left shift semantics

hfs_vfsops.c:477:19, left shift of 1 by 31 places cannot be represented in type 'int'
 1.36 17-Jan-2020  ad VFS_VGET(), VFS_ROOT(), VFS_FHTOVP(): give them a "int lktype" argument, to
allow us to get shared locks (or no lock) on the returned vnode. Matches
FreeBSD.
 1.35 10-Dec-2018  maxv branches: 1.35.6;
Remove unused mbuf.h includes.
 1.34 17-Feb-2017  hannken branches: 1.34.4; 1.34.12; 1.34.14;
Add generic genfs_suspendctl() and use it for all file systems.
Layered file systems need work.
 1.33 29-Dec-2014  maxv branches: 1.33.2; 1.33.4;
Small cleanup:
- KNF
- malloc + memset -> malloc(|M_ZERO)
- no need to check data == NULL
 1.32 10-Aug-2014  hannken branches: 1.32.4;
Change hfs from hashlist to vcache.
- use (cnid, fork) as key.
- use pool for hfs nodes.
 1.31 16-Apr-2014  maxv An (un)privileged user can easily make the kernel dereference a NULL
pointer.

The kernel allows 'data' to be NULL; it's the fs's responsibility to
ensure that it isn't NULL (if the fs actually needs data).

ok christos@
 1.30 23-Mar-2014  hannken branches: 1.30.2;
Change all vfsops to use C99 designated initializers.

No functional changes intended.
 1.29 13-Jun-2012  joerg branches: 1.29.2; 1.29.4;
Ensure that error is initialized in all code paths.
 1.28 13-Mar-2012  elad Replace the remaining KAUTH_GENERIC_ISSUSER authorization calls with
something meaningful. All relevant documentation has been updated or
written.

Most of these changes were brought up in the following messages:

http://mail-index.netbsd.org/tech-kern/2012/01/18/msg012490.html
http://mail-index.netbsd.org/tech-kern/2012/01/19/msg012502.html
http://mail-index.netbsd.org/tech-kern/2012/02/17/msg012728.html

Thanks to christos, manu, njoly, and jmmv for input.

Huge thanks to pgoyette for spinning these changes through some build
cycles and ATF.
 1.27 12-Jun-2011  rmind branches: 1.27.2; 1.27.6; 1.27.8;
Welcome to 5.99.53! Merge rmind-uvmplock branch:

- Reorganize locking in UVM and provide extra serialisation for pmap(9).
New lock order: [vmpage-owner-lock] -> pmap-lock.

- Simplify locking in some pmap(9) modules by removing P->V locking.

- Use lock object on vmobjlock (and thus vnode_t::v_interlock) to share
the locks amongst UVM objects where necessary (tmpfs, layerfs, unionfs).

- Rewrite and optimise x86 TLB shootdown code, make it simpler and cleaner.
Add TLBSTATS option for x86 to collect statistics about TLB shootdowns.

- Unify /dev/mem et al in MI code and provide required locking (removes
kernel-lock on some ports). Also, avoid cache-aliasing issues.

Thanks to Andrew Doran and Joerg Sonnenberger, as their initial patches
formed the core changes of this branch.
 1.26 24-Jun-2010  hannken branches: 1.26.6;
Clean up vnode lock operations pass 2:

VOP_UNLOCK(vp, flags) -> VOP_UNLOCK(vp): Remove the unneeded flags argument.

Welcome to 5.99.32.

Discussed on tech-kern.
 1.25 08-Jan-2010  pooka branches: 1.25.2; 1.25.4;
The VATTR_NULL/VREF/VHOLD/HOLDRELE() macros lost their will to live
years ago when the kernel was modified to not alter ABI based on
DIAGNOSTIC, and now just call the respective function interfaces
(in lowercase). Plenty of mix'n match upper/lowercase has creeped
into the tree since then. Nuke the macros and convert all callsites
to lowercase.

no functional change
 1.24 03-Dec-2009  pooka vrele, not vput for unlocked devvp
 1.23 27-Nov-2009  pooka Fix another fine example of "if you make the kernel panic, it's
more secure".
 1.22 29-Jun-2009  dholland Convert 67 namei call sites to use namei_simple, in these functions:

check_console, veriexecclose, veriexec_delete, veriexec_file_add,
emul_find_root, coff_load_shlib (sh3 version), coff_load_shlib,
compat_20_sys_statfs, compat_20_netbsd32_statfs,
ELFNAME2(netbsd32,probe_noteless), darwin_sys_statfs,
ibcs2_sys_statfs, ibcs2_sys_statvfs, linux_sys_uselib,
osf1_sys_statfs, sunos_sys_statfs, sunos32_sys_statfs,
ultrix_sys_statfs, do_sys_mount, fss_create_files (3 of 4),
adosfs_mount, cd9660_mount, coda_ioctl, coda_mount, ext2fs_mount,
ffs_mount, filecore_mount, hfs_mount, lfs_mount, msdosfs_mount,
ntfs_mount, sysvbfs_mount, udf_mount, union_mount, sys_chflags,
sys_lchflags, sys_chmod, sys_lchmod, sys_chown, sys_lchown,
sys___posix_chown, sys___posix_lchown, sys_link, do_sys_pstatvfs,
sys_quotactl, sys_revoke, sys_truncate, do_sys_utimes, sys_extattrctl,
sys_extattr_set_file, sys_extattr_set_link, sys_extattr_get_file,
sys_extattr_get_link, sys_extattr_delete_file,
sys_extattr_delete_link, sys_extattr_list_file, sys_extattr_list_link,
sys_setxattr, sys_lsetxattr, sys_getxattr, sys_lgetxattr,
sys_listxattr, sys_llistxattr, sys_removexattr, sys_lremovexattr

All have been scrutinized (several times, in fact) and compile-tested,
but not all have been explicitly tested in action.

XXX: While I haven't (intentionally) changed the use or nonuse of
XXX: TRYEMULROOT in any of these places, I'm not convinced all the
XXX: uses are correct; an audit might be desirable.
 1.21 25-Apr-2009  elad Add genfs_can_mount() and use it to prevent some more code duplication of
the security checks when mounting a device (VOP_ACCESS() + kauth(9) call)).

Proposed with no objections on tech-kern@:

http://mail-index.netbsd.org/tech-kern/2009/04/20/msg004859.html

The vnode is always expected to be locked, so no locking is done outside
the file-system code.
 1.20 17-Dec-2008  cegger branches: 1.20.2;
kill MALLOC and FREE macros.
 1.19 03-Sep-2008  gmcgarry branches: 1.19.2; 1.19.4; 1.19.12; 1.19.16;
Don't use unnamed structures.
 1.18 10-May-2008  rumble branches: 1.18.4;
Convert file systems to dynamically attach with the new module interface.
Make VFS hooks dynamic while we're here and say farewell to VFS_ATTACH and
VFS_HOOKS_ATTACH linksets.

As a consequence, most of the file systems can now be loaded as new style
modules.

Quick sanity check by ad@.
 1.17 29-Apr-2008  ad branches: 1.17.2;
PR kern/38057 ffs makes assuptions about devvp file system
PR kern/33406 softdeps get stuck in endless loop

Introduce VFS_FSYNC() and call it when syncing a block device, if it
has a mounted file system.
 1.16 28-Jan-2008  dholland branches: 1.16.6; 1.16.8; 1.16.10;
Fix some race conditions in rename.
Introduce a per-FS rename lock and new vfsops to manipulate it.
Get this lock while renaming. Also add another relookup() in do_sys_rename,
which is a hack to kludge around some of the worst deficiencies of
ufs_rename.
reviewed-by: pooka (and an earlier rev by ad)
posted on tech-kern with no objections.
 1.15 25-Jan-2008  ad - Fix probelms with inode hash: make MPSAFE, don't allocate with held locks.
- Replace use of lockmgr().
 1.14 24-Jan-2008  ad specfs changes for PR kern/37717 (raidclose() is no longer called on
shutdown). There are still problems with device access and a PR will be
filed.

- Kill checkalias(). Allow multiple vnodes to reference a single device.

- Don't play dangerous tricks with block vnodes to ensure that only one
vnode can describe a block device. Instead, prohibit concurrent opens of
block devices. As a bonus remove the unreliable code that prevents
multiple file system mounts on the same device. It's no longer needed.

- Track opens by vnode and by device. Issue cdev_close() when the last open
goes away, instead of abusing vnode::v_usecount to tell if the device is
open.
 1.13 08-Dec-2007  pooka Remove cn_lwp from struct componentname. curlwp should be used
from on. The NDINIT() macro no longer takes the lwp parameter and
associates the credentials of the calling thread with the namei
structure.
 1.12 26-Nov-2007  pooka branches: 1.12.2;
Remove the "struct lwp *" argument from all VFS and VOP interfaces.
The general trend is to remove it from all kernel interfaces and
this is a start. In case the calling lwp is desired, curlwp should
be used.

quick consensus on tech-kern
 1.11 25-Nov-2007  pooka * Use vfs_stdextattrctl instead of a homegrown version. Also fixes
a bug: the homegrown version neglected to unlock vp
* don't reimplement eopnotsupp()
* init genfs_node earlier vget, protects against error paths in vget
from attempting to destroy a non-inited node
 1.10 10-Oct-2007  ad branches: 1.10.4;
Merge from vmlocking:

- Split vnode::v_flag into three fields, depending on field locking.
- simple_lock -> kmutex in a few places.
- Fix some simple locking problems.
 1.9 31-Jul-2007  pooka branches: 1.9.2; 1.9.4; 1.9.6; 1.9.8; 1.9.10;
* nuke the nameidata parameter from VFS_MOUNT(). Nobody on tech-kern
knew what it was supposed to be used for and wrstuden gave a go-ahead
* while rototilling, convert file systems which went easily to
use VFS_PROTOS() instead of manually prototyping the methods
 1.8 26-Jul-2007  pooka Use eopnotsupp() instead of vfs_stdsuspendctl() and retire the latter.
 1.7 17-Jul-2007  pooka branches: 1.7.2;
Make set_statvfs_info() take a parameter for the vfs name instead
of always retrieving it from mp->mnt_op->vfs_name

christos ok
 1.6 12-Jul-2007  dsl Change the VFS_MOUNT() interface so that the 'data' buffer passed to the
fs code is a kernel buffer, pass though the length of the buffer as well.
Since the length of the userspace buffer isn'it (yet) passed through the mount
system call, add a field to the vfsops structure containing the default length.
Split sys_mount() for calls from compat code.
Ride one of the recent kernel version changes - old fs LKMs will load, but
sys_mount() will reject any attempt to use them.
 1.5 30-Jun-2007  pooka Using POOL_INIT here makes no sense, since file systems always have
an init method. So get rid of it and #ifdef _LKM and just always
init in the init method. Give malloc types the same treatment.
Makes file systems nicer to work with in linksetless environments
and fixes a few LKM discrepancies.
 1.4 22-Mar-2007  dillo Add support for HFS Wrapper (HFS+ volume inside an HFS volume).
Remove offset argument, we should now find an HFS+ volume in any
of its standard places.

Based on work from and test image provided by Pelle Johansson.
 1.3 19-Mar-2007  dillo args.path is in UIO_USERSPACE too.
Fixes statvfs on macppc and PR kern/36012.
Thanks to Magnus Henoch for testing.
 1.2 06-Mar-2007  dillo branches: 1.2.2; 1.2.4; 1.2.6; 1.2.8;
Complete rename of hfsp to hfs, requested by thorpej.
 1.1 06-Mar-2007  dillo Rename files from hfsp to hfs.
 1.2.8.1 29-Mar-2007  reinoud Pullup to -current
 1.2.6.1 11-Jul-2007  mjf Sync with head.
 1.2.4.3 24-Mar-2007  yamt sync with head.
 1.2.4.2 12-Mar-2007  rmind Sync with HEAD (missed new files in previous).
 1.2.4.1 06-Mar-2007  rmind file hfs_vfsops.c was added on branch yamt-idlelwp on 2007-03-12 06:14:52 +0000
 1.2.2.5 23-Oct-2007  ad Sync with head.
 1.2.2.4 20-Aug-2007  ad Sync with HEAD.
 1.2.2.3 15-Jul-2007  ad Sync with head.
 1.2.2.2 17-Jun-2007  ad - Increase the number of thread priorities from 128 to 256. How the space
is set up is to be revisited.
- Implement soft interrupts as kernel threads. A generic implementation
is provided, with hooks for fast-path MD code that can run the interrupt
threads over the top of other threads executing in the kernel.
- Split vnode::v_flag into three fields, depending on how the flag is
locked (by the interlock, by the vnode lock, by the file system).
- Miscellaneous locking fixes and improvements.
 1.2.2.1 10-Apr-2007  ad Sync with head.
 1.7.2.1 15-Aug-2007  skrll Sync with HEAD.
 1.9.10.2 31-Jul-2007  pooka * nuke the nameidata parameter from VFS_MOUNT(). Nobody on tech-kern
knew what it was supposed to be used for and wrstuden gave a go-ahead
* while rototilling, convert file systems which went easily to
use VFS_PROTOS() instead of manually prototyping the methods
 1.9.10.1 31-Jul-2007  pooka file hfs_vfsops.c was added on branch matt-mips64 on 2007-07-31 21:14:18 +0000
 1.9.8.1 14-Oct-2007  yamt sync with head.
 1.9.6.6 04-Feb-2008  yamt sync with head.
 1.9.6.5 21-Jan-2008  yamt sync with head
 1.9.6.4 07-Dec-2007  yamt sync with head
 1.9.6.3 27-Oct-2007  yamt sync with head.
 1.9.6.2 03-Sep-2007  yamt sync with head.
 1.9.6.1 31-Jul-2007  yamt file hfs_vfsops.c was added on branch yamt-lazymbuf on 2007-09-03 14:40:21 +0000
 1.9.4.3 23-Mar-2008  matt sync with HEAD
 1.9.4.2 09-Jan-2008  matt sync with HEAD
 1.9.4.1 06-Nov-2007  matt sync with HEAD
 1.9.2.3 09-Dec-2007  jmcneill Sync with HEAD.
 1.9.2.2 27-Nov-2007  joerg Sync with HEAD. amd64 Xen support needs testing.
 1.9.2.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.10.4.3 18-Feb-2008  mjf Sync with HEAD.
 1.10.4.2 27-Dec-2007  mjf Sync with HEAD.
 1.10.4.1 08-Dec-2007  mjf Sync with HEAD.
 1.12.2.1 26-Dec-2007  ad Sync with head.
 1.16.10.5 11-Aug-2010  yamt sync with head.
 1.16.10.4 11-Mar-2010  yamt sync with head
 1.16.10.3 18-Jul-2009  yamt sync with head.
 1.16.10.2 04-May-2009  yamt sync with head.
 1.16.10.1 16-May-2008  yamt sync with head.
 1.16.8.1 18-May-2008  yamt sync with head.
 1.16.6.3 17-Jan-2009  mjf Sync with HEAD.
 1.16.6.2 28-Sep-2008  mjf Sync with HEAD.
 1.16.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.17.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.17.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.18.4.1 19-Oct-2008  haad Sync with HEAD.
 1.19.16.1 28-Apr-2014  sborrill Pull up the following revisions(s) (requested by maxv in ticket #1901):
sys/kern/vfs_syscalls.c: revision 1.478, 1.480 via patch
sys/coda/coda_vfsops.c: revision 1.81
sys/fs/adosfs/advfsops.c: revision 1.70
sys/fs/cd9660/cd9660_vfsops.c: revision 1.84
sys/fs/efs/efs_vfsops.c: revision 1.25
sys/fs/filecorefs/filecore_vfsops.c: revision 1.76
sys/fs/hfs/hfs_vfsops.c: revision 1.31
sys/fs/msdosfs/msdosfs_vfsops.c: revision 1.107
sys/fs/ntfs/ntfs_vfsops.c: revision 1.94
sys/fs/ptyfs/ptyfs_vfsops.c: revision 1.50 via patch
sys/fs/puffs/puffs_vfsops.c: revision 1.110 via patch
sys/fs/smbfs/smbfs_vfsops.c: revision 1.100
sys/fs/sysvbfs/sysvbfs_vfsops.c: revision 1.43
sys/fs/tmpfs/tmpfs_vfsops.c: revision 1.59 via patch
sys/fs/udf/udf_vfsops.c: revision 1.67
sys/fs/union/union_vfsops.c: revision 1.72
sys/fs/unionfs/unionfs_vfsops.c: revision 1.13
sys/kern/vfs_syscalls.c: revision 1.479
sys/miscfs/nullfs/null_vfsops.c: revision 1.88 via patch
sys/miscfs/overlay/overlay_vfsops.c: revision 1.61
sys/miscfs/procfs/procfs_vfsops.c: revision 1.91
sys/miscfs/umapfs/umap_vfsops.c: revision 1.92
sys/nfs/nfs_vfsops.c: revision 1.227
sys/ufs/ext2fs/ext2fs_vfsops.c: revision 1.180
sys/ufs/ffs/ffs_vfsops.c: revision 1.297
sys/ufs/lfs/lfs_vfsops.c: revision 1.321
sys/ufs/mfs/mfs_vfsops.c: revision 1.107

Due to missing checks in the mount syscall, and a wrong assumption on the
file systems side, the kernel could allocate an unbounded or zero-sized
memory buffer, and could dereference a NULL pointer when particular
arguments are given by a user.
 1.19.12.1 28-Apr-2014  sborrill Pull up the following revisions(s) (requested by maxv in ticket #1901):
sys/kern/vfs_syscalls.c: revision 1.478, 1.480 via patch
sys/coda/coda_vfsops.c: revision 1.81
sys/fs/adosfs/advfsops.c: revision 1.70
sys/fs/cd9660/cd9660_vfsops.c: revision 1.84
sys/fs/efs/efs_vfsops.c: revision 1.25
sys/fs/filecorefs/filecore_vfsops.c: revision 1.76
sys/fs/hfs/hfs_vfsops.c: revision 1.31
sys/fs/msdosfs/msdosfs_vfsops.c: revision 1.107
sys/fs/ntfs/ntfs_vfsops.c: revision 1.94
sys/fs/ptyfs/ptyfs_vfsops.c: revision 1.50 via patch
sys/fs/puffs/puffs_vfsops.c: revision 1.110 via patch
sys/fs/smbfs/smbfs_vfsops.c: revision 1.100
sys/fs/sysvbfs/sysvbfs_vfsops.c: revision 1.43
sys/fs/tmpfs/tmpfs_vfsops.c: revision 1.59 via patch
sys/fs/udf/udf_vfsops.c: revision 1.67
sys/fs/union/union_vfsops.c: revision 1.72
sys/fs/unionfs/unionfs_vfsops.c: revision 1.13
sys/kern/vfs_syscalls.c: revision 1.479
sys/miscfs/nullfs/null_vfsops.c: revision 1.88 via patch
sys/miscfs/overlay/overlay_vfsops.c: revision 1.61
sys/miscfs/procfs/procfs_vfsops.c: revision 1.91
sys/miscfs/umapfs/umap_vfsops.c: revision 1.92
sys/nfs/nfs_vfsops.c: revision 1.227
sys/ufs/ext2fs/ext2fs_vfsops.c: revision 1.180
sys/ufs/ffs/ffs_vfsops.c: revision 1.297
sys/ufs/lfs/lfs_vfsops.c: revision 1.321
sys/ufs/mfs/mfs_vfsops.c: revision 1.107

Due to missing checks in the mount syscall, and a wrong assumption on the
file systems side, the kernel could allocate an unbounded or zero-sized
memory buffer, and could dereference a NULL pointer when particular
arguments are given by a user.
 1.19.4.1 25-Apr-2014  sborrill Pull up the following revisions(s) (requested by maxv in ticket #1901):
sys/kern/vfs_syscalls.c: revision 1.478, 1.480 via patch
sys/coda/coda_vfsops.c: revision 1.81
sys/fs/adosfs/advfsops.c: revision 1.70
sys/fs/cd9660/cd9660_vfsops.c: revision 1.84
sys/fs/efs/efs_vfsops.c: revision 1.25
sys/fs/filecorefs/filecore_vfsops.c: revision 1.76
sys/fs/hfs/hfs_vfsops.c: revision 1.31
sys/fs/msdosfs/msdosfs_vfsops.c: revision 1.107
sys/fs/ntfs/ntfs_vfsops.c: revision 1.94
sys/fs/ptyfs/ptyfs_vfsops.c: revision 1.50 via patch
sys/fs/puffs/puffs_vfsops.c: revision 1.110 via patch
sys/fs/smbfs/smbfs_vfsops.c: revision 1.100
sys/fs/sysvbfs/sysvbfs_vfsops.c: revision 1.43
sys/fs/tmpfs/tmpfs_vfsops.c: revision 1.59 via patch
sys/fs/udf/udf_vfsops.c: revision 1.67
sys/fs/union/union_vfsops.c: revision 1.72
sys/fs/unionfs/unionfs_vfsops.c: revision 1.13
sys/kern/vfs_syscalls.c: revision 1.479
sys/miscfs/nullfs/null_vfsops.c: revision 1.88 via patch
sys/miscfs/overlay/overlay_vfsops.c: revision 1.61
sys/miscfs/procfs/procfs_vfsops.c: revision 1.91
sys/miscfs/umapfs/umap_vfsops.c: revision 1.92
sys/nfs/nfs_vfsops.c: revision 1.227
sys/ufs/ext2fs/ext2fs_vfsops.c: revision 1.180
sys/ufs/ffs/ffs_vfsops.c: revision 1.297
sys/ufs/lfs/lfs_vfsops.c: revision 1.321
sys/ufs/mfs/mfs_vfsops.c: revision 1.107

Due to missing checks in the mount syscall, and a wrong assumption on the
file systems side, the kernel could allocate an unbounded or zero-sized
memory buffer, and could dereference a NULL pointer when particular
arguments are given by a user.
 1.19.2.2 28-Apr-2009  skrll Sync with HEAD.
 1.19.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.20.2.2 23-Jul-2009  jym Sync with HEAD.
 1.20.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.25.4.3 21-May-2011  rmind Fix the build.
 1.25.4.2 19-May-2011  rmind Implement sharing of vnode_t::v_interlock amongst vnodes:
- Lock is shared amongst UVM objects using uvm_obj_setlock() or getnewvnode().
- Adjust vnode cache to handle unsharing, add VI_LOCKSHARE flag for that.
- Use sharing in tmpfs and layerfs for underlying object.
- Simplify locking in ubc_fault().
- Sprinkle some asserts.

Discussed with ad@.
 1.25.4.1 03-Jul-2010  rmind sync with head
 1.25.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.26.6.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.27.8.2 21-Apr-2014  bouyer Pull up following revision(s) (requested by maxv in ticket #1050):
sys/ufs/chfs/chfs_vfsops.c: revision 1.11
sys/fs/unionfs/unionfs_vfsops.c: revision 1.13
sys/fs/nilfs/nilfs_vfsops.c: revision 1.16
sys/ufs/mfs/mfs_vfsops.c: revision 1.107
sys/fs/sysvbfs/sysvbfs_vfsops.c: revision 1.43
sys/ufs/ffs/ffs_vfsops.c: revision 1.297
sys/kern/vfs_syscalls.c: revision 1.478
sys/kern/vfs_syscalls.c: revision 1.479
sys/fs/puffs/puffs_vfsops.c: revision 1.110
sys/fs/cd9660/cd9660_vfsops.c: revision 1.84
sys/nfs/nfs_vfsops.c: revision 1.227
sys/fs/v7fs/v7fs_vfsops.c: revision 1.10
sys/ufs/ext2fs/ext2fs_vfsops.c: revision 1.180
sys/miscfs/umapfs/umap_vfsops.c: revision 1.92
sys/fs/filecorefs/filecore_vfsops.c: revision 1.76
sys/miscfs/nullfs/null_vfsops.c: revision 1.88
sys/fs/ptyfs/ptyfs_vfsops.c: revision 1.50
sys/coda/coda_vfsops.c: revision 1.81
sys/ufs/lfs/lfs_vfsops.c: revision 1.321
sys/fs/tmpfs/tmpfs_vfsops.c: revision 1.59
sys/fs/hfs/hfs_vfsops.c: revision 1.31
sys/miscfs/overlay/overlay_vfsops.c: revision 1.61
sys/fs/union/union_vfsops.c: revision 1.72
sys/fs/ntfs/ntfs_vfsops.c: revision 1.94
sys/kern/vfs_syscalls.c: revision 1.480
sys/fs/efs/efs_vfsops.c: revision 1.25
sys/kern/vfs_syscalls.c: revision 1.482
sys/fs/msdosfs/msdosfs_vfsops.c: revision 1.107
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.12
sys/miscfs/procfs/procfs_vfsops.c: revision 1.91
sys/fs/smbfs/smbfs_vfsops.c: revision 1.100
sys/fs/adosfs/advfsops.c: revision 1.70
sys/fs/udf/udf_vfsops.c: revision 1.67
Limit check for 'data_len'. Otherwise a (un)privileged user can easily
panic the system by passing a huge size.
ok christos@
An (un)privileged user can easily make the kernel dereference a NULL
pointer.
The kernel allows 'data' to be NULL; it's the fs's responsibility to
ensure that it isn't NULL (if the fs actually needs data).
ok christos@
Some fs's - like kernfs - set their vfs_min_mount_data to zero. Add a check
to prevent an (un)privileged user from requesting a zero-sized allocation
(and thus a panic).
This thing is totally buggy: 'data_len' is modified by the fs, so calling
kmem_free with it while its value has changed since the kmem_alloc is far
from being a good idea.
If the kernel figures out that something mismatches, it will panic
(typically with kernfs).
 1.27.8.1 24-Jun-2012  jdc branches: 1.27.8.1.4; 1.27.8.1.6;
Pull up revisions:
src/sys/fs/hfs/hfs_vfsops.c revision 1.29
src/sys/fs/sysvbfs/sysvbfs_vfsops.c revision 1.40
src/sys/fs/v7fs/v7fs_vfsops.c revision 1.7
(requested by joerg in ticket #344).
 1.27.8.1.6.1 21-Apr-2014  bouyer Pull up following revision(s) (requested by maxv in ticket #1050):
sys/ufs/chfs/chfs_vfsops.c: revision 1.11
sys/fs/unionfs/unionfs_vfsops.c: revision 1.13
sys/fs/nilfs/nilfs_vfsops.c: revision 1.16
sys/ufs/mfs/mfs_vfsops.c: revision 1.107
sys/fs/sysvbfs/sysvbfs_vfsops.c: revision 1.43
sys/ufs/ffs/ffs_vfsops.c: revision 1.297
sys/kern/vfs_syscalls.c: revision 1.478
sys/kern/vfs_syscalls.c: revision 1.479
sys/fs/puffs/puffs_vfsops.c: revision 1.110
sys/fs/cd9660/cd9660_vfsops.c: revision 1.84
sys/nfs/nfs_vfsops.c: revision 1.227
sys/fs/v7fs/v7fs_vfsops.c: revision 1.10
sys/ufs/ext2fs/ext2fs_vfsops.c: revision 1.180
sys/miscfs/umapfs/umap_vfsops.c: revision 1.92
sys/fs/filecorefs/filecore_vfsops.c: revision 1.76
sys/miscfs/nullfs/null_vfsops.c: revision 1.88
sys/fs/ptyfs/ptyfs_vfsops.c: revision 1.50
sys/coda/coda_vfsops.c: revision 1.81
sys/ufs/lfs/lfs_vfsops.c: revision 1.321
sys/fs/tmpfs/tmpfs_vfsops.c: revision 1.59
sys/fs/hfs/hfs_vfsops.c: revision 1.31
sys/miscfs/overlay/overlay_vfsops.c: revision 1.61
sys/fs/union/union_vfsops.c: revision 1.72
sys/fs/ntfs/ntfs_vfsops.c: revision 1.94
sys/kern/vfs_syscalls.c: revision 1.480
sys/fs/efs/efs_vfsops.c: revision 1.25
sys/kern/vfs_syscalls.c: revision 1.482
sys/fs/msdosfs/msdosfs_vfsops.c: revision 1.107
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.12
sys/miscfs/procfs/procfs_vfsops.c: revision 1.91
sys/fs/smbfs/smbfs_vfsops.c: revision 1.100
sys/fs/adosfs/advfsops.c: revision 1.70
sys/fs/udf/udf_vfsops.c: revision 1.67
Limit check for 'data_len'. Otherwise a (un)privileged user can easily
panic the system by passing a huge size.
ok christos@
An (un)privileged user can easily make the kernel dereference a NULL
pointer.
The kernel allows 'data' to be NULL; it's the fs's responsibility to
ensure that it isn't NULL (if the fs actually needs data).
ok christos@
Some fs's - like kernfs - set their vfs_min_mount_data to zero. Add a check
to prevent an (un)privileged user from requesting a zero-sized allocation
(and thus a panic).
This thing is totally buggy: 'data_len' is modified by the fs, so calling
kmem_free with it while its value has changed since the kmem_alloc is far
from being a good idea.
If the kernel figures out that something mismatches, it will panic
(typically with kernfs).
 1.27.8.1.4.1 21-Apr-2014  bouyer Pull up following revision(s) (requested by maxv in ticket #1050):
sys/ufs/chfs/chfs_vfsops.c: revision 1.11
sys/fs/unionfs/unionfs_vfsops.c: revision 1.13
sys/fs/nilfs/nilfs_vfsops.c: revision 1.16
sys/ufs/mfs/mfs_vfsops.c: revision 1.107
sys/fs/sysvbfs/sysvbfs_vfsops.c: revision 1.43
sys/ufs/ffs/ffs_vfsops.c: revision 1.297
sys/kern/vfs_syscalls.c: revision 1.478
sys/kern/vfs_syscalls.c: revision 1.479
sys/fs/puffs/puffs_vfsops.c: revision 1.110
sys/fs/cd9660/cd9660_vfsops.c: revision 1.84
sys/nfs/nfs_vfsops.c: revision 1.227
sys/fs/v7fs/v7fs_vfsops.c: revision 1.10
sys/ufs/ext2fs/ext2fs_vfsops.c: revision 1.180
sys/miscfs/umapfs/umap_vfsops.c: revision 1.92
sys/fs/filecorefs/filecore_vfsops.c: revision 1.76
sys/miscfs/nullfs/null_vfsops.c: revision 1.88
sys/fs/ptyfs/ptyfs_vfsops.c: revision 1.50
sys/coda/coda_vfsops.c: revision 1.81
sys/ufs/lfs/lfs_vfsops.c: revision 1.321
sys/fs/tmpfs/tmpfs_vfsops.c: revision 1.59
sys/fs/hfs/hfs_vfsops.c: revision 1.31
sys/miscfs/overlay/overlay_vfsops.c: revision 1.61
sys/fs/union/union_vfsops.c: revision 1.72
sys/fs/ntfs/ntfs_vfsops.c: revision 1.94
sys/kern/vfs_syscalls.c: revision 1.480
sys/fs/efs/efs_vfsops.c: revision 1.25
sys/kern/vfs_syscalls.c: revision 1.482
sys/fs/msdosfs/msdosfs_vfsops.c: revision 1.107
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c: revision 1.12
sys/miscfs/procfs/procfs_vfsops.c: revision 1.91
sys/fs/smbfs/smbfs_vfsops.c: revision 1.100
sys/fs/adosfs/advfsops.c: revision 1.70
sys/fs/udf/udf_vfsops.c: revision 1.67
Limit check for 'data_len'. Otherwise a (un)privileged user can easily
panic the system by passing a huge size.
ok christos@
An (un)privileged user can easily make the kernel dereference a NULL
pointer.
The kernel allows 'data' to be NULL; it's the fs's responsibility to
ensure that it isn't NULL (if the fs actually needs data).
ok christos@
Some fs's - like kernfs - set their vfs_min_mount_data to zero. Add a check
to prevent an (un)privileged user from requesting a zero-sized allocation
(and thus a panic).
This thing is totally buggy: 'data_len' is modified by the fs, so calling
kmem_free with it while its value has changed since the kmem_alloc is far
from being a good idea.
If the kernel figures out that something mismatches, it will panic
(typically with kernfs).
 1.27.6.1 05-Apr-2012  mrg sync to latest -current.
 1.27.2.3 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.27.2.2 30-Oct-2012  yamt sync with head
 1.27.2.1 17-Apr-2012  yamt sync with head
 1.29.4.1 18-May-2014  rmind sync with head
 1.29.2.2 03-Dec-2017  jdolecek update from HEAD
 1.29.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.30.2.1 10-Aug-2014  tls Rebase.
 1.32.4.2 28-Aug-2017  skrll Sync with HEAD
 1.32.4.1 06-Apr-2015  skrll Sync with HEAD
 1.33.4.1 21-Apr-2017  bouyer Sync with HEAD
 1.33.2.2 20-Mar-2017  pgoyette Sync with HEAD
 1.33.2.1 20-Jul-2016  pgoyette Adapt machine-independant code to the new {b,c}devsw reference-counting
(using localcount(9)). All callers of {b,c}devsw_lookup() now call
{b,c}devsw_lookup_acquire() which retains a reference on the 'struct
{b,c}devsw'. This reference must be released by the caller once it is
finished with the structure's content (or other data that would disappear
if the 'struct {b,c}devsw' were to disappear).
 1.34.14.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.34.14.1 10-Jun-2019  christos Sync with HEAD
 1.34.12.1 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.34.4.1 27-Apr-2017  pgoyette Restore all work from the former pgoyette-localcount branch (which is
now abandoned doe to cvs merge botch).

The branch now builds, and installs via anita. There are still some
problems (cgd is non-functional and all atf tests time-out) but they
will get resolved soon.
 1.35.6.2 29-Feb-2020  ad Sync with head.
 1.35.6.1 17-Jan-2020  ad Sync with head.
 1.40 06-Aug-2022  andvar s/blity/bility/ in various words, mainly in comments.
 1.39 18-Jul-2021  dholland Use macros for the canned parts of device and fifo vnode op tables.

Add GENFS_SPECOP_ENTRIES and GENFS_FIFOOP_ENTRIES macros that contain
the portion of the vnode ops table declaration that is
(conservatively) the same in every fs. Use these in every fs that
supports devices and/or fifos with separate ops tables.

Note that ptyfs works differently (it has one type of vnode with
open-coded dispatch to the specfs code, which I haven't changed in
this commit) and rump/librump/rumpvfs/rumpfs.c has an indirect dynamic
dispatch that already does more or less the same thing, which I also
haven't changed.

Also note that this anticipates a few bits in the next changeset here
and there, and adds missing but unreachable calls in some cases (e.g.
most fses weren't defining whiteout on devices and fifos, but it isn't
reachable there), and it changes parsepath on devices and fifos to
genfs_badop from genfs_parsepath (but it's not reachable there
either).

It appears that devices in kernfs were missing kqfilter, so it's
possible that if you try to use kqueue on /kern/rootdev that it'll
explode.

And finally note that the ops declaration tables aren't
order-dependent. (Other than vop_default_desc has to come first.)
Otherwise this wouldn't work.
 1.38 29-Jun-2021  dholland Implement VOP_PARSEPATH() for hfs.

This checks for a following "/rsrc" at the end of the pathname (to
indicate the resource fork of a file) and assimilates it into the
component name to be looked up. Then cn_namelen will already include
this text in lookup, and it's no longer necessary to muck with
cn_consume.

Invalid uses of "/rsrc" are ignored rather than rejected, which
appears to be the same as the old behavior. It is possible that the
parsepath logic should only consume the "/rsrc" if the name names a
file and not a directory, which would require looking it up in
parsepath and be a general nuisance; I hope not. It's also possible
that the whole thing doesn't work at all now, or it didn't before, as
I don't have any way to test it.
 1.37 29-Jun-2021  dholland - Add a new vnode op: VOP_PARSEPATH.
- Move namei_getcomponent to genfs_vnops.c and call it genfs_parsepath.
- Add a parsepath entry to every vnode ops table.

VOP_PARSEPATH takes a directory vnode to be searched and a complete
following path and chooses how much of that path to consume. To begin
with, all parsepath calls are genfs_parsepath, which locates the first
'/' as always.

Note that the call doesn't take the whole struct componentname, only
the string. The other bits of struct componentname should not be
needed and there's no reason to cause potential complications by
exposing them.
 1.36 16-May-2020  christos branches: 1.36.6;
Add ACL support for FFS. From FreeBSD.
 1.35 23-Apr-2020  ad PR kern/54759 (vm.ubc_direct deadlock when read()/write() into mapping of itself)

- Add new flag UBC_ISMAPPED which tells ubc_uiomove() the object is mmap()ed
somewhere. Use it to decide whether to do direct-mapped copy, rather than
poking around directly in the vnode in ubc_uiomove(), which is ugly and
doesn't work for tmpfs. It would be nicer to contain all this in UVM but
the filesystem provides the needed locking here (VV_MAPPED) and to
reinvent that would suck more.

- Rename UBC_UNMAP_FLAG() to UBC_VNODE_FLAGS(). Pass in UBC_ISMAPPED where
appropriate.
 1.34 26-May-2017  riastradh branches: 1.34.20;
Make VOP_RECLAIM do the last unlock of the vnode.

VOP_RECLAIM naturally has exclusive access to the vnode, so having it
locked on entry is not strictly necessary -- but it means if there
are any final operations that must be done on the vnode, such as
ffs_update, requiring exclusive access to it, we can now kassert that
the vnode is locked in those operations.

We can't just have the caller release the last lock because some file
systems don't use genfs_lock, and require the vnode to remain valid
for VOP_UNLOCK to work, notably unionfs.
 1.33 20-Aug-2016  hannken Remove now obsolete operation vcache_remove().

Welcome to 7.99.36
 1.32 21-Jun-2015  maxv KNF
 1.31 10-Aug-2014  hannken branches: 1.31.4;
Change hfs from hashlist to vcache.
- use (cnid, fork) as key.
- use pool for hfs nodes.
 1.30 25-Jul-2014  dholland Add VOP_FALLOCATE and VOP_FDISCARD to every vnode ops table I can
find.

The filesystem ones all call genfs_eopnotsupp - right now I am only
implementing the plumbing and we can implement fallocate and/or
fdiscard for files later.

The device ones call spec_fallocate (which is also genfs_eopnotsupp)
and spec_fdiscard, which dispatches to the device-level op.

The fifo ones all call vn_fifo_bypass, which also ends up being
EOPNOTSUPP.
 1.29 07-Feb-2014  hannken branches: 1.29.2;
Change vnode operation lookup to return the resulting vnode *vpp unlocked.
Change cache_lookup() to return an unlocked vnode.

Discussed on tech-kern@

Welcome to 6.99.31
 1.28 18-Oct-2013  christos remove unused variables
 1.27 18-Mar-2013  plunky branches: 1.27.6;
C99 section 6.7.2.3 (Tags) Note 3 states that:

A type specifier of the form

enum identifier

without an enumerator list shall only appear after the type it
specifies is complete.

which means that we cannot pass an "enum vtype" argument to
kauth_access_action() without fully specifying the type first.
Unfortunately there is a complicated include file loop which
makes that difficult, so convert this minimal function into a
macro (and capitalize it).

(ok elad@)
 1.26 22-Jul-2012  rmind branches: 1.26.2;
Move some the test for MAKEENTRY into the cache_enter(9). Make some
variables in vfs_cache.c static, __read_mostly, etc.

No objection on tech-kern@.
 1.25 13-Mar-2012  elad Replace the remaining KAUTH_GENERIC_ISSUSER authorization calls with
something meaningful. All relevant documentation has been updated or
written.

Most of these changes were brought up in the following messages:

http://mail-index.netbsd.org/tech-kern/2012/01/18/msg012490.html
http://mail-index.netbsd.org/tech-kern/2012/01/19/msg012502.html
http://mail-index.netbsd.org/tech-kern/2012/02/17/msg012728.html

Thanks to christos, manu, njoly, and jmmv for input.

Huge thanks to pgoyette for spinning these changes through some build
cycles and ATF.
 1.24 27-Sep-2011  christos branches: 1.24.2; 1.24.6; 1.24.8;
use NAME_MAX instead of MAXNAMLEN
 1.23 19-May-2011  rmind Remove cache_purge(9) calls from reclamation routines in the file systems,
as vclean(9) performs it for us since Lite2 merge.
 1.22 10-Feb-2011  christos remove comments about needing to encode : since the on disk format does
not allow them. Also fix reversed encoding in lookup. From Taylor R Campbell.
 1.21 10-Feb-2011  christos PR/44523: Taylor R Campbell: mount_hfs badly handles file names with slashes
in them, encode them as colons. XXX: Should encode : as :: too?
 1.20 07-Feb-2011  jakllsch Make this build.

Also, the previous commit contanined "unintended" functional changes I'm
going to ignore.
 1.19 07-Feb-2011  christos KNF, no functional changes intended.
 1.18 24-Jun-2010  hannken branches: 1.18.2; 1.18.4;
Clean up vnode lock operations pass 2:

VOP_UNLOCK(vp, flags) -> VOP_UNLOCK(vp): Remove the unneeded flags argument.

Welcome to 5.99.32.

Discussed on tech-kern.
 1.17 29-Mar-2010  pooka Stop exposing fifofs internals and leave only fifo_vnodeop_p visible.
 1.16 08-Jan-2010  pooka branches: 1.16.2; 1.16.4;
The VATTR_NULL/VREF/VHOLD/HOLDRELE() macros lost their will to live
years ago when the kernel was modified to not alter ABI based on
DIAGNOSTIC, and now just call the respective function interfaces
(in lowercase). Plenty of mix'n match upper/lowercase has creeped
into the tree since then. Nuke the macros and convert all callsites
to lowercase.

no functional change
 1.15 03-Jul-2009  elad Where possible, extract the file-system's access() routine to two internal
functions: the first checking if the operation is possible (regardless of
permissions), the second checking file-system permissions, ACLs, etc.

Mailing list reference:

http://mail-index.netbsd.org/tech-kern/2009/06/21/msg005311.html
 1.14 23-Jun-2009  elad Move the implementation of vaccess() to genfs_can_access(), in line with
the other routines of the same spirit.

Adjust file-system code to use it.

Keep vaccess() for KPI compatibility and to keep element of least
surprise. A "diagnostic" message warning that vaccess() is deprecated will
be printed when it's used (obviously, only in DIAGNOSTIC kernels).

No objections on tech-kern@:

http://mail-index.netbsd.org/tech-kern/2009/06/21/msg005310.html
 1.13 17-Dec-2008  cegger branches: 1.13.2;
kill MALLOC and FREE macros.
 1.12 26-Nov-2008  pooka Rototill all remaining file systems to use ubc_uiomove() instead
of the ubc_alloc() - uiomove() - ubc_release() dance.
 1.11 03-Sep-2008  gmcgarry branches: 1.11.2; 1.11.4;
Don't use unnamed structures.
 1.10 29-Apr-2008  ad branches: 1.10.2; 1.10.6;
PR kern/38057 ffs makes assuptions about devvp file system
PR kern/33406 softdeps get stuck in endless loop

Introduce VFS_FSYNC() and call it when syncing a block device, if it
has a mounted file system.
 1.9 30-Jan-2008  ad branches: 1.9.6; 1.9.8; 1.9.10;
Replace struct lock on vnodes with a simpler lock object built on
krwlock_t. This is a step towards removing lockmgr and simplifying
vnode locking. Discussed on tech-kern.
 1.8 25-Jan-2008  ad Remove VOP_LEASE. Discussed on tech-kern.
 1.7 03-Jan-2008  pooka struct vop_foo_args comment police: a_l has ceased to be
 1.6 08-Dec-2007  pooka branches: 1.6.4;
Remove cn_lwp from struct componentname. curlwp should be used
from on. The NDINIT() macro no longer takes the lwp parameter and
associates the credentials of the calling thread with the namei
structure.
 1.5 26-Nov-2007  pooka branches: 1.5.2;
Remove the "struct lwp *" argument from all VFS and VOP interfaces.
The general trend is to remove it from all kernel interfaces and
this is a start. In case the calling lwp is desired, curlwp should
be used.

quick consensus on tech-kern
 1.4 17-Aug-2007  pooka branches: 1.4.2; 1.4.4; 1.4.10;
In the new world order (a.k.a. the human-understandable world order)
VOP_LOOKUP ignores LOCKPARENT completely, so make this ignore it also.

XXX: tested only with rump, but I can't really see how this worked
at all before
 1.3 22-Mar-2007  dillo branches: 1.3.4; 1.3.8;
Add support for HFS Wrapper (HFS+ volume inside an HFS volume).
Remove offset argument, we should now find an HFS+ volume in any
of its standard places.

Based on work from and test image provided by Pelle Johansson.
 1.2 06-Mar-2007  dillo branches: 1.2.2; 1.2.4; 1.2.6; 1.2.8;
Complete rename of hfsp to hfs, requested by thorpej.
 1.1 06-Mar-2007  dillo Rename files from hfsp to hfs.
 1.2.8.1 29-Mar-2007  reinoud Pullup to -current
 1.2.6.1 11-Jul-2007  mjf Sync with head.
 1.2.4.3 24-Mar-2007  yamt sync with head.
 1.2.4.2 12-Mar-2007  rmind Sync with HEAD (missed new files in previous).
 1.2.4.1 06-Mar-2007  rmind file hfs_vnops.c was added on branch yamt-idlelwp on 2007-03-12 06:14:55 +0000
 1.2.2.2 20-Aug-2007  ad Sync with HEAD.
 1.2.2.1 10-Apr-2007  ad Sync with head.
 1.3.8.3 09-Dec-2007  jmcneill Sync with HEAD.
 1.3.8.2 27-Nov-2007  joerg Sync with HEAD. amd64 Xen support needs testing.
 1.3.8.1 03-Sep-2007  jmcneill Sync with HEAD.
 1.3.4.1 03-Sep-2007  skrll Sync with HEAD.
 1.4.10.3 18-Feb-2008  mjf Sync with HEAD.
 1.4.10.2 27-Dec-2007  mjf Sync with HEAD.
 1.4.10.1 08-Dec-2007  mjf Sync with HEAD.
 1.4.4.5 04-Feb-2008  yamt sync with head.
 1.4.4.4 21-Jan-2008  yamt sync with head
 1.4.4.3 07-Dec-2007  yamt sync with head
 1.4.4.2 03-Sep-2007  yamt sync with head.
 1.4.4.1 17-Aug-2007  yamt file hfs_vnops.c was added on branch yamt-lazymbuf on 2007-09-03 14:40:21 +0000
 1.4.2.2 23-Mar-2008  matt sync with HEAD
 1.4.2.1 09-Jan-2008  matt sync with HEAD
 1.5.2.1 26-Dec-2007  ad Sync with head.
 1.6.4.1 08-Jan-2008  bouyer Sync with HEAD
 1.9.10.5 11-Aug-2010  yamt sync with head.
 1.9.10.4 11-Mar-2010  yamt sync with head
 1.9.10.3 18-Jul-2009  yamt sync with head.
 1.9.10.2 04-May-2009  yamt sync with head.
 1.9.10.1 16-May-2008  yamt sync with head.
 1.9.8.1 18-May-2008  yamt sync with head.
 1.9.6.3 17-Jan-2009  mjf Sync with HEAD.
 1.9.6.2 28-Sep-2008  mjf Sync with HEAD.
 1.9.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.10.6.2 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.10.6.1 19-Oct-2008  haad Sync with HEAD.
 1.10.2.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.11.4.1 16-Feb-2011  bouyer Pull up following revision(s) (requested by dholland in ticket #1554):
sys/fs/hfs/hfs_vnops.c: revision 1.21, 1.22 via patch
PR/44523: Taylor R Campbell: mount_hfs badly handles file names with slashes
in them, encode them as colons. XXX: Should encode : as :: too?
remove comments about needing to encode : since the on disk format does
not allow them. Also fix reversed encoding in lookup. From Taylor R Campbell.
 1.11.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.13.2.1 23-Jul-2009  jym Sync with HEAD.
 1.16.4.4 31-May-2011  rmind sync with head
 1.16.4.3 05-Mar-2011  rmind sync with head
 1.16.4.2 03-Jul-2010  rmind sync with head
 1.16.4.1 30-May-2010  rmind sync with head
 1.16.2.2 17-Aug-2010  uebayasi Sync with HEAD.
 1.16.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.18.4.2 17-Feb-2011  bouyer Sync with HEAD
 1.18.4.1 08-Feb-2011  bouyer Sync with HEAD
 1.18.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.24.8.1 12-Aug-2012  martin Pull up following revision(s) (requested by manu in ticket #484):
sys/fs/nilfs/nilfs_vnops.c: revision 1.18
sys/ufs/ufs/ufs_lookup.c: revision 1.117
sys/nfs/nfs_vnops.c: revision 1.295
sys/ufs/chfs/chfs_vnops.c: revision 1.8
sys/ufs/ext2fs/ext2fs_lookup.c: revision 1.70
sys/fs/unionfs/unionfs_vnops.c: revision 1.6
sys/kern/vfs_cache.c: revision 1.89
sys/fs/efs/efs_vnops.c: revision 1.26
sys/fs/hfs/hfs_vnops.c: revision 1.26
sys/fs/adosfs/adlookup.c: revision 1.16
sys/fs/puffs/puffs_vnops.c: revision 1.168
sys/fs/tmpfs/tmpfs_vnops.c: revision 1.98
sys/fs/ntfs/ntfs_vnops.c: revision 1.52
sys/fs/cd9660/cd9660_lookup.c: revision 1.20
sys/fs/msdosfs/msdosfs_lookup.c: revision 1.24
sys/fs/smbfs/smbfs_vnops.c: revision 1.80
sys/fs/udf/udf_vnops.c: revision 1.72
sys/fs/filecorefs/filecore_lookup.c: revision 1.14
sys/fs/puffs/puffs_node.c: revision 1.25
Move some the test for MAKEENTRY into the cache_enter(9). Make some
variables in vfs_cache.c static, __read_mostly, etc.
No objection on tech-kern@.
 1.24.6.1 05-Apr-2012  mrg sync to latest -current.
 1.24.2.3 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.24.2.2 30-Oct-2012  yamt sync with head
 1.24.2.1 17-Apr-2012  yamt sync with head
 1.26.2.3 03-Dec-2017  jdolecek update from HEAD
 1.26.2.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.26.2.1 23-Jun-2013  tls resync from head
 1.27.6.1 18-May-2014  rmind sync with head
 1.29.2.1 10-Aug-2014  tls Rebase.
 1.31.4.3 28-Aug-2017  skrll Sync with HEAD
 1.31.4.2 05-Oct-2016  skrll Sync with HEAD
 1.31.4.1 22-Sep-2015  skrll Sync with HEAD
 1.34.20.1 25-Apr-2020  bouyer Sync with bouyer-xenpvh-base2 (HEAD)
 1.36.6.1 01-Aug-2021  thorpej Sync with HEAD.
 1.2 06-Mar-2007  dillo Rename files from hfsp to hfs.
 1.1 06-Mar-2007  dillo branches: 1.1.1;
Initial revision
 1.1.1.1 06-Mar-2007  dillo nitial import of (experimental read-only) implementation of Apple
HFS+ file system.

Originally developed for Google Summer of Code 2005 by Yevgeny Binder,
updated and enhanced by me.
 1.2 06-Mar-2007  dillo Rename files from hfsp to hfs.
 1.1 06-Mar-2007  dillo branches: 1.1.1;
Initial revision
 1.1.1.1 06-Mar-2007  dillo nitial import of (experimental read-only) implementation of Apple
HFS+ file system.

Originally developed for Google Summer of Code 2005 by Yevgeny Binder,
updated and enhanced by me.
 1.2 06-Mar-2007  dillo Rename files from hfsp to hfs.
 1.1 06-Mar-2007  dillo branches: 1.1.1;
Initial revision
 1.1.1.1 06-Mar-2007  dillo nitial import of (experimental read-only) implementation of Apple
HFS+ file system.

Originally developed for Google Summer of Code 2005 by Yevgeny Binder,
updated and enhanced by me.
 1.2 06-Mar-2007  dillo Rename files from hfsp to hfs.
 1.1 06-Mar-2007  dillo branches: 1.1.1;
Initial revision
 1.1.1.1 06-Mar-2007  dillo nitial import of (experimental read-only) implementation of Apple
HFS+ file system.

Originally developed for Google Summer of Code 2005 by Yevgeny Binder,
updated and enhanced by me.
 1.2 06-Mar-2007  dillo Rename files from hfsp to hfs.
 1.1 06-Mar-2007  dillo branches: 1.1.1;
Initial revision
 1.1.1.1 06-Mar-2007  dillo nitial import of (experimental read-only) implementation of Apple
HFS+ file system.

Originally developed for Google Summer of Code 2005 by Yevgeny Binder,
updated and enhanced by me.
 1.19 11-Aug-2023  mrg avoid uninitialised variable usage in early error paths.

found by GCC 12.
 1.18 19-Jun-2023  msaitoh Fix typo. unknwon -> unknown
 1.17 01-Mar-2023  riastradh fs/hfs: Avoid undefined pointer arith in hfslib_reada_node_offsets.

XXX pullup-8
XXX pullup-9
XXX pullup-10
 1.16 01-Mar-2023  riastradh fs/hfs: Avoid buffer overrun in hfslib_reada_node_offsets.

XXX pullup-8
XXX pullup-9
XXX pullup-10
 1.15 30-Dec-2018  sevan branches: 1.15.4; 1.15.30;
Fix support for case sensitive HFS.
Without this change, the wrong file is returned, if 2 file names contain a
subset of each other.


Code submitted in PR bin/52993 by Harold Gutch
 1.14 21-Jun-2015  maxv branches: 1.14.10; 1.14.16; 1.14.18;
KNF
 1.13 29-Dec-2014  maxv I started to KNF this file but quickly ended up figuring out I was not
courageous enough for such ugliness. So I only KNF'ed the first 300
lines.

I'll come back later.
 1.12 28-Jul-2012  matt branches: 1.12.2; 1.12.16;
Fix -fno-common found by building i386/conf/ALL
 1.11 15-Jun-2012  joerg Assert that out_hr is not NULL in hfslib_read_header_node
 1.10 24-Feb-2011  christos branches: 1.10.4;
simplify and avoid pointer gymnastics
 1.9 27-Nov-2009  pooka branches: 1.9.4; 1.9.6; 1.9.8;
Don't spam if mount fails due to invalid file system.
 1.8 14-Jul-2009  apb Initialise the "fork" local variable in hfslib_get_file_extents().
This variable was not actually used uninitialised, but some compilers
(e.g. gcc-4.3.3) warned that the variable might be used uninitialised.
Inspired by PR 41255 from Kurt Lidl.
 1.7 27-Mar-2009  pooka fix botch in previous
 1.6 26-Mar-2009  pooka pretend to do some sort of cleanup in error branches
 1.5 11-Dec-2007  lukem branches: 1.5.12; 1.5.20; 1.5.26;
use __KERNEL_RCSID()
 1.4 22-Mar-2007  dillo branches: 1.4.10; 1.4.12; 1.4.20; 1.4.22; 1.4.24;
Add support for HFS Wrapper (HFS+ volume inside an HFS volume).
Remove offset argument, we should now find an HFS+ volume in any
of its standard places.

Based on work from and test image provided by Pelle Johansson.
 1.3 09-Mar-2007  dillo branches: 1.3.2; 1.3.4; 1.3.6; 1.3.8;
Fix PR kern/35953 by mange at freemail dot hu (panic on mount):
(hfslib_open_volume) We are only interested in the catalgo and
extents header, so read the first 512 bytes, not the whole first
extent. Also makes mounting a lot faster.
 1.2 06-Mar-2007  dillo Complete rename of hfsp to hfs, requested by thorpej.
 1.1 06-Mar-2007  dillo Rename files from hfsp to hfs.
 1.3.8.1 29-Mar-2007  reinoud Pullup to -current
 1.3.6.1 11-Jul-2007  mjf Sync with head.
 1.3.4.3 24-Mar-2007  yamt sync with head.
 1.3.4.2 12-Mar-2007  rmind Sync with HEAD (missed new files in previous).
 1.3.4.1 09-Mar-2007  rmind file libhfs.c was added on branch yamt-idlelwp on 2007-03-12 06:14:55 +0000
 1.3.2.1 10-Apr-2007  ad Sync with head.
 1.4.24.1 13-Dec-2007  bouyer Sync with HEAD
 1.4.22.1 11-Dec-2007  yamt sync with head.
 1.4.20.1 26-Dec-2007  ad Sync with head.
 1.4.12.3 21-Jan-2008  yamt sync with head
 1.4.12.2 03-Sep-2007  yamt sync with head.
 1.4.12.1 22-Mar-2007  yamt file libhfs.c was added on branch yamt-lazymbuf on 2007-09-03 14:40:22 +0000
 1.4.10.1 09-Jan-2008  matt sync with HEAD
 1.5.26.2 23-Jul-2009  jym Sync with HEAD.
 1.5.26.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.5.20.1 28-Apr-2009  skrll Sync with HEAD.
 1.5.12.3 11-Mar-2010  yamt sync with head
 1.5.12.2 18-Jul-2009  yamt sync with head.
 1.5.12.1 04-May-2009  yamt sync with head.
 1.9.8.1 05-Mar-2011  bouyer Sync with HEAD
 1.9.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.9.4.1 05-Mar-2011  rmind sync with head
 1.10.4.1 30-Oct-2012  yamt sync with head
 1.12.16.2 22-Sep-2015  skrll Sync with HEAD
 1.12.16.1 06-Apr-2015  skrll Sync with HEAD
 1.12.2.1 03-Dec-2017  jdolecek update from HEAD
 1.14.18.1 10-Jun-2019  christos Sync with HEAD
 1.14.16.1 18-Jan-2019  pgoyette Synch with HEAD
 1.14.10.2 31-Jul-2023  martin Pull up following revision(s) (requested by riastradh in ticket #1865):

sys/fs/hfs/libhfs.h: revision 1.9
sys/fs/hfs/libhfs.c: revision 1.16
sys/fs/hfs/libhfs.c: revision 1.17

fs/hfs: Avoid buffer overrun in hfslib_reada_node_offsets.

fs/hfs: Avoid undefined pointer arith in hfslib_reada_node_offsets.
 1.14.10.1 01-Apr-2023  martin Pull up following revision(s) (requested by riastradh in ticket #1817):

sys/fs/hfs/libhfs.c: revision 1.15

Fix support for case sensitive HFS.

Without this change, the wrong file is returned, if 2 file names contain a
subset of each other.

Code submitted in PR bin/52993 by Harold Gutch
 1.15.30.1 31-Jul-2023  martin Pull up following revision(s) (requested by riastradh in ticket #271):

sys/fs/hfs/libhfs.h: revision 1.9
sys/fs/hfs/libhfs.c: revision 1.16
sys/fs/hfs/libhfs.c: revision 1.17

fs/hfs: Avoid buffer overrun in hfslib_reada_node_offsets.

fs/hfs: Avoid undefined pointer arith in hfslib_reada_node_offsets.
 1.15.4.1 31-Jul-2023  martin Pull up following revision(s) (requested by riastradh in ticket #1682):

sys/fs/hfs/libhfs.h: revision 1.9
sys/fs/hfs/libhfs.c: revision 1.16
sys/fs/hfs/libhfs.c: revision 1.17

fs/hfs: Avoid buffer overrun in hfslib_reada_node_offsets.

fs/hfs: Avoid undefined pointer arith in hfslib_reada_node_offsets.
 1.9 01-Mar-2023  riastradh fs/hfs: Avoid buffer overrun in hfslib_reada_node_offsets.

XXX pullup-8
XXX pullup-9
XXX pullup-10
 1.8 05-Jan-2019  maya branches: 1.8.4; 1.8.30;
Remove bogus code to workaround PCC limitations.

This would print stack garbage, which isn't desirable.
 1.7 21-Jun-2015  maxv branches: 1.7.10; 1.7.16; 1.7.18;
KNF
 1.6 28-Jul-2012  matt branches: 1.6.2; 1.6.16;
Fix -fno-common found by building i386/conf/ALL
 1.5 17-Jul-2011  joerg branches: 1.5.2;
Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.
 1.4 03-Sep-2008  gmcgarry Hack around zero vararg macro list on PCC.
 1.3 22-Mar-2007  dillo branches: 1.3.12; 1.3.32; 1.3.36; 1.3.38; 1.3.42;
Add support for HFS Wrapper (HFS+ volume inside an HFS volume).
Remove offset argument, we should now find an HFS+ volume in any
of its standard places.

Based on work from and test image provided by Pelle Johansson.
 1.2 06-Mar-2007  dillo branches: 1.2.2; 1.2.4; 1.2.6; 1.2.8;
Complete rename of hfsp to hfs, requested by thorpej.
 1.1 06-Mar-2007  dillo Rename files from hfsp to hfs.
 1.2.8.1 29-Mar-2007  reinoud Pullup to -current
 1.2.6.1 11-Jul-2007  mjf Sync with head.
 1.2.4.3 24-Mar-2007  yamt sync with head.
 1.2.4.2 12-Mar-2007  rmind Sync with HEAD (missed new files in previous).
 1.2.4.1 06-Mar-2007  rmind file libhfs.h was added on branch yamt-idlelwp on 2007-03-12 06:14:55 +0000
 1.2.2.1 10-Apr-2007  ad Sync with head.
 1.3.42.1 19-Oct-2008  haad Sync with HEAD.
 1.3.38.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.3.36.1 04-May-2009  yamt sync with head.
 1.3.32.1 28-Sep-2008  mjf Sync with HEAD.
 1.3.12.2 03-Sep-2007  yamt sync with head.
 1.3.12.1 22-Mar-2007  yamt file libhfs.h was added on branch yamt-lazymbuf on 2007-09-03 14:40:23 +0000
 1.5.2.1 30-Oct-2012  yamt sync with head
 1.6.16.1 22-Sep-2015  skrll Sync with HEAD
 1.6.2.1 03-Dec-2017  jdolecek update from HEAD
 1.7.18.1 10-Jun-2019  christos Sync with HEAD
 1.7.16.1 18-Jan-2019  pgoyette Synch with HEAD
 1.7.10.1 31-Jul-2023  martin Pull up following revision(s) (requested by riastradh in ticket #1865):

sys/fs/hfs/libhfs.h: revision 1.9
sys/fs/hfs/libhfs.c: revision 1.16
sys/fs/hfs/libhfs.c: revision 1.17

fs/hfs: Avoid buffer overrun in hfslib_reada_node_offsets.

fs/hfs: Avoid undefined pointer arith in hfslib_reada_node_offsets.
 1.8.30.1 31-Jul-2023  martin Pull up following revision(s) (requested by riastradh in ticket #271):

sys/fs/hfs/libhfs.h: revision 1.9
sys/fs/hfs/libhfs.c: revision 1.16
sys/fs/hfs/libhfs.c: revision 1.17

fs/hfs: Avoid buffer overrun in hfslib_reada_node_offsets.

fs/hfs: Avoid undefined pointer arith in hfslib_reada_node_offsets.
 1.8.4.1 31-Jul-2023  martin Pull up following revision(s) (requested by riastradh in ticket #1682):

sys/fs/hfs/libhfs.h: revision 1.9
sys/fs/hfs/libhfs.c: revision 1.16
sys/fs/hfs/libhfs.c: revision 1.17

fs/hfs: Avoid buffer overrun in hfslib_reada_node_offsets.

fs/hfs: Avoid undefined pointer arith in hfslib_reada_node_offsets.
 1.2 06-Mar-2007  dillo Rename files from hfsp to hfs.
 1.1 06-Mar-2007  dillo branches: 1.1.1;
Initial revision
 1.1.1.1 06-Mar-2007  dillo nitial import of (experimental read-only) implementation of Apple
HFS+ file system.

Originally developed for Google Summer of Code 2005 by Yevgeny Binder,
updated and enhanced by me.
 1.2 06-Mar-2007  dillo Rename files from hfsp to hfs.
 1.1 06-Mar-2007  dillo branches: 1.1.1;
Initial revision
 1.1.1.1 06-Mar-2007  dillo nitial import of (experimental read-only) implementation of Apple
HFS+ file system.

Originally developed for Google Summer of Code 2005 by Yevgeny Binder,
updated and enhanced by me.
 1.3 21-Jun-2015  maxv KNF
 1.2 11-Dec-2007  lukem branches: 1.2.56; 1.2.76;
use __KERNEL_RCSID()
 1.1 06-Mar-2007  dillo branches: 1.1.1;
Initial revision
 1.1.1.1 06-Mar-2007  dillo branches: 1.1.1.1.4; 1.1.1.1.18; 1.1.1.1.20; 1.1.1.1.28; 1.1.1.1.30; 1.1.1.1.32;
nitial import of (experimental read-only) implementation of Apple
HFS+ file system.

Originally developed for Google Summer of Code 2005 by Yevgeny Binder,
updated and enhanced by me.
 1.1.1.1.32.1 13-Dec-2007  bouyer Sync with HEAD
 1.1.1.1.30.1 11-Dec-2007  yamt sync with head.
 1.1.1.1.28.1 26-Dec-2007  ad Sync with head.
 1.1.1.1.20.3 21-Jan-2008  yamt sync with head
 1.1.1.1.20.2 03-Sep-2007  yamt sync with head.
 1.1.1.1.20.1 06-Mar-2007  yamt file unicode.c was added on branch yamt-lazymbuf on 2007-09-03 14:40:23 +0000
 1.1.1.1.18.1 09-Jan-2008  matt sync with HEAD
 1.1.1.1.4.2 12-Mar-2007  rmind Sync with HEAD (missed new files in previous).
 1.1.1.1.4.1 06-Mar-2007  rmind file unicode.c was added on branch yamt-idlelwp on 2007-03-12 06:14:56 +0000
 1.2.76.1 22-Sep-2015  skrll Sync with HEAD
 1.2.56.1 03-Dec-2017  jdolecek update from HEAD
 1.1 06-Mar-2007  dillo branches: 1.1.1;
Initial revision
 1.1.1.1 06-Mar-2007  dillo branches: 1.1.1.1.4; 1.1.1.1.20;
nitial import of (experimental read-only) implementation of Apple
HFS+ file system.

Originally developed for Google Summer of Code 2005 by Yevgeny Binder,
updated and enhanced by me.
 1.1.1.1.20.2 03-Sep-2007  yamt sync with head.
 1.1.1.1.20.1 06-Mar-2007  yamt file unicode.h was added on branch yamt-lazymbuf on 2007-09-03 14:40:24 +0000
 1.1.1.1.4.2 12-Mar-2007  rmind Sync with HEAD (missed new files in previous).
 1.1.1.1.4.1 06-Mar-2007  rmind file unicode.h was added on branch yamt-idlelwp on 2007-03-12 06:14:56 +0000

RSS XML Feed