Home | History | Annotate | only in /src/sys/ufs/chfs
History log of /src/sys/ufs/chfs
RevisionDateAuthorComments
 1.11 07-Dec-2021  andvar fix various typos, mainly in comments.
 1.10 19-Apr-2018  christos s/static inline/static __inline/g for consistency.
 1.9 11-Jan-2015  hannken branches: 1.9.16;
Change chfs from hashlist to vcache.
 1.8 19-Oct-2012  ttoth branches: 1.8.14;
CHFS comments
 1.7 10-Aug-2012  ttoth branches: 1.7.2;
chfs bugfix [node was obsoleted twice]
 1.6 13-Apr-2012  ttoth branches: 1.6.2;
prepare for chfs's makefs
 1.5 12-Apr-2012  ttoth using chtype on media instead of vtype
debug.c deleted
 1.4 28-Nov-2011  ahoka branches: 1.4.2;
cleanup, some style and remove leftover code
 1.3 24-Nov-2011  ahoka disable dbg messages (they break the build on amd64)
 1.2 24-Nov-2011  ahoka fix build failure on amd64 due to incorrect format string
 1.1 24-Nov-2011  ahoka Import CHFS, which was formerly known as ChewieFS.

CHFS is a file system for flash devices developed by the
Software Engineering Department at University of Szeged, Hungary.

http://chewiefs.sed.hu/

Thanks for all who made it possible.
 1.4.2.1 29-Apr-2012  mrg sync to latest -current.
 1.6.2.3 30-Oct-2012  yamt sync with head
 1.6.2.2 17-Apr-2012  yamt sync with head
 1.6.2.1 13-Apr-2012  yamt file chfs.h was added on branch yamt-pagecache on 2012-04-17 00:08:54 +0000
 1.7.2.2 03-Dec-2017  jdolecek update from HEAD
 1.7.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.8.14.1 06-Apr-2015  skrll Sync with HEAD
 1.9.16.1 22-Apr-2018  pgoyette Sync with HEAD
 1.2 19-Oct-2012  ttoth CHFS comments
 1.1 24-Nov-2011  ahoka branches: 1.1.6; 1.1.10;
Import CHFS, which was formerly known as ChewieFS.

CHFS is a file system for flash devices developed by the
Software Engineering Department at University of Szeged, Hungary.

http://chewiefs.sed.hu/

Thanks for all who made it possible.
 1.1.10.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.1.6.3 30-Oct-2012  yamt sync with head
 1.1.6.2 17-Apr-2012  yamt sync with head
 1.1.6.1 24-Nov-2011  yamt file chfs_args.h was added on branch yamt-pagecache on 2012-04-17 00:08:54 +0000
 1.6 19-Jul-2021  andvar Release mutexes in few more places on failure path. Reviewed them in chfs code after fixing PR kern/56242.
ok riastradh
 1.5 19-Oct-2012  ttoth branches: 1.5.54;
CHFS comments
 1.4 10-Aug-2012  ttoth branches: 1.4.2;
chfs bugfix [node was obsoleted twice]
 1.3 12-Apr-2012  ttoth branches: 1.3.2;
using chtype on media instead of vtype
debug.c deleted
 1.2 24-Nov-2011  agc branches: 1.2.2;
i missed a file - quick workaround for compilation bugs on amd64
 1.1 24-Nov-2011  ahoka Import CHFS, which was formerly known as ChewieFS.

CHFS is a file system for flash devices developed by the
Software Engineering Department at University of Szeged, Hungary.

http://chewiefs.sed.hu/

Thanks for all who made it possible.
 1.2.2.1 29-Apr-2012  mrg sync to latest -current.
 1.3.2.3 30-Oct-2012  yamt sync with head
 1.3.2.2 17-Apr-2012  yamt sync with head
 1.3.2.1 12-Apr-2012  yamt file chfs_build.c was added on branch yamt-pagecache on 2012-04-17 00:08:54 +0000
 1.4.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.5.54.1 01-Aug-2021  thorpej Sync with HEAD.
 1.2 19-Oct-2012  ttoth CHFS comments
 1.1 24-Nov-2011  ahoka branches: 1.1.6; 1.1.10;
Import CHFS, which was formerly known as ChewieFS.

CHFS is a file system for flash devices developed by the
Software Engineering Department at University of Szeged, Hungary.

http://chewiefs.sed.hu/

Thanks for all who made it possible.
 1.1.10.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.1.6.3 30-Oct-2012  yamt sync with head
 1.1.6.2 17-Apr-2012  yamt sync with head
 1.1.6.1 24-Nov-2011  yamt file chfs_erase.c was added on branch yamt-pagecache on 2012-04-17 00:08:54 +0000
 1.12 07-Dec-2021  andvar fix typos in word "instead", mainly in log messages.
 1.11 19-Jul-2021  andvar NFC - if/else blocks start with the same mutex_exit, just move it up.
 1.10 16-Jul-2021  andvar Fix incorrect function name, some grammar and typos in comments. Remove trailing tab symbol.
No functional change intended.
 1.9 01-Jun-2017  chs branches: 1.9.26;
remove checks for failure after memory allocation calls that cannot fail:

kmem_alloc() with KM_SLEEP
kmem_zalloc() with KM_SLEEP
percpu_alloc()
pserialize_create()
psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.
 1.8 11-Jan-2015  hannken Convert a bogus mnt_vnodelist traversal to vfs_vnode_iterator.
 1.7 08-Sep-2014  joerg branches: 1.7.2;
Timestamps are bad sources of entropy, so just use cprng_fast32.
 1.6 01-Sep-2014  he Plug memory leak in error returns and normal operation in
chfs_gcollect_pristine().
 1.5 20-Oct-2013  christos branches: 1.5.4;
remove unused
 1.4 19-Oct-2012  ttoth branches: 1.4.2;
CHFS comments
 1.3 10-Aug-2012  ttoth branches: 1.3.2;
chfs bugfix [node was obsoleted twice]
 1.2 24-Nov-2011  agc branches: 1.2.6;
quick workaround to make this compile, with thanks to Hisashi Fujinaka for the
nudge.
 1.1 24-Nov-2011  ahoka Import CHFS, which was formerly known as ChewieFS.

CHFS is a file system for flash devices developed by the
Software Engineering Department at University of Szeged, Hungary.

http://chewiefs.sed.hu/

Thanks for all who made it possible.
 1.2.6.4 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.2.6.3 30-Oct-2012  yamt sync with head
 1.2.6.2 17-Apr-2012  yamt sync with head
 1.2.6.1 24-Nov-2011  yamt file chfs_gc.c was added on branch yamt-pagecache on 2012-04-17 00:08:54 +0000
 1.3.2.3 03-Dec-2017  jdolecek update from HEAD
 1.3.2.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.4.2.1 18-May-2014  rmind sync with head
 1.5.4.1 08-Sep-2014  msaitoh Pull up following revision(s) (requested by he in ticket #74):
sys/ufs/chfs/chfs_vnode.c: revision 1.11
sys/ufs/chfs/chfs_readinode.c: revision 1.9
sys/ufs/chfs/chfs_scan.c: revision 1.5
sys/ufs/chfs/chfs_gc.c: revision 1.6
sys/ufs/chfs/ebh.c: revision 1.4
Plug leak in chfs_scan_eraseblock() of the allocated buffer.
Make sure to release it both on success and failure returns.
OK'ed by ttoth@
Plug memory leak in a corner case in chfs_get_data_nodes().
Plug memory leaks in error returns in chfs_readvnode().
Plug memory leak in error returns and normal operation in
chfs_gcollect_pristine().
Plug memory leak in add_peb_to_free() and add_peb_to_in_use()
in case there's a duplicate in the tree.
 1.7.2.2 28-Aug-2017  skrll Sync with HEAD
 1.7.2.1 06-Apr-2015  skrll Sync with HEAD
 1.9.26.1 01-Aug-2021  thorpej Sync with HEAD.
 1.4 11-Jan-2015  hannken Change chfs from hashlist to vcache.
 1.3 27-Feb-2014  hannken branches: 1.3.6;
The current implementation of vn_lock() is racy. Modification of
the vnode operations vector for active vnodes is unsafe because it
is not known whether deadfs or the original file system will be
called.

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

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

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

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

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

Discussed on tech-kern.

Welcome to 6.99.33
 1.2 19-Oct-2012  ttoth branches: 1.2.2;
CHFS comments
 1.1 24-Nov-2011  ahoka branches: 1.1.6; 1.1.10;
Import CHFS, which was formerly known as ChewieFS.

CHFS is a file system for flash devices developed by the
Software Engineering Department at University of Szeged, Hungary.

http://chewiefs.sed.hu/

Thanks for all who made it possible.
 1.1.10.3 03-Dec-2017  jdolecek update from HEAD
 1.1.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.10.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.1.6.4 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1.6.3 30-Oct-2012  yamt sync with head
 1.1.6.2 17-Apr-2012  yamt sync with head
 1.1.6.1 24-Nov-2011  yamt file chfs_ihash.c was added on branch yamt-pagecache on 2012-04-17 00:08:54 +0000
 1.2.2.1 18-May-2014  rmind sync with head
 1.3.6.1 06-Apr-2015  skrll Sync with HEAD
 1.10 11-Jan-2015  hannken Change chfs from hashlist to vcache.
 1.9 26-May-2014  dholland branches: 1.9.4;
Fix previous. Anyone have a brown paper bag?
 1.8 26-May-2014  dholland Remove lfs-only inode flags.
 1.7 22-Jan-2013  dholland branches: 1.7.10;
Stuff UFS_ in front of a few of ufs's symbols to reduce namespace
pollution. Specifically:
ROOTINO -> UFS_ROOTINO
WINO -> UFS_WINO
NXADDR -> UFS_NXADDR
NDADDR -> UFS_NDADDR
NIADDR -> UFS_NIADDR
MAXSYMLINKLEN -> UFS_MAXSYMLINKLEN
MAXSYMLINKLEN_UFS[12] -> UFS[12]_MAXSYMLINKLEN (for consistency)

Sort out ext2fs's misuse of NDADDR and NIADDR; fortunately, these have
the same values in ext2fs and ffs.

No functional change intended.
 1.6 19-Oct-2012  ttoth CHFS comments
 1.5 18-Apr-2012  joerg branches: 1.5.2;
Don't depend on implicit enum casts, be explicit.
 1.4 13-Apr-2012  ttoth branches: 1.4.2;
prepare for chfs's makefs
 1.3 12-Apr-2012  ttoth using chtype on media instead of vtype
debug.c deleted
 1.2 28-Feb-2012  christos Make this compile again. From Paul Fleischer.
 1.1 24-Nov-2011  ahoka branches: 1.1.2; 1.1.4;
Import CHFS, which was formerly known as ChewieFS.

CHFS is a file system for flash devices developed by the
Software Engineering Department at University of Szeged, Hungary.

http://chewiefs.sed.hu/

Thanks for all who made it possible.
 1.1.4.1 02-Mar-2012  riz Pull up following revision(s) (requested by tron in ticket #63):
sys/ufs/chfs/chfs_inode.h: revision 1.2
sys/ufs/chfs/chfs_malloc.c: revision 1.2
sys/arch/i386/conf/ALL: revision 1.333
sys/ufs/chfs/chfs_pool.c: revision 1.2
Make this compile again. From Paul Fleischer.
Add Chip File System.
 1.1.2.4 29-Apr-2012  mrg sync to latest -current.
 1.1.2.3 06-Mar-2012  mrg sync to -current
 1.1.2.2 06-Mar-2012  mrg sync to -current
 1.1.2.1 04-Mar-2012  mrg sync to latest -current.
 1.4.2.5 23-Jan-2013  yamt sync with head
 1.4.2.4 30-Oct-2012  yamt sync with head
 1.4.2.3 23-May-2012  yamt sync with head.
 1.4.2.2 17-Apr-2012  yamt sync with head
 1.4.2.1 13-Apr-2012  yamt file chfs_inode.h was added on branch yamt-pagecache on 2012-04-17 00:08:54 +0000
 1.5.2.4 03-Dec-2017  jdolecek update from HEAD
 1.5.2.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.5.2.2 25-Feb-2013  tls resync with head
 1.5.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.7.10.1 10-Aug-2014  tls Rebase.
 1.9.4.1 06-Apr-2015  skrll Sync with HEAD
 1.7 07-Dec-2021  andvar fix various typos, mainly in comments.
 1.6 17-Jun-2019  ryoon Fix build without DIAGNOSTIC
 1.5 09-Nov-2017  christos branches: 1.5.4;
use PR_WAITOK everywhere.
 1.4 19-Oct-2012  ttoth branches: 1.4.30;
CHFS comments
 1.3 10-Aug-2012  ttoth branches: 1.3.2;
chfs bugfix [node was obsoleted twice]
 1.2 28-Feb-2012  christos branches: 1.2.2;
Make this compile again. From Paul Fleischer.
 1.1 24-Nov-2011  ahoka branches: 1.1.2; 1.1.4;
Import CHFS, which was formerly known as ChewieFS.

CHFS is a file system for flash devices developed by the
Software Engineering Department at University of Szeged, Hungary.

http://chewiefs.sed.hu/

Thanks for all who made it possible.
 1.1.4.1 02-Mar-2012  riz Pull up following revision(s) (requested by tron in ticket #63):
sys/ufs/chfs/chfs_inode.h: revision 1.2
sys/ufs/chfs/chfs_malloc.c: revision 1.2
sys/arch/i386/conf/ALL: revision 1.333
sys/ufs/chfs/chfs_pool.c: revision 1.2
Make this compile again. From Paul Fleischer.
Add Chip File System.
 1.1.2.3 06-Mar-2012  mrg sync to -current
 1.1.2.2 06-Mar-2012  mrg sync to -current
 1.1.2.1 04-Mar-2012  mrg sync to latest -current.
 1.2.2.3 30-Oct-2012  yamt sync with head
 1.2.2.2 17-Apr-2012  yamt sync with head
 1.2.2.1 28-Feb-2012  yamt file chfs_malloc.c was added on branch yamt-pagecache on 2012-04-17 00:08:54 +0000
 1.3.2.2 03-Dec-2017  jdolecek update from HEAD
 1.3.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.4.30.1 27-Feb-2018  martin Pull up following revision(s) (requested by mrg in ticket #593):
sys/dev/marvell/mvxpsec.c: revision 1.2
sys/arch/m68k/m68k/pmap_motorola.c: revision 1.70
sys/opencrypto/crypto.c: revision 1.102
sys/arch/sparc64/sparc64/pmap.c: revision 1.308
sys/ufs/chfs/chfs_malloc.c: revision 1.5
sys/arch/powerpc/oea/pmap.c: revision 1.95
sys/sys/pool.h: revision 1.80,1.82
sys/kern/subr_pool.c: revision 1.209-1.216,1.219-1.220
sys/arch/alpha/alpha/pmap.c: revision 1.262
sys/kern/uipc_mbuf.c: revision 1.173
sys/uvm/uvm_fault.c: revision 1.202
sys/sys/mbuf.h: revision 1.172
sys/kern/subr_extent.c: revision 1.86
sys/arch/x86/x86/pmap.c: revision 1.266 (via patch)
sys/dev/dtv/dtv_scatter.c: revision 1.4

Allow only one pending call to a pool's backing allocator at a time.
Candidate fix for problems with hanging after kva fragmentation related
to PR kern/45718.

Proposed on tech-kern:
https://mail-index.NetBSD.org/tech-kern/2017/10/23/msg022472.html
Tested by bouyer@ on i386.

This makes one small change to the semantics of pool_prime and
pool_setlowat: they may fail with EWOULDBLOCK instead of ENOMEM, if
there is a pending call to the backing allocator in another thread but
we are not actually out of memory. That is unlikely because nearly
always these are used during initialization, when the pool is not in
use.

Define the new flag too for previous commit.

pool_grow can now fail even when sleeping is ok. Catch this case in pool_get
and retry.

Assert that pool_get failure happens only with PR_NOWAIT.
This would have caught the mistake I made last week leading to null
pointer dereferences all over the place, a mistake which I evidently
poorly scheduled alongside maxv's change to the panic message on x86
for null pointer dereferences.

Since pr_lock is now used to wait for two things now (PR_GROWING and
PR_WANTED) we need to loop for the condition we wanted.
make the KASSERTMSG/panic strings consistent as '%s: [%s], __func__, wchan'
Handle the ERESTART case from pool_grow()

don't pass 0 to the pool flags
Guess pool_cache_get(pc, 0) means PR_WAITOK here.
Earlier on in the same context we use kmem_alloc(sz, KM_SLEEP).

use PR_WAITOK everywhere.
use PR_NOWAIT.

Don't use 0 for PR_NOWAIT

use PR_NOWAIT instead of 0

panic ex nihilo -- PR_NOWAITing for zerot

Add assertions that either PR_WAITOK or PR_NOWAIT are set.
- fix an assert; we can reach there if we are nowait or limitfail.
- when priming the pool and failing with ERESTART, don't decrement the number
of pages; this avoids the issue of returning an ERESTART when we get to 0,
and is more correct.
- simplify the pool_grow code, and don't wakeup things if we ENOMEM.

In pmap_enter_ma(), only try to allocate pves if we might need them,
and even if that fails, only fail the operation if we later discover
that we really do need them. This implements the requirement that
pmap_enter(PMAP_CANFAIL) must not fail when replacing an existing
mapping with the first mapping of a new page, which is an unintended
consequence of the changes from the rmind-uvmplock branch in 2011.

The problem arises when pmap_enter(PMAP_CANFAIL) is used to replace an existing
pmap mapping with a mapping of a different page (eg. to resolve a copy-on-write).
If that fails and leaves the old pmap entry in place, then UVM won't hold
the right locks when it eventually retries. This entanglement of the UVM and
pmap locking was done in rmind-uvmplock in order to improve performance,
but it also means that the UVM state and pmap state need to be kept in sync
more than they did before. It would be possible to handle this in the UVM code
instead of in the pmap code, but these pmap changes improve the handling of
low memory situations in general, and handling this in UVM would be clunky,
so this seemed like the better way to go.

This somewhat indirectly fixes PR 52706, as well as the failing assertion
about "uvm_page_locked_p(old_pg)". (but only on x86, various other platforms
will need their own changes to handle this issue.)
In uvm_fault_upper_enter(), if pmap_enter(PMAP_CANFAIL) fails, assert that
the pmap did not leave around a now-stale pmap mapping for an old page.
If such a pmap mapping still existed after we unlocked the vm_map,
the UVM code would not know later that it would need to lock the
lower layer object while calling the pmap to remove or replace that
stale pmap mapping. See PR 52706 for further details.
hopefully workaround the irregularly "fork fails in init" problem.
if a pool is growing, and the grower is PR_NOWAIT, mark this.
if another caller wants to grow the pool and is also PR_NOWAIT,
busy-wait for the original caller, which should either succeed
or hard-fail fairly quickly.

implement the busy-wait by unlocking and relocking this pools
mutex and returning ERESTART. other methods (such as having
the caller do this) were significantly more code and this hack
is fairly localised.
ok chs@ riastradh@

Don't release the lock in the PR_NOWAIT allocation. Move flags setting
after the acquiring the mutex. (from Tobias Nygren)
apply the change from arch/x86/x86/pmap.c rev. 1.266 commitid vZRjvmxG7YTHLOfA:

In pmap_enter_ma(), only try to allocate pves if we might need them,
and even if that fails, only fail the operation if we later discover
that we really do need them. If we are replacing an existing mapping,
reuse the pv structure where possible.

This implements the requirement that pmap_enter(PMAP_CANFAIL) must not fail
when replacing an existing mapping with the first mapping of a new page,
which is an unintended consequence of the changes from the rmind-uvmplock
branch in 2011.

The problem arises when pmap_enter(PMAP_CANFAIL) is used to replace an existing
pmap mapping with a mapping of a different page (eg. to resolve a copy-on-write).
If that fails and leaves the old pmap entry in place, then UVM won't hold
the right locks when it eventually retries. This entanglement of the UVM and
pmap locking was done in rmind-uvmplock in order to improve performance,
but it also means that the UVM state and pmap state need to be kept in sync
more than they did before. It would be possible to handle this in the UVM code
instead of in the pmap code, but these pmap changes improve the handling of
low memory situations in general, and handling this in UVM would be clunky,
so this seemed like the better way to go.

This somewhat indirectly fixes PR 52706 on the remaining platforms where
this problem existed.
 1.5.4.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.5 07-Dec-2021  andvar fix various typos, mainly in comments.
 1.4 09-Dec-2013  wiz Fix typo ("then" instead of "than")
 1.3 19-Oct-2012  ttoth branches: 1.3.2;
CHFS comments
 1.2 10-Aug-2012  ttoth branches: 1.2.2;
chfs bugfix [node was obsoleted twice]
 1.1 24-Nov-2011  ahoka branches: 1.1.6;
Import CHFS, which was formerly known as ChewieFS.

CHFS is a file system for flash devices developed by the
Software Engineering Department at University of Szeged, Hungary.

http://chewiefs.sed.hu/

Thanks for all who made it possible.
 1.1.6.4 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1.6.3 30-Oct-2012  yamt sync with head
 1.1.6.2 17-Apr-2012  yamt sync with head
 1.1.6.1 24-Nov-2011  yamt file chfs_nodeops.c was added on branch yamt-pagecache on 2012-04-17 00:08:54 +0000
 1.2.2.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.3.2.1 18-May-2014  rmind sync with head
 1.5 05-Sep-2020  riastradh Round of uvm.h cleanup.

The poorly named uvm.h is generally supposed to be for uvm-internal
users only.

- Narrow it to files that actually need it -- mostly files that need
to query whether curlwp is the pagedaemon, which should maybe be
exposed by an external header.

- Use uvm_extern.h where feasible and uvm_*.h for things not exposed
by it. We should split up uvm_extern.h but this will serve for now
to reduce the uvm.h dependencies.

- Use uvm_stat.h and #ifdef UVMHIST uvm.h for files that use
UVMHIST(ubchist), since ubchist is declared in uvm.h but the
reference evaporates if UVMHIST is not defined, so we reduce header
file dependencies.

- Make uvm_device.h and uvm_swap.h independently includable while
here.

ok chs@
 1.4 17-Jun-2019  ryoon Fix build without DIAGNOSTIC
 1.3 29-Jan-2018  sevan branches: 1.3.4;
Drop commended out include to a hardcoded path in root's home directory.
 1.2 28-Feb-2012  christos branches: 1.2.2;
Make this compile again. From Paul Fleischer.
 1.1 24-Nov-2011  ahoka branches: 1.1.2; 1.1.4;
Import CHFS, which was formerly known as ChewieFS.

CHFS is a file system for flash devices developed by the
Software Engineering Department at University of Szeged, Hungary.

http://chewiefs.sed.hu/

Thanks for all who made it possible.
 1.1.4.1 02-Mar-2012  riz Pull up following revision(s) (requested by tron in ticket #63):
sys/ufs/chfs/chfs_inode.h: revision 1.2
sys/ufs/chfs/chfs_malloc.c: revision 1.2
sys/arch/i386/conf/ALL: revision 1.333
sys/ufs/chfs/chfs_pool.c: revision 1.2
Make this compile again. From Paul Fleischer.
Add Chip File System.
 1.1.2.3 06-Mar-2012  mrg sync to -current
 1.1.2.2 06-Mar-2012  mrg sync to -current
 1.1.2.1 04-Mar-2012  mrg sync to latest -current.
 1.2.2.2 17-Apr-2012  yamt sync with head
 1.2.2.1 28-Feb-2012  yamt file chfs_pool.c was added on branch yamt-pagecache on 2012-04-17 00:08:54 +0000
 1.3.4.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.1 24-Nov-2011  ahoka branches: 1.1.6;
Import CHFS, which was formerly known as ChewieFS.

CHFS is a file system for flash devices developed by the
Software Engineering Department at University of Szeged, Hungary.

http://chewiefs.sed.hu/

Thanks for all who made it possible.
 1.1.6.2 17-Apr-2012  yamt sync with head
 1.1.6.1 24-Nov-2011  yamt file chfs_pool.h was added on branch yamt-pagecache on 2012-04-17 00:08:54 +0000
 1.13 08-Apr-2022  andvar s/postion/position/
 1.12 10-Dec-2021  andvar s/occured/occurred/ in comments, log messages and man pages.
 1.11 15-Jul-2021  andvar Make sure that mutex is released before conditional return statements. Fixes PR kern/56242
ok riastradh
 1.10 01-Jun-2017  chs branches: 1.10.26;
remove checks for failure after memory allocation calls that cannot fail:

kmem_alloc() with KM_SLEEP
kmem_zalloc() with KM_SLEEP
percpu_alloc()
pserialize_create()
psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.
 1.9 01-Sep-2014  he branches: 1.9.2;
Plug memory leak in a corner case in chfs_get_data_nodes().
 1.8 20-Oct-2013  christos branches: 1.8.4;
remove unused
 1.7 01-Dec-2012  mbalmer branches: 1.7.2;
Fix a typo in debug output.
 1.6 19-Oct-2012  ttoth CHFS comments
 1.5 22-Aug-2012  ttoth branches: 1.5.2;
chfs: fixed truncating
 1.4 13-Aug-2012  ttoth chfs fixes
1. nodes are obsoleted only once during truncating a file
2. frags don't stay in pool_cache
 1.3 10-Aug-2012  ttoth chfs bugfix [node was obsoleted twice]
 1.2 24-Nov-2011  agc branches: 1.2.6;
quick workaround to make this compile, with thanks to Hisashi Fujinaka for the
nudge.
 1.1 24-Nov-2011  ahoka Import CHFS, which was formerly known as ChewieFS.

CHFS is a file system for flash devices developed by the
Software Engineering Department at University of Szeged, Hungary.

http://chewiefs.sed.hu/

Thanks for all who made it possible.
 1.2.6.5 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.2.6.4 16-Jan-2013  yamt sync with (a bit old) head
 1.2.6.3 30-Oct-2012  yamt sync with head
 1.2.6.2 17-Apr-2012  yamt sync with head
 1.2.6.1 24-Nov-2011  yamt file chfs_readinode.c was added on branch yamt-pagecache on 2012-04-17 00:08:54 +0000
 1.5.2.4 03-Dec-2017  jdolecek update from HEAD
 1.5.2.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.5.2.2 25-Feb-2013  tls resync with head
 1.5.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.7.2.1 18-May-2014  rmind sync with head
 1.8.4.1 08-Sep-2014  msaitoh Pull up following revision(s) (requested by he in ticket #74):
sys/ufs/chfs/chfs_vnode.c: revision 1.11
sys/ufs/chfs/chfs_readinode.c: revision 1.9
sys/ufs/chfs/chfs_scan.c: revision 1.5
sys/ufs/chfs/chfs_gc.c: revision 1.6
sys/ufs/chfs/ebh.c: revision 1.4
Plug leak in chfs_scan_eraseblock() of the allocated buffer.
Make sure to release it both on success and failure returns.
OK'ed by ttoth@
Plug memory leak in a corner case in chfs_get_data_nodes().
Plug memory leaks in error returns in chfs_readvnode().
Plug memory leak in error returns and normal operation in
chfs_gcollect_pristine().
Plug memory leak in add_peb_to_free() and add_peb_to_in_use()
in case there's a duplicate in the tree.
 1.9.2.1 28-Aug-2017  skrll Sync with HEAD
 1.10.26.1 01-Aug-2021  thorpej Sync with HEAD.
 1.10 16-Jul-2021  andvar Fix incorrect function name, some grammar and typos in comments. Remove trailing tab symbol.
No functional change intended.
 1.9 15-Jul-2021  andvar Make sure that mutex is released before conditional return statements. Fixes PR kern/56242
ok riastradh
 1.8 17-Jun-2019  ryoon branches: 1.8.14;
Fix build without DIAGNOSTIC
 1.7 01-Jun-2017  chs branches: 1.7.10;
remove checks for failure after memory allocation calls that cannot fail:

kmem_alloc() with KM_SLEEP
kmem_zalloc() with KM_SLEEP
percpu_alloc()
pserialize_create()
psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.
 1.6 07-Feb-2015  christos fix buf leak. Reported by:
http://www.m00nbsd.net/ae123a9bae03f7dde5c6d654412daf5a.html#Report-4
 1.5 01-Sep-2014  he branches: 1.5.2;
Plug leak in chfs_scan_eraseblock() of the allocated buffer.
Make sure to release it both on success and failure returns.
OK'ed by ttoth@
 1.4 19-Oct-2012  ttoth branches: 1.4.12;
CHFS comments
 1.3 10-Aug-2012  ttoth branches: 1.3.2;
chfs bugfix [node was obsoleted twice]
 1.2 24-Nov-2011  agc branches: 1.2.6;
quick workaround to make this compile, with thanks to Hisashi Fujinaka for the
nudge.
 1.1 24-Nov-2011  ahoka Import CHFS, which was formerly known as ChewieFS.

CHFS is a file system for flash devices developed by the
Software Engineering Department at University of Szeged, Hungary.

http://chewiefs.sed.hu/

Thanks for all who made it possible.
 1.2.6.3 30-Oct-2012  yamt sync with head
 1.2.6.2 17-Apr-2012  yamt sync with head
 1.2.6.1 24-Nov-2011  yamt file chfs_scan.c was added on branch yamt-pagecache on 2012-04-17 00:08:54 +0000
 1.3.2.2 03-Dec-2017  jdolecek update from HEAD
 1.3.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.4.12.2 16-Feb-2015  martin Pull up following revision(s) (requested by maxv in ticket #520):
sys/ufs/chfs/ebh.c: revision 1.6
sys/dev/sdmmc/sdmmc_mem.c: revision 1.33
sys/dev/ic/aic7xxx.c: revision 1.132
sys/fs/nfs/common/krpc_subr.c: revision 1.2
sys/modules/lua/lua.c: revision 1.16
sys/fs/udf/udf_subr.c: revision 1.128
sys/ufs/chfs/chfs_scan.c: revision 1.6
sys/dev/ic/an.c: revision 1.62

Fix six memory leaks and two inconsistencies.
 1.4.12.1 08-Sep-2014  msaitoh Pull up following revision(s) (requested by he in ticket #74):
sys/ufs/chfs/chfs_vnode.c: revision 1.11
sys/ufs/chfs/chfs_readinode.c: revision 1.9
sys/ufs/chfs/chfs_scan.c: revision 1.5
sys/ufs/chfs/chfs_gc.c: revision 1.6
sys/ufs/chfs/ebh.c: revision 1.4
Plug leak in chfs_scan_eraseblock() of the allocated buffer.
Make sure to release it both on success and failure returns.
OK'ed by ttoth@
Plug memory leak in a corner case in chfs_get_data_nodes().
Plug memory leaks in error returns in chfs_readvnode().
Plug memory leak in error returns and normal operation in
chfs_gcollect_pristine().
Plug memory leak in add_peb_to_free() and add_peb_to_in_use()
in case there's a duplicate in the tree.
 1.5.2.2 28-Aug-2017  skrll Sync with HEAD
 1.5.2.1 06-Apr-2015  skrll Sync with HEAD
 1.7.10.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.8.14.1 01-Aug-2021  thorpej Sync with HEAD.
 1.15 05-Sep-2020  riastradh Round of uvm.h cleanup.

The poorly named uvm.h is generally supposed to be for uvm-internal
users only.

- Narrow it to files that actually need it -- mostly files that need
to query whether curlwp is the pagedaemon, which should maybe be
exposed by an external header.

- Use uvm_extern.h where feasible and uvm_*.h for things not exposed
by it. We should split up uvm_extern.h but this will serve for now
to reduce the uvm.h dependencies.

- Use uvm_stat.h and #ifdef UVMHIST uvm.h for files that use
UVMHIST(ubchist), since ubchist is declared in uvm.h but the
reference evaporates if UVMHIST is not defined, so we reduce header
file dependencies.

- Make uvm_device.h and uvm_swap.h independently includable while
here.

ok chs@
 1.14 11-Jun-2020  ad uvm_availmem(): give it a boolean argument to specify whether a recent
cached value will do, or if the very latest total must be fetched. It can
be called thousands of times a second and fetching the totals impacts not
only the calling LWP but other CPUs doing unrelated activity in the VM
system.
 1.13 16-May-2020  christos Add ACL support for FFS. From FreeBSD.
 1.12 23-Apr-2020  ad PR kern/54759 (vm.ubc_direct deadlock when read()/write() into mapping of itself)

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

- Rename UBC_UNMAP_FLAG() to UBC_VNODE_FLAGS(). Pass in UBC_ISMAPPED where
appropriate.
 1.11 31-Dec-2019  ad branches: 1.11.6;
Rename uvm_free() -> uvm_availmem().
 1.10 21-Dec-2019  ad uvmexp.free -> uvm_free()
 1.9 20-Oct-2013  christos branches: 1.9.30;
remove unused
 1.8 19-Oct-2012  ttoth branches: 1.8.2;
CHFS comments
 1.7 22-Aug-2012  ttoth branches: 1.7.2;
chfs: fixed truncating
 1.6 13-Aug-2012  ttoth chfs fixes
1. nodes are obsoleted only once during truncating a file
2. frags don't stay in pool_cache
 1.5 10-Aug-2012  ttoth chfs bugfix [node was obsoleted twice]
 1.4 12-Apr-2012  ttoth branches: 1.4.2;
using chtype on media instead of vtype
debug.c deleted
 1.3 13-Mar-2012  elad Replace the remaining KAUTH_GENERIC_ISSUSER authorization calls with
something meaningful. All relevant documentation has been updated or
written.

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

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

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

Huge thanks to pgoyette for spinning these changes through some build
cycles and ATF.
 1.2 24-Nov-2011  agc branches: 1.2.2;
quick workaround to make this compile, with thanks to Hisashi Fujinaka for the
nudge.
 1.1 24-Nov-2011  ahoka Import CHFS, which was formerly known as ChewieFS.

CHFS is a file system for flash devices developed by the
Software Engineering Department at University of Szeged, Hungary.

http://chewiefs.sed.hu/

Thanks for all who made it possible.
 1.2.2.2 29-Apr-2012  mrg sync to latest -current.
 1.2.2.1 05-Apr-2012  mrg sync to latest -current.
 1.4.2.4 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.4.2.3 30-Oct-2012  yamt sync with head
 1.4.2.2 17-Apr-2012  yamt sync with head
 1.4.2.1 12-Apr-2012  yamt file chfs_subr.c was added on branch yamt-pagecache on 2012-04-17 00:08:54 +0000
 1.7.2.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.7.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.8.2.1 18-May-2014  rmind sync with head
 1.9.30.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.11.6.1 25-Apr-2020  bouyer Sync with bouyer-xenpvh-base2 (HEAD)
 1.24 28-May-2025  andvar fix few typos in comments.
 1.23 19-Mar-2022  hannken branches: 1.23.10;
Remove now unused VV_LOCKSWORK, all file systems support locking.

Remove unused predicates vn_locked() and vn_anylocked().

Welcome to 9.99.95
 1.22 05-Sep-2020  riastradh Round of uvm.h cleanup.

The poorly named uvm.h is generally supposed to be for uvm-internal
users only.

- Narrow it to files that actually need it -- mostly files that need
to query whether curlwp is the pagedaemon, which should maybe be
exposed by an external header.

- Use uvm_extern.h where feasible and uvm_*.h for things not exposed
by it. We should split up uvm_extern.h but this will serve for now
to reduce the uvm.h dependencies.

- Use uvm_stat.h and #ifdef UVMHIST uvm.h for files that use
UVMHIST(ubchist), since ubchist is declared in uvm.h but the
reference evaporates if UVMHIST is not defined, so we reduce header
file dependencies.

- Make uvm_device.h and uvm_swap.h independently includable while
here.

ok chs@
 1.21 17-Jan-2020  ad VFS_VGET(), VFS_ROOT(), VFS_FHTOVP(): give them a "int lktype" argument, to
allow us to get shared locks (or no lock) on the returned vnode. Matches
FreeBSD.
 1.20 27-Dec-2019  msaitoh branches: 1.20.2;
s/inital/initial/
 1.19 20-Jun-2019  pgoyette Split the ufs code out of the ffs module and into its own module.

Adapt chfs and ext2fs modules accordingly.
 1.18 28-May-2018  chs branches: 1.18.2;
add a genfs method to allow a file system to limit the range of pages
that are given to a single GOP_WRITE() call. needed by ZFS.
 1.17 14-Nov-2017  riastradh branches: 1.17.2;
Fix up chfs_mountfs error branches.
 1.16 17-Feb-2017  hannken branches: 1.16.4;
Add generic genfs_suspendctl() and use it for all file systems.
Layered file systems need work.
 1.15 11-Jan-2015  hannken branches: 1.15.2; 1.15.4;
Change chfs from hashlist to vcache.
 1.14 09-Nov-2014  maxv branches: 1.14.2;
Do not uselessly include <sys/malloc.h>.
 1.13 20-Oct-2014  christos simplify.
 1.12 20-Oct-2014  maxv Memory leak.

Found by my code scanner.

ok christos@
 1.11 16-Apr-2014  maxv branches: 1.11.2;
An (un)privileged user can easily make the kernel dereference a NULL
pointer.

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

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

No functional changes intended.
 1.9 20-Oct-2013  christos remove unused
 1.8 30-Sep-2013  hannken Replace macro v_specmountpoint with two functions spec_node_getmountedfs()
and spec_node_setmountedfs() to manage the file system mounted on a device.
Assert the device is a block device.

Welcome to 6.99.24

Discussed on tech-kern@ some time ago.

Reviewed by: David Holland <dholland@netbsd.org>
 1.7 22-Jan-2013  dholland branches: 1.7.2;
Stuff UFS_ in front of a few of ufs's symbols to reduce namespace
pollution. Specifically:
ROOTINO -> UFS_ROOTINO
WINO -> UFS_WINO
NXADDR -> UFS_NXADDR
NDADDR -> UFS_NDADDR
NIADDR -> UFS_NIADDR
MAXSYMLINKLEN -> UFS_MAXSYMLINKLEN
MAXSYMLINKLEN_UFS[12] -> UFS[12]_MAXSYMLINKLEN (for consistency)

Sort out ext2fs's misuse of NDADDR and NIADDR; fortunately, these have
the same values in ext2fs and ffs.

No functional change intended.
 1.6 19-Oct-2012  ttoth CHFS comments
 1.5 10-Aug-2012  ttoth branches: 1.5.2;
chfs bugfix [node was obsoleted twice]
 1.4 30-Apr-2012  rmind - Replace some malloc(9) uses with kmem(9).
- G/C M_IPMOPTS, M_IPMADDR and M_BWMETER.
 1.3 12-Apr-2012  ttoth branches: 1.3.2;
using chtype on media instead of vtype
debug.c deleted
 1.2 24-Nov-2011  agc branches: 1.2.2; 1.2.4; 1.2.8; 1.2.10;
quick workaround to make this compile, with thanks to Hisashi Fujinaka for the
nudge.
 1.1 24-Nov-2011  ahoka Import CHFS, which was formerly known as ChewieFS.

CHFS is a file system for flash devices developed by the
Software Engineering Department at University of Szeged, Hungary.

http://chewiefs.sed.hu/

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

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.3.2.5 23-Jan-2013  yamt sync with head
 1.3.2.4 30-Oct-2012  yamt sync with head
 1.3.2.3 23-May-2012  yamt sync with head.
 1.3.2.2 17-Apr-2012  yamt sync with head
 1.3.2.1 12-Apr-2012  yamt file chfs_vfsops.c was added on branch yamt-pagecache on 2012-04-17 00:08:54 +0000
 1.5.2.4 03-Dec-2017  jdolecek update from HEAD
 1.5.2.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.5.2.2 25-Feb-2013  tls resync with head
 1.5.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.7.2.1 18-May-2014  rmind sync with head
 1.10.2.1 10-Aug-2014  tls Rebase.
 1.11.2.2 17-Jan-2015  martin Pull up following revision(s) (requested by maxv in ticket #427):
sys/compat/svr4/svr4_schedctl.c: revision 1.8
sys/netinet/tcp_timer.c: revision 1.88
sys/miscfs/genfs/layer_vfsops.c: revision 1.45
sys/compat/svr4/svr4_ioctl.c: revision 1.37
sys/ufs/chfs/chfs_vfsops.c: revision 1.14
sys/miscfs/fdesc/fdesc_vfsops.c: revision 1.91
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.30
sys/compat/common/kern_time_50.c: revision 1.28
sys/netinet6/ip6_forward.c: revision 1.74
sys/miscfs/umapfs/umap_vnops.c: revision 1.57
sys/compat/svr4/svr4_fcntl.c: revision 1.74
distrib/sets/lists/comp/mi: revision 1.1931
sys/netinet6/udp6_output.c: revision 1.46
sys/fs/puffs/puffs_compat.c: revision 1.3
sys/fs/udf/udf_rename.c: revision 1.11
sys/compat/svr4/svr4_filio.c: revision 1.24
sys/fs/udf/udf_rename.c: revision 1.12
sys/netinet/tcp_usrreq.c: revision 1.202
sys/miscfs/umapfs/umap_subr.c: revision 1.29
sys/compat/linux/common/linux_fadvise64.c: revision 1.3
sys/netinet/if_atm.c: revision 1.34
sys/miscfs/procfs/procfs_subr.c: revision 1.106
sys/miscfs/genfs/layer_subr.c: revision 1.37
sys/netinet/tcp_sack.c: revision 1.30
sys/compat/freebsd/freebsd_misc.c: revision 1.33
sys/compat/freebsd/freebsd_file.c: revision 1.33
sys/ufs/chfs/chfs_vnode.c: revision 1.12
sys/compat/svr4/svr4_ttold.c: revision 1.34
sys/compat/linux/common/linux_file.c: revision 1.114
sys/compat/linux/arch/mips/linux_machdep.c: revision 1.43
sys/compat/linux/common/linux_signal.c: revision 1.76
sys/compat/common/compat_util.c: revision 1.46
sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.18
sys/compat/svr4/svr4_sockio.c: revision 1.36
sys/compat/linux/arch/arm/linux_machdep.c: revision 1.32
sys/compat/svr4/svr4_signal.c: revision 1.66
sys/kern/kern_exec.c: revision 1.410
sys/fs/puffs/puffs_vfsops.c: revision 1.115
sys/compat/svr4/svr4_exec_elf64.c: revision 1.15
sys/compat/linux/arch/i386/linux_machdep.c: revision 1.159
sys/compat/linux/arch/alpha/linux_machdep.c: revision 1.50
sys/compat/linux32/common/linux32_misc.c: revision 1.24
sys/netinet/in_pcb.c: revision 1.153
sys/sys/malloc.h: revision 1.116
sys/compat/common/if_43.c: revision 1.9
share/man/man9/Makefile: revision 1.380
sys/netinet/tcp_vtw.c: revision 1.12
sys/miscfs/umapfs/umap_vfsops.c: revision 1.95
sys/ufs/ext2fs/ext2fs_vfsops.c: revision 1.186
sys/compat/common/uipc_syscalls_43.c: revision 1.46
sys/ufs/ext2fs/ext2fs_vnops.c: revision 1.115
sys/fs/puffs/puffs_msgif.c: revision 1.97
sys/compat/svr4/svr4_ipc.c: revision 1.27
sys/compat/linux/common/linux_exec.c: revision 1.117
sys/ufs/ext2fs/ext2fs_readwrite.c: revision 1.66
sys/netinet/tcp_output.c: revision 1.179
sys/compat/svr4/svr4_termios.c: revision 1.28
sys/fs/udf/udf_strat_bootstrap.c: revision 1.4
sys/fs/puffs/puffs_subr.c: revision 1.67
sys/fs/puffs/puffs_node.c: revision 1.36
sys/miscfs/overlay/overlay_vnops.c: revision 1.21
sys/fs/cd9660/cd9660_node.c: revision 1.34
sys/netinet/raw_ip.c: revision 1.146
sys/sys/mallocvar.h: revision 1.13
sys/miscfs/overlay/overlay_vfsops.c: revision 1.63
share/man/man9/malloc.9: revision 1.50
sys/netinet6/dest6.c: revision 1.18
sys/compat/linux/common/linux_uselib.c: revision 1.33
sys/compat/linux/common/linux_socket.c: revision 1.120
share/man/man9/malloc.9: revision 1.51
sys/netinet/tcp_subr.c: revision 1.257
sys/compat/linux/common/linux_socketcall.c: revision 1.45
sys/compat/linux/common/linux_fadvise64_64.c: revision 1.3
sys/compat/freebsd/freebsd_ipc.c: revision 1.17
sys/compat/linux/common/linux_misc_notalpha.c: revision 1.109
sys/compat/linux/arch/alpha/linux_pipe.c: revision 1.17
sys/netinet6/in6_pcb.c: revision 1.132
sys/netinet6/in6_ifattach.c: revision 1.94
sys/compat/svr4/svr4_exec_elf32.c: revision 1.15
sys/miscfs/nullfs/null_vfsops.c: revision 1.90
sys/fs/cd9660/cd9660_util.c: revision 1.12
sys/compat/linux/arch/powerpc/linux_machdep.c: revision 1.48
sys/compat/freebsd/freebsd_exec_elf32.c: revision 1.20
sys/miscfs/procfs/procfs_vfsops.c: revision 1.94
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.28
sys/compat/linux/common/linux_sched.c: revision 1.67
sys/compat/linux/common/linux_exec_aout.c: revision 1.67
sys/compat/linux/common/linux_pipe.c: revision 1.67
sys/compat/linux/common/linux_llseek.c: revision 1.34
sys/compat/linux/arch/mips/linux_ptrace.c: revision 1.10
Do not uselessly include <sys/malloc.h>.
Cleanup:
- remove struct kmembuckets (dead)
- correctly deadify MALLOC_XX
- remove MALLOC_DEFINE_LIMIT and MALLOC_JUSTDEFINE_LIMIT (dead)
- remove malloc_roundup(), malloc_type_setlimit(), MALLOC_DEFINE_LIMIT()
and MALLOC_JUSTDEFINE_LIMIT() from man 9 malloc
New sentence, new line. Bump date for previous.
Obsolete malloc_roundup(9), malloc_type_setlimit(9) and MALLOC_DEFINE_LIMIT(9)
man pages.
 1.11.2.1 29-Dec-2014  martin Pull up following revision(s) (requested by maxv in ticket #353):
sys/ufs/chfs/chfs_vfsops.c: revision 1.12
sys/compat/common/vfs_syscalls_30.c: revision 1.35
sys/compat/linux/common/linux_uselib.c: revision 1.31
sys/compat/linux/common/linux_uselib.c: revision 1.32
Resource leak.
Memory leaks.
Reject non-regular files.
 1.14.2.2 28-Aug-2017  skrll Sync with HEAD
 1.14.2.1 06-Apr-2015  skrll Sync with HEAD
 1.15.4.1 21-Apr-2017  bouyer Sync with HEAD
 1.15.2.2 20-Mar-2017  pgoyette Sync with HEAD
 1.15.2.1 20-Jul-2016  pgoyette Adapt machine-independant code to the new {b,c}devsw reference-counting
(using localcount(9)). All callers of {b,c}devsw_lookup() now call
{b,c}devsw_lookup_acquire() which retains a reference on the 'struct
{b,c}devsw'. This reference must be released by the caller once it is
finished with the structure's content (or other data that would disappear
if the 'struct {b,c}devsw' were to disappear).
 1.16.4.1 27-Apr-2017  pgoyette Restore all work from the former pgoyette-localcount branch (which is
now abandoned doe to cvs merge botch).

The branch now builds, and installs via anita. There are still some
problems (cgd is non-functional and all atf tests time-out) but they
will get resolved soon.
 1.17.2.1 25-Jun-2018  pgoyette Sync with HEAD
 1.18.2.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.18.2.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.20.2.1 17-Jan-2020  ad Sync with head.
 1.23.10.1 02-Aug-2025  perseant Sync with HEAD
 1.20 07-Dec-2021  andvar fix typos in word "instead", mainly in log messages.
 1.19 16-May-2020  christos Add ACL support for FFS. From FreeBSD.
 1.18 17-Jan-2020  ad VFS_VGET(), VFS_ROOT(), VFS_FHTOVP(): give them a "int lktype" argument, to
allow us to get shared locks (or no lock) on the returned vnode. Matches
FreeBSD.
 1.17 18-Sep-2019  christos branches: 1.17.2;
fix compilation
 1.16 18-Sep-2019  christos Add newly created vnodes to the namei cache. The rest of the filesystems
already did that (or they don't support writing). Discussed in tech-kern.
 1.15 01-Apr-2017  riastradh branches: 1.15.14;
KASSERT(mutex_owned(vp->v_interlock)) in vnode iterator selector.
 1.14 11-Jan-2015  hannken branches: 1.14.2; 1.14.4;
Change chfs from hashlist to vcache.
 1.13 11-Jan-2015  hannken Convert a bogus mnt_vnodelist traversal to vfs_vnode_iterator.
 1.12 09-Nov-2014  maxv branches: 1.12.2;
Do not uselessly include <sys/malloc.h>.
 1.11 01-Sep-2014  he Plug memory leaks in error returns in chfs_readvnode().
 1.10 23-Jan-2014  hannken branches: 1.10.4;
Change vnode operations create, mknod, mkdir and symlink to return
the resulting vnode *vpp unlocked.

Discussed on tech-kern@

Welcome to 6.99.30
 1.9 17-Jan-2014  hannken Change vnode operations create, mknod, mkdir and symlink to keep the
directory node dvp locked on return.

Discussed on tech-kern@

Welcome to 6.99.29
 1.8 19-Oct-2012  ttoth branches: 1.8.2;
CHFS comments
 1.7 13-Aug-2012  ttoth branches: 1.7.2;
chfs fixes
1. nodes are obsoleted only once during truncating a file
2. frags don't stay in pool_cache
 1.6 10-Aug-2012  ttoth chfs bugfix [node was obsoleted twice]
 1.5 13-Apr-2012  ttoth branches: 1.5.2;
prepare for chfs's makefs
 1.4 12-Apr-2012  ttoth using chtype on media instead of vtype
debug.c deleted
 1.3 13-Mar-2012  elad Replace the remaining KAUTH_GENERIC_ISSUSER authorization calls with
something meaningful. All relevant documentation has been updated or
written.

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

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

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

Huge thanks to pgoyette for spinning these changes through some build
cycles and ATF.
 1.2 24-Nov-2011  agc branches: 1.2.2;
quick workaround to make this compile, with thanks to Hisashi Fujinaka for the
nudge.
 1.1 24-Nov-2011  ahoka Import CHFS, which was formerly known as ChewieFS.

CHFS is a file system for flash devices developed by the
Software Engineering Department at University of Szeged, Hungary.

http://chewiefs.sed.hu/

Thanks for all who made it possible.
 1.2.2.2 29-Apr-2012  mrg sync to latest -current.
 1.2.2.1 05-Apr-2012  mrg sync to latest -current.
 1.5.2.4 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.5.2.3 30-Oct-2012  yamt sync with head
 1.5.2.2 17-Apr-2012  yamt sync with head
 1.5.2.1 13-Apr-2012  yamt file chfs_vnode.c was added on branch yamt-pagecache on 2012-04-17 00:08:55 +0000
 1.7.2.3 03-Dec-2017  jdolecek update from HEAD
 1.7.2.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.7.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.8.2.1 18-May-2014  rmind sync with head
 1.10.4.2 17-Jan-2015  martin Pull up following revision(s) (requested by maxv in ticket #427):
sys/compat/svr4/svr4_schedctl.c: revision 1.8
sys/netinet/tcp_timer.c: revision 1.88
sys/miscfs/genfs/layer_vfsops.c: revision 1.45
sys/compat/svr4/svr4_ioctl.c: revision 1.37
sys/ufs/chfs/chfs_vfsops.c: revision 1.14
sys/miscfs/fdesc/fdesc_vfsops.c: revision 1.91
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.30
sys/compat/common/kern_time_50.c: revision 1.28
sys/netinet6/ip6_forward.c: revision 1.74
sys/miscfs/umapfs/umap_vnops.c: revision 1.57
sys/compat/svr4/svr4_fcntl.c: revision 1.74
distrib/sets/lists/comp/mi: revision 1.1931
sys/netinet6/udp6_output.c: revision 1.46
sys/fs/puffs/puffs_compat.c: revision 1.3
sys/fs/udf/udf_rename.c: revision 1.11
sys/compat/svr4/svr4_filio.c: revision 1.24
sys/fs/udf/udf_rename.c: revision 1.12
sys/netinet/tcp_usrreq.c: revision 1.202
sys/miscfs/umapfs/umap_subr.c: revision 1.29
sys/compat/linux/common/linux_fadvise64.c: revision 1.3
sys/netinet/if_atm.c: revision 1.34
sys/miscfs/procfs/procfs_subr.c: revision 1.106
sys/miscfs/genfs/layer_subr.c: revision 1.37
sys/netinet/tcp_sack.c: revision 1.30
sys/compat/freebsd/freebsd_misc.c: revision 1.33
sys/compat/freebsd/freebsd_file.c: revision 1.33
sys/ufs/chfs/chfs_vnode.c: revision 1.12
sys/compat/svr4/svr4_ttold.c: revision 1.34
sys/compat/linux/common/linux_file.c: revision 1.114
sys/compat/linux/arch/mips/linux_machdep.c: revision 1.43
sys/compat/linux/common/linux_signal.c: revision 1.76
sys/compat/common/compat_util.c: revision 1.46
sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.18
sys/compat/svr4/svr4_sockio.c: revision 1.36
sys/compat/linux/arch/arm/linux_machdep.c: revision 1.32
sys/compat/svr4/svr4_signal.c: revision 1.66
sys/kern/kern_exec.c: revision 1.410
sys/fs/puffs/puffs_vfsops.c: revision 1.115
sys/compat/svr4/svr4_exec_elf64.c: revision 1.15
sys/compat/linux/arch/i386/linux_machdep.c: revision 1.159
sys/compat/linux/arch/alpha/linux_machdep.c: revision 1.50
sys/compat/linux32/common/linux32_misc.c: revision 1.24
sys/netinet/in_pcb.c: revision 1.153
sys/sys/malloc.h: revision 1.116
sys/compat/common/if_43.c: revision 1.9
share/man/man9/Makefile: revision 1.380
sys/netinet/tcp_vtw.c: revision 1.12
sys/miscfs/umapfs/umap_vfsops.c: revision 1.95
sys/ufs/ext2fs/ext2fs_vfsops.c: revision 1.186
sys/compat/common/uipc_syscalls_43.c: revision 1.46
sys/ufs/ext2fs/ext2fs_vnops.c: revision 1.115
sys/fs/puffs/puffs_msgif.c: revision 1.97
sys/compat/svr4/svr4_ipc.c: revision 1.27
sys/compat/linux/common/linux_exec.c: revision 1.117
sys/ufs/ext2fs/ext2fs_readwrite.c: revision 1.66
sys/netinet/tcp_output.c: revision 1.179
sys/compat/svr4/svr4_termios.c: revision 1.28
sys/fs/udf/udf_strat_bootstrap.c: revision 1.4
sys/fs/puffs/puffs_subr.c: revision 1.67
sys/fs/puffs/puffs_node.c: revision 1.36
sys/miscfs/overlay/overlay_vnops.c: revision 1.21
sys/fs/cd9660/cd9660_node.c: revision 1.34
sys/netinet/raw_ip.c: revision 1.146
sys/sys/mallocvar.h: revision 1.13
sys/miscfs/overlay/overlay_vfsops.c: revision 1.63
share/man/man9/malloc.9: revision 1.50
sys/netinet6/dest6.c: revision 1.18
sys/compat/linux/common/linux_uselib.c: revision 1.33
sys/compat/linux/common/linux_socket.c: revision 1.120
share/man/man9/malloc.9: revision 1.51
sys/netinet/tcp_subr.c: revision 1.257
sys/compat/linux/common/linux_socketcall.c: revision 1.45
sys/compat/linux/common/linux_fadvise64_64.c: revision 1.3
sys/compat/freebsd/freebsd_ipc.c: revision 1.17
sys/compat/linux/common/linux_misc_notalpha.c: revision 1.109
sys/compat/linux/arch/alpha/linux_pipe.c: revision 1.17
sys/netinet6/in6_pcb.c: revision 1.132
sys/netinet6/in6_ifattach.c: revision 1.94
sys/compat/svr4/svr4_exec_elf32.c: revision 1.15
sys/miscfs/nullfs/null_vfsops.c: revision 1.90
sys/fs/cd9660/cd9660_util.c: revision 1.12
sys/compat/linux/arch/powerpc/linux_machdep.c: revision 1.48
sys/compat/freebsd/freebsd_exec_elf32.c: revision 1.20
sys/miscfs/procfs/procfs_vfsops.c: revision 1.94
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.28
sys/compat/linux/common/linux_sched.c: revision 1.67
sys/compat/linux/common/linux_exec_aout.c: revision 1.67
sys/compat/linux/common/linux_pipe.c: revision 1.67
sys/compat/linux/common/linux_llseek.c: revision 1.34
sys/compat/linux/arch/mips/linux_ptrace.c: revision 1.10
Do not uselessly include <sys/malloc.h>.
Cleanup:
- remove struct kmembuckets (dead)
- correctly deadify MALLOC_XX
- remove MALLOC_DEFINE_LIMIT and MALLOC_JUSTDEFINE_LIMIT (dead)
- remove malloc_roundup(), malloc_type_setlimit(), MALLOC_DEFINE_LIMIT()
and MALLOC_JUSTDEFINE_LIMIT() from man 9 malloc
New sentence, new line. Bump date for previous.
Obsolete malloc_roundup(9), malloc_type_setlimit(9) and MALLOC_DEFINE_LIMIT(9)
man pages.
 1.10.4.1 08-Sep-2014  msaitoh Pull up following revision(s) (requested by he in ticket #74):
sys/ufs/chfs/chfs_vnode.c: revision 1.11
sys/ufs/chfs/chfs_readinode.c: revision 1.9
sys/ufs/chfs/chfs_scan.c: revision 1.5
sys/ufs/chfs/chfs_gc.c: revision 1.6
sys/ufs/chfs/ebh.c: revision 1.4
Plug leak in chfs_scan_eraseblock() of the allocated buffer.
Make sure to release it both on success and failure returns.
OK'ed by ttoth@
Plug memory leak in a corner case in chfs_get_data_nodes().
Plug memory leaks in error returns in chfs_readvnode().
Plug memory leak in error returns and normal operation in
chfs_gcollect_pristine().
Plug memory leak in add_peb_to_free() and add_peb_to_in_use()
in case there's a duplicate in the tree.
 1.12.2.2 28-Aug-2017  skrll Sync with HEAD
 1.12.2.1 06-Apr-2015  skrll Sync with HEAD
 1.14.4.1 21-Apr-2017  bouyer Sync with HEAD
 1.14.2.1 26-Apr-2017  pgoyette Sync with HEAD
 1.15.14.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.15.14.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.17.2.1 17-Jan-2020  ad Sync with head.
 1.3 19-Oct-2012  ttoth CHFS comments
 1.2 10-Aug-2012  ttoth branches: 1.2.2;
chfs bugfix [node was obsoleted twice]
 1.1 24-Nov-2011  ahoka branches: 1.1.6;
Import CHFS, which was formerly known as ChewieFS.

CHFS is a file system for flash devices developed by the
Software Engineering Department at University of Szeged, Hungary.

http://chewiefs.sed.hu/

Thanks for all who made it possible.
 1.1.6.3 30-Oct-2012  yamt sync with head
 1.1.6.2 17-Apr-2012  yamt sync with head
 1.1.6.1 24-Nov-2011  yamt file chfs_vnode_cache.c was added on branch yamt-pagecache on 2012-04-17 00:08:55 +0000
 1.2.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.48 27-Mar-2022  christos add a kauth vnode check for creating links
 1.47 07-Dec-2021  andvar fix various typos, mainly in comments.
 1.46 20-Oct-2021  thorpej Overhaul of the EVFILT_VNODE kevent(2) filter:

- Centralize vnode kevent handling in the VOP_*() wrappers, rather than
forcing each individual file system to deal with it (except VOP_RENAME(),
because VOP_RENAME() is a mess and we currently have 2 different ways
of handling it; at least it's reasonably well-centralized in the "new"
way).
- Add support for NOTE_OPEN, NOTE_CLOSE, NOTE_CLOSE_WRITE, and NOTE_READ,
compatible with the same events in FreeBSD.
- Track which kevent notifications clients are interested in receiving
to avoid doing work for events no one cares about (avoiding, e.g.
taking locks and traversing the klist to send a NOTE_WRITE when
someone is merely watching for a file to be deleted, for example).

In support of the above:

- Add support in vnode_if.sh for specifying PRE- and POST-op handlers,
to be invoked before and after vop_pre() and vop_post(), respectively.
Basic idea from FreeBSD, but implemented differently.
- Add support in vnode_if.sh for specifying CONTEXT fields in the
vop_*_args structures. These context fields are used to convey information
between the file system VOP function and the VOP wrapper, but do not
occupy an argument slot in the VOP_*() call itself. These context fields
are initialized and subsequently interpreted by PRE- and POST-op handlers.
- Version VOP_REMOVE(), uses the a context field for the file system to report
back the resulting link count of the target vnode. Return this in tmpfs,
udf, nfs, chfs, ext2fs, lfs, and ufs.

NetBSD 9.99.92.
 1.45 18-Jul-2021  dholland Use macros for the canned parts of device and fifo vnode op tables.

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

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

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

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

And finally note that the ops declaration tables aren't
order-dependent. (Other than vop_default_desc has to come first.)
Otherwise this wouldn't work.
 1.44 05-Jul-2021  dholland whitespace
 1.43 29-Jun-2021  dholland - Add a new vnode op: VOP_PARSEPATH.
- Move namei_getcomponent to genfs_vnops.c and call it genfs_parsepath.
- Add a parsepath entry to every vnode ops table.

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

Note that the call doesn't take the whole struct componentname, only
the string. The other bits of struct componentname should not be
needed and there's no reason to cause potential complications by
exposing them.
 1.42 05-Sep-2020  riastradh branches: 1.42.6;
Round of uvm.h cleanup.

The poorly named uvm.h is generally supposed to be for uvm-internal
users only.

- Narrow it to files that actually need it -- mostly files that need
to query whether curlwp is the pagedaemon, which should maybe be
exposed by an external header.

- Use uvm_extern.h where feasible and uvm_*.h for things not exposed
by it. We should split up uvm_extern.h but this will serve for now
to reduce the uvm.h dependencies.

- Use uvm_stat.h and #ifdef UVMHIST uvm.h for files that use
UVMHIST(ubchist), since ubchist is declared in uvm.h but the
reference evaporates if UVMHIST is not defined, so we reduce header
file dependencies.

- Make uvm_device.h and uvm_swap.h independently includable while
here.

ok chs@
 1.41 23-May-2020  ad Move proc_lock into the data segment. It was dynamically allocated because
at the time we had mutex_obj_alloc() but not __cacheline_aligned.
 1.40 20-May-2020  christos fix accessx confusion (thanks hannken@)
 1.39 16-May-2020  christos Add ACL support for FFS. From FreeBSD.
 1.38 23-Apr-2020  ad PR kern/54759 (vm.ubc_direct deadlock when read()/write() into mapping of itself)

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

- Rename UBC_UNMAP_FLAG() to UBC_VNODE_FLAGS(). Pass in UBC_ISMAPPED where
appropriate.
 1.37 04-Apr-2020  ad branches: 1.37.2;
Merge the remaining changes from the ad-namecache branch, affecting namei()
and getcwd():

- push vnode locking back as far as possible.
- do most lookups directly in the namecache, avoiding vnode locks & refs.
- don't block new refs to vnodes across VOP_INACTIVE().
- get shared locks for VOP_LOOKUP() if the file system supports it.
- correct lock types for VOP_ACCESS() / VOP_GETATTR() in a few places.

Possible future enhancements:

- make the lookups lockless.
- support dotdot lookups by being lockless and inferring absence of chroot.
- maybe make it work for layered file systems.
- avoid vnode references at the root & cwd.
 1.36 23-Feb-2020  ad UVM locking changes, proposed on tech-kern:

- Change the lock on uvm_object, vm_amap and vm_anon to be a RW lock.
- Break v_interlock and vmobjlock apart. v_interlock remains a mutex.
- Do partial PV list locking in the x86 pmap. Others to follow later.
 1.35 17-Jan-2020  ad VFS_VGET(), VFS_ROOT(), VFS_FHTOVP(): give them a "int lktype" argument, to
allow us to get shared locks (or no lock) on the returned vnode. Matches
FreeBSD.
 1.34 17-Jun-2019  ryoon branches: 1.34.4;
Fix build without DIAGNOSTIC
 1.33 26-May-2017  riastradh branches: 1.33.10;
Make VOP_RECLAIM do the last unlock of the vnode.

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

We can't just have the caller release the last lock because some file
systems don't use genfs_lock, and require the vnode to remain valid
for VOP_UNLOCK to work, notably unionfs.
 1.32 26-Apr-2017  riastradh Change VOP_REMOVE and VOP_RMDIR to preserve lock/ref on dvp.

No change to vp -- the plan is to replace the node by the
componentname in the vop parameters, and let all directory vops do
lookups internally.

Proposed on tech-kern with no objections:
https://mail-index.netbsd.org/tech-kern/2017/04/17/msg021825.html
 1.31 11-Apr-2017  riastradh Make VOP_INACTIVE preserve vnode lock on return.

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

Ride 7.99.68, a bumpy bus of incremental vfs improvements!
 1.30 30-Mar-2017  hannken Remove now redundant calls to fstrans_start()/fstrans_done().
 1.29 20-Aug-2016  hannken branches: 1.29.2;
Remove now obsolete operation vcache_remove().

Welcome to 7.99.36
 1.28 20-Apr-2015  riastradh branches: 1.28.2;
Make VOP_LINK return directory still locked and referenced.

Ride 7.99.10 bump.
 1.27 28-Mar-2015  maxv Remove the 'cred' argument from bread(). Remove a now unused var in
ffs_snapshot.c. Update the man page accordingly.

ok hannken@
 1.26 28-Mar-2015  maxv Remove the 'cred' argument from breadn(), and update the man page
accordingly.

ok hannken@
 1.25 27-Mar-2015  riastradh Disentangle buffer-cached I/O from page-cached I/O in UFS.

Page-cached I/O is used for regular files, and is initiated by VFS
users such as userland and NFS.

Buffer-cached I/O is used for directories and symlinks, and is issued
only internally by UFS.

New UFS routine ufs_bufio replaces vn_rdwr for internal use.
ufs_bufio is implemented by new UFS operations uo_bufrd/uo_bufwr,
which sit in ufs_readwrite.c alongside the VOP_READ/VOP_WRITE
implementations.

I preserved the code as much as possible and will leave further
simplification for future commits. I kept the ulfs_readwrite.c
copypasta close to ufs_readwrite.c in case we ever want to merge them
back; likewise ext2fs_readwrite.c.

No externally visible semantic change. All atf fs tests still pass.
 1.24 11-Jan-2015  hannken Change chfs from hashlist to vcache.
 1.23 11-Jan-2015  hannken Return immediately from successfull cache_lookup().
No need to unlock an unlocked vnode.
 1.22 25-Jul-2014  dholland branches: 1.22.4;
Add VOP_FALLOCATE and VOP_FDISCARD to every vnode ops table I can
find.

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

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

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

Discussed on tech-kern@

Welcome to 6.99.31
 1.20 23-Jan-2014  hannken Change vnode operations create, mknod, mkdir and symlink to return
the resulting vnode *vpp unlocked.

Discussed on tech-kern@

Welcome to 6.99.30
 1.19 17-Jan-2014  hannken Change vnode operations create, mknod, mkdir and symlink to keep the
directory node dvp locked on return.

Discussed on tech-kern@

Welcome to 6.99.29
 1.18 20-Oct-2013  christos remove unused
 1.17 23-Jun-2013  dholland branches: 1.17.2;
Stick ffs_, ext2_, chfs_, filecore_, cd9660_, or mfs_ in front of
the following symbols so as to disambiguate fully. (Christos already
did the lfs ones.)

lblkno
lblktosize
lfragtosize
numfrags
blkroundup
fragroundup
 1.16 19-Jun-2013  dholland blkoff -> chfs_blkoff
blksize -> chfs_blksize
 1.15 18-Mar-2013  plunky C99 section 6.7.2.3 (Tags) Note 3 states that:

A type specifier of the form

enum identifier

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

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

(ok elad@)
 1.14 22-Jan-2013  dholland Stuff UFS_ in front of a few of ufs's symbols to reduce namespace
pollution. Specifically:
ROOTINO -> UFS_ROOTINO
WINO -> UFS_WINO
NXADDR -> UFS_NXADDR
NDADDR -> UFS_NDADDR
NIADDR -> UFS_NIADDR
MAXSYMLINKLEN -> UFS_MAXSYMLINKLEN
MAXSYMLINKLEN_UFS[12] -> UFS[12]_MAXSYMLINKLEN (for consistency)

Sort out ext2fs's misuse of NDADDR and NIADDR; fortunately, these have
the same values in ext2fs and ffs.

No functional change intended.
 1.13 05-Nov-2012  dholland Excise struct componentname from the namecache.

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

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

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

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

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

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

This change requires a kernel bump.
 1.11 19-Oct-2012  ttoth CHFS comments
 1.10 23-Aug-2012  ttoth branches: 1.10.2;
chfs: uappnd flag patch
 1.9 10-Aug-2012  ttoth chfs bugfix [node was obsoleted twice]
 1.8 22-Jul-2012  rmind Move some the test for MAKEENTRY into the cache_enter(9). Make some
variables in vfs_cache.c static, __read_mostly, etc.

No objection on tech-kern@.
 1.7 29-Apr-2012  chs change vflushbuf() to take the full FSYNC_* flags.
translate FSYNC_LAZY into PGO_LAZY for VOP_PUTPAGES() so that
genfs_do_io() can set the appropriate io priority for the I/O.
this is the first part of addressing PR 46325.
 1.6 18-Apr-2012  joerg Don't depend on implicit enum casts, be explicit.
 1.5 17-Apr-2012  christos it is not an error if the kernel needs to clear the setuid/
setgid bit on write/chown/chgrp
 1.4 12-Apr-2012  ttoth branches: 1.4.2;
using chtype on media instead of vtype
debug.c deleted
 1.3 13-Mar-2012  elad Replace the remaining KAUTH_GENERIC_ISSUSER authorization calls with
something meaningful. All relevant documentation has been updated or
written.

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

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

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

Huge thanks to pgoyette for spinning these changes through some build
cycles and ATF.
 1.2 24-Nov-2011  agc branches: 1.2.2; 1.2.4;
quick workaround to make this compile, with thanks to Hisashi Fujinaka for the
nudge.
 1.1 24-Nov-2011  ahoka Import CHFS, which was formerly known as ChewieFS.

CHFS is a file system for flash devices developed by the
Software Engineering Department at University of Szeged, Hungary.

http://chewiefs.sed.hu/

Thanks for all who made it possible.
 1.2.4.2 12-Aug-2012  martin Pull up following revision(s) (requested by manu in ticket #484):
sys/fs/nilfs/nilfs_vnops.c: revision 1.18
sys/ufs/ufs/ufs_lookup.c: revision 1.117
sys/nfs/nfs_vnops.c: revision 1.295
sys/ufs/chfs/chfs_vnops.c: revision 1.8
sys/ufs/ext2fs/ext2fs_lookup.c: revision 1.70
sys/fs/unionfs/unionfs_vnops.c: revision 1.6
sys/kern/vfs_cache.c: revision 1.89
sys/fs/efs/efs_vnops.c: revision 1.26
sys/fs/hfs/hfs_vnops.c: revision 1.26
sys/fs/adosfs/adlookup.c: revision 1.16
sys/fs/puffs/puffs_vnops.c: revision 1.168
sys/fs/tmpfs/tmpfs_vnops.c: revision 1.98
sys/fs/ntfs/ntfs_vnops.c: revision 1.52
sys/fs/cd9660/cd9660_lookup.c: revision 1.20
sys/fs/msdosfs/msdosfs_lookup.c: revision 1.24
sys/fs/smbfs/smbfs_vnops.c: revision 1.80
sys/fs/udf/udf_vnops.c: revision 1.72
sys/fs/filecorefs/filecore_lookup.c: revision 1.14
sys/fs/puffs/puffs_node.c: revision 1.25
Move some the test for MAKEENTRY into the cache_enter(9). Make some
variables in vfs_cache.c static, __read_mostly, etc.
No objection on tech-kern@.
 1.2.4.1 07-May-2012  riz Pull up following revision(s) (requested by chs in ticket #204):
sys/fs/sysvbfs/sysvbfs_vnops.c: revision 1.44
sys/ufs/ffs/ffs_vfsops.c: revision 1.277
sys/fs/v7fs/v7fs_vnops.c: revision 1.11
sys/ufs/chfs/chfs_vnops.c: revision 1.7
sys/ufs/ext2fs/ext2fs_readwrite.c: revision 1.61
sys/miscfs/genfs/genfs_io.c: revision 1.54
sys/kern/vfs_wapbl.c: revision 1.52
sys/uvm/uvm_pager.h: revision 1.43
sys/ufs/ffs/ffs_vnops.c: revision 1.121
sys/kern/vfs_subr.c: revision 1.434
sys/fs/msdosfs/msdosfs_vnops.c: revision 1.83
sys/fs/ntfs/ntfs_vnops.c: revision 1.51
sys/fs/udf/udf_subr.c: revision 1.119
sys/miscfs/specfs/spec_vnops.c: revision 1.135
sys/ufs/ext2fs/ext2fs_vnops.c: revision 1.103
sys/fs/udf/udf_vnops.c: revision 1.71
sys/ufs/ufs/ufs_readwrite.c: revision 1.104
change vflushbuf() to take the full FSYNC_* flags.
translate FSYNC_LAZY into PGO_LAZY for VOP_PUTPAGES() so that
genfs_do_io() can set the appropriate io priority for the I/O.
this is the first part of addressing PR 46325.
mark all wapbl I/O as BPRIO_TIMECRITICAL.
this is the second part of addressing PR 46325.
 1.2.2.3 02-Jun-2012  mrg sync to latest -current.
 1.2.2.2 29-Apr-2012  mrg sync to latest -current.
 1.2.2.1 05-Apr-2012  mrg sync to latest -current.
 1.4.2.7 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.4.2.6 23-Jan-2013  yamt sync with head
 1.4.2.5 16-Jan-2013  yamt sync with (a bit old) head
 1.4.2.4 30-Oct-2012  yamt sync with head
 1.4.2.3 23-May-2012  yamt sync with head.
 1.4.2.2 17-Apr-2012  yamt sync with head
 1.4.2.1 12-Apr-2012  yamt file chfs_vnops.c was added on branch yamt-pagecache on 2012-04-17 00:08:55 +0000
 1.10.2.5 03-Dec-2017  jdolecek update from HEAD
 1.10.2.4 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.10.2.3 23-Jun-2013  tls resync from head
 1.10.2.2 25-Feb-2013  tls resync with head
 1.10.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.17.2.1 18-May-2014  rmind sync with head
 1.21.2.1 10-Aug-2014  tls Rebase.
 1.22.4.4 28-Aug-2017  skrll Sync with HEAD
 1.22.4.3 05-Oct-2016  skrll Sync with HEAD
 1.22.4.2 06-Jun-2015  skrll Sync with HEAD
 1.22.4.1 06-Apr-2015  skrll Sync with HEAD
 1.28.2.1 26-Apr-2017  pgoyette Sync with HEAD
 1.29.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.33.10.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.33.10.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.34.4.3 29-Feb-2020  ad Sync with head.
 1.34.4.2 19-Jan-2020  ad Set IMNT_SHRLOOKUP and use it for the in-cache case. Need to check what
more can be done with tmpfs though, it can probably do the whole lookup.
 1.34.4.1 17-Jan-2020  ad Sync with head.
 1.37.2.1 25-Apr-2020  bouyer Sync with bouyer-xenpvh-base2 (HEAD)
 1.42.6.1 01-Aug-2021  thorpej Sync with HEAD.
 1.7 18-Oct-2014  snj src is too big these days to tolerate superfluous apostrophes. It's
"its", people!
 1.6 25-Jan-2014  skrll More alignment spellos
 1.5 19-Oct-2012  ttoth branches: 1.5.2;
CHFS comments
 1.4 16-Jan-2012  ahoka branches: 1.4.4; 1.4.8;
use enum instead of macros
add some input validation
cleanup
 1.3 16-Jan-2012  ahoka cleanup macros
 1.2 24-Nov-2011  agc branches: 1.2.2;
quick workaround for compilation bug on amd64
 1.1 24-Nov-2011  ahoka Import CHFS, which was formerly known as ChewieFS.

CHFS is a file system for flash devices developed by the
Software Engineering Department at University of Szeged, Hungary.

http://chewiefs.sed.hu/

Thanks for all who made it possible.
 1.2.2.1 18-Feb-2012  mrg merge to -current.
 1.4.8.3 03-Dec-2017  jdolecek update from HEAD
 1.4.8.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.8.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.4.4.4 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.4.4.3 30-Oct-2012  yamt sync with head
 1.4.4.2 17-Apr-2012  yamt sync with head
 1.4.4.1 16-Jan-2012  yamt file chfs_wbuf.c was added on branch yamt-pagecache on 2012-04-17 00:08:55 +0000
 1.5.2.1 18-May-2014  rmind sync with head
 1.7 07-Dec-2021  andvar fix various typos, mainly in comments.
 1.6 19-Jul-2021  andvar Release mutexes in few more places on failure path. Reviewed them in chfs code after fixing PR kern/56242.
ok riastradh
 1.5 19-Oct-2012  ttoth branches: 1.5.54;
CHFS comments
 1.4 10-Aug-2012  ttoth branches: 1.4.2;
chfs bugfix [node was obsoleted twice]
 1.3 12-Apr-2012  ttoth branches: 1.3.2;
using chtype on media instead of vtype
debug.c deleted
 1.2 24-Nov-2011  agc branches: 1.2.2;
quick workaround to make this compile, with thanks to Hisashi Fujinaka for the
nudge.
 1.1 24-Nov-2011  ahoka Import CHFS, which was formerly known as ChewieFS.

CHFS is a file system for flash devices developed by the
Software Engineering Department at University of Szeged, Hungary.

http://chewiefs.sed.hu/

Thanks for all who made it possible.
 1.2.2.1 29-Apr-2012  mrg sync to latest -current.
 1.3.2.3 30-Oct-2012  yamt sync with head
 1.3.2.2 17-Apr-2012  yamt sync with head
 1.3.2.1 12-Apr-2012  yamt file chfs_write.c was added on branch yamt-pagecache on 2012-04-17 00:08:55 +0000
 1.4.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.5.54.1 01-Aug-2021  thorpej Sync with HEAD.
 1.2 12-Apr-2012  ttoth using chtype on media instead of vtype
debug.c deleted
 1.1 24-Nov-2011  ahoka branches: 1.1.2;
Import CHFS, which was formerly known as ChewieFS.

CHFS is a file system for flash devices developed by the
Software Engineering Department at University of Szeged, Hungary.

http://chewiefs.sed.hu/

Thanks for all who made it possible.
 1.1.2.1 29-Apr-2012  mrg sync to latest -current.
 1.2 12-Apr-2012  ttoth branches: 1.2.2;
using chtype on media instead of vtype
debug.c deleted
 1.1 24-Nov-2011  ahoka branches: 1.1.2;
Import CHFS, which was formerly known as ChewieFS.

CHFS is a file system for flash devices developed by the
Software Engineering Department at University of Szeged, Hungary.

http://chewiefs.sed.hu/

Thanks for all who made it possible.
 1.1.2.1 29-Apr-2012  mrg sync to latest -current.
 1.2.2.2 17-Apr-2012  yamt sync with head
 1.2.2.1 12-Apr-2012  yamt file debug.h was added on branch yamt-pagecache on 2012-04-17 00:08:55 +0000
 1.11 08-Jan-2025  andvar s/eraseing/erasing/ and couple more typos in debug messages and comments.
 1.10 30-Dec-2022  andvar branches: 1.10.6;
s/succes/success/ in comments.
 1.9 07-Dec-2021  andvar fix various typos, mainly in comments.
 1.8 09-Aug-2021  andvar s/fist/first/
 1.7 07-Feb-2018  ozaki-r Remove unnecessary assertions

KASSERT(!rw_lock_held()) just before rw_destroy() is useless because
rw_destroy does more strict check and provides better information on
failure.
 1.6 07-Feb-2015  christos fix leak. Reported by:
http://www.m00nbsd.net/ae123a9bae03f7dde5c6d654412daf5a.html#Report-4
 1.5 18-Oct-2014  snj branches: 1.5.2;
src is too big these days to tolerate superfluous apostrophes. It's
"its", people!
 1.4 01-Sep-2014  he Plug memory leak in add_peb_to_free() and add_peb_to_in_use()
in case there's a duplicate in the tree.
 1.3 10-Aug-2012  ttoth branches: 1.3.2; 1.3.14;
chfs bugfix [node was obsoleted twice]
 1.2 25-Nov-2011  ahoka branches: 1.2.6;
Don't shadow some stupid function defined globally in random platforms.
 1.1 24-Nov-2011  ahoka Import CHFS, which was formerly known as ChewieFS.

CHFS is a file system for flash devices developed by the
Software Engineering Department at University of Szeged, Hungary.

http://chewiefs.sed.hu/

Thanks for all who made it possible.
 1.2.6.3 30-Oct-2012  yamt sync with head
 1.2.6.2 17-Apr-2012  yamt sync with head
 1.2.6.1 25-Nov-2011  yamt file ebh.c was added on branch yamt-pagecache on 2012-04-17 00:08:55 +0000
 1.3.14.2 16-Feb-2015  martin Pull up following revision(s) (requested by maxv in ticket #520):
sys/ufs/chfs/ebh.c: revision 1.6
sys/dev/sdmmc/sdmmc_mem.c: revision 1.33
sys/dev/ic/aic7xxx.c: revision 1.132
sys/fs/nfs/common/krpc_subr.c: revision 1.2
sys/modules/lua/lua.c: revision 1.16
sys/fs/udf/udf_subr.c: revision 1.128
sys/ufs/chfs/chfs_scan.c: revision 1.6
sys/dev/ic/an.c: revision 1.62

Fix six memory leaks and two inconsistencies.
 1.3.14.1 08-Sep-2014  msaitoh Pull up following revision(s) (requested by he in ticket #74):
sys/ufs/chfs/chfs_vnode.c: revision 1.11
sys/ufs/chfs/chfs_readinode.c: revision 1.9
sys/ufs/chfs/chfs_scan.c: revision 1.5
sys/ufs/chfs/chfs_gc.c: revision 1.6
sys/ufs/chfs/ebh.c: revision 1.4
Plug leak in chfs_scan_eraseblock() of the allocated buffer.
Make sure to release it both on success and failure returns.
OK'ed by ttoth@
Plug memory leak in a corner case in chfs_get_data_nodes().
Plug memory leaks in error returns in chfs_readvnode().
Plug memory leak in error returns and normal operation in
chfs_gcollect_pristine().
Plug memory leak in add_peb_to_free() and add_peb_to_in_use()
in case there's a duplicate in the tree.
 1.3.2.1 03-Dec-2017  jdolecek update from HEAD
 1.5.2.1 06-Apr-2015  skrll Sync with HEAD
 1.10.6.1 02-Aug-2025  perseant Sync with HEAD
 1.5 08-Jan-2025  andvar s/eraseing/erasing/ and couple more typos in debug messages and comments.
 1.4 06-Aug-2016  dholland branches: 1.4.52;
typo in comment
 1.3 19-Oct-2012  ttoth branches: 1.3.14;
CHFS comments
 1.2 13-Apr-2012  ttoth branches: 1.2.2; 1.2.4;
prepare for chfs's makefs
 1.1 24-Nov-2011  ahoka branches: 1.1.2;
Import CHFS, which was formerly known as ChewieFS.

CHFS is a file system for flash devices developed by the
Software Engineering Department at University of Szeged, Hungary.

http://chewiefs.sed.hu/

Thanks for all who made it possible.
 1.1.2.1 29-Apr-2012  mrg sync to latest -current.
 1.2.4.2 03-Dec-2017  jdolecek update from HEAD
 1.2.4.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.2.2.3 30-Oct-2012  yamt sync with head
 1.2.2.2 17-Apr-2012  yamt sync with head
 1.2.2.1 13-Apr-2012  yamt file ebh.h was added on branch yamt-pagecache on 2012-04-17 00:08:55 +0000
 1.3.14.1 05-Oct-2016  skrll Sync with HEAD
 1.4.52.1 02-Aug-2025  perseant Sync with HEAD
 1.2 16-Sep-2021  andvar fix typos in word "successfully", mainly s/succesfully/successfully/.
 1.1 24-Nov-2011  ahoka branches: 1.1.6;
Import CHFS, which was formerly known as ChewieFS.

CHFS is a file system for flash devices developed by the
Software Engineering Department at University of Szeged, Hungary.

http://chewiefs.sed.hu/

Thanks for all who made it possible.
 1.1.6.2 17-Apr-2012  yamt sync with head
 1.1.6.1 24-Nov-2011  yamt file ebh_media.h was added on branch yamt-pagecache on 2012-04-17 00:08:55 +0000
 1.2 19-Oct-2012  ttoth CHFS comments
 1.1 24-Nov-2011  ahoka branches: 1.1.6; 1.1.10;
Import CHFS, which was formerly known as ChewieFS.

CHFS is a file system for flash devices developed by the
Software Engineering Department at University of Szeged, Hungary.

http://chewiefs.sed.hu/

Thanks for all who made it possible.
 1.1.10.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.1.6.3 30-Oct-2012  yamt sync with head
 1.1.6.2 17-Apr-2012  yamt sync with head
 1.1.6.1 24-Nov-2011  yamt file ebh_misc.h was added on branch yamt-pagecache on 2012-04-17 00:08:55 +0000
 1.3 11-Aug-2021  andvar s/enrty/entry/
 1.2 19-Oct-2012  ttoth CHFS comments
 1.1 24-Nov-2011  ahoka branches: 1.1.6; 1.1.10;
Import CHFS, which was formerly known as ChewieFS.

CHFS is a file system for flash devices developed by the
Software Engineering Department at University of Szeged, Hungary.

http://chewiefs.sed.hu/

Thanks for all who made it possible.
 1.1.10.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.1.6.3 30-Oct-2012  yamt sync with head
 1.1.6.2 17-Apr-2012  yamt sync with head
 1.1.6.1 24-Nov-2011  yamt file media.h was added on branch yamt-pagecache on 2012-04-17 00:08:55 +0000

RSS XML Feed