Commit Graph

142 Commits

Author SHA1 Message Date
riastradh
338179b531 Use vpanic, not vprintf and then panic. 2020-03-03 06:44:38 +00:00
riastradh
69aded6dbf Report the OS name and release appropriately for NetBSD.
We are not OpenSolaris or uts!
2020-02-19 16:11:19 +00:00
pgoyette
956f25580a Another rename from uvm_free() --> uvm_availmem() 2019-12-31 14:51:29 +00:00
ad
ddd3a0be1e uvmexp.free -> uvm_free() 2019-12-21 13:00:20 +00:00
riastradh
aca9a2fd6e Avoid redefining uint_t &c. if compat_defs.h already defines them. 2019-12-05 03:21:42 +00:00
hannken
c72b1aea36 task_executor: prevent use after free, the task function may free
the tasq entry.
2019-08-20 08:12:50 +00:00
hannken
67361e01b4 Remove unneeded includes. 2019-07-24 16:54:37 +00:00
hannken
b83fa74ac8 Move local changes to files below "external/cddl/osnet/dist/" and
remove now unneeded files from "external/cddl/osnet/sys/sys/".

- sys/sys/bitmap.h -> dist/uts/common/sys/bitmap.h
- sys/sys/callb.h -> dist/uts/common/sys/callb.h

Stop including "cpupart.h", not needed for build.
2019-07-23 07:46:22 +00:00
hannken
f3f87b32db Sync with upstream r315983.
Move files originating from upstream below "dist/":

  OPENSOLARIS.LICENSE -> dist/OPENSOLARIS.LICENSE
  usr.sbin/zdb/zdb.8 -> dist/cmd/zdb/zdb.8
  sbin/zfs/zfs.8 -> dist/cmd/zfs/zfs.8
  sbin/zpool/zpool-features.7 -> dist/cmd/zpool/zpool-features.7
  sbin/zpool/zpool.8 -> dist/cmd/zpool/zpool.8
  include/libintl.h -> dist/head/libintl.h
  include/stdio_ext.h -> dist/head/stdio_ext.h
  include/thread.h -> dist/head/thread.h
  sys/kern/callb.c -> dist/uts/common/os/callb.c
  sys/kern/fm.c -> dist/uts/common/os/fm.c
  sys/sys/extdirent.h -> dist/uts/common/sys/extdirent.h
  sys/sys/isa_defs.h -> dist/uts/common/sys/isa_defs.h
  sys/sys/procset.h -> dist/uts/common/sys/procset.h
  sys/sys/sysmacros.h -> dist/uts/common/sys/sysmacros.h

Adapt "usr.sbin/fstyp/Makefile".
2019-06-24 08:27:19 +00:00
hannken
1a12b22735 Sync with upstream r315983.
FreeBSD splits "zfs_context.h" into:
  "lib/libzpool/common/sys/zfs_context.h" for user space
  "uts/common/fs/zfs/sys/zfs_context.h" for kernel space

Do the same here, move and sync "sys/sys/zfs_context.h" to
"dist/lib/libzpool/common/sys/zfs_context.h" and
"dist/uts/common/fs/zfs/sys/zfs_context.h".

Change "Makefile.zfs" to search includes from "dist/lib"
before "dist/uts" so we get the right include file.

Adapt "usr.sbin/fstyp/Makefile" to get the right include file.
2019-06-22 09:48:39 +00:00
hannken
1c4272293a Sync with upstream r315983. 2019-06-19 08:18:01 +00:00
kamil
3c0a7f49e5 Drop unused retval pointer from do_sys_mknod{,at}()
No functional change intended.
2019-06-18 22:34:25 +00:00
hannken
77431910a1 Unmap pages when zfs_rezget() re-establishes a znode with its dbufs. 2019-06-17 08:08:50 +00:00
hannken
cfba2bba58 There is no 1:1 relation between cv_signal() and cv_timedwait() as
the latter implicitly calls cv_signal() on error.

This leads to "tq_waiting > 0" with "tq_running == 0" and the
taskq stalls.

Change task_executor() to increment and decrement "tq_waiting"
and always check and run the queue after cv_timedwait().

Use mstohz(), fix timeout and sort includes.

Addresses PR port-xen/54273: "zpool create pool xbd2" panics DOMU kernel
2019-06-11 09:05:33 +00:00
hannken
ed2fdc797c Sync with upstream r315983. 2019-06-07 10:31:21 +00:00
hannken
f1690374af Handle files not present upstream:
dist/lib/libshare/common/libshare.h -> sys/libshare.h
dist/uts/common/sys/systeminfo.h    -> sys/sys/systeminfo.h
dist/uts/common/sys/taskq_impl.h    -> TRASH

No functional change intended.
2019-06-06 14:58:50 +00:00
hannken
a4a3cea66e Update the kmem_cache emulation to run its callbacks with
Solaris argument order.

No functional change intended.
2019-05-23 08:32:30 +00:00
hannken
146ae763fd Update ddi environment:
- Put device major numbers into "dev_info_t".
- Fix an off-by-one in zvol_create_minor().
- When creating a node handle existing nodes
  and add owner read/write permission.
- When removing nodes remove now empty directories.
2019-05-22 08:44:48 +00:00
hannken
572f68cd17 Implement the needed part of Solaris lookupname().
Remove unneeded protoype lookupnameat().
2019-05-22 08:42:57 +00:00
hannken
8c4b1be312 Cleanup modules "solaris" and "zfs":
- Defer spa_config_load() until root is mounted.
- Restore the config path to "/etc/zfs/zpool.cache".
- Module "zfs" is type MODULE_CLASS_VFS and no longer depends on "rootvnode".
- Module "solaris" no longer depends on "mp_online".
- Fix rump component registration to not detach "/dev/zfs" if
  it didn't attach it.
2019-05-07 08:51:09 +00:00
hannken
db54d209c2 This implementation of Solaris taskq API is incomplete and doesn't track
Solaris upstream.  FreeBSD already replaced it with a glue to their
taskqueue API.

Replace it with a glue component that queues Solaris taskq requests to
threadpool jobs.
2019-05-07 08:49:59 +00:00
christos
a27520238a use sizeof() properly (gcc-7) 2019-02-06 17:56:57 +00:00
hannken
930703cbc3 Prepare the implementation of the ZFS control directory ".zfs".
- Move the stub routines from zfs_stub.c to zfs_ctldir.c and
  remove now empty file zfs_stub.c

- Add stub routines for zfsctl_loadvnode() to initialize control
  nodes and zfsctl_snapshot() to retrieve ".zfs/snapshot".

- Add an initial vnode operations vector for control nodes.

- Implement lookup into ".zfs" and lookup ".." from ".zfs/snapshot/<snap>".

- Change nodeid of mounted snapshots to the snapshot object id.

- Respect "-u" flag to "zfs rename <snapshot> ...".
2019-02-05 09:54:36 +00:00
pgoyette
d91f98a871 Merge the [pgoyette-compat] branch 2019-01-27 02:08:33 +00:00
hannken
cbfd7da2fc Allow zfs_vn_rdwr() with "rw == UIO_READ" too. 2019-01-12 10:44:36 +00:00
hannken
256b65dcc0 Disable valid assertion "!(flags & TQ_NOQUEUE)" as "zfs send" triggers it. 2019-01-12 10:42:40 +00:00
hannken
0b243f3ebe Don't allow module to init before mp_online. 2018-12-13 10:19:47 +00:00
hannken
02397a5780 Zfs_write() may hide write errors if uiomove() succeeds but a
further dmu_tx_assign() fails because over quota or no space.

Use the emulated uiocopy() and uioskip() like illumos does.

Fix the uiocopy() emulation to not clobber the iovecs.
2018-11-30 09:53:40 +00:00
riastradh
fe26b32950 Use callout_halt, not callout_stop, for FreeBSD callout_drain shim.
Callers expect callout_drain will wait for it to complete if it has
fired.
2018-11-15 05:43:57 +00:00
riastradh
3c01401a94 Omit unused definition with broken cpp conditional. 2018-11-15 04:55:26 +00:00
riastradh
44773f2a69 Define _LP64 or _ILP32 for all architectures.
Rather than write out a table for each architecture, rely on the C
compiler to define _LP64 for 64-bit ones, on the assumption that
anything not LP64 is ILP32, and on CTASSERTs to verify this
assumption so that if it's wrong it'll fail safely with a noisy build
failure.

Gives zfs half a chance of building on, e.g., powerpc.
2018-11-14 17:09:08 +00:00
christos
550eae4327 Avoid conflicts with "our" (the FreeBSD) nvpair/nvlist implementation by
prefixing all symbols with "opensolaris_".
2018-10-23 22:26:14 +00:00
christos
7c0e6d1ccc remove duplicate typedef (it is in sunddi.h) 2018-09-06 00:44:43 +00:00
christos
8f1adcbb03 Add a blurb of a general approach how to maintain these files. 2018-06-03 20:59:49 +00:00
christos
68837537fe The native mutex.h has a userland visible portion. make it so and fix the
build.
2018-06-03 14:56:52 +00:00
chs
bbfe9dbd31 tweak the osnet compat headers to allow building on MacOS and Linux hosts. 2018-06-03 05:55:08 +00:00
christos
5a38769f09 - Remove more extraneous includes to avoid circular dependencies with the
real header files.
- Add <sys/errno.h> to <sys/systm.h> to avoid changing the source, but
  it should really belong to the source.
2018-06-02 18:46:34 +00:00
christos
50f0215b97 don't include <sys/proc.h> 2018-06-02 15:47:22 +00:00
kre
c0824e2dbe Avoid duplicate typedefs so these headers can be used
as part of tools build, when the base system compiler does
not allow duplicate type definitions.

Someone please fix this some better way than this!
2018-06-01 00:56:19 +00:00
chs
ba2539a980 merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
 - dtrace FBT probes can now be placed in kernel modules.
 - ZFS now supports mmap().
2018-05-28 21:04:59 +00:00
christos
bacfdb6969 add casts 2018-01-07 20:02:52 +00:00
kre
4464b377cc Let's define symbols before using them. 2017-11-18 18:52:59 +00:00
christos
3be9d673a3 use symbolic constant for 0 2017-11-18 13:51:56 +00:00
christos
114ddb80d3 our pool code needs either PR_SLEEP or PR_NOWAIT; arrange for that explaining
the current choice :-)
2017-11-17 18:18:01 +00:00
christos
3391c5f1a7 fix a few warnings. 2017-01-10 19:20:34 +00:00
christos
67442b909a PR/51118: Jared McNeill: Fix build on FreeBSD by removing osnet assert.h
and sys/limits.h and use sys/syslimits.h directly.
2017-01-07 21:39:52 +00:00
pgoyette
df0e13d590 On NetBSD we already have strpbrk() in libkern, so we don't need to
provide another copy in the module.  Removes another 'redefined symbol'
error when loading the module.

Related to PR kern/51265
2016-06-23 05:19:42 +00:00
christos
d7245a7577 include stdio.h for NULL 2016-04-28 11:45:02 +00:00
christos
efcb6e5b0c Split the opensolaris types into opentypes.h because linux includes
sysmacros.h from types.h and we can't interpose ourselves to define
the needed types otherwise.
Disable unused macros, get rid of __APPLE__
2016-02-01 02:12:55 +00:00
christos
d3b8f3fc89 prevent re-defines 2016-02-01 02:09:54 +00:00