missed one place to set dirent namelen - unmiss it
Match code with comment (can't really remember doing it often that
way around .. ) and initialize storage to zero when extending a file.
Don't allow getcwd() on procfs vnodes and provide "/" as the path
instead of the result from getcwd().  The works around locking
panics caused by namei calling VOP_READLINK while holding on to a
directory lock and getcwd() trying to acquire that lock.  The real
fix would be to get rid of getcwd() calls within VOPs (not locking
safe), but that's not a viable option in the netbsd-4 timeframe.

Suggestion for workaround from David Holland.
WARNS=4, pass lint
Fix the last point reported by yamt in PR kern/36673:

- There must be three mandatory objects in a sensor to be valid and be
  enabled on its dictionary: units, state and desc. If any of these
  objects fails for some reason, its dictionary won't created in the
  array and sensor will be marked with ENVSYS_FNOTVALID in edata->flags.

  That means there won't never be a partial dictionary.

- Mark all invalid sensors and sensors with duplicate description with
  ENVSYS_FNOTVALID and remove ENVSYS_FDUPDESC. The former is the generic
  way to say that a sensor does not obey the rules and must be not
  created.

- sysmon_envsys_createplist: if the array does not contain any object,
  release the array and return the error.

And with all that stuff I can go to holidays and be happy.
Keep track of the maximum size we have supplied the file server (or
it has supplied us).  If we fault pages which are at offset >= server
size, but less than the in-kernel vnode size, inform the file server
of the latest developments in file size before issueing the fault.
The avoids confusion with files which are not written start to finish.

fixes kern/36429 by yamt
Update to catch some problems that I just fixed in the framework. The
following test cases were fixed if a driver tries to register a driver
with sysmon_envsys_register() and the following items appear:

- Sensor with empty description.
- Sensor with state that doesn't match any of ENVSYS_SFOO.
- Sensor with units type that doesn't match any of ENVSYS_FOO.
use NULL, not 0, to pass a pointer
Retire uvn_attach() - it abuses VXLOCK and its functionality,
setting vnode sizes, is handled elsewhere: file system vnode creation
or spec_open() for regular files or block special files, respectively.

Add a call to VOP_MMAP() to the pagedvn exec path, since the vnode
is being memory mapped.

reviewed by tech-kern & wrstuden
Explicitly include <sys/proc.h> for tsleep() declaration.
Explicitly include <sys/proc.h> for tsleep() prototype.
When _KERNEL is defined, we have now grown a dependency on
<sys/proc.h>, since one of the inline functions now refer to curlwp.
Fix this by including <sys/proc.h> when _KERNEL is defined.
Add missing RCSID.
Introduce WILLMAKE for vnode operations which create a new vnode.
Insert a KASSERT along the return path of such operations to check
that the operation set the vnode size.
regen: assert that vnode creating operations set the size
Remove newline from format string of aprint_normal.

Thanks to pooka@ for pointing it out.
sprinkle (vaddr_t) to deal with sizeof(paddr_t) != sizeof(void *)
Now the loader should build again.
Remove printf for debugging.
Set union vnode size when creating a vnode.

fixes kern/36679 by Geoff C. Wing
- sysmon_envsys_createplist: do not return the error of sme->sme_gtredata
  in all cases to the caller, just continue and show a debug printf if it
  fails, because it's not a critical error.

- Improve some debugging printfs.

Fixes another part of yamt@'s PR kern/36673, that I forgot to commit
yesterday.