History log of /netbsd-current/sys/fs/msdosfs/msdosfs_vnops.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.112 18-Aug-2023 mrg

fix the previous to not fail to include the extension in lookups.

copy deExtension into the final 3 bytes. previously, this was found
by having them next to each other in the containing structure, but as
separate strings.

thanks to miod for pointing this out.


# 1.111 14-Aug-2023 mrg

when calling a function that needs more bytes than we have, create a
stack variable long enough and use that instead.

found by GCC 12.


Revision tags: netbsd-10-base bouyer-sunxi-drm-base
# 1.110 23-Oct-2021 thorpej

Sanitize the symbol namespace. NFC.


# 1.109 23-Oct-2021 hannken

Move msdosfs_rename() and doscheckpath() to new file msdosfs_rename.c.

No functional change.


# 1.108 23-Oct-2021 hannken

Factor out the lookup results from struct denode.

No functional change.


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


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base thorpej-i2c-spi-conf-base
# 1.106 18-Jul-2021 dholland

Abolish all the silly indirection macros for initializing vnode ops tables.

These are things of the form #define foofs_op genfs_op, or #define
foofs_op genfs_eopnotsupp, or similar. They serve no purpose besides
obfuscation, and have gotten cutpasted all over everywhere.


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


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-cfargs-base thorpej-futex-base
# 1.104 27-Jun-2020 christos

branches: 1.104.6;
Introduce genfs_pathconf() and use it for the default case in all filesystems.


# 1.103 16-May-2020 christos

Add ACL support for FFS. From FreeBSD.


Revision tags: bouyer-xenpvh-base2
# 1.102 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.


Revision tags: phil-wifi-20200421 bouyer-xenpvh-base1
# 1.101 13-Apr-2020 ad

Replace most uses of vp->v_usecount with a call to vrefcnt(vp), a function
that hides the details and does atomic_load_relaxed(). Signature matches
FreeBSD.


Revision tags: phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3
# 1.100 23-Feb-2020 ad

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


Revision tags: ad-namecache-base2 ad-namecache-base1 ad-namecache-base phil-wifi-20191119
# 1.99 18-Sep-2019 christos

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


Revision tags: netbsd-9-3-RELEASE netbsd-9-2-RELEASE netbsd-9-1-RELEASE netbsd-8-2-RELEASE netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 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
# 1.98 26-Apr-2017 riastradh

branches: 1.98.12;
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


Revision tags: pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320
# 1.97 01-Mar-2017 hannken

Remove now redundant calls to fstrans_start()/fstrans_done().


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
# 1.96 01-Feb-2016 christos

branches: 1.96.2; 1.96.4;
- split a long line.
- remove extra test.
- move d_namlen setting to msdosfs_vnops.c to avoid the ifdef.


# 1.95 01-Feb-2016 christos

We can't depend on dp->d_namlen existing for the parts that are used in
makefs(8).


# 1.94 30-Jan-2016 mlelstv

Add support to msdosfs and makefs to generate correct Unicode (UCS-2) directory
entries from UTF8 encoded file names.


Revision tags: nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606 nick-nhusb-base-20150406
# 1.93 04-Apr-2015 riastradh

Fix remaining read(fd, NULL, 1) cases.


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


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 tls-earlyentropy-base tls-maxphys-base
# 1.91 25-Jul-2014 dholland

branches: 1.91.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.90 08-Jul-2014 hannken

Change msdosfs from hashlist to vcache:
- Use (dir_cluster, dir_offset, dir_generation) as key, where
dir_generation is non-zero and unique for unlinked but open nodes.
- Change deget() to return a vnode as it is unsafe to return a
referenced but unlocked denode.


Revision tags: yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 rmind-smpnet-nbase rmind-smpnet-base
# 1.89 23-Jan-2014 hannken

branches: 1.89.2;
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.88 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.87 02-Nov-2013 hannken

Stop using v_mount of an unreferenced vnode -- save the mount while
the vnode has a reference.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base
# 1.86 18-Mar-2013 plunky

branches: 1.86.6;
C99 section 6.7.2.3 (Tags) Note 3 states that:

A type specifier of the form

enum identifier

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

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

(ok elad@)


Revision tags: yamt-pagecache-base8
# 1.85 28-Dec-2012 hannken

Move the initialization of n to after the error branch.

From Taylor R Campbell <riastradh@netbsd.org>


# 1.84 20-Dec-2012 hannken

Change bread() and breadn() to never return a buffer on
error and modify all callers to not brelse() on error.

Welcome to 6.99.16

PR kern/46282 (6.0_BETA crash: msdosfs_bmap -> pcbmap -> bread -> bio_doread)


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6 jmcneill-usbmp-base10 yamt-pagecache-base5
# 1.83 29-Apr-2012 chs

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


Revision tags: jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8
# 1.82 03-Apr-2012 njoly

Add missing braces in previous commit.


# 1.81 02-Apr-2012 njoly

Report the SF_ARCHIVED file flag if set.


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


Revision tags: 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
# 1.79 21-Nov-2011 hannken

branches: 1.79.2; 1.79.4;
Add missing fstrans_done().

Should fix PR #45635 (KASSERT "fli->fli_trans_cnt == 0" failed)


Revision tags: jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.78 20-Jul-2011 hannken

branches: 1.78.2;
Even though msdosfs never truncates file names it advertises _PC_NO_TRUNC
as zero. Make it advertise one (no_trunc == true).

Names longer than NAME_MAX (255) will never pass namei() btw.

Fixes PR #43670 (msdosfs claims support for filenames longer than {NAME_MAX},
but fails)


# 1.77 16-Jun-2011 hannken

Rename uvm_vnp_zerorange(struct vnode *, off_t, size_t) to
ubc_zerorange(struct uvm_object *, off_t, size_t, int) changing
the first argument to an uvm_object and adding a flags argument.

Modify tmpfs_reg_resize() to zero the backing store (aobj) instead
of the vnode. Ubc_purge() no longer panics when unmounting tmpfs.

Keep uvm_vnp_zerorange() until the next kernel version bump.


# 1.76 12-Jun-2011 rmind

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 rmind-uvmplock-base
# 1.75 26-Apr-2011 hannken

branches: 1.75.2;
Change vflushbuf() to return an error if a synchronous write fails.

Welcome to 5.99.51.


# 1.74 20-Mar-2011 hannken

When extending a file, either by truncating or by writing past EOF make
sure the unallocated remainder of the last page gets zeroed.

Detected by fsx.


# 1.73 19-Mar-2011 hannken

Remove a vnode reference leak from msdosfs_rename. Release tdvp if either
doscheckpath() or relookup() fails.

Adjust test fs/vfs/t_vnops.c and remove the link count test for msdos.

Fixes PR #44661


Revision tags: bouyer-quota2-nbase
# 1.72 03-Mar-2011 pooka

In rename, use char[12]�for new names instead of [11]. At least
one routine called from here (unix2dosfn) expects and uses all of
a [12].

This may fix the "stack size exceeded" problem which has been
triggering in gson's test runs. (i'm not entirely sure why it
doesn't trigger in anyone else's env)


Revision tags: bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231
# 1.71 02-Jan-2011 dholland

branches: 1.71.2; 1.71.4;
Remove the special refcount behavior (adding an extra reference to the
parent dir) associated with SAVESTART in relookup().

Check all call sites to make sure that SAVESTART wasn't set while
calling relookup(); if it was, adjust the refcount behavior. Remove
related references to SAVESTART.

The only code that was reaching the extra ref was msdosfs_rename,
where the refcount behavior was already fairly broken and/or gross;
repair it.

Add a dummy 4th argument to relookup to make sure code that hasn't
been inspected won't compile. (This will go away next time the
relookup semantics change, which they will.)


# 1.70 30-Nov-2010 dholland

Abolish the SAVENAME and HASBUF flags. There is now always a buffer,
so the path in a struct componentname is now always valid during VOP
calls.


# 1.69 30-Nov-2010 dholland

Abolish struct componentname's cn_pnbuf. Use the path buffer in the
pathbuf object passed to namei as work space instead. (For now a pnbuf
pointer appears in struct nameidata, to support certain unclean things
that haven't been fixed yet, but it will be going away in the future.)

This removes the need for the SAVENAME and HASBUF namei flags.


Revision tags: uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.68 22-Jul-2010 njoly

Remove bad cast, fix compilation with MSDOSFS_DEBUG.


# 1.67 24-Jun-2010 hannken

Clean up vnode lock operations pass 2:

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

Welcome to 5.99.32.

Discussed on tech-kern.


# 1.66 25-May-2010 pooka

Don't double unlock fvp if source file disappears during rename.
Problem found by njoly's awesome stresstester.


Revision tags: uebayasi-xip-base1
# 1.65 23-Apr-2010 pooka

Enforce RLIMIT_FSIZE before VOP_WRITE. This adds support to file
system drivers where it was missing from and fixes one buggy
implementation. The arguably weird semantics of the check are
maintained (v_size vs. va_bytes, overwrite).


# 1.64 09-Apr-2010 hannken

Add file system suspension support (vfs_suspend(9)) to msdosfs.

Reviewed by: Antti Kantee <pooka@netbsd.org>


# 1.63 08-Apr-2010 pooka

In genfs where available.

The only functional change is mknod now returning EOPNOTSUPP instead
of EINVAL. I make this sacrifice willingly and with a clean conscience.


# 1.62 08-Apr-2010 pooka

Use genfs instead of homegrown stuff where possible.


Revision tags: yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211 yamt-nfs-mp-base8 yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 jym-xensuspend-nbase
# 1.61 03-Jul-2009 elad

branches: 1.61.2; 1.61.4;
Where possible, extract the file-system's access() routine to two internal
functions: the first checking if the operation is possible (regardless of
permissions), the second checking file-system permissions, ACLs, etc.

Mailing list reference:

http://mail-index.netbsd.org/tech-kern/2009/06/21/msg005311.html


# 1.60 23-Jun-2009 elad

Move the implementation of vaccess() to genfs_can_access(), in line with
the other routines of the same spirit.

Adjust file-system code to use it.

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

No objections on tech-kern@:

http://mail-index.netbsd.org/tech-kern/2009/06/21/msg005310.html


Revision tags: yamt-nfs-mp-base5 yamt-nfs-mp-base4 jym-xensuspend-base
# 1.59 07-May-2009 elad

Extract the open-coded authorization logic for chtimes() from various
file-systems and put it in a single function, genfs_can_chtimes().

This also makes UDF follow the same policy as all other file-systems.

Mailing list reference:

http://mail-index.netbsd.org/tech-kern/2009/04/27/msg004951.html


Revision tags: yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.58 14-Mar-2009 dsl

ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.


Revision tags: nick-hppapmap-base2 mjf-devfs2-base
# 1.57 11-Jan-2009 cegger

branches: 1.57.2;
make this compile


# 1.56 11-Jan-2009 christos

merge christos-time_t


Revision tags: haad-dm-base2 haad-nbase2 ad-audiomp2-base christos-time_t-nbase christos-time_t-base haad-dm-base
# 1.55 28-Nov-2008 pooka

Tyop: v -> vp. Spotted by Tom's ARM builds.


# 1.54 26-Nov-2008 pooka

Rototill all remaining file systems to use ubc_uiomove() instead
of the ubc_alloc() - uiomove() - ubc_release() dance.


# 1.53 14-Nov-2008 pooka

In case writing past EOF, fail if extending the file fails (most
likely due to the file system being full).

Otherwise we'd fail in VOP_PUTPAGES(), which might not happen during
VOP_WRITE(), thus giving the caller the wrong impression that
writing was succesful.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE 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 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 wrstuden-revivesa-base
# 1.52 16-May-2008 hannken

branches: 1.52.4; 1.52.6; 1.52.10;
Make sure all cached buffers with valid, not yet written data have been
run through copy-on-write. Call fscow_run() with valid data where possible.

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

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

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

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

Welcome to 4.99.63

Reviewed by: YAMAMOTO Takashi <yamt@netbsd.org>


Revision tags: yamt-nfs-mp-base2
# 1.51 30-Apr-2008 ad

branches: 1.51.2;
Make various bits of debug code compile again.


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

branches: 1.50.2;
Network protocol interrupts can now block on locks, so merge the globals
proclist_mutex and proclist_lock into a single adaptive mutex (proc_lock).
Implications:

- Inspecting process state requires thread context, so signals can no longer
be sent from a hardware interrupt handler. Signal activity must be
deferred to a soft interrupt or kthread.

- As the proc state locking is simplified, it's now safe to take exit()
and wait() out from under kernel_lock.

- The system spends less time at IPL_SCHED, and there is less lock activity.


Revision tags: yamt-pf42-baseX yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase nick-net80211-sync-base keiichi-mipv6-base matt-armv6-nbase mjf-devfs-base hpcarm-cleanup-base
# 1.49 30-Jan-2008 ad

branches: 1.49.6; 1.49.8;
Replace struct lock on vnodes with a simpler lock object built on
krwlock_t. This is a step towards removing lockmgr and simplifying
vnode locking. Discussed on tech-kern.


# 1.48 25-Jan-2008 ad

Remove VOP_LEASE. Discussed on tech-kern.


Revision tags: bouyer-xeni386-nbase bouyer-xeni386-base matt-armv6-base
# 1.47 05-Jan-2008 christos

PR/37696: Paul Ripke: add large read / readahead support (Introduce run-length
detection to msdosfs_bmap(), from FreeBSD)


# 1.46 02-Jan-2008 ad

Merge vmlocking2 to head.


# 1.45 28-Dec-2007 reinoud

Use uvm_vnp_setwritesize() on file extending to instruct UVM to NOT read-in
the newly added space first. This significantly speeds up write speed for
msdosfs and making it at par with ffs wich already had this patched.

Speed increase measured on my IDE disc from 2Mb/sec to 32 Mb/sec


Revision tags: vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 vmlocking-nbase jmcneill-pm-base reinoud-bufcleanup-base
# 1.44 26-Nov-2007 pooka

branches: 1.44.2; 1.44.6;
Remove the "struct lwp *" argument from all VFS and VOP interfaces.
The general trend is to remove it from all kernel interfaces and
this is a start. In case the calling lwp is desired, curlwp should
be used.

quick consensus on tech-kern


Revision tags: bouyer-xenamd64-base2 bouyer-xenamd64-base
# 1.43 14-Nov-2007 pooka

Fix a problem noticed by Reinoud: the fs would try to release an
unlocked vnode when trying to rename a directory. The fix was to
shuffle some bits around and #pray.

The rename routine actually needs a very very major wide-angle whopping:
* it takes locks out-of-order
* it deals with references from SAVESTART lookups in interesting ways
* I doubt there is any guarantee for correct operation if there
are multiple concurrent accesses
* the error branches might just as well call panic() directly


Revision tags: jmcneill-base yamt-x86pmap-base4 yamt-x86pmap-base3 vmlocking-base
# 1.42 08-Oct-2007 ad

branches: 1.42.2; 1.42.4;
Merge brelse() changes from the vmlocking branch.


Revision tags: yamt-x86pmap-base2
# 1.41 24-Sep-2007 rumble

Avoid stack allocation of large dirent structures in foo_readdir().


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base matt-mips64-base
# 1.40 29-Jul-2007 rumble

branches: 1.40.4; 1.40.6; 1.40.8; 1.40.10;
Use _DIRENT_MINSIZE when determining the number of NFS cookies to allocate,
rather than hard-coding 16.


Revision tags: nick-csl-alignment-base yamt-idlelwp-base8 mjf-ufs-trans-base
# 1.39 19-Apr-2007 yamt

branches: 1.39.2;
hold proclist_mutex when calling psignal().


Revision tags: thorpej-atomic-base
# 1.38 04-Mar-2007 christos

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


Revision tags: ad-audiomp-base
# 1.37 21-Feb-2007 thorpej

Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.


Revision tags: post-newlock2-merge newlock2-nbase newlock2-base
# 1.36 04-Jan-2007 elad

branches: 1.36.2;
Consistent usage of KAUTH_GENERIC_ISSUSER.


Revision tags: yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3
# 1.35 09-Dec-2006 chs

a smorgasbord of improvements to vnode locking and path lookup:
- LOCKPARENT is no longer relevant for lookup(), relookup() or VOP_LOOKUP().
these now always return the parent vnode locked. namei() works as before.
lookup() and various other paths no longer acquire vnode locks in the
wrong order via vrele(). fixes PR 32535.
as a nice side effect, path lookup is also up to 25% faster.
- the above allows us to get rid of PDIRUNLOCK.
- also get rid of WANTPARENT (just use LOCKPARENT and unlock it).
- remove an assumption in layer_node_find() that all file systems implement
a recursive VOP_LOCK() (unionfs doesn't).
- require that all file systems supply vfs_vptofh and vfs_fhtovp routines.
fill in eopnotsupp() for file systems that don't support being exported
and remove the checks for NULL. (layerfs calls these without checking.)
- in union_lookup1(), don't change refcounts in the ISDOTDOT case, just
adjust which vnode is locked. fixes PR 33374.
- apply fixes for ufs_rename() from ufs_vnops.c rev. 1.61 to ext2fs_rename().


Revision tags: netbsd-4-base
# 1.34 25-Nov-2006 scw

branches: 1.34.2;
Support FAT filesystems on non-DEV_BSIZE media.

Based on the patches provided in PR kern/17398 by Trevin Beattie.


# 1.33 16-Nov-2006 christos

__unused removal on arguments; approved by core.


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

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


# 1.31 22-Sep-2006 xtraeme

Apply patch from PR kern/34583 sent by Rhialto, quoting him:

"Add a 3rd entry in the cache, which keeps the end position
from just before extending a file.
This has the desired effect of keeping the write speed constant."

And yes, that helps a lot copying large files... always at full speed
now. This closes my PR kern/30868 "Poor performance copying large files
on msdosfs".

Also remove a 2 if-statements testing the same condition, combine them.

All that from Rhialto, thank you very much.


Revision tags: abandoned-netbsd-4-base yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 rpaulo-netinet-merge-pcb-base
# 1.30 23-Jul-2006 ad

branches: 1.30.2; 1.30.4; 1.30.6;
Use the LWP cached credentials where sane.


Revision tags: yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base chap-midi-base
# 1.29 07-Jun-2006 kardel

merge FreeBSD timecounters from branch simonb-timecounters
- struct timeval time is gone
time.tv_sec -> time_second
- struct timeval mono_time is gone
mono_time.tv_sec -> time_uptime
- access to time via
{get,}{micro,nano,bin}time()
get* versions are fast but less precise
- support NTP nanokernel implementation (NTP API 4)
- further reading:
Timecounter Paper: http://phk.freebsd.dk/pubs/timecounter.pdf
NTP Nanokernel: http://www.eecis.udel.edu/~mills/ntp/html/kern.html


Revision tags: yamt-pdpolicy-base5 simonb-timecounters-base
# 1.28 14-May-2006 elad

branches: 1.28.2;
integrate kauth.


Revision tags: elad-kernelauth-base
# 1.27 14-Apr-2006 christos

Coveriry CID 733: Remove dead code.


Revision tags: yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 yamt-pdpolicy-base
# 1.26 01-Mar-2006 yamt

branches: 1.26.2; 1.26.4; 1.26.6;
merge yamt-uio_vmspace branch.

- use vmspace rather than proc or lwp where appropriate.
the latter is more natural to specify an address space.
(and less likely to be abused for random purposes.)
- fix a swdmover race.


Revision tags: yamt-uio_vmspace-base5
# 1.25 14-Jan-2006 christos

branches: 1.25.2; 1.25.4;
Protect against uio_lwp being NULL from Pavel Cahyna


# 1.24 11-Dec-2005 christos

branches: 1.24.2;
merge ktrace-lwp.


Revision tags: ktrace-lwp-base
# 1.23 29-Nov-2005 yamt

merge yamt-readahead branch.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-base
# 1.22 04-Nov-2005 christos

branches: 1.22.2;
PR/32003: Brian Buhrow: msdosfs doesn't properly zero out high cluster data
on non-FAT32 msdos filesystems.


# 1.21 02-Nov-2005 yamt

merge yamt-vop branch. remove following VOPs.

VOP_BLKATOFF
VOP_VALLOC
VOP_BALLOC
VOP_REALLOCBLKS
VOP_VFREE
VOP_TRUNCATE
VOP_UPDATE


Revision tags: yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base
# 1.20 12-Sep-2005 christos

branches: 1.20.2;
Use nanotime() to update the time fields in filesystems. Convert the code
from macros to real functions. Original patch and review from chuq.
Note: ext2fs only keeps seconds in the on-disk inode, and msdosfs does not
have enough precision for all fields, so this is not very useful for those
two.


# 1.19 10-Sep-2005 christos

Make fileno calculations use ino_t variables.


# 1.18 29-Aug-2005 xtraeme

Remove __P()


# 1.17 29-Aug-2005 xtraeme

The maximum file size on MS-DOS filesystems is 4 GB - 1 byte, so
don't bother trying to write files bigger than this. Just return
EFBIG to caller, rather than panic()ing later.

From OpenBSD.

This closes my PR kern/30864: "panic when copying files of >4GB on msdosfs"


# 1.16 19-Aug-2005 christos

fileid is now a quad.


# 1.15 19-Aug-2005 christos

64 bit inode changes.


Revision tags: yamt-km-base4 yamt-km-base3 netbsd-3-base kent-audio2-base
# 1.14 26-Feb-2005 perry

branches: 1.14.2; 1.14.4;
nuke trailing whitespace


Revision tags: yamt-km-base2 yamt-km-base kent-audio1-beforemerge
# 1.13 09-Jan-2005 chs

branches: 1.13.2; 1.13.4;
adjust the UBC mapping code to support non-vnode uvm_objects.
this means we can no longer look at the vnode size to determine how many
pages to request in a fault, which is good since for NFS the size can change
out from under us on the server anyway. there's also a new flag UBC_UNMAP
for ubc_release(), so that the file system code can make the decision about
whether to cache mappings for files being used as executables.


Revision tags: kent-audio1-base
# 1.12 13-Sep-2004 jdolecek

set mp->mnt_stat.f_namemax on filesystem mount for use by statvfs, and use
the value for also pathconf(_PC_NAME_MAX) to keep the two in sync


# 1.11 12-May-2004 jrf

caddr_t -> void * and removal of some more casts.


# 1.10 04-May-2004 jrf

Remove caddr_t inlines. Approved by christos@NetBSD.org.


Revision tags: netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.9 26-Jan-2004 hannken

branches: 1.9.2; 1.9.4;
Fix xxx_strategy() to use the vnode arg instead of bp->b_vp.


# 1.8 25-Jan-2004 hannken

Make VOP_STRATEGY(bp) a real VOP as discussed on tech-kern.

VOP_STRATEGY(bp) is replaced by one of two new functions:

- VOP_STRATEGY(vp, bp) Call the strategy routine of vp for bp.
- DEV_STRATEGY(bp) Call the d_strategy routine of bp->b_dev for bp.

DEV_STRATEGY(bp) is used only for block-to-block device situations.


# 1.7 07-Sep-2003 itojun

add -t option for gmt time offset (normally MS-DOS filesystem has timestamp
in localtime, not GMT). PR kern/22717


# 1.6 02-Aug-2003 jdolecek

Allow separate masks for files and directories. Useful e.g. to turn
the execute bit off for files, but keep search permission for directories.
Change contributed in PR kern/21538 by Pavel Arnost, based on some FreeBSD
patches.
Further manpage changes, and backward-compatibility adjustments done by me.

Also fixes PR kern/16778 by Johan Danielsson, and PR kern/3400 by Rick Byers


# 1.5 29-Jun-2003 fvdl

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


# 1.4 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.3 26-Jun-2003 itojun

strlcpy


# 1.2 25-Feb-2003 jdolecek

make 'dosdirtemplate' static const


Revision tags: nathanw_sa_before_merge fvdl_fs64_base nathanw_sa_base
# 1.1 26-Dec-2002 jdolecek

branches: 1.1.2;
move msdosfs code from sys/msdosfs to sys/fs/msdosfs


# 1.111 14-Aug-2023 mrg

when calling a function that needs more bytes than we have, create a
stack variable long enough and use that instead.

found by GCC 12.


Revision tags: netbsd-10-base bouyer-sunxi-drm-base
# 1.110 23-Oct-2021 thorpej

Sanitize the symbol namespace. NFC.


# 1.109 23-Oct-2021 hannken

Move msdosfs_rename() and doscheckpath() to new file msdosfs_rename.c.

No functional change.


# 1.108 23-Oct-2021 hannken

Factor out the lookup results from struct denode.

No functional change.


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


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base thorpej-i2c-spi-conf-base
# 1.106 18-Jul-2021 dholland

Abolish all the silly indirection macros for initializing vnode ops tables.

These are things of the form #define foofs_op genfs_op, or #define
foofs_op genfs_eopnotsupp, or similar. They serve no purpose besides
obfuscation, and have gotten cutpasted all over everywhere.


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


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-cfargs-base thorpej-futex-base
# 1.104 27-Jun-2020 christos

branches: 1.104.6;
Introduce genfs_pathconf() and use it for the default case in all filesystems.


# 1.103 16-May-2020 christos

Add ACL support for FFS. From FreeBSD.


Revision tags: bouyer-xenpvh-base2
# 1.102 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.


Revision tags: phil-wifi-20200421 bouyer-xenpvh-base1
# 1.101 13-Apr-2020 ad

Replace most uses of vp->v_usecount with a call to vrefcnt(vp), a function
that hides the details and does atomic_load_relaxed(). Signature matches
FreeBSD.


Revision tags: phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3
# 1.100 23-Feb-2020 ad

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


Revision tags: ad-namecache-base2 ad-namecache-base1 ad-namecache-base phil-wifi-20191119
# 1.99 18-Sep-2019 christos

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


Revision tags: netbsd-9-3-RELEASE netbsd-9-2-RELEASE netbsd-9-1-RELEASE netbsd-8-2-RELEASE netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 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
# 1.98 26-Apr-2017 riastradh

branches: 1.98.12;
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


Revision tags: pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320
# 1.97 01-Mar-2017 hannken

Remove now redundant calls to fstrans_start()/fstrans_done().


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
# 1.96 01-Feb-2016 christos

branches: 1.96.2; 1.96.4;
- split a long line.
- remove extra test.
- move d_namlen setting to msdosfs_vnops.c to avoid the ifdef.


# 1.95 01-Feb-2016 christos

We can't depend on dp->d_namlen existing for the parts that are used in
makefs(8).


# 1.94 30-Jan-2016 mlelstv

Add support to msdosfs and makefs to generate correct Unicode (UCS-2) directory
entries from UTF8 encoded file names.


Revision tags: nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606 nick-nhusb-base-20150406
# 1.93 04-Apr-2015 riastradh

Fix remaining read(fd, NULL, 1) cases.


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


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 tls-earlyentropy-base tls-maxphys-base
# 1.91 25-Jul-2014 dholland

branches: 1.91.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.90 08-Jul-2014 hannken

Change msdosfs from hashlist to vcache:
- Use (dir_cluster, dir_offset, dir_generation) as key, where
dir_generation is non-zero and unique for unlinked but open nodes.
- Change deget() to return a vnode as it is unsafe to return a
referenced but unlocked denode.


Revision tags: yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 rmind-smpnet-nbase rmind-smpnet-base
# 1.89 23-Jan-2014 hannken

branches: 1.89.2;
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.88 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.87 02-Nov-2013 hannken

Stop using v_mount of an unreferenced vnode -- save the mount while
the vnode has a reference.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base
# 1.86 18-Mar-2013 plunky

branches: 1.86.6;
C99 section 6.7.2.3 (Tags) Note 3 states that:

A type specifier of the form

enum identifier

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

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

(ok elad@)


Revision tags: yamt-pagecache-base8
# 1.85 28-Dec-2012 hannken

Move the initialization of n to after the error branch.

From Taylor R Campbell <riastradh@netbsd.org>


# 1.84 20-Dec-2012 hannken

Change bread() and breadn() to never return a buffer on
error and modify all callers to not brelse() on error.

Welcome to 6.99.16

PR kern/46282 (6.0_BETA crash: msdosfs_bmap -> pcbmap -> bread -> bio_doread)


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6 jmcneill-usbmp-base10 yamt-pagecache-base5
# 1.83 29-Apr-2012 chs

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


Revision tags: jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8
# 1.82 03-Apr-2012 njoly

Add missing braces in previous commit.


# 1.81 02-Apr-2012 njoly

Report the SF_ARCHIVED file flag if set.


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


Revision tags: 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
# 1.79 21-Nov-2011 hannken

branches: 1.79.2; 1.79.4;
Add missing fstrans_done().

Should fix PR #45635 (KASSERT "fli->fli_trans_cnt == 0" failed)


Revision tags: jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.78 20-Jul-2011 hannken

branches: 1.78.2;
Even though msdosfs never truncates file names it advertises _PC_NO_TRUNC
as zero. Make it advertise one (no_trunc == true).

Names longer than NAME_MAX (255) will never pass namei() btw.

Fixes PR #43670 (msdosfs claims support for filenames longer than {NAME_MAX},
but fails)


# 1.77 16-Jun-2011 hannken

Rename uvm_vnp_zerorange(struct vnode *, off_t, size_t) to
ubc_zerorange(struct uvm_object *, off_t, size_t, int) changing
the first argument to an uvm_object and adding a flags argument.

Modify tmpfs_reg_resize() to zero the backing store (aobj) instead
of the vnode. Ubc_purge() no longer panics when unmounting tmpfs.

Keep uvm_vnp_zerorange() until the next kernel version bump.


# 1.76 12-Jun-2011 rmind

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 rmind-uvmplock-base
# 1.75 26-Apr-2011 hannken

branches: 1.75.2;
Change vflushbuf() to return an error if a synchronous write fails.

Welcome to 5.99.51.


# 1.74 20-Mar-2011 hannken

When extending a file, either by truncating or by writing past EOF make
sure the unallocated remainder of the last page gets zeroed.

Detected by fsx.


# 1.73 19-Mar-2011 hannken

Remove a vnode reference leak from msdosfs_rename. Release tdvp if either
doscheckpath() or relookup() fails.

Adjust test fs/vfs/t_vnops.c and remove the link count test for msdos.

Fixes PR #44661


Revision tags: bouyer-quota2-nbase
# 1.72 03-Mar-2011 pooka

In rename, use char[12]�for new names instead of [11]. At least
one routine called from here (unix2dosfn) expects and uses all of
a [12].

This may fix the "stack size exceeded" problem which has been
triggering in gson's test runs. (i'm not entirely sure why it
doesn't trigger in anyone else's env)


Revision tags: bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231
# 1.71 02-Jan-2011 dholland

branches: 1.71.2; 1.71.4;
Remove the special refcount behavior (adding an extra reference to the
parent dir) associated with SAVESTART in relookup().

Check all call sites to make sure that SAVESTART wasn't set while
calling relookup(); if it was, adjust the refcount behavior. Remove
related references to SAVESTART.

The only code that was reaching the extra ref was msdosfs_rename,
where the refcount behavior was already fairly broken and/or gross;
repair it.

Add a dummy 4th argument to relookup to make sure code that hasn't
been inspected won't compile. (This will go away next time the
relookup semantics change, which they will.)


# 1.70 30-Nov-2010 dholland

Abolish the SAVENAME and HASBUF flags. There is now always a buffer,
so the path in a struct componentname is now always valid during VOP
calls.


# 1.69 30-Nov-2010 dholland

Abolish struct componentname's cn_pnbuf. Use the path buffer in the
pathbuf object passed to namei as work space instead. (For now a pnbuf
pointer appears in struct nameidata, to support certain unclean things
that haven't been fixed yet, but it will be going away in the future.)

This removes the need for the SAVENAME and HASBUF namei flags.


Revision tags: uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.68 22-Jul-2010 njoly

Remove bad cast, fix compilation with MSDOSFS_DEBUG.


# 1.67 24-Jun-2010 hannken

Clean up vnode lock operations pass 2:

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

Welcome to 5.99.32.

Discussed on tech-kern.


# 1.66 25-May-2010 pooka

Don't double unlock fvp if source file disappears during rename.
Problem found by njoly's awesome stresstester.


Revision tags: uebayasi-xip-base1
# 1.65 23-Apr-2010 pooka

Enforce RLIMIT_FSIZE before VOP_WRITE. This adds support to file
system drivers where it was missing from and fixes one buggy
implementation. The arguably weird semantics of the check are
maintained (v_size vs. va_bytes, overwrite).


# 1.64 09-Apr-2010 hannken

Add file system suspension support (vfs_suspend(9)) to msdosfs.

Reviewed by: Antti Kantee <pooka@netbsd.org>


# 1.63 08-Apr-2010 pooka

In genfs where available.

The only functional change is mknod now returning EOPNOTSUPP instead
of EINVAL. I make this sacrifice willingly and with a clean conscience.


# 1.62 08-Apr-2010 pooka

Use genfs instead of homegrown stuff where possible.


Revision tags: yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211 yamt-nfs-mp-base8 yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 jym-xensuspend-nbase
# 1.61 03-Jul-2009 elad

branches: 1.61.2; 1.61.4;
Where possible, extract the file-system's access() routine to two internal
functions: the first checking if the operation is possible (regardless of
permissions), the second checking file-system permissions, ACLs, etc.

Mailing list reference:

http://mail-index.netbsd.org/tech-kern/2009/06/21/msg005311.html


# 1.60 23-Jun-2009 elad

Move the implementation of vaccess() to genfs_can_access(), in line with
the other routines of the same spirit.

Adjust file-system code to use it.

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

No objections on tech-kern@:

http://mail-index.netbsd.org/tech-kern/2009/06/21/msg005310.html


Revision tags: yamt-nfs-mp-base5 yamt-nfs-mp-base4 jym-xensuspend-base
# 1.59 07-May-2009 elad

Extract the open-coded authorization logic for chtimes() from various
file-systems and put it in a single function, genfs_can_chtimes().

This also makes UDF follow the same policy as all other file-systems.

Mailing list reference:

http://mail-index.netbsd.org/tech-kern/2009/04/27/msg004951.html


Revision tags: yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.58 14-Mar-2009 dsl

ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.


Revision tags: nick-hppapmap-base2 mjf-devfs2-base
# 1.57 11-Jan-2009 cegger

branches: 1.57.2;
make this compile


# 1.56 11-Jan-2009 christos

merge christos-time_t


Revision tags: haad-dm-base2 haad-nbase2 ad-audiomp2-base christos-time_t-nbase christos-time_t-base haad-dm-base
# 1.55 28-Nov-2008 pooka

Tyop: v -> vp. Spotted by Tom's ARM builds.


# 1.54 26-Nov-2008 pooka

Rototill all remaining file systems to use ubc_uiomove() instead
of the ubc_alloc() - uiomove() - ubc_release() dance.


# 1.53 14-Nov-2008 pooka

In case writing past EOF, fail if extending the file fails (most
likely due to the file system being full).

Otherwise we'd fail in VOP_PUTPAGES(), which might not happen during
VOP_WRITE(), thus giving the caller the wrong impression that
writing was succesful.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE 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 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 wrstuden-revivesa-base
# 1.52 16-May-2008 hannken

branches: 1.52.4; 1.52.6; 1.52.10;
Make sure all cached buffers with valid, not yet written data have been
run through copy-on-write. Call fscow_run() with valid data where possible.

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

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

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

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

Welcome to 4.99.63

Reviewed by: YAMAMOTO Takashi <yamt@netbsd.org>


Revision tags: yamt-nfs-mp-base2
# 1.51 30-Apr-2008 ad

branches: 1.51.2;
Make various bits of debug code compile again.


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

branches: 1.50.2;
Network protocol interrupts can now block on locks, so merge the globals
proclist_mutex and proclist_lock into a single adaptive mutex (proc_lock).
Implications:

- Inspecting process state requires thread context, so signals can no longer
be sent from a hardware interrupt handler. Signal activity must be
deferred to a soft interrupt or kthread.

- As the proc state locking is simplified, it's now safe to take exit()
and wait() out from under kernel_lock.

- The system spends less time at IPL_SCHED, and there is less lock activity.


Revision tags: yamt-pf42-baseX yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase nick-net80211-sync-base keiichi-mipv6-base matt-armv6-nbase mjf-devfs-base hpcarm-cleanup-base
# 1.49 30-Jan-2008 ad

branches: 1.49.6; 1.49.8;
Replace struct lock on vnodes with a simpler lock object built on
krwlock_t. This is a step towards removing lockmgr and simplifying
vnode locking. Discussed on tech-kern.


# 1.48 25-Jan-2008 ad

Remove VOP_LEASE. Discussed on tech-kern.


Revision tags: bouyer-xeni386-nbase bouyer-xeni386-base matt-armv6-base
# 1.47 05-Jan-2008 christos

PR/37696: Paul Ripke: add large read / readahead support (Introduce run-length
detection to msdosfs_bmap(), from FreeBSD)


# 1.46 02-Jan-2008 ad

Merge vmlocking2 to head.


# 1.45 28-Dec-2007 reinoud

Use uvm_vnp_setwritesize() on file extending to instruct UVM to NOT read-in
the newly added space first. This significantly speeds up write speed for
msdosfs and making it at par with ffs wich already had this patched.

Speed increase measured on my IDE disc from 2Mb/sec to 32 Mb/sec


Revision tags: vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 vmlocking-nbase jmcneill-pm-base reinoud-bufcleanup-base
# 1.44 26-Nov-2007 pooka

branches: 1.44.2; 1.44.6;
Remove the "struct lwp *" argument from all VFS and VOP interfaces.
The general trend is to remove it from all kernel interfaces and
this is a start. In case the calling lwp is desired, curlwp should
be used.

quick consensus on tech-kern


Revision tags: bouyer-xenamd64-base2 bouyer-xenamd64-base
# 1.43 14-Nov-2007 pooka

Fix a problem noticed by Reinoud: the fs would try to release an
unlocked vnode when trying to rename a directory. The fix was to
shuffle some bits around and #pray.

The rename routine actually needs a very very major wide-angle whopping:
* it takes locks out-of-order
* it deals with references from SAVESTART lookups in interesting ways
* I doubt there is any guarantee for correct operation if there
are multiple concurrent accesses
* the error branches might just as well call panic() directly


Revision tags: jmcneill-base yamt-x86pmap-base4 yamt-x86pmap-base3 vmlocking-base
# 1.42 08-Oct-2007 ad

branches: 1.42.2; 1.42.4;
Merge brelse() changes from the vmlocking branch.


Revision tags: yamt-x86pmap-base2
# 1.41 24-Sep-2007 rumble

Avoid stack allocation of large dirent structures in foo_readdir().


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base matt-mips64-base
# 1.40 29-Jul-2007 rumble

branches: 1.40.4; 1.40.6; 1.40.8; 1.40.10;
Use _DIRENT_MINSIZE when determining the number of NFS cookies to allocate,
rather than hard-coding 16.


Revision tags: nick-csl-alignment-base yamt-idlelwp-base8 mjf-ufs-trans-base
# 1.39 19-Apr-2007 yamt

branches: 1.39.2;
hold proclist_mutex when calling psignal().


Revision tags: thorpej-atomic-base
# 1.38 04-Mar-2007 christos

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


Revision tags: ad-audiomp-base
# 1.37 21-Feb-2007 thorpej

Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.


Revision tags: post-newlock2-merge newlock2-nbase newlock2-base
# 1.36 04-Jan-2007 elad

branches: 1.36.2;
Consistent usage of KAUTH_GENERIC_ISSUSER.


Revision tags: yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3
# 1.35 09-Dec-2006 chs

a smorgasbord of improvements to vnode locking and path lookup:
- LOCKPARENT is no longer relevant for lookup(), relookup() or VOP_LOOKUP().
these now always return the parent vnode locked. namei() works as before.
lookup() and various other paths no longer acquire vnode locks in the
wrong order via vrele(). fixes PR 32535.
as a nice side effect, path lookup is also up to 25% faster.
- the above allows us to get rid of PDIRUNLOCK.
- also get rid of WANTPARENT (just use LOCKPARENT and unlock it).
- remove an assumption in layer_node_find() that all file systems implement
a recursive VOP_LOCK() (unionfs doesn't).
- require that all file systems supply vfs_vptofh and vfs_fhtovp routines.
fill in eopnotsupp() for file systems that don't support being exported
and remove the checks for NULL. (layerfs calls these without checking.)
- in union_lookup1(), don't change refcounts in the ISDOTDOT case, just
adjust which vnode is locked. fixes PR 33374.
- apply fixes for ufs_rename() from ufs_vnops.c rev. 1.61 to ext2fs_rename().


Revision tags: netbsd-4-base
# 1.34 25-Nov-2006 scw

branches: 1.34.2;
Support FAT filesystems on non-DEV_BSIZE media.

Based on the patches provided in PR kern/17398 by Trevin Beattie.


# 1.33 16-Nov-2006 christos

__unused removal on arguments; approved by core.


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

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


# 1.31 22-Sep-2006 xtraeme

Apply patch from PR kern/34583 sent by Rhialto, quoting him:

"Add a 3rd entry in the cache, which keeps the end position
from just before extending a file.
This has the desired effect of keeping the write speed constant."

And yes, that helps a lot copying large files... always at full speed
now. This closes my PR kern/30868 "Poor performance copying large files
on msdosfs".

Also remove a 2 if-statements testing the same condition, combine them.

All that from Rhialto, thank you very much.


Revision tags: abandoned-netbsd-4-base yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 rpaulo-netinet-merge-pcb-base
# 1.30 23-Jul-2006 ad

branches: 1.30.2; 1.30.4; 1.30.6;
Use the LWP cached credentials where sane.


Revision tags: yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base chap-midi-base
# 1.29 07-Jun-2006 kardel

merge FreeBSD timecounters from branch simonb-timecounters
- struct timeval time is gone
time.tv_sec -> time_second
- struct timeval mono_time is gone
mono_time.tv_sec -> time_uptime
- access to time via
{get,}{micro,nano,bin}time()
get* versions are fast but less precise
- support NTP nanokernel implementation (NTP API 4)
- further reading:
Timecounter Paper: http://phk.freebsd.dk/pubs/timecounter.pdf
NTP Nanokernel: http://www.eecis.udel.edu/~mills/ntp/html/kern.html


Revision tags: yamt-pdpolicy-base5 simonb-timecounters-base
# 1.28 14-May-2006 elad

branches: 1.28.2;
integrate kauth.


Revision tags: elad-kernelauth-base
# 1.27 14-Apr-2006 christos

Coveriry CID 733: Remove dead code.


Revision tags: yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 yamt-pdpolicy-base
# 1.26 01-Mar-2006 yamt

branches: 1.26.2; 1.26.4; 1.26.6;
merge yamt-uio_vmspace branch.

- use vmspace rather than proc or lwp where appropriate.
the latter is more natural to specify an address space.
(and less likely to be abused for random purposes.)
- fix a swdmover race.


Revision tags: yamt-uio_vmspace-base5
# 1.25 14-Jan-2006 christos

branches: 1.25.2; 1.25.4;
Protect against uio_lwp being NULL from Pavel Cahyna


# 1.24 11-Dec-2005 christos

branches: 1.24.2;
merge ktrace-lwp.


Revision tags: ktrace-lwp-base
# 1.23 29-Nov-2005 yamt

merge yamt-readahead branch.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-base
# 1.22 04-Nov-2005 christos

branches: 1.22.2;
PR/32003: Brian Buhrow: msdosfs doesn't properly zero out high cluster data
on non-FAT32 msdos filesystems.


# 1.21 02-Nov-2005 yamt

merge yamt-vop branch. remove following VOPs.

VOP_BLKATOFF
VOP_VALLOC
VOP_BALLOC
VOP_REALLOCBLKS
VOP_VFREE
VOP_TRUNCATE
VOP_UPDATE


Revision tags: yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base
# 1.20 12-Sep-2005 christos

branches: 1.20.2;
Use nanotime() to update the time fields in filesystems. Convert the code
from macros to real functions. Original patch and review from chuq.
Note: ext2fs only keeps seconds in the on-disk inode, and msdosfs does not
have enough precision for all fields, so this is not very useful for those
two.


# 1.19 10-Sep-2005 christos

Make fileno calculations use ino_t variables.


# 1.18 29-Aug-2005 xtraeme

Remove __P()


# 1.17 29-Aug-2005 xtraeme

The maximum file size on MS-DOS filesystems is 4 GB - 1 byte, so
don't bother trying to write files bigger than this. Just return
EFBIG to caller, rather than panic()ing later.

From OpenBSD.

This closes my PR kern/30864: "panic when copying files of >4GB on msdosfs"


# 1.16 19-Aug-2005 christos

fileid is now a quad.


# 1.15 19-Aug-2005 christos

64 bit inode changes.


Revision tags: yamt-km-base4 yamt-km-base3 netbsd-3-base kent-audio2-base
# 1.14 26-Feb-2005 perry

branches: 1.14.2; 1.14.4;
nuke trailing whitespace


Revision tags: yamt-km-base2 yamt-km-base kent-audio1-beforemerge
# 1.13 09-Jan-2005 chs

branches: 1.13.2; 1.13.4;
adjust the UBC mapping code to support non-vnode uvm_objects.
this means we can no longer look at the vnode size to determine how many
pages to request in a fault, which is good since for NFS the size can change
out from under us on the server anyway. there's also a new flag UBC_UNMAP
for ubc_release(), so that the file system code can make the decision about
whether to cache mappings for files being used as executables.


Revision tags: kent-audio1-base
# 1.12 13-Sep-2004 jdolecek

set mp->mnt_stat.f_namemax on filesystem mount for use by statvfs, and use
the value for also pathconf(_PC_NAME_MAX) to keep the two in sync


# 1.11 12-May-2004 jrf

caddr_t -> void * and removal of some more casts.


# 1.10 04-May-2004 jrf

Remove caddr_t inlines. Approved by christos@NetBSD.org.


Revision tags: netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.9 26-Jan-2004 hannken

branches: 1.9.2; 1.9.4;
Fix xxx_strategy() to use the vnode arg instead of bp->b_vp.


# 1.8 25-Jan-2004 hannken

Make VOP_STRATEGY(bp) a real VOP as discussed on tech-kern.

VOP_STRATEGY(bp) is replaced by one of two new functions:

- VOP_STRATEGY(vp, bp) Call the strategy routine of vp for bp.
- DEV_STRATEGY(bp) Call the d_strategy routine of bp->b_dev for bp.

DEV_STRATEGY(bp) is used only for block-to-block device situations.


# 1.7 07-Sep-2003 itojun

add -t option for gmt time offset (normally MS-DOS filesystem has timestamp
in localtime, not GMT). PR kern/22717


# 1.6 02-Aug-2003 jdolecek

Allow separate masks for files and directories. Useful e.g. to turn
the execute bit off for files, but keep search permission for directories.
Change contributed in PR kern/21538 by Pavel Arnost, based on some FreeBSD
patches.
Further manpage changes, and backward-compatibility adjustments done by me.

Also fixes PR kern/16778 by Johan Danielsson, and PR kern/3400 by Rick Byers


# 1.5 29-Jun-2003 fvdl

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


# 1.4 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.3 26-Jun-2003 itojun

strlcpy


# 1.2 25-Feb-2003 jdolecek

make 'dosdirtemplate' static const


Revision tags: nathanw_sa_before_merge fvdl_fs64_base nathanw_sa_base
# 1.1 26-Dec-2002 jdolecek

branches: 1.1.2;
move msdosfs code from sys/msdosfs to sys/fs/msdosfs


# 1.110 23-Oct-2021 thorpej

Sanitize the symbol namespace. NFC.


# 1.109 23-Oct-2021 hannken

Move msdosfs_rename() and doscheckpath() to new file msdosfs_rename.c.

No functional change.


# 1.108 23-Oct-2021 hannken

Factor out the lookup results from struct denode.

No functional change.


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


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base thorpej-i2c-spi-conf-base
# 1.106 18-Jul-2021 dholland

Abolish all the silly indirection macros for initializing vnode ops tables.

These are things of the form #define foofs_op genfs_op, or #define
foofs_op genfs_eopnotsupp, or similar. They serve no purpose besides
obfuscation, and have gotten cutpasted all over everywhere.


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


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-cfargs-base thorpej-futex-base
# 1.104 27-Jun-2020 christos

branches: 1.104.6;
Introduce genfs_pathconf() and use it for the default case in all filesystems.


# 1.103 16-May-2020 christos

Add ACL support for FFS. From FreeBSD.


Revision tags: bouyer-xenpvh-base2
# 1.102 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.


Revision tags: phil-wifi-20200421 bouyer-xenpvh-base1
# 1.101 13-Apr-2020 ad

Replace most uses of vp->v_usecount with a call to vrefcnt(vp), a function
that hides the details and does atomic_load_relaxed(). Signature matches
FreeBSD.


Revision tags: phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3
# 1.100 23-Feb-2020 ad

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


Revision tags: ad-namecache-base2 ad-namecache-base1 ad-namecache-base phil-wifi-20191119
# 1.99 18-Sep-2019 christos

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


Revision tags: netbsd-9-2-RELEASE netbsd-9-1-RELEASE netbsd-8-2-RELEASE netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 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
# 1.98 26-Apr-2017 riastradh

branches: 1.98.12;
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


Revision tags: pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320
# 1.97 01-Mar-2017 hannken

Remove now redundant calls to fstrans_start()/fstrans_done().


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
# 1.96 01-Feb-2016 christos

branches: 1.96.2; 1.96.4;
- split a long line.
- remove extra test.
- move d_namlen setting to msdosfs_vnops.c to avoid the ifdef.


# 1.95 01-Feb-2016 christos

We can't depend on dp->d_namlen existing for the parts that are used in
makefs(8).


# 1.94 30-Jan-2016 mlelstv

Add support to msdosfs and makefs to generate correct Unicode (UCS-2) directory
entries from UTF8 encoded file names.


Revision tags: nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606 nick-nhusb-base-20150406
# 1.93 04-Apr-2015 riastradh

Fix remaining read(fd, NULL, 1) cases.


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


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 tls-earlyentropy-base tls-maxphys-base
# 1.91 25-Jul-2014 dholland

branches: 1.91.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.90 08-Jul-2014 hannken

Change msdosfs from hashlist to vcache:
- Use (dir_cluster, dir_offset, dir_generation) as key, where
dir_generation is non-zero and unique for unlinked but open nodes.
- Change deget() to return a vnode as it is unsafe to return a
referenced but unlocked denode.


Revision tags: yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 rmind-smpnet-nbase rmind-smpnet-base
# 1.89 23-Jan-2014 hannken

branches: 1.89.2;
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.88 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.87 02-Nov-2013 hannken

Stop using v_mount of an unreferenced vnode -- save the mount while
the vnode has a reference.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base
# 1.86 18-Mar-2013 plunky

branches: 1.86.6;
C99 section 6.7.2.3 (Tags) Note 3 states that:

A type specifier of the form

enum identifier

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

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

(ok elad@)


Revision tags: yamt-pagecache-base8
# 1.85 28-Dec-2012 hannken

Move the initialization of n to after the error branch.

From Taylor R Campbell <riastradh@netbsd.org>


# 1.84 20-Dec-2012 hannken

Change bread() and breadn() to never return a buffer on
error and modify all callers to not brelse() on error.

Welcome to 6.99.16

PR kern/46282 (6.0_BETA crash: msdosfs_bmap -> pcbmap -> bread -> bio_doread)


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6 jmcneill-usbmp-base10 yamt-pagecache-base5
# 1.83 29-Apr-2012 chs

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


Revision tags: jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8
# 1.82 03-Apr-2012 njoly

Add missing braces in previous commit.


# 1.81 02-Apr-2012 njoly

Report the SF_ARCHIVED file flag if set.


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


Revision tags: 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
# 1.79 21-Nov-2011 hannken

branches: 1.79.2; 1.79.4;
Add missing fstrans_done().

Should fix PR #45635 (KASSERT "fli->fli_trans_cnt == 0" failed)


Revision tags: jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.78 20-Jul-2011 hannken

branches: 1.78.2;
Even though msdosfs never truncates file names it advertises _PC_NO_TRUNC
as zero. Make it advertise one (no_trunc == true).

Names longer than NAME_MAX (255) will never pass namei() btw.

Fixes PR #43670 (msdosfs claims support for filenames longer than {NAME_MAX},
but fails)


# 1.77 16-Jun-2011 hannken

Rename uvm_vnp_zerorange(struct vnode *, off_t, size_t) to
ubc_zerorange(struct uvm_object *, off_t, size_t, int) changing
the first argument to an uvm_object and adding a flags argument.

Modify tmpfs_reg_resize() to zero the backing store (aobj) instead
of the vnode. Ubc_purge() no longer panics when unmounting tmpfs.

Keep uvm_vnp_zerorange() until the next kernel version bump.


# 1.76 12-Jun-2011 rmind

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 rmind-uvmplock-base
# 1.75 26-Apr-2011 hannken

branches: 1.75.2;
Change vflushbuf() to return an error if a synchronous write fails.

Welcome to 5.99.51.


# 1.74 20-Mar-2011 hannken

When extending a file, either by truncating or by writing past EOF make
sure the unallocated remainder of the last page gets zeroed.

Detected by fsx.


# 1.73 19-Mar-2011 hannken

Remove a vnode reference leak from msdosfs_rename. Release tdvp if either
doscheckpath() or relookup() fails.

Adjust test fs/vfs/t_vnops.c and remove the link count test for msdos.

Fixes PR #44661


Revision tags: bouyer-quota2-nbase
# 1.72 03-Mar-2011 pooka

In rename, use char[12]�for new names instead of [11]. At least
one routine called from here (unix2dosfn) expects and uses all of
a [12].

This may fix the "stack size exceeded" problem which has been
triggering in gson's test runs. (i'm not entirely sure why it
doesn't trigger in anyone else's env)


Revision tags: bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231
# 1.71 02-Jan-2011 dholland

branches: 1.71.2; 1.71.4;
Remove the special refcount behavior (adding an extra reference to the
parent dir) associated with SAVESTART in relookup().

Check all call sites to make sure that SAVESTART wasn't set while
calling relookup(); if it was, adjust the refcount behavior. Remove
related references to SAVESTART.

The only code that was reaching the extra ref was msdosfs_rename,
where the refcount behavior was already fairly broken and/or gross;
repair it.

Add a dummy 4th argument to relookup to make sure code that hasn't
been inspected won't compile. (This will go away next time the
relookup semantics change, which they will.)


# 1.70 30-Nov-2010 dholland

Abolish the SAVENAME and HASBUF flags. There is now always a buffer,
so the path in a struct componentname is now always valid during VOP
calls.


# 1.69 30-Nov-2010 dholland

Abolish struct componentname's cn_pnbuf. Use the path buffer in the
pathbuf object passed to namei as work space instead. (For now a pnbuf
pointer appears in struct nameidata, to support certain unclean things
that haven't been fixed yet, but it will be going away in the future.)

This removes the need for the SAVENAME and HASBUF namei flags.


Revision tags: uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.68 22-Jul-2010 njoly

Remove bad cast, fix compilation with MSDOSFS_DEBUG.


# 1.67 24-Jun-2010 hannken

Clean up vnode lock operations pass 2:

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

Welcome to 5.99.32.

Discussed on tech-kern.


# 1.66 25-May-2010 pooka

Don't double unlock fvp if source file disappears during rename.
Problem found by njoly's awesome stresstester.


Revision tags: uebayasi-xip-base1
# 1.65 23-Apr-2010 pooka

Enforce RLIMIT_FSIZE before VOP_WRITE. This adds support to file
system drivers where it was missing from and fixes one buggy
implementation. The arguably weird semantics of the check are
maintained (v_size vs. va_bytes, overwrite).


# 1.64 09-Apr-2010 hannken

Add file system suspension support (vfs_suspend(9)) to msdosfs.

Reviewed by: Antti Kantee <pooka@netbsd.org>


# 1.63 08-Apr-2010 pooka

In genfs where available.

The only functional change is mknod now returning EOPNOTSUPP instead
of EINVAL. I make this sacrifice willingly and with a clean conscience.


# 1.62 08-Apr-2010 pooka

Use genfs instead of homegrown stuff where possible.


Revision tags: yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211 yamt-nfs-mp-base8 yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 jym-xensuspend-nbase
# 1.61 03-Jul-2009 elad

branches: 1.61.2; 1.61.4;
Where possible, extract the file-system's access() routine to two internal
functions: the first checking if the operation is possible (regardless of
permissions), the second checking file-system permissions, ACLs, etc.

Mailing list reference:

http://mail-index.netbsd.org/tech-kern/2009/06/21/msg005311.html


# 1.60 23-Jun-2009 elad

Move the implementation of vaccess() to genfs_can_access(), in line with
the other routines of the same spirit.

Adjust file-system code to use it.

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

No objections on tech-kern@:

http://mail-index.netbsd.org/tech-kern/2009/06/21/msg005310.html


Revision tags: yamt-nfs-mp-base5 yamt-nfs-mp-base4 jym-xensuspend-base
# 1.59 07-May-2009 elad

Extract the open-coded authorization logic for chtimes() from various
file-systems and put it in a single function, genfs_can_chtimes().

This also makes UDF follow the same policy as all other file-systems.

Mailing list reference:

http://mail-index.netbsd.org/tech-kern/2009/04/27/msg004951.html


Revision tags: yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.58 14-Mar-2009 dsl

ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.


Revision tags: nick-hppapmap-base2 mjf-devfs2-base
# 1.57 11-Jan-2009 cegger

branches: 1.57.2;
make this compile


# 1.56 11-Jan-2009 christos

merge christos-time_t


Revision tags: haad-dm-base2 haad-nbase2 ad-audiomp2-base christos-time_t-nbase christos-time_t-base haad-dm-base
# 1.55 28-Nov-2008 pooka

Tyop: v -> vp. Spotted by Tom's ARM builds.


# 1.54 26-Nov-2008 pooka

Rototill all remaining file systems to use ubc_uiomove() instead
of the ubc_alloc() - uiomove() - ubc_release() dance.


# 1.53 14-Nov-2008 pooka

In case writing past EOF, fail if extending the file fails (most
likely due to the file system being full).

Otherwise we'd fail in VOP_PUTPAGES(), which might not happen during
VOP_WRITE(), thus giving the caller the wrong impression that
writing was succesful.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE 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 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 wrstuden-revivesa-base
# 1.52 16-May-2008 hannken

branches: 1.52.4; 1.52.6; 1.52.10;
Make sure all cached buffers with valid, not yet written data have been
run through copy-on-write. Call fscow_run() with valid data where possible.

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

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

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

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

Welcome to 4.99.63

Reviewed by: YAMAMOTO Takashi <yamt@netbsd.org>


Revision tags: yamt-nfs-mp-base2
# 1.51 30-Apr-2008 ad

branches: 1.51.2;
Make various bits of debug code compile again.


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

branches: 1.50.2;
Network protocol interrupts can now block on locks, so merge the globals
proclist_mutex and proclist_lock into a single adaptive mutex (proc_lock).
Implications:

- Inspecting process state requires thread context, so signals can no longer
be sent from a hardware interrupt handler. Signal activity must be
deferred to a soft interrupt or kthread.

- As the proc state locking is simplified, it's now safe to take exit()
and wait() out from under kernel_lock.

- The system spends less time at IPL_SCHED, and there is less lock activity.


Revision tags: yamt-pf42-baseX yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase nick-net80211-sync-base keiichi-mipv6-base matt-armv6-nbase mjf-devfs-base hpcarm-cleanup-base
# 1.49 30-Jan-2008 ad

branches: 1.49.6; 1.49.8;
Replace struct lock on vnodes with a simpler lock object built on
krwlock_t. This is a step towards removing lockmgr and simplifying
vnode locking. Discussed on tech-kern.


# 1.48 25-Jan-2008 ad

Remove VOP_LEASE. Discussed on tech-kern.


Revision tags: bouyer-xeni386-nbase bouyer-xeni386-base matt-armv6-base
# 1.47 05-Jan-2008 christos

PR/37696: Paul Ripke: add large read / readahead support (Introduce run-length
detection to msdosfs_bmap(), from FreeBSD)


# 1.46 02-Jan-2008 ad

Merge vmlocking2 to head.


# 1.45 28-Dec-2007 reinoud

Use uvm_vnp_setwritesize() on file extending to instruct UVM to NOT read-in
the newly added space first. This significantly speeds up write speed for
msdosfs and making it at par with ffs wich already had this patched.

Speed increase measured on my IDE disc from 2Mb/sec to 32 Mb/sec


Revision tags: vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 vmlocking-nbase jmcneill-pm-base reinoud-bufcleanup-base
# 1.44 26-Nov-2007 pooka

branches: 1.44.2; 1.44.6;
Remove the "struct lwp *" argument from all VFS and VOP interfaces.
The general trend is to remove it from all kernel interfaces and
this is a start. In case the calling lwp is desired, curlwp should
be used.

quick consensus on tech-kern


Revision tags: bouyer-xenamd64-base2 bouyer-xenamd64-base
# 1.43 14-Nov-2007 pooka

Fix a problem noticed by Reinoud: the fs would try to release an
unlocked vnode when trying to rename a directory. The fix was to
shuffle some bits around and #pray.

The rename routine actually needs a very very major wide-angle whopping:
* it takes locks out-of-order
* it deals with references from SAVESTART lookups in interesting ways
* I doubt there is any guarantee for correct operation if there
are multiple concurrent accesses
* the error branches might just as well call panic() directly


Revision tags: jmcneill-base yamt-x86pmap-base4 yamt-x86pmap-base3 vmlocking-base
# 1.42 08-Oct-2007 ad

branches: 1.42.2; 1.42.4;
Merge brelse() changes from the vmlocking branch.


Revision tags: yamt-x86pmap-base2
# 1.41 24-Sep-2007 rumble

Avoid stack allocation of large dirent structures in foo_readdir().


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base matt-mips64-base
# 1.40 29-Jul-2007 rumble

branches: 1.40.4; 1.40.6; 1.40.8; 1.40.10;
Use _DIRENT_MINSIZE when determining the number of NFS cookies to allocate,
rather than hard-coding 16.


Revision tags: nick-csl-alignment-base yamt-idlelwp-base8 mjf-ufs-trans-base
# 1.39 19-Apr-2007 yamt

branches: 1.39.2;
hold proclist_mutex when calling psignal().


Revision tags: thorpej-atomic-base
# 1.38 04-Mar-2007 christos

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


Revision tags: ad-audiomp-base
# 1.37 21-Feb-2007 thorpej

Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.


Revision tags: post-newlock2-merge newlock2-nbase newlock2-base
# 1.36 04-Jan-2007 elad

branches: 1.36.2;
Consistent usage of KAUTH_GENERIC_ISSUSER.


Revision tags: yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3
# 1.35 09-Dec-2006 chs

a smorgasbord of improvements to vnode locking and path lookup:
- LOCKPARENT is no longer relevant for lookup(), relookup() or VOP_LOOKUP().
these now always return the parent vnode locked. namei() works as before.
lookup() and various other paths no longer acquire vnode locks in the
wrong order via vrele(). fixes PR 32535.
as a nice side effect, path lookup is also up to 25% faster.
- the above allows us to get rid of PDIRUNLOCK.
- also get rid of WANTPARENT (just use LOCKPARENT and unlock it).
- remove an assumption in layer_node_find() that all file systems implement
a recursive VOP_LOCK() (unionfs doesn't).
- require that all file systems supply vfs_vptofh and vfs_fhtovp routines.
fill in eopnotsupp() for file systems that don't support being exported
and remove the checks for NULL. (layerfs calls these without checking.)
- in union_lookup1(), don't change refcounts in the ISDOTDOT case, just
adjust which vnode is locked. fixes PR 33374.
- apply fixes for ufs_rename() from ufs_vnops.c rev. 1.61 to ext2fs_rename().


Revision tags: netbsd-4-base
# 1.34 25-Nov-2006 scw

branches: 1.34.2;
Support FAT filesystems on non-DEV_BSIZE media.

Based on the patches provided in PR kern/17398 by Trevin Beattie.


# 1.33 16-Nov-2006 christos

__unused removal on arguments; approved by core.


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

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


# 1.31 22-Sep-2006 xtraeme

Apply patch from PR kern/34583 sent by Rhialto, quoting him:

"Add a 3rd entry in the cache, which keeps the end position
from just before extending a file.
This has the desired effect of keeping the write speed constant."

And yes, that helps a lot copying large files... always at full speed
now. This closes my PR kern/30868 "Poor performance copying large files
on msdosfs".

Also remove a 2 if-statements testing the same condition, combine them.

All that from Rhialto, thank you very much.


Revision tags: abandoned-netbsd-4-base yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 rpaulo-netinet-merge-pcb-base
# 1.30 23-Jul-2006 ad

branches: 1.30.2; 1.30.4; 1.30.6;
Use the LWP cached credentials where sane.


Revision tags: yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base chap-midi-base
# 1.29 07-Jun-2006 kardel

merge FreeBSD timecounters from branch simonb-timecounters
- struct timeval time is gone
time.tv_sec -> time_second
- struct timeval mono_time is gone
mono_time.tv_sec -> time_uptime
- access to time via
{get,}{micro,nano,bin}time()
get* versions are fast but less precise
- support NTP nanokernel implementation (NTP API 4)
- further reading:
Timecounter Paper: http://phk.freebsd.dk/pubs/timecounter.pdf
NTP Nanokernel: http://www.eecis.udel.edu/~mills/ntp/html/kern.html


Revision tags: yamt-pdpolicy-base5 simonb-timecounters-base
# 1.28 14-May-2006 elad

branches: 1.28.2;
integrate kauth.


Revision tags: elad-kernelauth-base
# 1.27 14-Apr-2006 christos

Coveriry CID 733: Remove dead code.


Revision tags: yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 yamt-pdpolicy-base
# 1.26 01-Mar-2006 yamt

branches: 1.26.2; 1.26.4; 1.26.6;
merge yamt-uio_vmspace branch.

- use vmspace rather than proc or lwp where appropriate.
the latter is more natural to specify an address space.
(and less likely to be abused for random purposes.)
- fix a swdmover race.


Revision tags: yamt-uio_vmspace-base5
# 1.25 14-Jan-2006 christos

branches: 1.25.2; 1.25.4;
Protect against uio_lwp being NULL from Pavel Cahyna


# 1.24 11-Dec-2005 christos

branches: 1.24.2;
merge ktrace-lwp.


Revision tags: ktrace-lwp-base
# 1.23 29-Nov-2005 yamt

merge yamt-readahead branch.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-base
# 1.22 04-Nov-2005 christos

branches: 1.22.2;
PR/32003: Brian Buhrow: msdosfs doesn't properly zero out high cluster data
on non-FAT32 msdos filesystems.


# 1.21 02-Nov-2005 yamt

merge yamt-vop branch. remove following VOPs.

VOP_BLKATOFF
VOP_VALLOC
VOP_BALLOC
VOP_REALLOCBLKS
VOP_VFREE
VOP_TRUNCATE
VOP_UPDATE


Revision tags: yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base
# 1.20 12-Sep-2005 christos

branches: 1.20.2;
Use nanotime() to update the time fields in filesystems. Convert the code
from macros to real functions. Original patch and review from chuq.
Note: ext2fs only keeps seconds in the on-disk inode, and msdosfs does not
have enough precision for all fields, so this is not very useful for those
two.


# 1.19 10-Sep-2005 christos

Make fileno calculations use ino_t variables.


# 1.18 29-Aug-2005 xtraeme

Remove __P()


# 1.17 29-Aug-2005 xtraeme

The maximum file size on MS-DOS filesystems is 4 GB - 1 byte, so
don't bother trying to write files bigger than this. Just return
EFBIG to caller, rather than panic()ing later.

From OpenBSD.

This closes my PR kern/30864: "panic when copying files of >4GB on msdosfs"


# 1.16 19-Aug-2005 christos

fileid is now a quad.


# 1.15 19-Aug-2005 christos

64 bit inode changes.


Revision tags: yamt-km-base4 yamt-km-base3 netbsd-3-base kent-audio2-base
# 1.14 26-Feb-2005 perry

branches: 1.14.2; 1.14.4;
nuke trailing whitespace


Revision tags: yamt-km-base2 yamt-km-base kent-audio1-beforemerge
# 1.13 09-Jan-2005 chs

branches: 1.13.2; 1.13.4;
adjust the UBC mapping code to support non-vnode uvm_objects.
this means we can no longer look at the vnode size to determine how many
pages to request in a fault, which is good since for NFS the size can change
out from under us on the server anyway. there's also a new flag UBC_UNMAP
for ubc_release(), so that the file system code can make the decision about
whether to cache mappings for files being used as executables.


Revision tags: kent-audio1-base
# 1.12 13-Sep-2004 jdolecek

set mp->mnt_stat.f_namemax on filesystem mount for use by statvfs, and use
the value for also pathconf(_PC_NAME_MAX) to keep the two in sync


# 1.11 12-May-2004 jrf

caddr_t -> void * and removal of some more casts.


# 1.10 04-May-2004 jrf

Remove caddr_t inlines. Approved by christos@NetBSD.org.


Revision tags: netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.9 26-Jan-2004 hannken

branches: 1.9.2; 1.9.4;
Fix xxx_strategy() to use the vnode arg instead of bp->b_vp.


# 1.8 25-Jan-2004 hannken

Make VOP_STRATEGY(bp) a real VOP as discussed on tech-kern.

VOP_STRATEGY(bp) is replaced by one of two new functions:

- VOP_STRATEGY(vp, bp) Call the strategy routine of vp for bp.
- DEV_STRATEGY(bp) Call the d_strategy routine of bp->b_dev for bp.

DEV_STRATEGY(bp) is used only for block-to-block device situations.


# 1.7 07-Sep-2003 itojun

add -t option for gmt time offset (normally MS-DOS filesystem has timestamp
in localtime, not GMT). PR kern/22717


# 1.6 02-Aug-2003 jdolecek

Allow separate masks for files and directories. Useful e.g. to turn
the execute bit off for files, but keep search permission for directories.
Change contributed in PR kern/21538 by Pavel Arnost, based on some FreeBSD
patches.
Further manpage changes, and backward-compatibility adjustments done by me.

Also fixes PR kern/16778 by Johan Danielsson, and PR kern/3400 by Rick Byers


# 1.5 29-Jun-2003 fvdl

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


# 1.4 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.3 26-Jun-2003 itojun

strlcpy


# 1.2 25-Feb-2003 jdolecek

make 'dosdirtemplate' static const


Revision tags: nathanw_sa_before_merge fvdl_fs64_base nathanw_sa_base
# 1.1 26-Dec-2002 jdolecek

branches: 1.1.2;
move msdosfs code from sys/msdosfs to sys/fs/msdosfs


# 1.109 23-Oct-2021 hannken

Move msdosfs_rename() and doscheckpath() to new file msdosfs_rename.c.

No functional change.


# 1.108 23-Oct-2021 hannken

Factor out the lookup results from struct denode.

No functional change.


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


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base thorpej-i2c-spi-conf-base
# 1.106 18-Jul-2021 dholland

Abolish all the silly indirection macros for initializing vnode ops tables.

These are things of the form #define foofs_op genfs_op, or #define
foofs_op genfs_eopnotsupp, or similar. They serve no purpose besides
obfuscation, and have gotten cutpasted all over everywhere.


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


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-cfargs-base thorpej-futex-base
# 1.104 27-Jun-2020 christos

branches: 1.104.6;
Introduce genfs_pathconf() and use it for the default case in all filesystems.


# 1.103 16-May-2020 christos

Add ACL support for FFS. From FreeBSD.


Revision tags: bouyer-xenpvh-base2
# 1.102 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.


Revision tags: phil-wifi-20200421 bouyer-xenpvh-base1
# 1.101 13-Apr-2020 ad

Replace most uses of vp->v_usecount with a call to vrefcnt(vp), a function
that hides the details and does atomic_load_relaxed(). Signature matches
FreeBSD.


Revision tags: phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3
# 1.100 23-Feb-2020 ad

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


Revision tags: ad-namecache-base2 ad-namecache-base1 ad-namecache-base phil-wifi-20191119
# 1.99 18-Sep-2019 christos

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


Revision tags: netbsd-9-2-RELEASE netbsd-9-1-RELEASE netbsd-8-2-RELEASE netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 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
# 1.98 26-Apr-2017 riastradh

branches: 1.98.12;
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


Revision tags: pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320
# 1.97 01-Mar-2017 hannken

Remove now redundant calls to fstrans_start()/fstrans_done().


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
# 1.96 01-Feb-2016 christos

branches: 1.96.2; 1.96.4;
- split a long line.
- remove extra test.
- move d_namlen setting to msdosfs_vnops.c to avoid the ifdef.


# 1.95 01-Feb-2016 christos

We can't depend on dp->d_namlen existing for the parts that are used in
makefs(8).


# 1.94 30-Jan-2016 mlelstv

Add support to msdosfs and makefs to generate correct Unicode (UCS-2) directory
entries from UTF8 encoded file names.


Revision tags: nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606 nick-nhusb-base-20150406
# 1.93 04-Apr-2015 riastradh

Fix remaining read(fd, NULL, 1) cases.


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


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 tls-earlyentropy-base tls-maxphys-base
# 1.91 25-Jul-2014 dholland

branches: 1.91.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.90 08-Jul-2014 hannken

Change msdosfs from hashlist to vcache:
- Use (dir_cluster, dir_offset, dir_generation) as key, where
dir_generation is non-zero and unique for unlinked but open nodes.
- Change deget() to return a vnode as it is unsafe to return a
referenced but unlocked denode.


Revision tags: yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 rmind-smpnet-nbase rmind-smpnet-base
# 1.89 23-Jan-2014 hannken

branches: 1.89.2;
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.88 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.87 02-Nov-2013 hannken

Stop using v_mount of an unreferenced vnode -- save the mount while
the vnode has a reference.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base
# 1.86 18-Mar-2013 plunky

branches: 1.86.6;
C99 section 6.7.2.3 (Tags) Note 3 states that:

A type specifier of the form

enum identifier

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

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

(ok elad@)


Revision tags: yamt-pagecache-base8
# 1.85 28-Dec-2012 hannken

Move the initialization of n to after the error branch.

From Taylor R Campbell <riastradh@netbsd.org>


# 1.84 20-Dec-2012 hannken

Change bread() and breadn() to never return a buffer on
error and modify all callers to not brelse() on error.

Welcome to 6.99.16

PR kern/46282 (6.0_BETA crash: msdosfs_bmap -> pcbmap -> bread -> bio_doread)


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6 jmcneill-usbmp-base10 yamt-pagecache-base5
# 1.83 29-Apr-2012 chs

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


Revision tags: jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8
# 1.82 03-Apr-2012 njoly

Add missing braces in previous commit.


# 1.81 02-Apr-2012 njoly

Report the SF_ARCHIVED file flag if set.


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


Revision tags: 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
# 1.79 21-Nov-2011 hannken

branches: 1.79.2; 1.79.4;
Add missing fstrans_done().

Should fix PR #45635 (KASSERT "fli->fli_trans_cnt == 0" failed)


Revision tags: jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.78 20-Jul-2011 hannken

branches: 1.78.2;
Even though msdosfs never truncates file names it advertises _PC_NO_TRUNC
as zero. Make it advertise one (no_trunc == true).

Names longer than NAME_MAX (255) will never pass namei() btw.

Fixes PR #43670 (msdosfs claims support for filenames longer than {NAME_MAX},
but fails)


# 1.77 16-Jun-2011 hannken

Rename uvm_vnp_zerorange(struct vnode *, off_t, size_t) to
ubc_zerorange(struct uvm_object *, off_t, size_t, int) changing
the first argument to an uvm_object and adding a flags argument.

Modify tmpfs_reg_resize() to zero the backing store (aobj) instead
of the vnode. Ubc_purge() no longer panics when unmounting tmpfs.

Keep uvm_vnp_zerorange() until the next kernel version bump.


# 1.76 12-Jun-2011 rmind

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 rmind-uvmplock-base
# 1.75 26-Apr-2011 hannken

branches: 1.75.2;
Change vflushbuf() to return an error if a synchronous write fails.

Welcome to 5.99.51.


# 1.74 20-Mar-2011 hannken

When extending a file, either by truncating or by writing past EOF make
sure the unallocated remainder of the last page gets zeroed.

Detected by fsx.


# 1.73 19-Mar-2011 hannken

Remove a vnode reference leak from msdosfs_rename. Release tdvp if either
doscheckpath() or relookup() fails.

Adjust test fs/vfs/t_vnops.c and remove the link count test for msdos.

Fixes PR #44661


Revision tags: bouyer-quota2-nbase
# 1.72 03-Mar-2011 pooka

In rename, use char[12]�for new names instead of [11]. At least
one routine called from here (unix2dosfn) expects and uses all of
a [12].

This may fix the "stack size exceeded" problem which has been
triggering in gson's test runs. (i'm not entirely sure why it
doesn't trigger in anyone else's env)


Revision tags: bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231
# 1.71 02-Jan-2011 dholland

branches: 1.71.2; 1.71.4;
Remove the special refcount behavior (adding an extra reference to the
parent dir) associated with SAVESTART in relookup().

Check all call sites to make sure that SAVESTART wasn't set while
calling relookup(); if it was, adjust the refcount behavior. Remove
related references to SAVESTART.

The only code that was reaching the extra ref was msdosfs_rename,
where the refcount behavior was already fairly broken and/or gross;
repair it.

Add a dummy 4th argument to relookup to make sure code that hasn't
been inspected won't compile. (This will go away next time the
relookup semantics change, which they will.)


# 1.70 30-Nov-2010 dholland

Abolish the SAVENAME and HASBUF flags. There is now always a buffer,
so the path in a struct componentname is now always valid during VOP
calls.


# 1.69 30-Nov-2010 dholland

Abolish struct componentname's cn_pnbuf. Use the path buffer in the
pathbuf object passed to namei as work space instead. (For now a pnbuf
pointer appears in struct nameidata, to support certain unclean things
that haven't been fixed yet, but it will be going away in the future.)

This removes the need for the SAVENAME and HASBUF namei flags.


Revision tags: uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.68 22-Jul-2010 njoly

Remove bad cast, fix compilation with MSDOSFS_DEBUG.


# 1.67 24-Jun-2010 hannken

Clean up vnode lock operations pass 2:

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

Welcome to 5.99.32.

Discussed on tech-kern.


# 1.66 25-May-2010 pooka

Don't double unlock fvp if source file disappears during rename.
Problem found by njoly's awesome stresstester.


Revision tags: uebayasi-xip-base1
# 1.65 23-Apr-2010 pooka

Enforce RLIMIT_FSIZE before VOP_WRITE. This adds support to file
system drivers where it was missing from and fixes one buggy
implementation. The arguably weird semantics of the check are
maintained (v_size vs. va_bytes, overwrite).


# 1.64 09-Apr-2010 hannken

Add file system suspension support (vfs_suspend(9)) to msdosfs.

Reviewed by: Antti Kantee <pooka@netbsd.org>


# 1.63 08-Apr-2010 pooka

In genfs where available.

The only functional change is mknod now returning EOPNOTSUPP instead
of EINVAL. I make this sacrifice willingly and with a clean conscience.


# 1.62 08-Apr-2010 pooka

Use genfs instead of homegrown stuff where possible.


Revision tags: yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211 yamt-nfs-mp-base8 yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 jym-xensuspend-nbase
# 1.61 03-Jul-2009 elad

branches: 1.61.2; 1.61.4;
Where possible, extract the file-system's access() routine to two internal
functions: the first checking if the operation is possible (regardless of
permissions), the second checking file-system permissions, ACLs, etc.

Mailing list reference:

http://mail-index.netbsd.org/tech-kern/2009/06/21/msg005311.html


# 1.60 23-Jun-2009 elad

Move the implementation of vaccess() to genfs_can_access(), in line with
the other routines of the same spirit.

Adjust file-system code to use it.

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

No objections on tech-kern@:

http://mail-index.netbsd.org/tech-kern/2009/06/21/msg005310.html


Revision tags: yamt-nfs-mp-base5 yamt-nfs-mp-base4 jym-xensuspend-base
# 1.59 07-May-2009 elad

Extract the open-coded authorization logic for chtimes() from various
file-systems and put it in a single function, genfs_can_chtimes().

This also makes UDF follow the same policy as all other file-systems.

Mailing list reference:

http://mail-index.netbsd.org/tech-kern/2009/04/27/msg004951.html


Revision tags: yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.58 14-Mar-2009 dsl

ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.


Revision tags: nick-hppapmap-base2 mjf-devfs2-base
# 1.57 11-Jan-2009 cegger

branches: 1.57.2;
make this compile


# 1.56 11-Jan-2009 christos

merge christos-time_t


Revision tags: haad-dm-base2 haad-nbase2 ad-audiomp2-base christos-time_t-nbase christos-time_t-base haad-dm-base
# 1.55 28-Nov-2008 pooka

Tyop: v -> vp. Spotted by Tom's ARM builds.


# 1.54 26-Nov-2008 pooka

Rototill all remaining file systems to use ubc_uiomove() instead
of the ubc_alloc() - uiomove() - ubc_release() dance.


# 1.53 14-Nov-2008 pooka

In case writing past EOF, fail if extending the file fails (most
likely due to the file system being full).

Otherwise we'd fail in VOP_PUTPAGES(), which might not happen during
VOP_WRITE(), thus giving the caller the wrong impression that
writing was succesful.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE 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 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 wrstuden-revivesa-base
# 1.52 16-May-2008 hannken

branches: 1.52.4; 1.52.6; 1.52.10;
Make sure all cached buffers with valid, not yet written data have been
run through copy-on-write. Call fscow_run() with valid data where possible.

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

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

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

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

Welcome to 4.99.63

Reviewed by: YAMAMOTO Takashi <yamt@netbsd.org>


Revision tags: yamt-nfs-mp-base2
# 1.51 30-Apr-2008 ad

branches: 1.51.2;
Make various bits of debug code compile again.


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

branches: 1.50.2;
Network protocol interrupts can now block on locks, so merge the globals
proclist_mutex and proclist_lock into a single adaptive mutex (proc_lock).
Implications:

- Inspecting process state requires thread context, so signals can no longer
be sent from a hardware interrupt handler. Signal activity must be
deferred to a soft interrupt or kthread.

- As the proc state locking is simplified, it's now safe to take exit()
and wait() out from under kernel_lock.

- The system spends less time at IPL_SCHED, and there is less lock activity.


Revision tags: yamt-pf42-baseX yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase nick-net80211-sync-base keiichi-mipv6-base matt-armv6-nbase mjf-devfs-base hpcarm-cleanup-base
# 1.49 30-Jan-2008 ad

branches: 1.49.6; 1.49.8;
Replace struct lock on vnodes with a simpler lock object built on
krwlock_t. This is a step towards removing lockmgr and simplifying
vnode locking. Discussed on tech-kern.


# 1.48 25-Jan-2008 ad

Remove VOP_LEASE. Discussed on tech-kern.


Revision tags: bouyer-xeni386-nbase bouyer-xeni386-base matt-armv6-base
# 1.47 05-Jan-2008 christos

PR/37696: Paul Ripke: add large read / readahead support (Introduce run-length
detection to msdosfs_bmap(), from FreeBSD)


# 1.46 02-Jan-2008 ad

Merge vmlocking2 to head.


# 1.45 28-Dec-2007 reinoud

Use uvm_vnp_setwritesize() on file extending to instruct UVM to NOT read-in
the newly added space first. This significantly speeds up write speed for
msdosfs and making it at par with ffs wich already had this patched.

Speed increase measured on my IDE disc from 2Mb/sec to 32 Mb/sec


Revision tags: vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 vmlocking-nbase jmcneill-pm-base reinoud-bufcleanup-base
# 1.44 26-Nov-2007 pooka

branches: 1.44.2; 1.44.6;
Remove the "struct lwp *" argument from all VFS and VOP interfaces.
The general trend is to remove it from all kernel interfaces and
this is a start. In case the calling lwp is desired, curlwp should
be used.

quick consensus on tech-kern


Revision tags: bouyer-xenamd64-base2 bouyer-xenamd64-base
# 1.43 14-Nov-2007 pooka

Fix a problem noticed by Reinoud: the fs would try to release an
unlocked vnode when trying to rename a directory. The fix was to
shuffle some bits around and #pray.

The rename routine actually needs a very very major wide-angle whopping:
* it takes locks out-of-order
* it deals with references from SAVESTART lookups in interesting ways
* I doubt there is any guarantee for correct operation if there
are multiple concurrent accesses
* the error branches might just as well call panic() directly


Revision tags: jmcneill-base yamt-x86pmap-base4 yamt-x86pmap-base3 vmlocking-base
# 1.42 08-Oct-2007 ad

branches: 1.42.2; 1.42.4;
Merge brelse() changes from the vmlocking branch.


Revision tags: yamt-x86pmap-base2
# 1.41 24-Sep-2007 rumble

Avoid stack allocation of large dirent structures in foo_readdir().


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base matt-mips64-base
# 1.40 29-Jul-2007 rumble

branches: 1.40.4; 1.40.6; 1.40.8; 1.40.10;
Use _DIRENT_MINSIZE when determining the number of NFS cookies to allocate,
rather than hard-coding 16.


Revision tags: nick-csl-alignment-base yamt-idlelwp-base8 mjf-ufs-trans-base
# 1.39 19-Apr-2007 yamt

branches: 1.39.2;
hold proclist_mutex when calling psignal().


Revision tags: thorpej-atomic-base
# 1.38 04-Mar-2007 christos

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


Revision tags: ad-audiomp-base
# 1.37 21-Feb-2007 thorpej

Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.


Revision tags: post-newlock2-merge newlock2-nbase newlock2-base
# 1.36 04-Jan-2007 elad

branches: 1.36.2;
Consistent usage of KAUTH_GENERIC_ISSUSER.


Revision tags: yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3
# 1.35 09-Dec-2006 chs

a smorgasbord of improvements to vnode locking and path lookup:
- LOCKPARENT is no longer relevant for lookup(), relookup() or VOP_LOOKUP().
these now always return the parent vnode locked. namei() works as before.
lookup() and various other paths no longer acquire vnode locks in the
wrong order via vrele(). fixes PR 32535.
as a nice side effect, path lookup is also up to 25% faster.
- the above allows us to get rid of PDIRUNLOCK.
- also get rid of WANTPARENT (just use LOCKPARENT and unlock it).
- remove an assumption in layer_node_find() that all file systems implement
a recursive VOP_LOCK() (unionfs doesn't).
- require that all file systems supply vfs_vptofh and vfs_fhtovp routines.
fill in eopnotsupp() for file systems that don't support being exported
and remove the checks for NULL. (layerfs calls these without checking.)
- in union_lookup1(), don't change refcounts in the ISDOTDOT case, just
adjust which vnode is locked. fixes PR 33374.
- apply fixes for ufs_rename() from ufs_vnops.c rev. 1.61 to ext2fs_rename().


Revision tags: netbsd-4-base
# 1.34 25-Nov-2006 scw

branches: 1.34.2;
Support FAT filesystems on non-DEV_BSIZE media.

Based on the patches provided in PR kern/17398 by Trevin Beattie.


# 1.33 16-Nov-2006 christos

__unused removal on arguments; approved by core.


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

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


# 1.31 22-Sep-2006 xtraeme

Apply patch from PR kern/34583 sent by Rhialto, quoting him:

"Add a 3rd entry in the cache, which keeps the end position
from just before extending a file.
This has the desired effect of keeping the write speed constant."

And yes, that helps a lot copying large files... always at full speed
now. This closes my PR kern/30868 "Poor performance copying large files
on msdosfs".

Also remove a 2 if-statements testing the same condition, combine them.

All that from Rhialto, thank you very much.


Revision tags: abandoned-netbsd-4-base yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 rpaulo-netinet-merge-pcb-base
# 1.30 23-Jul-2006 ad

branches: 1.30.2; 1.30.4; 1.30.6;
Use the LWP cached credentials where sane.


Revision tags: yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base chap-midi-base
# 1.29 07-Jun-2006 kardel

merge FreeBSD timecounters from branch simonb-timecounters
- struct timeval time is gone
time.tv_sec -> time_second
- struct timeval mono_time is gone
mono_time.tv_sec -> time_uptime
- access to time via
{get,}{micro,nano,bin}time()
get* versions are fast but less precise
- support NTP nanokernel implementation (NTP API 4)
- further reading:
Timecounter Paper: http://phk.freebsd.dk/pubs/timecounter.pdf
NTP Nanokernel: http://www.eecis.udel.edu/~mills/ntp/html/kern.html


Revision tags: yamt-pdpolicy-base5 simonb-timecounters-base
# 1.28 14-May-2006 elad

branches: 1.28.2;
integrate kauth.


Revision tags: elad-kernelauth-base
# 1.27 14-Apr-2006 christos

Coveriry CID 733: Remove dead code.


Revision tags: yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 yamt-pdpolicy-base
# 1.26 01-Mar-2006 yamt

branches: 1.26.2; 1.26.4; 1.26.6;
merge yamt-uio_vmspace branch.

- use vmspace rather than proc or lwp where appropriate.
the latter is more natural to specify an address space.
(and less likely to be abused for random purposes.)
- fix a swdmover race.


Revision tags: yamt-uio_vmspace-base5
# 1.25 14-Jan-2006 christos

branches: 1.25.2; 1.25.4;
Protect against uio_lwp being NULL from Pavel Cahyna


# 1.24 11-Dec-2005 christos

branches: 1.24.2;
merge ktrace-lwp.


Revision tags: ktrace-lwp-base
# 1.23 29-Nov-2005 yamt

merge yamt-readahead branch.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-base
# 1.22 04-Nov-2005 christos

branches: 1.22.2;
PR/32003: Brian Buhrow: msdosfs doesn't properly zero out high cluster data
on non-FAT32 msdos filesystems.


# 1.21 02-Nov-2005 yamt

merge yamt-vop branch. remove following VOPs.

VOP_BLKATOFF
VOP_VALLOC
VOP_BALLOC
VOP_REALLOCBLKS
VOP_VFREE
VOP_TRUNCATE
VOP_UPDATE


Revision tags: yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base
# 1.20 12-Sep-2005 christos

branches: 1.20.2;
Use nanotime() to update the time fields in filesystems. Convert the code
from macros to real functions. Original patch and review from chuq.
Note: ext2fs only keeps seconds in the on-disk inode, and msdosfs does not
have enough precision for all fields, so this is not very useful for those
two.


# 1.19 10-Sep-2005 christos

Make fileno calculations use ino_t variables.


# 1.18 29-Aug-2005 xtraeme

Remove __P()


# 1.17 29-Aug-2005 xtraeme

The maximum file size on MS-DOS filesystems is 4 GB - 1 byte, so
don't bother trying to write files bigger than this. Just return
EFBIG to caller, rather than panic()ing later.

From OpenBSD.

This closes my PR kern/30864: "panic when copying files of >4GB on msdosfs"


# 1.16 19-Aug-2005 christos

fileid is now a quad.


# 1.15 19-Aug-2005 christos

64 bit inode changes.


Revision tags: yamt-km-base4 yamt-km-base3 netbsd-3-base kent-audio2-base
# 1.14 26-Feb-2005 perry

branches: 1.14.2; 1.14.4;
nuke trailing whitespace


Revision tags: yamt-km-base2 yamt-km-base kent-audio1-beforemerge
# 1.13 09-Jan-2005 chs

branches: 1.13.2; 1.13.4;
adjust the UBC mapping code to support non-vnode uvm_objects.
this means we can no longer look at the vnode size to determine how many
pages to request in a fault, which is good since for NFS the size can change
out from under us on the server anyway. there's also a new flag UBC_UNMAP
for ubc_release(), so that the file system code can make the decision about
whether to cache mappings for files being used as executables.


Revision tags: kent-audio1-base
# 1.12 13-Sep-2004 jdolecek

set mp->mnt_stat.f_namemax on filesystem mount for use by statvfs, and use
the value for also pathconf(_PC_NAME_MAX) to keep the two in sync


# 1.11 12-May-2004 jrf

caddr_t -> void * and removal of some more casts.


# 1.10 04-May-2004 jrf

Remove caddr_t inlines. Approved by christos@NetBSD.org.


Revision tags: netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.9 26-Jan-2004 hannken

branches: 1.9.2; 1.9.4;
Fix xxx_strategy() to use the vnode arg instead of bp->b_vp.


# 1.8 25-Jan-2004 hannken

Make VOP_STRATEGY(bp) a real VOP as discussed on tech-kern.

VOP_STRATEGY(bp) is replaced by one of two new functions:

- VOP_STRATEGY(vp, bp) Call the strategy routine of vp for bp.
- DEV_STRATEGY(bp) Call the d_strategy routine of bp->b_dev for bp.

DEV_STRATEGY(bp) is used only for block-to-block device situations.


# 1.7 07-Sep-2003 itojun

add -t option for gmt time offset (normally MS-DOS filesystem has timestamp
in localtime, not GMT). PR kern/22717


# 1.6 02-Aug-2003 jdolecek

Allow separate masks for files and directories. Useful e.g. to turn
the execute bit off for files, but keep search permission for directories.
Change contributed in PR kern/21538 by Pavel Arnost, based on some FreeBSD
patches.
Further manpage changes, and backward-compatibility adjustments done by me.

Also fixes PR kern/16778 by Johan Danielsson, and PR kern/3400 by Rick Byers


# 1.5 29-Jun-2003 fvdl

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


# 1.4 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.3 26-Jun-2003 itojun

strlcpy


# 1.2 25-Feb-2003 jdolecek

make 'dosdirtemplate' static const


Revision tags: nathanw_sa_before_merge fvdl_fs64_base nathanw_sa_base
# 1.1 26-Dec-2002 jdolecek

branches: 1.1.2;
move msdosfs code from sys/msdosfs to sys/fs/msdosfs


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


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base thorpej-i2c-spi-conf-base
# 1.106 18-Jul-2021 dholland

Abolish all the silly indirection macros for initializing vnode ops tables.

These are things of the form #define foofs_op genfs_op, or #define
foofs_op genfs_eopnotsupp, or similar. They serve no purpose besides
obfuscation, and have gotten cutpasted all over everywhere.


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


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-cfargs-base thorpej-futex-base
# 1.104 27-Jun-2020 christos

branches: 1.104.6;
Introduce genfs_pathconf() and use it for the default case in all filesystems.


# 1.103 16-May-2020 christos

Add ACL support for FFS. From FreeBSD.


Revision tags: bouyer-xenpvh-base2
# 1.102 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.


Revision tags: phil-wifi-20200421 bouyer-xenpvh-base1
# 1.101 13-Apr-2020 ad

Replace most uses of vp->v_usecount with a call to vrefcnt(vp), a function
that hides the details and does atomic_load_relaxed(). Signature matches
FreeBSD.


Revision tags: phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3
# 1.100 23-Feb-2020 ad

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


Revision tags: ad-namecache-base2 ad-namecache-base1 ad-namecache-base phil-wifi-20191119
# 1.99 18-Sep-2019 christos

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


Revision tags: netbsd-9-2-RELEASE netbsd-9-1-RELEASE netbsd-8-2-RELEASE netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 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
# 1.98 26-Apr-2017 riastradh

branches: 1.98.12;
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


Revision tags: pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320
# 1.97 01-Mar-2017 hannken

Remove now redundant calls to fstrans_start()/fstrans_done().


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
# 1.96 01-Feb-2016 christos

branches: 1.96.2; 1.96.4;
- split a long line.
- remove extra test.
- move d_namlen setting to msdosfs_vnops.c to avoid the ifdef.


# 1.95 01-Feb-2016 christos

We can't depend on dp->d_namlen existing for the parts that are used in
makefs(8).


# 1.94 30-Jan-2016 mlelstv

Add support to msdosfs and makefs to generate correct Unicode (UCS-2) directory
entries from UTF8 encoded file names.


Revision tags: nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606 nick-nhusb-base-20150406
# 1.93 04-Apr-2015 riastradh

Fix remaining read(fd, NULL, 1) cases.


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


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 tls-earlyentropy-base tls-maxphys-base
# 1.91 25-Jul-2014 dholland

branches: 1.91.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.90 08-Jul-2014 hannken

Change msdosfs from hashlist to vcache:
- Use (dir_cluster, dir_offset, dir_generation) as key, where
dir_generation is non-zero and unique for unlinked but open nodes.
- Change deget() to return a vnode as it is unsafe to return a
referenced but unlocked denode.


Revision tags: yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 rmind-smpnet-nbase rmind-smpnet-base
# 1.89 23-Jan-2014 hannken

branches: 1.89.2;
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.88 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.87 02-Nov-2013 hannken

Stop using v_mount of an unreferenced vnode -- save the mount while
the vnode has a reference.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base
# 1.86 18-Mar-2013 plunky

branches: 1.86.6;
C99 section 6.7.2.3 (Tags) Note 3 states that:

A type specifier of the form

enum identifier

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

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

(ok elad@)


Revision tags: yamt-pagecache-base8
# 1.85 28-Dec-2012 hannken

Move the initialization of n to after the error branch.

From Taylor R Campbell <riastradh@netbsd.org>


# 1.84 20-Dec-2012 hannken

Change bread() and breadn() to never return a buffer on
error and modify all callers to not brelse() on error.

Welcome to 6.99.16

PR kern/46282 (6.0_BETA crash: msdosfs_bmap -> pcbmap -> bread -> bio_doread)


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6 jmcneill-usbmp-base10 yamt-pagecache-base5
# 1.83 29-Apr-2012 chs

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


Revision tags: jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8
# 1.82 03-Apr-2012 njoly

Add missing braces in previous commit.


# 1.81 02-Apr-2012 njoly

Report the SF_ARCHIVED file flag if set.


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


Revision tags: 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
# 1.79 21-Nov-2011 hannken

branches: 1.79.2; 1.79.4;
Add missing fstrans_done().

Should fix PR #45635 (KASSERT "fli->fli_trans_cnt == 0" failed)


Revision tags: jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.78 20-Jul-2011 hannken

branches: 1.78.2;
Even though msdosfs never truncates file names it advertises _PC_NO_TRUNC
as zero. Make it advertise one (no_trunc == true).

Names longer than NAME_MAX (255) will never pass namei() btw.

Fixes PR #43670 (msdosfs claims support for filenames longer than {NAME_MAX},
but fails)


# 1.77 16-Jun-2011 hannken

Rename uvm_vnp_zerorange(struct vnode *, off_t, size_t) to
ubc_zerorange(struct uvm_object *, off_t, size_t, int) changing
the first argument to an uvm_object and adding a flags argument.

Modify tmpfs_reg_resize() to zero the backing store (aobj) instead
of the vnode. Ubc_purge() no longer panics when unmounting tmpfs.

Keep uvm_vnp_zerorange() until the next kernel version bump.


# 1.76 12-Jun-2011 rmind

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 rmind-uvmplock-base
# 1.75 26-Apr-2011 hannken

branches: 1.75.2;
Change vflushbuf() to return an error if a synchronous write fails.

Welcome to 5.99.51.


# 1.74 20-Mar-2011 hannken

When extending a file, either by truncating or by writing past EOF make
sure the unallocated remainder of the last page gets zeroed.

Detected by fsx.


# 1.73 19-Mar-2011 hannken

Remove a vnode reference leak from msdosfs_rename. Release tdvp if either
doscheckpath() or relookup() fails.

Adjust test fs/vfs/t_vnops.c and remove the link count test for msdos.

Fixes PR #44661


Revision tags: bouyer-quota2-nbase
# 1.72 03-Mar-2011 pooka

In rename, use char[12]�for new names instead of [11]. At least
one routine called from here (unix2dosfn) expects and uses all of
a [12].

This may fix the "stack size exceeded" problem which has been
triggering in gson's test runs. (i'm not entirely sure why it
doesn't trigger in anyone else's env)


Revision tags: bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231
# 1.71 02-Jan-2011 dholland

branches: 1.71.2; 1.71.4;
Remove the special refcount behavior (adding an extra reference to the
parent dir) associated with SAVESTART in relookup().

Check all call sites to make sure that SAVESTART wasn't set while
calling relookup(); if it was, adjust the refcount behavior. Remove
related references to SAVESTART.

The only code that was reaching the extra ref was msdosfs_rename,
where the refcount behavior was already fairly broken and/or gross;
repair it.

Add a dummy 4th argument to relookup to make sure code that hasn't
been inspected won't compile. (This will go away next time the
relookup semantics change, which they will.)


# 1.70 30-Nov-2010 dholland

Abolish the SAVENAME and HASBUF flags. There is now always a buffer,
so the path in a struct componentname is now always valid during VOP
calls.


# 1.69 30-Nov-2010 dholland

Abolish struct componentname's cn_pnbuf. Use the path buffer in the
pathbuf object passed to namei as work space instead. (For now a pnbuf
pointer appears in struct nameidata, to support certain unclean things
that haven't been fixed yet, but it will be going away in the future.)

This removes the need for the SAVENAME and HASBUF namei flags.


Revision tags: uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.68 22-Jul-2010 njoly

Remove bad cast, fix compilation with MSDOSFS_DEBUG.


# 1.67 24-Jun-2010 hannken

Clean up vnode lock operations pass 2:

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

Welcome to 5.99.32.

Discussed on tech-kern.


# 1.66 25-May-2010 pooka

Don't double unlock fvp if source file disappears during rename.
Problem found by njoly's awesome stresstester.


Revision tags: uebayasi-xip-base1
# 1.65 23-Apr-2010 pooka

Enforce RLIMIT_FSIZE before VOP_WRITE. This adds support to file
system drivers where it was missing from and fixes one buggy
implementation. The arguably weird semantics of the check are
maintained (v_size vs. va_bytes, overwrite).


# 1.64 09-Apr-2010 hannken

Add file system suspension support (vfs_suspend(9)) to msdosfs.

Reviewed by: Antti Kantee <pooka@netbsd.org>


# 1.63 08-Apr-2010 pooka

In genfs where available.

The only functional change is mknod now returning EOPNOTSUPP instead
of EINVAL. I make this sacrifice willingly and with a clean conscience.


# 1.62 08-Apr-2010 pooka

Use genfs instead of homegrown stuff where possible.


Revision tags: yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211 yamt-nfs-mp-base8 yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 jym-xensuspend-nbase
# 1.61 03-Jul-2009 elad

branches: 1.61.2; 1.61.4;
Where possible, extract the file-system's access() routine to two internal
functions: the first checking if the operation is possible (regardless of
permissions), the second checking file-system permissions, ACLs, etc.

Mailing list reference:

http://mail-index.netbsd.org/tech-kern/2009/06/21/msg005311.html


# 1.60 23-Jun-2009 elad

Move the implementation of vaccess() to genfs_can_access(), in line with
the other routines of the same spirit.

Adjust file-system code to use it.

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

No objections on tech-kern@:

http://mail-index.netbsd.org/tech-kern/2009/06/21/msg005310.html


Revision tags: yamt-nfs-mp-base5 yamt-nfs-mp-base4 jym-xensuspend-base
# 1.59 07-May-2009 elad

Extract the open-coded authorization logic for chtimes() from various
file-systems and put it in a single function, genfs_can_chtimes().

This also makes UDF follow the same policy as all other file-systems.

Mailing list reference:

http://mail-index.netbsd.org/tech-kern/2009/04/27/msg004951.html


Revision tags: yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.58 14-Mar-2009 dsl

ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.


Revision tags: nick-hppapmap-base2 mjf-devfs2-base
# 1.57 11-Jan-2009 cegger

branches: 1.57.2;
make this compile


# 1.56 11-Jan-2009 christos

merge christos-time_t


Revision tags: haad-dm-base2 haad-nbase2 ad-audiomp2-base christos-time_t-nbase christos-time_t-base haad-dm-base
# 1.55 28-Nov-2008 pooka

Tyop: v -> vp. Spotted by Tom's ARM builds.


# 1.54 26-Nov-2008 pooka

Rototill all remaining file systems to use ubc_uiomove() instead
of the ubc_alloc() - uiomove() - ubc_release() dance.


# 1.53 14-Nov-2008 pooka

In case writing past EOF, fail if extending the file fails (most
likely due to the file system being full).

Otherwise we'd fail in VOP_PUTPAGES(), which might not happen during
VOP_WRITE(), thus giving the caller the wrong impression that
writing was succesful.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE 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 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 wrstuden-revivesa-base
# 1.52 16-May-2008 hannken

branches: 1.52.4; 1.52.6; 1.52.10;
Make sure all cached buffers with valid, not yet written data have been
run through copy-on-write. Call fscow_run() with valid data where possible.

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

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

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

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

Welcome to 4.99.63

Reviewed by: YAMAMOTO Takashi <yamt@netbsd.org>


Revision tags: yamt-nfs-mp-base2
# 1.51 30-Apr-2008 ad

branches: 1.51.2;
Make various bits of debug code compile again.


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

branches: 1.50.2;
Network protocol interrupts can now block on locks, so merge the globals
proclist_mutex and proclist_lock into a single adaptive mutex (proc_lock).
Implications:

- Inspecting process state requires thread context, so signals can no longer
be sent from a hardware interrupt handler. Signal activity must be
deferred to a soft interrupt or kthread.

- As the proc state locking is simplified, it's now safe to take exit()
and wait() out from under kernel_lock.

- The system spends less time at IPL_SCHED, and there is less lock activity.


Revision tags: yamt-pf42-baseX yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase nick-net80211-sync-base keiichi-mipv6-base matt-armv6-nbase mjf-devfs-base hpcarm-cleanup-base
# 1.49 30-Jan-2008 ad

branches: 1.49.6; 1.49.8;
Replace struct lock on vnodes with a simpler lock object built on
krwlock_t. This is a step towards removing lockmgr and simplifying
vnode locking. Discussed on tech-kern.


# 1.48 25-Jan-2008 ad

Remove VOP_LEASE. Discussed on tech-kern.


Revision tags: bouyer-xeni386-nbase bouyer-xeni386-base matt-armv6-base
# 1.47 05-Jan-2008 christos

PR/37696: Paul Ripke: add large read / readahead support (Introduce run-length
detection to msdosfs_bmap(), from FreeBSD)


# 1.46 02-Jan-2008 ad

Merge vmlocking2 to head.


# 1.45 28-Dec-2007 reinoud

Use uvm_vnp_setwritesize() on file extending to instruct UVM to NOT read-in
the newly added space first. This significantly speeds up write speed for
msdosfs and making it at par with ffs wich already had this patched.

Speed increase measured on my IDE disc from 2Mb/sec to 32 Mb/sec


Revision tags: vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 vmlocking-nbase jmcneill-pm-base reinoud-bufcleanup-base
# 1.44 26-Nov-2007 pooka

branches: 1.44.2; 1.44.6;
Remove the "struct lwp *" argument from all VFS and VOP interfaces.
The general trend is to remove it from all kernel interfaces and
this is a start. In case the calling lwp is desired, curlwp should
be used.

quick consensus on tech-kern


Revision tags: bouyer-xenamd64-base2 bouyer-xenamd64-base
# 1.43 14-Nov-2007 pooka

Fix a problem noticed by Reinoud: the fs would try to release an
unlocked vnode when trying to rename a directory. The fix was to
shuffle some bits around and #pray.

The rename routine actually needs a very very major wide-angle whopping:
* it takes locks out-of-order
* it deals with references from SAVESTART lookups in interesting ways
* I doubt there is any guarantee for correct operation if there
are multiple concurrent accesses
* the error branches might just as well call panic() directly


Revision tags: jmcneill-base yamt-x86pmap-base4 yamt-x86pmap-base3 vmlocking-base
# 1.42 08-Oct-2007 ad

branches: 1.42.2; 1.42.4;
Merge brelse() changes from the vmlocking branch.


Revision tags: yamt-x86pmap-base2
# 1.41 24-Sep-2007 rumble

Avoid stack allocation of large dirent structures in foo_readdir().


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base matt-mips64-base
# 1.40 29-Jul-2007 rumble

branches: 1.40.4; 1.40.6; 1.40.8; 1.40.10;
Use _DIRENT_MINSIZE when determining the number of NFS cookies to allocate,
rather than hard-coding 16.


Revision tags: nick-csl-alignment-base yamt-idlelwp-base8 mjf-ufs-trans-base
# 1.39 19-Apr-2007 yamt

branches: 1.39.2;
hold proclist_mutex when calling psignal().


Revision tags: thorpej-atomic-base
# 1.38 04-Mar-2007 christos

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


Revision tags: ad-audiomp-base
# 1.37 21-Feb-2007 thorpej

Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.


Revision tags: post-newlock2-merge newlock2-nbase newlock2-base
# 1.36 04-Jan-2007 elad

branches: 1.36.2;
Consistent usage of KAUTH_GENERIC_ISSUSER.


Revision tags: yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3
# 1.35 09-Dec-2006 chs

a smorgasbord of improvements to vnode locking and path lookup:
- LOCKPARENT is no longer relevant for lookup(), relookup() or VOP_LOOKUP().
these now always return the parent vnode locked. namei() works as before.
lookup() and various other paths no longer acquire vnode locks in the
wrong order via vrele(). fixes PR 32535.
as a nice side effect, path lookup is also up to 25% faster.
- the above allows us to get rid of PDIRUNLOCK.
- also get rid of WANTPARENT (just use LOCKPARENT and unlock it).
- remove an assumption in layer_node_find() that all file systems implement
a recursive VOP_LOCK() (unionfs doesn't).
- require that all file systems supply vfs_vptofh and vfs_fhtovp routines.
fill in eopnotsupp() for file systems that don't support being exported
and remove the checks for NULL. (layerfs calls these without checking.)
- in union_lookup1(), don't change refcounts in the ISDOTDOT case, just
adjust which vnode is locked. fixes PR 33374.
- apply fixes for ufs_rename() from ufs_vnops.c rev. 1.61 to ext2fs_rename().


Revision tags: netbsd-4-base
# 1.34 25-Nov-2006 scw

branches: 1.34.2;
Support FAT filesystems on non-DEV_BSIZE media.

Based on the patches provided in PR kern/17398 by Trevin Beattie.


# 1.33 16-Nov-2006 christos

__unused removal on arguments; approved by core.


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

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


# 1.31 22-Sep-2006 xtraeme

Apply patch from PR kern/34583 sent by Rhialto, quoting him:

"Add a 3rd entry in the cache, which keeps the end position
from just before extending a file.
This has the desired effect of keeping the write speed constant."

And yes, that helps a lot copying large files... always at full speed
now. This closes my PR kern/30868 "Poor performance copying large files
on msdosfs".

Also remove a 2 if-statements testing the same condition, combine them.

All that from Rhialto, thank you very much.


Revision tags: abandoned-netbsd-4-base yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 rpaulo-netinet-merge-pcb-base
# 1.30 23-Jul-2006 ad

branches: 1.30.2; 1.30.4; 1.30.6;
Use the LWP cached credentials where sane.


Revision tags: yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base chap-midi-base
# 1.29 07-Jun-2006 kardel

merge FreeBSD timecounters from branch simonb-timecounters
- struct timeval time is gone
time.tv_sec -> time_second
- struct timeval mono_time is gone
mono_time.tv_sec -> time_uptime
- access to time via
{get,}{micro,nano,bin}time()
get* versions are fast but less precise
- support NTP nanokernel implementation (NTP API 4)
- further reading:
Timecounter Paper: http://phk.freebsd.dk/pubs/timecounter.pdf
NTP Nanokernel: http://www.eecis.udel.edu/~mills/ntp/html/kern.html


Revision tags: yamt-pdpolicy-base5 simonb-timecounters-base
# 1.28 14-May-2006 elad

branches: 1.28.2;
integrate kauth.


Revision tags: elad-kernelauth-base
# 1.27 14-Apr-2006 christos

Coveriry CID 733: Remove dead code.


Revision tags: yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 yamt-pdpolicy-base
# 1.26 01-Mar-2006 yamt

branches: 1.26.2; 1.26.4; 1.26.6;
merge yamt-uio_vmspace branch.

- use vmspace rather than proc or lwp where appropriate.
the latter is more natural to specify an address space.
(and less likely to be abused for random purposes.)
- fix a swdmover race.


Revision tags: yamt-uio_vmspace-base5
# 1.25 14-Jan-2006 christos

branches: 1.25.2; 1.25.4;
Protect against uio_lwp being NULL from Pavel Cahyna


# 1.24 11-Dec-2005 christos

branches: 1.24.2;
merge ktrace-lwp.


Revision tags: ktrace-lwp-base
# 1.23 29-Nov-2005 yamt

merge yamt-readahead branch.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-base
# 1.22 04-Nov-2005 christos

branches: 1.22.2;
PR/32003: Brian Buhrow: msdosfs doesn't properly zero out high cluster data
on non-FAT32 msdos filesystems.


# 1.21 02-Nov-2005 yamt

merge yamt-vop branch. remove following VOPs.

VOP_BLKATOFF
VOP_VALLOC
VOP_BALLOC
VOP_REALLOCBLKS
VOP_VFREE
VOP_TRUNCATE
VOP_UPDATE


Revision tags: yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base
# 1.20 12-Sep-2005 christos

branches: 1.20.2;
Use nanotime() to update the time fields in filesystems. Convert the code
from macros to real functions. Original patch and review from chuq.
Note: ext2fs only keeps seconds in the on-disk inode, and msdosfs does not
have enough precision for all fields, so this is not very useful for those
two.


# 1.19 10-Sep-2005 christos

Make fileno calculations use ino_t variables.


# 1.18 29-Aug-2005 xtraeme

Remove __P()


# 1.17 29-Aug-2005 xtraeme

The maximum file size on MS-DOS filesystems is 4 GB - 1 byte, so
don't bother trying to write files bigger than this. Just return
EFBIG to caller, rather than panic()ing later.

From OpenBSD.

This closes my PR kern/30864: "panic when copying files of >4GB on msdosfs"


# 1.16 19-Aug-2005 christos

fileid is now a quad.


# 1.15 19-Aug-2005 christos

64 bit inode changes.


Revision tags: yamt-km-base4 yamt-km-base3 netbsd-3-base kent-audio2-base
# 1.14 26-Feb-2005 perry

branches: 1.14.2; 1.14.4;
nuke trailing whitespace


Revision tags: yamt-km-base2 yamt-km-base kent-audio1-beforemerge
# 1.13 09-Jan-2005 chs

branches: 1.13.2; 1.13.4;
adjust the UBC mapping code to support non-vnode uvm_objects.
this means we can no longer look at the vnode size to determine how many
pages to request in a fault, which is good since for NFS the size can change
out from under us on the server anyway. there's also a new flag UBC_UNMAP
for ubc_release(), so that the file system code can make the decision about
whether to cache mappings for files being used as executables.


Revision tags: kent-audio1-base
# 1.12 13-Sep-2004 jdolecek

set mp->mnt_stat.f_namemax on filesystem mount for use by statvfs, and use
the value for also pathconf(_PC_NAME_MAX) to keep the two in sync


# 1.11 12-May-2004 jrf

caddr_t -> void * and removal of some more casts.


# 1.10 04-May-2004 jrf

Remove caddr_t inlines. Approved by christos@NetBSD.org.


Revision tags: netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.9 26-Jan-2004 hannken

branches: 1.9.2; 1.9.4;
Fix xxx_strategy() to use the vnode arg instead of bp->b_vp.


# 1.8 25-Jan-2004 hannken

Make VOP_STRATEGY(bp) a real VOP as discussed on tech-kern.

VOP_STRATEGY(bp) is replaced by one of two new functions:

- VOP_STRATEGY(vp, bp) Call the strategy routine of vp for bp.
- DEV_STRATEGY(bp) Call the d_strategy routine of bp->b_dev for bp.

DEV_STRATEGY(bp) is used only for block-to-block device situations.


# 1.7 07-Sep-2003 itojun

add -t option for gmt time offset (normally MS-DOS filesystem has timestamp
in localtime, not GMT). PR kern/22717


# 1.6 02-Aug-2003 jdolecek

Allow separate masks for files and directories. Useful e.g. to turn
the execute bit off for files, but keep search permission for directories.
Change contributed in PR kern/21538 by Pavel Arnost, based on some FreeBSD
patches.
Further manpage changes, and backward-compatibility adjustments done by me.

Also fixes PR kern/16778 by Johan Danielsson, and PR kern/3400 by Rick Byers


# 1.5 29-Jun-2003 fvdl

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


# 1.4 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.3 26-Jun-2003 itojun

strlcpy


# 1.2 25-Feb-2003 jdolecek

make 'dosdirtemplate' static const


Revision tags: nathanw_sa_before_merge fvdl_fs64_base nathanw_sa_base
# 1.1 26-Dec-2002 jdolecek

branches: 1.1.2;
move msdosfs code from sys/msdosfs to sys/fs/msdosfs


# 1.106 18-Jul-2021 dholland

Abolish all the silly indirection macros for initializing vnode ops tables.

These are things of the form #define foofs_op genfs_op, or #define
foofs_op genfs_eopnotsupp, or similar. They serve no purpose besides
obfuscation, and have gotten cutpasted all over everywhere.


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


Revision tags: 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
# 1.104 27-Jun-2020 christos

Introduce genfs_pathconf() and use it for the default case in all filesystems.


# 1.103 16-May-2020 christos

Add ACL support for FFS. From FreeBSD.


Revision tags: bouyer-xenpvh-base2
# 1.102 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.


Revision tags: phil-wifi-20200421 bouyer-xenpvh-base1
# 1.101 13-Apr-2020 ad

Replace most uses of vp->v_usecount with a call to vrefcnt(vp), a function
that hides the details and does atomic_load_relaxed(). Signature matches
FreeBSD.


Revision tags: phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3
# 1.100 23-Feb-2020 ad

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


Revision tags: ad-namecache-base2 ad-namecache-base1 ad-namecache-base phil-wifi-20191119
# 1.99 18-Sep-2019 christos

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


Revision tags: netbsd-9-2-RELEASE netbsd-9-1-RELEASE netbsd-8-2-RELEASE netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 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
# 1.98 26-Apr-2017 riastradh

branches: 1.98.12;
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


Revision tags: pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320
# 1.97 01-Mar-2017 hannken

Remove now redundant calls to fstrans_start()/fstrans_done().


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
# 1.96 01-Feb-2016 christos

branches: 1.96.2; 1.96.4;
- split a long line.
- remove extra test.
- move d_namlen setting to msdosfs_vnops.c to avoid the ifdef.


# 1.95 01-Feb-2016 christos

We can't depend on dp->d_namlen existing for the parts that are used in
makefs(8).


# 1.94 30-Jan-2016 mlelstv

Add support to msdosfs and makefs to generate correct Unicode (UCS-2) directory
entries from UTF8 encoded file names.


Revision tags: nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606 nick-nhusb-base-20150406
# 1.93 04-Apr-2015 riastradh

Fix remaining read(fd, NULL, 1) cases.


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


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 tls-earlyentropy-base tls-maxphys-base
# 1.91 25-Jul-2014 dholland

branches: 1.91.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.90 08-Jul-2014 hannken

Change msdosfs from hashlist to vcache:
- Use (dir_cluster, dir_offset, dir_generation) as key, where
dir_generation is non-zero and unique for unlinked but open nodes.
- Change deget() to return a vnode as it is unsafe to return a
referenced but unlocked denode.


Revision tags: yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 rmind-smpnet-nbase rmind-smpnet-base
# 1.89 23-Jan-2014 hannken

branches: 1.89.2;
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.88 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.87 02-Nov-2013 hannken

Stop using v_mount of an unreferenced vnode -- save the mount while
the vnode has a reference.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base
# 1.86 18-Mar-2013 plunky

branches: 1.86.6;
C99 section 6.7.2.3 (Tags) Note 3 states that:

A type specifier of the form

enum identifier

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

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

(ok elad@)


Revision tags: yamt-pagecache-base8
# 1.85 28-Dec-2012 hannken

Move the initialization of n to after the error branch.

From Taylor R Campbell <riastradh@netbsd.org>


# 1.84 20-Dec-2012 hannken

Change bread() and breadn() to never return a buffer on
error and modify all callers to not brelse() on error.

Welcome to 6.99.16

PR kern/46282 (6.0_BETA crash: msdosfs_bmap -> pcbmap -> bread -> bio_doread)


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6 jmcneill-usbmp-base10 yamt-pagecache-base5
# 1.83 29-Apr-2012 chs

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


Revision tags: jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8
# 1.82 03-Apr-2012 njoly

Add missing braces in previous commit.


# 1.81 02-Apr-2012 njoly

Report the SF_ARCHIVED file flag if set.


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


Revision tags: 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
# 1.79 21-Nov-2011 hannken

branches: 1.79.2; 1.79.4;
Add missing fstrans_done().

Should fix PR #45635 (KASSERT "fli->fli_trans_cnt == 0" failed)


Revision tags: jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.78 20-Jul-2011 hannken

branches: 1.78.2;
Even though msdosfs never truncates file names it advertises _PC_NO_TRUNC
as zero. Make it advertise one (no_trunc == true).

Names longer than NAME_MAX (255) will never pass namei() btw.

Fixes PR #43670 (msdosfs claims support for filenames longer than {NAME_MAX},
but fails)


# 1.77 16-Jun-2011 hannken

Rename uvm_vnp_zerorange(struct vnode *, off_t, size_t) to
ubc_zerorange(struct uvm_object *, off_t, size_t, int) changing
the first argument to an uvm_object and adding a flags argument.

Modify tmpfs_reg_resize() to zero the backing store (aobj) instead
of the vnode. Ubc_purge() no longer panics when unmounting tmpfs.

Keep uvm_vnp_zerorange() until the next kernel version bump.


# 1.76 12-Jun-2011 rmind

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 rmind-uvmplock-base
# 1.75 26-Apr-2011 hannken

branches: 1.75.2;
Change vflushbuf() to return an error if a synchronous write fails.

Welcome to 5.99.51.


# 1.74 20-Mar-2011 hannken

When extending a file, either by truncating or by writing past EOF make
sure the unallocated remainder of the last page gets zeroed.

Detected by fsx.


# 1.73 19-Mar-2011 hannken

Remove a vnode reference leak from msdosfs_rename. Release tdvp if either
doscheckpath() or relookup() fails.

Adjust test fs/vfs/t_vnops.c and remove the link count test for msdos.

Fixes PR #44661


Revision tags: bouyer-quota2-nbase
# 1.72 03-Mar-2011 pooka

In rename, use char[12]�for new names instead of [11]. At least
one routine called from here (unix2dosfn) expects and uses all of
a [12].

This may fix the "stack size exceeded" problem which has been
triggering in gson's test runs. (i'm not entirely sure why it
doesn't trigger in anyone else's env)


Revision tags: bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231
# 1.71 02-Jan-2011 dholland

branches: 1.71.2; 1.71.4;
Remove the special refcount behavior (adding an extra reference to the
parent dir) associated with SAVESTART in relookup().

Check all call sites to make sure that SAVESTART wasn't set while
calling relookup(); if it was, adjust the refcount behavior. Remove
related references to SAVESTART.

The only code that was reaching the extra ref was msdosfs_rename,
where the refcount behavior was already fairly broken and/or gross;
repair it.

Add a dummy 4th argument to relookup to make sure code that hasn't
been inspected won't compile. (This will go away next time the
relookup semantics change, which they will.)


# 1.70 30-Nov-2010 dholland

Abolish the SAVENAME and HASBUF flags. There is now always a buffer,
so the path in a struct componentname is now always valid during VOP
calls.


# 1.69 30-Nov-2010 dholland

Abolish struct componentname's cn_pnbuf. Use the path buffer in the
pathbuf object passed to namei as work space instead. (For now a pnbuf
pointer appears in struct nameidata, to support certain unclean things
that haven't been fixed yet, but it will be going away in the future.)

This removes the need for the SAVENAME and HASBUF namei flags.


Revision tags: uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.68 22-Jul-2010 njoly

Remove bad cast, fix compilation with MSDOSFS_DEBUG.


# 1.67 24-Jun-2010 hannken

Clean up vnode lock operations pass 2:

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

Welcome to 5.99.32.

Discussed on tech-kern.


# 1.66 25-May-2010 pooka

Don't double unlock fvp if source file disappears during rename.
Problem found by njoly's awesome stresstester.


Revision tags: uebayasi-xip-base1
# 1.65 23-Apr-2010 pooka

Enforce RLIMIT_FSIZE before VOP_WRITE. This adds support to file
system drivers where it was missing from and fixes one buggy
implementation. The arguably weird semantics of the check are
maintained (v_size vs. va_bytes, overwrite).


# 1.64 09-Apr-2010 hannken

Add file system suspension support (vfs_suspend(9)) to msdosfs.

Reviewed by: Antti Kantee <pooka@netbsd.org>


# 1.63 08-Apr-2010 pooka

In genfs where available.

The only functional change is mknod now returning EOPNOTSUPP instead
of EINVAL. I make this sacrifice willingly and with a clean conscience.


# 1.62 08-Apr-2010 pooka

Use genfs instead of homegrown stuff where possible.


Revision tags: yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211 yamt-nfs-mp-base8 yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 jym-xensuspend-nbase
# 1.61 03-Jul-2009 elad

branches: 1.61.2; 1.61.4;
Where possible, extract the file-system's access() routine to two internal
functions: the first checking if the operation is possible (regardless of
permissions), the second checking file-system permissions, ACLs, etc.

Mailing list reference:

http://mail-index.netbsd.org/tech-kern/2009/06/21/msg005311.html


# 1.60 23-Jun-2009 elad

Move the implementation of vaccess() to genfs_can_access(), in line with
the other routines of the same spirit.

Adjust file-system code to use it.

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

No objections on tech-kern@:

http://mail-index.netbsd.org/tech-kern/2009/06/21/msg005310.html


Revision tags: yamt-nfs-mp-base5 yamt-nfs-mp-base4 jym-xensuspend-base
# 1.59 07-May-2009 elad

Extract the open-coded authorization logic for chtimes() from various
file-systems and put it in a single function, genfs_can_chtimes().

This also makes UDF follow the same policy as all other file-systems.

Mailing list reference:

http://mail-index.netbsd.org/tech-kern/2009/04/27/msg004951.html


Revision tags: yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.58 14-Mar-2009 dsl

ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.


Revision tags: nick-hppapmap-base2 mjf-devfs2-base
# 1.57 11-Jan-2009 cegger

branches: 1.57.2;
make this compile


# 1.56 11-Jan-2009 christos

merge christos-time_t


Revision tags: haad-dm-base2 haad-nbase2 ad-audiomp2-base christos-time_t-nbase christos-time_t-base haad-dm-base
# 1.55 28-Nov-2008 pooka

Tyop: v -> vp. Spotted by Tom's ARM builds.


# 1.54 26-Nov-2008 pooka

Rototill all remaining file systems to use ubc_uiomove() instead
of the ubc_alloc() - uiomove() - ubc_release() dance.


# 1.53 14-Nov-2008 pooka

In case writing past EOF, fail if extending the file fails (most
likely due to the file system being full).

Otherwise we'd fail in VOP_PUTPAGES(), which might not happen during
VOP_WRITE(), thus giving the caller the wrong impression that
writing was succesful.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE 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 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 wrstuden-revivesa-base
# 1.52 16-May-2008 hannken

branches: 1.52.4; 1.52.6; 1.52.10;
Make sure all cached buffers with valid, not yet written data have been
run through copy-on-write. Call fscow_run() with valid data where possible.

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

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

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

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

Welcome to 4.99.63

Reviewed by: YAMAMOTO Takashi <yamt@netbsd.org>


Revision tags: yamt-nfs-mp-base2
# 1.51 30-Apr-2008 ad

branches: 1.51.2;
Make various bits of debug code compile again.


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

branches: 1.50.2;
Network protocol interrupts can now block on locks, so merge the globals
proclist_mutex and proclist_lock into a single adaptive mutex (proc_lock).
Implications:

- Inspecting process state requires thread context, so signals can no longer
be sent from a hardware interrupt handler. Signal activity must be
deferred to a soft interrupt or kthread.

- As the proc state locking is simplified, it's now safe to take exit()
and wait() out from under kernel_lock.

- The system spends less time at IPL_SCHED, and there is less lock activity.


Revision tags: yamt-pf42-baseX yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase nick-net80211-sync-base keiichi-mipv6-base matt-armv6-nbase mjf-devfs-base hpcarm-cleanup-base
# 1.49 30-Jan-2008 ad

branches: 1.49.6; 1.49.8;
Replace struct lock on vnodes with a simpler lock object built on
krwlock_t. This is a step towards removing lockmgr and simplifying
vnode locking. Discussed on tech-kern.


# 1.48 25-Jan-2008 ad

Remove VOP_LEASE. Discussed on tech-kern.


Revision tags: bouyer-xeni386-nbase bouyer-xeni386-base matt-armv6-base
# 1.47 05-Jan-2008 christos

PR/37696: Paul Ripke: add large read / readahead support (Introduce run-length
detection to msdosfs_bmap(), from FreeBSD)


# 1.46 02-Jan-2008 ad

Merge vmlocking2 to head.


# 1.45 28-Dec-2007 reinoud

Use uvm_vnp_setwritesize() on file extending to instruct UVM to NOT read-in
the newly added space first. This significantly speeds up write speed for
msdosfs and making it at par with ffs wich already had this patched.

Speed increase measured on my IDE disc from 2Mb/sec to 32 Mb/sec


Revision tags: vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 vmlocking-nbase jmcneill-pm-base reinoud-bufcleanup-base
# 1.44 26-Nov-2007 pooka

branches: 1.44.2; 1.44.6;
Remove the "struct lwp *" argument from all VFS and VOP interfaces.
The general trend is to remove it from all kernel interfaces and
this is a start. In case the calling lwp is desired, curlwp should
be used.

quick consensus on tech-kern


Revision tags: bouyer-xenamd64-base2 bouyer-xenamd64-base
# 1.43 14-Nov-2007 pooka

Fix a problem noticed by Reinoud: the fs would try to release an
unlocked vnode when trying to rename a directory. The fix was to
shuffle some bits around and #pray.

The rename routine actually needs a very very major wide-angle whopping:
* it takes locks out-of-order
* it deals with references from SAVESTART lookups in interesting ways
* I doubt there is any guarantee for correct operation if there
are multiple concurrent accesses
* the error branches might just as well call panic() directly


Revision tags: jmcneill-base yamt-x86pmap-base4 yamt-x86pmap-base3 vmlocking-base
# 1.42 08-Oct-2007 ad

branches: 1.42.2; 1.42.4;
Merge brelse() changes from the vmlocking branch.


Revision tags: yamt-x86pmap-base2
# 1.41 24-Sep-2007 rumble

Avoid stack allocation of large dirent structures in foo_readdir().


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base matt-mips64-base
# 1.40 29-Jul-2007 rumble

branches: 1.40.4; 1.40.6; 1.40.8; 1.40.10;
Use _DIRENT_MINSIZE when determining the number of NFS cookies to allocate,
rather than hard-coding 16.


Revision tags: nick-csl-alignment-base yamt-idlelwp-base8 mjf-ufs-trans-base
# 1.39 19-Apr-2007 yamt

branches: 1.39.2;
hold proclist_mutex when calling psignal().


Revision tags: thorpej-atomic-base
# 1.38 04-Mar-2007 christos

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


Revision tags: ad-audiomp-base
# 1.37 21-Feb-2007 thorpej

Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.


Revision tags: post-newlock2-merge newlock2-nbase newlock2-base
# 1.36 04-Jan-2007 elad

branches: 1.36.2;
Consistent usage of KAUTH_GENERIC_ISSUSER.


Revision tags: yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3
# 1.35 09-Dec-2006 chs

a smorgasbord of improvements to vnode locking and path lookup:
- LOCKPARENT is no longer relevant for lookup(), relookup() or VOP_LOOKUP().
these now always return the parent vnode locked. namei() works as before.
lookup() and various other paths no longer acquire vnode locks in the
wrong order via vrele(). fixes PR 32535.
as a nice side effect, path lookup is also up to 25% faster.
- the above allows us to get rid of PDIRUNLOCK.
- also get rid of WANTPARENT (just use LOCKPARENT and unlock it).
- remove an assumption in layer_node_find() that all file systems implement
a recursive VOP_LOCK() (unionfs doesn't).
- require that all file systems supply vfs_vptofh and vfs_fhtovp routines.
fill in eopnotsupp() for file systems that don't support being exported
and remove the checks for NULL. (layerfs calls these without checking.)
- in union_lookup1(), don't change refcounts in the ISDOTDOT case, just
adjust which vnode is locked. fixes PR 33374.
- apply fixes for ufs_rename() from ufs_vnops.c rev. 1.61 to ext2fs_rename().


Revision tags: netbsd-4-base
# 1.34 25-Nov-2006 scw

branches: 1.34.2;
Support FAT filesystems on non-DEV_BSIZE media.

Based on the patches provided in PR kern/17398 by Trevin Beattie.


# 1.33 16-Nov-2006 christos

__unused removal on arguments; approved by core.


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

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


# 1.31 22-Sep-2006 xtraeme

Apply patch from PR kern/34583 sent by Rhialto, quoting him:

"Add a 3rd entry in the cache, which keeps the end position
from just before extending a file.
This has the desired effect of keeping the write speed constant."

And yes, that helps a lot copying large files... always at full speed
now. This closes my PR kern/30868 "Poor performance copying large files
on msdosfs".

Also remove a 2 if-statements testing the same condition, combine them.

All that from Rhialto, thank you very much.


Revision tags: abandoned-netbsd-4-base yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 rpaulo-netinet-merge-pcb-base
# 1.30 23-Jul-2006 ad

branches: 1.30.2; 1.30.4; 1.30.6;
Use the LWP cached credentials where sane.


Revision tags: yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base chap-midi-base
# 1.29 07-Jun-2006 kardel

merge FreeBSD timecounters from branch simonb-timecounters
- struct timeval time is gone
time.tv_sec -> time_second
- struct timeval mono_time is gone
mono_time.tv_sec -> time_uptime
- access to time via
{get,}{micro,nano,bin}time()
get* versions are fast but less precise
- support NTP nanokernel implementation (NTP API 4)
- further reading:
Timecounter Paper: http://phk.freebsd.dk/pubs/timecounter.pdf
NTP Nanokernel: http://www.eecis.udel.edu/~mills/ntp/html/kern.html


Revision tags: yamt-pdpolicy-base5 simonb-timecounters-base
# 1.28 14-May-2006 elad

branches: 1.28.2;
integrate kauth.


Revision tags: elad-kernelauth-base
# 1.27 14-Apr-2006 christos

Coveriry CID 733: Remove dead code.


Revision tags: yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 yamt-pdpolicy-base
# 1.26 01-Mar-2006 yamt

branches: 1.26.2; 1.26.4; 1.26.6;
merge yamt-uio_vmspace branch.

- use vmspace rather than proc or lwp where appropriate.
the latter is more natural to specify an address space.
(and less likely to be abused for random purposes.)
- fix a swdmover race.


Revision tags: yamt-uio_vmspace-base5
# 1.25 14-Jan-2006 christos

branches: 1.25.2; 1.25.4;
Protect against uio_lwp being NULL from Pavel Cahyna


# 1.24 11-Dec-2005 christos

branches: 1.24.2;
merge ktrace-lwp.


Revision tags: ktrace-lwp-base
# 1.23 29-Nov-2005 yamt

merge yamt-readahead branch.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-base
# 1.22 04-Nov-2005 christos

branches: 1.22.2;
PR/32003: Brian Buhrow: msdosfs doesn't properly zero out high cluster data
on non-FAT32 msdos filesystems.


# 1.21 02-Nov-2005 yamt

merge yamt-vop branch. remove following VOPs.

VOP_BLKATOFF
VOP_VALLOC
VOP_BALLOC
VOP_REALLOCBLKS
VOP_VFREE
VOP_TRUNCATE
VOP_UPDATE


Revision tags: yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base
# 1.20 12-Sep-2005 christos

branches: 1.20.2;
Use nanotime() to update the time fields in filesystems. Convert the code
from macros to real functions. Original patch and review from chuq.
Note: ext2fs only keeps seconds in the on-disk inode, and msdosfs does not
have enough precision for all fields, so this is not very useful for those
two.


# 1.19 10-Sep-2005 christos

Make fileno calculations use ino_t variables.


# 1.18 29-Aug-2005 xtraeme

Remove __P()


# 1.17 29-Aug-2005 xtraeme

The maximum file size on MS-DOS filesystems is 4 GB - 1 byte, so
don't bother trying to write files bigger than this. Just return
EFBIG to caller, rather than panic()ing later.

From OpenBSD.

This closes my PR kern/30864: "panic when copying files of >4GB on msdosfs"


# 1.16 19-Aug-2005 christos

fileid is now a quad.


# 1.15 19-Aug-2005 christos

64 bit inode changes.


Revision tags: yamt-km-base4 yamt-km-base3 netbsd-3-base kent-audio2-base
# 1.14 26-Feb-2005 perry

branches: 1.14.2; 1.14.4;
nuke trailing whitespace


Revision tags: yamt-km-base2 yamt-km-base kent-audio1-beforemerge
# 1.13 09-Jan-2005 chs

branches: 1.13.2; 1.13.4;
adjust the UBC mapping code to support non-vnode uvm_objects.
this means we can no longer look at the vnode size to determine how many
pages to request in a fault, which is good since for NFS the size can change
out from under us on the server anyway. there's also a new flag UBC_UNMAP
for ubc_release(), so that the file system code can make the decision about
whether to cache mappings for files being used as executables.


Revision tags: kent-audio1-base
# 1.12 13-Sep-2004 jdolecek

set mp->mnt_stat.f_namemax on filesystem mount for use by statvfs, and use
the value for also pathconf(_PC_NAME_MAX) to keep the two in sync


# 1.11 12-May-2004 jrf

caddr_t -> void * and removal of some more casts.


# 1.10 04-May-2004 jrf

Remove caddr_t inlines. Approved by christos@NetBSD.org.


Revision tags: netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.9 26-Jan-2004 hannken

branches: 1.9.2; 1.9.4;
Fix xxx_strategy() to use the vnode arg instead of bp->b_vp.


# 1.8 25-Jan-2004 hannken

Make VOP_STRATEGY(bp) a real VOP as discussed on tech-kern.

VOP_STRATEGY(bp) is replaced by one of two new functions:

- VOP_STRATEGY(vp, bp) Call the strategy routine of vp for bp.
- DEV_STRATEGY(bp) Call the d_strategy routine of bp->b_dev for bp.

DEV_STRATEGY(bp) is used only for block-to-block device situations.


# 1.7 07-Sep-2003 itojun

add -t option for gmt time offset (normally MS-DOS filesystem has timestamp
in localtime, not GMT). PR kern/22717


# 1.6 02-Aug-2003 jdolecek

Allow separate masks for files and directories. Useful e.g. to turn
the execute bit off for files, but keep search permission for directories.
Change contributed in PR kern/21538 by Pavel Arnost, based on some FreeBSD
patches.
Further manpage changes, and backward-compatibility adjustments done by me.

Also fixes PR kern/16778 by Johan Danielsson, and PR kern/3400 by Rick Byers


# 1.5 29-Jun-2003 fvdl

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


# 1.4 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.3 26-Jun-2003 itojun

strlcpy


# 1.2 25-Feb-2003 jdolecek

make 'dosdirtemplate' static const


Revision tags: nathanw_sa_before_merge fvdl_fs64_base nathanw_sa_base
# 1.1 26-Dec-2002 jdolecek

branches: 1.1.2;
move msdosfs code from sys/msdosfs to sys/fs/msdosfs


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


Revision tags: 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
# 1.104 27-Jun-2020 christos

Introduce genfs_pathconf() and use it for the default case in all filesystems.


# 1.103 16-May-2020 christos

Add ACL support for FFS. From FreeBSD.


Revision tags: bouyer-xenpvh-base2
# 1.102 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.


Revision tags: phil-wifi-20200421 bouyer-xenpvh-base1
# 1.101 13-Apr-2020 ad

Replace most uses of vp->v_usecount with a call to vrefcnt(vp), a function
that hides the details and does atomic_load_relaxed(). Signature matches
FreeBSD.


Revision tags: phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3
# 1.100 23-Feb-2020 ad

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


Revision tags: ad-namecache-base2 ad-namecache-base1 ad-namecache-base phil-wifi-20191119
# 1.99 18-Sep-2019 christos

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


Revision tags: netbsd-9-2-RELEASE netbsd-9-1-RELEASE netbsd-8-2-RELEASE netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 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
# 1.98 26-Apr-2017 riastradh

branches: 1.98.12;
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


Revision tags: pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320
# 1.97 01-Mar-2017 hannken

Remove now redundant calls to fstrans_start()/fstrans_done().


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
# 1.96 01-Feb-2016 christos

branches: 1.96.2; 1.96.4;
- split a long line.
- remove extra test.
- move d_namlen setting to msdosfs_vnops.c to avoid the ifdef.


# 1.95 01-Feb-2016 christos

We can't depend on dp->d_namlen existing for the parts that are used in
makefs(8).


# 1.94 30-Jan-2016 mlelstv

Add support to msdosfs and makefs to generate correct Unicode (UCS-2) directory
entries from UTF8 encoded file names.


Revision tags: nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606 nick-nhusb-base-20150406
# 1.93 04-Apr-2015 riastradh

Fix remaining read(fd, NULL, 1) cases.


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


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 tls-earlyentropy-base tls-maxphys-base
# 1.91 25-Jul-2014 dholland

branches: 1.91.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.90 08-Jul-2014 hannken

Change msdosfs from hashlist to vcache:
- Use (dir_cluster, dir_offset, dir_generation) as key, where
dir_generation is non-zero and unique for unlinked but open nodes.
- Change deget() to return a vnode as it is unsafe to return a
referenced but unlocked denode.


Revision tags: yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 rmind-smpnet-nbase rmind-smpnet-base
# 1.89 23-Jan-2014 hannken

branches: 1.89.2;
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.88 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.87 02-Nov-2013 hannken

Stop using v_mount of an unreferenced vnode -- save the mount while
the vnode has a reference.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base
# 1.86 18-Mar-2013 plunky

branches: 1.86.6;
C99 section 6.7.2.3 (Tags) Note 3 states that:

A type specifier of the form

enum identifier

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

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

(ok elad@)


Revision tags: yamt-pagecache-base8
# 1.85 28-Dec-2012 hannken

Move the initialization of n to after the error branch.

From Taylor R Campbell <riastradh@netbsd.org>


# 1.84 20-Dec-2012 hannken

Change bread() and breadn() to never return a buffer on
error and modify all callers to not brelse() on error.

Welcome to 6.99.16

PR kern/46282 (6.0_BETA crash: msdosfs_bmap -> pcbmap -> bread -> bio_doread)


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6 jmcneill-usbmp-base10 yamt-pagecache-base5
# 1.83 29-Apr-2012 chs

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


Revision tags: jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8
# 1.82 03-Apr-2012 njoly

Add missing braces in previous commit.


# 1.81 02-Apr-2012 njoly

Report the SF_ARCHIVED file flag if set.


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


Revision tags: 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
# 1.79 21-Nov-2011 hannken

branches: 1.79.2; 1.79.4;
Add missing fstrans_done().

Should fix PR #45635 (KASSERT "fli->fli_trans_cnt == 0" failed)


Revision tags: jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.78 20-Jul-2011 hannken

branches: 1.78.2;
Even though msdosfs never truncates file names it advertises _PC_NO_TRUNC
as zero. Make it advertise one (no_trunc == true).

Names longer than NAME_MAX (255) will never pass namei() btw.

Fixes PR #43670 (msdosfs claims support for filenames longer than {NAME_MAX},
but fails)


# 1.77 16-Jun-2011 hannken

Rename uvm_vnp_zerorange(struct vnode *, off_t, size_t) to
ubc_zerorange(struct uvm_object *, off_t, size_t, int) changing
the first argument to an uvm_object and adding a flags argument.

Modify tmpfs_reg_resize() to zero the backing store (aobj) instead
of the vnode. Ubc_purge() no longer panics when unmounting tmpfs.

Keep uvm_vnp_zerorange() until the next kernel version bump.


# 1.76 12-Jun-2011 rmind

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 rmind-uvmplock-base
# 1.75 26-Apr-2011 hannken

branches: 1.75.2;
Change vflushbuf() to return an error if a synchronous write fails.

Welcome to 5.99.51.


# 1.74 20-Mar-2011 hannken

When extending a file, either by truncating or by writing past EOF make
sure the unallocated remainder of the last page gets zeroed.

Detected by fsx.


# 1.73 19-Mar-2011 hannken

Remove a vnode reference leak from msdosfs_rename. Release tdvp if either
doscheckpath() or relookup() fails.

Adjust test fs/vfs/t_vnops.c and remove the link count test for msdos.

Fixes PR #44661


Revision tags: bouyer-quota2-nbase
# 1.72 03-Mar-2011 pooka

In rename, use char[12]�for new names instead of [11]. At least
one routine called from here (unix2dosfn) expects and uses all of
a [12].

This may fix the "stack size exceeded" problem which has been
triggering in gson's test runs. (i'm not entirely sure why it
doesn't trigger in anyone else's env)


Revision tags: bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231
# 1.71 02-Jan-2011 dholland

branches: 1.71.2; 1.71.4;
Remove the special refcount behavior (adding an extra reference to the
parent dir) associated with SAVESTART in relookup().

Check all call sites to make sure that SAVESTART wasn't set while
calling relookup(); if it was, adjust the refcount behavior. Remove
related references to SAVESTART.

The only code that was reaching the extra ref was msdosfs_rename,
where the refcount behavior was already fairly broken and/or gross;
repair it.

Add a dummy 4th argument to relookup to make sure code that hasn't
been inspected won't compile. (This will go away next time the
relookup semantics change, which they will.)


# 1.70 30-Nov-2010 dholland

Abolish the SAVENAME and HASBUF flags. There is now always a buffer,
so the path in a struct componentname is now always valid during VOP
calls.


# 1.69 30-Nov-2010 dholland

Abolish struct componentname's cn_pnbuf. Use the path buffer in the
pathbuf object passed to namei as work space instead. (For now a pnbuf
pointer appears in struct nameidata, to support certain unclean things
that haven't been fixed yet, but it will be going away in the future.)

This removes the need for the SAVENAME and HASBUF namei flags.


Revision tags: uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.68 22-Jul-2010 njoly

Remove bad cast, fix compilation with MSDOSFS_DEBUG.


# 1.67 24-Jun-2010 hannken

Clean up vnode lock operations pass 2:

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

Welcome to 5.99.32.

Discussed on tech-kern.


# 1.66 25-May-2010 pooka

Don't double unlock fvp if source file disappears during rename.
Problem found by njoly's awesome stresstester.


Revision tags: uebayasi-xip-base1
# 1.65 23-Apr-2010 pooka

Enforce RLIMIT_FSIZE before VOP_WRITE. This adds support to file
system drivers where it was missing from and fixes one buggy
implementation. The arguably weird semantics of the check are
maintained (v_size vs. va_bytes, overwrite).


# 1.64 09-Apr-2010 hannken

Add file system suspension support (vfs_suspend(9)) to msdosfs.

Reviewed by: Antti Kantee <pooka@netbsd.org>


# 1.63 08-Apr-2010 pooka

In genfs where available.

The only functional change is mknod now returning EOPNOTSUPP instead
of EINVAL. I make this sacrifice willingly and with a clean conscience.


# 1.62 08-Apr-2010 pooka

Use genfs instead of homegrown stuff where possible.


Revision tags: yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211 yamt-nfs-mp-base8 yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 jym-xensuspend-nbase
# 1.61 03-Jul-2009 elad

branches: 1.61.2; 1.61.4;
Where possible, extract the file-system's access() routine to two internal
functions: the first checking if the operation is possible (regardless of
permissions), the second checking file-system permissions, ACLs, etc.

Mailing list reference:

http://mail-index.netbsd.org/tech-kern/2009/06/21/msg005311.html


# 1.60 23-Jun-2009 elad

Move the implementation of vaccess() to genfs_can_access(), in line with
the other routines of the same spirit.

Adjust file-system code to use it.

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

No objections on tech-kern@:

http://mail-index.netbsd.org/tech-kern/2009/06/21/msg005310.html


Revision tags: yamt-nfs-mp-base5 yamt-nfs-mp-base4 jym-xensuspend-base
# 1.59 07-May-2009 elad

Extract the open-coded authorization logic for chtimes() from various
file-systems and put it in a single function, genfs_can_chtimes().

This also makes UDF follow the same policy as all other file-systems.

Mailing list reference:

http://mail-index.netbsd.org/tech-kern/2009/04/27/msg004951.html


Revision tags: yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.58 14-Mar-2009 dsl

ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.


Revision tags: nick-hppapmap-base2 mjf-devfs2-base
# 1.57 11-Jan-2009 cegger

branches: 1.57.2;
make this compile


# 1.56 11-Jan-2009 christos

merge christos-time_t


Revision tags: haad-dm-base2 haad-nbase2 ad-audiomp2-base christos-time_t-nbase christos-time_t-base haad-dm-base
# 1.55 28-Nov-2008 pooka

Tyop: v -> vp. Spotted by Tom's ARM builds.


# 1.54 26-Nov-2008 pooka

Rototill all remaining file systems to use ubc_uiomove() instead
of the ubc_alloc() - uiomove() - ubc_release() dance.


# 1.53 14-Nov-2008 pooka

In case writing past EOF, fail if extending the file fails (most
likely due to the file system being full).

Otherwise we'd fail in VOP_PUTPAGES(), which might not happen during
VOP_WRITE(), thus giving the caller the wrong impression that
writing was succesful.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE 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 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 wrstuden-revivesa-base
# 1.52 16-May-2008 hannken

branches: 1.52.4; 1.52.6; 1.52.10;
Make sure all cached buffers with valid, not yet written data have been
run through copy-on-write. Call fscow_run() with valid data where possible.

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

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

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

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

Welcome to 4.99.63

Reviewed by: YAMAMOTO Takashi <yamt@netbsd.org>


Revision tags: yamt-nfs-mp-base2
# 1.51 30-Apr-2008 ad

branches: 1.51.2;
Make various bits of debug code compile again.


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

branches: 1.50.2;
Network protocol interrupts can now block on locks, so merge the globals
proclist_mutex and proclist_lock into a single adaptive mutex (proc_lock).
Implications:

- Inspecting process state requires thread context, so signals can no longer
be sent from a hardware interrupt handler. Signal activity must be
deferred to a soft interrupt or kthread.

- As the proc state locking is simplified, it's now safe to take exit()
and wait() out from under kernel_lock.

- The system spends less time at IPL_SCHED, and there is less lock activity.


Revision tags: yamt-pf42-baseX yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase nick-net80211-sync-base keiichi-mipv6-base matt-armv6-nbase mjf-devfs-base hpcarm-cleanup-base
# 1.49 30-Jan-2008 ad

branches: 1.49.6; 1.49.8;
Replace struct lock on vnodes with a simpler lock object built on
krwlock_t. This is a step towards removing lockmgr and simplifying
vnode locking. Discussed on tech-kern.


# 1.48 25-Jan-2008 ad

Remove VOP_LEASE. Discussed on tech-kern.


Revision tags: bouyer-xeni386-nbase bouyer-xeni386-base matt-armv6-base
# 1.47 05-Jan-2008 christos

PR/37696: Paul Ripke: add large read / readahead support (Introduce run-length
detection to msdosfs_bmap(), from FreeBSD)


# 1.46 02-Jan-2008 ad

Merge vmlocking2 to head.


# 1.45 28-Dec-2007 reinoud

Use uvm_vnp_setwritesize() on file extending to instruct UVM to NOT read-in
the newly added space first. This significantly speeds up write speed for
msdosfs and making it at par with ffs wich already had this patched.

Speed increase measured on my IDE disc from 2Mb/sec to 32 Mb/sec


Revision tags: vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 vmlocking-nbase jmcneill-pm-base reinoud-bufcleanup-base
# 1.44 26-Nov-2007 pooka

branches: 1.44.2; 1.44.6;
Remove the "struct lwp *" argument from all VFS and VOP interfaces.
The general trend is to remove it from all kernel interfaces and
this is a start. In case the calling lwp is desired, curlwp should
be used.

quick consensus on tech-kern


Revision tags: bouyer-xenamd64-base2 bouyer-xenamd64-base
# 1.43 14-Nov-2007 pooka

Fix a problem noticed by Reinoud: the fs would try to release an
unlocked vnode when trying to rename a directory. The fix was to
shuffle some bits around and #pray.

The rename routine actually needs a very very major wide-angle whopping:
* it takes locks out-of-order
* it deals with references from SAVESTART lookups in interesting ways
* I doubt there is any guarantee for correct operation if there
are multiple concurrent accesses
* the error branches might just as well call panic() directly


Revision tags: jmcneill-base yamt-x86pmap-base4 yamt-x86pmap-base3 vmlocking-base
# 1.42 08-Oct-2007 ad

branches: 1.42.2; 1.42.4;
Merge brelse() changes from the vmlocking branch.


Revision tags: yamt-x86pmap-base2
# 1.41 24-Sep-2007 rumble

Avoid stack allocation of large dirent structures in foo_readdir().


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base matt-mips64-base
# 1.40 29-Jul-2007 rumble

branches: 1.40.4; 1.40.6; 1.40.8; 1.40.10;
Use _DIRENT_MINSIZE when determining the number of NFS cookies to allocate,
rather than hard-coding 16.


Revision tags: nick-csl-alignment-base yamt-idlelwp-base8 mjf-ufs-trans-base
# 1.39 19-Apr-2007 yamt

branches: 1.39.2;
hold proclist_mutex when calling psignal().


Revision tags: thorpej-atomic-base
# 1.38 04-Mar-2007 christos

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


Revision tags: ad-audiomp-base
# 1.37 21-Feb-2007 thorpej

Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.


Revision tags: post-newlock2-merge newlock2-nbase newlock2-base
# 1.36 04-Jan-2007 elad

branches: 1.36.2;
Consistent usage of KAUTH_GENERIC_ISSUSER.


Revision tags: yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3
# 1.35 09-Dec-2006 chs

a smorgasbord of improvements to vnode locking and path lookup:
- LOCKPARENT is no longer relevant for lookup(), relookup() or VOP_LOOKUP().
these now always return the parent vnode locked. namei() works as before.
lookup() and various other paths no longer acquire vnode locks in the
wrong order via vrele(). fixes PR 32535.
as a nice side effect, path lookup is also up to 25% faster.
- the above allows us to get rid of PDIRUNLOCK.
- also get rid of WANTPARENT (just use LOCKPARENT and unlock it).
- remove an assumption in layer_node_find() that all file systems implement
a recursive VOP_LOCK() (unionfs doesn't).
- require that all file systems supply vfs_vptofh and vfs_fhtovp routines.
fill in eopnotsupp() for file systems that don't support being exported
and remove the checks for NULL. (layerfs calls these without checking.)
- in union_lookup1(), don't change refcounts in the ISDOTDOT case, just
adjust which vnode is locked. fixes PR 33374.
- apply fixes for ufs_rename() from ufs_vnops.c rev. 1.61 to ext2fs_rename().


Revision tags: netbsd-4-base
# 1.34 25-Nov-2006 scw

branches: 1.34.2;
Support FAT filesystems on non-DEV_BSIZE media.

Based on the patches provided in PR kern/17398 by Trevin Beattie.


# 1.33 16-Nov-2006 christos

__unused removal on arguments; approved by core.


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

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


# 1.31 22-Sep-2006 xtraeme

Apply patch from PR kern/34583 sent by Rhialto, quoting him:

"Add a 3rd entry in the cache, which keeps the end position
from just before extending a file.
This has the desired effect of keeping the write speed constant."

And yes, that helps a lot copying large files... always at full speed
now. This closes my PR kern/30868 "Poor performance copying large files
on msdosfs".

Also remove a 2 if-statements testing the same condition, combine them.

All that from Rhialto, thank you very much.


Revision tags: abandoned-netbsd-4-base yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 rpaulo-netinet-merge-pcb-base
# 1.30 23-Jul-2006 ad

branches: 1.30.2; 1.30.4; 1.30.6;
Use the LWP cached credentials where sane.


Revision tags: yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base chap-midi-base
# 1.29 07-Jun-2006 kardel

merge FreeBSD timecounters from branch simonb-timecounters
- struct timeval time is gone
time.tv_sec -> time_second
- struct timeval mono_time is gone
mono_time.tv_sec -> time_uptime
- access to time via
{get,}{micro,nano,bin}time()
get* versions are fast but less precise
- support NTP nanokernel implementation (NTP API 4)
- further reading:
Timecounter Paper: http://phk.freebsd.dk/pubs/timecounter.pdf
NTP Nanokernel: http://www.eecis.udel.edu/~mills/ntp/html/kern.html


Revision tags: yamt-pdpolicy-base5 simonb-timecounters-base
# 1.28 14-May-2006 elad

branches: 1.28.2;
integrate kauth.


Revision tags: elad-kernelauth-base
# 1.27 14-Apr-2006 christos

Coveriry CID 733: Remove dead code.


Revision tags: yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 yamt-pdpolicy-base
# 1.26 01-Mar-2006 yamt

branches: 1.26.2; 1.26.4; 1.26.6;
merge yamt-uio_vmspace branch.

- use vmspace rather than proc or lwp where appropriate.
the latter is more natural to specify an address space.
(and less likely to be abused for random purposes.)
- fix a swdmover race.


Revision tags: yamt-uio_vmspace-base5
# 1.25 14-Jan-2006 christos

branches: 1.25.2; 1.25.4;
Protect against uio_lwp being NULL from Pavel Cahyna


# 1.24 11-Dec-2005 christos

branches: 1.24.2;
merge ktrace-lwp.


Revision tags: ktrace-lwp-base
# 1.23 29-Nov-2005 yamt

merge yamt-readahead branch.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-base
# 1.22 04-Nov-2005 christos

branches: 1.22.2;
PR/32003: Brian Buhrow: msdosfs doesn't properly zero out high cluster data
on non-FAT32 msdos filesystems.


# 1.21 02-Nov-2005 yamt

merge yamt-vop branch. remove following VOPs.

VOP_BLKATOFF
VOP_VALLOC
VOP_BALLOC
VOP_REALLOCBLKS
VOP_VFREE
VOP_TRUNCATE
VOP_UPDATE


Revision tags: yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base
# 1.20 12-Sep-2005 christos

branches: 1.20.2;
Use nanotime() to update the time fields in filesystems. Convert the code
from macros to real functions. Original patch and review from chuq.
Note: ext2fs only keeps seconds in the on-disk inode, and msdosfs does not
have enough precision for all fields, so this is not very useful for those
two.


# 1.19 10-Sep-2005 christos

Make fileno calculations use ino_t variables.


# 1.18 29-Aug-2005 xtraeme

Remove __P()


# 1.17 29-Aug-2005 xtraeme

The maximum file size on MS-DOS filesystems is 4 GB - 1 byte, so
don't bother trying to write files bigger than this. Just return
EFBIG to caller, rather than panic()ing later.

From OpenBSD.

This closes my PR kern/30864: "panic when copying files of >4GB on msdosfs"


# 1.16 19-Aug-2005 christos

fileid is now a quad.


# 1.15 19-Aug-2005 christos

64 bit inode changes.


Revision tags: yamt-km-base4 yamt-km-base3 netbsd-3-base kent-audio2-base
# 1.14 26-Feb-2005 perry

branches: 1.14.2; 1.14.4;
nuke trailing whitespace


Revision tags: yamt-km-base2 yamt-km-base kent-audio1-beforemerge
# 1.13 09-Jan-2005 chs

branches: 1.13.2; 1.13.4;
adjust the UBC mapping code to support non-vnode uvm_objects.
this means we can no longer look at the vnode size to determine how many
pages to request in a fault, which is good since for NFS the size can change
out from under us on the server anyway. there's also a new flag UBC_UNMAP
for ubc_release(), so that the file system code can make the decision about
whether to cache mappings for files being used as executables.


Revision tags: kent-audio1-base
# 1.12 13-Sep-2004 jdolecek

set mp->mnt_stat.f_namemax on filesystem mount for use by statvfs, and use
the value for also pathconf(_PC_NAME_MAX) to keep the two in sync


# 1.11 12-May-2004 jrf

caddr_t -> void * and removal of some more casts.


# 1.10 04-May-2004 jrf

Remove caddr_t inlines. Approved by christos@NetBSD.org.


Revision tags: netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.9 26-Jan-2004 hannken

branches: 1.9.2; 1.9.4;
Fix xxx_strategy() to use the vnode arg instead of bp->b_vp.


# 1.8 25-Jan-2004 hannken

Make VOP_STRATEGY(bp) a real VOP as discussed on tech-kern.

VOP_STRATEGY(bp) is replaced by one of two new functions:

- VOP_STRATEGY(vp, bp) Call the strategy routine of vp for bp.
- DEV_STRATEGY(bp) Call the d_strategy routine of bp->b_dev for bp.

DEV_STRATEGY(bp) is used only for block-to-block device situations.


# 1.7 07-Sep-2003 itojun

add -t option for gmt time offset (normally MS-DOS filesystem has timestamp
in localtime, not GMT). PR kern/22717


# 1.6 02-Aug-2003 jdolecek

Allow separate masks for files and directories. Useful e.g. to turn
the execute bit off for files, but keep search permission for directories.
Change contributed in PR kern/21538 by Pavel Arnost, based on some FreeBSD
patches.
Further manpage changes, and backward-compatibility adjustments done by me.

Also fixes PR kern/16778 by Johan Danielsson, and PR kern/3400 by Rick Byers


# 1.5 29-Jun-2003 fvdl

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


# 1.4 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.3 26-Jun-2003 itojun

strlcpy


# 1.2 25-Feb-2003 jdolecek

make 'dosdirtemplate' static const


Revision tags: nathanw_sa_before_merge fvdl_fs64_base nathanw_sa_base
# 1.1 26-Dec-2002 jdolecek

branches: 1.1.2;
move msdosfs code from sys/msdosfs to sys/fs/msdosfs


# 1.104 27-Jun-2020 christos

Introduce genfs_pathconf() and use it for the default case in all filesystems.


# 1.103 16-May-2020 christos

Add ACL support for FFS. From FreeBSD.


Revision tags: bouyer-xenpvh-base2
# 1.102 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.


Revision tags: phil-wifi-20200421 bouyer-xenpvh-base1
# 1.101 13-Apr-2020 ad

Replace most uses of vp->v_usecount with a call to vrefcnt(vp), a function
that hides the details and does atomic_load_relaxed(). Signature matches
FreeBSD.


Revision tags: phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3
# 1.100 23-Feb-2020 ad

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


Revision tags: ad-namecache-base2 ad-namecache-base1 ad-namecache-base phil-wifi-20191119
# 1.99 18-Sep-2019 christos

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


Revision tags: netbsd-8-2-RELEASE netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 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
# 1.98 26-Apr-2017 riastradh

branches: 1.98.12;
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


Revision tags: pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320
# 1.97 01-Mar-2017 hannken

Remove now redundant calls to fstrans_start()/fstrans_done().


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
# 1.96 01-Feb-2016 christos

branches: 1.96.2; 1.96.4;
- split a long line.
- remove extra test.
- move d_namlen setting to msdosfs_vnops.c to avoid the ifdef.


# 1.95 01-Feb-2016 christos

We can't depend on dp->d_namlen existing for the parts that are used in
makefs(8).


# 1.94 30-Jan-2016 mlelstv

Add support to msdosfs and makefs to generate correct Unicode (UCS-2) directory
entries from UTF8 encoded file names.


Revision tags: nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606 nick-nhusb-base-20150406
# 1.93 04-Apr-2015 riastradh

Fix remaining read(fd, NULL, 1) cases.


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


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 tls-earlyentropy-base tls-maxphys-base
# 1.91 25-Jul-2014 dholland

branches: 1.91.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.90 08-Jul-2014 hannken

Change msdosfs from hashlist to vcache:
- Use (dir_cluster, dir_offset, dir_generation) as key, where
dir_generation is non-zero and unique for unlinked but open nodes.
- Change deget() to return a vnode as it is unsafe to return a
referenced but unlocked denode.


Revision tags: yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 rmind-smpnet-nbase rmind-smpnet-base
# 1.89 23-Jan-2014 hannken

branches: 1.89.2;
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.88 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.87 02-Nov-2013 hannken

Stop using v_mount of an unreferenced vnode -- save the mount while
the vnode has a reference.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base
# 1.86 18-Mar-2013 plunky

branches: 1.86.6;
C99 section 6.7.2.3 (Tags) Note 3 states that:

A type specifier of the form

enum identifier

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

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

(ok elad@)


Revision tags: yamt-pagecache-base8
# 1.85 28-Dec-2012 hannken

Move the initialization of n to after the error branch.

From Taylor R Campbell <riastradh@netbsd.org>


# 1.84 20-Dec-2012 hannken

Change bread() and breadn() to never return a buffer on
error and modify all callers to not brelse() on error.

Welcome to 6.99.16

PR kern/46282 (6.0_BETA crash: msdosfs_bmap -> pcbmap -> bread -> bio_doread)


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6 jmcneill-usbmp-base10 yamt-pagecache-base5
# 1.83 29-Apr-2012 chs

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


Revision tags: jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8
# 1.82 03-Apr-2012 njoly

Add missing braces in previous commit.


# 1.81 02-Apr-2012 njoly

Report the SF_ARCHIVED file flag if set.


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


Revision tags: 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
# 1.79 21-Nov-2011 hannken

branches: 1.79.2; 1.79.4;
Add missing fstrans_done().

Should fix PR #45635 (KASSERT "fli->fli_trans_cnt == 0" failed)


Revision tags: jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.78 20-Jul-2011 hannken

branches: 1.78.2;
Even though msdosfs never truncates file names it advertises _PC_NO_TRUNC
as zero. Make it advertise one (no_trunc == true).

Names longer than NAME_MAX (255) will never pass namei() btw.

Fixes PR #43670 (msdosfs claims support for filenames longer than {NAME_MAX},
but fails)


# 1.77 16-Jun-2011 hannken

Rename uvm_vnp_zerorange(struct vnode *, off_t, size_t) to
ubc_zerorange(struct uvm_object *, off_t, size_t, int) changing
the first argument to an uvm_object and adding a flags argument.

Modify tmpfs_reg_resize() to zero the backing store (aobj) instead
of the vnode. Ubc_purge() no longer panics when unmounting tmpfs.

Keep uvm_vnp_zerorange() until the next kernel version bump.


# 1.76 12-Jun-2011 rmind

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 rmind-uvmplock-base
# 1.75 26-Apr-2011 hannken

branches: 1.75.2;
Change vflushbuf() to return an error if a synchronous write fails.

Welcome to 5.99.51.


# 1.74 20-Mar-2011 hannken

When extending a file, either by truncating or by writing past EOF make
sure the unallocated remainder of the last page gets zeroed.

Detected by fsx.


# 1.73 19-Mar-2011 hannken

Remove a vnode reference leak from msdosfs_rename. Release tdvp if either
doscheckpath() or relookup() fails.

Adjust test fs/vfs/t_vnops.c and remove the link count test for msdos.

Fixes PR #44661


Revision tags: bouyer-quota2-nbase
# 1.72 03-Mar-2011 pooka

In rename, use char[12]�for new names instead of [11]. At least
one routine called from here (unix2dosfn) expects and uses all of
a [12].

This may fix the "stack size exceeded" problem which has been
triggering in gson's test runs. (i'm not entirely sure why it
doesn't trigger in anyone else's env)


Revision tags: bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231
# 1.71 02-Jan-2011 dholland

branches: 1.71.2; 1.71.4;
Remove the special refcount behavior (adding an extra reference to the
parent dir) associated with SAVESTART in relookup().

Check all call sites to make sure that SAVESTART wasn't set while
calling relookup(); if it was, adjust the refcount behavior. Remove
related references to SAVESTART.

The only code that was reaching the extra ref was msdosfs_rename,
where the refcount behavior was already fairly broken and/or gross;
repair it.

Add a dummy 4th argument to relookup to make sure code that hasn't
been inspected won't compile. (This will go away next time the
relookup semantics change, which they will.)


# 1.70 30-Nov-2010 dholland

Abolish the SAVENAME and HASBUF flags. There is now always a buffer,
so the path in a struct componentname is now always valid during VOP
calls.


# 1.69 30-Nov-2010 dholland

Abolish struct componentname's cn_pnbuf. Use the path buffer in the
pathbuf object passed to namei as work space instead. (For now a pnbuf
pointer appears in struct nameidata, to support certain unclean things
that haven't been fixed yet, but it will be going away in the future.)

This removes the need for the SAVENAME and HASBUF namei flags.


Revision tags: uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.68 22-Jul-2010 njoly

Remove bad cast, fix compilation with MSDOSFS_DEBUG.


# 1.67 24-Jun-2010 hannken

Clean up vnode lock operations pass 2:

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

Welcome to 5.99.32.

Discussed on tech-kern.


# 1.66 25-May-2010 pooka

Don't double unlock fvp if source file disappears during rename.
Problem found by njoly's awesome stresstester.


Revision tags: uebayasi-xip-base1
# 1.65 23-Apr-2010 pooka

Enforce RLIMIT_FSIZE before VOP_WRITE. This adds support to file
system drivers where it was missing from and fixes one buggy
implementation. The arguably weird semantics of the check are
maintained (v_size vs. va_bytes, overwrite).


# 1.64 09-Apr-2010 hannken

Add file system suspension support (vfs_suspend(9)) to msdosfs.

Reviewed by: Antti Kantee <pooka@netbsd.org>


# 1.63 08-Apr-2010 pooka

In genfs where available.

The only functional change is mknod now returning EOPNOTSUPP instead
of EINVAL. I make this sacrifice willingly and with a clean conscience.


# 1.62 08-Apr-2010 pooka

Use genfs instead of homegrown stuff where possible.


Revision tags: yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211 yamt-nfs-mp-base8 yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 jym-xensuspend-nbase
# 1.61 03-Jul-2009 elad

branches: 1.61.2; 1.61.4;
Where possible, extract the file-system's access() routine to two internal
functions: the first checking if the operation is possible (regardless of
permissions), the second checking file-system permissions, ACLs, etc.

Mailing list reference:

http://mail-index.netbsd.org/tech-kern/2009/06/21/msg005311.html


# 1.60 23-Jun-2009 elad

Move the implementation of vaccess() to genfs_can_access(), in line with
the other routines of the same spirit.

Adjust file-system code to use it.

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

No objections on tech-kern@:

http://mail-index.netbsd.org/tech-kern/2009/06/21/msg005310.html


Revision tags: yamt-nfs-mp-base5 yamt-nfs-mp-base4 jym-xensuspend-base
# 1.59 07-May-2009 elad

Extract the open-coded authorization logic for chtimes() from various
file-systems and put it in a single function, genfs_can_chtimes().

This also makes UDF follow the same policy as all other file-systems.

Mailing list reference:

http://mail-index.netbsd.org/tech-kern/2009/04/27/msg004951.html


Revision tags: yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.58 14-Mar-2009 dsl

ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.


Revision tags: nick-hppapmap-base2 mjf-devfs2-base
# 1.57 11-Jan-2009 cegger

branches: 1.57.2;
make this compile


# 1.56 11-Jan-2009 christos

merge christos-time_t


Revision tags: haad-dm-base2 haad-nbase2 ad-audiomp2-base christos-time_t-nbase christos-time_t-base haad-dm-base
# 1.55 28-Nov-2008 pooka

Tyop: v -> vp. Spotted by Tom's ARM builds.


# 1.54 26-Nov-2008 pooka

Rototill all remaining file systems to use ubc_uiomove() instead
of the ubc_alloc() - uiomove() - ubc_release() dance.


# 1.53 14-Nov-2008 pooka

In case writing past EOF, fail if extending the file fails (most
likely due to the file system being full).

Otherwise we'd fail in VOP_PUTPAGES(), which might not happen during
VOP_WRITE(), thus giving the caller the wrong impression that
writing was succesful.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE 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 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 wrstuden-revivesa-base
# 1.52 16-May-2008 hannken

branches: 1.52.4; 1.52.6; 1.52.10;
Make sure all cached buffers with valid, not yet written data have been
run through copy-on-write. Call fscow_run() with valid data where possible.

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

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

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

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

Welcome to 4.99.63

Reviewed by: YAMAMOTO Takashi <yamt@netbsd.org>


Revision tags: yamt-nfs-mp-base2
# 1.51 30-Apr-2008 ad

branches: 1.51.2;
Make various bits of debug code compile again.


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

branches: 1.50.2;
Network protocol interrupts can now block on locks, so merge the globals
proclist_mutex and proclist_lock into a single adaptive mutex (proc_lock).
Implications:

- Inspecting process state requires thread context, so signals can no longer
be sent from a hardware interrupt handler. Signal activity must be
deferred to a soft interrupt or kthread.

- As the proc state locking is simplified, it's now safe to take exit()
and wait() out from under kernel_lock.

- The system spends less time at IPL_SCHED, and there is less lock activity.


Revision tags: yamt-pf42-baseX yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase nick-net80211-sync-base keiichi-mipv6-base matt-armv6-nbase mjf-devfs-base hpcarm-cleanup-base
# 1.49 30-Jan-2008 ad

branches: 1.49.6; 1.49.8;
Replace struct lock on vnodes with a simpler lock object built on
krwlock_t. This is a step towards removing lockmgr and simplifying
vnode locking. Discussed on tech-kern.


# 1.48 25-Jan-2008 ad

Remove VOP_LEASE. Discussed on tech-kern.


Revision tags: bouyer-xeni386-nbase bouyer-xeni386-base matt-armv6-base
# 1.47 05-Jan-2008 christos

PR/37696: Paul Ripke: add large read / readahead support (Introduce run-length
detection to msdosfs_bmap(), from FreeBSD)


# 1.46 02-Jan-2008 ad

Merge vmlocking2 to head.


# 1.45 28-Dec-2007 reinoud

Use uvm_vnp_setwritesize() on file extending to instruct UVM to NOT read-in
the newly added space first. This significantly speeds up write speed for
msdosfs and making it at par with ffs wich already had this patched.

Speed increase measured on my IDE disc from 2Mb/sec to 32 Mb/sec


Revision tags: vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 vmlocking-nbase jmcneill-pm-base reinoud-bufcleanup-base
# 1.44 26-Nov-2007 pooka

branches: 1.44.2; 1.44.6;
Remove the "struct lwp *" argument from all VFS and VOP interfaces.
The general trend is to remove it from all kernel interfaces and
this is a start. In case the calling lwp is desired, curlwp should
be used.

quick consensus on tech-kern


Revision tags: bouyer-xenamd64-base2 bouyer-xenamd64-base
# 1.43 14-Nov-2007 pooka

Fix a problem noticed by Reinoud: the fs would try to release an
unlocked vnode when trying to rename a directory. The fix was to
shuffle some bits around and #pray.

The rename routine actually needs a very very major wide-angle whopping:
* it takes locks out-of-order
* it deals with references from SAVESTART lookups in interesting ways
* I doubt there is any guarantee for correct operation if there
are multiple concurrent accesses
* the error branches might just as well call panic() directly


Revision tags: jmcneill-base yamt-x86pmap-base4 yamt-x86pmap-base3 vmlocking-base
# 1.42 08-Oct-2007 ad

branches: 1.42.2; 1.42.4;
Merge brelse() changes from the vmlocking branch.


Revision tags: yamt-x86pmap-base2
# 1.41 24-Sep-2007 rumble

Avoid stack allocation of large dirent structures in foo_readdir().


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base matt-mips64-base
# 1.40 29-Jul-2007 rumble

branches: 1.40.4; 1.40.6; 1.40.8; 1.40.10;
Use _DIRENT_MINSIZE when determining the number of NFS cookies to allocate,
rather than hard-coding 16.


Revision tags: nick-csl-alignment-base yamt-idlelwp-base8 mjf-ufs-trans-base
# 1.39 19-Apr-2007 yamt

branches: 1.39.2;
hold proclist_mutex when calling psignal().


Revision tags: thorpej-atomic-base
# 1.38 04-Mar-2007 christos

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


Revision tags: ad-audiomp-base
# 1.37 21-Feb-2007 thorpej

Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.


Revision tags: post-newlock2-merge newlock2-nbase newlock2-base
# 1.36 04-Jan-2007 elad

branches: 1.36.2;
Consistent usage of KAUTH_GENERIC_ISSUSER.


Revision tags: yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3
# 1.35 09-Dec-2006 chs

a smorgasbord of improvements to vnode locking and path lookup:
- LOCKPARENT is no longer relevant for lookup(), relookup() or VOP_LOOKUP().
these now always return the parent vnode locked. namei() works as before.
lookup() and various other paths no longer acquire vnode locks in the
wrong order via vrele(). fixes PR 32535.
as a nice side effect, path lookup is also up to 25% faster.
- the above allows us to get rid of PDIRUNLOCK.
- also get rid of WANTPARENT (just use LOCKPARENT and unlock it).
- remove an assumption in layer_node_find() that all file systems implement
a recursive VOP_LOCK() (unionfs doesn't).
- require that all file systems supply vfs_vptofh and vfs_fhtovp routines.
fill in eopnotsupp() for file systems that don't support being exported
and remove the checks for NULL. (layerfs calls these without checking.)
- in union_lookup1(), don't change refcounts in the ISDOTDOT case, just
adjust which vnode is locked. fixes PR 33374.
- apply fixes for ufs_rename() from ufs_vnops.c rev. 1.61 to ext2fs_rename().


Revision tags: netbsd-4-base
# 1.34 25-Nov-2006 scw

branches: 1.34.2;
Support FAT filesystems on non-DEV_BSIZE media.

Based on the patches provided in PR kern/17398 by Trevin Beattie.


# 1.33 16-Nov-2006 christos

__unused removal on arguments; approved by core.


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

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


# 1.31 22-Sep-2006 xtraeme

Apply patch from PR kern/34583 sent by Rhialto, quoting him:

"Add a 3rd entry in the cache, which keeps the end position
from just before extending a file.
This has the desired effect of keeping the write speed constant."

And yes, that helps a lot copying large files... always at full speed
now. This closes my PR kern/30868 "Poor performance copying large files
on msdosfs".

Also remove a 2 if-statements testing the same condition, combine them.

All that from Rhialto, thank you very much.


Revision tags: abandoned-netbsd-4-base yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 rpaulo-netinet-merge-pcb-base
# 1.30 23-Jul-2006 ad

branches: 1.30.2; 1.30.4; 1.30.6;
Use the LWP cached credentials where sane.


Revision tags: yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base chap-midi-base
# 1.29 07-Jun-2006 kardel

merge FreeBSD timecounters from branch simonb-timecounters
- struct timeval time is gone
time.tv_sec -> time_second
- struct timeval mono_time is gone
mono_time.tv_sec -> time_uptime
- access to time via
{get,}{micro,nano,bin}time()
get* versions are fast but less precise
- support NTP nanokernel implementation (NTP API 4)
- further reading:
Timecounter Paper: http://phk.freebsd.dk/pubs/timecounter.pdf
NTP Nanokernel: http://www.eecis.udel.edu/~mills/ntp/html/kern.html


Revision tags: yamt-pdpolicy-base5 simonb-timecounters-base
# 1.28 14-May-2006 elad

branches: 1.28.2;
integrate kauth.


Revision tags: elad-kernelauth-base
# 1.27 14-Apr-2006 christos

Coveriry CID 733: Remove dead code.


Revision tags: yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 yamt-pdpolicy-base
# 1.26 01-Mar-2006 yamt

branches: 1.26.2; 1.26.4; 1.26.6;
merge yamt-uio_vmspace branch.

- use vmspace rather than proc or lwp where appropriate.
the latter is more natural to specify an address space.
(and less likely to be abused for random purposes.)
- fix a swdmover race.


Revision tags: yamt-uio_vmspace-base5
# 1.25 14-Jan-2006 christos

branches: 1.25.2; 1.25.4;
Protect against uio_lwp being NULL from Pavel Cahyna


# 1.24 11-Dec-2005 christos

branches: 1.24.2;
merge ktrace-lwp.


Revision tags: ktrace-lwp-base
# 1.23 29-Nov-2005 yamt

merge yamt-readahead branch.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-base
# 1.22 04-Nov-2005 christos

branches: 1.22.2;
PR/32003: Brian Buhrow: msdosfs doesn't properly zero out high cluster data
on non-FAT32 msdos filesystems.


# 1.21 02-Nov-2005 yamt

merge yamt-vop branch. remove following VOPs.

VOP_BLKATOFF
VOP_VALLOC
VOP_BALLOC
VOP_REALLOCBLKS
VOP_VFREE
VOP_TRUNCATE
VOP_UPDATE


Revision tags: yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base
# 1.20 12-Sep-2005 christos

branches: 1.20.2;
Use nanotime() to update the time fields in filesystems. Convert the code
from macros to real functions. Original patch and review from chuq.
Note: ext2fs only keeps seconds in the on-disk inode, and msdosfs does not
have enough precision for all fields, so this is not very useful for those
two.


# 1.19 10-Sep-2005 christos

Make fileno calculations use ino_t variables.


# 1.18 29-Aug-2005 xtraeme

Remove __P()


# 1.17 29-Aug-2005 xtraeme

The maximum file size on MS-DOS filesystems is 4 GB - 1 byte, so
don't bother trying to write files bigger than this. Just return
EFBIG to caller, rather than panic()ing later.

From OpenBSD.

This closes my PR kern/30864: "panic when copying files of >4GB on msdosfs"


# 1.16 19-Aug-2005 christos

fileid is now a quad.


# 1.15 19-Aug-2005 christos

64 bit inode changes.


Revision tags: yamt-km-base4 yamt-km-base3 netbsd-3-base kent-audio2-base
# 1.14 26-Feb-2005 perry

branches: 1.14.2; 1.14.4;
nuke trailing whitespace


Revision tags: yamt-km-base2 yamt-km-base kent-audio1-beforemerge
# 1.13 09-Jan-2005 chs

branches: 1.13.2; 1.13.4;
adjust the UBC mapping code to support non-vnode uvm_objects.
this means we can no longer look at the vnode size to determine how many
pages to request in a fault, which is good since for NFS the size can change
out from under us on the server anyway. there's also a new flag UBC_UNMAP
for ubc_release(), so that the file system code can make the decision about
whether to cache mappings for files being used as executables.


Revision tags: kent-audio1-base
# 1.12 13-Sep-2004 jdolecek

set mp->mnt_stat.f_namemax on filesystem mount for use by statvfs, and use
the value for also pathconf(_PC_NAME_MAX) to keep the two in sync


# 1.11 12-May-2004 jrf

caddr_t -> void * and removal of some more casts.


# 1.10 04-May-2004 jrf

Remove caddr_t inlines. Approved by christos@NetBSD.org.


Revision tags: netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.9 26-Jan-2004 hannken

branches: 1.9.2; 1.9.4;
Fix xxx_strategy() to use the vnode arg instead of bp->b_vp.


# 1.8 25-Jan-2004 hannken

Make VOP_STRATEGY(bp) a real VOP as discussed on tech-kern.

VOP_STRATEGY(bp) is replaced by one of two new functions:

- VOP_STRATEGY(vp, bp) Call the strategy routine of vp for bp.
- DEV_STRATEGY(bp) Call the d_strategy routine of bp->b_dev for bp.

DEV_STRATEGY(bp) is used only for block-to-block device situations.


# 1.7 07-Sep-2003 itojun

add -t option for gmt time offset (normally MS-DOS filesystem has timestamp
in localtime, not GMT). PR kern/22717


# 1.6 02-Aug-2003 jdolecek

Allow separate masks for files and directories. Useful e.g. to turn
the execute bit off for files, but keep search permission for directories.
Change contributed in PR kern/21538 by Pavel Arnost, based on some FreeBSD
patches.
Further manpage changes, and backward-compatibility adjustments done by me.

Also fixes PR kern/16778 by Johan Danielsson, and PR kern/3400 by Rick Byers


# 1.5 29-Jun-2003 fvdl

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


# 1.4 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.3 26-Jun-2003 itojun

strlcpy


# 1.2 25-Feb-2003 jdolecek

make 'dosdirtemplate' static const


Revision tags: nathanw_sa_before_merge fvdl_fs64_base nathanw_sa_base
# 1.1 26-Dec-2002 jdolecek

branches: 1.1.2;
move msdosfs code from sys/msdosfs to sys/fs/msdosfs


# 1.103 16-May-2020 christos

Add ACL support for FFS. From FreeBSD.


Revision tags: bouyer-xenpvh-base2
# 1.102 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.


Revision tags: phil-wifi-20200421 bouyer-xenpvh-base1
# 1.101 13-Apr-2020 ad

Replace most uses of vp->v_usecount with a call to vrefcnt(vp), a function
that hides the details and does atomic_load_relaxed(). Signature matches
FreeBSD.


Revision tags: phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3
# 1.100 23-Feb-2020 ad

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


Revision tags: ad-namecache-base2 ad-namecache-base1 ad-namecache-base phil-wifi-20191119
# 1.99 18-Sep-2019 christos

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


Revision tags: netbsd-8-2-RELEASE netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 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
# 1.98 26-Apr-2017 riastradh

branches: 1.98.12;
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


Revision tags: pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320
# 1.97 01-Mar-2017 hannken

Remove now redundant calls to fstrans_start()/fstrans_done().


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
# 1.96 01-Feb-2016 christos

branches: 1.96.2; 1.96.4;
- split a long line.
- remove extra test.
- move d_namlen setting to msdosfs_vnops.c to avoid the ifdef.


# 1.95 01-Feb-2016 christos

We can't depend on dp->d_namlen existing for the parts that are used in
makefs(8).


# 1.94 30-Jan-2016 mlelstv

Add support to msdosfs and makefs to generate correct Unicode (UCS-2) directory
entries from UTF8 encoded file names.


Revision tags: nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606 nick-nhusb-base-20150406
# 1.93 04-Apr-2015 riastradh

Fix remaining read(fd, NULL, 1) cases.


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


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 tls-earlyentropy-base tls-maxphys-base
# 1.91 25-Jul-2014 dholland

branches: 1.91.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.90 08-Jul-2014 hannken

Change msdosfs from hashlist to vcache:
- Use (dir_cluster, dir_offset, dir_generation) as key, where
dir_generation is non-zero and unique for unlinked but open nodes.
- Change deget() to return a vnode as it is unsafe to return a
referenced but unlocked denode.


Revision tags: yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 rmind-smpnet-nbase rmind-smpnet-base
# 1.89 23-Jan-2014 hannken

branches: 1.89.2;
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.88 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.87 02-Nov-2013 hannken

Stop using v_mount of an unreferenced vnode -- save the mount while
the vnode has a reference.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base
# 1.86 18-Mar-2013 plunky

branches: 1.86.6;
C99 section 6.7.2.3 (Tags) Note 3 states that:

A type specifier of the form

enum identifier

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

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

(ok elad@)


Revision tags: yamt-pagecache-base8
# 1.85 28-Dec-2012 hannken

Move the initialization of n to after the error branch.

From Taylor R Campbell <riastradh@netbsd.org>


# 1.84 20-Dec-2012 hannken

Change bread() and breadn() to never return a buffer on
error and modify all callers to not brelse() on error.

Welcome to 6.99.16

PR kern/46282 (6.0_BETA crash: msdosfs_bmap -> pcbmap -> bread -> bio_doread)


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6 jmcneill-usbmp-base10 yamt-pagecache-base5
# 1.83 29-Apr-2012 chs

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


Revision tags: jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8
# 1.82 03-Apr-2012 njoly

Add missing braces in previous commit.


# 1.81 02-Apr-2012 njoly

Report the SF_ARCHIVED file flag if set.


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


Revision tags: 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
# 1.79 21-Nov-2011 hannken

branches: 1.79.2; 1.79.4;
Add missing fstrans_done().

Should fix PR #45635 (KASSERT "fli->fli_trans_cnt == 0" failed)


Revision tags: jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.78 20-Jul-2011 hannken

branches: 1.78.2;
Even though msdosfs never truncates file names it advertises _PC_NO_TRUNC
as zero. Make it advertise one (no_trunc == true).

Names longer than NAME_MAX (255) will never pass namei() btw.

Fixes PR #43670 (msdosfs claims support for filenames longer than {NAME_MAX},
but fails)


# 1.77 16-Jun-2011 hannken

Rename uvm_vnp_zerorange(struct vnode *, off_t, size_t) to
ubc_zerorange(struct uvm_object *, off_t, size_t, int) changing
the first argument to an uvm_object and adding a flags argument.

Modify tmpfs_reg_resize() to zero the backing store (aobj) instead
of the vnode. Ubc_purge() no longer panics when unmounting tmpfs.

Keep uvm_vnp_zerorange() until the next kernel version bump.


# 1.76 12-Jun-2011 rmind

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 rmind-uvmplock-base
# 1.75 26-Apr-2011 hannken

branches: 1.75.2;
Change vflushbuf() to return an error if a synchronous write fails.

Welcome to 5.99.51.


# 1.74 20-Mar-2011 hannken

When extending a file, either by truncating or by writing past EOF make
sure the unallocated remainder of the last page gets zeroed.

Detected by fsx.


# 1.73 19-Mar-2011 hannken

Remove a vnode reference leak from msdosfs_rename. Release tdvp if either
doscheckpath() or relookup() fails.

Adjust test fs/vfs/t_vnops.c and remove the link count test for msdos.

Fixes PR #44661


Revision tags: bouyer-quota2-nbase
# 1.72 03-Mar-2011 pooka

In rename, use char[12]�for new names instead of [11]. At least
one routine called from here (unix2dosfn) expects and uses all of
a [12].

This may fix the "stack size exceeded" problem which has been
triggering in gson's test runs. (i'm not entirely sure why it
doesn't trigger in anyone else's env)


Revision tags: bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231
# 1.71 02-Jan-2011 dholland

branches: 1.71.2; 1.71.4;
Remove the special refcount behavior (adding an extra reference to the
parent dir) associated with SAVESTART in relookup().

Check all call sites to make sure that SAVESTART wasn't set while
calling relookup(); if it was, adjust the refcount behavior. Remove
related references to SAVESTART.

The only code that was reaching the extra ref was msdosfs_rename,
where the refcount behavior was already fairly broken and/or gross;
repair it.

Add a dummy 4th argument to relookup to make sure code that hasn't
been inspected won't compile. (This will go away next time the
relookup semantics change, which they will.)


# 1.70 30-Nov-2010 dholland

Abolish the SAVENAME and HASBUF flags. There is now always a buffer,
so the path in a struct componentname is now always valid during VOP
calls.


# 1.69 30-Nov-2010 dholland

Abolish struct componentname's cn_pnbuf. Use the path buffer in the
pathbuf object passed to namei as work space instead. (For now a pnbuf
pointer appears in struct nameidata, to support certain unclean things
that haven't been fixed yet, but it will be going away in the future.)

This removes the need for the SAVENAME and HASBUF namei flags.


Revision tags: uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.68 22-Jul-2010 njoly

Remove bad cast, fix compilation with MSDOSFS_DEBUG.


# 1.67 24-Jun-2010 hannken

Clean up vnode lock operations pass 2:

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

Welcome to 5.99.32.

Discussed on tech-kern.


# 1.66 25-May-2010 pooka

Don't double unlock fvp if source file disappears during rename.
Problem found by njoly's awesome stresstester.


Revision tags: uebayasi-xip-base1
# 1.65 23-Apr-2010 pooka

Enforce RLIMIT_FSIZE before VOP_WRITE. This adds support to file
system drivers where it was missing from and fixes one buggy
implementation. The arguably weird semantics of the check are
maintained (v_size vs. va_bytes, overwrite).


# 1.64 09-Apr-2010 hannken

Add file system suspension support (vfs_suspend(9)) to msdosfs.

Reviewed by: Antti Kantee <pooka@netbsd.org>


# 1.63 08-Apr-2010 pooka

In genfs where available.

The only functional change is mknod now returning EOPNOTSUPP instead
of EINVAL. I make this sacrifice willingly and with a clean conscience.


# 1.62 08-Apr-2010 pooka

Use genfs instead of homegrown stuff where possible.


Revision tags: yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211 yamt-nfs-mp-base8 yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 jym-xensuspend-nbase
# 1.61 03-Jul-2009 elad

branches: 1.61.2; 1.61.4;
Where possible, extract the file-system's access() routine to two internal
functions: the first checking if the operation is possible (regardless of
permissions), the second checking file-system permissions, ACLs, etc.

Mailing list reference:

http://mail-index.netbsd.org/tech-kern/2009/06/21/msg005311.html


# 1.60 23-Jun-2009 elad

Move the implementation of vaccess() to genfs_can_access(), in line with
the other routines of the same spirit.

Adjust file-system code to use it.

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

No objections on tech-kern@:

http://mail-index.netbsd.org/tech-kern/2009/06/21/msg005310.html


Revision tags: yamt-nfs-mp-base5 yamt-nfs-mp-base4 jym-xensuspend-base
# 1.59 07-May-2009 elad

Extract the open-coded authorization logic for chtimes() from various
file-systems and put it in a single function, genfs_can_chtimes().

This also makes UDF follow the same policy as all other file-systems.

Mailing list reference:

http://mail-index.netbsd.org/tech-kern/2009/04/27/msg004951.html


Revision tags: yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.58 14-Mar-2009 dsl

ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.


Revision tags: nick-hppapmap-base2 mjf-devfs2-base
# 1.57 11-Jan-2009 cegger

branches: 1.57.2;
make this compile


# 1.56 11-Jan-2009 christos

merge christos-time_t


Revision tags: haad-dm-base2 haad-nbase2 ad-audiomp2-base christos-time_t-nbase christos-time_t-base haad-dm-base
# 1.55 28-Nov-2008 pooka

Tyop: v -> vp. Spotted by Tom's ARM builds.


# 1.54 26-Nov-2008 pooka

Rototill all remaining file systems to use ubc_uiomove() instead
of the ubc_alloc() - uiomove() - ubc_release() dance.


# 1.53 14-Nov-2008 pooka

In case writing past EOF, fail if extending the file fails (most
likely due to the file system being full).

Otherwise we'd fail in VOP_PUTPAGES(), which might not happen during
VOP_WRITE(), thus giving the caller the wrong impression that
writing was succesful.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE 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 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 wrstuden-revivesa-base
# 1.52 16-May-2008 hannken

branches: 1.52.4; 1.52.6; 1.52.10;
Make sure all cached buffers with valid, not yet written data have been
run through copy-on-write. Call fscow_run() with valid data where possible.

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

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

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

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

Welcome to 4.99.63

Reviewed by: YAMAMOTO Takashi <yamt@netbsd.org>


Revision tags: yamt-nfs-mp-base2
# 1.51 30-Apr-2008 ad

branches: 1.51.2;
Make various bits of debug code compile again.


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

branches: 1.50.2;
Network protocol interrupts can now block on locks, so merge the globals
proclist_mutex and proclist_lock into a single adaptive mutex (proc_lock).
Implications:

- Inspecting process state requires thread context, so signals can no longer
be sent from a hardware interrupt handler. Signal activity must be
deferred to a soft interrupt or kthread.

- As the proc state locking is simplified, it's now safe to take exit()
and wait() out from under kernel_lock.

- The system spends less time at IPL_SCHED, and there is less lock activity.


Revision tags: yamt-pf42-baseX yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase nick-net80211-sync-base keiichi-mipv6-base matt-armv6-nbase mjf-devfs-base hpcarm-cleanup-base
# 1.49 30-Jan-2008 ad

branches: 1.49.6; 1.49.8;
Replace struct lock on vnodes with a simpler lock object built on
krwlock_t. This is a step towards removing lockmgr and simplifying
vnode locking. Discussed on tech-kern.


# 1.48 25-Jan-2008 ad

Remove VOP_LEASE. Discussed on tech-kern.


Revision tags: bouyer-xeni386-nbase bouyer-xeni386-base matt-armv6-base
# 1.47 05-Jan-2008 christos

PR/37696: Paul Ripke: add large read / readahead support (Introduce run-length
detection to msdosfs_bmap(), from FreeBSD)


# 1.46 02-Jan-2008 ad

Merge vmlocking2 to head.


# 1.45 28-Dec-2007 reinoud

Use uvm_vnp_setwritesize() on file extending to instruct UVM to NOT read-in
the newly added space first. This significantly speeds up write speed for
msdosfs and making it at par with ffs wich already had this patched.

Speed increase measured on my IDE disc from 2Mb/sec to 32 Mb/sec


Revision tags: vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 vmlocking-nbase jmcneill-pm-base reinoud-bufcleanup-base
# 1.44 26-Nov-2007 pooka

branches: 1.44.2; 1.44.6;
Remove the "struct lwp *" argument from all VFS and VOP interfaces.
The general trend is to remove it from all kernel interfaces and
this is a start. In case the calling lwp is desired, curlwp should
be used.

quick consensus on tech-kern


Revision tags: bouyer-xenamd64-base2 bouyer-xenamd64-base
# 1.43 14-Nov-2007 pooka

Fix a problem noticed by Reinoud: the fs would try to release an
unlocked vnode when trying to rename a directory. The fix was to
shuffle some bits around and #pray.

The rename routine actually needs a very very major wide-angle whopping:
* it takes locks out-of-order
* it deals with references from SAVESTART lookups in interesting ways
* I doubt there is any guarantee for correct operation if there
are multiple concurrent accesses
* the error branches might just as well call panic() directly


Revision tags: jmcneill-base yamt-x86pmap-base4 yamt-x86pmap-base3 vmlocking-base
# 1.42 08-Oct-2007 ad

branches: 1.42.2; 1.42.4;
Merge brelse() changes from the vmlocking branch.


Revision tags: yamt-x86pmap-base2
# 1.41 24-Sep-2007 rumble

Avoid stack allocation of large dirent structures in foo_readdir().


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base matt-mips64-base
# 1.40 29-Jul-2007 rumble

branches: 1.40.4; 1.40.6; 1.40.8; 1.40.10;
Use _DIRENT_MINSIZE when determining the number of NFS cookies to allocate,
rather than hard-coding 16.


Revision tags: nick-csl-alignment-base yamt-idlelwp-base8 mjf-ufs-trans-base
# 1.39 19-Apr-2007 yamt

branches: 1.39.2;
hold proclist_mutex when calling psignal().


Revision tags: thorpej-atomic-base
# 1.38 04-Mar-2007 christos

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


Revision tags: ad-audiomp-base
# 1.37 21-Feb-2007 thorpej

Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.


Revision tags: post-newlock2-merge newlock2-nbase newlock2-base
# 1.36 04-Jan-2007 elad

branches: 1.36.2;
Consistent usage of KAUTH_GENERIC_ISSUSER.


Revision tags: yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3
# 1.35 09-Dec-2006 chs

a smorgasbord of improvements to vnode locking and path lookup:
- LOCKPARENT is no longer relevant for lookup(), relookup() or VOP_LOOKUP().
these now always return the parent vnode locked. namei() works as before.
lookup() and various other paths no longer acquire vnode locks in the
wrong order via vrele(). fixes PR 32535.
as a nice side effect, path lookup is also up to 25% faster.
- the above allows us to get rid of PDIRUNLOCK.
- also get rid of WANTPARENT (just use LOCKPARENT and unlock it).
- remove an assumption in layer_node_find() that all file systems implement
a recursive VOP_LOCK() (unionfs doesn't).
- require that all file systems supply vfs_vptofh and vfs_fhtovp routines.
fill in eopnotsupp() for file systems that don't support being exported
and remove the checks for NULL. (layerfs calls these without checking.)
- in union_lookup1(), don't change refcounts in the ISDOTDOT case, just
adjust which vnode is locked. fixes PR 33374.
- apply fixes for ufs_rename() from ufs_vnops.c rev. 1.61 to ext2fs_rename().


Revision tags: netbsd-4-base
# 1.34 25-Nov-2006 scw

branches: 1.34.2;
Support FAT filesystems on non-DEV_BSIZE media.

Based on the patches provided in PR kern/17398 by Trevin Beattie.


# 1.33 16-Nov-2006 christos

__unused removal on arguments; approved by core.


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

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


# 1.31 22-Sep-2006 xtraeme

Apply patch from PR kern/34583 sent by Rhialto, quoting him:

"Add a 3rd entry in the cache, which keeps the end position
from just before extending a file.
This has the desired effect of keeping the write speed constant."

And yes, that helps a lot copying large files... always at full speed
now. This closes my PR kern/30868 "Poor performance copying large files
on msdosfs".

Also remove a 2 if-statements testing the same condition, combine them.

All that from Rhialto, thank you very much.


Revision tags: abandoned-netbsd-4-base yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 rpaulo-netinet-merge-pcb-base
# 1.30 23-Jul-2006 ad

branches: 1.30.2; 1.30.4; 1.30.6;
Use the LWP cached credentials where sane.


Revision tags: yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base chap-midi-base
# 1.29 07-Jun-2006 kardel

merge FreeBSD timecounters from branch simonb-timecounters
- struct timeval time is gone
time.tv_sec -> time_second
- struct timeval mono_time is gone
mono_time.tv_sec -> time_uptime
- access to time via
{get,}{micro,nano,bin}time()
get* versions are fast but less precise
- support NTP nanokernel implementation (NTP API 4)
- further reading:
Timecounter Paper: http://phk.freebsd.dk/pubs/timecounter.pdf
NTP Nanokernel: http://www.eecis.udel.edu/~mills/ntp/html/kern.html


Revision tags: yamt-pdpolicy-base5 simonb-timecounters-base
# 1.28 14-May-2006 elad

branches: 1.28.2;
integrate kauth.


Revision tags: elad-kernelauth-base
# 1.27 14-Apr-2006 christos

Coveriry CID 733: Remove dead code.


Revision tags: yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 yamt-pdpolicy-base
# 1.26 01-Mar-2006 yamt

branches: 1.26.2; 1.26.4; 1.26.6;
merge yamt-uio_vmspace branch.

- use vmspace rather than proc or lwp where appropriate.
the latter is more natural to specify an address space.
(and less likely to be abused for random purposes.)
- fix a swdmover race.


Revision tags: yamt-uio_vmspace-base5
# 1.25 14-Jan-2006 christos

branches: 1.25.2; 1.25.4;
Protect against uio_lwp being NULL from Pavel Cahyna


# 1.24 11-Dec-2005 christos

branches: 1.24.2;
merge ktrace-lwp.


Revision tags: ktrace-lwp-base
# 1.23 29-Nov-2005 yamt

merge yamt-readahead branch.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-base
# 1.22 04-Nov-2005 christos

branches: 1.22.2;
PR/32003: Brian Buhrow: msdosfs doesn't properly zero out high cluster data
on non-FAT32 msdos filesystems.


# 1.21 02-Nov-2005 yamt

merge yamt-vop branch. remove following VOPs.

VOP_BLKATOFF
VOP_VALLOC
VOP_BALLOC
VOP_REALLOCBLKS
VOP_VFREE
VOP_TRUNCATE
VOP_UPDATE


Revision tags: yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base
# 1.20 12-Sep-2005 christos

branches: 1.20.2;
Use nanotime() to update the time fields in filesystems. Convert the code
from macros to real functions. Original patch and review from chuq.
Note: ext2fs only keeps seconds in the on-disk inode, and msdosfs does not
have enough precision for all fields, so this is not very useful for those
two.


# 1.19 10-Sep-2005 christos

Make fileno calculations use ino_t variables.


# 1.18 29-Aug-2005 xtraeme

Remove __P()


# 1.17 29-Aug-2005 xtraeme

The maximum file size on MS-DOS filesystems is 4 GB - 1 byte, so
don't bother trying to write files bigger than this. Just return
EFBIG to caller, rather than panic()ing later.

From OpenBSD.

This closes my PR kern/30864: "panic when copying files of >4GB on msdosfs"


# 1.16 19-Aug-2005 christos

fileid is now a quad.


# 1.15 19-Aug-2005 christos

64 bit inode changes.


Revision tags: yamt-km-base4 yamt-km-base3 netbsd-3-base kent-audio2-base
# 1.14 26-Feb-2005 perry

branches: 1.14.2; 1.14.4;
nuke trailing whitespace


Revision tags: yamt-km-base2 yamt-km-base kent-audio1-beforemerge
# 1.13 09-Jan-2005 chs

branches: 1.13.2; 1.13.4;
adjust the UBC mapping code to support non-vnode uvm_objects.
this means we can no longer look at the vnode size to determine how many
pages to request in a fault, which is good since for NFS the size can change
out from under us on the server anyway. there's also a new flag UBC_UNMAP
for ubc_release(), so that the file system code can make the decision about
whether to cache mappings for files being used as executables.


Revision tags: kent-audio1-base
# 1.12 13-Sep-2004 jdolecek

set mp->mnt_stat.f_namemax on filesystem mount for use by statvfs, and use
the value for also pathconf(_PC_NAME_MAX) to keep the two in sync


# 1.11 12-May-2004 jrf

caddr_t -> void * and removal of some more casts.


# 1.10 04-May-2004 jrf

Remove caddr_t inlines. Approved by christos@NetBSD.org.


Revision tags: netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.9 26-Jan-2004 hannken

branches: 1.9.2; 1.9.4;
Fix xxx_strategy() to use the vnode arg instead of bp->b_vp.


# 1.8 25-Jan-2004 hannken

Make VOP_STRATEGY(bp) a real VOP as discussed on tech-kern.

VOP_STRATEGY(bp) is replaced by one of two new functions:

- VOP_STRATEGY(vp, bp) Call the strategy routine of vp for bp.
- DEV_STRATEGY(bp) Call the d_strategy routine of bp->b_dev for bp.

DEV_STRATEGY(bp) is used only for block-to-block device situations.


# 1.7 07-Sep-2003 itojun

add -t option for gmt time offset (normally MS-DOS filesystem has timestamp
in localtime, not GMT). PR kern/22717


# 1.6 02-Aug-2003 jdolecek

Allow separate masks for files and directories. Useful e.g. to turn
the execute bit off for files, but keep search permission for directories.
Change contributed in PR kern/21538 by Pavel Arnost, based on some FreeBSD
patches.
Further manpage changes, and backward-compatibility adjustments done by me.

Also fixes PR kern/16778 by Johan Danielsson, and PR kern/3400 by Rick Byers


# 1.5 29-Jun-2003 fvdl

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


# 1.4 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.3 26-Jun-2003 itojun

strlcpy


# 1.2 25-Feb-2003 jdolecek

make 'dosdirtemplate' static const


Revision tags: nathanw_sa_before_merge fvdl_fs64_base nathanw_sa_base
# 1.1 26-Dec-2002 jdolecek

branches: 1.1.2;
move msdosfs code from sys/msdosfs to sys/fs/msdosfs


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


Revision tags: phil-wifi-20200421 bouyer-xenpvh-base1
# 1.101 13-Apr-2020 ad

Replace most uses of vp->v_usecount with a call to vrefcnt(vp), a function
that hides the details and does atomic_load_relaxed(). Signature matches
FreeBSD.


Revision tags: phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3
# 1.100 23-Feb-2020 ad

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


Revision tags: ad-namecache-base2 ad-namecache-base1 ad-namecache-base phil-wifi-20191119
# 1.99 18-Sep-2019 christos

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


Revision tags: netbsd-8-2-RELEASE netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 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
# 1.98 26-Apr-2017 riastradh

branches: 1.98.12;
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


Revision tags: pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320
# 1.97 01-Mar-2017 hannken

Remove now redundant calls to fstrans_start()/fstrans_done().


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
# 1.96 01-Feb-2016 christos

branches: 1.96.2; 1.96.4;
- split a long line.
- remove extra test.
- move d_namlen setting to msdosfs_vnops.c to avoid the ifdef.


# 1.95 01-Feb-2016 christos

We can't depend on dp->d_namlen existing for the parts that are used in
makefs(8).


# 1.94 30-Jan-2016 mlelstv

Add support to msdosfs and makefs to generate correct Unicode (UCS-2) directory
entries from UTF8 encoded file names.


Revision tags: nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606 nick-nhusb-base-20150406
# 1.93 04-Apr-2015 riastradh

Fix remaining read(fd, NULL, 1) cases.


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


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 tls-earlyentropy-base tls-maxphys-base
# 1.91 25-Jul-2014 dholland

branches: 1.91.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.90 08-Jul-2014 hannken

Change msdosfs from hashlist to vcache:
- Use (dir_cluster, dir_offset, dir_generation) as key, where
dir_generation is non-zero and unique for unlinked but open nodes.
- Change deget() to return a vnode as it is unsafe to return a
referenced but unlocked denode.


Revision tags: yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 rmind-smpnet-nbase rmind-smpnet-base
# 1.89 23-Jan-2014 hannken

branches: 1.89.2;
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.88 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.87 02-Nov-2013 hannken

Stop using v_mount of an unreferenced vnode -- save the mount while
the vnode has a reference.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base
# 1.86 18-Mar-2013 plunky

branches: 1.86.6;
C99 section 6.7.2.3 (Tags) Note 3 states that:

A type specifier of the form

enum identifier

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

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

(ok elad@)


Revision tags: yamt-pagecache-base8
# 1.85 28-Dec-2012 hannken

Move the initialization of n to after the error branch.

From Taylor R Campbell <riastradh@netbsd.org>


# 1.84 20-Dec-2012 hannken

Change bread() and breadn() to never return a buffer on
error and modify all callers to not brelse() on error.

Welcome to 6.99.16

PR kern/46282 (6.0_BETA crash: msdosfs_bmap -> pcbmap -> bread -> bio_doread)


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6 jmcneill-usbmp-base10 yamt-pagecache-base5
# 1.83 29-Apr-2012 chs

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


Revision tags: jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8
# 1.82 03-Apr-2012 njoly

Add missing braces in previous commit.


# 1.81 02-Apr-2012 njoly

Report the SF_ARCHIVED file flag if set.


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


Revision tags: 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
# 1.79 21-Nov-2011 hannken

branches: 1.79.2; 1.79.4;
Add missing fstrans_done().

Should fix PR #45635 (KASSERT "fli->fli_trans_cnt == 0" failed)


Revision tags: jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.78 20-Jul-2011 hannken

branches: 1.78.2;
Even though msdosfs never truncates file names it advertises _PC_NO_TRUNC
as zero. Make it advertise one (no_trunc == true).

Names longer than NAME_MAX (255) will never pass namei() btw.

Fixes PR #43670 (msdosfs claims support for filenames longer than {NAME_MAX},
but fails)


# 1.77 16-Jun-2011 hannken

Rename uvm_vnp_zerorange(struct vnode *, off_t, size_t) to
ubc_zerorange(struct uvm_object *, off_t, size_t, int) changing
the first argument to an uvm_object and adding a flags argument.

Modify tmpfs_reg_resize() to zero the backing store (aobj) instead
of the vnode. Ubc_purge() no longer panics when unmounting tmpfs.

Keep uvm_vnp_zerorange() until the next kernel version bump.


# 1.76 12-Jun-2011 rmind

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 rmind-uvmplock-base
# 1.75 26-Apr-2011 hannken

branches: 1.75.2;
Change vflushbuf() to return an error if a synchronous write fails.

Welcome to 5.99.51.


# 1.74 20-Mar-2011 hannken

When extending a file, either by truncating or by writing past EOF make
sure the unallocated remainder of the last page gets zeroed.

Detected by fsx.


# 1.73 19-Mar-2011 hannken

Remove a vnode reference leak from msdosfs_rename. Release tdvp if either
doscheckpath() or relookup() fails.

Adjust test fs/vfs/t_vnops.c and remove the link count test for msdos.

Fixes PR #44661


Revision tags: bouyer-quota2-nbase
# 1.72 03-Mar-2011 pooka

In rename, use char[12]�for new names instead of [11]. At least
one routine called from here (unix2dosfn) expects and uses all of
a [12].

This may fix the "stack size exceeded" problem which has been
triggering in gson's test runs. (i'm not entirely sure why it
doesn't trigger in anyone else's env)


Revision tags: bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231
# 1.71 02-Jan-2011 dholland

branches: 1.71.2; 1.71.4;
Remove the special refcount behavior (adding an extra reference to the
parent dir) associated with SAVESTART in relookup().

Check all call sites to make sure that SAVESTART wasn't set while
calling relookup(); if it was, adjust the refcount behavior. Remove
related references to SAVESTART.

The only code that was reaching the extra ref was msdosfs_rename,
where the refcount behavior was already fairly broken and/or gross;
repair it.

Add a dummy 4th argument to relookup to make sure code that hasn't
been inspected won't compile. (This will go away next time the
relookup semantics change, which they will.)


# 1.70 30-Nov-2010 dholland

Abolish the SAVENAME and HASBUF flags. There is now always a buffer,
so the path in a struct componentname is now always valid during VOP
calls.


# 1.69 30-Nov-2010 dholland

Abolish struct componentname's cn_pnbuf. Use the path buffer in the
pathbuf object passed to namei as work space instead. (For now a pnbuf
pointer appears in struct nameidata, to support certain unclean things
that haven't been fixed yet, but it will be going away in the future.)

This removes the need for the SAVENAME and HASBUF namei flags.


Revision tags: uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.68 22-Jul-2010 njoly

Remove bad cast, fix compilation with MSDOSFS_DEBUG.


# 1.67 24-Jun-2010 hannken

Clean up vnode lock operations pass 2:

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

Welcome to 5.99.32.

Discussed on tech-kern.


# 1.66 25-May-2010 pooka

Don't double unlock fvp if source file disappears during rename.
Problem found by njoly's awesome stresstester.


Revision tags: uebayasi-xip-base1
# 1.65 23-Apr-2010 pooka

Enforce RLIMIT_FSIZE before VOP_WRITE. This adds support to file
system drivers where it was missing from and fixes one buggy
implementation. The arguably weird semantics of the check are
maintained (v_size vs. va_bytes, overwrite).


# 1.64 09-Apr-2010 hannken

Add file system suspension support (vfs_suspend(9)) to msdosfs.

Reviewed by: Antti Kantee <pooka@netbsd.org>


# 1.63 08-Apr-2010 pooka

In genfs where available.

The only functional change is mknod now returning EOPNOTSUPP instead
of EINVAL. I make this sacrifice willingly and with a clean conscience.


# 1.62 08-Apr-2010 pooka

Use genfs instead of homegrown stuff where possible.


Revision tags: yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211 yamt-nfs-mp-base8 yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 jym-xensuspend-nbase
# 1.61 03-Jul-2009 elad

branches: 1.61.2; 1.61.4;
Where possible, extract the file-system's access() routine to two internal
functions: the first checking if the operation is possible (regardless of
permissions), the second checking file-system permissions, ACLs, etc.

Mailing list reference:

http://mail-index.netbsd.org/tech-kern/2009/06/21/msg005311.html


# 1.60 23-Jun-2009 elad

Move the implementation of vaccess() to genfs_can_access(), in line with
the other routines of the same spirit.

Adjust file-system code to use it.

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

No objections on tech-kern@:

http://mail-index.netbsd.org/tech-kern/2009/06/21/msg005310.html


Revision tags: yamt-nfs-mp-base5 yamt-nfs-mp-base4 jym-xensuspend-base
# 1.59 07-May-2009 elad

Extract the open-coded authorization logic for chtimes() from various
file-systems and put it in a single function, genfs_can_chtimes().

This also makes UDF follow the same policy as all other file-systems.

Mailing list reference:

http://mail-index.netbsd.org/tech-kern/2009/04/27/msg004951.html


Revision tags: yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.58 14-Mar-2009 dsl

ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.


Revision tags: nick-hppapmap-base2 mjf-devfs2-base
# 1.57 11-Jan-2009 cegger

branches: 1.57.2;
make this compile


# 1.56 11-Jan-2009 christos

merge christos-time_t


Revision tags: haad-dm-base2 haad-nbase2 ad-audiomp2-base christos-time_t-nbase christos-time_t-base haad-dm-base
# 1.55 28-Nov-2008 pooka

Tyop: v -> vp. Spotted by Tom's ARM builds.


# 1.54 26-Nov-2008 pooka

Rototill all remaining file systems to use ubc_uiomove() instead
of the ubc_alloc() - uiomove() - ubc_release() dance.


# 1.53 14-Nov-2008 pooka

In case writing past EOF, fail if extending the file fails (most
likely due to the file system being full).

Otherwise we'd fail in VOP_PUTPAGES(), which might not happen during
VOP_WRITE(), thus giving the caller the wrong impression that
writing was succesful.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE 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 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 wrstuden-revivesa-base
# 1.52 16-May-2008 hannken

branches: 1.52.4; 1.52.6; 1.52.10;
Make sure all cached buffers with valid, not yet written data have been
run through copy-on-write. Call fscow_run() with valid data where possible.

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

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

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

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

Welcome to 4.99.63

Reviewed by: YAMAMOTO Takashi <yamt@netbsd.org>


Revision tags: yamt-nfs-mp-base2
# 1.51 30-Apr-2008 ad

branches: 1.51.2;
Make various bits of debug code compile again.


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

branches: 1.50.2;
Network protocol interrupts can now block on locks, so merge the globals
proclist_mutex and proclist_lock into a single adaptive mutex (proc_lock).
Implications:

- Inspecting process state requires thread context, so signals can no longer
be sent from a hardware interrupt handler. Signal activity must be
deferred to a soft interrupt or kthread.

- As the proc state locking is simplified, it's now safe to take exit()
and wait() out from under kernel_lock.

- The system spends less time at IPL_SCHED, and there is less lock activity.


Revision tags: yamt-pf42-baseX yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase nick-net80211-sync-base keiichi-mipv6-base matt-armv6-nbase mjf-devfs-base hpcarm-cleanup-base
# 1.49 30-Jan-2008 ad

branches: 1.49.6; 1.49.8;
Replace struct lock on vnodes with a simpler lock object built on
krwlock_t. This is a step towards removing lockmgr and simplifying
vnode locking. Discussed on tech-kern.


# 1.48 25-Jan-2008 ad

Remove VOP_LEASE. Discussed on tech-kern.


Revision tags: bouyer-xeni386-nbase bouyer-xeni386-base matt-armv6-base
# 1.47 05-Jan-2008 christos

PR/37696: Paul Ripke: add large read / readahead support (Introduce run-length
detection to msdosfs_bmap(), from FreeBSD)


# 1.46 02-Jan-2008 ad

Merge vmlocking2 to head.


# 1.45 28-Dec-2007 reinoud

Use uvm_vnp_setwritesize() on file extending to instruct UVM to NOT read-in
the newly added space first. This significantly speeds up write speed for
msdosfs and making it at par with ffs wich already had this patched.

Speed increase measured on my IDE disc from 2Mb/sec to 32 Mb/sec


Revision tags: vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 vmlocking-nbase jmcneill-pm-base reinoud-bufcleanup-base
# 1.44 26-Nov-2007 pooka

branches: 1.44.2; 1.44.6;
Remove the "struct lwp *" argument from all VFS and VOP interfaces.
The general trend is to remove it from all kernel interfaces and
this is a start. In case the calling lwp is desired, curlwp should
be used.

quick consensus on tech-kern


Revision tags: bouyer-xenamd64-base2 bouyer-xenamd64-base
# 1.43 14-Nov-2007 pooka

Fix a problem noticed by Reinoud: the fs would try to release an
unlocked vnode when trying to rename a directory. The fix was to
shuffle some bits around and #pray.

The rename routine actually needs a very very major wide-angle whopping:
* it takes locks out-of-order
* it deals with references from SAVESTART lookups in interesting ways
* I doubt there is any guarantee for correct operation if there
are multiple concurrent accesses
* the error branches might just as well call panic() directly


Revision tags: jmcneill-base yamt-x86pmap-base4 yamt-x86pmap-base3 vmlocking-base
# 1.42 08-Oct-2007 ad

branches: 1.42.2; 1.42.4;
Merge brelse() changes from the vmlocking branch.


Revision tags: yamt-x86pmap-base2
# 1.41 24-Sep-2007 rumble

Avoid stack allocation of large dirent structures in foo_readdir().


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base matt-mips64-base
# 1.40 29-Jul-2007 rumble

branches: 1.40.4; 1.40.6; 1.40.8; 1.40.10;
Use _DIRENT_MINSIZE when determining the number of NFS cookies to allocate,
rather than hard-coding 16.


Revision tags: nick-csl-alignment-base yamt-idlelwp-base8 mjf-ufs-trans-base
# 1.39 19-Apr-2007 yamt

branches: 1.39.2;
hold proclist_mutex when calling psignal().


Revision tags: thorpej-atomic-base
# 1.38 04-Mar-2007 christos

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


Revision tags: ad-audiomp-base
# 1.37 21-Feb-2007 thorpej

Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.


Revision tags: post-newlock2-merge newlock2-nbase newlock2-base
# 1.36 04-Jan-2007 elad

branches: 1.36.2;
Consistent usage of KAUTH_GENERIC_ISSUSER.


Revision tags: yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3
# 1.35 09-Dec-2006 chs

a smorgasbord of improvements to vnode locking and path lookup:
- LOCKPARENT is no longer relevant for lookup(), relookup() or VOP_LOOKUP().
these now always return the parent vnode locked. namei() works as before.
lookup() and various other paths no longer acquire vnode locks in the
wrong order via vrele(). fixes PR 32535.
as a nice side effect, path lookup is also up to 25% faster.
- the above allows us to get rid of PDIRUNLOCK.
- also get rid of WANTPARENT (just use LOCKPARENT and unlock it).
- remove an assumption in layer_node_find() that all file systems implement
a recursive VOP_LOCK() (unionfs doesn't).
- require that all file systems supply vfs_vptofh and vfs_fhtovp routines.
fill in eopnotsupp() for file systems that don't support being exported
and remove the checks for NULL. (layerfs calls these without checking.)
- in union_lookup1(), don't change refcounts in the ISDOTDOT case, just
adjust which vnode is locked. fixes PR 33374.
- apply fixes for ufs_rename() from ufs_vnops.c rev. 1.61 to ext2fs_rename().


Revision tags: netbsd-4-base
# 1.34 25-Nov-2006 scw

branches: 1.34.2;
Support FAT filesystems on non-DEV_BSIZE media.

Based on the patches provided in PR kern/17398 by Trevin Beattie.


# 1.33 16-Nov-2006 christos

__unused removal on arguments; approved by core.


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

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


# 1.31 22-Sep-2006 xtraeme

Apply patch from PR kern/34583 sent by Rhialto, quoting him:

"Add a 3rd entry in the cache, which keeps the end position
from just before extending a file.
This has the desired effect of keeping the write speed constant."

And yes, that helps a lot copying large files... always at full speed
now. This closes my PR kern/30868 "Poor performance copying large files
on msdosfs".

Also remove a 2 if-statements testing the same condition, combine them.

All that from Rhialto, thank you very much.


Revision tags: abandoned-netbsd-4-base yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 rpaulo-netinet-merge-pcb-base
# 1.30 23-Jul-2006 ad

branches: 1.30.2; 1.30.4; 1.30.6;
Use the LWP cached credentials where sane.


Revision tags: yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base chap-midi-base
# 1.29 07-Jun-2006 kardel

merge FreeBSD timecounters from branch simonb-timecounters
- struct timeval time is gone
time.tv_sec -> time_second
- struct timeval mono_time is gone
mono_time.tv_sec -> time_uptime
- access to time via
{get,}{micro,nano,bin}time()
get* versions are fast but less precise
- support NTP nanokernel implementation (NTP API 4)
- further reading:
Timecounter Paper: http://phk.freebsd.dk/pubs/timecounter.pdf
NTP Nanokernel: http://www.eecis.udel.edu/~mills/ntp/html/kern.html


Revision tags: yamt-pdpolicy-base5 simonb-timecounters-base
# 1.28 14-May-2006 elad

branches: 1.28.2;
integrate kauth.


Revision tags: elad-kernelauth-base
# 1.27 14-Apr-2006 christos

Coveriry CID 733: Remove dead code.


Revision tags: yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 yamt-pdpolicy-base
# 1.26 01-Mar-2006 yamt

branches: 1.26.2; 1.26.4; 1.26.6;
merge yamt-uio_vmspace branch.

- use vmspace rather than proc or lwp where appropriate.
the latter is more natural to specify an address space.
(and less likely to be abused for random purposes.)
- fix a swdmover race.


Revision tags: yamt-uio_vmspace-base5
# 1.25 14-Jan-2006 christos

branches: 1.25.2; 1.25.4;
Protect against uio_lwp being NULL from Pavel Cahyna


# 1.24 11-Dec-2005 christos

branches: 1.24.2;
merge ktrace-lwp.


Revision tags: ktrace-lwp-base
# 1.23 29-Nov-2005 yamt

merge yamt-readahead branch.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-base
# 1.22 04-Nov-2005 christos

branches: 1.22.2;
PR/32003: Brian Buhrow: msdosfs doesn't properly zero out high cluster data
on non-FAT32 msdos filesystems.


# 1.21 02-Nov-2005 yamt

merge yamt-vop branch. remove following VOPs.

VOP_BLKATOFF
VOP_VALLOC
VOP_BALLOC
VOP_REALLOCBLKS
VOP_VFREE
VOP_TRUNCATE
VOP_UPDATE


Revision tags: yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base
# 1.20 12-Sep-2005 christos

branches: 1.20.2;
Use nanotime() to update the time fields in filesystems. Convert the code
from macros to real functions. Original patch and review from chuq.
Note: ext2fs only keeps seconds in the on-disk inode, and msdosfs does not
have enough precision for all fields, so this is not very useful for those
two.


# 1.19 10-Sep-2005 christos

Make fileno calculations use ino_t variables.


# 1.18 29-Aug-2005 xtraeme

Remove __P()


# 1.17 29-Aug-2005 xtraeme

The maximum file size on MS-DOS filesystems is 4 GB - 1 byte, so
don't bother trying to write files bigger than this. Just return
EFBIG to caller, rather than panic()ing later.

From OpenBSD.

This closes my PR kern/30864: "panic when copying files of >4GB on msdosfs"


# 1.16 19-Aug-2005 christos

fileid is now a quad.


# 1.15 19-Aug-2005 christos

64 bit inode changes.


Revision tags: yamt-km-base4 yamt-km-base3 netbsd-3-base kent-audio2-base
# 1.14 26-Feb-2005 perry

branches: 1.14.2; 1.14.4;
nuke trailing whitespace


Revision tags: yamt-km-base2 yamt-km-base kent-audio1-beforemerge
# 1.13 09-Jan-2005 chs

branches: 1.13.2; 1.13.4;
adjust the UBC mapping code to support non-vnode uvm_objects.
this means we can no longer look at the vnode size to determine how many
pages to request in a fault, which is good since for NFS the size can change
out from under us on the server anyway. there's also a new flag UBC_UNMAP
for ubc_release(), so that the file system code can make the decision about
whether to cache mappings for files being used as executables.


Revision tags: kent-audio1-base
# 1.12 13-Sep-2004 jdolecek

set mp->mnt_stat.f_namemax on filesystem mount for use by statvfs, and use
the value for also pathconf(_PC_NAME_MAX) to keep the two in sync


# 1.11 12-May-2004 jrf

caddr_t -> void * and removal of some more casts.


# 1.10 04-May-2004 jrf

Remove caddr_t inlines. Approved by christos@NetBSD.org.


Revision tags: netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.9 26-Jan-2004 hannken

branches: 1.9.2; 1.9.4;
Fix xxx_strategy() to use the vnode arg instead of bp->b_vp.


# 1.8 25-Jan-2004 hannken

Make VOP_STRATEGY(bp) a real VOP as discussed on tech-kern.

VOP_STRATEGY(bp) is replaced by one of two new functions:

- VOP_STRATEGY(vp, bp) Call the strategy routine of vp for bp.
- DEV_STRATEGY(bp) Call the d_strategy routine of bp->b_dev for bp.

DEV_STRATEGY(bp) is used only for block-to-block device situations.


# 1.7 07-Sep-2003 itojun

add -t option for gmt time offset (normally MS-DOS filesystem has timestamp
in localtime, not GMT). PR kern/22717


# 1.6 02-Aug-2003 jdolecek

Allow separate masks for files and directories. Useful e.g. to turn
the execute bit off for files, but keep search permission for directories.
Change contributed in PR kern/21538 by Pavel Arnost, based on some FreeBSD
patches.
Further manpage changes, and backward-compatibility adjustments done by me.

Also fixes PR kern/16778 by Johan Danielsson, and PR kern/3400 by Rick Byers


# 1.5 29-Jun-2003 fvdl

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


# 1.4 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.3 26-Jun-2003 itojun

strlcpy


# 1.2 25-Feb-2003 jdolecek

make 'dosdirtemplate' static const


Revision tags: nathanw_sa_before_merge fvdl_fs64_base nathanw_sa_base
# 1.1 26-Dec-2002 jdolecek

branches: 1.1.2;
move msdosfs code from sys/msdosfs to sys/fs/msdosfs


# 1.101 13-Apr-2020 ad

Replace most uses of vp->v_usecount with a call to vrefcnt(vp), a function
that hides the details and does atomic_load_relaxed(). Signature matches
FreeBSD.


Revision tags: phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3
# 1.100 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.


Revision tags: ad-namecache-base2 ad-namecache-base1 ad-namecache-base phil-wifi-20191119
# 1.99 18-Sep-2019 christos

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


Revision tags: netbsd-8-2-RELEASE netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 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
# 1.98 26-Apr-2017 riastradh

branches: 1.98.12;
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


Revision tags: pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320
# 1.97 01-Mar-2017 hannken

Remove now redundant calls to fstrans_start()/fstrans_done().


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
# 1.96 01-Feb-2016 christos

branches: 1.96.2; 1.96.4;
- split a long line.
- remove extra test.
- move d_namlen setting to msdosfs_vnops.c to avoid the ifdef.


# 1.95 01-Feb-2016 christos

We can't depend on dp->d_namlen existing for the parts that are used in
makefs(8).


# 1.94 30-Jan-2016 mlelstv

Add support to msdosfs and makefs to generate correct Unicode (UCS-2) directory
entries from UTF8 encoded file names.


Revision tags: nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606 nick-nhusb-base-20150406
# 1.93 04-Apr-2015 riastradh

Fix remaining read(fd, NULL, 1) cases.


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


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 tls-earlyentropy-base tls-maxphys-base
# 1.91 25-Jul-2014 dholland

branches: 1.91.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.90 08-Jul-2014 hannken

Change msdosfs from hashlist to vcache:
- Use (dir_cluster, dir_offset, dir_generation) as key, where
dir_generation is non-zero and unique for unlinked but open nodes.
- Change deget() to return a vnode as it is unsafe to return a
referenced but unlocked denode.


Revision tags: yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 rmind-smpnet-nbase rmind-smpnet-base
# 1.89 23-Jan-2014 hannken

branches: 1.89.2;
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.88 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.87 02-Nov-2013 hannken

Stop using v_mount of an unreferenced vnode -- save the mount while
the vnode has a reference.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base
# 1.86 18-Mar-2013 plunky

branches: 1.86.6;
C99 section 6.7.2.3 (Tags) Note 3 states that:

A type specifier of the form

enum identifier

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

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

(ok elad@)


Revision tags: yamt-pagecache-base8
# 1.85 28-Dec-2012 hannken

Move the initialization of n to after the error branch.

From Taylor R Campbell <riastradh@netbsd.org>


# 1.84 20-Dec-2012 hannken

Change bread() and breadn() to never return a buffer on
error and modify all callers to not brelse() on error.

Welcome to 6.99.16

PR kern/46282 (6.0_BETA crash: msdosfs_bmap -> pcbmap -> bread -> bio_doread)


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6 jmcneill-usbmp-base10 yamt-pagecache-base5
# 1.83 29-Apr-2012 chs

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


Revision tags: jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8
# 1.82 03-Apr-2012 njoly

Add missing braces in previous commit.


# 1.81 02-Apr-2012 njoly

Report the SF_ARCHIVED file flag if set.


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


Revision tags: 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
# 1.79 21-Nov-2011 hannken

branches: 1.79.2; 1.79.4;
Add missing fstrans_done().

Should fix PR #45635 (KASSERT "fli->fli_trans_cnt == 0" failed)


Revision tags: jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.78 20-Jul-2011 hannken

branches: 1.78.2;
Even though msdosfs never truncates file names it advertises _PC_NO_TRUNC
as zero. Make it advertise one (no_trunc == true).

Names longer than NAME_MAX (255) will never pass namei() btw.

Fixes PR #43670 (msdosfs claims support for filenames longer than {NAME_MAX},
but fails)


# 1.77 16-Jun-2011 hannken

Rename uvm_vnp_zerorange(struct vnode *, off_t, size_t) to
ubc_zerorange(struct uvm_object *, off_t, size_t, int) changing
the first argument to an uvm_object and adding a flags argument.

Modify tmpfs_reg_resize() to zero the backing store (aobj) instead
of the vnode. Ubc_purge() no longer panics when unmounting tmpfs.

Keep uvm_vnp_zerorange() until the next kernel version bump.


# 1.76 12-Jun-2011 rmind

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 rmind-uvmplock-base
# 1.75 26-Apr-2011 hannken

branches: 1.75.2;
Change vflushbuf() to return an error if a synchronous write fails.

Welcome to 5.99.51.


# 1.74 20-Mar-2011 hannken

When extending a file, either by truncating or by writing past EOF make
sure the unallocated remainder of the last page gets zeroed.

Detected by fsx.


# 1.73 19-Mar-2011 hannken

Remove a vnode reference leak from msdosfs_rename. Release tdvp if either
doscheckpath() or relookup() fails.

Adjust test fs/vfs/t_vnops.c and remove the link count test for msdos.

Fixes PR #44661


Revision tags: bouyer-quota2-nbase
# 1.72 03-Mar-2011 pooka

In rename, use char[12]�for new names instead of [11]. At least
one routine called from here (unix2dosfn) expects and uses all of
a [12].

This may fix the "stack size exceeded" problem which has been
triggering in gson's test runs. (i'm not entirely sure why it
doesn't trigger in anyone else's env)


Revision tags: bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231
# 1.71 02-Jan-2011 dholland

branches: 1.71.2; 1.71.4;
Remove the special refcount behavior (adding an extra reference to the
parent dir) associated with SAVESTART in relookup().

Check all call sites to make sure that SAVESTART wasn't set while
calling relookup(); if it was, adjust the refcount behavior. Remove
related references to SAVESTART.

The only code that was reaching the extra ref was msdosfs_rename,
where the refcount behavior was already fairly broken and/or gross;
repair it.

Add a dummy 4th argument to relookup to make sure code that hasn't
been inspected won't compile. (This will go away next time the
relookup semantics change, which they will.)


# 1.70 30-Nov-2010 dholland

Abolish the SAVENAME and HASBUF flags. There is now always a buffer,
so the path in a struct componentname is now always valid during VOP
calls.


# 1.69 30-Nov-2010 dholland

Abolish struct componentname's cn_pnbuf. Use the path buffer in the
pathbuf object passed to namei as work space instead. (For now a pnbuf
pointer appears in struct nameidata, to support certain unclean things
that haven't been fixed yet, but it will be going away in the future.)

This removes the need for the SAVENAME and HASBUF namei flags.


Revision tags: uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.68 22-Jul-2010 njoly

Remove bad cast, fix compilation with MSDOSFS_DEBUG.


# 1.67 24-Jun-2010 hannken

Clean up vnode lock operations pass 2:

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

Welcome to 5.99.32.

Discussed on tech-kern.


# 1.66 25-May-2010 pooka

Don't double unlock fvp if source file disappears during rename.
Problem found by njoly's awesome stresstester.


Revision tags: uebayasi-xip-base1
# 1.65 23-Apr-2010 pooka

Enforce RLIMIT_FSIZE before VOP_WRITE. This adds support to file
system drivers where it was missing from and fixes one buggy
implementation. The arguably weird semantics of the check are
maintained (v_size vs. va_bytes, overwrite).


# 1.64 09-Apr-2010 hannken

Add file system suspension support (vfs_suspend(9)) to msdosfs.

Reviewed by: Antti Kantee <pooka@netbsd.org>


# 1.63 08-Apr-2010 pooka

In genfs where available.

The only functional change is mknod now returning EOPNOTSUPP instead
of EINVAL. I make this sacrifice willingly and with a clean conscience.


# 1.62 08-Apr-2010 pooka

Use genfs instead of homegrown stuff where possible.


Revision tags: yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211 yamt-nfs-mp-base8 yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 jym-xensuspend-nbase
# 1.61 03-Jul-2009 elad

branches: 1.61.2; 1.61.4;
Where possible, extract the file-system's access() routine to two internal
functions: the first checking if the operation is possible (regardless of
permissions), the second checking file-system permissions, ACLs, etc.

Mailing list reference:

http://mail-index.netbsd.org/tech-kern/2009/06/21/msg005311.html


# 1.60 23-Jun-2009 elad

Move the implementation of vaccess() to genfs_can_access(), in line with
the other routines of the same spirit.

Adjust file-system code to use it.

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

No objections on tech-kern@:

http://mail-index.netbsd.org/tech-kern/2009/06/21/msg005310.html


Revision tags: yamt-nfs-mp-base5 yamt-nfs-mp-base4 jym-xensuspend-base
# 1.59 07-May-2009 elad

Extract the open-coded authorization logic for chtimes() from various
file-systems and put it in a single function, genfs_can_chtimes().

This also makes UDF follow the same policy as all other file-systems.

Mailing list reference:

http://mail-index.netbsd.org/tech-kern/2009/04/27/msg004951.html


Revision tags: yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.58 14-Mar-2009 dsl

ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.


Revision tags: nick-hppapmap-base2 mjf-devfs2-base
# 1.57 11-Jan-2009 cegger

branches: 1.57.2;
make this compile


# 1.56 11-Jan-2009 christos

merge christos-time_t


Revision tags: haad-dm-base2 haad-nbase2 ad-audiomp2-base christos-time_t-nbase christos-time_t-base haad-dm-base
# 1.55 28-Nov-2008 pooka

Tyop: v -> vp. Spotted by Tom's ARM builds.


# 1.54 26-Nov-2008 pooka

Rototill all remaining file systems to use ubc_uiomove() instead
of the ubc_alloc() - uiomove() - ubc_release() dance.


# 1.53 14-Nov-2008 pooka

In case writing past EOF, fail if extending the file fails (most
likely due to the file system being full).

Otherwise we'd fail in VOP_PUTPAGES(), which might not happen during
VOP_WRITE(), thus giving the caller the wrong impression that
writing was succesful.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE 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 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 wrstuden-revivesa-base
# 1.52 16-May-2008 hannken

branches: 1.52.4; 1.52.6; 1.52.10;
Make sure all cached buffers with valid, not yet written data have been
run through copy-on-write. Call fscow_run() with valid data where possible.

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

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

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

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

Welcome to 4.99.63

Reviewed by: YAMAMOTO Takashi <yamt@netbsd.org>


Revision tags: yamt-nfs-mp-base2
# 1.51 30-Apr-2008 ad

branches: 1.51.2;
Make various bits of debug code compile again.


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

branches: 1.50.2;
Network protocol interrupts can now block on locks, so merge the globals
proclist_mutex and proclist_lock into a single adaptive mutex (proc_lock).
Implications:

- Inspecting process state requires thread context, so signals can no longer
be sent from a hardware interrupt handler. Signal activity must be
deferred to a soft interrupt or kthread.

- As the proc state locking is simplified, it's now safe to take exit()
and wait() out from under kernel_lock.

- The system spends less time at IPL_SCHED, and there is less lock activity.


Revision tags: yamt-pf42-baseX yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase nick-net80211-sync-base keiichi-mipv6-base matt-armv6-nbase mjf-devfs-base hpcarm-cleanup-base
# 1.49 30-Jan-2008 ad

branches: 1.49.6; 1.49.8;
Replace struct lock on vnodes with a simpler lock object built on
krwlock_t. This is a step towards removing lockmgr and simplifying
vnode locking. Discussed on tech-kern.


# 1.48 25-Jan-2008 ad

Remove VOP_LEASE. Discussed on tech-kern.


Revision tags: bouyer-xeni386-nbase bouyer-xeni386-base matt-armv6-base
# 1.47 05-Jan-2008 christos

PR/37696: Paul Ripke: add large read / readahead support (Introduce run-length
detection to msdosfs_bmap(), from FreeBSD)


# 1.46 02-Jan-2008 ad

Merge vmlocking2 to head.


# 1.45 28-Dec-2007 reinoud

Use uvm_vnp_setwritesize() on file extending to instruct UVM to NOT read-in
the newly added space first. This significantly speeds up write speed for
msdosfs and making it at par with ffs wich already had this patched.

Speed increase measured on my IDE disc from 2Mb/sec to 32 Mb/sec


Revision tags: vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 vmlocking-nbase jmcneill-pm-base reinoud-bufcleanup-base
# 1.44 26-Nov-2007 pooka

branches: 1.44.2; 1.44.6;
Remove the "struct lwp *" argument from all VFS and VOP interfaces.
The general trend is to remove it from all kernel interfaces and
this is a start. In case the calling lwp is desired, curlwp should
be used.

quick consensus on tech-kern


Revision tags: bouyer-xenamd64-base2 bouyer-xenamd64-base
# 1.43 14-Nov-2007 pooka

Fix a problem noticed by Reinoud: the fs would try to release an
unlocked vnode when trying to rename a directory. The fix was to
shuffle some bits around and #pray.

The rename routine actually needs a very very major wide-angle whopping:
* it takes locks out-of-order
* it deals with references from SAVESTART lookups in interesting ways
* I doubt there is any guarantee for correct operation if there
are multiple concurrent accesses
* the error branches might just as well call panic() directly


Revision tags: jmcneill-base yamt-x86pmap-base4 yamt-x86pmap-base3 vmlocking-base
# 1.42 08-Oct-2007 ad

branches: 1.42.2; 1.42.4;
Merge brelse() changes from the vmlocking branch.


Revision tags: yamt-x86pmap-base2
# 1.41 24-Sep-2007 rumble

Avoid stack allocation of large dirent structures in foo_readdir().


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base matt-mips64-base
# 1.40 29-Jul-2007 rumble

branches: 1.40.4; 1.40.6; 1.40.8; 1.40.10;
Use _DIRENT_MINSIZE when determining the number of NFS cookies to allocate,
rather than hard-coding 16.


Revision tags: nick-csl-alignment-base yamt-idlelwp-base8 mjf-ufs-trans-base
# 1.39 19-Apr-2007 yamt

branches: 1.39.2;
hold proclist_mutex when calling psignal().


Revision tags: thorpej-atomic-base
# 1.38 04-Mar-2007 christos

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


Revision tags: ad-audiomp-base
# 1.37 21-Feb-2007 thorpej

Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.


Revision tags: post-newlock2-merge newlock2-nbase newlock2-base
# 1.36 04-Jan-2007 elad

branches: 1.36.2;
Consistent usage of KAUTH_GENERIC_ISSUSER.


Revision tags: yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3
# 1.35 09-Dec-2006 chs

a smorgasbord of improvements to vnode locking and path lookup:
- LOCKPARENT is no longer relevant for lookup(), relookup() or VOP_LOOKUP().
these now always return the parent vnode locked. namei() works as before.
lookup() and various other paths no longer acquire vnode locks in the
wrong order via vrele(). fixes PR 32535.
as a nice side effect, path lookup is also up to 25% faster.
- the above allows us to get rid of PDIRUNLOCK.
- also get rid of WANTPARENT (just use LOCKPARENT and unlock it).
- remove an assumption in layer_node_find() that all file systems implement
a recursive VOP_LOCK() (unionfs doesn't).
- require that all file systems supply vfs_vptofh and vfs_fhtovp routines.
fill in eopnotsupp() for file systems that don't support being exported
and remove the checks for NULL. (layerfs calls these without checking.)
- in union_lookup1(), don't change refcounts in the ISDOTDOT case, just
adjust which vnode is locked. fixes PR 33374.
- apply fixes for ufs_rename() from ufs_vnops.c rev. 1.61 to ext2fs_rename().


Revision tags: netbsd-4-base
# 1.34 25-Nov-2006 scw

branches: 1.34.2;
Support FAT filesystems on non-DEV_BSIZE media.

Based on the patches provided in PR kern/17398 by Trevin Beattie.


# 1.33 16-Nov-2006 christos

__unused removal on arguments; approved by core.


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

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


# 1.31 22-Sep-2006 xtraeme

Apply patch from PR kern/34583 sent by Rhialto, quoting him:

"Add a 3rd entry in the cache, which keeps the end position
from just before extending a file.
This has the desired effect of keeping the write speed constant."

And yes, that helps a lot copying large files... always at full speed
now. This closes my PR kern/30868 "Poor performance copying large files
on msdosfs".

Also remove a 2 if-statements testing the same condition, combine them.

All that from Rhialto, thank you very much.


Revision tags: abandoned-netbsd-4-base yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 rpaulo-netinet-merge-pcb-base
# 1.30 23-Jul-2006 ad

branches: 1.30.2; 1.30.4; 1.30.6;
Use the LWP cached credentials where sane.


Revision tags: yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base chap-midi-base
# 1.29 07-Jun-2006 kardel

merge FreeBSD timecounters from branch simonb-timecounters
- struct timeval time is gone
time.tv_sec -> time_second
- struct timeval mono_time is gone
mono_time.tv_sec -> time_uptime
- access to time via
{get,}{micro,nano,bin}time()
get* versions are fast but less precise
- support NTP nanokernel implementation (NTP API 4)
- further reading:
Timecounter Paper: http://phk.freebsd.dk/pubs/timecounter.pdf
NTP Nanokernel: http://www.eecis.udel.edu/~mills/ntp/html/kern.html


Revision tags: yamt-pdpolicy-base5 simonb-timecounters-base
# 1.28 14-May-2006 elad

branches: 1.28.2;
integrate kauth.


Revision tags: elad-kernelauth-base
# 1.27 14-Apr-2006 christos

Coveriry CID 733: Remove dead code.


Revision tags: yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 yamt-pdpolicy-base
# 1.26 01-Mar-2006 yamt

branches: 1.26.2; 1.26.4; 1.26.6;
merge yamt-uio_vmspace branch.

- use vmspace rather than proc or lwp where appropriate.
the latter is more natural to specify an address space.
(and less likely to be abused for random purposes.)
- fix a swdmover race.


Revision tags: yamt-uio_vmspace-base5
# 1.25 14-Jan-2006 christos

branches: 1.25.2; 1.25.4;
Protect against uio_lwp being NULL from Pavel Cahyna


# 1.24 11-Dec-2005 christos

branches: 1.24.2;
merge ktrace-lwp.


Revision tags: ktrace-lwp-base
# 1.23 29-Nov-2005 yamt

merge yamt-readahead branch.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-base
# 1.22 04-Nov-2005 christos

branches: 1.22.2;
PR/32003: Brian Buhrow: msdosfs doesn't properly zero out high cluster data
on non-FAT32 msdos filesystems.


# 1.21 02-Nov-2005 yamt

merge yamt-vop branch. remove following VOPs.

VOP_BLKATOFF
VOP_VALLOC
VOP_BALLOC
VOP_REALLOCBLKS
VOP_VFREE
VOP_TRUNCATE
VOP_UPDATE


Revision tags: yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base
# 1.20 12-Sep-2005 christos

branches: 1.20.2;
Use nanotime() to update the time fields in filesystems. Convert the code
from macros to real functions. Original patch and review from chuq.
Note: ext2fs only keeps seconds in the on-disk inode, and msdosfs does not
have enough precision for all fields, so this is not very useful for those
two.


# 1.19 10-Sep-2005 christos

Make fileno calculations use ino_t variables.


# 1.18 29-Aug-2005 xtraeme

Remove __P()


# 1.17 29-Aug-2005 xtraeme

The maximum file size on MS-DOS filesystems is 4 GB - 1 byte, so
don't bother trying to write files bigger than this. Just return
EFBIG to caller, rather than panic()ing later.

From OpenBSD.

This closes my PR kern/30864: "panic when copying files of >4GB on msdosfs"


# 1.16 19-Aug-2005 christos

fileid is now a quad.


# 1.15 19-Aug-2005 christos

64 bit inode changes.


Revision tags: yamt-km-base4 yamt-km-base3 netbsd-3-base kent-audio2-base
# 1.14 26-Feb-2005 perry

branches: 1.14.2; 1.14.4;
nuke trailing whitespace


Revision tags: yamt-km-base2 yamt-km-base kent-audio1-beforemerge
# 1.13 09-Jan-2005 chs

branches: 1.13.2; 1.13.4;
adjust the UBC mapping code to support non-vnode uvm_objects.
this means we can no longer look at the vnode size to determine how many
pages to request in a fault, which is good since for NFS the size can change
out from under us on the server anyway. there's also a new flag UBC_UNMAP
for ubc_release(), so that the file system code can make the decision about
whether to cache mappings for files being used as executables.


Revision tags: kent-audio1-base
# 1.12 13-Sep-2004 jdolecek

set mp->mnt_stat.f_namemax on filesystem mount for use by statvfs, and use
the value for also pathconf(_PC_NAME_MAX) to keep the two in sync


# 1.11 12-May-2004 jrf

caddr_t -> void * and removal of some more casts.


# 1.10 04-May-2004 jrf

Remove caddr_t inlines. Approved by christos@NetBSD.org.


Revision tags: netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.9 26-Jan-2004 hannken

branches: 1.9.2; 1.9.4;
Fix xxx_strategy() to use the vnode arg instead of bp->b_vp.


# 1.8 25-Jan-2004 hannken

Make VOP_STRATEGY(bp) a real VOP as discussed on tech-kern.

VOP_STRATEGY(bp) is replaced by one of two new functions:

- VOP_STRATEGY(vp, bp) Call the strategy routine of vp for bp.
- DEV_STRATEGY(bp) Call the d_strategy routine of bp->b_dev for bp.

DEV_STRATEGY(bp) is used only for block-to-block device situations.


# 1.7 07-Sep-2003 itojun

add -t option for gmt time offset (normally MS-DOS filesystem has timestamp
in localtime, not GMT). PR kern/22717


# 1.6 02-Aug-2003 jdolecek

Allow separate masks for files and directories. Useful e.g. to turn
the execute bit off for files, but keep search permission for directories.
Change contributed in PR kern/21538 by Pavel Arnost, based on some FreeBSD
patches.
Further manpage changes, and backward-compatibility adjustments done by me.

Also fixes PR kern/16778 by Johan Danielsson, and PR kern/3400 by Rick Byers


# 1.5 29-Jun-2003 fvdl

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


# 1.4 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.3 26-Jun-2003 itojun

strlcpy


# 1.2 25-Feb-2003 jdolecek

make 'dosdirtemplate' static const


Revision tags: nathanw_sa_before_merge fvdl_fs64_base nathanw_sa_base
# 1.1 26-Dec-2002 jdolecek

branches: 1.1.2;
move msdosfs code from sys/msdosfs to sys/fs/msdosfs


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


Revision tags: ad-namecache-base2 ad-namecache-base1 ad-namecache-base phil-wifi-20191119
# 1.99 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.


Revision tags: netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 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
# 1.98 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


Revision tags: pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320
# 1.97 01-Mar-2017 hannken

Remove now redundant calls to fstrans_start()/fstrans_done().


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
# 1.96 01-Feb-2016 christos

branches: 1.96.2; 1.96.4;
- split a long line.
- remove extra test.
- move d_namlen setting to msdosfs_vnops.c to avoid the ifdef.


# 1.95 01-Feb-2016 christos

We can't depend on dp->d_namlen existing for the parts that are used in
makefs(8).


# 1.94 30-Jan-2016 mlelstv

Add support to msdosfs and makefs to generate correct Unicode (UCS-2) directory
entries from UTF8 encoded file names.


Revision tags: nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606 nick-nhusb-base-20150406
# 1.93 04-Apr-2015 riastradh

Fix remaining read(fd, NULL, 1) cases.


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


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 tls-earlyentropy-base tls-maxphys-base
# 1.91 25-Jul-2014 dholland

branches: 1.91.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.90 08-Jul-2014 hannken

Change msdosfs from hashlist to vcache:
- Use (dir_cluster, dir_offset, dir_generation) as key, where
dir_generation is non-zero and unique for unlinked but open nodes.
- Change deget() to return a vnode as it is unsafe to return a
referenced but unlocked denode.


Revision tags: yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 rmind-smpnet-nbase rmind-smpnet-base
# 1.89 23-Jan-2014 hannken

branches: 1.89.2;
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.88 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.87 02-Nov-2013 hannken

Stop using v_mount of an unreferenced vnode -- save the mount while
the vnode has a reference.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base
# 1.86 18-Mar-2013 plunky

branches: 1.86.6;
C99 section 6.7.2.3 (Tags) Note 3 states that:

A type specifier of the form

enum identifier

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

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

(ok elad@)


Revision tags: yamt-pagecache-base8
# 1.85 28-Dec-2012 hannken

Move the initialization of n to after the error branch.

From Taylor R Campbell <riastradh@netbsd.org>


# 1.84 20-Dec-2012 hannken

Change bread() and breadn() to never return a buffer on
error and modify all callers to not brelse() on error.

Welcome to 6.99.16

PR kern/46282 (6.0_BETA crash: msdosfs_bmap -> pcbmap -> bread -> bio_doread)


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6 jmcneill-usbmp-base10 yamt-pagecache-base5
# 1.83 29-Apr-2012 chs

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


Revision tags: jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8
# 1.82 03-Apr-2012 njoly

Add missing braces in previous commit.


# 1.81 02-Apr-2012 njoly

Report the SF_ARCHIVED file flag if set.


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


Revision tags: 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
# 1.79 21-Nov-2011 hannken

branches: 1.79.2; 1.79.4;
Add missing fstrans_done().

Should fix PR #45635 (KASSERT "fli->fli_trans_cnt == 0" failed)


Revision tags: jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.78 20-Jul-2011 hannken

branches: 1.78.2;
Even though msdosfs never truncates file names it advertises _PC_NO_TRUNC
as zero. Make it advertise one (no_trunc == true).

Names longer than NAME_MAX (255) will never pass namei() btw.

Fixes PR #43670 (msdosfs claims support for filenames longer than {NAME_MAX},
but fails)


# 1.77 16-Jun-2011 hannken

Rename uvm_vnp_zerorange(struct vnode *, off_t, size_t) to
ubc_zerorange(struct uvm_object *, off_t, size_t, int) changing
the first argument to an uvm_object and adding a flags argument.

Modify tmpfs_reg_resize() to zero the backing store (aobj) instead
of the vnode. Ubc_purge() no longer panics when unmounting tmpfs.

Keep uvm_vnp_zerorange() until the next kernel version bump.


# 1.76 12-Jun-2011 rmind

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 rmind-uvmplock-base
# 1.75 26-Apr-2011 hannken

branches: 1.75.2;
Change vflushbuf() to return an error if a synchronous write fails.

Welcome to 5.99.51.


# 1.74 20-Mar-2011 hannken

When extending a file, either by truncating or by writing past EOF make
sure the unallocated remainder of the last page gets zeroed.

Detected by fsx.


# 1.73 19-Mar-2011 hannken

Remove a vnode reference leak from msdosfs_rename. Release tdvp if either
doscheckpath() or relookup() fails.

Adjust test fs/vfs/t_vnops.c and remove the link count test for msdos.

Fixes PR #44661


Revision tags: bouyer-quota2-nbase
# 1.72 03-Mar-2011 pooka

In rename, use char[12]�for new names instead of [11]. At least
one routine called from here (unix2dosfn) expects and uses all of
a [12].

This may fix the "stack size exceeded" problem which has been
triggering in gson's test runs. (i'm not entirely sure why it
doesn't trigger in anyone else's env)


Revision tags: bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231
# 1.71 02-Jan-2011 dholland

branches: 1.71.2; 1.71.4;
Remove the special refcount behavior (adding an extra reference to the
parent dir) associated with SAVESTART in relookup().

Check all call sites to make sure that SAVESTART wasn't set while
calling relookup(); if it was, adjust the refcount behavior. Remove
related references to SAVESTART.

The only code that was reaching the extra ref was msdosfs_rename,
where the refcount behavior was already fairly broken and/or gross;
repair it.

Add a dummy 4th argument to relookup to make sure code that hasn't
been inspected won't compile. (This will go away next time the
relookup semantics change, which they will.)


# 1.70 30-Nov-2010 dholland

Abolish the SAVENAME and HASBUF flags. There is now always a buffer,
so the path in a struct componentname is now always valid during VOP
calls.


# 1.69 30-Nov-2010 dholland

Abolish struct componentname's cn_pnbuf. Use the path buffer in the
pathbuf object passed to namei as work space instead. (For now a pnbuf
pointer appears in struct nameidata, to support certain unclean things
that haven't been fixed yet, but it will be going away in the future.)

This removes the need for the SAVENAME and HASBUF namei flags.


Revision tags: uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.68 22-Jul-2010 njoly

Remove bad cast, fix compilation with MSDOSFS_DEBUG.


# 1.67 24-Jun-2010 hannken

Clean up vnode lock operations pass 2:

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

Welcome to 5.99.32.

Discussed on tech-kern.


# 1.66 25-May-2010 pooka

Don't double unlock fvp if source file disappears during rename.
Problem found by njoly's awesome stresstester.


Revision tags: uebayasi-xip-base1
# 1.65 23-Apr-2010 pooka

Enforce RLIMIT_FSIZE before VOP_WRITE. This adds support to file
system drivers where it was missing from and fixes one buggy
implementation. The arguably weird semantics of the check are
maintained (v_size vs. va_bytes, overwrite).


# 1.64 09-Apr-2010 hannken

Add file system suspension support (vfs_suspend(9)) to msdosfs.

Reviewed by: Antti Kantee <pooka@netbsd.org>


# 1.63 08-Apr-2010 pooka

In genfs where available.

The only functional change is mknod now returning EOPNOTSUPP instead
of EINVAL. I make this sacrifice willingly and with a clean conscience.


# 1.62 08-Apr-2010 pooka

Use genfs instead of homegrown stuff where possible.


Revision tags: yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211 yamt-nfs-mp-base8 yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 jym-xensuspend-nbase
# 1.61 03-Jul-2009 elad

branches: 1.61.2; 1.61.4;
Where possible, extract the file-system's access() routine to two internal
functions: the first checking if the operation is possible (regardless of
permissions), the second checking file-system permissions, ACLs, etc.

Mailing list reference:

http://mail-index.netbsd.org/tech-kern/2009/06/21/msg005311.html


# 1.60 23-Jun-2009 elad

Move the implementation of vaccess() to genfs_can_access(), in line with
the other routines of the same spirit.

Adjust file-system code to use it.

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

No objections on tech-kern@:

http://mail-index.netbsd.org/tech-kern/2009/06/21/msg005310.html


Revision tags: yamt-nfs-mp-base5 yamt-nfs-mp-base4 jym-xensuspend-base
# 1.59 07-May-2009 elad

Extract the open-coded authorization logic for chtimes() from various
file-systems and put it in a single function, genfs_can_chtimes().

This also makes UDF follow the same policy as all other file-systems.

Mailing list reference:

http://mail-index.netbsd.org/tech-kern/2009/04/27/msg004951.html


Revision tags: yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.58 14-Mar-2009 dsl

ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.


Revision tags: nick-hppapmap-base2 mjf-devfs2-base
# 1.57 11-Jan-2009 cegger

branches: 1.57.2;
make this compile


# 1.56 11-Jan-2009 christos

merge christos-time_t


Revision tags: haad-dm-base2 haad-nbase2 ad-audiomp2-base christos-time_t-nbase christos-time_t-base haad-dm-base
# 1.55 28-Nov-2008 pooka

Tyop: v -> vp. Spotted by Tom's ARM builds.


# 1.54 26-Nov-2008 pooka

Rototill all remaining file systems to use ubc_uiomove() instead
of the ubc_alloc() - uiomove() - ubc_release() dance.


# 1.53 14-Nov-2008 pooka

In case writing past EOF, fail if extending the file fails (most
likely due to the file system being full).

Otherwise we'd fail in VOP_PUTPAGES(), which might not happen during
VOP_WRITE(), thus giving the caller the wrong impression that
writing was succesful.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE 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 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 wrstuden-revivesa-base
# 1.52 16-May-2008 hannken

branches: 1.52.4; 1.52.6; 1.52.10;
Make sure all cached buffers with valid, not yet written data have been
run through copy-on-write. Call fscow_run() with valid data where possible.

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

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

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

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

Welcome to 4.99.63

Reviewed by: YAMAMOTO Takashi <yamt@netbsd.org>


Revision tags: yamt-nfs-mp-base2
# 1.51 30-Apr-2008 ad

branches: 1.51.2;
Make various bits of debug code compile again.


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

branches: 1.50.2;
Network protocol interrupts can now block on locks, so merge the globals
proclist_mutex and proclist_lock into a single adaptive mutex (proc_lock).
Implications:

- Inspecting process state requires thread context, so signals can no longer
be sent from a hardware interrupt handler. Signal activity must be
deferred to a soft interrupt or kthread.

- As the proc state locking is simplified, it's now safe to take exit()
and wait() out from under kernel_lock.

- The system spends less time at IPL_SCHED, and there is less lock activity.


Revision tags: yamt-pf42-baseX yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase nick-net80211-sync-base keiichi-mipv6-base matt-armv6-nbase mjf-devfs-base hpcarm-cleanup-base
# 1.49 30-Jan-2008 ad

branches: 1.49.6; 1.49.8;
Replace struct lock on vnodes with a simpler lock object built on
krwlock_t. This is a step towards removing lockmgr and simplifying
vnode locking. Discussed on tech-kern.


# 1.48 25-Jan-2008 ad

Remove VOP_LEASE. Discussed on tech-kern.


Revision tags: bouyer-xeni386-nbase bouyer-xeni386-base matt-armv6-base
# 1.47 05-Jan-2008 christos

PR/37696: Paul Ripke: add large read / readahead support (Introduce run-length
detection to msdosfs_bmap(), from FreeBSD)


# 1.46 02-Jan-2008 ad

Merge vmlocking2 to head.


# 1.45 28-Dec-2007 reinoud

Use uvm_vnp_setwritesize() on file extending to instruct UVM to NOT read-in
the newly added space first. This significantly speeds up write speed for
msdosfs and making it at par with ffs wich already had this patched.

Speed increase measured on my IDE disc from 2Mb/sec to 32 Mb/sec


Revision tags: vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 vmlocking-nbase jmcneill-pm-base reinoud-bufcleanup-base
# 1.44 26-Nov-2007 pooka

branches: 1.44.2; 1.44.6;
Remove the "struct lwp *" argument from all VFS and VOP interfaces.
The general trend is to remove it from all kernel interfaces and
this is a start. In case the calling lwp is desired, curlwp should
be used.

quick consensus on tech-kern


Revision tags: bouyer-xenamd64-base2 bouyer-xenamd64-base
# 1.43 14-Nov-2007 pooka

Fix a problem noticed by Reinoud: the fs would try to release an
unlocked vnode when trying to rename a directory. The fix was to
shuffle some bits around and #pray.

The rename routine actually needs a very very major wide-angle whopping:
* it takes locks out-of-order
* it deals with references from SAVESTART lookups in interesting ways
* I doubt there is any guarantee for correct operation if there
are multiple concurrent accesses
* the error branches might just as well call panic() directly


Revision tags: jmcneill-base yamt-x86pmap-base4 yamt-x86pmap-base3 vmlocking-base
# 1.42 08-Oct-2007 ad

branches: 1.42.2; 1.42.4;
Merge brelse() changes from the vmlocking branch.


Revision tags: yamt-x86pmap-base2
# 1.41 24-Sep-2007 rumble

Avoid stack allocation of large dirent structures in foo_readdir().


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base matt-mips64-base
# 1.40 29-Jul-2007 rumble

branches: 1.40.4; 1.40.6; 1.40.8; 1.40.10;
Use _DIRENT_MINSIZE when determining the number of NFS cookies to allocate,
rather than hard-coding 16.


Revision tags: nick-csl-alignment-base yamt-idlelwp-base8 mjf-ufs-trans-base
# 1.39 19-Apr-2007 yamt

branches: 1.39.2;
hold proclist_mutex when calling psignal().


Revision tags: thorpej-atomic-base
# 1.38 04-Mar-2007 christos

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


Revision tags: ad-audiomp-base
# 1.37 21-Feb-2007 thorpej

Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.


Revision tags: post-newlock2-merge newlock2-nbase newlock2-base
# 1.36 04-Jan-2007 elad

branches: 1.36.2;
Consistent usage of KAUTH_GENERIC_ISSUSER.


Revision tags: yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3
# 1.35 09-Dec-2006 chs

a smorgasbord of improvements to vnode locking and path lookup:
- LOCKPARENT is no longer relevant for lookup(), relookup() or VOP_LOOKUP().
these now always return the parent vnode locked. namei() works as before.
lookup() and various other paths no longer acquire vnode locks in the
wrong order via vrele(). fixes PR 32535.
as a nice side effect, path lookup is also up to 25% faster.
- the above allows us to get rid of PDIRUNLOCK.
- also get rid of WANTPARENT (just use LOCKPARENT and unlock it).
- remove an assumption in layer_node_find() that all file systems implement
a recursive VOP_LOCK() (unionfs doesn't).
- require that all file systems supply vfs_vptofh and vfs_fhtovp routines.
fill in eopnotsupp() for file systems that don't support being exported
and remove the checks for NULL. (layerfs calls these without checking.)
- in union_lookup1(), don't change refcounts in the ISDOTDOT case, just
adjust which vnode is locked. fixes PR 33374.
- apply fixes for ufs_rename() from ufs_vnops.c rev. 1.61 to ext2fs_rename().


Revision tags: netbsd-4-base
# 1.34 25-Nov-2006 scw

branches: 1.34.2;
Support FAT filesystems on non-DEV_BSIZE media.

Based on the patches provided in PR kern/17398 by Trevin Beattie.


# 1.33 16-Nov-2006 christos

__unused removal on arguments; approved by core.


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

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


# 1.31 22-Sep-2006 xtraeme

Apply patch from PR kern/34583 sent by Rhialto, quoting him:

"Add a 3rd entry in the cache, which keeps the end position
from just before extending a file.
This has the desired effect of keeping the write speed constant."

And yes, that helps a lot copying large files... always at full speed
now. This closes my PR kern/30868 "Poor performance copying large files
on msdosfs".

Also remove a 2 if-statements testing the same condition, combine them.

All that from Rhialto, thank you very much.


Revision tags: abandoned-netbsd-4-base yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 rpaulo-netinet-merge-pcb-base
# 1.30 23-Jul-2006 ad

branches: 1.30.2; 1.30.4; 1.30.6;
Use the LWP cached credentials where sane.


Revision tags: yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base chap-midi-base
# 1.29 07-Jun-2006 kardel

merge FreeBSD timecounters from branch simonb-timecounters
- struct timeval time is gone
time.tv_sec -> time_second
- struct timeval mono_time is gone
mono_time.tv_sec -> time_uptime
- access to time via
{get,}{micro,nano,bin}time()
get* versions are fast but less precise
- support NTP nanokernel implementation (NTP API 4)
- further reading:
Timecounter Paper: http://phk.freebsd.dk/pubs/timecounter.pdf
NTP Nanokernel: http://www.eecis.udel.edu/~mills/ntp/html/kern.html


Revision tags: yamt-pdpolicy-base5 simonb-timecounters-base
# 1.28 14-May-2006 elad

branches: 1.28.2;
integrate kauth.


Revision tags: elad-kernelauth-base
# 1.27 14-Apr-2006 christos

Coveriry CID 733: Remove dead code.


Revision tags: yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 yamt-pdpolicy-base
# 1.26 01-Mar-2006 yamt

branches: 1.26.2; 1.26.4; 1.26.6;
merge yamt-uio_vmspace branch.

- use vmspace rather than proc or lwp where appropriate.
the latter is more natural to specify an address space.
(and less likely to be abused for random purposes.)
- fix a swdmover race.


Revision tags: yamt-uio_vmspace-base5
# 1.25 14-Jan-2006 christos

branches: 1.25.2; 1.25.4;
Protect against uio_lwp being NULL from Pavel Cahyna


# 1.24 11-Dec-2005 christos

branches: 1.24.2;
merge ktrace-lwp.


Revision tags: ktrace-lwp-base
# 1.23 29-Nov-2005 yamt

merge yamt-readahead branch.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-base
# 1.22 04-Nov-2005 christos

branches: 1.22.2;
PR/32003: Brian Buhrow: msdosfs doesn't properly zero out high cluster data
on non-FAT32 msdos filesystems.


# 1.21 02-Nov-2005 yamt

merge yamt-vop branch. remove following VOPs.

VOP_BLKATOFF
VOP_VALLOC
VOP_BALLOC
VOP_REALLOCBLKS
VOP_VFREE
VOP_TRUNCATE
VOP_UPDATE


Revision tags: yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base
# 1.20 12-Sep-2005 christos

branches: 1.20.2;
Use nanotime() to update the time fields in filesystems. Convert the code
from macros to real functions. Original patch and review from chuq.
Note: ext2fs only keeps seconds in the on-disk inode, and msdosfs does not
have enough precision for all fields, so this is not very useful for those
two.


# 1.19 10-Sep-2005 christos

Make fileno calculations use ino_t variables.


# 1.18 29-Aug-2005 xtraeme

Remove __P()


# 1.17 29-Aug-2005 xtraeme

The maximum file size on MS-DOS filesystems is 4 GB - 1 byte, so
don't bother trying to write files bigger than this. Just return
EFBIG to caller, rather than panic()ing later.

From OpenBSD.

This closes my PR kern/30864: "panic when copying files of >4GB on msdosfs"


# 1.16 19-Aug-2005 christos

fileid is now a quad.


# 1.15 19-Aug-2005 christos

64 bit inode changes.


Revision tags: yamt-km-base4 yamt-km-base3 netbsd-3-base kent-audio2-base
# 1.14 26-Feb-2005 perry

branches: 1.14.2; 1.14.4;
nuke trailing whitespace


Revision tags: yamt-km-base2 yamt-km-base kent-audio1-beforemerge
# 1.13 09-Jan-2005 chs

branches: 1.13.2; 1.13.4;
adjust the UBC mapping code to support non-vnode uvm_objects.
this means we can no longer look at the vnode size to determine how many
pages to request in a fault, which is good since for NFS the size can change
out from under us on the server anyway. there's also a new flag UBC_UNMAP
for ubc_release(), so that the file system code can make the decision about
whether to cache mappings for files being used as executables.


Revision tags: kent-audio1-base
# 1.12 13-Sep-2004 jdolecek

set mp->mnt_stat.f_namemax on filesystem mount for use by statvfs, and use
the value for also pathconf(_PC_NAME_MAX) to keep the two in sync


# 1.11 12-May-2004 jrf

caddr_t -> void * and removal of some more casts.


# 1.10 04-May-2004 jrf

Remove caddr_t inlines. Approved by christos@NetBSD.org.


Revision tags: netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.9 26-Jan-2004 hannken

branches: 1.9.2; 1.9.4;
Fix xxx_strategy() to use the vnode arg instead of bp->b_vp.


# 1.8 25-Jan-2004 hannken

Make VOP_STRATEGY(bp) a real VOP as discussed on tech-kern.

VOP_STRATEGY(bp) is replaced by one of two new functions:

- VOP_STRATEGY(vp, bp) Call the strategy routine of vp for bp.
- DEV_STRATEGY(bp) Call the d_strategy routine of bp->b_dev for bp.

DEV_STRATEGY(bp) is used only for block-to-block device situations.


# 1.7 07-Sep-2003 itojun

add -t option for gmt time offset (normally MS-DOS filesystem has timestamp
in localtime, not GMT). PR kern/22717


# 1.6 02-Aug-2003 jdolecek

Allow separate masks for files and directories. Useful e.g. to turn
the execute bit off for files, but keep search permission for directories.
Change contributed in PR kern/21538 by Pavel Arnost, based on some FreeBSD
patches.
Further manpage changes, and backward-compatibility adjustments done by me.

Also fixes PR kern/16778 by Johan Danielsson, and PR kern/3400 by Rick Byers


# 1.5 29-Jun-2003 fvdl

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


# 1.4 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.3 26-Jun-2003 itojun

strlcpy


# 1.2 25-Feb-2003 jdolecek

make 'dosdirtemplate' static const


Revision tags: nathanw_sa_before_merge fvdl_fs64_base nathanw_sa_base
# 1.1 26-Dec-2002 jdolecek

branches: 1.1.2;
move msdosfs code from sys/msdosfs to sys/fs/msdosfs


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


Revision tags: 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
# 1.98 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


Revision tags: pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320
# 1.97 01-Mar-2017 hannken

Remove now redundant calls to fstrans_start()/fstrans_done().


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
# 1.96 01-Feb-2016 christos

branches: 1.96.2; 1.96.4;
- split a long line.
- remove extra test.
- move d_namlen setting to msdosfs_vnops.c to avoid the ifdef.


# 1.95 01-Feb-2016 christos

We can't depend on dp->d_namlen existing for the parts that are used in
makefs(8).


# 1.94 30-Jan-2016 mlelstv

Add support to msdosfs and makefs to generate correct Unicode (UCS-2) directory
entries from UTF8 encoded file names.


Revision tags: nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606 nick-nhusb-base-20150406
# 1.93 04-Apr-2015 riastradh

Fix remaining read(fd, NULL, 1) cases.


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


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 tls-earlyentropy-base tls-maxphys-base
# 1.91 25-Jul-2014 dholland

branches: 1.91.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.90 08-Jul-2014 hannken

Change msdosfs from hashlist to vcache:
- Use (dir_cluster, dir_offset, dir_generation) as key, where
dir_generation is non-zero and unique for unlinked but open nodes.
- Change deget() to return a vnode as it is unsafe to return a
referenced but unlocked denode.


Revision tags: yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 rmind-smpnet-nbase rmind-smpnet-base
# 1.89 23-Jan-2014 hannken

branches: 1.89.2;
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.88 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.87 02-Nov-2013 hannken

Stop using v_mount of an unreferenced vnode -- save the mount while
the vnode has a reference.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base
# 1.86 18-Mar-2013 plunky

branches: 1.86.6;
C99 section 6.7.2.3 (Tags) Note 3 states that:

A type specifier of the form

enum identifier

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

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

(ok elad@)


Revision tags: yamt-pagecache-base8
# 1.85 28-Dec-2012 hannken

Move the initialization of n to after the error branch.

From Taylor R Campbell <riastradh@netbsd.org>


# 1.84 20-Dec-2012 hannken

Change bread() and breadn() to never return a buffer on
error and modify all callers to not brelse() on error.

Welcome to 6.99.16

PR kern/46282 (6.0_BETA crash: msdosfs_bmap -> pcbmap -> bread -> bio_doread)


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6 jmcneill-usbmp-base10 yamt-pagecache-base5
# 1.83 29-Apr-2012 chs

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


Revision tags: jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8
# 1.82 03-Apr-2012 njoly

Add missing braces in previous commit.


# 1.81 02-Apr-2012 njoly

Report the SF_ARCHIVED file flag if set.


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


Revision tags: 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
# 1.79 21-Nov-2011 hannken

branches: 1.79.2; 1.79.4;
Add missing fstrans_done().

Should fix PR #45635 (KASSERT "fli->fli_trans_cnt == 0" failed)


Revision tags: jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.78 20-Jul-2011 hannken

branches: 1.78.2;
Even though msdosfs never truncates file names it advertises _PC_NO_TRUNC
as zero. Make it advertise one (no_trunc == true).

Names longer than NAME_MAX (255) will never pass namei() btw.

Fixes PR #43670 (msdosfs claims support for filenames longer than {NAME_MAX},
but fails)


# 1.77 16-Jun-2011 hannken

Rename uvm_vnp_zerorange(struct vnode *, off_t, size_t) to
ubc_zerorange(struct uvm_object *, off_t, size_t, int) changing
the first argument to an uvm_object and adding a flags argument.

Modify tmpfs_reg_resize() to zero the backing store (aobj) instead
of the vnode. Ubc_purge() no longer panics when unmounting tmpfs.

Keep uvm_vnp_zerorange() until the next kernel version bump.


# 1.76 12-Jun-2011 rmind

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 rmind-uvmplock-base
# 1.75 26-Apr-2011 hannken

branches: 1.75.2;
Change vflushbuf() to return an error if a synchronous write fails.

Welcome to 5.99.51.


# 1.74 20-Mar-2011 hannken

When extending a file, either by truncating or by writing past EOF make
sure the unallocated remainder of the last page gets zeroed.

Detected by fsx.


# 1.73 19-Mar-2011 hannken

Remove a vnode reference leak from msdosfs_rename. Release tdvp if either
doscheckpath() or relookup() fails.

Adjust test fs/vfs/t_vnops.c and remove the link count test for msdos.

Fixes PR #44661


Revision tags: bouyer-quota2-nbase
# 1.72 03-Mar-2011 pooka

In rename, use char[12]�for new names instead of [11]. At least
one routine called from here (unix2dosfn) expects and uses all of
a [12].

This may fix the "stack size exceeded" problem which has been
triggering in gson's test runs. (i'm not entirely sure why it
doesn't trigger in anyone else's env)


Revision tags: bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231
# 1.71 02-Jan-2011 dholland

branches: 1.71.2; 1.71.4;
Remove the special refcount behavior (adding an extra reference to the
parent dir) associated with SAVESTART in relookup().

Check all call sites to make sure that SAVESTART wasn't set while
calling relookup(); if it was, adjust the refcount behavior. Remove
related references to SAVESTART.

The only code that was reaching the extra ref was msdosfs_rename,
where the refcount behavior was already fairly broken and/or gross;
repair it.

Add a dummy 4th argument to relookup to make sure code that hasn't
been inspected won't compile. (This will go away next time the
relookup semantics change, which they will.)


# 1.70 30-Nov-2010 dholland

Abolish the SAVENAME and HASBUF flags. There is now always a buffer,
so the path in a struct componentname is now always valid during VOP
calls.


# 1.69 30-Nov-2010 dholland

Abolish struct componentname's cn_pnbuf. Use the path buffer in the
pathbuf object passed to namei as work space instead. (For now a pnbuf
pointer appears in struct nameidata, to support certain unclean things
that haven't been fixed yet, but it will be going away in the future.)

This removes the need for the SAVENAME and HASBUF namei flags.


Revision tags: uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.68 22-Jul-2010 njoly

Remove bad cast, fix compilation with MSDOSFS_DEBUG.


# 1.67 24-Jun-2010 hannken

Clean up vnode lock operations pass 2:

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

Welcome to 5.99.32.

Discussed on tech-kern.


# 1.66 25-May-2010 pooka

Don't double unlock fvp if source file disappears during rename.
Problem found by njoly's awesome stresstester.


Revision tags: uebayasi-xip-base1
# 1.65 23-Apr-2010 pooka

Enforce RLIMIT_FSIZE before VOP_WRITE. This adds support to file
system drivers where it was missing from and fixes one buggy
implementation. The arguably weird semantics of the check are
maintained (v_size vs. va_bytes, overwrite).


# 1.64 09-Apr-2010 hannken

Add file system suspension support (vfs_suspend(9)) to msdosfs.

Reviewed by: Antti Kantee <pooka@netbsd.org>


# 1.63 08-Apr-2010 pooka

In genfs where available.

The only functional change is mknod now returning EOPNOTSUPP instead
of EINVAL. I make this sacrifice willingly and with a clean conscience.


# 1.62 08-Apr-2010 pooka

Use genfs instead of homegrown stuff where possible.


Revision tags: yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211 yamt-nfs-mp-base8 yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 jym-xensuspend-nbase
# 1.61 03-Jul-2009 elad

branches: 1.61.2; 1.61.4;
Where possible, extract the file-system's access() routine to two internal
functions: the first checking if the operation is possible (regardless of
permissions), the second checking file-system permissions, ACLs, etc.

Mailing list reference:

http://mail-index.netbsd.org/tech-kern/2009/06/21/msg005311.html


# 1.60 23-Jun-2009 elad

Move the implementation of vaccess() to genfs_can_access(), in line with
the other routines of the same spirit.

Adjust file-system code to use it.

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

No objections on tech-kern@:

http://mail-index.netbsd.org/tech-kern/2009/06/21/msg005310.html


Revision tags: yamt-nfs-mp-base5 yamt-nfs-mp-base4 jym-xensuspend-base
# 1.59 07-May-2009 elad

Extract the open-coded authorization logic for chtimes() from various
file-systems and put it in a single function, genfs_can_chtimes().

This also makes UDF follow the same policy as all other file-systems.

Mailing list reference:

http://mail-index.netbsd.org/tech-kern/2009/04/27/msg004951.html


Revision tags: yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.58 14-Mar-2009 dsl

ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.


Revision tags: nick-hppapmap-base2 mjf-devfs2-base
# 1.57 11-Jan-2009 cegger

branches: 1.57.2;
make this compile


# 1.56 11-Jan-2009 christos

merge christos-time_t


Revision tags: haad-dm-base2 haad-nbase2 ad-audiomp2-base christos-time_t-nbase christos-time_t-base haad-dm-base
# 1.55 28-Nov-2008 pooka

Tyop: v -> vp. Spotted by Tom's ARM builds.


# 1.54 26-Nov-2008 pooka

Rototill all remaining file systems to use ubc_uiomove() instead
of the ubc_alloc() - uiomove() - ubc_release() dance.


# 1.53 14-Nov-2008 pooka

In case writing past EOF, fail if extending the file fails (most
likely due to the file system being full).

Otherwise we'd fail in VOP_PUTPAGES(), which might not happen during
VOP_WRITE(), thus giving the caller the wrong impression that
writing was succesful.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE 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 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 wrstuden-revivesa-base
# 1.52 16-May-2008 hannken

branches: 1.52.4; 1.52.6; 1.52.10;
Make sure all cached buffers with valid, not yet written data have been
run through copy-on-write. Call fscow_run() with valid data where possible.

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

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

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

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

Welcome to 4.99.63

Reviewed by: YAMAMOTO Takashi <yamt@netbsd.org>


Revision tags: yamt-nfs-mp-base2
# 1.51 30-Apr-2008 ad

branches: 1.51.2;
Make various bits of debug code compile again.


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

branches: 1.50.2;
Network protocol interrupts can now block on locks, so merge the globals
proclist_mutex and proclist_lock into a single adaptive mutex (proc_lock).
Implications:

- Inspecting process state requires thread context, so signals can no longer
be sent from a hardware interrupt handler. Signal activity must be
deferred to a soft interrupt or kthread.

- As the proc state locking is simplified, it's now safe to take exit()
and wait() out from under kernel_lock.

- The system spends less time at IPL_SCHED, and there is less lock activity.


Revision tags: yamt-pf42-baseX yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase nick-net80211-sync-base keiichi-mipv6-base matt-armv6-nbase mjf-devfs-base hpcarm-cleanup-base
# 1.49 30-Jan-2008 ad

branches: 1.49.6; 1.49.8;
Replace struct lock on vnodes with a simpler lock object built on
krwlock_t. This is a step towards removing lockmgr and simplifying
vnode locking. Discussed on tech-kern.


# 1.48 25-Jan-2008 ad

Remove VOP_LEASE. Discussed on tech-kern.


Revision tags: bouyer-xeni386-nbase bouyer-xeni386-base matt-armv6-base
# 1.47 05-Jan-2008 christos

PR/37696: Paul Ripke: add large read / readahead support (Introduce run-length
detection to msdosfs_bmap(), from FreeBSD)


# 1.46 02-Jan-2008 ad

Merge vmlocking2 to head.


# 1.45 28-Dec-2007 reinoud

Use uvm_vnp_setwritesize() on file extending to instruct UVM to NOT read-in
the newly added space first. This significantly speeds up write speed for
msdosfs and making it at par with ffs wich already had this patched.

Speed increase measured on my IDE disc from 2Mb/sec to 32 Mb/sec


Revision tags: vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 vmlocking-nbase jmcneill-pm-base reinoud-bufcleanup-base
# 1.44 26-Nov-2007 pooka

branches: 1.44.2; 1.44.6;
Remove the "struct lwp *" argument from all VFS and VOP interfaces.
The general trend is to remove it from all kernel interfaces and
this is a start. In case the calling lwp is desired, curlwp should
be used.

quick consensus on tech-kern


Revision tags: bouyer-xenamd64-base2 bouyer-xenamd64-base
# 1.43 14-Nov-2007 pooka

Fix a problem noticed by Reinoud: the fs would try to release an
unlocked vnode when trying to rename a directory. The fix was to
shuffle some bits around and #pray.

The rename routine actually needs a very very major wide-angle whopping:
* it takes locks out-of-order
* it deals with references from SAVESTART lookups in interesting ways
* I doubt there is any guarantee for correct operation if there
are multiple concurrent accesses
* the error branches might just as well call panic() directly


Revision tags: jmcneill-base yamt-x86pmap-base4 yamt-x86pmap-base3 vmlocking-base
# 1.42 08-Oct-2007 ad

branches: 1.42.2; 1.42.4;
Merge brelse() changes from the vmlocking branch.


Revision tags: yamt-x86pmap-base2
# 1.41 24-Sep-2007 rumble

Avoid stack allocation of large dirent structures in foo_readdir().


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base matt-mips64-base
# 1.40 29-Jul-2007 rumble

branches: 1.40.4; 1.40.6; 1.40.8; 1.40.10;
Use _DIRENT_MINSIZE when determining the number of NFS cookies to allocate,
rather than hard-coding 16.


Revision tags: nick-csl-alignment-base yamt-idlelwp-base8 mjf-ufs-trans-base
# 1.39 19-Apr-2007 yamt

branches: 1.39.2;
hold proclist_mutex when calling psignal().


Revision tags: thorpej-atomic-base
# 1.38 04-Mar-2007 christos

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


Revision tags: ad-audiomp-base
# 1.37 21-Feb-2007 thorpej

Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.


Revision tags: post-newlock2-merge newlock2-nbase newlock2-base
# 1.36 04-Jan-2007 elad

branches: 1.36.2;
Consistent usage of KAUTH_GENERIC_ISSUSER.


Revision tags: yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3
# 1.35 09-Dec-2006 chs

a smorgasbord of improvements to vnode locking and path lookup:
- LOCKPARENT is no longer relevant for lookup(), relookup() or VOP_LOOKUP().
these now always return the parent vnode locked. namei() works as before.
lookup() and various other paths no longer acquire vnode locks in the
wrong order via vrele(). fixes PR 32535.
as a nice side effect, path lookup is also up to 25% faster.
- the above allows us to get rid of PDIRUNLOCK.
- also get rid of WANTPARENT (just use LOCKPARENT and unlock it).
- remove an assumption in layer_node_find() that all file systems implement
a recursive VOP_LOCK() (unionfs doesn't).
- require that all file systems supply vfs_vptofh and vfs_fhtovp routines.
fill in eopnotsupp() for file systems that don't support being exported
and remove the checks for NULL. (layerfs calls these without checking.)
- in union_lookup1(), don't change refcounts in the ISDOTDOT case, just
adjust which vnode is locked. fixes PR 33374.
- apply fixes for ufs_rename() from ufs_vnops.c rev. 1.61 to ext2fs_rename().


Revision tags: netbsd-4-base
# 1.34 25-Nov-2006 scw

branches: 1.34.2;
Support FAT filesystems on non-DEV_BSIZE media.

Based on the patches provided in PR kern/17398 by Trevin Beattie.


# 1.33 16-Nov-2006 christos

__unused removal on arguments; approved by core.


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

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


# 1.31 22-Sep-2006 xtraeme

Apply patch from PR kern/34583 sent by Rhialto, quoting him:

"Add a 3rd entry in the cache, which keeps the end position
from just before extending a file.
This has the desired effect of keeping the write speed constant."

And yes, that helps a lot copying large files... always at full speed
now. This closes my PR kern/30868 "Poor performance copying large files
on msdosfs".

Also remove a 2 if-statements testing the same condition, combine them.

All that from Rhialto, thank you very much.


Revision tags: abandoned-netbsd-4-base yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 rpaulo-netinet-merge-pcb-base
# 1.30 23-Jul-2006 ad

branches: 1.30.2; 1.30.4; 1.30.6;
Use the LWP cached credentials where sane.


Revision tags: yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base chap-midi-base
# 1.29 07-Jun-2006 kardel

merge FreeBSD timecounters from branch simonb-timecounters
- struct timeval time is gone
time.tv_sec -> time_second
- struct timeval mono_time is gone
mono_time.tv_sec -> time_uptime
- access to time via
{get,}{micro,nano,bin}time()
get* versions are fast but less precise
- support NTP nanokernel implementation (NTP API 4)
- further reading:
Timecounter Paper: http://phk.freebsd.dk/pubs/timecounter.pdf
NTP Nanokernel: http://www.eecis.udel.edu/~mills/ntp/html/kern.html


Revision tags: yamt-pdpolicy-base5 simonb-timecounters-base
# 1.28 14-May-2006 elad

branches: 1.28.2;
integrate kauth.


Revision tags: elad-kernelauth-base
# 1.27 14-Apr-2006 christos

Coveriry CID 733: Remove dead code.


Revision tags: yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 yamt-pdpolicy-base
# 1.26 01-Mar-2006 yamt

branches: 1.26.2; 1.26.4; 1.26.6;
merge yamt-uio_vmspace branch.

- use vmspace rather than proc or lwp where appropriate.
the latter is more natural to specify an address space.
(and less likely to be abused for random purposes.)
- fix a swdmover race.


Revision tags: yamt-uio_vmspace-base5
# 1.25 14-Jan-2006 christos

branches: 1.25.2; 1.25.4;
Protect against uio_lwp being NULL from Pavel Cahyna


# 1.24 11-Dec-2005 christos

branches: 1.24.2;
merge ktrace-lwp.


Revision tags: ktrace-lwp-base
# 1.23 29-Nov-2005 yamt

merge yamt-readahead branch.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-base
# 1.22 04-Nov-2005 christos

branches: 1.22.2;
PR/32003: Brian Buhrow: msdosfs doesn't properly zero out high cluster data
on non-FAT32 msdos filesystems.


# 1.21 02-Nov-2005 yamt

merge yamt-vop branch. remove following VOPs.

VOP_BLKATOFF
VOP_VALLOC
VOP_BALLOC
VOP_REALLOCBLKS
VOP_VFREE
VOP_TRUNCATE
VOP_UPDATE


Revision tags: yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base
# 1.20 12-Sep-2005 christos

branches: 1.20.2;
Use nanotime() to update the time fields in filesystems. Convert the code
from macros to real functions. Original patch and review from chuq.
Note: ext2fs only keeps seconds in the on-disk inode, and msdosfs does not
have enough precision for all fields, so this is not very useful for those
two.


# 1.19 10-Sep-2005 christos

Make fileno calculations use ino_t variables.


# 1.18 29-Aug-2005 xtraeme

Remove __P()


# 1.17 29-Aug-2005 xtraeme

The maximum file size on MS-DOS filesystems is 4 GB - 1 byte, so
don't bother trying to write files bigger than this. Just return
EFBIG to caller, rather than panic()ing later.

From OpenBSD.

This closes my PR kern/30864: "panic when copying files of >4GB on msdosfs"


# 1.16 19-Aug-2005 christos

fileid is now a quad.


# 1.15 19-Aug-2005 christos

64 bit inode changes.


Revision tags: yamt-km-base4 yamt-km-base3 netbsd-3-base kent-audio2-base
# 1.14 26-Feb-2005 perry

branches: 1.14.2; 1.14.4;
nuke trailing whitespace


Revision tags: yamt-km-base2 yamt-km-base kent-audio1-beforemerge
# 1.13 09-Jan-2005 chs

branches: 1.13.2; 1.13.4;
adjust the UBC mapping code to support non-vnode uvm_objects.
this means we can no longer look at the vnode size to determine how many
pages to request in a fault, which is good since for NFS the size can change
out from under us on the server anyway. there's also a new flag UBC_UNMAP
for ubc_release(), so that the file system code can make the decision about
whether to cache mappings for files being used as executables.


Revision tags: kent-audio1-base
# 1.12 13-Sep-2004 jdolecek

set mp->mnt_stat.f_namemax on filesystem mount for use by statvfs, and use
the value for also pathconf(_PC_NAME_MAX) to keep the two in sync


# 1.11 12-May-2004 jrf

caddr_t -> void * and removal of some more casts.


# 1.10 04-May-2004 jrf

Remove caddr_t inlines. Approved by christos@NetBSD.org.


Revision tags: netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.9 26-Jan-2004 hannken

branches: 1.9.2; 1.9.4;
Fix xxx_strategy() to use the vnode arg instead of bp->b_vp.


# 1.8 25-Jan-2004 hannken

Make VOP_STRATEGY(bp) a real VOP as discussed on tech-kern.

VOP_STRATEGY(bp) is replaced by one of two new functions:

- VOP_STRATEGY(vp, bp) Call the strategy routine of vp for bp.
- DEV_STRATEGY(bp) Call the d_strategy routine of bp->b_dev for bp.

DEV_STRATEGY(bp) is used only for block-to-block device situations.


# 1.7 07-Sep-2003 itojun

add -t option for gmt time offset (normally MS-DOS filesystem has timestamp
in localtime, not GMT). PR kern/22717


# 1.6 02-Aug-2003 jdolecek

Allow separate masks for files and directories. Useful e.g. to turn
the execute bit off for files, but keep search permission for directories.
Change contributed in PR kern/21538 by Pavel Arnost, based on some FreeBSD
patches.
Further manpage changes, and backward-compatibility adjustments done by me.

Also fixes PR kern/16778 by Johan Danielsson, and PR kern/3400 by Rick Byers


# 1.5 29-Jun-2003 fvdl

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


# 1.4 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.3 26-Jun-2003 itojun

strlcpy


# 1.2 25-Feb-2003 jdolecek

make 'dosdirtemplate' static const


Revision tags: nathanw_sa_before_merge fvdl_fs64_base nathanw_sa_base
# 1.1 26-Dec-2002 jdolecek

branches: 1.1.2;
move msdosfs code from sys/msdosfs to sys/fs/msdosfs


Revision tags: prg-localcount2-base
# 1.98 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


Revision tags: pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320
# 1.97 01-Mar-2017 hannken

Remove now redundant calls to fstrans_start()/fstrans_done().


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
# 1.96 01-Feb-2016 christos

branches: 1.96.2; 1.96.4;
- split a long line.
- remove extra test.
- move d_namlen setting to msdosfs_vnops.c to avoid the ifdef.


# 1.95 01-Feb-2016 christos

We can't depend on dp->d_namlen existing for the parts that are used in
makefs(8).


# 1.94 30-Jan-2016 mlelstv

Add support to msdosfs and makefs to generate correct Unicode (UCS-2) directory
entries from UTF8 encoded file names.


Revision tags: nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606 nick-nhusb-base-20150406
# 1.93 04-Apr-2015 riastradh

Fix remaining read(fd, NULL, 1) cases.


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


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 tls-earlyentropy-base tls-maxphys-base
# 1.91 25-Jul-2014 dholland

branches: 1.91.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.90 08-Jul-2014 hannken

Change msdosfs from hashlist to vcache:
- Use (dir_cluster, dir_offset, dir_generation) as key, where
dir_generation is non-zero and unique for unlinked but open nodes.
- Change deget() to return a vnode as it is unsafe to return a
referenced but unlocked denode.


Revision tags: yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 rmind-smpnet-nbase rmind-smpnet-base
# 1.89 23-Jan-2014 hannken

branches: 1.89.2;
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.88 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.87 02-Nov-2013 hannken

Stop using v_mount of an unreferenced vnode -- save the mount while
the vnode has a reference.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base
# 1.86 18-Mar-2013 plunky

branches: 1.86.6;
C99 section 6.7.2.3 (Tags) Note 3 states that:

A type specifier of the form

enum identifier

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

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

(ok elad@)


Revision tags: yamt-pagecache-base8
# 1.85 28-Dec-2012 hannken

Move the initialization of n to after the error branch.

From Taylor R Campbell <riastradh@netbsd.org>


# 1.84 20-Dec-2012 hannken

Change bread() and breadn() to never return a buffer on
error and modify all callers to not brelse() on error.

Welcome to 6.99.16

PR kern/46282 (6.0_BETA crash: msdosfs_bmap -> pcbmap -> bread -> bio_doread)


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6 jmcneill-usbmp-base10 yamt-pagecache-base5
# 1.83 29-Apr-2012 chs

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


Revision tags: jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8
# 1.82 03-Apr-2012 njoly

Add missing braces in previous commit.


# 1.81 02-Apr-2012 njoly

Report the SF_ARCHIVED file flag if set.


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


Revision tags: 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
# 1.79 21-Nov-2011 hannken

branches: 1.79.2; 1.79.4;
Add missing fstrans_done().

Should fix PR #45635 (KASSERT "fli->fli_trans_cnt == 0" failed)


Revision tags: jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.78 20-Jul-2011 hannken

branches: 1.78.2;
Even though msdosfs never truncates file names it advertises _PC_NO_TRUNC
as zero. Make it advertise one (no_trunc == true).

Names longer than NAME_MAX (255) will never pass namei() btw.

Fixes PR #43670 (msdosfs claims support for filenames longer than {NAME_MAX},
but fails)


# 1.77 16-Jun-2011 hannken

Rename uvm_vnp_zerorange(struct vnode *, off_t, size_t) to
ubc_zerorange(struct uvm_object *, off_t, size_t, int) changing
the first argument to an uvm_object and adding a flags argument.

Modify tmpfs_reg_resize() to zero the backing store (aobj) instead
of the vnode. Ubc_purge() no longer panics when unmounting tmpfs.

Keep uvm_vnp_zerorange() until the next kernel version bump.


# 1.76 12-Jun-2011 rmind

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 rmind-uvmplock-base
# 1.75 26-Apr-2011 hannken

branches: 1.75.2;
Change vflushbuf() to return an error if a synchronous write fails.

Welcome to 5.99.51.


# 1.74 20-Mar-2011 hannken

When extending a file, either by truncating or by writing past EOF make
sure the unallocated remainder of the last page gets zeroed.

Detected by fsx.


# 1.73 19-Mar-2011 hannken

Remove a vnode reference leak from msdosfs_rename. Release tdvp if either
doscheckpath() or relookup() fails.

Adjust test fs/vfs/t_vnops.c and remove the link count test for msdos.

Fixes PR #44661


Revision tags: bouyer-quota2-nbase
# 1.72 03-Mar-2011 pooka

In rename, use char[12]�for new names instead of [11]. At least
one routine called from here (unix2dosfn) expects and uses all of
a [12].

This may fix the "stack size exceeded" problem which has been
triggering in gson's test runs. (i'm not entirely sure why it
doesn't trigger in anyone else's env)


Revision tags: bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231
# 1.71 02-Jan-2011 dholland

branches: 1.71.2; 1.71.4;
Remove the special refcount behavior (adding an extra reference to the
parent dir) associated with SAVESTART in relookup().

Check all call sites to make sure that SAVESTART wasn't set while
calling relookup(); if it was, adjust the refcount behavior. Remove
related references to SAVESTART.

The only code that was reaching the extra ref was msdosfs_rename,
where the refcount behavior was already fairly broken and/or gross;
repair it.

Add a dummy 4th argument to relookup to make sure code that hasn't
been inspected won't compile. (This will go away next time the
relookup semantics change, which they will.)


# 1.70 30-Nov-2010 dholland

Abolish the SAVENAME and HASBUF flags. There is now always a buffer,
so the path in a struct componentname is now always valid during VOP
calls.


# 1.69 30-Nov-2010 dholland

Abolish struct componentname's cn_pnbuf. Use the path buffer in the
pathbuf object passed to namei as work space instead. (For now a pnbuf
pointer appears in struct nameidata, to support certain unclean things
that haven't been fixed yet, but it will be going away in the future.)

This removes the need for the SAVENAME and HASBUF namei flags.


Revision tags: uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.68 22-Jul-2010 njoly

Remove bad cast, fix compilation with MSDOSFS_DEBUG.


# 1.67 24-Jun-2010 hannken

Clean up vnode lock operations pass 2:

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

Welcome to 5.99.32.

Discussed on tech-kern.


# 1.66 25-May-2010 pooka

Don't double unlock fvp if source file disappears during rename.
Problem found by njoly's awesome stresstester.


Revision tags: uebayasi-xip-base1
# 1.65 23-Apr-2010 pooka

Enforce RLIMIT_FSIZE before VOP_WRITE. This adds support to file
system drivers where it was missing from and fixes one buggy
implementation. The arguably weird semantics of the check are
maintained (v_size vs. va_bytes, overwrite).


# 1.64 09-Apr-2010 hannken

Add file system suspension support (vfs_suspend(9)) to msdosfs.

Reviewed by: Antti Kantee <pooka@netbsd.org>


# 1.63 08-Apr-2010 pooka

In genfs where available.

The only functional change is mknod now returning EOPNOTSUPP instead
of EINVAL. I make this sacrifice willingly and with a clean conscience.


# 1.62 08-Apr-2010 pooka

Use genfs instead of homegrown stuff where possible.


Revision tags: yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211 yamt-nfs-mp-base8 yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 jym-xensuspend-nbase
# 1.61 03-Jul-2009 elad

branches: 1.61.2; 1.61.4;
Where possible, extract the file-system's access() routine to two internal
functions: the first checking if the operation is possible (regardless of
permissions), the second checking file-system permissions, ACLs, etc.

Mailing list reference:

http://mail-index.netbsd.org/tech-kern/2009/06/21/msg005311.html


# 1.60 23-Jun-2009 elad

Move the implementation of vaccess() to genfs_can_access(), in line with
the other routines of the same spirit.

Adjust file-system code to use it.

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

No objections on tech-kern@:

http://mail-index.netbsd.org/tech-kern/2009/06/21/msg005310.html


Revision tags: yamt-nfs-mp-base5 yamt-nfs-mp-base4 jym-xensuspend-base
# 1.59 07-May-2009 elad

Extract the open-coded authorization logic for chtimes() from various
file-systems and put it in a single function, genfs_can_chtimes().

This also makes UDF follow the same policy as all other file-systems.

Mailing list reference:

http://mail-index.netbsd.org/tech-kern/2009/04/27/msg004951.html


Revision tags: yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.58 14-Mar-2009 dsl

ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.


Revision tags: nick-hppapmap-base2 mjf-devfs2-base
# 1.57 11-Jan-2009 cegger

branches: 1.57.2;
make this compile


# 1.56 11-Jan-2009 christos

merge christos-time_t


Revision tags: haad-dm-base2 haad-nbase2 ad-audiomp2-base christos-time_t-nbase christos-time_t-base haad-dm-base
# 1.55 28-Nov-2008 pooka

Tyop: v -> vp. Spotted by Tom's ARM builds.


# 1.54 26-Nov-2008 pooka

Rototill all remaining file systems to use ubc_uiomove() instead
of the ubc_alloc() - uiomove() - ubc_release() dance.


# 1.53 14-Nov-2008 pooka

In case writing past EOF, fail if extending the file fails (most
likely due to the file system being full).

Otherwise we'd fail in VOP_PUTPAGES(), which might not happen during
VOP_WRITE(), thus giving the caller the wrong impression that
writing was succesful.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE 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 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 wrstuden-revivesa-base
# 1.52 16-May-2008 hannken

branches: 1.52.4; 1.52.6; 1.52.10;
Make sure all cached buffers with valid, not yet written data have been
run through copy-on-write. Call fscow_run() with valid data where possible.

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

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

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

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

Welcome to 4.99.63

Reviewed by: YAMAMOTO Takashi <yamt@netbsd.org>


Revision tags: yamt-nfs-mp-base2
# 1.51 30-Apr-2008 ad

branches: 1.51.2;
Make various bits of debug code compile again.


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

branches: 1.50.2;
Network protocol interrupts can now block on locks, so merge the globals
proclist_mutex and proclist_lock into a single adaptive mutex (proc_lock).
Implications:

- Inspecting process state requires thread context, so signals can no longer
be sent from a hardware interrupt handler. Signal activity must be
deferred to a soft interrupt or kthread.

- As the proc state locking is simplified, it's now safe to take exit()
and wait() out from under kernel_lock.

- The system spends less time at IPL_SCHED, and there is less lock activity.


Revision tags: yamt-pf42-baseX yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase nick-net80211-sync-base keiichi-mipv6-base matt-armv6-nbase mjf-devfs-base hpcarm-cleanup-base
# 1.49 30-Jan-2008 ad

branches: 1.49.6; 1.49.8;
Replace struct lock on vnodes with a simpler lock object built on
krwlock_t. This is a step towards removing lockmgr and simplifying
vnode locking. Discussed on tech-kern.


# 1.48 25-Jan-2008 ad

Remove VOP_LEASE. Discussed on tech-kern.


Revision tags: bouyer-xeni386-nbase bouyer-xeni386-base matt-armv6-base
# 1.47 05-Jan-2008 christos

PR/37696: Paul Ripke: add large read / readahead support (Introduce run-length
detection to msdosfs_bmap(), from FreeBSD)


# 1.46 02-Jan-2008 ad

Merge vmlocking2 to head.


# 1.45 28-Dec-2007 reinoud

Use uvm_vnp_setwritesize() on file extending to instruct UVM to NOT read-in
the newly added space first. This significantly speeds up write speed for
msdosfs and making it at par with ffs wich already had this patched.

Speed increase measured on my IDE disc from 2Mb/sec to 32 Mb/sec


Revision tags: vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 vmlocking-nbase jmcneill-pm-base reinoud-bufcleanup-base
# 1.44 26-Nov-2007 pooka

branches: 1.44.2; 1.44.6;
Remove the "struct lwp *" argument from all VFS and VOP interfaces.
The general trend is to remove it from all kernel interfaces and
this is a start. In case the calling lwp is desired, curlwp should
be used.

quick consensus on tech-kern


Revision tags: bouyer-xenamd64-base2 bouyer-xenamd64-base
# 1.43 14-Nov-2007 pooka

Fix a problem noticed by Reinoud: the fs would try to release an
unlocked vnode when trying to rename a directory. The fix was to
shuffle some bits around and #pray.

The rename routine actually needs a very very major wide-angle whopping:
* it takes locks out-of-order
* it deals with references from SAVESTART lookups in interesting ways
* I doubt there is any guarantee for correct operation if there
are multiple concurrent accesses
* the error branches might just as well call panic() directly


Revision tags: jmcneill-base yamt-x86pmap-base4 yamt-x86pmap-base3 vmlocking-base
# 1.42 08-Oct-2007 ad

branches: 1.42.2; 1.42.4;
Merge brelse() changes from the vmlocking branch.


Revision tags: yamt-x86pmap-base2
# 1.41 24-Sep-2007 rumble

Avoid stack allocation of large dirent structures in foo_readdir().


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base matt-mips64-base
# 1.40 29-Jul-2007 rumble

branches: 1.40.4; 1.40.6; 1.40.8; 1.40.10;
Use _DIRENT_MINSIZE when determining the number of NFS cookies to allocate,
rather than hard-coding 16.


Revision tags: nick-csl-alignment-base yamt-idlelwp-base8 mjf-ufs-trans-base
# 1.39 19-Apr-2007 yamt

branches: 1.39.2;
hold proclist_mutex when calling psignal().


Revision tags: thorpej-atomic-base
# 1.38 04-Mar-2007 christos

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


Revision tags: ad-audiomp-base
# 1.37 21-Feb-2007 thorpej

Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.


Revision tags: post-newlock2-merge newlock2-nbase newlock2-base
# 1.36 04-Jan-2007 elad

branches: 1.36.2;
Consistent usage of KAUTH_GENERIC_ISSUSER.


Revision tags: yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3
# 1.35 09-Dec-2006 chs

a smorgasbord of improvements to vnode locking and path lookup:
- LOCKPARENT is no longer relevant for lookup(), relookup() or VOP_LOOKUP().
these now always return the parent vnode locked. namei() works as before.
lookup() and various other paths no longer acquire vnode locks in the
wrong order via vrele(). fixes PR 32535.
as a nice side effect, path lookup is also up to 25% faster.
- the above allows us to get rid of PDIRUNLOCK.
- also get rid of WANTPARENT (just use LOCKPARENT and unlock it).
- remove an assumption in layer_node_find() that all file systems implement
a recursive VOP_LOCK() (unionfs doesn't).
- require that all file systems supply vfs_vptofh and vfs_fhtovp routines.
fill in eopnotsupp() for file systems that don't support being exported
and remove the checks for NULL. (layerfs calls these without checking.)
- in union_lookup1(), don't change refcounts in the ISDOTDOT case, just
adjust which vnode is locked. fixes PR 33374.
- apply fixes for ufs_rename() from ufs_vnops.c rev. 1.61 to ext2fs_rename().


Revision tags: netbsd-4-base
# 1.34 25-Nov-2006 scw

branches: 1.34.2;
Support FAT filesystems on non-DEV_BSIZE media.

Based on the patches provided in PR kern/17398 by Trevin Beattie.


# 1.33 16-Nov-2006 christos

__unused removal on arguments; approved by core.


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

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


# 1.31 22-Sep-2006 xtraeme

Apply patch from PR kern/34583 sent by Rhialto, quoting him:

"Add a 3rd entry in the cache, which keeps the end position
from just before extending a file.
This has the desired effect of keeping the write speed constant."

And yes, that helps a lot copying large files... always at full speed
now. This closes my PR kern/30868 "Poor performance copying large files
on msdosfs".

Also remove a 2 if-statements testing the same condition, combine them.

All that from Rhialto, thank you very much.


Revision tags: abandoned-netbsd-4-base yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 rpaulo-netinet-merge-pcb-base
# 1.30 23-Jul-2006 ad

branches: 1.30.2; 1.30.4; 1.30.6;
Use the LWP cached credentials where sane.


Revision tags: yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base chap-midi-base
# 1.29 07-Jun-2006 kardel

merge FreeBSD timecounters from branch simonb-timecounters
- struct timeval time is gone
time.tv_sec -> time_second
- struct timeval mono_time is gone
mono_time.tv_sec -> time_uptime
- access to time via
{get,}{micro,nano,bin}time()
get* versions are fast but less precise
- support NTP nanokernel implementation (NTP API 4)
- further reading:
Timecounter Paper: http://phk.freebsd.dk/pubs/timecounter.pdf
NTP Nanokernel: http://www.eecis.udel.edu/~mills/ntp/html/kern.html


Revision tags: yamt-pdpolicy-base5 simonb-timecounters-base
# 1.28 14-May-2006 elad

branches: 1.28.2;
integrate kauth.


Revision tags: elad-kernelauth-base
# 1.27 14-Apr-2006 christos

Coveriry CID 733: Remove dead code.


Revision tags: yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 yamt-pdpolicy-base
# 1.26 01-Mar-2006 yamt

branches: 1.26.2; 1.26.4; 1.26.6;
merge yamt-uio_vmspace branch.

- use vmspace rather than proc or lwp where appropriate.
the latter is more natural to specify an address space.
(and less likely to be abused for random purposes.)
- fix a swdmover race.


Revision tags: yamt-uio_vmspace-base5
# 1.25 14-Jan-2006 christos

branches: 1.25.2; 1.25.4;
Protect against uio_lwp being NULL from Pavel Cahyna


# 1.24 11-Dec-2005 christos

branches: 1.24.2;
merge ktrace-lwp.


Revision tags: ktrace-lwp-base
# 1.23 29-Nov-2005 yamt

merge yamt-readahead branch.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-base
# 1.22 04-Nov-2005 christos

branches: 1.22.2;
PR/32003: Brian Buhrow: msdosfs doesn't properly zero out high cluster data
on non-FAT32 msdos filesystems.


# 1.21 02-Nov-2005 yamt

merge yamt-vop branch. remove following VOPs.

VOP_BLKATOFF
VOP_VALLOC
VOP_BALLOC
VOP_REALLOCBLKS
VOP_VFREE
VOP_TRUNCATE
VOP_UPDATE


Revision tags: yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base
# 1.20 12-Sep-2005 christos

branches: 1.20.2;
Use nanotime() to update the time fields in filesystems. Convert the code
from macros to real functions. Original patch and review from chuq.
Note: ext2fs only keeps seconds in the on-disk inode, and msdosfs does not
have enough precision for all fields, so this is not very useful for those
two.


# 1.19 10-Sep-2005 christos

Make fileno calculations use ino_t variables.


# 1.18 29-Aug-2005 xtraeme

Remove __P()


# 1.17 29-Aug-2005 xtraeme

The maximum file size on MS-DOS filesystems is 4 GB - 1 byte, so
don't bother trying to write files bigger than this. Just return
EFBIG to caller, rather than panic()ing later.

From OpenBSD.

This closes my PR kern/30864: "panic when copying files of >4GB on msdosfs"


# 1.16 19-Aug-2005 christos

fileid is now a quad.


# 1.15 19-Aug-2005 christos

64 bit inode changes.


Revision tags: yamt-km-base4 yamt-km-base3 netbsd-3-base kent-audio2-base
# 1.14 26-Feb-2005 perry

branches: 1.14.2; 1.14.4;
nuke trailing whitespace


Revision tags: yamt-km-base2 yamt-km-base kent-audio1-beforemerge
# 1.13 09-Jan-2005 chs

branches: 1.13.2; 1.13.4;
adjust the UBC mapping code to support non-vnode uvm_objects.
this means we can no longer look at the vnode size to determine how many
pages to request in a fault, which is good since for NFS the size can change
out from under us on the server anyway. there's also a new flag UBC_UNMAP
for ubc_release(), so that the file system code can make the decision about
whether to cache mappings for files being used as executables.


Revision tags: kent-audio1-base
# 1.12 13-Sep-2004 jdolecek

set mp->mnt_stat.f_namemax on filesystem mount for use by statvfs, and use
the value for also pathconf(_PC_NAME_MAX) to keep the two in sync


# 1.11 12-May-2004 jrf

caddr_t -> void * and removal of some more casts.


# 1.10 04-May-2004 jrf

Remove caddr_t inlines. Approved by christos@NetBSD.org.


Revision tags: netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.9 26-Jan-2004 hannken

branches: 1.9.2; 1.9.4;
Fix xxx_strategy() to use the vnode arg instead of bp->b_vp.


# 1.8 25-Jan-2004 hannken

Make VOP_STRATEGY(bp) a real VOP as discussed on tech-kern.

VOP_STRATEGY(bp) is replaced by one of two new functions:

- VOP_STRATEGY(vp, bp) Call the strategy routine of vp for bp.
- DEV_STRATEGY(bp) Call the d_strategy routine of bp->b_dev for bp.

DEV_STRATEGY(bp) is used only for block-to-block device situations.


# 1.7 07-Sep-2003 itojun

add -t option for gmt time offset (normally MS-DOS filesystem has timestamp
in localtime, not GMT). PR kern/22717


# 1.6 02-Aug-2003 jdolecek

Allow separate masks for files and directories. Useful e.g. to turn
the execute bit off for files, but keep search permission for directories.
Change contributed in PR kern/21538 by Pavel Arnost, based on some FreeBSD
patches.
Further manpage changes, and backward-compatibility adjustments done by me.

Also fixes PR kern/16778 by Johan Danielsson, and PR kern/3400 by Rick Byers


# 1.5 29-Jun-2003 fvdl

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


# 1.4 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.3 26-Jun-2003 itojun

strlcpy


# 1.2 25-Feb-2003 jdolecek

make 'dosdirtemplate' static const


Revision tags: nathanw_sa_before_merge fvdl_fs64_base nathanw_sa_base
# 1.1 26-Dec-2002 jdolecek

branches: 1.1.2;
move msdosfs code from sys/msdosfs to sys/fs/msdosfs


# 1.97 01-Mar-2017 hannken

Remove now redundant calls to fstrans_start()/fstrans_done().


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
# 1.96 01-Feb-2016 christos

- split a long line.
- remove extra test.
- move d_namlen setting to msdosfs_vnops.c to avoid the ifdef.


# 1.95 01-Feb-2016 christos

We can't depend on dp->d_namlen existing for the parts that are used in
makefs(8).


# 1.94 30-Jan-2016 mlelstv

Add support to msdosfs and makefs to generate correct Unicode (UCS-2) directory
entries from UTF8 encoded file names.


Revision tags: nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606 nick-nhusb-base-20150406
# 1.93 04-Apr-2015 riastradh

Fix remaining read(fd, NULL, 1) cases.


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


Revision tags: 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 tls-earlyentropy-base tls-maxphys-base
# 1.91 25-Jul-2014 dholland

branches: 1.91.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.90 08-Jul-2014 hannken

Change msdosfs from hashlist to vcache:
- Use (dir_cluster, dir_offset, dir_generation) as key, where
dir_generation is non-zero and unique for unlinked but open nodes.
- Change deget() to return a vnode as it is unsafe to return a
referenced but unlocked denode.


Revision tags: yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 rmind-smpnet-nbase rmind-smpnet-base
# 1.89 23-Jan-2014 hannken

branches: 1.89.2;
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.88 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.87 02-Nov-2013 hannken

Stop using v_mount of an unreferenced vnode -- save the mount while
the vnode has a reference.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base
# 1.86 18-Mar-2013 plunky

branches: 1.86.6;
C99 section 6.7.2.3 (Tags) Note 3 states that:

A type specifier of the form

enum identifier

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

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

(ok elad@)


Revision tags: yamt-pagecache-base8
# 1.85 28-Dec-2012 hannken

Move the initialization of n to after the error branch.

From Taylor R Campbell <riastradh@netbsd.org>


# 1.84 20-Dec-2012 hannken

Change bread() and breadn() to never return a buffer on
error and modify all callers to not brelse() on error.

Welcome to 6.99.16

PR kern/46282 (6.0_BETA crash: msdosfs_bmap -> pcbmap -> bread -> bio_doread)


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6 jmcneill-usbmp-base10 yamt-pagecache-base5
# 1.83 29-Apr-2012 chs

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


Revision tags: jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8
# 1.82 03-Apr-2012 njoly

Add missing braces in previous commit.


# 1.81 02-Apr-2012 njoly

Report the SF_ARCHIVED file flag if set.


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


Revision tags: 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
# 1.79 21-Nov-2011 hannken

branches: 1.79.2; 1.79.4;
Add missing fstrans_done().

Should fix PR #45635 (KASSERT "fli->fli_trans_cnt == 0" failed)


Revision tags: jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.78 20-Jul-2011 hannken

branches: 1.78.2;
Even though msdosfs never truncates file names it advertises _PC_NO_TRUNC
as zero. Make it advertise one (no_trunc == true).

Names longer than NAME_MAX (255) will never pass namei() btw.

Fixes PR #43670 (msdosfs claims support for filenames longer than {NAME_MAX},
but fails)


# 1.77 16-Jun-2011 hannken

Rename uvm_vnp_zerorange(struct vnode *, off_t, size_t) to
ubc_zerorange(struct uvm_object *, off_t, size_t, int) changing
the first argument to an uvm_object and adding a flags argument.

Modify tmpfs_reg_resize() to zero the backing store (aobj) instead
of the vnode. Ubc_purge() no longer panics when unmounting tmpfs.

Keep uvm_vnp_zerorange() until the next kernel version bump.


# 1.76 12-Jun-2011 rmind

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 rmind-uvmplock-base
# 1.75 26-Apr-2011 hannken

branches: 1.75.2;
Change vflushbuf() to return an error if a synchronous write fails.

Welcome to 5.99.51.


# 1.74 20-Mar-2011 hannken

When extending a file, either by truncating or by writing past EOF make
sure the unallocated remainder of the last page gets zeroed.

Detected by fsx.


# 1.73 19-Mar-2011 hannken

Remove a vnode reference leak from msdosfs_rename. Release tdvp if either
doscheckpath() or relookup() fails.

Adjust test fs/vfs/t_vnops.c and remove the link count test for msdos.

Fixes PR #44661


Revision tags: bouyer-quota2-nbase
# 1.72 03-Mar-2011 pooka

In rename, use char[12]�for new names instead of [11]. At least
one routine called from here (unix2dosfn) expects and uses all of
a [12].

This may fix the "stack size exceeded" problem which has been
triggering in gson's test runs. (i'm not entirely sure why it
doesn't trigger in anyone else's env)


Revision tags: bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231
# 1.71 02-Jan-2011 dholland

branches: 1.71.2; 1.71.4;
Remove the special refcount behavior (adding an extra reference to the
parent dir) associated with SAVESTART in relookup().

Check all call sites to make sure that SAVESTART wasn't set while
calling relookup(); if it was, adjust the refcount behavior. Remove
related references to SAVESTART.

The only code that was reaching the extra ref was msdosfs_rename,
where the refcount behavior was already fairly broken and/or gross;
repair it.

Add a dummy 4th argument to relookup to make sure code that hasn't
been inspected won't compile. (This will go away next time the
relookup semantics change, which they will.)


# 1.70 30-Nov-2010 dholland

Abolish the SAVENAME and HASBUF flags. There is now always a buffer,
so the path in a struct componentname is now always valid during VOP
calls.


# 1.69 30-Nov-2010 dholland

Abolish struct componentname's cn_pnbuf. Use the path buffer in the
pathbuf object passed to namei as work space instead. (For now a pnbuf
pointer appears in struct nameidata, to support certain unclean things
that haven't been fixed yet, but it will be going away in the future.)

This removes the need for the SAVENAME and HASBUF namei flags.


Revision tags: uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.68 22-Jul-2010 njoly

Remove bad cast, fix compilation with MSDOSFS_DEBUG.


# 1.67 24-Jun-2010 hannken

Clean up vnode lock operations pass 2:

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

Welcome to 5.99.32.

Discussed on tech-kern.


# 1.66 25-May-2010 pooka

Don't double unlock fvp if source file disappears during rename.
Problem found by njoly's awesome stresstester.


Revision tags: uebayasi-xip-base1
# 1.65 23-Apr-2010 pooka

Enforce RLIMIT_FSIZE before VOP_WRITE. This adds support to file
system drivers where it was missing from and fixes one buggy
implementation. The arguably weird semantics of the check are
maintained (v_size vs. va_bytes, overwrite).


# 1.64 09-Apr-2010 hannken

Add file system suspension support (vfs_suspend(9)) to msdosfs.

Reviewed by: Antti Kantee <pooka@netbsd.org>


# 1.63 08-Apr-2010 pooka

In genfs where available.

The only functional change is mknod now returning EOPNOTSUPP instead
of EINVAL. I make this sacrifice willingly and with a clean conscience.


# 1.62 08-Apr-2010 pooka

Use genfs instead of homegrown stuff where possible.


Revision tags: yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211 yamt-nfs-mp-base8 yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 jym-xensuspend-nbase
# 1.61 03-Jul-2009 elad

branches: 1.61.2; 1.61.4;
Where possible, extract the file-system's access() routine to two internal
functions: the first checking if the operation is possible (regardless of
permissions), the second checking file-system permissions, ACLs, etc.

Mailing list reference:

http://mail-index.netbsd.org/tech-kern/2009/06/21/msg005311.html


# 1.60 23-Jun-2009 elad

Move the implementation of vaccess() to genfs_can_access(), in line with
the other routines of the same spirit.

Adjust file-system code to use it.

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

No objections on tech-kern@:

http://mail-index.netbsd.org/tech-kern/2009/06/21/msg005310.html


Revision tags: yamt-nfs-mp-base5 yamt-nfs-mp-base4 jym-xensuspend-base
# 1.59 07-May-2009 elad

Extract the open-coded authorization logic for chtimes() from various
file-systems and put it in a single function, genfs_can_chtimes().

This also makes UDF follow the same policy as all other file-systems.

Mailing list reference:

http://mail-index.netbsd.org/tech-kern/2009/04/27/msg004951.html


Revision tags: yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.58 14-Mar-2009 dsl

ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.


Revision tags: nick-hppapmap-base2 mjf-devfs2-base
# 1.57 11-Jan-2009 cegger

branches: 1.57.2;
make this compile


# 1.56 11-Jan-2009 christos

merge christos-time_t


Revision tags: haad-dm-base2 haad-nbase2 ad-audiomp2-base christos-time_t-nbase christos-time_t-base haad-dm-base
# 1.55 28-Nov-2008 pooka

Tyop: v -> vp. Spotted by Tom's ARM builds.


# 1.54 26-Nov-2008 pooka

Rototill all remaining file systems to use ubc_uiomove() instead
of the ubc_alloc() - uiomove() - ubc_release() dance.


# 1.53 14-Nov-2008 pooka

In case writing past EOF, fail if extending the file fails (most
likely due to the file system being full).

Otherwise we'd fail in VOP_PUTPAGES(), which might not happen during
VOP_WRITE(), thus giving the caller the wrong impression that
writing was succesful.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE 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 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 wrstuden-revivesa-base
# 1.52 16-May-2008 hannken

branches: 1.52.4; 1.52.6; 1.52.10;
Make sure all cached buffers with valid, not yet written data have been
run through copy-on-write. Call fscow_run() with valid data where possible.

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

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

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

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

Welcome to 4.99.63

Reviewed by: YAMAMOTO Takashi <yamt@netbsd.org>


Revision tags: yamt-nfs-mp-base2
# 1.51 30-Apr-2008 ad

branches: 1.51.2;
Make various bits of debug code compile again.


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

branches: 1.50.2;
Network protocol interrupts can now block on locks, so merge the globals
proclist_mutex and proclist_lock into a single adaptive mutex (proc_lock).
Implications:

- Inspecting process state requires thread context, so signals can no longer
be sent from a hardware interrupt handler. Signal activity must be
deferred to a soft interrupt or kthread.

- As the proc state locking is simplified, it's now safe to take exit()
and wait() out from under kernel_lock.

- The system spends less time at IPL_SCHED, and there is less lock activity.


Revision tags: yamt-pf42-baseX yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase nick-net80211-sync-base keiichi-mipv6-base matt-armv6-nbase mjf-devfs-base hpcarm-cleanup-base
# 1.49 30-Jan-2008 ad

branches: 1.49.6; 1.49.8;
Replace struct lock on vnodes with a simpler lock object built on
krwlock_t. This is a step towards removing lockmgr and simplifying
vnode locking. Discussed on tech-kern.


# 1.48 25-Jan-2008 ad

Remove VOP_LEASE. Discussed on tech-kern.


Revision tags: bouyer-xeni386-nbase bouyer-xeni386-base matt-armv6-base
# 1.47 05-Jan-2008 christos

PR/37696: Paul Ripke: add large read / readahead support (Introduce run-length
detection to msdosfs_bmap(), from FreeBSD)


# 1.46 02-Jan-2008 ad

Merge vmlocking2 to head.


# 1.45 28-Dec-2007 reinoud

Use uvm_vnp_setwritesize() on file extending to instruct UVM to NOT read-in
the newly added space first. This significantly speeds up write speed for
msdosfs and making it at par with ffs wich already had this patched.

Speed increase measured on my IDE disc from 2Mb/sec to 32 Mb/sec


Revision tags: vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 vmlocking-nbase jmcneill-pm-base reinoud-bufcleanup-base
# 1.44 26-Nov-2007 pooka

branches: 1.44.2; 1.44.6;
Remove the "struct lwp *" argument from all VFS and VOP interfaces.
The general trend is to remove it from all kernel interfaces and
this is a start. In case the calling lwp is desired, curlwp should
be used.

quick consensus on tech-kern


Revision tags: bouyer-xenamd64-base2 bouyer-xenamd64-base
# 1.43 14-Nov-2007 pooka

Fix a problem noticed by Reinoud: the fs would try to release an
unlocked vnode when trying to rename a directory. The fix was to
shuffle some bits around and #pray.

The rename routine actually needs a very very major wide-angle whopping:
* it takes locks out-of-order
* it deals with references from SAVESTART lookups in interesting ways
* I doubt there is any guarantee for correct operation if there
are multiple concurrent accesses
* the error branches might just as well call panic() directly


Revision tags: jmcneill-base yamt-x86pmap-base4 yamt-x86pmap-base3 vmlocking-base
# 1.42 08-Oct-2007 ad

branches: 1.42.2; 1.42.4;
Merge brelse() changes from the vmlocking branch.


Revision tags: yamt-x86pmap-base2
# 1.41 24-Sep-2007 rumble

Avoid stack allocation of large dirent structures in foo_readdir().


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base matt-mips64-base
# 1.40 29-Jul-2007 rumble

branches: 1.40.4; 1.40.6; 1.40.8; 1.40.10;
Use _DIRENT_MINSIZE when determining the number of NFS cookies to allocate,
rather than hard-coding 16.


Revision tags: nick-csl-alignment-base yamt-idlelwp-base8 mjf-ufs-trans-base
# 1.39 19-Apr-2007 yamt

branches: 1.39.2;
hold proclist_mutex when calling psignal().


Revision tags: thorpej-atomic-base
# 1.38 04-Mar-2007 christos

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


Revision tags: ad-audiomp-base
# 1.37 21-Feb-2007 thorpej

Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.


Revision tags: post-newlock2-merge newlock2-nbase newlock2-base
# 1.36 04-Jan-2007 elad

branches: 1.36.2;
Consistent usage of KAUTH_GENERIC_ISSUSER.


Revision tags: yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3
# 1.35 09-Dec-2006 chs

a smorgasbord of improvements to vnode locking and path lookup:
- LOCKPARENT is no longer relevant for lookup(), relookup() or VOP_LOOKUP().
these now always return the parent vnode locked. namei() works as before.
lookup() and various other paths no longer acquire vnode locks in the
wrong order via vrele(). fixes PR 32535.
as a nice side effect, path lookup is also up to 25% faster.
- the above allows us to get rid of PDIRUNLOCK.
- also get rid of WANTPARENT (just use LOCKPARENT and unlock it).
- remove an assumption in layer_node_find() that all file systems implement
a recursive VOP_LOCK() (unionfs doesn't).
- require that all file systems supply vfs_vptofh and vfs_fhtovp routines.
fill in eopnotsupp() for file systems that don't support being exported
and remove the checks for NULL. (layerfs calls these without checking.)
- in union_lookup1(), don't change refcounts in the ISDOTDOT case, just
adjust which vnode is locked. fixes PR 33374.
- apply fixes for ufs_rename() from ufs_vnops.c rev. 1.61 to ext2fs_rename().


Revision tags: netbsd-4-base
# 1.34 25-Nov-2006 scw

branches: 1.34.2;
Support FAT filesystems on non-DEV_BSIZE media.

Based on the patches provided in PR kern/17398 by Trevin Beattie.


# 1.33 16-Nov-2006 christos

__unused removal on arguments; approved by core.


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

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


# 1.31 22-Sep-2006 xtraeme

Apply patch from PR kern/34583 sent by Rhialto, quoting him:

"Add a 3rd entry in the cache, which keeps the end position
from just before extending a file.
This has the desired effect of keeping the write speed constant."

And yes, that helps a lot copying large files... always at full speed
now. This closes my PR kern/30868 "Poor performance copying large files
on msdosfs".

Also remove a 2 if-statements testing the same condition, combine them.

All that from Rhialto, thank you very much.


Revision tags: abandoned-netbsd-4-base yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 rpaulo-netinet-merge-pcb-base
# 1.30 23-Jul-2006 ad

branches: 1.30.2; 1.30.4; 1.30.6;
Use the LWP cached credentials where sane.


Revision tags: yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base chap-midi-base
# 1.29 07-Jun-2006 kardel

merge FreeBSD timecounters from branch simonb-timecounters
- struct timeval time is gone
time.tv_sec -> time_second
- struct timeval mono_time is gone
mono_time.tv_sec -> time_uptime
- access to time via
{get,}{micro,nano,bin}time()
get* versions are fast but less precise
- support NTP nanokernel implementation (NTP API 4)
- further reading:
Timecounter Paper: http://phk.freebsd.dk/pubs/timecounter.pdf
NTP Nanokernel: http://www.eecis.udel.edu/~mills/ntp/html/kern.html


Revision tags: yamt-pdpolicy-base5 simonb-timecounters-base
# 1.28 14-May-2006 elad

branches: 1.28.2;
integrate kauth.


Revision tags: elad-kernelauth-base
# 1.27 14-Apr-2006 christos

Coveriry CID 733: Remove dead code.


Revision tags: yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 yamt-pdpolicy-base
# 1.26 01-Mar-2006 yamt

branches: 1.26.2; 1.26.4; 1.26.6;
merge yamt-uio_vmspace branch.

- use vmspace rather than proc or lwp where appropriate.
the latter is more natural to specify an address space.
(and less likely to be abused for random purposes.)
- fix a swdmover race.


Revision tags: yamt-uio_vmspace-base5
# 1.25 14-Jan-2006 christos

branches: 1.25.2; 1.25.4;
Protect against uio_lwp being NULL from Pavel Cahyna


# 1.24 11-Dec-2005 christos

branches: 1.24.2;
merge ktrace-lwp.


Revision tags: ktrace-lwp-base
# 1.23 29-Nov-2005 yamt

merge yamt-readahead branch.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-base
# 1.22 04-Nov-2005 christos

branches: 1.22.2;
PR/32003: Brian Buhrow: msdosfs doesn't properly zero out high cluster data
on non-FAT32 msdos filesystems.


# 1.21 02-Nov-2005 yamt

merge yamt-vop branch. remove following VOPs.

VOP_BLKATOFF
VOP_VALLOC
VOP_BALLOC
VOP_REALLOCBLKS
VOP_VFREE
VOP_TRUNCATE
VOP_UPDATE


Revision tags: yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base
# 1.20 12-Sep-2005 christos

branches: 1.20.2;
Use nanotime() to update the time fields in filesystems. Convert the code
from macros to real functions. Original patch and review from chuq.
Note: ext2fs only keeps seconds in the on-disk inode, and msdosfs does not
have enough precision for all fields, so this is not very useful for those
two.


# 1.19 10-Sep-2005 christos

Make fileno calculations use ino_t variables.


# 1.18 29-Aug-2005 xtraeme

Remove __P()


# 1.17 29-Aug-2005 xtraeme

The maximum file size on MS-DOS filesystems is 4 GB - 1 byte, so
don't bother trying to write files bigger than this. Just return
EFBIG to caller, rather than panic()ing later.

From OpenBSD.

This closes my PR kern/30864: "panic when copying files of >4GB on msdosfs"


# 1.16 19-Aug-2005 christos

fileid is now a quad.


# 1.15 19-Aug-2005 christos

64 bit inode changes.


Revision tags: yamt-km-base4 yamt-km-base3 netbsd-3-base kent-audio2-base
# 1.14 26-Feb-2005 perry

branches: 1.14.2; 1.14.4;
nuke trailing whitespace


Revision tags: yamt-km-base2 yamt-km-base kent-audio1-beforemerge
# 1.13 09-Jan-2005 chs

branches: 1.13.2; 1.13.4;
adjust the UBC mapping code to support non-vnode uvm_objects.
this means we can no longer look at the vnode size to determine how many
pages to request in a fault, which is good since for NFS the size can change
out from under us on the server anyway. there's also a new flag UBC_UNMAP
for ubc_release(), so that the file system code can make the decision about
whether to cache mappings for files being used as executables.


Revision tags: kent-audio1-base
# 1.12 13-Sep-2004 jdolecek

set mp->mnt_stat.f_namemax on filesystem mount for use by statvfs, and use
the value for also pathconf(_PC_NAME_MAX) to keep the two in sync


# 1.11 12-May-2004 jrf

caddr_t -> void * and removal of some more casts.


# 1.10 04-May-2004 jrf

Remove caddr_t inlines. Approved by christos@NetBSD.org.


Revision tags: netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.9 26-Jan-2004 hannken

branches: 1.9.2; 1.9.4;
Fix xxx_strategy() to use the vnode arg instead of bp->b_vp.


# 1.8 25-Jan-2004 hannken

Make VOP_STRATEGY(bp) a real VOP as discussed on tech-kern.

VOP_STRATEGY(bp) is replaced by one of two new functions:

- VOP_STRATEGY(vp, bp) Call the strategy routine of vp for bp.
- DEV_STRATEGY(bp) Call the d_strategy routine of bp->b_dev for bp.

DEV_STRATEGY(bp) is used only for block-to-block device situations.


# 1.7 07-Sep-2003 itojun

add -t option for gmt time offset (normally MS-DOS filesystem has timestamp
in localtime, not GMT). PR kern/22717


# 1.6 02-Aug-2003 jdolecek

Allow separate masks for files and directories. Useful e.g. to turn
the execute bit off for files, but keep search permission for directories.
Change contributed in PR kern/21538 by Pavel Arnost, based on some FreeBSD
patches.
Further manpage changes, and backward-compatibility adjustments done by me.

Also fixes PR kern/16778 by Johan Danielsson, and PR kern/3400 by Rick Byers


# 1.5 29-Jun-2003 fvdl

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


# 1.4 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.3 26-Jun-2003 itojun

strlcpy


# 1.2 25-Feb-2003 jdolecek

make 'dosdirtemplate' static const


Revision tags: nathanw_sa_before_merge fvdl_fs64_base nathanw_sa_base
# 1.1 26-Dec-2002 jdolecek

branches: 1.1.2;
move msdosfs code from sys/msdosfs to sys/fs/msdosfs


Revision tags: 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
# 1.96 01-Feb-2016 christos

- split a long line.
- remove extra test.
- move d_namlen setting to msdosfs_vnops.c to avoid the ifdef.


# 1.95 01-Feb-2016 christos

We can't depend on dp->d_namlen existing for the parts that are used in
makefs(8).


# 1.94 30-Jan-2016 mlelstv

Add support to msdosfs and makefs to generate correct Unicode (UCS-2) directory
entries from UTF8 encoded file names.


Revision tags: nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606 nick-nhusb-base-20150406
# 1.93 04-Apr-2015 riastradh

Fix remaining read(fd, NULL, 1) cases.


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


Revision tags: 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 tls-earlyentropy-base tls-maxphys-base
# 1.91 25-Jul-2014 dholland

branches: 1.91.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.90 08-Jul-2014 hannken

Change msdosfs from hashlist to vcache:
- Use (dir_cluster, dir_offset, dir_generation) as key, where
dir_generation is non-zero and unique for unlinked but open nodes.
- Change deget() to return a vnode as it is unsafe to return a
referenced but unlocked denode.


Revision tags: yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 rmind-smpnet-nbase rmind-smpnet-base
# 1.89 23-Jan-2014 hannken

branches: 1.89.2;
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.88 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.87 02-Nov-2013 hannken

Stop using v_mount of an unreferenced vnode -- save the mount while
the vnode has a reference.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base
# 1.86 18-Mar-2013 plunky

branches: 1.86.6;
C99 section 6.7.2.3 (Tags) Note 3 states that:

A type specifier of the form

enum identifier

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

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

(ok elad@)


Revision tags: yamt-pagecache-base8
# 1.85 28-Dec-2012 hannken

Move the initialization of n to after the error branch.

From Taylor R Campbell <riastradh@netbsd.org>


# 1.84 20-Dec-2012 hannken

Change bread() and breadn() to never return a buffer on
error and modify all callers to not brelse() on error.

Welcome to 6.99.16

PR kern/46282 (6.0_BETA crash: msdosfs_bmap -> pcbmap -> bread -> bio_doread)


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6 jmcneill-usbmp-base10 yamt-pagecache-base5
# 1.83 29-Apr-2012 chs

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


Revision tags: jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8
# 1.82 03-Apr-2012 njoly

Add missing braces in previous commit.


# 1.81 02-Apr-2012 njoly

Report the SF_ARCHIVED file flag if set.


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


Revision tags: 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
# 1.79 21-Nov-2011 hannken

branches: 1.79.2; 1.79.4;
Add missing fstrans_done().

Should fix PR #45635 (KASSERT "fli->fli_trans_cnt == 0" failed)


Revision tags: jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.78 20-Jul-2011 hannken

branches: 1.78.2;
Even though msdosfs never truncates file names it advertises _PC_NO_TRUNC
as zero. Make it advertise one (no_trunc == true).

Names longer than NAME_MAX (255) will never pass namei() btw.

Fixes PR #43670 (msdosfs claims support for filenames longer than {NAME_MAX},
but fails)


# 1.77 16-Jun-2011 hannken

Rename uvm_vnp_zerorange(struct vnode *, off_t, size_t) to
ubc_zerorange(struct uvm_object *, off_t, size_t, int) changing
the first argument to an uvm_object and adding a flags argument.

Modify tmpfs_reg_resize() to zero the backing store (aobj) instead
of the vnode. Ubc_purge() no longer panics when unmounting tmpfs.

Keep uvm_vnp_zerorange() until the next kernel version bump.


# 1.76 12-Jun-2011 rmind

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 rmind-uvmplock-base
# 1.75 26-Apr-2011 hannken

branches: 1.75.2;
Change vflushbuf() to return an error if a synchronous write fails.

Welcome to 5.99.51.


# 1.74 20-Mar-2011 hannken

When extending a file, either by truncating or by writing past EOF make
sure the unallocated remainder of the last page gets zeroed.

Detected by fsx.


# 1.73 19-Mar-2011 hannken

Remove a vnode reference leak from msdosfs_rename. Release tdvp if either
doscheckpath() or relookup() fails.

Adjust test fs/vfs/t_vnops.c and remove the link count test for msdos.

Fixes PR #44661


Revision tags: bouyer-quota2-nbase
# 1.72 03-Mar-2011 pooka

In rename, use char[12]�for new names instead of [11]. At least
one routine called from here (unix2dosfn) expects and uses all of
a [12].

This may fix the "stack size exceeded" problem which has been
triggering in gson's test runs. (i'm not entirely sure why it
doesn't trigger in anyone else's env)


Revision tags: bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231
# 1.71 02-Jan-2011 dholland

branches: 1.71.2; 1.71.4;
Remove the special refcount behavior (adding an extra reference to the
parent dir) associated with SAVESTART in relookup().

Check all call sites to make sure that SAVESTART wasn't set while
calling relookup(); if it was, adjust the refcount behavior. Remove
related references to SAVESTART.

The only code that was reaching the extra ref was msdosfs_rename,
where the refcount behavior was already fairly broken and/or gross;
repair it.

Add a dummy 4th argument to relookup to make sure code that hasn't
been inspected won't compile. (This will go away next time the
relookup semantics change, which they will.)


# 1.70 30-Nov-2010 dholland

Abolish the SAVENAME and HASBUF flags. There is now always a buffer,
so the path in a struct componentname is now always valid during VOP
calls.


# 1.69 30-Nov-2010 dholland

Abolish struct componentname's cn_pnbuf. Use the path buffer in the
pathbuf object passed to namei as work space instead. (For now a pnbuf
pointer appears in struct nameidata, to support certain unclean things
that haven't been fixed yet, but it will be going away in the future.)

This removes the need for the SAVENAME and HASBUF namei flags.


Revision tags: uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.68 22-Jul-2010 njoly

Remove bad cast, fix compilation with MSDOSFS_DEBUG.


# 1.67 24-Jun-2010 hannken

Clean up vnode lock operations pass 2:

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

Welcome to 5.99.32.

Discussed on tech-kern.


# 1.66 25-May-2010 pooka

Don't double unlock fvp if source file disappears during rename.
Problem found by njoly's awesome stresstester.


Revision tags: uebayasi-xip-base1
# 1.65 23-Apr-2010 pooka

Enforce RLIMIT_FSIZE before VOP_WRITE. This adds support to file
system drivers where it was missing from and fixes one buggy
implementation. The arguably weird semantics of the check are
maintained (v_size vs. va_bytes, overwrite).


# 1.64 09-Apr-2010 hannken

Add file system suspension support (vfs_suspend(9)) to msdosfs.

Reviewed by: Antti Kantee <pooka@netbsd.org>


# 1.63 08-Apr-2010 pooka

In genfs where available.

The only functional change is mknod now returning EOPNOTSUPP instead
of EINVAL. I make this sacrifice willingly and with a clean conscience.


# 1.62 08-Apr-2010 pooka

Use genfs instead of homegrown stuff where possible.


Revision tags: yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211 yamt-nfs-mp-base8 yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 jym-xensuspend-nbase
# 1.61 03-Jul-2009 elad

branches: 1.61.2; 1.61.4;
Where possible, extract the file-system's access() routine to two internal
functions: the first checking if the operation is possible (regardless of
permissions), the second checking file-system permissions, ACLs, etc.

Mailing list reference:

http://mail-index.netbsd.org/tech-kern/2009/06/21/msg005311.html


# 1.60 23-Jun-2009 elad

Move the implementation of vaccess() to genfs_can_access(), in line with
the other routines of the same spirit.

Adjust file-system code to use it.

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

No objections on tech-kern@:

http://mail-index.netbsd.org/tech-kern/2009/06/21/msg005310.html


Revision tags: yamt-nfs-mp-base5 yamt-nfs-mp-base4 jym-xensuspend-base
# 1.59 07-May-2009 elad

Extract the open-coded authorization logic for chtimes() from various
file-systems and put it in a single function, genfs_can_chtimes().

This also makes UDF follow the same policy as all other file-systems.

Mailing list reference:

http://mail-index.netbsd.org/tech-kern/2009/04/27/msg004951.html


Revision tags: yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.58 14-Mar-2009 dsl

ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.


Revision tags: nick-hppapmap-base2 mjf-devfs2-base
# 1.57 11-Jan-2009 cegger

branches: 1.57.2;
make this compile


# 1.56 11-Jan-2009 christos

merge christos-time_t


Revision tags: haad-dm-base2 haad-nbase2 ad-audiomp2-base christos-time_t-nbase christos-time_t-base haad-dm-base
# 1.55 28-Nov-2008 pooka

Tyop: v -> vp. Spotted by Tom's ARM builds.


# 1.54 26-Nov-2008 pooka

Rototill all remaining file systems to use ubc_uiomove() instead
of the ubc_alloc() - uiomove() - ubc_release() dance.


# 1.53 14-Nov-2008 pooka

In case writing past EOF, fail if extending the file fails (most
likely due to the file system being full).

Otherwise we'd fail in VOP_PUTPAGES(), which might not happen during
VOP_WRITE(), thus giving the caller the wrong impression that
writing was succesful.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE 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 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 wrstuden-revivesa-base
# 1.52 16-May-2008 hannken

branches: 1.52.4; 1.52.6; 1.52.10;
Make sure all cached buffers with valid, not yet written data have been
run through copy-on-write. Call fscow_run() with valid data where possible.

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

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

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

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

Welcome to 4.99.63

Reviewed by: YAMAMOTO Takashi <yamt@netbsd.org>


Revision tags: yamt-nfs-mp-base2
# 1.51 30-Apr-2008 ad

branches: 1.51.2;
Make various bits of debug code compile again.


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

branches: 1.50.2;
Network protocol interrupts can now block on locks, so merge the globals
proclist_mutex and proclist_lock into a single adaptive mutex (proc_lock).
Implications:

- Inspecting process state requires thread context, so signals can no longer
be sent from a hardware interrupt handler. Signal activity must be
deferred to a soft interrupt or kthread.

- As the proc state locking is simplified, it's now safe to take exit()
and wait() out from under kernel_lock.

- The system spends less time at IPL_SCHED, and there is less lock activity.


Revision tags: yamt-pf42-baseX yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase nick-net80211-sync-base keiichi-mipv6-base matt-armv6-nbase mjf-devfs-base hpcarm-cleanup-base
# 1.49 30-Jan-2008 ad

branches: 1.49.6; 1.49.8;
Replace struct lock on vnodes with a simpler lock object built on
krwlock_t. This is a step towards removing lockmgr and simplifying
vnode locking. Discussed on tech-kern.


# 1.48 25-Jan-2008 ad

Remove VOP_LEASE. Discussed on tech-kern.


Revision tags: bouyer-xeni386-nbase bouyer-xeni386-base matt-armv6-base
# 1.47 05-Jan-2008 christos

PR/37696: Paul Ripke: add large read / readahead support (Introduce run-length
detection to msdosfs_bmap(), from FreeBSD)


# 1.46 02-Jan-2008 ad

Merge vmlocking2 to head.


# 1.45 28-Dec-2007 reinoud

Use uvm_vnp_setwritesize() on file extending to instruct UVM to NOT read-in
the newly added space first. This significantly speeds up write speed for
msdosfs and making it at par with ffs wich already had this patched.

Speed increase measured on my IDE disc from 2Mb/sec to 32 Mb/sec


Revision tags: vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 vmlocking-nbase jmcneill-pm-base reinoud-bufcleanup-base
# 1.44 26-Nov-2007 pooka

branches: 1.44.2; 1.44.6;
Remove the "struct lwp *" argument from all VFS and VOP interfaces.
The general trend is to remove it from all kernel interfaces and
this is a start. In case the calling lwp is desired, curlwp should
be used.

quick consensus on tech-kern


Revision tags: bouyer-xenamd64-base2 bouyer-xenamd64-base
# 1.43 14-Nov-2007 pooka

Fix a problem noticed by Reinoud: the fs would try to release an
unlocked vnode when trying to rename a directory. The fix was to
shuffle some bits around and #pray.

The rename routine actually needs a very very major wide-angle whopping:
* it takes locks out-of-order
* it deals with references from SAVESTART lookups in interesting ways
* I doubt there is any guarantee for correct operation if there
are multiple concurrent accesses
* the error branches might just as well call panic() directly


Revision tags: jmcneill-base yamt-x86pmap-base4 yamt-x86pmap-base3 vmlocking-base
# 1.42 08-Oct-2007 ad

branches: 1.42.2; 1.42.4;
Merge brelse() changes from the vmlocking branch.


Revision tags: yamt-x86pmap-base2
# 1.41 24-Sep-2007 rumble

Avoid stack allocation of large dirent structures in foo_readdir().


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base matt-mips64-base
# 1.40 29-Jul-2007 rumble

branches: 1.40.4; 1.40.6; 1.40.8; 1.40.10;
Use _DIRENT_MINSIZE when determining the number of NFS cookies to allocate,
rather than hard-coding 16.


Revision tags: nick-csl-alignment-base yamt-idlelwp-base8 mjf-ufs-trans-base
# 1.39 19-Apr-2007 yamt

branches: 1.39.2;
hold proclist_mutex when calling psignal().


Revision tags: thorpej-atomic-base
# 1.38 04-Mar-2007 christos

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


Revision tags: ad-audiomp-base
# 1.37 21-Feb-2007 thorpej

Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.


Revision tags: post-newlock2-merge newlock2-nbase newlock2-base
# 1.36 04-Jan-2007 elad

branches: 1.36.2;
Consistent usage of KAUTH_GENERIC_ISSUSER.


Revision tags: yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3
# 1.35 09-Dec-2006 chs

a smorgasbord of improvements to vnode locking and path lookup:
- LOCKPARENT is no longer relevant for lookup(), relookup() or VOP_LOOKUP().
these now always return the parent vnode locked. namei() works as before.
lookup() and various other paths no longer acquire vnode locks in the
wrong order via vrele(). fixes PR 32535.
as a nice side effect, path lookup is also up to 25% faster.
- the above allows us to get rid of PDIRUNLOCK.
- also get rid of WANTPARENT (just use LOCKPARENT and unlock it).
- remove an assumption in layer_node_find() that all file systems implement
a recursive VOP_LOCK() (unionfs doesn't).
- require that all file systems supply vfs_vptofh and vfs_fhtovp routines.
fill in eopnotsupp() for file systems that don't support being exported
and remove the checks for NULL. (layerfs calls these without checking.)
- in union_lookup1(), don't change refcounts in the ISDOTDOT case, just
adjust which vnode is locked. fixes PR 33374.
- apply fixes for ufs_rename() from ufs_vnops.c rev. 1.61 to ext2fs_rename().


Revision tags: netbsd-4-base
# 1.34 25-Nov-2006 scw

branches: 1.34.2;
Support FAT filesystems on non-DEV_BSIZE media.

Based on the patches provided in PR kern/17398 by Trevin Beattie.


# 1.33 16-Nov-2006 christos

__unused removal on arguments; approved by core.


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

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


# 1.31 22-Sep-2006 xtraeme

Apply patch from PR kern/34583 sent by Rhialto, quoting him:

"Add a 3rd entry in the cache, which keeps the end position
from just before extending a file.
This has the desired effect of keeping the write speed constant."

And yes, that helps a lot copying large files... always at full speed
now. This closes my PR kern/30868 "Poor performance copying large files
on msdosfs".

Also remove a 2 if-statements testing the same condition, combine them.

All that from Rhialto, thank you very much.


Revision tags: abandoned-netbsd-4-base yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 rpaulo-netinet-merge-pcb-base
# 1.30 23-Jul-2006 ad

branches: 1.30.2; 1.30.4; 1.30.6;
Use the LWP cached credentials where sane.


Revision tags: yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base chap-midi-base
# 1.29 07-Jun-2006 kardel

merge FreeBSD timecounters from branch simonb-timecounters
- struct timeval time is gone
time.tv_sec -> time_second
- struct timeval mono_time is gone
mono_time.tv_sec -> time_uptime
- access to time via
{get,}{micro,nano,bin}time()
get* versions are fast but less precise
- support NTP nanokernel implementation (NTP API 4)
- further reading:
Timecounter Paper: http://phk.freebsd.dk/pubs/timecounter.pdf
NTP Nanokernel: http://www.eecis.udel.edu/~mills/ntp/html/kern.html


Revision tags: yamt-pdpolicy-base5 simonb-timecounters-base
# 1.28 14-May-2006 elad

branches: 1.28.2;
integrate kauth.


Revision tags: elad-kernelauth-base
# 1.27 14-Apr-2006 christos

Coveriry CID 733: Remove dead code.


Revision tags: yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 yamt-pdpolicy-base
# 1.26 01-Mar-2006 yamt

branches: 1.26.2; 1.26.4; 1.26.6;
merge yamt-uio_vmspace branch.

- use vmspace rather than proc or lwp where appropriate.
the latter is more natural to specify an address space.
(and less likely to be abused for random purposes.)
- fix a swdmover race.


Revision tags: yamt-uio_vmspace-base5
# 1.25 14-Jan-2006 christos

branches: 1.25.2; 1.25.4;
Protect against uio_lwp being NULL from Pavel Cahyna


# 1.24 11-Dec-2005 christos

branches: 1.24.2;
merge ktrace-lwp.


Revision tags: ktrace-lwp-base
# 1.23 29-Nov-2005 yamt

merge yamt-readahead branch.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-base
# 1.22 04-Nov-2005 christos

branches: 1.22.2;
PR/32003: Brian Buhrow: msdosfs doesn't properly zero out high cluster data
on non-FAT32 msdos filesystems.


# 1.21 02-Nov-2005 yamt

merge yamt-vop branch. remove following VOPs.

VOP_BLKATOFF
VOP_VALLOC
VOP_BALLOC
VOP_REALLOCBLKS
VOP_VFREE
VOP_TRUNCATE
VOP_UPDATE


Revision tags: yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base
# 1.20 12-Sep-2005 christos

branches: 1.20.2;
Use nanotime() to update the time fields in filesystems. Convert the code
from macros to real functions. Original patch and review from chuq.
Note: ext2fs only keeps seconds in the on-disk inode, and msdosfs does not
have enough precision for all fields, so this is not very useful for those
two.


# 1.19 10-Sep-2005 christos

Make fileno calculations use ino_t variables.


# 1.18 29-Aug-2005 xtraeme

Remove __P()


# 1.17 29-Aug-2005 xtraeme

The maximum file size on MS-DOS filesystems is 4 GB - 1 byte, so
don't bother trying to write files bigger than this. Just return
EFBIG to caller, rather than panic()ing later.

From OpenBSD.

This closes my PR kern/30864: "panic when copying files of >4GB on msdosfs"


# 1.16 19-Aug-2005 christos

fileid is now a quad.


# 1.15 19-Aug-2005 christos

64 bit inode changes.


Revision tags: yamt-km-base4 yamt-km-base3 netbsd-3-base kent-audio2-base
# 1.14 26-Feb-2005 perry

branches: 1.14.2; 1.14.4;
nuke trailing whitespace


Revision tags: yamt-km-base2 yamt-km-base kent-audio1-beforemerge
# 1.13 09-Jan-2005 chs

branches: 1.13.2; 1.13.4;
adjust the UBC mapping code to support non-vnode uvm_objects.
this means we can no longer look at the vnode size to determine how many
pages to request in a fault, which is good since for NFS the size can change
out from under us on the server anyway. there's also a new flag UBC_UNMAP
for ubc_release(), so that the file system code can make the decision about
whether to cache mappings for files being used as executables.


Revision tags: kent-audio1-base
# 1.12 13-Sep-2004 jdolecek

set mp->mnt_stat.f_namemax on filesystem mount for use by statvfs, and use
the value for also pathconf(_PC_NAME_MAX) to keep the two in sync


# 1.11 12-May-2004 jrf

caddr_t -> void * and removal of some more casts.


# 1.10 04-May-2004 jrf

Remove caddr_t inlines. Approved by christos@NetBSD.org.


Revision tags: netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.9 26-Jan-2004 hannken

branches: 1.9.2; 1.9.4;
Fix xxx_strategy() to use the vnode arg instead of bp->b_vp.


# 1.8 25-Jan-2004 hannken

Make VOP_STRATEGY(bp) a real VOP as discussed on tech-kern.

VOP_STRATEGY(bp) is replaced by one of two new functions:

- VOP_STRATEGY(vp, bp) Call the strategy routine of vp for bp.
- DEV_STRATEGY(bp) Call the d_strategy routine of bp->b_dev for bp.

DEV_STRATEGY(bp) is used only for block-to-block device situations.


# 1.7 07-Sep-2003 itojun

add -t option for gmt time offset (normally MS-DOS filesystem has timestamp
in localtime, not GMT). PR kern/22717


# 1.6 02-Aug-2003 jdolecek

Allow separate masks for files and directories. Useful e.g. to turn
the execute bit off for files, but keep search permission for directories.
Change contributed in PR kern/21538 by Pavel Arnost, based on some FreeBSD
patches.
Further manpage changes, and backward-compatibility adjustments done by me.

Also fixes PR kern/16778 by Johan Danielsson, and PR kern/3400 by Rick Byers


# 1.5 29-Jun-2003 fvdl

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


# 1.4 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.3 26-Jun-2003 itojun

strlcpy


# 1.2 25-Feb-2003 jdolecek

make 'dosdirtemplate' static const


Revision tags: nathanw_sa_before_merge fvdl_fs64_base nathanw_sa_base
# 1.1 26-Dec-2002 jdolecek

branches: 1.1.2;
move msdosfs code from sys/msdosfs to sys/fs/msdosfs