sys/cddl: Remove CTLFLAG_MPSAFE flag

Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
sys/cddl: Freebsd uses CTLFLAG_RDTUN here

DragonflyBSD does not provide 'early only' read-only tunable.
Hence use suboptimal CTLFLAG_RW flag.

Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
sys/cddl/compat: Lockup {rwlock,mutex}.h with mutex(9)

Convert FreeBSD SX(9) locks to DragonflyBSD MUTEX(9) locking.
With one caveat that an equivalent of:

 struct thread * sx_xholder(struct sx *sx);

in SX(9) is a pointer to struct member 'mtx_owner' in the
main struct mtx of MUTEX(9), and so we return that value.

Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
arc.c: use curthread,pagethread over curproc,pageproc

Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
sys/cddl/*/zfs/arc.c: Port to DragonflyBSD

DragonflyBSD has a different in-kernel threading model,
somethings are named a little differently:

FreeBSD -> DragonflyBSD

 vm_cnt.v_free_count  -> vmstats.v_free_count
 vm_cnt.v_cache_count -> vmstats.v_cache_count
 vm_cnt.v_page_size   -> vmstats.v_page_size

Also,

  td_ru.ru_inblock -> lwp_ru.ru_inblock

Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
sys/proc.h: hack in PRIBIO,PVM vals to continue..

REVIST XXX

Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
sys/cddl: Port vm_cnt.xxx to vm_stats.xxx

Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
sys/cddl: Fixup td_ru is not a member of 'struct thread'

Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
sys/cddl: Change 'CTLTYPE_U64' -> 'CTLTYPE_UQUAD'

Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
sys/cddl/Makefile: define _PROPLIB_ZFS_CONFLICT avoids type-conflict

Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
sys/cddl: Fix type-signature in dmu.h

Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
sys/sys/conf.h: Missing NOBODY uid/gid pair

Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
sys/cddl/compat: Redudant define in vfs.h

Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
sys/cddl: Rename curcpu -> mycpuid

Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
sys/cddl/compat: Remove conflicting opensolaris_utsname type

struct utsname is already defined in 'sys/sys/utsname.h'.

Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
sys/cddl: No need to pass lock type to VFS_ROOT()

Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
sys/cddl: Strip out 'extern vmem_t *zio_alloc_arena'

Does not seem to be used and just keeps build.

Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
cddl: Internalise VOP_GETATTR to __VOP_GETATTR to avoid conflict

REVIST

Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
sys/cddl: Missing include in dmu.h

Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
sys/cddl: dmu_{diff,send}.c Fixup bwillwrite() call sites

DragonflyBSD expects a integer parameter to bwillwrite() with
the number of bytes we expect to write.

REVIST this.

Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>