History log of /netbsd-current/sys/ufs/mfs/mfs_vfsops.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.116 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.115 19-Mar-2022 hannken

Switch MFS device node to real vnode locking, VV_LOCKSWORK now.


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-i2c-spi-conf-base thorpej-cfargs-base thorpej-futex-base bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base phil-wifi-20200406
# 1.114 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.


Revision tags: netbsd-9-2-RELEASE netbsd-9-1-RELEASE is-mlppp-base netbsd-8-2-RELEASE ad-namecache-base3 netbsd-9-0-RELEASE netbsd-9-0-RC2 ad-namecache-base2 ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 netbsd-8-1-RELEASE netbsd-8-1-RC1 isaki-audio2-base pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1
# 1.113 17-Apr-2017 hannken

branches: 1.113.12;
Remove unused argument "nextp" from vfs_busy() and vfs_unbusy().
Remove argument "keepref" from vfs_unbusy() and add vfs_ref() where needed.


# 1.112 17-Apr-2017 hannken

Add vfs_ref(mp) and vfs_rele(mp) to add or remove a reference to
struct mount. Rename vfs_destroy(mp) to vfs_rele(mp) and replace
incrementing mp->mnt_refcnt with vfs_ref(mp).


Revision tags: jdolecek-ncq-base pgoyette-localcount-20170320
# 1.111 17-Feb-2017 hannken

Add generic genfs_suspendctl() and use it for all file systems.
Layered file systems need work.


Revision tags: nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606 nick-nhusb-base-20150406
# 1.110 17-Mar-2015 hannken

branches: 1.110.2; 1.110.4;
Change ffs to use vcache_new:
- Change ffs_valloc to return an inode number.
- Remove now obsolete UFS operations UFS_VALLOC and UFS_VFREE.
- Make ufs_makeinode private to ufs_vnops.c and pass vattr instead of mode.


# 1.109 14-Jan-2015 hannken

Change mfs to use an anonymous vnode obtained with bdevvp()
for the specdev it mounts on.


Revision tags: netbsd-7-2-RELEASE netbsd-7-1-2-RELEASE netbsd-7-1-1-RELEASE netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 netbsd-7-0-2-RELEASE netbsd-7-nhusb-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.108 08-May-2014 hannken

branches: 1.108.4;
Add a global vnode cache:

- vcache_get() retrieves a referenced and initialised vnode / fs node pair.
- vcache_remove() removes a vnode / fs node pair from the cache.

On cache miss vcache_get() calls new vfs operation vfs_loadvnode() to
initialise a vnode / fs node pair. This call is guaranteed exclusive,
no other thread will try to load this vnode / fs node pair.

Convert ufs/ext2fs, ufs/ffs and ufs/mfs to use this interface.

Remove now unused ufs/ufs_ihash

Discussed on tech-kern.

Welcome to 6.99.41


# 1.107 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@


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15
# 1.106 23-Mar-2014 hannken

branches: 1.106.2;
Change all vfsops to use C99 designated initializers.

No functional changes intended.


Revision tags: riastradh-drm2-base3
# 1.105 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.104 23-Nov-2013 christos

change the mountlist CIRCLEQ into a TAILQ


Revision tags: yamt-pagecache-tag8 netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 agc-symver-base netbsd-6-1-RC2 netbsd-6-1-RC1 yamt-pagecache-base8 netbsd-6-0-1-RELEASE yamt-pagecache-base7 matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.103 12-Jun-2011 rmind

branches: 1.103.2; 1.103.8; 1.103.12; 1.103.14; 1.103.16; 1.103.22;
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.


Revision tags: rmind-uvmplock-nbase cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10 uebayasi-xip-base1 rmind-uvmplock-base yamt-nfs-mp-base9
# 1.102 02-Mar-2010 pooka

branches: 1.102.2; 1.102.8;
Make mfs_initminiroot() mandatory. Allows to remove #ifdef MFS.


Revision tags: uebayasi-xip-base matt-premerge-20091211 yamt-nfs-mp-base8 yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 jym-xensuspend-nbase yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base2 jym-xensuspend-base nick-hppapmap-base mjf-devfs2-base
# 1.101 13-Jan-2009 yamt

branches: 1.101.4;
g/c BUFQ_FOO() macros and use bufq_foo() directly.


# 1.100 19-Dec-2008 pgoyette

Store config(1)'s root filesystem type as a text string rather than
embedding the address of its xxx_mountroot() in swapnetbsd.c. This
permits booting of kernels with hard-wired filesystem type even if the
filesystem is in a loadable module (ie, not linked into the kernel
image).

Discussed on current-users. Tested on amd64 and i386 with both hard-
wired and '?' filesystem times, and on both modular and monolithic
kernels.

Thanks to pooka@ for code review and suggestions.

Addresses my PR kern/40167


Revision tags: haad-dm-base2 haad-nbase2 ad-audiomp2-base haad-dm-base
# 1.99 13-Nov-2008 ad

These depend on ffs.


Revision tags: netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 simonb-wapbl-nbase simonb-wapbl-base
# 1.98 28-Jun-2008 rumble

branches: 1.98.2; 1.98.4; 1.98.6; 1.98.12; 1.98.16;
Create sysctl entries during module initialisation and destroy them
appropriately.

Many of these file systems are now ready for modularisation.


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base
# 1.97 10-May-2008 rumble

branches: 1.97.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.96 06-May-2008 ad

branches: 1.96.2;
PR kern/38141 lookup/vfs_busy acquire rwlock recursively

Simplify the mount locking. Remove all the crud to deal with recursion on
the mount lock, and crud to deal with unmount as another weirdo lock.

Hopefully this will once and for all fix the deadlocks with this. With this
commit there are two locks on each mount:

- krwlock_t mnt_unmounting. This is used to prevent unmount across critical
sections like getnewvnode(). It's only ever read locked with rw_tryenter(),
and is only ever write locked in dounmount(). A write hold can't be taken
on this lock if the current LWP could hold a vnode lock.

- kmutex_t mnt_updating. This is taken by threads updating the mount, for
example when going r/o -> r/w, and is only present to serialize updates.
In order to take this lock, a read hold must first be taken on
mnt_unmounting, and the two need to be held across the operation.

One effect of this change: previously if an unmount failed, we would make a
half hearted attempt to back out of it gracefully, but that was unlikely to
work in a lot of cases. Now while an unmount that will be aborted is in
progress, new file operations within the mount will fail instead of being
delayed. That is unlikely to be a problem though, because if the admin
requests unmount of a file system then s(he) has made a decision to deny
access to the resource.


# 1.95 30-Apr-2008 ad

PR kern/38135 vfs_busy/vfs_trybusy confusion

The previous fix worked, but it opened a window where mounts could have
disappeared from mountlist while the caller was traversing it using
vfs_trybusy(). Fix that.


# 1.94 29-Apr-2008 ad

kern/38135 vfs_busy/vfs_trybusy confusion

The symptom was that sometimes file systems would occasionally not appear
in output from 'df' or 'mount' if the system was busy. Resolution:

- Make mount locks work somewhat like vm_map locks.
- vfs_trybusy() now only fails if the mount is gone, or if someone is
unmounting the file system. Simple contention on mnt_lock doesn't
cause it to fail.
- vfs_busy() will wait even if the file system is being unmounted.


# 1.93 29-Apr-2008 ad

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.


Revision tags: yamt-nfs-mp-base
# 1.92 24-Apr-2008 ad

branches: 1.92.2;
Merge proc::p_mutex and proc::p_smutex into a single adaptive mutex, since
we no longer need to guard against access from hardware interrupt handlers.

Additionally, if cloning a process with CLONE_SIGHAND, arrange to have the
child process share the parent's lock so that signal state may be kept in
sync. Partially addresses PR kern/37437.


Revision tags: yamt-pf42-baseX yamt-pf42-base ad-socklock-base1
# 1.91 26-Mar-2008 ad

branches: 1.91.2;
Changes for PR kern/38291 (panic unmounting MFS /tmp):

- Reference count the mfsnode to fix an aincent bug. Only destroy when
reference count drops to zero. In mfs_start(), busy the mount and get
a reference to the mfsnode to prevent it disappearing while the server
is running. If the file system is gone already, vfs_busy() will fail.
- Always destroy the bufq.
- Use a global mfs_lock for simplicity.
- Replace use of malloc/free. Fixes broken MALLOC_TYPE change.


Revision tags: yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase nick-net80211-sync-base keiichi-mipv6-base matt-armv6-nbase hpcarm-cleanup-base
# 1.90 21-Feb-2008 ad

branches: 1.90.4;
Make MFS MP-safe. Needed because of the funny tricks it plays.


Revision tags: mjf-devfs-base
# 1.89 30-Jan-2008 ad

branches: 1.89.2;
PR kern/37706 (forced unmount of file systems is unsafe):

- Do reference counting for 'struct mount'. Each vnode associated with a
mount takes a reference, and in turn the mount takes a reference to the
vfsops.
- Now that mounts are reference counted, replace the overcomplicated mount
locking inherited from 4.4BSD with a recursable rwlock.


# 1.88 28-Jan-2008 dholland

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.87 25-Jan-2008 pooka

spec_node_init() mfs device vnode.

fixes PR kern/37867 by Steve Woodford


# 1.86 24-Jan-2008 ad

specfs changes for PR kern/37717 (raidclose() is no longer called on
shutdown). There are still problems with device access and a PR will be
filed.

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

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

- Track opens by vnode and by device. Issue cdev_close() when the last open
goes away, instead of abusing vnode::v_usecount to tell if the device is
open.


Revision tags: bouyer-xeni386-merge1 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 vmlocking-nbase matt-armv6-base jmcneill-pm-base reinoud-bufcleanup-base
# 1.85 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


Revision tags: jmcneill-base bouyer-xenamd64-base2 yamt-x86pmap-base4 bouyer-xenamd64-base yamt-x86pmap-base3 vmlocking-base
# 1.84 10-Oct-2007 ad

branches: 1.84.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.


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base2 yamt-x86pmap-base matt-mips64-base
# 1.83 31-Jul-2007 pooka

branches: 1.83.2; 1.83.4; 1.83.6; 1.83.8;
* 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.82 26-Jul-2007 pooka

Use eopnotsupp() instead of vfs_stdsuspendctl() and retire the latter.


Revision tags: nick-csl-alignment-base
# 1.81 17-Jul-2007 pooka

branches: 1.81.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.80 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.


Revision tags: mjf-ufs-trans-base
# 1.79 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.


Revision tags: yamt-idlelwp-base8 thorpej-atomic-base
# 1.78 04-Mar-2007 christos

branches: 1.78.2; 1.78.4;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.


Revision tags: ad-audiomp-base post-newlock2-merge
# 1.77 09-Feb-2007 ad

branches: 1.77.2;
Merge newlock2 to head.


Revision tags: newlock2-nbase newlock2-base
# 1.76 19-Jan-2007 hannken

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).


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 netbsd-4-base
# 1.75 16-Nov-2006 christos

__unused removal on arguments; approved by core.


Revision tags: yamt-splraiseipl-base2
# 1.74 12-Oct-2006 christos

- sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386


Revision tags: yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 rpaulo-netinet-merge-pcb-base
# 1.73 02-Sep-2006 christos

branches: 1.73.2; 1.73.4;
add missing initializers


Revision tags: abandoned-netbsd-4-base yamt-pdpolicy-base7 yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base yamt-pdpolicy-base5 chap-midi-base elad-kernelauth-base simonb-timecounters-base
# 1.72 15-Apr-2006 christos

From my posting of April 3 to tech-kern:

My understanding is that the CLRSIG() is supposed to clear the signal
that was sent to the syncer process to prevent it from being delivered
to the syncer process in case unmounting fails, so that the syncer process
does not die while the filesystem is still mounted. The typical scenario
is, the syncher process is tsleep()ing in the kernel, and waking up when
it needs to do work. If someone sends a signal to it, eg. kill -TERM
the mfs process, then the kernel will try to unmount the mfs filesystem
before delivering the signal to the process. If that unmount fails, then
we should not really kill the process because that will hang the mount.
So we call CLRSIG() to stop the signal from being delivered.

So the first call to issignal() will return the signal number that was
sent to the syncer process (unless someone malicious was able to send
a lower numbered signal between the time tsleep() returned and we called
issignal()... something that is not really easy to do). But you are
right, we should not be calling it many times as a side effect of this
macro.

Rewrite CLRSIG() clear all the signals and call issignal() the correct
number of times.


Revision tags: yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.71 11-Dec-2005 christos

branches: 1.71.4; 1.71.6; 1.71.8; 1.71.10; 1.71.12;
merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.70 15-Oct-2005 yamt

- change the way to specify a bufq strategy. (by string rather than by number)
- rather than embedding bufq_state in driver softc,
have a pointer to the former.
- move bufq related functions from kern/subr_disk.c to kern/subr_bufq.c.
- rename method to strategy for consistency.
- move some definitions which don't need to be exposed to the rest of kernel
from sys/bufq.h to sys/bufq_impl.h.
(is it better to move it to kern/ or somewhere?)
- fix some obvious breakage in dev/qbus/ts.c. (not tested)


# 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()
* Use ANSI function declarations on ext2fs and mfs


# 1.67 29-May-2005 christos

branches: 1.67.2;
- sprinkle const
- avoid shadow variables.


Revision tags: kent-audio2-base
# 1.66 29-Mar-2005 thorpej

- 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[].


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 yamt-km-base4 yamt-km-base3 netbsd-3-base
# 1.65 26-Feb-2005 perry

nuke trailing whitespace


Revision tags: yamt-km-base2 yamt-km-base kent-audio1-beforemerge
# 1.64 09-Jan-2005 mycroft

branches: 1.64.2; 1.64.4;
Rework the mountroot interface so that vfs_mountroot() opens the root device
and just passes it on to the file system functions. This avoids opening and
closing the device several times.

Mentioned on tech-kern some time ago, IIRC. I've been running this for a
long time.


# 1.63 02-Jan-2005 thorpej

Add the system call and VFS infrastructure for file system extended
attributes.

From FreeBSD.


Revision tags: kent-audio1-base
# 1.62 28-Oct-2004 yamt

move buffer queue related stuffs from buf.h to their own header, bufq.h.


# 1.61 05-Jul-2004 pk

Call inittodr() from main(). Let file system code set the recorded `last
update' time (if any) through the new function setrootfstime().


# 1.60 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.59 25-May-2004 atatat

Sysctl descriptions under vfs subtree


# 1.58 21-Apr-2004 christos

similar fix to enami's in the fstypename field. Not really needed, but better
safe than sorry.


# 1.57 21-Apr-2004 enami

Don't copy past the end of destination array boundary; the size of source
array changed due to recent statvfs change.


# 1.56 21-Apr-2004 christos

Replace the statfs() family of system calls with statvfs().
Retain binary compatibility.


Revision tags: netbsd-2-0-base
# 1.55 24-Mar-2004 atatat

branches: 1.55.2;
Tango on sysctl_createv() and flags. The flags have all been renamed,
and sysctl_createv() now uses more arguments.


# 1.54 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.53 14-Oct-2003 dbj

add mnt_iflag field to struct mount for internal flags
mv MNT_GONE, MNT_UNMOUNT and MNT_WANTRDWR to this field
additonally add mnt_writeopcountupper and mnt_writeopcountlower fields
in preparation for pending write suspension support work
bump kernel version to 1.6ZD


# 1.52 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.51 29-Jun-2003 fvdl

branches: 1.51.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.


# 1.50 28-Jun-2003 bouyer

Adapt for struct proc* -> struct lwp* changes.


# 1.49 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.48 22-Apr-2003 christos

fix lkm malloc lossage.


# 1.47 22-Apr-2003 christos

choose the smaller size of the two strings when memcpy'ing them. A better
fix would be to strncpy and null terminate? From enami.


# 1.46 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.45 02-Apr-2003 fvdl

Add support for UFS2. UFS2 is an enhanced FFS, adding support for
64 bit block pointers, extended attribute storage, and a few
other things.

This commit does not yet include the code to manipulate the extended
storage (for e.g. ACLs), this will be done later.

Originally written by Kirk McKusick and Network Associates Laboratories for
FreeBSD.


# 1.44 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.43 18-Jan-2003 thorpej

Merge the nathanw_sa branch.


Revision tags: nathanw_sa_before_merge fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base nathanw_sa_base
# 1.42 24-Oct-2002 chs

the work-around in rev. 1.37 (turn off async) wasn't enough to prevent
hangs under heavy load. so we now apply the more extreme version:
make MFS mounts "sync". fixes PRs 17128 and 17321.


Revision tags: kqueue-aftermerge kqueue-beforemerge kqueue-base
# 1.41 21-Sep-2002 christos

MNT_GETARGS support


Revision tags: gehenna-devsw-base
# 1.40 21-Jul-2002 hannken

Rename bufq_init() to bufq_alloc().
Add bufq_free() to remove a buffer queue.
Avoid MALLOC while holding a spinlock.

From Chuck Silvers.


# 1.39 19-Jul-2002 hannken

Convert to new device buffer queue interface.


Revision tags: netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base eeh-devprop-base newlock-base
# 1.38 04-Mar-2002 simonb

branches: 1.38.2; 1.38.6; 1.38.8;
Don't use local extern declarations for the mountroot variable or
declare local prototypes for nfs_mountroot() or md_root_setconf().


Revision tags: ifpoll-base
# 1.37 03-Feb-2002 chs

fix PR 15299 by making MFS filesystems not be "async".
in the longer term, MFS needs to be made a lot more VM-friendly.


Revision tags: thorpej-mips-cache-base
# 1.36 08-Nov-2001 lukem

add RCSID


Revision tags: thorpej-devvp-base3 thorpej-devvp-base2 post-chs-ubcperf pre-chs-ubcperf
# 1.35 15-Sep-2001 chs

branches: 1.35.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.


Revision tags: thorpej-devvp-base perseant-lfsv2-base
# 1.34 30-May-2001 mrg

branches: 1.34.4; 1.34.6;
use _KERNEL_OPT


Revision tags: thorpej_scsipi_beforemerge thorpej_scsipi_nbase thorpej_scsipi_base
# 1.33 16-Apr-2001 thorpej

When unmounting a file system, acquire the syncer_lock before
vfs_busy'ing just before the dounmount() call. This is to avoid
sleeping with the mountlist_slock held -- but we must acquire
syncer_lock before vfs_busy because the syncer itself uses
syncer_lock -> vfs_busy locking order.


# 1.32 24-Feb-2001 cgd

branches: 1.32.2;
fix bug (pointed out as sequence point violation warning with current-ish gcc)
caused by use of makedev(major,minor++). makedev() now (since 32-bit
dev_t conversion) evaluates its second argument twice.


# 1.31 22-Jan-2001 jdolecek

make filesystem vnodeop, specop, fifoop and vnodeopv_* arrays const


# 1.30 13-Oct-2000 simonb

Position comment correctly wrt last commit.


# 1.29 13-Oct-2000 simonb

In mfs_start(), move the handling of outstanding I/O requests to before
the check for unmounting the filesystem.

Appears to fix kern/10122 from Hitoshi Matsunawa.


Revision tags: netbsd-1-5-ALPHA2 netbsd-1-5-base minoura-xpg4dl-base
# 1.28 19-May-2000 thorpej

branches: 1.28.4;
Back out previous change; there is something Seriously Wrong.


# 1.27 16-May-2000 thorpej

Redo the way MFS does I/O to the server's address space. Instead of
queueing up buffers and awakening the MFS server process to do the I/O,
we do the I/O to the server process's address space directly using
facilities provided by UVM.

This makes it possible for buffers attempting to flush out while the
MFS is being unmounted to actually do the I/O, where before it would
fail if the server process wasn't in the MFS idle loop (i.e. had been
signaled and was attempting to exit).

Should fix kern/10122 (I can no longer reproduce the problem described
in the PR when running with these changes), and any number of other
MFS-related complaints made by people over time.


# 1.26 16-May-2000 thorpej

Record the proc directly, not the pid, of the MFS server process,
and nuke the spare fields in the mfsnode.


# 1.25 30-Mar-2000 augustss

Remove register declarations.


# 1.24 29-Mar-2000 simonb

Remove redundant decl of rootvp - it's in <sys/systm.h>.


# 1.23 16-Mar-2000 jdolecek

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.

For each leaf filesystem, add appropriate vfs_done routine.

Also remember how many times ffs_init() was called and do
the appropriate initialization on first call only. In ffs_done(),
destroy the resources when called by the last user of ffs code.
Change mfs to call ffs_init()/ffs_done() appropriately.


Revision tags: chs-ubc2-newbase
# 1.22 21-Jan-2000 thorpej

Update for sys/buf.h/disksort_*() changes.


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base comdex-fall-1999-base fvdl-softdep-base chs-ubc2-base
# 1.21 17-Jul-1999 wrstuden

branches: 1.21.2; 1.21.8;
Adjust mountroot routines to vrele rootvp in case of mount error. Closes
PR 7977 by Neil Carson, <neil@brini.com>.


# 1.20 04-Apr-1999 mycroft

It was silly to not make this exportable.


Revision tags: netbsd-1-4-PATCH002 kame_141_19991130 netbsd-1-4-PATCH001 kame_14_19990705 kame_14_19990628 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.19 26-Feb-1999 wrstuden

branches: 1.19.2; 1.19.4;
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.


Revision tags: kenh-if-detach-base chs-ubc-base
# 1.18 09-Aug-1998 perry

bzero->memset, bcopy->memcpy, bcmp->memcmp


Revision tags: eeh-paddr_t-base
# 1.17 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.16 01-Mar-1998 fvdl

Remove accidentally enabled mfs_mountroot from vfsops struct.


# 1.15 01-Mar-1998 fvdl

Merge with Lite2 + local changes


# 1.14 18-Feb-1998 thorpej

Place a pointer to an array of our vnodeopv_desc *'s in our vfsops
structure, for use by vfs_attach().


Revision tags: netbsd-1-3-PATCH003 netbsd-1-3-PATCH003-CANDIDATE2 netbsd-1-3-PATCH003-CANDIDATE1 netbsd-1-3-PATCH003-CANDIDATE0 netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base thorpej-signal-base marc-pcmcia-bp marc-pcmcia-base
# 1.13 12-Jun-1997 mrg

remove swap configuration.


Revision tags: is-newarp-before-merge
# 1.12 22-Feb-1997 fvdl

Implement similar fix as in the NQNFS fix from BSDI, to avoid race conditions
when unmounting. It cleans up the loop a bit too.


Revision tags: is-newarp-base
# 1.11 22-Dec-1996 cgd

branches: 1.11.6;
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...


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.10 09-Feb-1996 christos

mfs prototypes


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.9 01-Sep-1995 mycroft

Do any pending I/O before trying to unmount, per John Kohl.


# 1.8 18-Jun-1995 cgd

don't assume the f_fsnamelen is nul-truncated or longer than MFSNAMELEN


# 1.7 09-Mar-1995 mycroft

copy*str() should use size_t.


# 1.6 08-Mar-1995 cgd

size for copyinstr should be u_long


# 1.5 18-Jan-1995 mycroft

Clean up the code to frob mnt_stat a bit.


# 1.4 18-Jan-1995 mycroft

Turn mountlist into a CIRCLEQ, and handle setting and checking of MNT_ROOTFS
differently.


# 1.3 15-Dec-1994 mycroft

Call foo_statfs() from a common place when mounting.


Revision tags: netbsd-1-0-PATCH06 netbsd-1-0-PATCH05 netbsd-1-0-PATCH04 netbsd-1-0-PATCH03 netbsd-1-0-PATCH02 netbsd-1-0-PATCH1 netbsd-1-0-PATCH0 netbsd-1-0-RELEASE netbsd-1-0-base
# 1.2 29-Jun-1994 cgd

New RCS ID's, take two. they're more aesthecially pleasant, and use 'NetBSD'


# 1.1 08-Jun-1994 mycroft

branches: 1.1.1;
Update to 4.4-Lite fs code, with local changes.


# 1.114 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.


Revision tags: ad-namecache-base3 netbsd-9-0-RELEASE netbsd-9-0-RC2 ad-namecache-base2 ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 netbsd-8-1-RELEASE netbsd-8-1-RC1 isaki-audio2-base pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1
# 1.113 17-Apr-2017 hannken

Remove unused argument "nextp" from vfs_busy() and vfs_unbusy().
Remove argument "keepref" from vfs_unbusy() and add vfs_ref() where needed.


# 1.112 17-Apr-2017 hannken

Add vfs_ref(mp) and vfs_rele(mp) to add or remove a reference to
struct mount. Rename vfs_destroy(mp) to vfs_rele(mp) and replace
incrementing mp->mnt_refcnt with vfs_ref(mp).


Revision tags: jdolecek-ncq-base pgoyette-localcount-20170320
# 1.111 17-Feb-2017 hannken

Add generic genfs_suspendctl() and use it for all file systems.
Layered file systems need work.


Revision tags: nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606 nick-nhusb-base-20150406
# 1.110 17-Mar-2015 hannken

branches: 1.110.2; 1.110.4;
Change ffs to use vcache_new:
- Change ffs_valloc to return an inode number.
- Remove now obsolete UFS operations UFS_VALLOC and UFS_VFREE.
- Make ufs_makeinode private to ufs_vnops.c and pass vattr instead of mode.


# 1.109 14-Jan-2015 hannken

Change mfs to use an anonymous vnode obtained with bdevvp()
for the specdev it mounts on.


Revision tags: netbsd-7-2-RELEASE netbsd-7-1-2-RELEASE netbsd-7-1-1-RELEASE netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 netbsd-7-0-2-RELEASE netbsd-7-nhusb-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.108 08-May-2014 hannken

branches: 1.108.4;
Add a global vnode cache:

- vcache_get() retrieves a referenced and initialised vnode / fs node pair.
- vcache_remove() removes a vnode / fs node pair from the cache.

On cache miss vcache_get() calls new vfs operation vfs_loadvnode() to
initialise a vnode / fs node pair. This call is guaranteed exclusive,
no other thread will try to load this vnode / fs node pair.

Convert ufs/ext2fs, ufs/ffs and ufs/mfs to use this interface.

Remove now unused ufs/ufs_ihash

Discussed on tech-kern.

Welcome to 6.99.41


# 1.107 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@


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15
# 1.106 23-Mar-2014 hannken

branches: 1.106.2;
Change all vfsops to use C99 designated initializers.

No functional changes intended.


Revision tags: riastradh-drm2-base3
# 1.105 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.104 23-Nov-2013 christos

change the mountlist CIRCLEQ into a TAILQ


Revision tags: yamt-pagecache-tag8 netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 agc-symver-base netbsd-6-1-RC2 netbsd-6-1-RC1 yamt-pagecache-base8 netbsd-6-0-1-RELEASE yamt-pagecache-base7 matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.103 12-Jun-2011 rmind

branches: 1.103.2; 1.103.8; 1.103.12; 1.103.14; 1.103.16; 1.103.22;
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.


Revision tags: rmind-uvmplock-nbase cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10 uebayasi-xip-base1 rmind-uvmplock-base yamt-nfs-mp-base9
# 1.102 02-Mar-2010 pooka

branches: 1.102.2; 1.102.8;
Make mfs_initminiroot() mandatory. Allows to remove #ifdef MFS.


Revision tags: uebayasi-xip-base matt-premerge-20091211 yamt-nfs-mp-base8 yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 jym-xensuspend-nbase yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base2 jym-xensuspend-base nick-hppapmap-base mjf-devfs2-base
# 1.101 13-Jan-2009 yamt

branches: 1.101.4;
g/c BUFQ_FOO() macros and use bufq_foo() directly.


# 1.100 19-Dec-2008 pgoyette

Store config(1)'s root filesystem type as a text string rather than
embedding the address of its xxx_mountroot() in swapnetbsd.c. This
permits booting of kernels with hard-wired filesystem type even if the
filesystem is in a loadable module (ie, not linked into the kernel
image).

Discussed on current-users. Tested on amd64 and i386 with both hard-
wired and '?' filesystem times, and on both modular and monolithic
kernels.

Thanks to pooka@ for code review and suggestions.

Addresses my PR kern/40167


Revision tags: haad-dm-base2 haad-nbase2 ad-audiomp2-base haad-dm-base
# 1.99 13-Nov-2008 ad

These depend on ffs.


Revision tags: netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 simonb-wapbl-nbase simonb-wapbl-base
# 1.98 28-Jun-2008 rumble

branches: 1.98.2; 1.98.4; 1.98.6; 1.98.12; 1.98.16;
Create sysctl entries during module initialisation and destroy them
appropriately.

Many of these file systems are now ready for modularisation.


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base
# 1.97 10-May-2008 rumble

branches: 1.97.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.96 06-May-2008 ad

branches: 1.96.2;
PR kern/38141 lookup/vfs_busy acquire rwlock recursively

Simplify the mount locking. Remove all the crud to deal with recursion on
the mount lock, and crud to deal with unmount as another weirdo lock.

Hopefully this will once and for all fix the deadlocks with this. With this
commit there are two locks on each mount:

- krwlock_t mnt_unmounting. This is used to prevent unmount across critical
sections like getnewvnode(). It's only ever read locked with rw_tryenter(),
and is only ever write locked in dounmount(). A write hold can't be taken
on this lock if the current LWP could hold a vnode lock.

- kmutex_t mnt_updating. This is taken by threads updating the mount, for
example when going r/o -> r/w, and is only present to serialize updates.
In order to take this lock, a read hold must first be taken on
mnt_unmounting, and the two need to be held across the operation.

One effect of this change: previously if an unmount failed, we would make a
half hearted attempt to back out of it gracefully, but that was unlikely to
work in a lot of cases. Now while an unmount that will be aborted is in
progress, new file operations within the mount will fail instead of being
delayed. That is unlikely to be a problem though, because if the admin
requests unmount of a file system then s(he) has made a decision to deny
access to the resource.


# 1.95 30-Apr-2008 ad

PR kern/38135 vfs_busy/vfs_trybusy confusion

The previous fix worked, but it opened a window where mounts could have
disappeared from mountlist while the caller was traversing it using
vfs_trybusy(). Fix that.


# 1.94 29-Apr-2008 ad

kern/38135 vfs_busy/vfs_trybusy confusion

The symptom was that sometimes file systems would occasionally not appear
in output from 'df' or 'mount' if the system was busy. Resolution:

- Make mount locks work somewhat like vm_map locks.
- vfs_trybusy() now only fails if the mount is gone, or if someone is
unmounting the file system. Simple contention on mnt_lock doesn't
cause it to fail.
- vfs_busy() will wait even if the file system is being unmounted.


# 1.93 29-Apr-2008 ad

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.


Revision tags: yamt-nfs-mp-base
# 1.92 24-Apr-2008 ad

branches: 1.92.2;
Merge proc::p_mutex and proc::p_smutex into a single adaptive mutex, since
we no longer need to guard against access from hardware interrupt handlers.

Additionally, if cloning a process with CLONE_SIGHAND, arrange to have the
child process share the parent's lock so that signal state may be kept in
sync. Partially addresses PR kern/37437.


Revision tags: yamt-pf42-baseX yamt-pf42-base ad-socklock-base1
# 1.91 26-Mar-2008 ad

branches: 1.91.2;
Changes for PR kern/38291 (panic unmounting MFS /tmp):

- Reference count the mfsnode to fix an aincent bug. Only destroy when
reference count drops to zero. In mfs_start(), busy the mount and get
a reference to the mfsnode to prevent it disappearing while the server
is running. If the file system is gone already, vfs_busy() will fail.
- Always destroy the bufq.
- Use a global mfs_lock for simplicity.
- Replace use of malloc/free. Fixes broken MALLOC_TYPE change.


Revision tags: yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase nick-net80211-sync-base keiichi-mipv6-base matt-armv6-nbase hpcarm-cleanup-base
# 1.90 21-Feb-2008 ad

branches: 1.90.4;
Make MFS MP-safe. Needed because of the funny tricks it plays.


Revision tags: mjf-devfs-base
# 1.89 30-Jan-2008 ad

branches: 1.89.2;
PR kern/37706 (forced unmount of file systems is unsafe):

- Do reference counting for 'struct mount'. Each vnode associated with a
mount takes a reference, and in turn the mount takes a reference to the
vfsops.
- Now that mounts are reference counted, replace the overcomplicated mount
locking inherited from 4.4BSD with a recursable rwlock.


# 1.88 28-Jan-2008 dholland

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.87 25-Jan-2008 pooka

spec_node_init() mfs device vnode.

fixes PR kern/37867 by Steve Woodford


# 1.86 24-Jan-2008 ad

specfs changes for PR kern/37717 (raidclose() is no longer called on
shutdown). There are still problems with device access and a PR will be
filed.

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

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

- Track opens by vnode and by device. Issue cdev_close() when the last open
goes away, instead of abusing vnode::v_usecount to tell if the device is
open.


Revision tags: bouyer-xeni386-merge1 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 vmlocking-nbase matt-armv6-base jmcneill-pm-base reinoud-bufcleanup-base
# 1.85 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


Revision tags: jmcneill-base bouyer-xenamd64-base2 yamt-x86pmap-base4 bouyer-xenamd64-base yamt-x86pmap-base3 vmlocking-base
# 1.84 10-Oct-2007 ad

branches: 1.84.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.


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base2 yamt-x86pmap-base matt-mips64-base
# 1.83 31-Jul-2007 pooka

branches: 1.83.2; 1.83.4; 1.83.6; 1.83.8;
* 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.82 26-Jul-2007 pooka

Use eopnotsupp() instead of vfs_stdsuspendctl() and retire the latter.


Revision tags: nick-csl-alignment-base
# 1.81 17-Jul-2007 pooka

branches: 1.81.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.80 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.


Revision tags: mjf-ufs-trans-base
# 1.79 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.


Revision tags: yamt-idlelwp-base8 thorpej-atomic-base
# 1.78 04-Mar-2007 christos

branches: 1.78.2; 1.78.4;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.


Revision tags: ad-audiomp-base post-newlock2-merge
# 1.77 09-Feb-2007 ad

branches: 1.77.2;
Merge newlock2 to head.


Revision tags: newlock2-nbase newlock2-base
# 1.76 19-Jan-2007 hannken

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).


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 netbsd-4-base
# 1.75 16-Nov-2006 christos

__unused removal on arguments; approved by core.


Revision tags: yamt-splraiseipl-base2
# 1.74 12-Oct-2006 christos

- sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386


Revision tags: yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 rpaulo-netinet-merge-pcb-base
# 1.73 02-Sep-2006 christos

branches: 1.73.2; 1.73.4;
add missing initializers


Revision tags: abandoned-netbsd-4-base yamt-pdpolicy-base7 yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base yamt-pdpolicy-base5 chap-midi-base elad-kernelauth-base simonb-timecounters-base
# 1.72 15-Apr-2006 christos

From my posting of April 3 to tech-kern:

My understanding is that the CLRSIG() is supposed to clear the signal
that was sent to the syncer process to prevent it from being delivered
to the syncer process in case unmounting fails, so that the syncer process
does not die while the filesystem is still mounted. The typical scenario
is, the syncher process is tsleep()ing in the kernel, and waking up when
it needs to do work. If someone sends a signal to it, eg. kill -TERM
the mfs process, then the kernel will try to unmount the mfs filesystem
before delivering the signal to the process. If that unmount fails, then
we should not really kill the process because that will hang the mount.
So we call CLRSIG() to stop the signal from being delivered.

So the first call to issignal() will return the signal number that was
sent to the syncer process (unless someone malicious was able to send
a lower numbered signal between the time tsleep() returned and we called
issignal()... something that is not really easy to do). But you are
right, we should not be calling it many times as a side effect of this
macro.

Rewrite CLRSIG() clear all the signals and call issignal() the correct
number of times.


Revision tags: yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.71 11-Dec-2005 christos

branches: 1.71.4; 1.71.6; 1.71.8; 1.71.10; 1.71.12;
merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.70 15-Oct-2005 yamt

- change the way to specify a bufq strategy. (by string rather than by number)
- rather than embedding bufq_state in driver softc,
have a pointer to the former.
- move bufq related functions from kern/subr_disk.c to kern/subr_bufq.c.
- rename method to strategy for consistency.
- move some definitions which don't need to be exposed to the rest of kernel
from sys/bufq.h to sys/bufq_impl.h.
(is it better to move it to kern/ or somewhere?)
- fix some obvious breakage in dev/qbus/ts.c. (not tested)


# 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()
* Use ANSI function declarations on ext2fs and mfs


# 1.67 29-May-2005 christos

branches: 1.67.2;
- sprinkle const
- avoid shadow variables.


Revision tags: kent-audio2-base
# 1.66 29-Mar-2005 thorpej

- 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[].


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 yamt-km-base4 yamt-km-base3 netbsd-3-base
# 1.65 26-Feb-2005 perry

nuke trailing whitespace


Revision tags: yamt-km-base2 yamt-km-base kent-audio1-beforemerge
# 1.64 09-Jan-2005 mycroft

branches: 1.64.2; 1.64.4;
Rework the mountroot interface so that vfs_mountroot() opens the root device
and just passes it on to the file system functions. This avoids opening and
closing the device several times.

Mentioned on tech-kern some time ago, IIRC. I've been running this for a
long time.


# 1.63 02-Jan-2005 thorpej

Add the system call and VFS infrastructure for file system extended
attributes.

From FreeBSD.


Revision tags: kent-audio1-base
# 1.62 28-Oct-2004 yamt

move buffer queue related stuffs from buf.h to their own header, bufq.h.


# 1.61 05-Jul-2004 pk

Call inittodr() from main(). Let file system code set the recorded `last
update' time (if any) through the new function setrootfstime().


# 1.60 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.59 25-May-2004 atatat

Sysctl descriptions under vfs subtree


# 1.58 21-Apr-2004 christos

similar fix to enami's in the fstypename field. Not really needed, but better
safe than sorry.


# 1.57 21-Apr-2004 enami

Don't copy past the end of destination array boundary; the size of source
array changed due to recent statvfs change.


# 1.56 21-Apr-2004 christos

Replace the statfs() family of system calls with statvfs().
Retain binary compatibility.


Revision tags: netbsd-2-0-base
# 1.55 24-Mar-2004 atatat

branches: 1.55.2;
Tango on sysctl_createv() and flags. The flags have all been renamed,
and sysctl_createv() now uses more arguments.


# 1.54 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.53 14-Oct-2003 dbj

add mnt_iflag field to struct mount for internal flags
mv MNT_GONE, MNT_UNMOUNT and MNT_WANTRDWR to this field
additonally add mnt_writeopcountupper and mnt_writeopcountlower fields
in preparation for pending write suspension support work
bump kernel version to 1.6ZD


# 1.52 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.51 29-Jun-2003 fvdl

branches: 1.51.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.


# 1.50 28-Jun-2003 bouyer

Adapt for struct proc* -> struct lwp* changes.


# 1.49 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.48 22-Apr-2003 christos

fix lkm malloc lossage.


# 1.47 22-Apr-2003 christos

choose the smaller size of the two strings when memcpy'ing them. A better
fix would be to strncpy and null terminate? From enami.


# 1.46 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.45 02-Apr-2003 fvdl

Add support for UFS2. UFS2 is an enhanced FFS, adding support for
64 bit block pointers, extended attribute storage, and a few
other things.

This commit does not yet include the code to manipulate the extended
storage (for e.g. ACLs), this will be done later.

Originally written by Kirk McKusick and Network Associates Laboratories for
FreeBSD.


# 1.44 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.43 18-Jan-2003 thorpej

Merge the nathanw_sa branch.


Revision tags: nathanw_sa_before_merge fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base nathanw_sa_base
# 1.42 24-Oct-2002 chs

the work-around in rev. 1.37 (turn off async) wasn't enough to prevent
hangs under heavy load. so we now apply the more extreme version:
make MFS mounts "sync". fixes PRs 17128 and 17321.


Revision tags: kqueue-aftermerge kqueue-beforemerge kqueue-base
# 1.41 21-Sep-2002 christos

MNT_GETARGS support


Revision tags: gehenna-devsw-base
# 1.40 21-Jul-2002 hannken

Rename bufq_init() to bufq_alloc().
Add bufq_free() to remove a buffer queue.
Avoid MALLOC while holding a spinlock.

From Chuck Silvers.


# 1.39 19-Jul-2002 hannken

Convert to new device buffer queue interface.


Revision tags: netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base eeh-devprop-base newlock-base
# 1.38 04-Mar-2002 simonb

branches: 1.38.2; 1.38.6; 1.38.8;
Don't use local extern declarations for the mountroot variable or
declare local prototypes for nfs_mountroot() or md_root_setconf().


Revision tags: ifpoll-base
# 1.37 03-Feb-2002 chs

fix PR 15299 by making MFS filesystems not be "async".
in the longer term, MFS needs to be made a lot more VM-friendly.


Revision tags: thorpej-mips-cache-base
# 1.36 08-Nov-2001 lukem

add RCSID


Revision tags: thorpej-devvp-base3 thorpej-devvp-base2 post-chs-ubcperf pre-chs-ubcperf
# 1.35 15-Sep-2001 chs

branches: 1.35.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.


Revision tags: thorpej-devvp-base perseant-lfsv2-base
# 1.34 30-May-2001 mrg

branches: 1.34.4; 1.34.6;
use _KERNEL_OPT


Revision tags: thorpej_scsipi_beforemerge thorpej_scsipi_nbase thorpej_scsipi_base
# 1.33 16-Apr-2001 thorpej

When unmounting a file system, acquire the syncer_lock before
vfs_busy'ing just before the dounmount() call. This is to avoid
sleeping with the mountlist_slock held -- but we must acquire
syncer_lock before vfs_busy because the syncer itself uses
syncer_lock -> vfs_busy locking order.


# 1.32 24-Feb-2001 cgd

branches: 1.32.2;
fix bug (pointed out as sequence point violation warning with current-ish gcc)
caused by use of makedev(major,minor++). makedev() now (since 32-bit
dev_t conversion) evaluates its second argument twice.


# 1.31 22-Jan-2001 jdolecek

make filesystem vnodeop, specop, fifoop and vnodeopv_* arrays const


# 1.30 13-Oct-2000 simonb

Position comment correctly wrt last commit.


# 1.29 13-Oct-2000 simonb

In mfs_start(), move the handling of outstanding I/O requests to before
the check for unmounting the filesystem.

Appears to fix kern/10122 from Hitoshi Matsunawa.


Revision tags: netbsd-1-5-ALPHA2 netbsd-1-5-base minoura-xpg4dl-base
# 1.28 19-May-2000 thorpej

branches: 1.28.4;
Back out previous change; there is something Seriously Wrong.


# 1.27 16-May-2000 thorpej

Redo the way MFS does I/O to the server's address space. Instead of
queueing up buffers and awakening the MFS server process to do the I/O,
we do the I/O to the server process's address space directly using
facilities provided by UVM.

This makes it possible for buffers attempting to flush out while the
MFS is being unmounted to actually do the I/O, where before it would
fail if the server process wasn't in the MFS idle loop (i.e. had been
signaled and was attempting to exit).

Should fix kern/10122 (I can no longer reproduce the problem described
in the PR when running with these changes), and any number of other
MFS-related complaints made by people over time.


# 1.26 16-May-2000 thorpej

Record the proc directly, not the pid, of the MFS server process,
and nuke the spare fields in the mfsnode.


# 1.25 30-Mar-2000 augustss

Remove register declarations.


# 1.24 29-Mar-2000 simonb

Remove redundant decl of rootvp - it's in <sys/systm.h>.


# 1.23 16-Mar-2000 jdolecek

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.

For each leaf filesystem, add appropriate vfs_done routine.

Also remember how many times ffs_init() was called and do
the appropriate initialization on first call only. In ffs_done(),
destroy the resources when called by the last user of ffs code.
Change mfs to call ffs_init()/ffs_done() appropriately.


Revision tags: chs-ubc2-newbase
# 1.22 21-Jan-2000 thorpej

Update for sys/buf.h/disksort_*() changes.


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base comdex-fall-1999-base fvdl-softdep-base chs-ubc2-base
# 1.21 17-Jul-1999 wrstuden

branches: 1.21.2; 1.21.8;
Adjust mountroot routines to vrele rootvp in case of mount error. Closes
PR 7977 by Neil Carson, <neil@brini.com>.


# 1.20 04-Apr-1999 mycroft

It was silly to not make this exportable.


Revision tags: netbsd-1-4-PATCH002 kame_141_19991130 netbsd-1-4-PATCH001 kame_14_19990705 kame_14_19990628 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.19 26-Feb-1999 wrstuden

branches: 1.19.2; 1.19.4;
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.


Revision tags: kenh-if-detach-base chs-ubc-base
# 1.18 09-Aug-1998 perry

bzero->memset, bcopy->memcpy, bcmp->memcmp


Revision tags: eeh-paddr_t-base
# 1.17 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.16 01-Mar-1998 fvdl

Remove accidentally enabled mfs_mountroot from vfsops struct.


# 1.15 01-Mar-1998 fvdl

Merge with Lite2 + local changes


# 1.14 18-Feb-1998 thorpej

Place a pointer to an array of our vnodeopv_desc *'s in our vfsops
structure, for use by vfs_attach().


Revision tags: netbsd-1-3-PATCH003 netbsd-1-3-PATCH003-CANDIDATE2 netbsd-1-3-PATCH003-CANDIDATE1 netbsd-1-3-PATCH003-CANDIDATE0 netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base thorpej-signal-base marc-pcmcia-bp marc-pcmcia-base
# 1.13 12-Jun-1997 mrg

remove swap configuration.


Revision tags: is-newarp-before-merge
# 1.12 22-Feb-1997 fvdl

Implement similar fix as in the NQNFS fix from BSDI, to avoid race conditions
when unmounting. It cleans up the loop a bit too.


Revision tags: is-newarp-base
# 1.11 22-Dec-1996 cgd

branches: 1.11.6;
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...


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.10 09-Feb-1996 christos

mfs prototypes


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.9 01-Sep-1995 mycroft

Do any pending I/O before trying to unmount, per John Kohl.


# 1.8 18-Jun-1995 cgd

don't assume the f_fsnamelen is nul-truncated or longer than MFSNAMELEN


# 1.7 09-Mar-1995 mycroft

copy*str() should use size_t.


# 1.6 08-Mar-1995 cgd

size for copyinstr should be u_long


# 1.5 18-Jan-1995 mycroft

Clean up the code to frob mnt_stat a bit.


# 1.4 18-Jan-1995 mycroft

Turn mountlist into a CIRCLEQ, and handle setting and checking of MNT_ROOTFS
differently.


# 1.3 15-Dec-1994 mycroft

Call foo_statfs() from a common place when mounting.


Revision tags: netbsd-1-0-PATCH06 netbsd-1-0-PATCH05 netbsd-1-0-PATCH04 netbsd-1-0-PATCH03 netbsd-1-0-PATCH02 netbsd-1-0-PATCH1 netbsd-1-0-PATCH0 netbsd-1-0-RELEASE netbsd-1-0-base
# 1.2 29-Jun-1994 cgd

New RCS ID's, take two. they're more aesthecially pleasant, and use 'NetBSD'


# 1.1 08-Jun-1994 mycroft

branches: 1.1.1;
Update to 4.4-Lite fs code, with local changes.


Revision tags: prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1
# 1.113 17-Apr-2017 hannken

Remove unused argument "nextp" from vfs_busy() and vfs_unbusy().
Remove argument "keepref" from vfs_unbusy() and add vfs_ref() where needed.


# 1.112 17-Apr-2017 hannken

Add vfs_ref(mp) and vfs_rele(mp) to add or remove a reference to
struct mount. Rename vfs_destroy(mp) to vfs_rele(mp) and replace
incrementing mp->mnt_refcnt with vfs_ref(mp).


Revision tags: jdolecek-ncq-base pgoyette-localcount-20170320
# 1.111 17-Feb-2017 hannken

Add generic genfs_suspendctl() and use it for all file systems.
Layered file systems need work.


Revision tags: nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606 nick-nhusb-base-20150406
# 1.110 17-Mar-2015 hannken

branches: 1.110.2; 1.110.4;
Change ffs to use vcache_new:
- Change ffs_valloc to return an inode number.
- Remove now obsolete UFS operations UFS_VALLOC and UFS_VFREE.
- Make ufs_makeinode private to ufs_vnops.c and pass vattr instead of mode.


# 1.109 14-Jan-2015 hannken

Change mfs to use an anonymous vnode obtained with bdevvp()
for the specdev it mounts on.


Revision tags: netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 netbsd-7-0-2-RELEASE netbsd-7-nhusb-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.108 08-May-2014 hannken

branches: 1.108.4;
Add a global vnode cache:

- vcache_get() retrieves a referenced and initialised vnode / fs node pair.
- vcache_remove() removes a vnode / fs node pair from the cache.

On cache miss vcache_get() calls new vfs operation vfs_loadvnode() to
initialise a vnode / fs node pair. This call is guaranteed exclusive,
no other thread will try to load this vnode / fs node pair.

Convert ufs/ext2fs, ufs/ffs and ufs/mfs to use this interface.

Remove now unused ufs/ufs_ihash

Discussed on tech-kern.

Welcome to 6.99.41


# 1.107 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@


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15
# 1.106 23-Mar-2014 hannken

branches: 1.106.2;
Change all vfsops to use C99 designated initializers.

No functional changes intended.


Revision tags: riastradh-drm2-base3
# 1.105 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.104 23-Nov-2013 christos

change the mountlist CIRCLEQ into a TAILQ


Revision tags: yamt-pagecache-tag8 netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 agc-symver-base netbsd-6-1-RC2 netbsd-6-1-RC1 yamt-pagecache-base8 netbsd-6-0-1-RELEASE yamt-pagecache-base7 matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.103 12-Jun-2011 rmind

branches: 1.103.2; 1.103.8; 1.103.12; 1.103.14; 1.103.16; 1.103.22;
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.


Revision tags: rmind-uvmplock-nbase cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10 uebayasi-xip-base1 rmind-uvmplock-base yamt-nfs-mp-base9
# 1.102 02-Mar-2010 pooka

branches: 1.102.2; 1.102.8;
Make mfs_initminiroot() mandatory. Allows to remove #ifdef MFS.


Revision tags: uebayasi-xip-base matt-premerge-20091211 yamt-nfs-mp-base8 yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 jym-xensuspend-nbase yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base2 jym-xensuspend-base nick-hppapmap-base mjf-devfs2-base
# 1.101 13-Jan-2009 yamt

branches: 1.101.4;
g/c BUFQ_FOO() macros and use bufq_foo() directly.


# 1.100 19-Dec-2008 pgoyette

Store config(1)'s root filesystem type as a text string rather than
embedding the address of its xxx_mountroot() in swapnetbsd.c. This
permits booting of kernels with hard-wired filesystem type even if the
filesystem is in a loadable module (ie, not linked into the kernel
image).

Discussed on current-users. Tested on amd64 and i386 with both hard-
wired and '?' filesystem times, and on both modular and monolithic
kernels.

Thanks to pooka@ for code review and suggestions.

Addresses my PR kern/40167


Revision tags: haad-dm-base2 haad-nbase2 ad-audiomp2-base haad-dm-base
# 1.99 13-Nov-2008 ad

These depend on ffs.


Revision tags: netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 simonb-wapbl-nbase simonb-wapbl-base
# 1.98 28-Jun-2008 rumble

branches: 1.98.2; 1.98.4; 1.98.6; 1.98.12; 1.98.16;
Create sysctl entries during module initialisation and destroy them
appropriately.

Many of these file systems are now ready for modularisation.


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base
# 1.97 10-May-2008 rumble

branches: 1.97.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.96 06-May-2008 ad

branches: 1.96.2;
PR kern/38141 lookup/vfs_busy acquire rwlock recursively

Simplify the mount locking. Remove all the crud to deal with recursion on
the mount lock, and crud to deal with unmount as another weirdo lock.

Hopefully this will once and for all fix the deadlocks with this. With this
commit there are two locks on each mount:

- krwlock_t mnt_unmounting. This is used to prevent unmount across critical
sections like getnewvnode(). It's only ever read locked with rw_tryenter(),
and is only ever write locked in dounmount(). A write hold can't be taken
on this lock if the current LWP could hold a vnode lock.

- kmutex_t mnt_updating. This is taken by threads updating the mount, for
example when going r/o -> r/w, and is only present to serialize updates.
In order to take this lock, a read hold must first be taken on
mnt_unmounting, and the two need to be held across the operation.

One effect of this change: previously if an unmount failed, we would make a
half hearted attempt to back out of it gracefully, but that was unlikely to
work in a lot of cases. Now while an unmount that will be aborted is in
progress, new file operations within the mount will fail instead of being
delayed. That is unlikely to be a problem though, because if the admin
requests unmount of a file system then s(he) has made a decision to deny
access to the resource.


# 1.95 30-Apr-2008 ad

PR kern/38135 vfs_busy/vfs_trybusy confusion

The previous fix worked, but it opened a window where mounts could have
disappeared from mountlist while the caller was traversing it using
vfs_trybusy(). Fix that.


# 1.94 29-Apr-2008 ad

kern/38135 vfs_busy/vfs_trybusy confusion

The symptom was that sometimes file systems would occasionally not appear
in output from 'df' or 'mount' if the system was busy. Resolution:

- Make mount locks work somewhat like vm_map locks.
- vfs_trybusy() now only fails if the mount is gone, or if someone is
unmounting the file system. Simple contention on mnt_lock doesn't
cause it to fail.
- vfs_busy() will wait even if the file system is being unmounted.


# 1.93 29-Apr-2008 ad

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.


Revision tags: yamt-nfs-mp-base
# 1.92 24-Apr-2008 ad

branches: 1.92.2;
Merge proc::p_mutex and proc::p_smutex into a single adaptive mutex, since
we no longer need to guard against access from hardware interrupt handlers.

Additionally, if cloning a process with CLONE_SIGHAND, arrange to have the
child process share the parent's lock so that signal state may be kept in
sync. Partially addresses PR kern/37437.


Revision tags: yamt-pf42-baseX yamt-pf42-base ad-socklock-base1
# 1.91 26-Mar-2008 ad

branches: 1.91.2;
Changes for PR kern/38291 (panic unmounting MFS /tmp):

- Reference count the mfsnode to fix an aincent bug. Only destroy when
reference count drops to zero. In mfs_start(), busy the mount and get
a reference to the mfsnode to prevent it disappearing while the server
is running. If the file system is gone already, vfs_busy() will fail.
- Always destroy the bufq.
- Use a global mfs_lock for simplicity.
- Replace use of malloc/free. Fixes broken MALLOC_TYPE change.


Revision tags: yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase nick-net80211-sync-base keiichi-mipv6-base matt-armv6-nbase hpcarm-cleanup-base
# 1.90 21-Feb-2008 ad

branches: 1.90.4;
Make MFS MP-safe. Needed because of the funny tricks it plays.


Revision tags: mjf-devfs-base
# 1.89 30-Jan-2008 ad

branches: 1.89.2;
PR kern/37706 (forced unmount of file systems is unsafe):

- Do reference counting for 'struct mount'. Each vnode associated with a
mount takes a reference, and in turn the mount takes a reference to the
vfsops.
- Now that mounts are reference counted, replace the overcomplicated mount
locking inherited from 4.4BSD with a recursable rwlock.


# 1.88 28-Jan-2008 dholland

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.87 25-Jan-2008 pooka

spec_node_init() mfs device vnode.

fixes PR kern/37867 by Steve Woodford


# 1.86 24-Jan-2008 ad

specfs changes for PR kern/37717 (raidclose() is no longer called on
shutdown). There are still problems with device access and a PR will be
filed.

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

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

- Track opens by vnode and by device. Issue cdev_close() when the last open
goes away, instead of abusing vnode::v_usecount to tell if the device is
open.


Revision tags: bouyer-xeni386-merge1 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 vmlocking-nbase matt-armv6-base jmcneill-pm-base reinoud-bufcleanup-base
# 1.85 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


Revision tags: jmcneill-base bouyer-xenamd64-base2 yamt-x86pmap-base4 bouyer-xenamd64-base yamt-x86pmap-base3 vmlocking-base
# 1.84 10-Oct-2007 ad

branches: 1.84.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.


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base2 yamt-x86pmap-base matt-mips64-base
# 1.83 31-Jul-2007 pooka

branches: 1.83.2; 1.83.4; 1.83.6; 1.83.8;
* 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.82 26-Jul-2007 pooka

Use eopnotsupp() instead of vfs_stdsuspendctl() and retire the latter.


Revision tags: nick-csl-alignment-base
# 1.81 17-Jul-2007 pooka

branches: 1.81.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.80 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.


Revision tags: mjf-ufs-trans-base
# 1.79 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.


Revision tags: yamt-idlelwp-base8 thorpej-atomic-base
# 1.78 04-Mar-2007 christos

branches: 1.78.2; 1.78.4;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.


Revision tags: ad-audiomp-base post-newlock2-merge
# 1.77 09-Feb-2007 ad

branches: 1.77.2;
Merge newlock2 to head.


Revision tags: newlock2-nbase newlock2-base
# 1.76 19-Jan-2007 hannken

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).


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 netbsd-4-base
# 1.75 16-Nov-2006 christos

__unused removal on arguments; approved by core.


Revision tags: yamt-splraiseipl-base2
# 1.74 12-Oct-2006 christos

- sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386


Revision tags: yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 rpaulo-netinet-merge-pcb-base
# 1.73 02-Sep-2006 christos

branches: 1.73.2; 1.73.4;
add missing initializers


Revision tags: abandoned-netbsd-4-base yamt-pdpolicy-base7 yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base yamt-pdpolicy-base5 chap-midi-base elad-kernelauth-base simonb-timecounters-base
# 1.72 15-Apr-2006 christos

From my posting of April 3 to tech-kern:

My understanding is that the CLRSIG() is supposed to clear the signal
that was sent to the syncer process to prevent it from being delivered
to the syncer process in case unmounting fails, so that the syncer process
does not die while the filesystem is still mounted. The typical scenario
is, the syncher process is tsleep()ing in the kernel, and waking up when
it needs to do work. If someone sends a signal to it, eg. kill -TERM
the mfs process, then the kernel will try to unmount the mfs filesystem
before delivering the signal to the process. If that unmount fails, then
we should not really kill the process because that will hang the mount.
So we call CLRSIG() to stop the signal from being delivered.

So the first call to issignal() will return the signal number that was
sent to the syncer process (unless someone malicious was able to send
a lower numbered signal between the time tsleep() returned and we called
issignal()... something that is not really easy to do). But you are
right, we should not be calling it many times as a side effect of this
macro.

Rewrite CLRSIG() clear all the signals and call issignal() the correct
number of times.


Revision tags: yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.71 11-Dec-2005 christos

branches: 1.71.4; 1.71.6; 1.71.8; 1.71.10; 1.71.12;
merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.70 15-Oct-2005 yamt

- change the way to specify a bufq strategy. (by string rather than by number)
- rather than embedding bufq_state in driver softc,
have a pointer to the former.
- move bufq related functions from kern/subr_disk.c to kern/subr_bufq.c.
- rename method to strategy for consistency.
- move some definitions which don't need to be exposed to the rest of kernel
from sys/bufq.h to sys/bufq_impl.h.
(is it better to move it to kern/ or somewhere?)
- fix some obvious breakage in dev/qbus/ts.c. (not tested)


# 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()
* Use ANSI function declarations on ext2fs and mfs


# 1.67 29-May-2005 christos

branches: 1.67.2;
- sprinkle const
- avoid shadow variables.


Revision tags: kent-audio2-base
# 1.66 29-Mar-2005 thorpej

- 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[].


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 yamt-km-base4 yamt-km-base3 netbsd-3-base
# 1.65 26-Feb-2005 perry

nuke trailing whitespace


Revision tags: yamt-km-base2 yamt-km-base kent-audio1-beforemerge
# 1.64 09-Jan-2005 mycroft

branches: 1.64.2; 1.64.4;
Rework the mountroot interface so that vfs_mountroot() opens the root device
and just passes it on to the file system functions. This avoids opening and
closing the device several times.

Mentioned on tech-kern some time ago, IIRC. I've been running this for a
long time.


# 1.63 02-Jan-2005 thorpej

Add the system call and VFS infrastructure for file system extended
attributes.

From FreeBSD.


Revision tags: kent-audio1-base
# 1.62 28-Oct-2004 yamt

move buffer queue related stuffs from buf.h to their own header, bufq.h.


# 1.61 05-Jul-2004 pk

Call inittodr() from main(). Let file system code set the recorded `last
update' time (if any) through the new function setrootfstime().


# 1.60 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.59 25-May-2004 atatat

Sysctl descriptions under vfs subtree


# 1.58 21-Apr-2004 christos

similar fix to enami's in the fstypename field. Not really needed, but better
safe than sorry.


# 1.57 21-Apr-2004 enami

Don't copy past the end of destination array boundary; the size of source
array changed due to recent statvfs change.


# 1.56 21-Apr-2004 christos

Replace the statfs() family of system calls with statvfs().
Retain binary compatibility.


Revision tags: netbsd-2-0-base
# 1.55 24-Mar-2004 atatat

branches: 1.55.2;
Tango on sysctl_createv() and flags. The flags have all been renamed,
and sysctl_createv() now uses more arguments.


# 1.54 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.53 14-Oct-2003 dbj

add mnt_iflag field to struct mount for internal flags
mv MNT_GONE, MNT_UNMOUNT and MNT_WANTRDWR to this field
additonally add mnt_writeopcountupper and mnt_writeopcountlower fields
in preparation for pending write suspension support work
bump kernel version to 1.6ZD


# 1.52 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.51 29-Jun-2003 fvdl

branches: 1.51.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.


# 1.50 28-Jun-2003 bouyer

Adapt for struct proc* -> struct lwp* changes.


# 1.49 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.48 22-Apr-2003 christos

fix lkm malloc lossage.


# 1.47 22-Apr-2003 christos

choose the smaller size of the two strings when memcpy'ing them. A better
fix would be to strncpy and null terminate? From enami.


# 1.46 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.45 02-Apr-2003 fvdl

Add support for UFS2. UFS2 is an enhanced FFS, adding support for
64 bit block pointers, extended attribute storage, and a few
other things.

This commit does not yet include the code to manipulate the extended
storage (for e.g. ACLs), this will be done later.

Originally written by Kirk McKusick and Network Associates Laboratories for
FreeBSD.


# 1.44 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.43 18-Jan-2003 thorpej

Merge the nathanw_sa branch.


Revision tags: nathanw_sa_before_merge fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base nathanw_sa_base
# 1.42 24-Oct-2002 chs

the work-around in rev. 1.37 (turn off async) wasn't enough to prevent
hangs under heavy load. so we now apply the more extreme version:
make MFS mounts "sync". fixes PRs 17128 and 17321.


Revision tags: kqueue-aftermerge kqueue-beforemerge kqueue-base
# 1.41 21-Sep-2002 christos

MNT_GETARGS support


Revision tags: gehenna-devsw-base
# 1.40 21-Jul-2002 hannken

Rename bufq_init() to bufq_alloc().
Add bufq_free() to remove a buffer queue.
Avoid MALLOC while holding a spinlock.

From Chuck Silvers.


# 1.39 19-Jul-2002 hannken

Convert to new device buffer queue interface.


Revision tags: netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base eeh-devprop-base newlock-base
# 1.38 04-Mar-2002 simonb

branches: 1.38.2; 1.38.6; 1.38.8;
Don't use local extern declarations for the mountroot variable or
declare local prototypes for nfs_mountroot() or md_root_setconf().


Revision tags: ifpoll-base
# 1.37 03-Feb-2002 chs

fix PR 15299 by making MFS filesystems not be "async".
in the longer term, MFS needs to be made a lot more VM-friendly.


Revision tags: thorpej-mips-cache-base
# 1.36 08-Nov-2001 lukem

add RCSID


Revision tags: thorpej-devvp-base3 thorpej-devvp-base2 post-chs-ubcperf pre-chs-ubcperf
# 1.35 15-Sep-2001 chs

branches: 1.35.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.


Revision tags: thorpej-devvp-base perseant-lfsv2-base
# 1.34 30-May-2001 mrg

branches: 1.34.4; 1.34.6;
use _KERNEL_OPT


Revision tags: thorpej_scsipi_beforemerge thorpej_scsipi_nbase thorpej_scsipi_base
# 1.33 16-Apr-2001 thorpej

When unmounting a file system, acquire the syncer_lock before
vfs_busy'ing just before the dounmount() call. This is to avoid
sleeping with the mountlist_slock held -- but we must acquire
syncer_lock before vfs_busy because the syncer itself uses
syncer_lock -> vfs_busy locking order.


# 1.32 24-Feb-2001 cgd

branches: 1.32.2;
fix bug (pointed out as sequence point violation warning with current-ish gcc)
caused by use of makedev(major,minor++). makedev() now (since 32-bit
dev_t conversion) evaluates its second argument twice.


# 1.31 22-Jan-2001 jdolecek

make filesystem vnodeop, specop, fifoop and vnodeopv_* arrays const


# 1.30 13-Oct-2000 simonb

Position comment correctly wrt last commit.


# 1.29 13-Oct-2000 simonb

In mfs_start(), move the handling of outstanding I/O requests to before
the check for unmounting the filesystem.

Appears to fix kern/10122 from Hitoshi Matsunawa.


Revision tags: netbsd-1-5-ALPHA2 netbsd-1-5-base minoura-xpg4dl-base
# 1.28 19-May-2000 thorpej

branches: 1.28.4;
Back out previous change; there is something Seriously Wrong.


# 1.27 16-May-2000 thorpej

Redo the way MFS does I/O to the server's address space. Instead of
queueing up buffers and awakening the MFS server process to do the I/O,
we do the I/O to the server process's address space directly using
facilities provided by UVM.

This makes it possible for buffers attempting to flush out while the
MFS is being unmounted to actually do the I/O, where before it would
fail if the server process wasn't in the MFS idle loop (i.e. had been
signaled and was attempting to exit).

Should fix kern/10122 (I can no longer reproduce the problem described
in the PR when running with these changes), and any number of other
MFS-related complaints made by people over time.


# 1.26 16-May-2000 thorpej

Record the proc directly, not the pid, of the MFS server process,
and nuke the spare fields in the mfsnode.


# 1.25 30-Mar-2000 augustss

Remove register declarations.


# 1.24 29-Mar-2000 simonb

Remove redundant decl of rootvp - it's in <sys/systm.h>.


# 1.23 16-Mar-2000 jdolecek

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.

For each leaf filesystem, add appropriate vfs_done routine.

Also remember how many times ffs_init() was called and do
the appropriate initialization on first call only. In ffs_done(),
destroy the resources when called by the last user of ffs code.
Change mfs to call ffs_init()/ffs_done() appropriately.


Revision tags: chs-ubc2-newbase
# 1.22 21-Jan-2000 thorpej

Update for sys/buf.h/disksort_*() changes.


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base comdex-fall-1999-base fvdl-softdep-base chs-ubc2-base
# 1.21 17-Jul-1999 wrstuden

branches: 1.21.2; 1.21.8;
Adjust mountroot routines to vrele rootvp in case of mount error. Closes
PR 7977 by Neil Carson, <neil@brini.com>.


# 1.20 04-Apr-1999 mycroft

It was silly to not make this exportable.


Revision tags: netbsd-1-4-PATCH002 kame_141_19991130 netbsd-1-4-PATCH001 kame_14_19990705 kame_14_19990628 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.19 26-Feb-1999 wrstuden

branches: 1.19.2; 1.19.4;
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.


Revision tags: kenh-if-detach-base chs-ubc-base
# 1.18 09-Aug-1998 perry

bzero->memset, bcopy->memcpy, bcmp->memcmp


Revision tags: eeh-paddr_t-base
# 1.17 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.16 01-Mar-1998 fvdl

Remove accidentally enabled mfs_mountroot from vfsops struct.


# 1.15 01-Mar-1998 fvdl

Merge with Lite2 + local changes


# 1.14 18-Feb-1998 thorpej

Place a pointer to an array of our vnodeopv_desc *'s in our vfsops
structure, for use by vfs_attach().


Revision tags: netbsd-1-3-PATCH003 netbsd-1-3-PATCH003-CANDIDATE2 netbsd-1-3-PATCH003-CANDIDATE1 netbsd-1-3-PATCH003-CANDIDATE0 netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base thorpej-signal-base marc-pcmcia-bp marc-pcmcia-base
# 1.13 12-Jun-1997 mrg

remove swap configuration.


Revision tags: is-newarp-before-merge
# 1.12 22-Feb-1997 fvdl

Implement similar fix as in the NQNFS fix from BSDI, to avoid race conditions
when unmounting. It cleans up the loop a bit too.


Revision tags: is-newarp-base
# 1.11 22-Dec-1996 cgd

branches: 1.11.6;
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...


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.10 09-Feb-1996 christos

mfs prototypes


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.9 01-Sep-1995 mycroft

Do any pending I/O before trying to unmount, per John Kohl.


# 1.8 18-Jun-1995 cgd

don't assume the f_fsnamelen is nul-truncated or longer than MFSNAMELEN


# 1.7 09-Mar-1995 mycroft

copy*str() should use size_t.


# 1.6 08-Mar-1995 cgd

size for copyinstr should be u_long


# 1.5 18-Jan-1995 mycroft

Clean up the code to frob mnt_stat a bit.


# 1.4 18-Jan-1995 mycroft

Turn mountlist into a CIRCLEQ, and handle setting and checking of MNT_ROOTFS
differently.


# 1.3 15-Dec-1994 mycroft

Call foo_statfs() from a common place when mounting.


Revision tags: netbsd-1-0-PATCH06 netbsd-1-0-PATCH05 netbsd-1-0-PATCH04 netbsd-1-0-PATCH03 netbsd-1-0-PATCH02 netbsd-1-0-PATCH1 netbsd-1-0-PATCH0 netbsd-1-0-RELEASE netbsd-1-0-base
# 1.2 29-Jun-1994 cgd

New RCS ID's, take two. they're more aesthecially pleasant, and use 'NetBSD'


# 1.1 08-Jun-1994 mycroft

branches: 1.1.1;
Update to 4.4-Lite fs code, with local changes.


# 1.111 17-Feb-2017 hannken

Add generic genfs_suspendctl() and use it for all file systems.
Layered file systems need work.


Revision tags: nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606 nick-nhusb-base-20150406
# 1.110 17-Mar-2015 hannken

Change ffs to use vcache_new:
- Change ffs_valloc to return an inode number.
- Remove now obsolete UFS operations UFS_VALLOC and UFS_VFREE.
- Make ufs_makeinode private to ufs_vnops.c and pass vattr instead of mode.


# 1.109 14-Jan-2015 hannken

Change mfs to use an anonymous vnode obtained with bdevvp()
for the specdev it mounts on.


Revision tags: netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 netbsd-7-0-2-RELEASE netbsd-7-nhusb-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.108 08-May-2014 hannken

branches: 1.108.4;
Add a global vnode cache:

- vcache_get() retrieves a referenced and initialised vnode / fs node pair.
- vcache_remove() removes a vnode / fs node pair from the cache.

On cache miss vcache_get() calls new vfs operation vfs_loadvnode() to
initialise a vnode / fs node pair. This call is guaranteed exclusive,
no other thread will try to load this vnode / fs node pair.

Convert ufs/ext2fs, ufs/ffs and ufs/mfs to use this interface.

Remove now unused ufs/ufs_ihash

Discussed on tech-kern.

Welcome to 6.99.41


# 1.107 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@


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15
# 1.106 23-Mar-2014 hannken

branches: 1.106.2;
Change all vfsops to use C99 designated initializers.

No functional changes intended.


Revision tags: riastradh-drm2-base3
# 1.105 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.104 23-Nov-2013 christos

change the mountlist CIRCLEQ into a TAILQ


Revision tags: yamt-pagecache-tag8 netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 agc-symver-base netbsd-6-1-RC2 netbsd-6-1-RC1 yamt-pagecache-base8 netbsd-6-0-1-RELEASE yamt-pagecache-base7 matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.103 12-Jun-2011 rmind

branches: 1.103.2; 1.103.8; 1.103.12; 1.103.14; 1.103.16; 1.103.22;
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.


Revision tags: rmind-uvmplock-nbase cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10 uebayasi-xip-base1 rmind-uvmplock-base yamt-nfs-mp-base9
# 1.102 02-Mar-2010 pooka

branches: 1.102.2; 1.102.8;
Make mfs_initminiroot() mandatory. Allows to remove #ifdef MFS.


Revision tags: uebayasi-xip-base matt-premerge-20091211 yamt-nfs-mp-base8 yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 jym-xensuspend-nbase yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base2 jym-xensuspend-base nick-hppapmap-base mjf-devfs2-base
# 1.101 13-Jan-2009 yamt

branches: 1.101.4;
g/c BUFQ_FOO() macros and use bufq_foo() directly.


# 1.100 19-Dec-2008 pgoyette

Store config(1)'s root filesystem type as a text string rather than
embedding the address of its xxx_mountroot() in swapnetbsd.c. This
permits booting of kernels with hard-wired filesystem type even if the
filesystem is in a loadable module (ie, not linked into the kernel
image).

Discussed on current-users. Tested on amd64 and i386 with both hard-
wired and '?' filesystem times, and on both modular and monolithic
kernels.

Thanks to pooka@ for code review and suggestions.

Addresses my PR kern/40167


Revision tags: haad-dm-base2 haad-nbase2 ad-audiomp2-base haad-dm-base
# 1.99 13-Nov-2008 ad

These depend on ffs.


Revision tags: netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 simonb-wapbl-nbase simonb-wapbl-base
# 1.98 28-Jun-2008 rumble

branches: 1.98.2; 1.98.4; 1.98.6; 1.98.12; 1.98.16;
Create sysctl entries during module initialisation and destroy them
appropriately.

Many of these file systems are now ready for modularisation.


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base
# 1.97 10-May-2008 rumble

branches: 1.97.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.96 06-May-2008 ad

branches: 1.96.2;
PR kern/38141 lookup/vfs_busy acquire rwlock recursively

Simplify the mount locking. Remove all the crud to deal with recursion on
the mount lock, and crud to deal with unmount as another weirdo lock.

Hopefully this will once and for all fix the deadlocks with this. With this
commit there are two locks on each mount:

- krwlock_t mnt_unmounting. This is used to prevent unmount across critical
sections like getnewvnode(). It's only ever read locked with rw_tryenter(),
and is only ever write locked in dounmount(). A write hold can't be taken
on this lock if the current LWP could hold a vnode lock.

- kmutex_t mnt_updating. This is taken by threads updating the mount, for
example when going r/o -> r/w, and is only present to serialize updates.
In order to take this lock, a read hold must first be taken on
mnt_unmounting, and the two need to be held across the operation.

One effect of this change: previously if an unmount failed, we would make a
half hearted attempt to back out of it gracefully, but that was unlikely to
work in a lot of cases. Now while an unmount that will be aborted is in
progress, new file operations within the mount will fail instead of being
delayed. That is unlikely to be a problem though, because if the admin
requests unmount of a file system then s(he) has made a decision to deny
access to the resource.


# 1.95 30-Apr-2008 ad

PR kern/38135 vfs_busy/vfs_trybusy confusion

The previous fix worked, but it opened a window where mounts could have
disappeared from mountlist while the caller was traversing it using
vfs_trybusy(). Fix that.


# 1.94 29-Apr-2008 ad

kern/38135 vfs_busy/vfs_trybusy confusion

The symptom was that sometimes file systems would occasionally not appear
in output from 'df' or 'mount' if the system was busy. Resolution:

- Make mount locks work somewhat like vm_map locks.
- vfs_trybusy() now only fails if the mount is gone, or if someone is
unmounting the file system. Simple contention on mnt_lock doesn't
cause it to fail.
- vfs_busy() will wait even if the file system is being unmounted.


# 1.93 29-Apr-2008 ad

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.


Revision tags: yamt-nfs-mp-base
# 1.92 24-Apr-2008 ad

branches: 1.92.2;
Merge proc::p_mutex and proc::p_smutex into a single adaptive mutex, since
we no longer need to guard against access from hardware interrupt handlers.

Additionally, if cloning a process with CLONE_SIGHAND, arrange to have the
child process share the parent's lock so that signal state may be kept in
sync. Partially addresses PR kern/37437.


Revision tags: yamt-pf42-baseX yamt-pf42-base ad-socklock-base1
# 1.91 26-Mar-2008 ad

branches: 1.91.2;
Changes for PR kern/38291 (panic unmounting MFS /tmp):

- Reference count the mfsnode to fix an aincent bug. Only destroy when
reference count drops to zero. In mfs_start(), busy the mount and get
a reference to the mfsnode to prevent it disappearing while the server
is running. If the file system is gone already, vfs_busy() will fail.
- Always destroy the bufq.
- Use a global mfs_lock for simplicity.
- Replace use of malloc/free. Fixes broken MALLOC_TYPE change.


Revision tags: yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase nick-net80211-sync-base keiichi-mipv6-base matt-armv6-nbase hpcarm-cleanup-base
# 1.90 21-Feb-2008 ad

branches: 1.90.4;
Make MFS MP-safe. Needed because of the funny tricks it plays.


Revision tags: mjf-devfs-base
# 1.89 30-Jan-2008 ad

branches: 1.89.2;
PR kern/37706 (forced unmount of file systems is unsafe):

- Do reference counting for 'struct mount'. Each vnode associated with a
mount takes a reference, and in turn the mount takes a reference to the
vfsops.
- Now that mounts are reference counted, replace the overcomplicated mount
locking inherited from 4.4BSD with a recursable rwlock.


# 1.88 28-Jan-2008 dholland

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.87 25-Jan-2008 pooka

spec_node_init() mfs device vnode.

fixes PR kern/37867 by Steve Woodford


# 1.86 24-Jan-2008 ad

specfs changes for PR kern/37717 (raidclose() is no longer called on
shutdown). There are still problems with device access and a PR will be
filed.

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

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

- Track opens by vnode and by device. Issue cdev_close() when the last open
goes away, instead of abusing vnode::v_usecount to tell if the device is
open.


Revision tags: bouyer-xeni386-merge1 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 vmlocking-nbase matt-armv6-base jmcneill-pm-base reinoud-bufcleanup-base
# 1.85 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


Revision tags: jmcneill-base bouyer-xenamd64-base2 yamt-x86pmap-base4 bouyer-xenamd64-base yamt-x86pmap-base3 vmlocking-base
# 1.84 10-Oct-2007 ad

branches: 1.84.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.


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base2 yamt-x86pmap-base matt-mips64-base
# 1.83 31-Jul-2007 pooka

branches: 1.83.2; 1.83.4; 1.83.6; 1.83.8;
* 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.82 26-Jul-2007 pooka

Use eopnotsupp() instead of vfs_stdsuspendctl() and retire the latter.


Revision tags: nick-csl-alignment-base
# 1.81 17-Jul-2007 pooka

branches: 1.81.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.80 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.


Revision tags: mjf-ufs-trans-base
# 1.79 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.


Revision tags: yamt-idlelwp-base8 thorpej-atomic-base
# 1.78 04-Mar-2007 christos

branches: 1.78.2; 1.78.4;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.


Revision tags: ad-audiomp-base post-newlock2-merge
# 1.77 09-Feb-2007 ad

branches: 1.77.2;
Merge newlock2 to head.


Revision tags: newlock2-nbase newlock2-base
# 1.76 19-Jan-2007 hannken

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).


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 netbsd-4-base
# 1.75 16-Nov-2006 christos

__unused removal on arguments; approved by core.


Revision tags: yamt-splraiseipl-base2
# 1.74 12-Oct-2006 christos

- sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386


Revision tags: yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 rpaulo-netinet-merge-pcb-base
# 1.73 02-Sep-2006 christos

branches: 1.73.2; 1.73.4;
add missing initializers


Revision tags: abandoned-netbsd-4-base yamt-pdpolicy-base7 yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base yamt-pdpolicy-base5 chap-midi-base elad-kernelauth-base simonb-timecounters-base
# 1.72 15-Apr-2006 christos

From my posting of April 3 to tech-kern:

My understanding is that the CLRSIG() is supposed to clear the signal
that was sent to the syncer process to prevent it from being delivered
to the syncer process in case unmounting fails, so that the syncer process
does not die while the filesystem is still mounted. The typical scenario
is, the syncher process is tsleep()ing in the kernel, and waking up when
it needs to do work. If someone sends a signal to it, eg. kill -TERM
the mfs process, then the kernel will try to unmount the mfs filesystem
before delivering the signal to the process. If that unmount fails, then
we should not really kill the process because that will hang the mount.
So we call CLRSIG() to stop the signal from being delivered.

So the first call to issignal() will return the signal number that was
sent to the syncer process (unless someone malicious was able to send
a lower numbered signal between the time tsleep() returned and we called
issignal()... something that is not really easy to do). But you are
right, we should not be calling it many times as a side effect of this
macro.

Rewrite CLRSIG() clear all the signals and call issignal() the correct
number of times.


Revision tags: yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.71 11-Dec-2005 christos

branches: 1.71.4; 1.71.6; 1.71.8; 1.71.10; 1.71.12;
merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.70 15-Oct-2005 yamt

- change the way to specify a bufq strategy. (by string rather than by number)
- rather than embedding bufq_state in driver softc,
have a pointer to the former.
- move bufq related functions from kern/subr_disk.c to kern/subr_bufq.c.
- rename method to strategy for consistency.
- move some definitions which don't need to be exposed to the rest of kernel
from sys/bufq.h to sys/bufq_impl.h.
(is it better to move it to kern/ or somewhere?)
- fix some obvious breakage in dev/qbus/ts.c. (not tested)


# 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()
* Use ANSI function declarations on ext2fs and mfs


# 1.67 29-May-2005 christos

branches: 1.67.2;
- sprinkle const
- avoid shadow variables.


Revision tags: kent-audio2-base
# 1.66 29-Mar-2005 thorpej

- 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[].


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 yamt-km-base4 yamt-km-base3 netbsd-3-base
# 1.65 26-Feb-2005 perry

nuke trailing whitespace


Revision tags: yamt-km-base2 yamt-km-base kent-audio1-beforemerge
# 1.64 09-Jan-2005 mycroft

branches: 1.64.2; 1.64.4;
Rework the mountroot interface so that vfs_mountroot() opens the root device
and just passes it on to the file system functions. This avoids opening and
closing the device several times.

Mentioned on tech-kern some time ago, IIRC. I've been running this for a
long time.


# 1.63 02-Jan-2005 thorpej

Add the system call and VFS infrastructure for file system extended
attributes.

From FreeBSD.


Revision tags: kent-audio1-base
# 1.62 28-Oct-2004 yamt

move buffer queue related stuffs from buf.h to their own header, bufq.h.


# 1.61 05-Jul-2004 pk

Call inittodr() from main(). Let file system code set the recorded `last
update' time (if any) through the new function setrootfstime().


# 1.60 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.59 25-May-2004 atatat

Sysctl descriptions under vfs subtree


# 1.58 21-Apr-2004 christos

similar fix to enami's in the fstypename field. Not really needed, but better
safe than sorry.


# 1.57 21-Apr-2004 enami

Don't copy past the end of destination array boundary; the size of source
array changed due to recent statvfs change.


# 1.56 21-Apr-2004 christos

Replace the statfs() family of system calls with statvfs().
Retain binary compatibility.


Revision tags: netbsd-2-0-base
# 1.55 24-Mar-2004 atatat

branches: 1.55.2;
Tango on sysctl_createv() and flags. The flags have all been renamed,
and sysctl_createv() now uses more arguments.


# 1.54 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.53 14-Oct-2003 dbj

add mnt_iflag field to struct mount for internal flags
mv MNT_GONE, MNT_UNMOUNT and MNT_WANTRDWR to this field
additonally add mnt_writeopcountupper and mnt_writeopcountlower fields
in preparation for pending write suspension support work
bump kernel version to 1.6ZD


# 1.52 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.51 29-Jun-2003 fvdl

branches: 1.51.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.


# 1.50 28-Jun-2003 bouyer

Adapt for struct proc* -> struct lwp* changes.


# 1.49 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.48 22-Apr-2003 christos

fix lkm malloc lossage.


# 1.47 22-Apr-2003 christos

choose the smaller size of the two strings when memcpy'ing them. A better
fix would be to strncpy and null terminate? From enami.


# 1.46 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.45 02-Apr-2003 fvdl

Add support for UFS2. UFS2 is an enhanced FFS, adding support for
64 bit block pointers, extended attribute storage, and a few
other things.

This commit does not yet include the code to manipulate the extended
storage (for e.g. ACLs), this will be done later.

Originally written by Kirk McKusick and Network Associates Laboratories for
FreeBSD.


# 1.44 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.43 18-Jan-2003 thorpej

Merge the nathanw_sa branch.


Revision tags: nathanw_sa_before_merge fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base nathanw_sa_base
# 1.42 24-Oct-2002 chs

the work-around in rev. 1.37 (turn off async) wasn't enough to prevent
hangs under heavy load. so we now apply the more extreme version:
make MFS mounts "sync". fixes PRs 17128 and 17321.


Revision tags: kqueue-aftermerge kqueue-beforemerge kqueue-base
# 1.41 21-Sep-2002 christos

MNT_GETARGS support


Revision tags: gehenna-devsw-base
# 1.40 21-Jul-2002 hannken

Rename bufq_init() to bufq_alloc().
Add bufq_free() to remove a buffer queue.
Avoid MALLOC while holding a spinlock.

From Chuck Silvers.


# 1.39 19-Jul-2002 hannken

Convert to new device buffer queue interface.


Revision tags: netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base eeh-devprop-base newlock-base
# 1.38 04-Mar-2002 simonb

branches: 1.38.2; 1.38.6; 1.38.8;
Don't use local extern declarations for the mountroot variable or
declare local prototypes for nfs_mountroot() or md_root_setconf().


Revision tags: ifpoll-base
# 1.37 03-Feb-2002 chs

fix PR 15299 by making MFS filesystems not be "async".
in the longer term, MFS needs to be made a lot more VM-friendly.


Revision tags: thorpej-mips-cache-base
# 1.36 08-Nov-2001 lukem

add RCSID


Revision tags: thorpej-devvp-base3 thorpej-devvp-base2 post-chs-ubcperf pre-chs-ubcperf
# 1.35 15-Sep-2001 chs

branches: 1.35.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.


Revision tags: thorpej-devvp-base perseant-lfsv2-base
# 1.34 30-May-2001 mrg

branches: 1.34.4; 1.34.6;
use _KERNEL_OPT


Revision tags: thorpej_scsipi_beforemerge thorpej_scsipi_nbase thorpej_scsipi_base
# 1.33 16-Apr-2001 thorpej

When unmounting a file system, acquire the syncer_lock before
vfs_busy'ing just before the dounmount() call. This is to avoid
sleeping with the mountlist_slock held -- but we must acquire
syncer_lock before vfs_busy because the syncer itself uses
syncer_lock -> vfs_busy locking order.


# 1.32 24-Feb-2001 cgd

branches: 1.32.2;
fix bug (pointed out as sequence point violation warning with current-ish gcc)
caused by use of makedev(major,minor++). makedev() now (since 32-bit
dev_t conversion) evaluates its second argument twice.


# 1.31 22-Jan-2001 jdolecek

make filesystem vnodeop, specop, fifoop and vnodeopv_* arrays const


# 1.30 13-Oct-2000 simonb

Position comment correctly wrt last commit.


# 1.29 13-Oct-2000 simonb

In mfs_start(), move the handling of outstanding I/O requests to before
the check for unmounting the filesystem.

Appears to fix kern/10122 from Hitoshi Matsunawa.


Revision tags: netbsd-1-5-ALPHA2 netbsd-1-5-base minoura-xpg4dl-base
# 1.28 19-May-2000 thorpej

branches: 1.28.4;
Back out previous change; there is something Seriously Wrong.


# 1.27 16-May-2000 thorpej

Redo the way MFS does I/O to the server's address space. Instead of
queueing up buffers and awakening the MFS server process to do the I/O,
we do the I/O to the server process's address space directly using
facilities provided by UVM.

This makes it possible for buffers attempting to flush out while the
MFS is being unmounted to actually do the I/O, where before it would
fail if the server process wasn't in the MFS idle loop (i.e. had been
signaled and was attempting to exit).

Should fix kern/10122 (I can no longer reproduce the problem described
in the PR when running with these changes), and any number of other
MFS-related complaints made by people over time.


# 1.26 16-May-2000 thorpej

Record the proc directly, not the pid, of the MFS server process,
and nuke the spare fields in the mfsnode.


# 1.25 30-Mar-2000 augustss

Remove register declarations.


# 1.24 29-Mar-2000 simonb

Remove redundant decl of rootvp - it's in <sys/systm.h>.


# 1.23 16-Mar-2000 jdolecek

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.

For each leaf filesystem, add appropriate vfs_done routine.

Also remember how many times ffs_init() was called and do
the appropriate initialization on first call only. In ffs_done(),
destroy the resources when called by the last user of ffs code.
Change mfs to call ffs_init()/ffs_done() appropriately.


Revision tags: chs-ubc2-newbase
# 1.22 21-Jan-2000 thorpej

Update for sys/buf.h/disksort_*() changes.


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base comdex-fall-1999-base fvdl-softdep-base chs-ubc2-base
# 1.21 17-Jul-1999 wrstuden

branches: 1.21.2; 1.21.8;
Adjust mountroot routines to vrele rootvp in case of mount error. Closes
PR 7977 by Neil Carson, <neil@brini.com>.


# 1.20 04-Apr-1999 mycroft

It was silly to not make this exportable.


Revision tags: netbsd-1-4-PATCH002 kame_141_19991130 netbsd-1-4-PATCH001 kame_14_19990705 kame_14_19990628 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.19 26-Feb-1999 wrstuden

branches: 1.19.2; 1.19.4;
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.


Revision tags: kenh-if-detach-base chs-ubc-base
# 1.18 09-Aug-1998 perry

bzero->memset, bcopy->memcpy, bcmp->memcmp


Revision tags: eeh-paddr_t-base
# 1.17 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.16 01-Mar-1998 fvdl

Remove accidentally enabled mfs_mountroot from vfsops struct.


# 1.15 01-Mar-1998 fvdl

Merge with Lite2 + local changes


# 1.14 18-Feb-1998 thorpej

Place a pointer to an array of our vnodeopv_desc *'s in our vfsops
structure, for use by vfs_attach().


Revision tags: netbsd-1-3-PATCH003 netbsd-1-3-PATCH003-CANDIDATE2 netbsd-1-3-PATCH003-CANDIDATE1 netbsd-1-3-PATCH003-CANDIDATE0 netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base thorpej-signal-base marc-pcmcia-bp marc-pcmcia-base
# 1.13 12-Jun-1997 mrg

remove swap configuration.


Revision tags: is-newarp-before-merge
# 1.12 22-Feb-1997 fvdl

Implement similar fix as in the NQNFS fix from BSDI, to avoid race conditions
when unmounting. It cleans up the loop a bit too.


Revision tags: is-newarp-base
# 1.11 22-Dec-1996 cgd

branches: 1.11.6;
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...


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.10 09-Feb-1996 christos

mfs prototypes


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.9 01-Sep-1995 mycroft

Do any pending I/O before trying to unmount, per John Kohl.


# 1.8 18-Jun-1995 cgd

don't assume the f_fsnamelen is nul-truncated or longer than MFSNAMELEN


# 1.7 09-Mar-1995 mycroft

copy*str() should use size_t.


# 1.6 08-Mar-1995 cgd

size for copyinstr should be u_long


# 1.5 18-Jan-1995 mycroft

Clean up the code to frob mnt_stat a bit.


# 1.4 18-Jan-1995 mycroft

Turn mountlist into a CIRCLEQ, and handle setting and checking of MNT_ROOTFS
differently.


# 1.3 15-Dec-1994 mycroft

Call foo_statfs() from a common place when mounting.


Revision tags: netbsd-1-0-PATCH06 netbsd-1-0-PATCH05 netbsd-1-0-PATCH04 netbsd-1-0-PATCH03 netbsd-1-0-PATCH02 netbsd-1-0-PATCH1 netbsd-1-0-PATCH0 netbsd-1-0-RELEASE netbsd-1-0-base
# 1.2 29-Jun-1994 cgd

New RCS ID's, take two. they're more aesthecially pleasant, and use 'NetBSD'


# 1.1 08-Jun-1994 mycroft

branches: 1.1.1;
Update to 4.4-Lite fs code, with local changes.