History log of /netbsd-current/sys/nfs/nfsm_subs.h
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.57 23-Mar-2023 riastradh

nfs: Use unsigned name lengths so we don't trip over negative ones.

- nfsm_strsiz is only used with uint32_t in callers, but let's not
leave it as a rake to step on.

- nfsm_srvnamesiz is abused with signed s. The internal conversion
to unsigned serves to reject both negative and too-large values in
such callers.

XXX Should make all callers use unsigned, rather than flipping back
and forth between signed and unsigned for name lengths.

XXX pullup-8
XXX pullup-9
XXX pullup-10


# 1.56 23-Mar-2023 riastradh

nfs: Use unsigned fhlen so we don't trip over negative values.

XXX pullup-8
XXX pullup-9
XXX pullup-10


Revision tags: netbsd-10-base bouyer-sunxi-drm-base
# 1.55 12-Aug-2021 andvar

branches: 1.55.4;
s/directry/directory/


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-i2c-spi-conf-base thorpej-cfargs-base thorpej-futex-base bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base phil-wifi-20200406
# 1.54 04-Apr-2020 mlelstv

NFSv2 is limited to use only 32bit in metadata. Prevent that larger
metadata values are simply truncated.

-> clamp filesystem block counts to signed 32bit.
-> clamp file sizes to signed 32bit (*)

Some NFSv2 clients also have problems to handle buffer sizes larger
than (signed) 16bit.
-> clamp buffer sizes to signed 16bit for better compatibility.

(*) This can lead to erroneous behaviour for files larger than 2GB
that NFSv2 cannot handle but it is still better than before.
An alternative would be to (partially) reject operations on files
larger than 2GB, but which causes other problems.


Revision tags: netbsd-9-3-RELEASE netbsd-9-2-RELEASE netbsd-9-1-RELEASE is-mlppp-base netbsd-8-2-RELEASE ad-namecache-base3 netbsd-9-0-RELEASE netbsd-9-0-RC2 ad-namecache-base2 ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 netbsd-8-1-RELEASE netbsd-8-1-RC1 isaki-audio2-base pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 netbsd-7-2-RELEASE 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 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 nick-nhusb-base-20170204 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 nick-nhusb-base-20161204 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE nick-nhusb-base-20161004 localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 netbsd-7-0-1-RELEASE nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.53 14-Sep-2013 martin

branches: 1.53.22; 1.53.30; 1.53.34;
Backout wildcard pragma to kill warnings and instead sprinkle a few dozen
__unused attributes.
Requested by joerg@


# 1.52 14-Sep-2013 martin

Silence gcc 4.8.1 warnings


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE yamt-pagecache-tag8 netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 agc-symver-base netbsd-6-1-RC2 netbsd-6-1-RC1 yamt-pagecache-base8 netbsd-6-0-1-RELEASE yamt-pagecache-base7 matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10 uebayasi-xip-base1 rmind-uvmplock-base yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211 yamt-nfs-mp-base8 yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 jym-xensuspend-nbase yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 jym-xensuspend-base nick-hppapmap-base
# 1.51 10-Apr-2009 bouyer

PR kern/41158: nfs_rename() locking against myself
nfsrv_rename() can exit without calling genfs_renamelock_exit() because
the nfsm_reply() can do return (0) on error.
Change nfsm_reply to use 'error = 0; goto nfsmout' instead.
Fix a few place so it's safe to goto nfsmout from nfsm_reply, or other
macros calling it.
As a side effect it could fix a missing vrele(dirp) in various place where
nfsm_reply could return(0).


Revision tags: netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 nick-csl-alignment-base5 haad-dm-base wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base yamt-nfs-mp-base yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase mjf-devfs2-base nick-net80211-sync-base keiichi-mipv6-base bouyer-xeni386-merge1 matt-armv6-prevmlocking vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 matt-armv6-nbase jmcneill-base mjf-devfs-base bouyer-xenamd64-base2 vmlocking-nbase yamt-x86pmap-base4 bouyer-xenamd64-base yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base matt-armv6-base matt-mips64-base jmcneill-pm-base hpcarm-cleanup-base nick-csl-alignment-base yamt-idlelwp-base8 thorpej-atomic-base reinoud-bufcleanup-base mjf-ufs-trans-base vmlocking-base
# 1.50 04-Mar-2007 christos

branches: 1.50.40; 1.50.50; 1.50.52; 1.50.56;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.


Revision tags: ad-audiomp-base
# 1.49 22-Feb-2007 thorpej

TRUE -> true, FALSE -> false


# 1.48 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: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base post-newlock2-merge newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 yamt-splraiseipl-base2 yamt-splraiseipl-base yamt-pdpolicy-base9 newlock2-base yamt-pdpolicy-base8 netbsd-4-base rpaulo-netinet-merge-pcb-base
# 1.47 02-Sep-2006 yamt

branches: 1.47.8;
nfsd: deal with variable-sized filehandles.


Revision tags: yamt-pdpolicy-base7
# 1.46 08-Aug-2006 yamt

nfsm_srvfhtom: ensure that padding bytes in nfsv2 file handles are zero.


Revision tags: abandoned-netbsd-4-base yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base chap-midi-base
# 1.45 07-Jun-2006 kardel

branches: 1.45.4;
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 yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 elad-kernelauth-base yamt-pdpolicy-base yamt-uio_vmspace-base5 simonb-timecounters-base
# 1.44 11-Dec-2005 christos

branches: 1.44.4; 1.44.6; 1.44.8; 1.44.14;
merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 ktrace-lwp-base
# 1.43 31-Oct-2005 thorpej

Fix paste-o in the NFSV3SATTRTIME_TOSERVER case of mtime handing (need
to set va_mtime, not va_atime).


Revision tags: yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base
# 1.42 01-Oct-2005 yamt

branches: 1.42.2;
nfsm_srvsattr: use nanotime(9) rather than time(9) for NFSV3SATTRTIME_TOSERVER.


# 1.41 29-May-2005 christos

branches: 1.41.2;
- sprinkle const
- avoid shadowed variables
- mark bad const use with XXXUNCONST


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

nuke trailing whitespace


Revision tags: yamt-km-base2 yamt-km-base
# 1.39 19-Jan-2005 yamt

branches: 1.39.2;
implement inaccurate mtime/ctime detection.
namely, if mtime or ctime are same between pre_op_attr and post_op_attr
when we expected them to be changed, don't trust the server.


Revision tags: kent-audio1-beforemerge kent-audio1-base
# 1.38 29-Sep-2004 yamt

branches: 1.38.4;
g/c NFSMINOFF, which is unused and identical with MRESETDATA.


# 1.37 10-May-2004 yamt

don't do kludge for a reply to a retransmitted request
unless we actually retransmitted the request.


# 1.36 05-Apr-2004 yamt

nfsm_mtofh: handle the case that filehandle is exist but fattr is not.


# 1.35 05-Apr-2004 yamt

nfsm_wcc_data: update n_ctime and n_nctime if no one other than us
changed the file in the meantime so that we won't invalidate caches
unnecessarily due to our own activities.


Revision tags: netbsd-2-0-base
# 1.34 19-Mar-2004 yamt

branches: 1.34.2;
comments on some nfsm_ macros.


# 1.33 15-Mar-2004 yamt

some comments on cryptic nfsm_ macros.


# 1.32 26-Sep-2003 yamt

change n_mtime from time_t to timespec in order to improve
cache consistency.
(1 second granularity is too loose these days.)


# 1.31 07-Aug-2003 agc

Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.


# 1.30 29-Jun-2003 fvdl

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


# 1.29 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.28 09-Jun-2003 yamt

rework zero padding of rpc reply.
- for READ procedure, don't send back more bytes than requested.
- don't have doubtful assumptions on mbuf chain structure.
- rename a function (nfsm_adj -> nfs_zeropad) to avoid confusion as
the semantics of the function was changed.


# 1.27 06-May-2003 yamt

remove nfsm_srvstrsiz as it's no longer used.


# 1.26 24-Apr-2003 drochner

Change some subordinate functions to take a "struct nfsnode" argument
instead of "struct vnode". This saves a number of pointer dereferences;
it sums up to about half a kB for me. And it paves the way for future
fixes.
While cleaning up, eliminate a write-only member of "struct nfsreq"
and a pointless assignment in the NFS_V2_ONLY case.


# 1.25 28-Mar-2003 yamt

reply ENAMETOOLONG properly instead of discarding request as BADRPC.
my own PR20791.


# 1.24 26-Feb-2003 matt

Fix typo.


# 1.23 26-Feb-2003 matt

Add MBUFTRACE kernel option.
Do a little mbuf rework while here. Change all uses of MGET*(*, M_WAIT, *)
to m_get*(M_WAIT, *). These are not performance critical and making them
call m_get saves considerable space. Add m_clget analogue of MCLGET and
make corresponding change for M_WAIT uses.
Modify netinet, gem, fxp, tulip, nfs to support MBUFTRACE.
Begin to change netstat to use sysctl.


Revision tags: nathanw_sa_before_merge fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base nathanw_sa_base kqueue-aftermerge kqueue-beforemerge
# 1.22 21-Oct-2002 yamt

fix a page locking deadlock problem for nfs.

add a flag that specify if the file can be truncated safely or not
to nfsm_loadattr and friends. when it isn't safe, just mark the nfsnode
as "should be truncated later".

ok'ed by Frank van der Linden and Chuck Silvers.
close kern/18036.


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base gehenna-devsw-base kqueue-base
# 1.21 03-Apr-2002 wrstuden

In the SETATTR code, if the changes to a & m time are exclusively
set via NFSV3SATTRTIME_TOSERVER and not NFSV3SATTRTIME_TOCLIENT,
add VA_UTIMES_NULL to the va_vflags. This reflects our policy
where we're much more liberal about who can set a & m times to 'now'
than we are about who can set them to a specific time.

Should close PR 15597 from Martin Husemann. Patch is based on the
one Matthias Drochner gave in the PR.


Revision tags: netbsd-1-5-PATCH003 eeh-devprop-base newlock-base ifpoll-base thorpej-mips-cache-base thorpej-devvp-base3 thorpej-devvp-base2 post-chs-ubcperf pre-chs-ubcperf thorpej-devvp-base netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 thorpej_scsipi_beforemerge thorpej_scsipi_nbase netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 netbsd-1-5-base minoura-xpg4dl-base chs-ubc2-newbase wrstuden-devbsize-19991221 wrstuden-devbsize-base comdex-fall-1999-base fvdl-softdep-base thorpej_scsipi_base chs-ubc2-base
# 1.20 29-May-1999 fvdl

branches: 1.20.14; 1.20.16;
Be more correct with attribute structures for setattr RPCs and friends,
so that picky servers (e.g. Solaris 7) don't refuse our requests. Move
some code into a macro, and a bit of KNF. From OpenBSD.


Revision tags: kame_14_19990705 kame_14_19990628 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.19 06-Mar-1999 fair

branches: 1.19.2; 1.19.4; 1.19.6;
Snatch a patch from OpenBSD to fix PRs 6529 and 7074.
Adjust fxdr_hyper() and txdr_hyper() macros.


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

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


Revision tags: netbsd-1-3-PATCH003 netbsd-1-3-PATCH003-CANDIDATE2 netbsd-1-3-PATCH003-CANDIDATE1 netbsd-1-3-PATCH003-CANDIDATE0 eeh-paddr_t-base netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base thorpej-signal-base marc-pcmcia-bp marc-pcmcia-base
# 1.17 14-Jul-1997 fvdl

Don't assume that pointers into mbuf data remain valid across nfsm_dissect.
In readdirplus, don't keep such pointers but store the file attributes
in a variable instead until they are needed. Change nfsm_loadattr*
a bit so it can accept a direct pointer to an nfs_fattr structure.


# 1.16 24-Jun-1997 fvdl

Let nfsm_srvmtofh deal with the public filehandle, convert to all zeroes
for both v2 and v3 internally.


# 1.15 27-Mar-1997 thorpej

Don't assume mbuf external storage is MCLBYTES.


Revision tags: is-newarp-before-merge
# 1.14 24-Feb-1997 fvdl

Use ALIGNED_POINTER to see whether mbuf data needs to be realigned.


# 1.13 22-Feb-1997 fvdl

Cast pointer to u_long, not int, when doing the alignment check.
Fixes warnings on the Alpha. Needs a better solution.


# 1.12 22-Feb-1997 fvdl

Fixes from BSDI (thanks go to Keith Bostic). Original RCS message:

date: 1997/02/10 18:41:15; author: cp; state: Exp; lines: +8 -2
Make nfs_realign go away on sparc and add functionality to nfsm_disct.

===
[XXX this introduces an ifdef __i386__, see the comment. Should be changed]


Revision tags: is-newarp-base
# 1.11 25-Oct-1996 cgd

branches: 1.11.4;
make the namei struct members ni_dirp and ni_next, and the componentname
struct member cn_nameptr 'const', since they should never be used to
modify the path name. (Only the pathname buffer, cn_pnbuf, should be
modified.) Propagate the const poisoning to code that uses the namei
and componentname structs.


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.10 20-Mar-1996 fvdl

Make sure not to free the reply mbuf twice. Should fix PR #2240


# 1.9 18-Feb-1996 fvdl

Bring in a merge of Rick Macklem's NFSv3 code from Lite2


# 1.8 09-Feb-1996 christos

nfs prototype changes


# 1.7 19-Dec-1995 cgd

changes to make this work on systems where pointers & longs are 64 bits.
This is mostly just changes to make the stuff that goes over the wire
use fixed-size types.


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.6 23-May-1995 mycroft

Remove gratuitous extra indirections.


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

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


# 1.4 08-Jun-1994 mycroft

Update to 4.4-Lite fs code, with local changes.


Revision tags: magnum-base netbsd-0-9-patch-001 netbsd-0-9-RELEASE netbsd-0-9-BETA netbsd-0-9-ALPHA2 netbsd-0-9-ALPHA netbsd-0-9-base
# 1.3 03-Jun-1993 cgd

fix for macklem's bogus use of the va_flags field, supplied by
John Woods, jfwfrom: @ksr.com. also, fixes the following problems:
the va_gen field is in a similar position
(Suns are going to be reporting the change-date microseconds as their
"generation"), I've supplied my own set of diffs below for your inspection.
Note these aren't even compiled, but they're pretty similar to what I had
to do to our older version of OSF/1 here. (There's also an unrelated change
supplied for xdr_subs.h; the pointer types supplied to the fxdr_time() and
txdr_time() macros are not, in fact, both struct timevals. That turns out
to be one of many tips-of-the-iceberg facing those porting the (old) Berkeley
NFS code to 64-bit machines...)


# 1.2 20-May-1993 cgd

more rcs id adding and header cleanup. i like vi macros!


Revision tags: netbsd-0-8 netbsd-alpha-1
# 1.1 20-Apr-1993 mycroft

branches: 1.1.1;
Restore files lost during crash.


# 1.55 12-Aug-2021 andvar

s/directry/directory/


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-i2c-spi-conf-base thorpej-cfargs-base thorpej-futex-base bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base phil-wifi-20200406
# 1.54 04-Apr-2020 mlelstv

NFSv2 is limited to use only 32bit in metadata. Prevent that larger
metadata values are simply truncated.

-> clamp filesystem block counts to signed 32bit.
-> clamp file sizes to signed 32bit (*)

Some NFSv2 clients also have problems to handle buffer sizes larger
than (signed) 16bit.
-> clamp buffer sizes to signed 16bit for better compatibility.

(*) This can lead to erroneous behaviour for files larger than 2GB
that NFSv2 cannot handle but it is still better than before.
An alternative would be to (partially) reject operations on files
larger than 2GB, but which causes other problems.


Revision tags: netbsd-9-2-RELEASE netbsd-9-1-RELEASE is-mlppp-base netbsd-8-2-RELEASE ad-namecache-base3 netbsd-9-0-RELEASE netbsd-9-0-RC2 ad-namecache-base2 ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 netbsd-8-1-RELEASE netbsd-8-1-RC1 isaki-audio2-base pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 netbsd-7-2-RELEASE 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 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 nick-nhusb-base-20170204 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 nick-nhusb-base-20161204 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE nick-nhusb-base-20161004 localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 netbsd-7-0-1-RELEASE nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.53 14-Sep-2013 martin

branches: 1.53.30;
Backout wildcard pragma to kill warnings and instead sprinkle a few dozen
__unused attributes.
Requested by joerg@


# 1.52 14-Sep-2013 martin

Silence gcc 4.8.1 warnings


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE yamt-pagecache-tag8 netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 agc-symver-base netbsd-6-1-RC2 netbsd-6-1-RC1 yamt-pagecache-base8 netbsd-6-0-1-RELEASE yamt-pagecache-base7 matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10 uebayasi-xip-base1 rmind-uvmplock-base yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211 yamt-nfs-mp-base8 yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 jym-xensuspend-nbase yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 jym-xensuspend-base nick-hppapmap-base
# 1.51 10-Apr-2009 bouyer

PR kern/41158: nfs_rename() locking against myself
nfsrv_rename() can exit without calling genfs_renamelock_exit() because
the nfsm_reply() can do return (0) on error.
Change nfsm_reply to use 'error = 0; goto nfsmout' instead.
Fix a few place so it's safe to goto nfsmout from nfsm_reply, or other
macros calling it.
As a side effect it could fix a missing vrele(dirp) in various place where
nfsm_reply could return(0).


Revision tags: netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 nick-csl-alignment-base5 haad-dm-base wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base yamt-nfs-mp-base yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase mjf-devfs2-base nick-net80211-sync-base keiichi-mipv6-base bouyer-xeni386-merge1 matt-armv6-prevmlocking vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 matt-armv6-nbase jmcneill-base mjf-devfs-base bouyer-xenamd64-base2 vmlocking-nbase yamt-x86pmap-base4 bouyer-xenamd64-base yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base matt-armv6-base matt-mips64-base jmcneill-pm-base hpcarm-cleanup-base nick-csl-alignment-base yamt-idlelwp-base8 thorpej-atomic-base reinoud-bufcleanup-base mjf-ufs-trans-base vmlocking-base
# 1.50 04-Mar-2007 christos

branches: 1.50.40; 1.50.50; 1.50.52; 1.50.56;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.


Revision tags: ad-audiomp-base
# 1.49 22-Feb-2007 thorpej

TRUE -> true, FALSE -> false


# 1.48 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: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base post-newlock2-merge newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 yamt-splraiseipl-base2 yamt-splraiseipl-base yamt-pdpolicy-base9 newlock2-base yamt-pdpolicy-base8 netbsd-4-base rpaulo-netinet-merge-pcb-base
# 1.47 02-Sep-2006 yamt

branches: 1.47.8;
nfsd: deal with variable-sized filehandles.


Revision tags: yamt-pdpolicy-base7
# 1.46 08-Aug-2006 yamt

nfsm_srvfhtom: ensure that padding bytes in nfsv2 file handles are zero.


Revision tags: abandoned-netbsd-4-base yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base chap-midi-base
# 1.45 07-Jun-2006 kardel

branches: 1.45.4;
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 yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 elad-kernelauth-base yamt-pdpolicy-base yamt-uio_vmspace-base5 simonb-timecounters-base
# 1.44 11-Dec-2005 christos

branches: 1.44.4; 1.44.6; 1.44.8; 1.44.14;
merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 ktrace-lwp-base
# 1.43 31-Oct-2005 thorpej

Fix paste-o in the NFSV3SATTRTIME_TOSERVER case of mtime handing (need
to set va_mtime, not va_atime).


Revision tags: yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base
# 1.42 01-Oct-2005 yamt

branches: 1.42.2;
nfsm_srvsattr: use nanotime(9) rather than time(9) for NFSV3SATTRTIME_TOSERVER.


# 1.41 29-May-2005 christos

branches: 1.41.2;
- sprinkle const
- avoid shadowed variables
- mark bad const use with XXXUNCONST


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

nuke trailing whitespace


Revision tags: yamt-km-base2 yamt-km-base
# 1.39 19-Jan-2005 yamt

branches: 1.39.2;
implement inaccurate mtime/ctime detection.
namely, if mtime or ctime are same between pre_op_attr and post_op_attr
when we expected them to be changed, don't trust the server.


Revision tags: kent-audio1-beforemerge kent-audio1-base
# 1.38 29-Sep-2004 yamt

branches: 1.38.4;
g/c NFSMINOFF, which is unused and identical with MRESETDATA.


# 1.37 10-May-2004 yamt

don't do kludge for a reply to a retransmitted request
unless we actually retransmitted the request.


# 1.36 05-Apr-2004 yamt

nfsm_mtofh: handle the case that filehandle is exist but fattr is not.


# 1.35 05-Apr-2004 yamt

nfsm_wcc_data: update n_ctime and n_nctime if no one other than us
changed the file in the meantime so that we won't invalidate caches
unnecessarily due to our own activities.


Revision tags: netbsd-2-0-base
# 1.34 19-Mar-2004 yamt

branches: 1.34.2;
comments on some nfsm_ macros.


# 1.33 15-Mar-2004 yamt

some comments on cryptic nfsm_ macros.


# 1.32 26-Sep-2003 yamt

change n_mtime from time_t to timespec in order to improve
cache consistency.
(1 second granularity is too loose these days.)


# 1.31 07-Aug-2003 agc

Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.


# 1.30 29-Jun-2003 fvdl

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


# 1.29 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.28 09-Jun-2003 yamt

rework zero padding of rpc reply.
- for READ procedure, don't send back more bytes than requested.
- don't have doubtful assumptions on mbuf chain structure.
- rename a function (nfsm_adj -> nfs_zeropad) to avoid confusion as
the semantics of the function was changed.


# 1.27 06-May-2003 yamt

remove nfsm_srvstrsiz as it's no longer used.


# 1.26 24-Apr-2003 drochner

Change some subordinate functions to take a "struct nfsnode" argument
instead of "struct vnode". This saves a number of pointer dereferences;
it sums up to about half a kB for me. And it paves the way for future
fixes.
While cleaning up, eliminate a write-only member of "struct nfsreq"
and a pointless assignment in the NFS_V2_ONLY case.


# 1.25 28-Mar-2003 yamt

reply ENAMETOOLONG properly instead of discarding request as BADRPC.
my own PR20791.


# 1.24 26-Feb-2003 matt

Fix typo.


# 1.23 26-Feb-2003 matt

Add MBUFTRACE kernel option.
Do a little mbuf rework while here. Change all uses of MGET*(*, M_WAIT, *)
to m_get*(M_WAIT, *). These are not performance critical and making them
call m_get saves considerable space. Add m_clget analogue of MCLGET and
make corresponding change for M_WAIT uses.
Modify netinet, gem, fxp, tulip, nfs to support MBUFTRACE.
Begin to change netstat to use sysctl.


Revision tags: nathanw_sa_before_merge fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base nathanw_sa_base kqueue-aftermerge kqueue-beforemerge
# 1.22 21-Oct-2002 yamt

fix a page locking deadlock problem for nfs.

add a flag that specify if the file can be truncated safely or not
to nfsm_loadattr and friends. when it isn't safe, just mark the nfsnode
as "should be truncated later".

ok'ed by Frank van der Linden and Chuck Silvers.
close kern/18036.


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base gehenna-devsw-base kqueue-base
# 1.21 03-Apr-2002 wrstuden

In the SETATTR code, if the changes to a & m time are exclusively
set via NFSV3SATTRTIME_TOSERVER and not NFSV3SATTRTIME_TOCLIENT,
add VA_UTIMES_NULL to the va_vflags. This reflects our policy
where we're much more liberal about who can set a & m times to 'now'
than we are about who can set them to a specific time.

Should close PR 15597 from Martin Husemann. Patch is based on the
one Matthias Drochner gave in the PR.


Revision tags: netbsd-1-5-PATCH003 eeh-devprop-base newlock-base ifpoll-base thorpej-mips-cache-base thorpej-devvp-base3 thorpej-devvp-base2 post-chs-ubcperf pre-chs-ubcperf thorpej-devvp-base netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 thorpej_scsipi_beforemerge thorpej_scsipi_nbase netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 netbsd-1-5-base minoura-xpg4dl-base chs-ubc2-newbase wrstuden-devbsize-19991221 wrstuden-devbsize-base comdex-fall-1999-base fvdl-softdep-base thorpej_scsipi_base chs-ubc2-base
# 1.20 29-May-1999 fvdl

branches: 1.20.14; 1.20.16;
Be more correct with attribute structures for setattr RPCs and friends,
so that picky servers (e.g. Solaris 7) don't refuse our requests. Move
some code into a macro, and a bit of KNF. From OpenBSD.


Revision tags: kame_14_19990705 kame_14_19990628 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.19 06-Mar-1999 fair

branches: 1.19.2; 1.19.4; 1.19.6;
Snatch a patch from OpenBSD to fix PRs 6529 and 7074.
Adjust fxdr_hyper() and txdr_hyper() macros.


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

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


Revision tags: netbsd-1-3-PATCH003 netbsd-1-3-PATCH003-CANDIDATE2 netbsd-1-3-PATCH003-CANDIDATE1 netbsd-1-3-PATCH003-CANDIDATE0 eeh-paddr_t-base netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base thorpej-signal-base marc-pcmcia-bp marc-pcmcia-base
# 1.17 14-Jul-1997 fvdl

Don't assume that pointers into mbuf data remain valid across nfsm_dissect.
In readdirplus, don't keep such pointers but store the file attributes
in a variable instead until they are needed. Change nfsm_loadattr*
a bit so it can accept a direct pointer to an nfs_fattr structure.


# 1.16 24-Jun-1997 fvdl

Let nfsm_srvmtofh deal with the public filehandle, convert to all zeroes
for both v2 and v3 internally.


# 1.15 27-Mar-1997 thorpej

Don't assume mbuf external storage is MCLBYTES.


Revision tags: is-newarp-before-merge
# 1.14 24-Feb-1997 fvdl

Use ALIGNED_POINTER to see whether mbuf data needs to be realigned.


# 1.13 22-Feb-1997 fvdl

Cast pointer to u_long, not int, when doing the alignment check.
Fixes warnings on the Alpha. Needs a better solution.


# 1.12 22-Feb-1997 fvdl

Fixes from BSDI (thanks go to Keith Bostic). Original RCS message:

date: 1997/02/10 18:41:15; author: cp; state: Exp; lines: +8 -2
Make nfs_realign go away on sparc and add functionality to nfsm_disct.

===
[XXX this introduces an ifdef __i386__, see the comment. Should be changed]


Revision tags: is-newarp-base
# 1.11 25-Oct-1996 cgd

branches: 1.11.4;
make the namei struct members ni_dirp and ni_next, and the componentname
struct member cn_nameptr 'const', since they should never be used to
modify the path name. (Only the pathname buffer, cn_pnbuf, should be
modified.) Propagate the const poisoning to code that uses the namei
and componentname structs.


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.10 20-Mar-1996 fvdl

Make sure not to free the reply mbuf twice. Should fix PR #2240


# 1.9 18-Feb-1996 fvdl

Bring in a merge of Rick Macklem's NFSv3 code from Lite2


# 1.8 09-Feb-1996 christos

nfs prototype changes


# 1.7 19-Dec-1995 cgd

changes to make this work on systems where pointers & longs are 64 bits.
This is mostly just changes to make the stuff that goes over the wire
use fixed-size types.


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.6 23-May-1995 mycroft

Remove gratuitous extra indirections.


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

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


# 1.4 08-Jun-1994 mycroft

Update to 4.4-Lite fs code, with local changes.


Revision tags: magnum-base netbsd-0-9-patch-001 netbsd-0-9-RELEASE netbsd-0-9-BETA netbsd-0-9-ALPHA2 netbsd-0-9-ALPHA netbsd-0-9-base
# 1.3 03-Jun-1993 cgd

fix for macklem's bogus use of the va_flags field, supplied by
John Woods, jfwfrom: @ksr.com. also, fixes the following problems:
the va_gen field is in a similar position
(Suns are going to be reporting the change-date microseconds as their
"generation"), I've supplied my own set of diffs below for your inspection.
Note these aren't even compiled, but they're pretty similar to what I had
to do to our older version of OSF/1 here. (There's also an unrelated change
supplied for xdr_subs.h; the pointer types supplied to the fxdr_time() and
txdr_time() macros are not, in fact, both struct timevals. That turns out
to be one of many tips-of-the-iceberg facing those porting the (old) Berkeley
NFS code to 64-bit machines...)


# 1.2 20-May-1993 cgd

more rcs id adding and header cleanup. i like vi macros!


Revision tags: netbsd-0-8 netbsd-alpha-1
# 1.1 20-Apr-1993 mycroft

branches: 1.1.1;
Restore files lost during crash.


# 1.54 04-Apr-2020 mlelstv

NFSv2 is limited to use only 32bit in metadata. Prevent that larger
metadata values are simply truncated.

-> clamp filesystem block counts to signed 32bit.
-> clamp file sizes to signed 32bit (*)

Some NFSv2 clients also have problems to handle buffer sizes larger
than (signed) 16bit.
-> clamp buffer sizes to signed 16bit for better compatibility.

(*) This can lead to erroneous behaviour for files larger than 2GB
that NFSv2 cannot handle but it is still better than before.
An alternative would be to (partially) reject operations on files
larger than 2GB, but which causes other problems.


Revision tags: netbsd-8-2-RELEASE ad-namecache-base3 netbsd-9-0-RELEASE netbsd-9-0-RC2 ad-namecache-base2 ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 netbsd-8-1-RELEASE netbsd-8-1-RC1 isaki-audio2-base pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 netbsd-7-2-RELEASE 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 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 nick-nhusb-base-20170204 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 nick-nhusb-base-20161204 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE nick-nhusb-base-20161004 localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 netbsd-7-0-1-RELEASE nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.53 14-Sep-2013 martin

Backout wildcard pragma to kill warnings and instead sprinkle a few dozen
__unused attributes.
Requested by joerg@


# 1.52 14-Sep-2013 martin

Silence gcc 4.8.1 warnings


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE yamt-pagecache-tag8 netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 agc-symver-base netbsd-6-1-RC2 netbsd-6-1-RC1 yamt-pagecache-base8 netbsd-6-0-1-RELEASE yamt-pagecache-base7 matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10 uebayasi-xip-base1 rmind-uvmplock-base yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211 yamt-nfs-mp-base8 yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 jym-xensuspend-nbase yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 jym-xensuspend-base nick-hppapmap-base
# 1.51 10-Apr-2009 bouyer

PR kern/41158: nfs_rename() locking against myself
nfsrv_rename() can exit without calling genfs_renamelock_exit() because
the nfsm_reply() can do return (0) on error.
Change nfsm_reply to use 'error = 0; goto nfsmout' instead.
Fix a few place so it's safe to goto nfsmout from nfsm_reply, or other
macros calling it.
As a side effect it could fix a missing vrele(dirp) in various place where
nfsm_reply could return(0).


Revision tags: netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 nick-csl-alignment-base5 haad-dm-base wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base yamt-nfs-mp-base yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase mjf-devfs2-base nick-net80211-sync-base keiichi-mipv6-base bouyer-xeni386-merge1 matt-armv6-prevmlocking vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 matt-armv6-nbase jmcneill-base mjf-devfs-base bouyer-xenamd64-base2 vmlocking-nbase yamt-x86pmap-base4 bouyer-xenamd64-base yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base matt-armv6-base matt-mips64-base jmcneill-pm-base hpcarm-cleanup-base nick-csl-alignment-base yamt-idlelwp-base8 thorpej-atomic-base reinoud-bufcleanup-base mjf-ufs-trans-base vmlocking-base
# 1.50 04-Mar-2007 christos

branches: 1.50.40; 1.50.50; 1.50.52; 1.50.56;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.


Revision tags: ad-audiomp-base
# 1.49 22-Feb-2007 thorpej

TRUE -> true, FALSE -> false


# 1.48 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: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base post-newlock2-merge newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 yamt-splraiseipl-base2 yamt-splraiseipl-base yamt-pdpolicy-base9 newlock2-base yamt-pdpolicy-base8 netbsd-4-base rpaulo-netinet-merge-pcb-base
# 1.47 02-Sep-2006 yamt

branches: 1.47.8;
nfsd: deal with variable-sized filehandles.


Revision tags: yamt-pdpolicy-base7
# 1.46 08-Aug-2006 yamt

nfsm_srvfhtom: ensure that padding bytes in nfsv2 file handles are zero.


Revision tags: abandoned-netbsd-4-base yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base chap-midi-base
# 1.45 07-Jun-2006 kardel

branches: 1.45.4;
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 yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 elad-kernelauth-base yamt-pdpolicy-base yamt-uio_vmspace-base5 simonb-timecounters-base
# 1.44 11-Dec-2005 christos

branches: 1.44.4; 1.44.6; 1.44.8; 1.44.14;
merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 ktrace-lwp-base
# 1.43 31-Oct-2005 thorpej

Fix paste-o in the NFSV3SATTRTIME_TOSERVER case of mtime handing (need
to set va_mtime, not va_atime).


Revision tags: yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base
# 1.42 01-Oct-2005 yamt

branches: 1.42.2;
nfsm_srvsattr: use nanotime(9) rather than time(9) for NFSV3SATTRTIME_TOSERVER.


# 1.41 29-May-2005 christos

branches: 1.41.2;
- sprinkle const
- avoid shadowed variables
- mark bad const use with XXXUNCONST


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

nuke trailing whitespace


Revision tags: yamt-km-base2 yamt-km-base
# 1.39 19-Jan-2005 yamt

branches: 1.39.2;
implement inaccurate mtime/ctime detection.
namely, if mtime or ctime are same between pre_op_attr and post_op_attr
when we expected them to be changed, don't trust the server.


Revision tags: kent-audio1-beforemerge kent-audio1-base
# 1.38 29-Sep-2004 yamt

branches: 1.38.4;
g/c NFSMINOFF, which is unused and identical with MRESETDATA.


# 1.37 10-May-2004 yamt

don't do kludge for a reply to a retransmitted request
unless we actually retransmitted the request.


# 1.36 05-Apr-2004 yamt

nfsm_mtofh: handle the case that filehandle is exist but fattr is not.


# 1.35 05-Apr-2004 yamt

nfsm_wcc_data: update n_ctime and n_nctime if no one other than us
changed the file in the meantime so that we won't invalidate caches
unnecessarily due to our own activities.


Revision tags: netbsd-2-0-base
# 1.34 19-Mar-2004 yamt

branches: 1.34.2;
comments on some nfsm_ macros.


# 1.33 15-Mar-2004 yamt

some comments on cryptic nfsm_ macros.


# 1.32 26-Sep-2003 yamt

change n_mtime from time_t to timespec in order to improve
cache consistency.
(1 second granularity is too loose these days.)


# 1.31 07-Aug-2003 agc

Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.


# 1.30 29-Jun-2003 fvdl

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


# 1.29 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.28 09-Jun-2003 yamt

rework zero padding of rpc reply.
- for READ procedure, don't send back more bytes than requested.
- don't have doubtful assumptions on mbuf chain structure.
- rename a function (nfsm_adj -> nfs_zeropad) to avoid confusion as
the semantics of the function was changed.


# 1.27 06-May-2003 yamt

remove nfsm_srvstrsiz as it's no longer used.


# 1.26 24-Apr-2003 drochner

Change some subordinate functions to take a "struct nfsnode" argument
instead of "struct vnode". This saves a number of pointer dereferences;
it sums up to about half a kB for me. And it paves the way for future
fixes.
While cleaning up, eliminate a write-only member of "struct nfsreq"
and a pointless assignment in the NFS_V2_ONLY case.


# 1.25 28-Mar-2003 yamt

reply ENAMETOOLONG properly instead of discarding request as BADRPC.
my own PR20791.


# 1.24 26-Feb-2003 matt

Fix typo.


# 1.23 26-Feb-2003 matt

Add MBUFTRACE kernel option.
Do a little mbuf rework while here. Change all uses of MGET*(*, M_WAIT, *)
to m_get*(M_WAIT, *). These are not performance critical and making them
call m_get saves considerable space. Add m_clget analogue of MCLGET and
make corresponding change for M_WAIT uses.
Modify netinet, gem, fxp, tulip, nfs to support MBUFTRACE.
Begin to change netstat to use sysctl.


Revision tags: nathanw_sa_before_merge fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base nathanw_sa_base kqueue-aftermerge kqueue-beforemerge
# 1.22 21-Oct-2002 yamt

fix a page locking deadlock problem for nfs.

add a flag that specify if the file can be truncated safely or not
to nfsm_loadattr and friends. when it isn't safe, just mark the nfsnode
as "should be truncated later".

ok'ed by Frank van der Linden and Chuck Silvers.
close kern/18036.


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base gehenna-devsw-base kqueue-base
# 1.21 03-Apr-2002 wrstuden

In the SETATTR code, if the changes to a & m time are exclusively
set via NFSV3SATTRTIME_TOSERVER and not NFSV3SATTRTIME_TOCLIENT,
add VA_UTIMES_NULL to the va_vflags. This reflects our policy
where we're much more liberal about who can set a & m times to 'now'
than we are about who can set them to a specific time.

Should close PR 15597 from Martin Husemann. Patch is based on the
one Matthias Drochner gave in the PR.


Revision tags: netbsd-1-5-PATCH003 eeh-devprop-base newlock-base ifpoll-base thorpej-mips-cache-base thorpej-devvp-base3 thorpej-devvp-base2 post-chs-ubcperf pre-chs-ubcperf thorpej-devvp-base netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 thorpej_scsipi_beforemerge thorpej_scsipi_nbase netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 netbsd-1-5-base minoura-xpg4dl-base chs-ubc2-newbase wrstuden-devbsize-19991221 wrstuden-devbsize-base comdex-fall-1999-base fvdl-softdep-base thorpej_scsipi_base chs-ubc2-base
# 1.20 29-May-1999 fvdl

branches: 1.20.14; 1.20.16;
Be more correct with attribute structures for setattr RPCs and friends,
so that picky servers (e.g. Solaris 7) don't refuse our requests. Move
some code into a macro, and a bit of KNF. From OpenBSD.


Revision tags: kame_14_19990705 kame_14_19990628 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.19 06-Mar-1999 fair

branches: 1.19.2; 1.19.4; 1.19.6;
Snatch a patch from OpenBSD to fix PRs 6529 and 7074.
Adjust fxdr_hyper() and txdr_hyper() macros.


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

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


Revision tags: netbsd-1-3-PATCH003 netbsd-1-3-PATCH003-CANDIDATE2 netbsd-1-3-PATCH003-CANDIDATE1 netbsd-1-3-PATCH003-CANDIDATE0 eeh-paddr_t-base netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base thorpej-signal-base marc-pcmcia-bp marc-pcmcia-base
# 1.17 14-Jul-1997 fvdl

Don't assume that pointers into mbuf data remain valid across nfsm_dissect.
In readdirplus, don't keep such pointers but store the file attributes
in a variable instead until they are needed. Change nfsm_loadattr*
a bit so it can accept a direct pointer to an nfs_fattr structure.


# 1.16 24-Jun-1997 fvdl

Let nfsm_srvmtofh deal with the public filehandle, convert to all zeroes
for both v2 and v3 internally.


# 1.15 27-Mar-1997 thorpej

Don't assume mbuf external storage is MCLBYTES.


Revision tags: is-newarp-before-merge
# 1.14 24-Feb-1997 fvdl

Use ALIGNED_POINTER to see whether mbuf data needs to be realigned.


# 1.13 22-Feb-1997 fvdl

Cast pointer to u_long, not int, when doing the alignment check.
Fixes warnings on the Alpha. Needs a better solution.


# 1.12 22-Feb-1997 fvdl

Fixes from BSDI (thanks go to Keith Bostic). Original RCS message:

date: 1997/02/10 18:41:15; author: cp; state: Exp; lines: +8 -2
Make nfs_realign go away on sparc and add functionality to nfsm_disct.

===
[XXX this introduces an ifdef __i386__, see the comment. Should be changed]


Revision tags: is-newarp-base
# 1.11 25-Oct-1996 cgd

branches: 1.11.4;
make the namei struct members ni_dirp and ni_next, and the componentname
struct member cn_nameptr 'const', since they should never be used to
modify the path name. (Only the pathname buffer, cn_pnbuf, should be
modified.) Propagate the const poisoning to code that uses the namei
and componentname structs.


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.10 20-Mar-1996 fvdl

Make sure not to free the reply mbuf twice. Should fix PR #2240


# 1.9 18-Feb-1996 fvdl

Bring in a merge of Rick Macklem's NFSv3 code from Lite2


# 1.8 09-Feb-1996 christos

nfs prototype changes


# 1.7 19-Dec-1995 cgd

changes to make this work on systems where pointers & longs are 64 bits.
This is mostly just changes to make the stuff that goes over the wire
use fixed-size types.


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.6 23-May-1995 mycroft

Remove gratuitous extra indirections.


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

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


# 1.4 08-Jun-1994 mycroft

Update to 4.4-Lite fs code, with local changes.


Revision tags: magnum-base netbsd-0-9-patch-001 netbsd-0-9-RELEASE netbsd-0-9-BETA netbsd-0-9-ALPHA2 netbsd-0-9-ALPHA netbsd-0-9-base
# 1.3 03-Jun-1993 cgd

fix for macklem's bogus use of the va_flags field, supplied by
John Woods, jfwfrom: @ksr.com. also, fixes the following problems:
the va_gen field is in a similar position
(Suns are going to be reporting the change-date microseconds as their
"generation"), I've supplied my own set of diffs below for your inspection.
Note these aren't even compiled, but they're pretty similar to what I had
to do to our older version of OSF/1 here. (There's also an unrelated change
supplied for xdr_subs.h; the pointer types supplied to the fxdr_time() and
txdr_time() macros are not, in fact, both struct timevals. That turns out
to be one of many tips-of-the-iceberg facing those porting the (old) Berkeley
NFS code to 64-bit machines...)


# 1.2 20-May-1993 cgd

more rcs id adding and header cleanup. i like vi macros!


Revision tags: netbsd-0-8 netbsd-alpha-1
# 1.1 20-Apr-1993 mycroft

branches: 1.1.1;
Restore files lost during crash.