nor why it uses &p0 as a magic constant (rather than NULL).
Re-instate the definition of p0, but enable the 'fake' definition
of 'struct proc' if the relevant part of sys/proc.h seems to have
been #if'ed away.
Should fix the build.
Solaris returns EEXIST, whereas we want to return ENOTEMPTY (POSIX
allows both), but this got included in an unrelated commit and should
be separated into a common commit for other related error code fixes.
zfs_access uses secpolicy_vnode_access, so it makes no sense for the
latter to call VOP_ACCESS!
Everything seems to return EACCES instead of EPERM, probably because
that's what kauth returns. This should be fixed, but that may
require some nontrivial surgery to zfs's calls to secpolicy_*, which
is where kauth gets involved.
This commit imports some code from illumos to implement the routine
secpolicy_vnode_setattr. This shouldn't be outside dist/, but for
now it is expedient to do so. We ought to fix that, along with all
the other CDDL code outside dist/, when we next import a newer
version of zfs.
Don't try to zget the parent, whose znode id may have been recycled
by now.
It's not clear to me how Solaris avoids this, but maybe I'm just
missing something obvious.
- Restore some zfs locking and unlocking that got lost randomly.
- Enable use of the BSD vnode lock. Lock order: all BSD vnode locks
are taken before all zfs internal locks. There remains an issue with
O_EXCL, to be solved later (famous last words). KASSERT the locking
scheme up the wazoo.
- Take our cruft out of zfs_lookup and move it to zfs_netbsd_lookup.
Restore much of the way zfs_lookup looked to make merging future
versions easier. Disable use of the namecache for now because its
locking dance is too scary to contemplate.
- Implement BSD semantics for rename, to appease our tests. This is
a provisional kludge; eventually we need VOP_RENAME to take a flag
specifying whether to use BSD semantics or POSIX semantics.
- Simplify zfs_netbsd_reclaim and make it work. Now that getnewvnode
never tries to vclean anything itself, we need not worry about
recursion of ZFS_OBJ_MUTEX locks.
- Clarify and fix genfs node initialization and destruction.
zfs passes most of our atf vfs tests now, including the rename races.
Still to do:
- fix the impedance mismatch between our permissions model and zfs's;
- fix O_EXCL (nontrivial);
- throw dirconc at it and see how badly it explodes;
- find why zpool sometimes wedges itself during mkfs; and
- find why pool caches sometimes seem to get corrupted.
Avoid cv_broadcast(&cv); cv_destroy(&cv); which works in Solaris only
by abuse of the condvar abstraction.
There are parts of this code that should be factored into smaller
subroutines, mainly range lock allocation and initialization, but
that would make it harder to merge newer versions of zfs, so for now
I've just expanded those parts further in-line.
Solaris relies on cv_broadcast(&cv); cv_destroy(&cv) working, but
that hoses our cv_wait, which needs to continue using cv after it is
woken. Solaris's idiom is an abuse of the condvar abstraction, but
we can get the same effect with reference counting.
rename "xcpu" back to "cpu" now that the conflicting global variable
has been renamed out of the way. this also fixes some cases
where references to the local variable "cpu" had not been renamed
and thus were accidentally referring to the former global "cpu".
caches, merge together pool_drain_start() and pool_drain_end() into
bool pool_drain(struct pool **ppp);
"bool" value indicates whether reclaiming was fully done (true) or not (false)
"ppp" will contain a pointer to the pool that was drained (optional).
See http://mail-index.netbsd.org/tech-kern/2012/06/04/msg013287.html