Home | History | Annotate | only in /src/sys/fs/efs
History log of /src/sys/fs/efs
RevisionDateAuthorComments
 1.1 29-Jun-2007  rumble branches: 1.1.2; 1.1.12;
Add read-only support for SGI's Extent File System.

Reviewed by pooka@.
 1.1.12.2 03-Sep-2007  yamt sync with head.
 1.1.12.1 29-Jun-2007  yamt file Makefile was added on branch yamt-lazymbuf on 2007-09-03 14:40:08 +0000
 1.1.2.2 15-Jul-2007  ad Sync with head.
 1.1.2.1 29-Jun-2007  ad file Makefile was added on branch vmlocking on 2007-07-15 16:15:17 +0000
 1.2 30-Jun-2007  rumble branches: 1.2.2; 1.2.12;
Additional documentation on extents and some artificial limitations SGI
has introduced (and changed in backwards-incompatible ways) over the years.
 1.1 29-Jun-2007  rumble Add read-only support for SGI's Extent File System.

Reviewed by pooka@.
 1.2.12.2 03-Sep-2007  yamt sync with head.
 1.2.12.1 30-Jun-2007  yamt file efs.h was added on branch yamt-lazymbuf on 2007-09-03 14:40:08 +0000
 1.2.2.2 15-Jul-2007  ad Sync with head.
 1.2.2.1 30-Jun-2007  ad file efs.h was added on branch vmlocking on 2007-07-15 16:15:20 +0000
 1.3 07-Jul-2016  msaitoh KNF. Remove extra spaces. No functional change.
 1.2 30-Jun-2007  rumble branches: 1.2.2; 1.2.12; 1.2.82; 1.2.102;
Additional documentation on extents and some artificial limitations SGI
has introduced (and changed in backwards-incompatible ways) over the years.
 1.1 29-Jun-2007  rumble Add read-only support for SGI's Extent File System.

Reviewed by pooka@.
 1.2.102.1 09-Jul-2016  skrll Sync with HEAD
 1.2.82.1 03-Dec-2017  jdolecek update from HEAD
 1.2.12.2 03-Sep-2007  yamt sync with head.
 1.2.12.1 30-Jun-2007  yamt file efs_dinode.h was added on branch yamt-lazymbuf on 2007-09-03 14:40:08 +0000
 1.2.2.2 15-Jul-2007  ad Sync with head.
 1.2.2.1 30-Jun-2007  ad file efs_dinode.h was added on branch vmlocking on 2007-07-15 16:15:21 +0000
 1.2 07-Jul-2016  msaitoh KNF. Remove extra spaces. No functional change.
 1.1 29-Jun-2007  rumble branches: 1.1.2; 1.1.12; 1.1.82; 1.1.102;
Add read-only support for SGI's Extent File System.

Reviewed by pooka@.
 1.1.102.1 09-Jul-2016  skrll Sync with HEAD
 1.1.82.1 03-Dec-2017  jdolecek update from HEAD
 1.1.12.2 03-Sep-2007  yamt sync with head.
 1.1.12.1 29-Jun-2007  yamt file efs_dir.h was added on branch yamt-lazymbuf on 2007-09-03 14:40:09 +0000
 1.1.2.2 15-Jul-2007  ad Sync with head.
 1.1.2.1 29-Jun-2007  ad file efs_dir.h was added on branch vmlocking on 2007-07-15 16:15:21 +0000
 1.3 04-Jul-2007  rumble branches: 1.3.2; 1.3.12;
Additional fixes/enhancements:
1) Comply with the way buffercache(9) is intended to be used. Now we
read in single blocks of EFS_BB_SIZE, never taking in variable
length extents with a single bread() call.

2) Handle symlinks with more than one extent. There's no reason for
this to ever happen, but it's handled now.

3) Finally, add a hint to our iteration initialiser so we can start
from the desired offset, rather than naively looping through from
the beginning each time. Since we can binary search the correct
location quickly, this improves large sequential reads by about
40% with 128MB files. Improvement should increase with file size.
 1.2 30-Jun-2007  rumble Additional documentation on extents and some artificial limitations SGI
has introduced (and changed in backwards-incompatible ways) over the years.
 1.1 29-Jun-2007  rumble Add read-only support for SGI's Extent File System.

Reviewed by pooka@.
 1.3.12.2 03-Sep-2007  yamt sync with head.
 1.3.12.1 04-Jul-2007  yamt file efs_extent.h was added on branch yamt-lazymbuf on 2007-09-03 14:40:09 +0000
 1.3.2.2 15-Jul-2007  ad Sync with head.
 1.3.2.1 04-Jul-2007  ad file efs_extent.h was added on branch vmlocking on 2007-07-15 16:15:22 +0000
 1.2 28-May-2018  chs add a genfs method to allow a file system to limit the range of pages
that are given to a single GOP_WRITE() call. needed by ZFS.
 1.1 29-Jun-2007  rumble branches: 1.1.2; 1.1.12; 1.1.124;
Add read-only support for SGI's Extent File System.

Reviewed by pooka@.
 1.1.124.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1.12.2 03-Sep-2007  yamt sync with head.
 1.1.12.1 29-Jun-2007  yamt file efs_genfs.c was added on branch yamt-lazymbuf on 2007-09-03 14:40:10 +0000
 1.1.2.2 15-Jul-2007  ad Sync with head.
 1.1.2.1 29-Jun-2007  ad file efs_genfs.c was added on branch vmlocking on 2007-07-15 16:15:22 +0000
 1.1 29-Jun-2007  rumble branches: 1.1.2; 1.1.12;
Add read-only support for SGI's Extent File System.

Reviewed by pooka@.
 1.1.12.2 03-Sep-2007  yamt sync with head.
 1.1.12.1 29-Jun-2007  yamt file efs_genfs.h was added on branch yamt-lazymbuf on 2007-09-03 14:40:10 +0000
 1.1.2.2 15-Jul-2007  ad Sync with head.
 1.1.2.1 29-Jun-2007  ad file efs_genfs.h was added on branch vmlocking on 2007-07-15 16:15:23 +0000
 1.11 07-Aug-2014  hannken Change efs from hashlist to vcache.
 1.10 27-Feb-2014  hannken branches: 1.10.2;
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.9 29-Apr-2012  dsl branches: 1.9.2; 1.9.4;
Remove everything to do with 'struct malloc_type' and the malloc link_set.
To make code in 'external' (etc) still compile, MALLOC_DECLARE() still
has to generate something of type 'struct malloc_type *', with
normal optimisation gcc generates a compile-time 0.
MALLOC_DEFINE() and friends have no effect.
Fix one or two places where the code would no longer compile.
 1.8 27-Jan-2012  para extending vmem(9) to be able to allocated resources for it's own needs.
simplifying uvm_map handling (no special kernel entries anymore no relocking)
make malloc(9) a thin wrapper around kmem(9)
(with private interface for interrupt safety reasons)

releng@ acknowledged
 1.7 12-Jun-2011  rmind branches: 1.7.2; 1.7.6;
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.6 21-Jul-2010  hannken branches: 1.6.6;
Make holding v_interlock mandatory for callers of vget().

Announced some time ago on tech-kern.
 1.5 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.4 05-May-2008  ad branches: 1.4.20; 1.4.22;
- 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.3 30-Jan-2008  ad branches: 1.3.6; 1.3.8; 1.3.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.2 02-Jan-2008  ad Merge vmlocking2 to head.
 1.1 29-Jun-2007  rumble branches: 1.1.2; 1.1.10; 1.1.12; 1.1.18; 1.1.20; 1.1.24;
Add read-only support for SGI's Extent File System.

Reviewed by pooka@.
 1.1.24.1 02-Jan-2008  bouyer Sync with HEAD
 1.1.20.1 04-Dec-2007  ad Pull the vmlocking changes into a new branch.
 1.1.18.1 18-Feb-2008  mjf Sync with HEAD.
 1.1.12.4 04-Feb-2008  yamt sync with head.
 1.1.12.3 21-Jan-2008  yamt sync with head
 1.1.12.2 03-Sep-2007  yamt sync with head.
 1.1.12.1 29-Jun-2007  yamt file efs_ihash.c was added on branch yamt-lazymbuf on 2007-09-03 14:40:11 +0000
 1.1.10.2 23-Mar-2008  matt sync with HEAD
 1.1.10.1 09-Jan-2008  matt sync with HEAD
 1.1.2.2 15-Jul-2007  ad Sync with head.
 1.1.2.1 29-Jun-2007  ad file efs_ihash.c was added on branch vmlocking on 2007-07-15 16:15:24 +0000
 1.3.10.2 11-Aug-2010  yamt sync with head.
 1.3.10.1 16-May-2008  yamt sync with head.
 1.3.8.1 18-May-2008  yamt sync with head.
 1.3.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.4.22.3 05-Mar-2011  rmind sync with head
 1.4.22.2 03-Jul-2010  rmind sync with head
 1.4.22.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.4.20.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.6.6.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.7.6.2 02-Jun-2012  mrg sync to latest -current.
 1.7.6.1 18-Feb-2012  mrg merge to -current.
 1.7.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.7.2.2 23-May-2012  yamt sync with head.
 1.7.2.1 17-Apr-2012  yamt sync with head
 1.9.4.1 18-May-2014  rmind sync with head
 1.9.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.10.2.1 10-Aug-2014  tls Rebase.
 1.2 07-Aug-2014  hannken Change efs from hashlist to vcache.
 1.1 29-Jun-2007  rumble branches: 1.1.2; 1.1.12; 1.1.82; 1.1.98;
Add read-only support for SGI's Extent File System.

Reviewed by pooka@.
 1.1.98.1 10-Aug-2014  tls Rebase.
 1.1.82.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.12.2 03-Sep-2007  yamt sync with head.
 1.1.12.1 29-Jun-2007  yamt file efs_ihash.h was added on branch yamt-lazymbuf on 2007-09-03 14:40:11 +0000
 1.1.2.2 15-Jul-2007  ad Sync with head.
 1.1.2.1 29-Jun-2007  ad file efs_ihash.h was added on branch vmlocking on 2007-07-15 16:15:25 +0000
 1.1 29-Jun-2007  rumble branches: 1.1.2; 1.1.12;
Add read-only support for SGI's Extent File System.

Reviewed by pooka@.
 1.1.12.2 03-Sep-2007  yamt sync with head.
 1.1.12.1 29-Jun-2007  yamt file efs_inode.h was added on branch yamt-lazymbuf on 2007-09-03 14:40:12 +0000
 1.1.2.2 15-Jul-2007  ad Sync with head.
 1.1.2.1 29-Jun-2007  ad file efs_inode.h was added on branch vmlocking on 2007-07-15 16:15:27 +0000
 1.1 29-Jun-2007  rumble branches: 1.1.2; 1.1.12;
Add read-only support for SGI's Extent File System.

Reviewed by pooka@.
 1.1.12.2 03-Sep-2007  yamt sync with head.
 1.1.12.1 29-Jun-2007  yamt file efs_mount.h was added on branch yamt-lazymbuf on 2007-09-03 14:40:13 +0000
 1.1.2.2 15-Jul-2007  ad Sync with head.
 1.1.2.1 29-Jun-2007  ad file efs_mount.h was added on branch vmlocking on 2007-07-15 16:15:28 +0000
 1.1 29-Jun-2007  rumble branches: 1.1.2; 1.1.12;
Add read-only support for SGI's Extent File System.

Reviewed by pooka@.
 1.1.12.2 03-Sep-2007  yamt sync with head.
 1.1.12.1 29-Jun-2007  yamt file efs_sb.h was added on branch yamt-lazymbuf on 2007-09-03 14:40:14 +0000
 1.1.2.2 15-Jul-2007  ad Sync with head.
 1.1.2.1 29-Jun-2007  ad file efs_sb.h was added on branch vmlocking on 2007-07-15 16:15:28 +0000
 1.14 10-Dec-2021  andvar s/occured/occurred/ in comments, log messages and man pages.
 1.13 07-Sep-2020  christos fix unaligned access
 1.12 26-Sep-2015  maxv Curious typo. Harmless. Found by Brainy
 1.11 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.10 30-Oct-2013  mrg branches: 1.10.6;
use __diagused where appropriate.
 1.9 20-Oct-2013  christos Now that KASSERT will always consume its arguments, move a KASSERT inside
a DIAGNOSTIC, because the function used is only defined with DIAGNOSTIC.
 1.8 20-Dec-2012  hannken branches: 1.8.2;
Change bread() and breadn() to never return a buffer on
error and modify all callers to not brelse() on error.

Welcome to 6.99.16

PR kern/46282 (6.0_BETA crash: msdosfs_bmap -> pcbmap -> bread -> bio_doread)
 1.7 16-May-2008  hannken branches: 1.7.32; 1.7.42;
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.6 08-Oct-2007  ad branches: 1.6.18; 1.6.20; 1.6.22; 1.6.24;
Merge brelse() changes from the vmlocking branch.
 1.5 06-Aug-2007  rumble branches: 1.5.2; 1.5.4; 1.5.6; 1.5.8;
Fix a parenthesis bug that would nearly always make the superblock magic
check evaluate to true.
 1.4 29-Jul-2007  rumble branches: 1.4.4;
When computing the superblock checksum, use an unsigned short to avoid an
undesired sign-extension. Now EFS works on big endian machines, too.
 1.3 04-Jul-2007  rumble branches: 1.3.2; 1.3.4;
Clamp down tigher on the bound around 'numextents'. Add a few comments
to make it clearer what we're tracking.
 1.2 04-Jul-2007  rumble Additional fixes/enhancements:
1) Comply with the way buffercache(9) is intended to be used. Now we
read in single blocks of EFS_BB_SIZE, never taking in variable
length extents with a single bread() call.

2) Handle symlinks with more than one extent. There's no reason for
this to ever happen, but it's handled now.

3) Finally, add a hint to our iteration initialiser so we can start
from the desired offset, rather than naively looping through from
the beginning each time. Since we can binary search the correct
location quickly, this improves large sequential reads by about
40% with 128MB files. Improvement should increase with file size.
 1.1 29-Jun-2007  rumble Add read-only support for SGI's Extent File System.

Reviewed by pooka@.
 1.3.4.1 15-Aug-2007  skrll Sync with HEAD.
 1.3.2.3 20-Aug-2007  ad Sync with HEAD.
 1.3.2.2 15-Jul-2007  ad Sync with head.
 1.3.2.1 04-Jul-2007  ad file efs_subr.c was added on branch vmlocking on 2007-07-15 16:15:29 +0000
 1.4.4.2 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.4.4.1 09-Aug-2007  jmcneill Sync with HEAD.
 1.5.8.2 06-Aug-2007  rumble Fix a parenthesis bug that would nearly always make the superblock magic
check evaluate to true.
 1.5.8.1 06-Aug-2007  rumble file efs_subr.c was added on branch matt-mips64 on 2007-08-06 23:25:28 +0000
 1.5.6.1 14-Oct-2007  yamt sync with head.
 1.5.4.3 27-Oct-2007  yamt sync with head.
 1.5.4.2 03-Sep-2007  yamt sync with head.
 1.5.4.1 06-Aug-2007  yamt file efs_subr.c was added on branch yamt-lazymbuf on 2007-09-03 14:40:14 +0000
 1.5.2.1 06-Nov-2007  matt sync with HEAD
 1.6.24.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.6.22.1 04-May-2009  yamt sync with head.
 1.6.20.1 18-May-2008  yamt sync with head.
 1.6.18.1 02-Jun-2008  mjf Sync with HEAD.
 1.7.42.3 03-Dec-2017  jdolecek update from HEAD
 1.7.42.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.7.42.1 25-Feb-2013  tls resync with head
 1.7.32.2 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.7.32.1 23-Jan-2013  yamt sync with head
 1.8.2.1 18-May-2014  rmind sync with head
 1.10.6.2 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.10.6.1 06-Apr-2015  skrll Sync with HEAD
 1.2 04-Jul-2007  rumble branches: 1.2.2; 1.2.12;
Additional fixes/enhancements:
1) Comply with the way buffercache(9) is intended to be used. Now we
read in single blocks of EFS_BB_SIZE, never taking in variable
length extents with a single bread() call.

2) Handle symlinks with more than one extent. There's no reason for
this to ever happen, but it's handled now.

3) Finally, add a hint to our iteration initialiser so we can start
from the desired offset, rather than naively looping through from
the beginning each time. Since we can binary search the correct
location quickly, this improves large sequential reads by about
40% with 128MB files. Improvement should increase with file size.
 1.1 29-Jun-2007  rumble Add read-only support for SGI's Extent File System.

Reviewed by pooka@.
 1.2.12.2 03-Sep-2007  yamt sync with head.
 1.2.12.1 04-Jul-2007  yamt file efs_subr.h was added on branch yamt-lazymbuf on 2007-09-03 14:40:15 +0000
 1.2.2.2 15-Jul-2007  ad Sync with head.
 1.2.2.1 04-Jul-2007  ad file efs_subr.h was added on branch vmlocking on 2007-07-15 16:15:29 +0000
 1.30 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.29 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.28 17-Feb-2017  hannken branches: 1.28.14; 1.28.20;
Add generic genfs_suspendctl() and use it for all file systems.
Layered file systems need work.
 1.27 07-Jul-2016  msaitoh branches: 1.27.2; 1.27.4;
KNF. Remove extra spaces. No functional change.
 1.26 07-Aug-2014  hannken branches: 1.26.4;
Change efs from hashlist to vcache.
 1.25 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.24 20-Dec-2012  hannken branches: 1.24.2; 1.24.10;
Change bread() and breadn() to never return a buffer on
error and modify all callers to not brelse() on error.

Welcome to 6.99.16

PR kern/46282 (6.0_BETA crash: msdosfs_bmap -> pcbmap -> bread -> bio_doread)
 1.23 13-Mar-2012  elad branches: 1.23.2;
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.22 12-Jun-2011  rmind branches: 1.22.2; 1.22.6; 1.22.8; 1.22.12; 1.22.14;
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.21 19-Nov-2010  dholland branches: 1.21.6;
Introduce struct pathbuf. This is an abstraction to hold a pathname
and the metadata required to interpret it. Callers of namei must now
create a pathbuf and pass it to NDINIT (instead of a string and a
uio_seg), then destroy the pathbuf after the namei session is
complete.

Update all namei call sites accordingly. Add a pathbuf(9) man page and
update namei(9).

The pathbuf interface also now appears in a couple of related
additional places that were passing string/uio_seg pairs that were
later fed into NDINIT. Update other call sites accordingly.
 1.20 24-Jun-2010  hannken 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.19 25-Apr-2009  elad branches: 1.19.2; 1.19.4;
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.18 20-Apr-2009  elad Pass VREAD instead of FREAD to VOP_ACCESS().

Okay christos@.
 1.17 01-Dec-2008  pooka branches: 1.17.4;
Add specfs/fifofs support. Not really fully tested, but at least
vfs routines don't crash now.
(didn't have an image with matching device node numbers)

fixes PR kern/40055 by myself
 1.16 24-Sep-2008  ad branches: 1.16.2; 1.16.4;
Don't assign vnode::v_mount. getnewvnode() does it.
 1.15 10-May-2008  rumble branches: 1.15.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.14 08-Dec-2007  pooka branches: 1.14.12; 1.14.14; 1.14.16; 1.14.18;
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.13 26-Nov-2007  pooka branches: 1.13.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.12 10-Oct-2007  ad branches: 1.12.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.11 08-Oct-2007  ad Merge brelse() changes from the vmlocking branch.
 1.10 08-Sep-2007  rumble branches: 1.10.2;
Don't explicitly set vp->v_size and then call uvm_vnp_setsize(). This is
not only unnecessary, but trips a kernel assertion introduced in r1.85 of
uvm/uvm_vnode.c.
 1.9 06-Aug-2007  pooka branches: 1.9.2; 1.9.4; 1.9.6;
Make VFS_SYNC always succeed instead of always fail.
Fixes non-forced unmount.
 1.8 31-Jul-2007  pooka branches: 1.8.2;
* 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.7 26-Jul-2007  pooka Use eopnotsupp() instead of vfs_stdsuspendctl() and retire the latter.
 1.6 21-Jul-2007  ad Don't depend on uvm_extern.h pulling in proc.h.
 1.5 17-Jul-2007  pooka branches: 1.5.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.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 04-Jul-2007  rumble Additional fixes/enhancements:
1) Comply with the way buffercache(9) is intended to be used. Now we
read in single blocks of EFS_BB_SIZE, never taking in variable
length extents with a single bread() call.

2) Handle symlinks with more than one extent. There's no reason for
this to ever happen, but it's handled now.

3) Finally, add a hint to our iteration initialiser so we can start
from the desired offset, rather than naively looping through from
the beginning each time. Since we can binary search the correct
location quickly, this improves large sequential reads by about
40% with 128MB files. Improvement should increase with file size.
 1.2 01-Jul-2007  rumble Remove a superfluous pasted structure definition, permitting ALL to
build again.

Caught by Hisashi T Fujinaka.
 1.1 29-Jun-2007  rumble Add read-only support for SGI's Extent File System.

Reviewed by pooka@.
 1.4.2.5 23-Oct-2007  ad Sync with head.
 1.4.2.4 09-Oct-2007  ad Sync with head.
 1.4.2.3 20-Aug-2007  ad Sync with HEAD.
 1.4.2.2 15-Jul-2007  ad Sync with head.
 1.4.2.1 12-Jul-2007  ad file efs_vfsops.c was added on branch vmlocking on 2007-07-15 16:15:30 +0000
 1.5.2.2 10-Sep-2007  skrll Sync with HEAD.
 1.5.2.1 15-Aug-2007  skrll Sync with HEAD.
 1.8.2.5 09-Dec-2007  jmcneill Sync with HEAD.
 1.8.2.4 27-Nov-2007  joerg Sync with HEAD. amd64 Xen support needs testing.
 1.8.2.3 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.8.2.2 02-Oct-2007  joerg Sync with HEAD.
 1.8.2.1 09-Aug-2007  jmcneill Sync with HEAD.
 1.9.6.2 06-Aug-2007  pooka Make VFS_SYNC always succeed instead of always fail.
Fixes non-forced unmount.
 1.9.6.1 06-Aug-2007  pooka file efs_vfsops.c was added on branch matt-mips64 on 2007-08-06 21:10:25 +0000
 1.9.4.5 21-Jan-2008  yamt sync with head
 1.9.4.4 07-Dec-2007  yamt sync with head
 1.9.4.3 27-Oct-2007  yamt sync with head.
 1.9.4.2 03-Sep-2007  yamt sync with head.
 1.9.4.1 06-Aug-2007  yamt file efs_vfsops.c was added on branch yamt-lazymbuf on 2007-09-03 14:40:15 +0000
 1.9.2.2 09-Jan-2008  matt sync with HEAD
 1.9.2.1 06-Nov-2007  matt sync with HEAD
 1.10.2.1 14-Oct-2007  yamt sync with head.
 1.12.4.2 27-Dec-2007  mjf Sync with HEAD.
 1.12.4.1 08-Dec-2007  mjf Sync with HEAD.
 1.13.2.1 26-Dec-2007  ad Sync with head.
 1.14.18.2 10-Oct-2008  skrll Sync with HEAD.
 1.14.18.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.14.16.3 11-Aug-2010  yamt sync with head.
 1.14.16.2 04-May-2009  yamt sync with head.
 1.14.16.1 16-May-2008  yamt sync with head.
 1.14.14.1 18-May-2008  yamt sync with head.
 1.14.12.3 17-Jan-2009  mjf Sync with HEAD.
 1.14.12.2 28-Sep-2008  mjf Sync with HEAD.
 1.14.12.1 02-Jun-2008  mjf Sync with HEAD.
 1.15.4.2 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.15.4.1 19-Oct-2008  haad Sync with HEAD.
 1.16.4.2 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.16.4.1 06-Jan-2009  snj branches: 1.16.4.1.6; 1.16.4.1.10;
Pull up following revision(s) (requested by rumble in ticket #216):
sys/fs/efs/efs_vfsops.c: revision 1.17
sys/fs/efs/efs_vnops.c: revision 1.17
Add specfs/fifofs support. Not really fully tested, but at least
vfs routines don't crash now.
(didn't have an image with matching device node numbers)
fixes PR kern/40055 by myself
 1.16.4.1.10.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.16.4.1.6.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.16.2.2 28-Apr-2009  skrll Sync with HEAD.
 1.16.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.17.4.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.19.4.3 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.19.4.2 05-Mar-2011  rmind sync with head
 1.19.4.1 03-Jul-2010  rmind sync with head
 1.19.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.21.6.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.22.14.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.22.12.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.22.8.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.22.6.1 05-Apr-2012  mrg sync to latest -current.
 1.22.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.22.2.2 23-Jan-2013  yamt sync with head
 1.22.2.1 17-Apr-2012  yamt sync with head
 1.23.2.3 03-Dec-2017  jdolecek update from HEAD
 1.23.2.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.23.2.1 25-Feb-2013  tls resync with head
 1.24.10.1 10-Aug-2014  tls Rebase.
 1.24.2.1 18-May-2014  rmind sync with head
 1.26.4.2 28-Aug-2017  skrll Sync with HEAD
 1.26.4.1 09-Jul-2016  skrll Sync with HEAD
 1.27.4.1 21-Apr-2017  bouyer Sync with HEAD
 1.27.2.1 20-Mar-2017  pgoyette Sync with HEAD
 1.28.20.1 17-Jan-2020  ad Sync with head.
 1.28.14.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.44 06-Aug-2022  andvar s/blity/bility/ in various words, mainly in comments.
 1.43 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.42 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.41 27-Jun-2020  christos branches: 1.41.6;
Introduce genfs_pathconf() and use it for the default case in all filesystems.
 1.40 16-May-2020  christos Add ACL support for FFS. From FreeBSD.
 1.39 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.38 26-May-2017  riastradh branches: 1.38.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.37 11-Apr-2017  riastradh Make VOP_INACTIVE preserve vnode lock on return.

Discussed on tech-kern:
https://mail-index.netbsd.org/tech-kern/2017/04/01/msg021751.html

Ride 7.99.68, a bumpy bus of incremental vfs improvements!
 1.36 20-Aug-2016  hannken branches: 1.36.2;
Remove now obsolete operation vcache_remove().

Welcome to 7.99.36
 1.35 07-Jul-2016  msaitoh branches: 1.35.2;
KNF. Remove extra spaces. No functional change.
 1.34 02-Mar-2016  christos PR/50883: David Binderman: Remove redundant code.
 1.33 07-Aug-2014  hannken branches: 1.33.4;
Change efs from hashlist to vcache.
 1.32 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.31 07-Feb-2014  hannken branches: 1.31.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.30 18-Mar-2013  plunky branches: 1.30.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.29 20-Dec-2012  hannken Change bread() and breadn() to never return a buffer on
error and modify all callers to not brelse() on error.

Welcome to 6.99.16

PR kern/46282 (6.0_BETA crash: msdosfs_bmap -> pcbmap -> bread -> bio_doread)
 1.28 05-Nov-2012  dholland Excise struct componentname from the namecache.

This uglifies the interface, because several operations need to be
passed the namei flags and cache_lookup also needs for the time being
to be passed cnp->cn_nameiop. Nonetheless, it's a net benefit.

The glop should be able to go away eventually but requires structural
cleanup elsewhere first.

This change requires a kernel bump.
 1.27 05-Nov-2012  dholland Disentangle the namecache from the internals of namei.

- Move the namecache's hash computation to inside the namecache code,
instead of being spread out all over the place. Remove cn_hash from
struct componentname and delete all uses of it.

- It is no longer necessary (if it ever was) for cache_lookup and
cache_lookup_raw to clear MAKEENTRY from cnp->cn_flags for the cases
that cache_enter already checks for.

- Rearrange the interface of cache_lookup (and cache_lookup_raw) to
make it somewhat simpler, to exclude certain nonexistent error
conditions, and (most importantly) to make it not require write access
to cnp->cn_flags.

This change requires a kernel bump.
 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 19-May-2011  rmind branches: 1.24.4; 1.24.8; 1.24.10;
Remove cache_purge(9) calls from reclamation routines in the file systems,
as vclean(9) performs it for us since Lite2 merge.
 1.23 30-Nov-2010  dholland branches: 1.23.2;
Abolish the SAVENAME and HASBUF flags. There is now always a buffer,
so the path in a struct componentname is now always valid during VOP
calls.
 1.22 24-Jun-2010  hannken 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.21 29-Mar-2010  pooka Stop exposing fifofs internals and leave only fifo_vnodeop_p visible.
 1.20 03-Jul-2009  pooka branches: 1.20.2; 1.20.4;
Fix utterly botched previous commit. efs compiles now and apprears
to work, but the person doing the original change should verify
that it actually works like before the change.

(hi, elad!)
 1.19 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.18 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.17 01-Dec-2008  pooka branches: 1.17.4;
Add specfs/fifofs support. Not really fully tested, but at least
vfs routines don't crash now.
(didn't have an image with matching device node numbers)

fixes PR kern/40055 by myself
 1.16 26-Nov-2008  pooka Rototill all remaining file systems to use ubc_uiomove() instead
of the ubc_alloc() - uiomove() - ubc_release() dance.
 1.15 16-Nov-2008  pooka more <sys/buf.h> police
 1.14 25-Jan-2008  ad branches: 1.14.6; 1.14.10; 1.14.16; 1.14.18; 1.14.20;
Remove VOP_LEASE. Discussed on tech-kern.
 1.13 02-Jan-2008  ad Merge vmlocking2 to head.
 1.12 26-Nov-2007  pooka branches: 1.12.2; 1.12.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.11 10-Oct-2007  ad branches: 1.11.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.10 08-Oct-2007  ad Merge brelse() changes from the vmlocking branch.
 1.9 24-Sep-2007  rumble Avoid stack allocation of large dirent structures in foo_readdir().
 1.8 08-Sep-2007  rumble branches: 1.8.2;
In efs_readdir don't foolishly allocate and free dirents for each entry
before copying them out, rather just use a single one. Further, follow
the example of tmpfs and others by simply allocating on the stack.

This should have the side-effect of silencing false Coverity reports like
CID 4559 and 4554.
 1.7 08-Sep-2007  rumble CID 4553:

In efs_lookup, when checking whether a CREATE or RENAME operation would
succeed, be sure to pass the appropriate vnode pointer to VOP_ACCESS.
 1.6 29-Jul-2007  rumble branches: 1.6.4; 1.6.6; 1.6.8; 1.6.10;
Only set *ap->a_cookies when we're returning success. Also, do not hard-
code 16, but rather use _DIRENT_MINSIZE as the divisor when determining
the number of cookies to allocate.

Noticed by pooka@.
 1.5 29-Jul-2007  rumble Support NFS cookies and the eofflag in efs_readdir. Also, be sure to
update uio->uio_offset as not doing so would cause large directory reads
to misbehave.

EFS is now properly NFS-exportable.
 1.4 29-Jul-2007  ad It's not a good idea for device drivers to modify b_flags, as they don't
need to understand the locking around that field. Instead of setting
B_ERROR, set b_error instead. b_error is 'owned' by whoever completes
the I/O request.
 1.3 04-Jul-2007  rumble branches: 1.3.2; 1.3.4;
Additional fixes/enhancements:
1) Comply with the way buffercache(9) is intended to be used. Now we
read in single blocks of EFS_BB_SIZE, never taking in variable
length extents with a single bread() call.

2) Handle symlinks with more than one extent. There's no reason for
this to ever happen, but it's handled now.

3) Finally, add a hint to our iteration initialiser so we can start
from the desired offset, rather than naively looping through from
the beginning each time. Since we can binary search the correct
location quickly, this improves large sequential reads by about
40% with 128MB files. Improvement should increase with file size.
 1.2 04-Jul-2007  rumble Fix a significant performance bug in efs_read:

When reading a file, we would erroneously iterate to the next extent
before having filled the entire uio request. This lead to unnecessary
extent iteration and excessive calls to efs_read.

Sequential read performance has doubled in the uncached case and
quadrupled when data is buffered.
 1.1 29-Jun-2007  rumble Add read-only support for SGI's Extent File System.

Reviewed by pooka@.
 1.3.4.2 10-Sep-2007  skrll Sync with HEAD.
 1.3.4.1 15-Aug-2007  skrll Sync with HEAD.
 1.3.2.7 09-Oct-2007  ad Sync with head.
 1.3.2.6 09-Oct-2007  ad Sync with head.
 1.3.2.5 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.3.2.4 20-Aug-2007  ad Sync with HEAD.
 1.3.2.3 19-Aug-2007  ad - Back out the biodone() changes.
- Eliminate B_ERROR (from HEAD).
 1.3.2.2 15-Jul-2007  ad Sync with head.
 1.3.2.1 04-Jul-2007  ad file efs_vnops.c was added on branch vmlocking on 2007-07-15 16:15:30 +0000
 1.6.10.2 29-Jul-2007  rumble Only set *ap->a_cookies when we're returning success. Also, do not hard-
code 16, but rather use _DIRENT_MINSIZE as the divisor when determining
the number of cookies to allocate.

Noticed by pooka@.
 1.6.10.1 29-Jul-2007  rumble file efs_vnops.c was added on branch matt-mips64 on 2007-07-29 20:58:11 +0000
 1.6.8.6 04-Feb-2008  yamt sync with head.
 1.6.8.5 21-Jan-2008  yamt sync with head
 1.6.8.4 07-Dec-2007  yamt sync with head
 1.6.8.3 27-Oct-2007  yamt sync with head.
 1.6.8.2 03-Sep-2007  yamt sync with head.
 1.6.8.1 29-Jul-2007  yamt file efs_vnops.c was added on branch yamt-lazymbuf on 2007-09-03 14:40:16 +0000
 1.6.6.3 23-Mar-2008  matt sync with HEAD
 1.6.6.2 09-Jan-2008  matt sync with HEAD
 1.6.6.1 06-Nov-2007  matt sync with HEAD
 1.6.4.3 27-Nov-2007  joerg Sync with HEAD. amd64 Xen support needs testing.
 1.6.4.2 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.6.4.1 02-Oct-2007  joerg Sync with HEAD.
 1.8.2.2 14-Oct-2007  yamt sync with head.
 1.8.2.1 06-Oct-2007  yamt sync with head.
 1.11.4.2 18-Feb-2008  mjf Sync with HEAD.
 1.11.4.1 08-Dec-2007  mjf Sync with HEAD.
 1.12.6.1 02-Jan-2008  bouyer Sync with HEAD
 1.12.2.1 04-Dec-2007  ad Pull the vmlocking changes into a new branch.
 1.14.20.4 06-Jan-2009  snj Apply patch (requested by rumble in ticket #216):
Adjust for the netbsd-5 branch by defining UBC_UNMAP_FLAG.
 1.14.20.3 06-Jan-2009  snj Pull up following revision(s) (requested by rumble in ticket #216):
sys/fs/efs/efs_vfsops.c: revision 1.17
sys/fs/efs/efs_vnops.c: revision 1.17
Add specfs/fifofs support. Not really fully tested, but at least
vfs routines don't crash now.
(didn't have an image with matching device node numbers)
fixes PR kern/40055 by myself
 1.14.20.2 06-Jan-2009  snj Pull up following revision(s) (requested by rumble in ticket #216):
sys/fs/efs/efs_vnops.c: revision 1.16
Rototill all remaining file systems to use ubc_uiomove() instead
of the ubc_alloc() - uiomove() - ubc_release() dance.
 1.14.20.1 06-Jan-2009  snj Pull up following revision(s) (requested by rumble in ticket #216):
sys/fs/efs/efs_vnops.c: revision 1.15
more <sys/buf.h> police
 1.14.18.1 19-Jan-2009  skrll Sync with HEAD.
 1.14.16.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.14.10.3 11-Aug-2010  yamt sync with head.
 1.14.10.2 18-Jul-2009  yamt sync with head.
 1.14.10.1 04-May-2009  yamt sync with head.
 1.14.6.1 17-Jan-2009  mjf Sync with HEAD.
 1.17.4.1 23-Jul-2009  jym Sync with HEAD.
 1.20.4.4 31-May-2011  rmind sync with head
 1.20.4.3 05-Mar-2011  rmind sync with head
 1.20.4.2 03-Jul-2010  rmind sync with head
 1.20.4.1 30-May-2010  rmind sync with head
 1.20.2.2 17-Aug-2010  uebayasi Sync with HEAD.
 1.20.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.23.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.24.10.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.8.1 05-Apr-2012  mrg sync to latest -current.
 1.24.4.5 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.4.4 23-Jan-2013  yamt sync with head
 1.24.4.3 16-Jan-2013  yamt sync with (a bit old) head
 1.24.4.2 30-Oct-2012  yamt sync with head
 1.24.4.1 17-Apr-2012  yamt sync with head
 1.26.2.5 03-Dec-2017  jdolecek update from HEAD
 1.26.2.4 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.26.2.3 23-Jun-2013  tls resync from head
 1.26.2.2 25-Feb-2013  tls resync with head
 1.26.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.30.6.1 18-May-2014  rmind sync with head
 1.31.2.1 10-Aug-2014  tls Rebase.
 1.33.4.4 28-Aug-2017  skrll Sync with HEAD
 1.33.4.3 05-Oct-2016  skrll Sync with HEAD
 1.33.4.2 09-Jul-2016  skrll Sync with HEAD
 1.33.4.1 19-Mar-2016  skrll Sync with HEAD
 1.35.2.1 26-Apr-2017  pgoyette Sync with HEAD
 1.36.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.38.20.1 25-Apr-2020  bouyer Sync with bouyer-xenpvh-base2 (HEAD)
 1.41.6.1 01-Aug-2021  thorpej Sync with HEAD.
 1.3 11-Oct-2014  uebayasi Define filesystem attributes with vfs dependency.
 1.2 07-Aug-2014  hannken Change efs from hashlist to vcache.
 1.1 29-Jun-2007  rumble branches: 1.1.2; 1.1.12; 1.1.82; 1.1.98;
Add read-only support for SGI's Extent File System.

Reviewed by pooka@.
 1.1.98.1 10-Aug-2014  tls Rebase.
 1.1.82.2 03-Dec-2017  jdolecek update from HEAD
 1.1.82.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.12.2 03-Sep-2007  yamt sync with head.
 1.1.12.1 29-Jun-2007  yamt file files.efs was added on branch yamt-lazymbuf on 2007-09-03 14:40:16 +0000
 1.1.2.2 15-Jul-2007  ad Sync with head.
 1.1.2.1 29-Jun-2007  ad file files.efs was added on branch vmlocking on 2007-07-15 16:15:31 +0000

RSS XML Feed