Home | History | Annotate | Download | only in kernfs
History log of /src/sys/miscfs/kernfs/kernfs_vfsops.c
RevisionDateAuthorComments
 1.101  16-Feb-2025  joe remove unecessary branches
 1.100  07-Apr-2020  jdolecek branches: 1.100.28;
switch to kmem_zalloc() instead of malloc() for struct kernfs_mount
 1.99  16-Mar-2020  pgoyette Use the module subsystem's ability to process SYSCTL_SETUP() entries to
automate installation of sysctl nodes.

Note that there are still a number of device and pseudo-device modules
that create entries tied to individual device units, rather than to the
module itself. These are not changed.
 1.98  04-Feb-2020  riastradh Use specfs vnops for specnodes in kernfs.

While here, don't filter out rootdev and rrootdev merely because
they're not cached.

Fixes the elusive /kern/rootdev and /kern/rrootdev nodes, which only
appeared sometimes when they felt like it, and fixes operations on
/kern/rootdev and /kern/rrootdev always returning EOPNOTSUPP.

We didn't seem to have a single PR for these issues but the following
PRs are all relevant:

PR bin/13564
PR kern/38265
PR kern/38778
PR kern/45974

XXX pullup-9, pullup-8, pullup-7, pullup-6, pullup-5, pullup-4, pullup-3, pullup-2, pullup-1.4T...
 1.97  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.96  17-Feb-2017  hannken branches: 1.96.14; 1.96.18; 1.96.20;
Add generic genfs_suspendctl() and use it for all file systems.
Layered file systems need work.
 1.95  20-Jul-2014  hannken branches: 1.95.4; 1.95.8; 1.95.12;
Change kernfs from hashlist to vcache.
 1.94  17-Jul-2014  hannken Finish KAME IPSEC removal:
- Remove field kfs_value, it is always zero. Compute the hash from kt_tag.
- Remove stray definitions kernfs_revoke_sa and kernfs_revoke_sp.

While here, remove kfs_type from allocvp(), it is always kt->kt_tag.
 1.93  23-Mar-2014  hannken branches: 1.93.2;
Change all vfsops to use C99 designated initializers.

No functional changes intended.
 1.92  25-Feb-2014  pooka Ensure that the top level sysctl nodes (kern, vfs, net, ...) exist before
the sysctl link sets are processed, and remove redundancy.

Shaves >13kB off of an amd64 GENERIC, not to mention >1k duplicate
lines of code.
 1.91  27-Sep-2011  christos branches: 1.91.2; 1.91.12; 1.91.16;
define KERNFS_MAXNAMLEN and use it.`
 1.90  30-Nov-2009  pooka Introduce genfs_statvfs() as pretty much a no-info statvfs and
convert several pseudo file systems to use it.
 1.89  15-Mar-2009  cegger ansify function definitions
 1.88  14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.87  17-Dec-2008  cegger branches: 1.87.2;
kill MALLOC and FREE macros.
 1.86  28-Jun-2008  rumble branches: 1.86.4;
Create sysctl entries during module initialisation and destroy them
appropriately.

Many of these file systems are now ready for modularisation.
 1.85  10-May-2008  rumble branches: 1.85.2;
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.84  29-Apr-2008  ad branches: 1.84.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.83  28-Jan-2008  dholland branches: 1.83.6; 1.83.8; 1.83.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.82  26-Nov-2007  pooka 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.81  31-Jul-2007  pooka branches: 1.81.2; 1.81.4; 1.81.10; 1.81.12;
* 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.80  26-Jul-2007  pooka Use eopnotsupp() instead of vfs_stdsuspendctl() and retire the latter.
 1.79  17-Jul-2007  pooka branches: 1.79.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.78  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.77  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.76  19-Jan-2007  hannken branches: 1.76.6; 1.76.8;
New file system suspension API to replace vn_start_write and vn_finished_write.
The suspension helpers are now put into file system specific operations.
This means every file system not supporting these helpers cannot be suspended
and therefore snapshots are no longer possible.

Implemented for file systems of type ffs.

The new API is enabled on a kernel option NEWVNGATE. This option is
not enabled by default in any kernel config.

Presented and discussed on tech-kern with much input from
Bill Studenmund <wrstuden@netbsd.org> and YAMAMOTO Takashi <yamt@netbsd.org>.

Welcome to 4.99.9 (new vfs op vfs_suspendctl).
 1.75  09-Dec-2006  chs a smorgasbord of improvements to vnode locking and path lookup:
- LOCKPARENT is no longer relevant for lookup(), relookup() or VOP_LOOKUP().
these now always return the parent vnode locked. namei() works as before.
lookup() and various other paths no longer acquire vnode locks in the
wrong order via vrele(). fixes PR 32535.
as a nice side effect, path lookup is also up to 25% faster.
- the above allows us to get rid of PDIRUNLOCK.
- also get rid of WANTPARENT (just use LOCKPARENT and unlock it).
- remove an assumption in layer_node_find() that all file systems implement
a recursive VOP_LOCK() (unionfs doesn't).
- require that all file systems supply vfs_vptofh and vfs_fhtovp routines.
fill in eopnotsupp() for file systems that don't support being exported
and remove the checks for NULL. (layerfs calls these without checking.)
- in union_lookup1(), don't change refcounts in the ISDOTDOT case, just
adjust which vnode is locked. fixes PR 33374.
- apply fixes for ufs_rename() from ufs_vnops.c rev. 1.61 to ext2fs_rename().
 1.74  16-Nov-2006  christos branches: 1.74.2;
__unused removal on arguments; approved by core.
 1.73  12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.72  02-Sep-2006  christos branches: 1.72.2; 1.72.4;
add missing initializers.
 1.71  14-May-2006  elad integrate kauth.
 1.70  11-Dec-2005  christos branches: 1.70.4; 1.70.6; 1.70.8; 1.70.10; 1.70.12;
merge ktrace-lwp.
 1.69  23-Sep-2005  jmmv Apply the NFS exports list rototill patch:

- Remove all NFS related stuff from file system specific code.
- Drop the vfs_checkexp hook and generalize it in the new nfs_check_export
function, thus removing redundancy from all file systems.
- Move all NFS export-related stuff from kern/vfs_subr.c to the new
file sys/nfs/nfs_export.c. The former was becoming large and its code
is always compiled, regardless of the build options. Using the latter,
the code is only compiled in when NFSSERVER is enabled. While doing this,
also make some functions in nfs_subs.c conditional to NFSSERVER.
- Add a new command in nfssvc(2), called NFSSVC_SETEXPORTSLIST, that takes a
path and a set of export entries. At the moment it can only clear the
exports list or append entries, one by one, but it is done in a way that
allows setting the whole set of entries atomically in the future (see the
comment in mountd_set_exports_list or in doc/TODO).
- Change mountd(8) to use the nfssvc(2) system call instead of mount(2) so
that it becomes file system agnostic. In fact, all this whole thing was
done to remove a 'XXX' block from this utility!
- Change the mount*, newfs and fsck* userland utilities to not deal with NFS
exports initialization; done internally by the kernel when initializing
the NFS support for each file system.
- Implement an interface for VFS (called VFS hooks) so that several kernel
subsystems can run arbitrary code upon receipt of specific VFS events.
At the moment, this only provides support for unmount and is used to
destroy NFS exports lists from the file systems being unmounted, though it
has room for extension.

Thanks go to yamt@, chs@, thorpej@, wrstuden@ and others for their comments
and advice in the development of this patch.
 1.68  30-Aug-2005  xtraeme Remove __P()
 1.67  29-Mar-2005  thorpej branches: 1.67.2;
- Define a VFS_ATTACH() macro that places a reference to a vfsops structure
into the "vfsops" link set.
- Use VFS_ATTACH() where vfsops are declared for individual file systems.
- In vfsinit(), traverse the "vfsops" link set, rather than vfs_list_initial[].
 1.66  02-Jan-2005  thorpej branches: 1.66.2;
Add the system call and VFS infrastructure for file system extended
attributes.

From FreeBSD.
 1.65  13-Sep-2004  jdolecek set mp->mnt_stat.f_namemax on filesystem mount, for use by statvfs
 1.64  29-May-2004  tron Don't leak memory in VFS_MOUNT() if set_statvfs_info() fails.
 1.63  25-May-2004  hannken Add ffs internal snapshots. Written by Marshall Kirk McKusick for FreeBSD.

- Not enabled by default. Needs kernel option FFS_SNAPSHOT.
- Change parameters of ffs_blkfree.
- Let the copy-on-write functions return an error so spec_strategy
may fail if the copy-on-write fails.
- Change genfs_*lock*() to use vp->v_vnlock instead of &vp->v_lock.
- Add flag B_METAONLY to VOP_BALLOC to return indirect block buffer.
- Add a function ffs_checkfreefile needed for snapshot creation.
- Add special handling of snapshot files:
Snapshots may not be opened for writing and the attributes are read-only.
Use the mtime as the time this snapshot was taken.
Deny mtime updates for snapshot files.
- Add function transferlockers to transfer any waiting processes from
one lock to another.
- Add vfsop VFS_SNAPSHOT to take a snapshot and make it accessible through
a vnode.
- Add snapshot support to ls, fsck_ffs and dump.

Welcome to 2.0F.

Approved by: Jason R. Thorpe <thorpej@netbsd.org>
 1.62  25-May-2004  atatat Sysctl descriptions under vfs subtree
 1.61  27-Apr-2004  jrf First pass for some caddr_t removal and changes to get rid of it where we
no longer use and/or need it

- removed casts from unionfs, deadfs and fdesc
(there are more to hunt down still)
- changed vfs_quotactl args argumet from caddr_t to void *
- changed vfs_quotactl structures/callers to reflect the api change

Compiled fine and ran for about a day. Approved/reviewed by
christos@netbsd.org and gimpy@netbsd.org.
 1.60  21-Apr-2004  christos add sys/dirent.h
 1.59  21-Apr-2004  christos Replace the statfs() family of system calls with statvfs().
Retain binary compatibility.
 1.58  24-Mar-2004  atatat branches: 1.58.2;
Tango on sysctl_createv() and flags. The flags have all been renamed,
and sysctl_createv() now uses more arguments.
 1.57  04-Dec-2003  atatat Dynamic sysctl.

Gone are the old kern_sysctl(), cpu_sysctl(), hw_sysctl(),
vfs_sysctl(), etc, routines, along with sysctl_int() et al. Now all
nodes are registered with the tree, and nodes can be added (or
removed) easily, and I/O to and from the tree is handled generically.

Since the nodes are registered with the tree, the mapping from name to
number (and back again) can now be discovered, instead of having to be
hard coded. Adding new nodes to the tree is likewise much simpler --
the new infrastructure handles almost all the work for simple types,
and just about anything else can be done with a small helper function.

All existing nodes are where they were before (numerically speaking),
so all existing consumers of sysctl information should notice no
difference.

PS - I'm sorry, but there's a distinct lack of documentation at the
moment. I'm working on sysctl(3/8/9) right now, and I promise to
watch out for buses.
 1.56  27-Sep-2003  darcy Changes as discussed with itojun on tech-kern. I have modified the enums
to have KFS or PFS differentiators. Further I have wrapped the enum in
procfs in "#ifdef _KERNEL" as it is done in kernfs.

To see the discussion go to http://mail-index.NetBSD.org/tech-kern/2003/09/
and look for "Mismatched enums in include files" in the list.
 1.55  26-Sep-2003  atatat Make kernfs peacefully co-exist with procfs.
 1.54  08-Sep-2003  itojun add /kern/ipsecsa and /kern/ipsecsp, which can be inspected by setkey(8).
it allows easier access to ipsecsa/sp. it works around problem where
setkey -D does not work with large number of ipsec SAs due to socket buffer
size.
 1.53  07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.52  29-Jun-2003  fvdl branches: 1.52.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.51  29-Jun-2003  thorpej Undo part of the ktrace/lwp changes. In particular:
* Remove the "lwp *" argument that was added to vget(). Turns out
that nothing actually used it!
* Remove the "lwp *" arguments that were added to VFS_ROOT(), VFS_VGET(),
and VFS_FHTOVP(); all they did was pass it to vget() (which, as noted
above, didn't use it).
* Remove all of the "lwp *" arguments to internal functions that were added
just to appease the above.
 1.50  28-Jun-2003  darrenr Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records. The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
 1.49  22-Apr-2003  christos fix lkm malloc lossage.
 1.48  16-Apr-2003  christos PR/1796: John Kohl: statfs misbehaves under chrooted environments.

- Under chroot it displays only the visible filesystems with appropriate paths.
- The statfs f_mntonname gets adjusted to contain the real path from root.
- While was there, fixed a bug in ext2fs, locking problems with vfs_getfsstat(),
and factored out some of the vfsop statfs() code to copy_statfs_info(). This
fixes the problem where some filesystems forgot to set fsid.
- Made coda look more like a normal fs.
 1.47  01-Feb-2003  thorpej Add extensible malloc types, adapted from FreeBSD. This turns
malloc types into a structure, a pointer to which is passed around,
instead of an int constant. Allow the limit to be adjusted when the
malloc type is defined, or with a function call, as suggested by
Jonathan Stone.
 1.46  21-Sep-2002  christos MNT_GETARGS support
 1.45  06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.44  30-Jul-2002  soren Die, qaddr_t, die! - mnt_data in struct mount is already effectively
a void *, so stop pretending otherwise.
 1.43  15-Nov-2001  lukem branches: 1.43.8;
don't need <sys/types.h> when including <sys/param.h>
 1.42  10-Nov-2001  lukem add RCSIDs
 1.41  15-Sep-2001  chs branches: 1.41.2;
add a new VFS op, vfs_reinit, which is called when desiredvnodes is
adjusted via sysctl. file systems that have hash tables which are
sized based on the value of this variable now resize those hash tables
using the new value. the max number of FFS softdeps is also recalculated.

convert various file systems to use the <sys/queue.h> macros for
their hash tables.
 1.40  30-May-2001  mrg branches: 1.40.2; 1.40.4;
use _KERNEL_OPT
 1.39  04-Feb-2001  mrg branches: 1.39.2;
clean up some KERNFS_DIAGNOSTIC calls.
 1.38  22-Jan-2001  jdolecek make filesystem vnodeop, specop, fifoop and vnodeopv_* arrays const
 1.37  10-Jun-2000  assar make vfs_getnewfsid only take one argument and fetch the name of the
filesystem from the supplied mount argument. also make makefstype
take a const parameter. update all the callers.
 1.36  16-Mar-2000  jdolecek branches: 1.36.2;
Add new VFS op routine - vfs_done and call it on filesystem detach
in vfs_detach(). vfs_done may free global filesystem's resources,
typically those allocated in respective filesystem's init function.
Needed so those filesystems which went in via LKM have a chance to
clean after themselves before unloading. This fixes random panics
when LKM for filesystem using pools was loaded and unloaded several
times.

For each leaf filesystem, add appropriate vfs_done routine.
 1.35  26-Feb-1999  wrstuden branches: 1.35.8; 1.35.14;
Modify vfsops to seperate vfs_fhtovp() into two routines. vfs_fhtovp() now
only handles the file handle to vnode conversion, and a new call,
vfs_checkexp(), performs the export verification.
 1.34  09-Aug-1998  perry bzero->memset, bcopy->memcpy, bcmp->memcmp
 1.33  05-Jul-1998  jonathan * defopt COMPAT_{09,10,11,12,13} and COMPAT_NOMID.
TODO: revisit interaction between native compat and emul compat usage.
 1.32  01-Mar-1998  fvdl Merge with Lite2 + local changes
 1.31  18-Feb-1998  thorpej Place a pointer to an array of our vnodeopv_desc *'s in our vfsops
structure, for use by vfs_attach().
 1.30  10-Sep-1997  christos PR/4098: Alan Barrett: Fix diagnostic printf formatting.
 1.29  22-Dec-1996  cgd branches: 1.29.10;
Change the second and third args to struct vfsops' (*vfs_mount)() to
'const char *', and 'void *', respectively. The second arg is taken directly
from user arguments, and is const there, so must be const in the prototypes
and functions. The third arg is also taken directly from user arguments.
It doesn't have to be changed, but since it's cleaner to keep the type
the same as the user arg's type, and I'm already making the 'const char *'
change...
 1.28  13-Oct-1996  christos backout previous kprintf changes
 1.27  10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.26  22-Apr-1996  christos remove include of <sys/cpu.h>
 1.25  09-Feb-1996  christos miscfs prototype changes
 1.24  18-Jun-1995  cgd don't assume the f_fsnamelen is nul-truncated or longer than MFSNAMELEN
 1.23  09-Mar-1995  mycroft copy*str() should use size_t.
 1.22  08-Mar-1995  cgd use u_long for copyin*
 1.21  18-Jan-1995  mycroft Clean up the code to frob mnt_stat a (tiny) bit.
 1.20  15-Dec-1994  mycroft Call foo_statfs() from a common place when mounting.
 1.19  15-Sep-1994  mycroft stat the file system at mount time, for `df -n', et al.
 1.18  29-Jun-1994  cgd branches: 1.18.2;
New RCS ID's, take two. they're more aesthecially pleasant, and use 'NetBSD'
 1.17  15-Jun-1994  mycroft Minor update from JSP after merging my changes.
 1.16  15-Jun-1994  mycroft Fix a bug in finding the raw root device.
 1.15  08-Jun-1994  mycroft Update to 4.4-Lite fs code, with local changes.
 1.14  23-Apr-1994  cgd make fs types consistent over new kernels. also, some proto foo.
 1.13  21-Apr-1994  cgd Convert mount, vnode, and buf structs to use <sys/queue.h>. Also,
some knf and structure frobbing to do along with it.
 1.12  14-Apr-1994  cgd fs types are names now.
 1.11  05-Jan-1994  cgd update with latest kernfs file system from jsp@sequent.com
 1.10  20-Dec-1993  cgd branches: 1.10.2;
pull load average and misc changes down from magnum
 1.9  18-Dec-1993  mycroft Canonicalize all #includes.
 1.8  23-Aug-1993  cgd branches: 1.8.2;
changes from 0.9-ALPHA2 to 0.9-BETA
 1.7  07-Jun-1993  cgd branches: 1.7.2;
give various filesystems their own vnode types
 1.6  07-Jun-1993  cgd give miscfs filesystems their own mount structure malloc type.
 1.5  28-May-1993  cgd add some more functionality: a setattr which supports chmod+chown+chgrp,
and the various support elsewhere to deal with it.
 1.4  27-Mar-1993  cgd added cdevvp (after taking it out of vfs_subr.c) because realized
that it was only needed here.
 1.3  27-Mar-1993  cgd added ".." and support for "rrootdev"
 1.2  25-Mar-1993  cgd changed copyright notice thanks to following statement:

Return-Path: jsp@compnews.co.uk
Received: from ben.uknet.ac.uk by postgres.Berkeley.EDU (5.61/1.29)
id AA25983; Thu, 25 Mar 93 05:37:37 -0800
Received: from fennel.compnews.co.uk by ben.uknet.ac.uk via UKIP with SMTP (PP)
id <g.05640-0@ben.uknet.ac.uk>; Thu, 25 Mar 1993 13:37:19 +0000
Received: from sage.compnews.co.uk by fennel.compnews.co.uk;
Thu, 25 Mar 93 13:37:08 GMT
Message-Id: <28109.9303251337@sage.compnews.co.uk>
From: jsp@compnews.co.uk (Jan-Simon Pendry)
Date: Thu, 25 Mar 1993 13:37:05 +0100
In-Reply-To: cgd@postgres.berkeley.edu's message as of Mar 25, 5:32am.
Phone-Number-1: +44 430 432450
Phone-Number-2: +44 430 432480 x20
Fax-Number: +44 430 432022
X-Mailer: Mail User's Shell (7.2.5 10/14/92)
To: cgd@postgres.berkeley.edu
Subject: Re: fdesc/kernfs/etc code...

You may put this copyright message on the source code:

/*
* Copyright (c) 1990, 1992 Jan-Simon Pendry
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Jan-Simon Pendry.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
*/
 1.1  23-Mar-1993  cgd branches: 1.1.1;
files which implement the kern filesystem. from Jan-Simon Pendry,
pendry@vangogh.cs.berkeley.edu
 1.1.1.2  01-Mar-1998  fvdl Import 4.4BSD-Lite2
 1.1.1.1  01-Mar-1998  fvdl Import 4.4BSD-Lite for reference
 1.7.2.1  20-Aug-1993  cgd kill old, badly placed incarnation of cdevvp
 1.8.2.3  03-Dec-1993  cgd don't try to get rootdev at vfs init time. wait until kernfs mount time
to do it. this is hackish, but it gets the job done, and is slightly
more robust than the previous way it was done...
 1.8.2.2  29-Nov-1993  mycroft Don't crash deferencing a null pointer if the raw root device was not found.
 1.8.2.1  14-Nov-1993  mycroft Canonicalize all #includes.
 1.10.2.3  06-Jan-1994  pk Re-instate EOPNOTSUPP
 1.10.2.2  28-Dec-1993  pk Return ENODEV rather then EOPNOTSUPP for unsupported operations.
 1.10.2.1  20-Dec-1993  pk file kernfs_vfsops.c was added on branch magnum on 1993-12-28 16:21:43 +0000
 1.18.2.1  16-Sep-1994  cgd from trunk, per mycroft
 1.29.10.1  16-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.35.14.1  21-Dec-1999  wrstuden Initial commit of recent changes to make DEV_BSIZE go away.

Runs on i386, needs work on other arch's. Main kernel routines should be
fine, but a number of the stand programs need help.

cd, fd, ccd, wd, and sd have been updated. sd has been tested with non-512
byte block devices. vnd, raidframe, and lfs need work.

Non 2**n block support is automatic for LKM's and conditional for kernels
on "options NON_PO2_BLOCKS".
 1.35.8.2  11-Feb-2001  bouyer Sync with HEAD.
 1.35.8.1  20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.36.2.1  22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.39.2.7  18-Oct-2002  nathanw Catch up to -current.
 1.39.2.6  17-Sep-2002  nathanw Catch up to -current.
 1.39.2.5  01-Aug-2002  nathanw Catch up to -current.
 1.39.2.4  08-Jan-2002  nathanw Catch up to -current.
 1.39.2.3  14-Nov-2001  nathanw Catch up to -current.
 1.39.2.2  21-Sep-2001  nathanw Catch up to -current.
 1.39.2.1  21-Jun-2001  nathanw Catch up to -current.
 1.40.4.1  01-Oct-2001  fvdl Catch up with -current.
 1.40.2.3  10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.40.2.2  06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.40.2.1  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.41.2.1  12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.43.8.2  29-Aug-2002  gehenna catch up with -current.
 1.43.8.1  16-May-2002  gehenna Replace the direct-access to devsw table with calling devsw APIs.
 1.52.2.8  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.52.2.7  01-Apr-2005  skrll Sync with HEAD.
 1.52.2.6  17-Jan-2005  skrll Sync with HEAD.
 1.52.2.5  21-Sep-2004  skrll Fix the sync with head I botched.
 1.52.2.4  18-Sep-2004  skrll Sync with HEAD.
 1.52.2.3  24-Aug-2004  skrll Undo part of the ktrace/lwp changes. In particular:
* Remove the "lwp *" argument that was added to vget(). Turns out
that nothing actually used it!
* Remove the "lwp *" arguments that were added to VFS_ROOT(), VFS_VGET(),
and VFS_FHTOVP(); all they did was pass it to vget() (which, as noted
above, didn't use it).
* Remove all of the "lwp *" arguments to internal functions that were added
just to appease the above.
 1.52.2.2  03-Aug-2004  skrll Sync with HEAD
 1.52.2.1  02-Jul-2003  darrenr Apply the aborted ktrace-lwp changes to a specific branch. This is just for
others to review, I'm concerned that patch fuziness may have resulted in some
errant code being generated but I'll look at that later by comparing the diff
from the base to the branch with the file I attempt to apply to it. This will,
at the very least, put the changes in a better context for others to review
them and attempt to tinker with removing passing of 'struct lwp' through
the kernel.
 1.58.2.1  29-May-2004  tron Pull up revision 1.62 (requested by atatat in ticket #393):
Sysctl descriptions under vfs subtree
 1.66.2.1  29-Apr-2005  kent sync with -current
 1.67.2.6  04-Feb-2008  yamt sync with head.
 1.67.2.5  07-Dec-2007  yamt sync with head
 1.67.2.4  03-Sep-2007  yamt sync with head.
 1.67.2.3  26-Feb-2007  yamt sync with head.
 1.67.2.2  30-Dec-2006  yamt sync with head.
 1.67.2.1  21-Jun-2006  yamt sync with head.
 1.70.12.1  24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.70.10.2  06-May-2006  christos - Move kauth_cred_t declaration to <sys/types.h>
- Cleanup struct ucred; forward declarations that are unused.
- Don't include <sys/kauth.h> in any header, but include it in the c files
that need it.

Approved by core.
 1.70.10.1  08-Mar-2006  elad Adapt to kernel authorization KPI.
 1.70.8.2  03-Sep-2006  yamt sync with head.
 1.70.8.1  24-May-2006  yamt sync with head.
 1.70.6.1  01-Jun-2006  kardel Sync with head.
 1.70.4.1  09-Sep-2006  rpaulo sync with head
 1.72.4.2  10-Dec-2006  yamt sync with head.
 1.72.4.1  22-Oct-2006  yamt sync with head
 1.72.2.3  01-Feb-2007  ad Sync with head.
 1.72.2.2  12-Jan-2007  ad Sync with head.
 1.72.2.1  18-Nov-2006  ad Sync with head.
 1.74.2.1  17-Feb-2007  tron Apply patch (requested by chs in ticket #422):
- Fix various deadlock problems with nullfs and unionfs.
- Speed up path lookups by upto 25%.
 1.76.8.1  11-Jul-2007  mjf Sync with head.
 1.76.6.2  20-Aug-2007  ad Sync with HEAD.
 1.76.6.1  15-Jul-2007  ad Sync with head.
 1.79.2.1  15-Aug-2007  skrll Sync with HEAD.
 1.81.12.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.81.12.1  31-Jul-2007  pooka file kernfs_vfsops.c was added on branch matt-mips64 on 2007-07-31 21:14:17 +0000
 1.81.10.2  18-Feb-2008  mjf Sync with HEAD.
 1.81.10.1  08-Dec-2007  mjf Sync with HEAD.
 1.81.4.2  23-Mar-2008  matt sync with HEAD
 1.81.4.1  09-Jan-2008  matt sync with HEAD
 1.81.2.1  27-Nov-2007  joerg Sync with HEAD. amd64 Xen support needs testing.
 1.83.10.3  11-Mar-2010  yamt sync with head
 1.83.10.2  04-May-2009  yamt sync with head.
 1.83.10.1  16-May-2008  yamt sync with head.
 1.83.8.1  18-May-2008  yamt sync with head.
 1.83.6.3  17-Jan-2009  mjf Sync with HEAD.
 1.83.6.2  29-Jun-2008  mjf Sync with HEAD.
 1.83.6.1  02-Jun-2008  mjf Sync with HEAD.
 1.84.2.2  18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.84.2.1  23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.85.2.1  03-Jul-2008  simonb Sync with head.
 1.86.4.2  28-Apr-2009  skrll Sync with HEAD.
 1.86.4.1  19-Jan-2009  skrll Sync with HEAD.
 1.87.2.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.91.16.1  18-May-2014  rmind sync with head
 1.91.12.2  03-Dec-2017  jdolecek update from HEAD
 1.91.12.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.91.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.93.2.1  10-Aug-2014  tls Rebase.
 1.95.12.1  21-Apr-2017  bouyer Sync with HEAD
 1.95.8.1  20-Mar-2017  pgoyette Sync with HEAD
 1.95.4.1  28-Aug-2017  skrll Sync with HEAD
 1.96.20.2  29-Feb-2020  ad Sync with head.
 1.96.20.1  17-Jan-2020  ad Sync with head.
 1.96.18.1  12-Feb-2020  martin Pull up following revision(s) (requested by riastradh in ticket #702):

sys/miscfs/kernfs/kernfs_vfsops.c: revision 1.98
sys/miscfs/kernfs/kernfs_vnops.c: revision 1.163
sys/miscfs/kernfs/kernfs.h: revision 1.43

Use specfs vnops for specnodes in kernfs.

While here, don't filter out rootdev and rrootdev merely because
they're not cached.

Fixes the elusive /kern/rootdev and /kern/rrootdev nodes, which only
appeared sometimes when they felt like it, and fixes operations on
/kern/rootdev and /kern/rrootdev always returning EOPNOTSUPP.

We didn't seem to have a single PR for these issues but the following
PRs are all relevant:

PR bin/13564
PR kern/38265
PR kern/38778
PR kern/45974

XXX pullup-9, pullup-8, pullup-7, pullup-6, pullup-5, pullup-4, pullup-3, p=
ullup-2, pullup-1.4T...
 1.96.14.2  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.96.14.1  08-Apr-2020  martin Merge changes from current as of 20200406
 1.100.28.1  02-Aug-2025  perseant Sync with HEAD

RSS XML Feed