Commit Graph

880 Commits

Author SHA1 Message Date
brad 2e0a32871b Add USE_SHLIBDIR=yes to a number of Makefiles for the libraries used
by /sbin/{zfs,zpool,mount_zfs}.  The general effect is to move them
from /usr/lib to /lib.  Compatibility links are installed in /usr/lib
and nothing that is installed, say in /usr/pkg, appears to break.

With this, it is possible to have a /var and /usr mount using ZFS
legacy mounting early on in the boot process.

Run tested on amd64 and i386 and compile tested on evbarm.
2019-09-22 18:45:19 +00:00
sevan 69d856e495 Use Pa macro for path
new sentence, new line
2019-09-20 22:47:36 +00:00
brad 5aa9b9d41e Add a copyright to the man page and a bit of history. 2019-09-20 22:38:28 +00:00
wiz 67060edf74 Use more markup. 2019-09-16 04:57:12 +00:00
gutteridge a55674ceb3 mount_zfs.8: add xref to fstab(5) 2019-09-15 20:51:52 +00:00
brad 12ea0a140d Add support for legacy ZFS filesystems, specified by mountpoint=legacy
in the ZFS properties of the dataset and a simple man page for
mount_zfs.  With this, it is possible to put ZFS filesystems in
/etc/fstab as file system type zfs.

Add a rc.d script that kicks the module ZFS load mostly before
mountall runs simular to what LVM does.  This allows for any legacy
mounts to be specified in critical_local_filesystems and allows for
ZFS pools on top of cgd (probably among other things).  Introduce a
rc.conf variable called zfs which needs to be set to YES, in the usual
manor of things, to get zvols and ZFS dataset support rather then just
assume that 'zfs mount' does that in mountall.  Fix a problem in
mountall if ZFS is not compiled into the system.
2019-09-15 19:38:08 +00:00
hannken 65d6baaaeb Add missing dmu_zfetch_fini() when dnode_create() lost the race. 2019-08-24 12:59:34 +00:00
hannken 799f938b54 Implement kqueue support. 2019-08-24 12:59:05 +00:00
hannken ace58db59c Implement poll support. 2019-08-24 12:58:24 +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 ae0ee8779d Rearrange the evaluation of "dvd_maxphys" so it works for wedges too. 2019-08-20 08:12:14 +00:00
hannken 9075f3bd2d Always open the raw block devices as "<device><unit>" like it
comes from sysctl "hw.disknames" without attaching the raw
partition letter.  Now pools on wedges get imported too.
2019-08-20 08:11:21 +00:00
hannken 97faa474a9 Add missing "defined(__NetBSD__)" to make "zfs promote" work. 2019-08-13 08:03:25 +00:00
maya b214c01f05 validate the length of args (like other filesystems)
ok riastradh
2019-08-07 20:45:53 +00:00
hannken 706360a664 Handle automatic module loading on device open more like FreeBSD does.
Where FreeBSD uses a module "dtraceall" that depends on all dtrace
modules we now load the basic set "dtrace sdt fbt syscall" on open.
2019-07-24 16:57:45 +00:00
hannken 67361e01b4 Remove unneeded includes. 2019-07-24 16:54:37 +00:00
hannken d233d0f45b Create "dtrace_taskq" here like FreeBSD does.
PR kern/54397: Panic when loading a DTrace module whilst DTrace is running
2019-07-23 09:06:12 +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 c7790bc1b7 Always use "netbsd" as kernel name, dt_module_update() already takes
care to load data from the booted kernel image.
2019-07-21 15:38:06 +00:00
hannken f705610493 Try to load module "dtrace" before opening "/dev/dtrace/dtrace".
Fixes PR kern/54387: DTrace Kernel module does not autoload on first use ...
2019-07-21 15:37:27 +00:00
hannken bb86f86314 XXX: A crude hack to bring down the number of types for a
GENRIC kernel below 2**15-1 (from ~34000 to ~29800).

Remove the type attributes "volatile", "const" and "restrict",
for DTRACE these attributes are of little value.
2019-07-16 07:27:35 +00:00
hannken 9112aa41cd Add fixup operation to remove private mutex types for x86.
For GENERIC the number of types goes down from 47351 to 33981.
2019-07-16 07:26:41 +00:00
hannken fcc1d7b138 Always exclude "fbt_*" from the list of FBT probes. 2019-07-16 07:26:00 +00:00
hannken 19f44db6df Change dtrace toxic range to "0 .. VM_MIN_KERNEL_ADDRESS_DEFAULT",
the direct map may be mapped below "VM_MIN_KERNEL_ADDRESS".
2019-07-05 08:29:18 +00:00
hannken 30c4137c4d Change module type to "MODULE_CLASS_MISC" to allow preloading.
Change "dtrace_nullop()" to return zero, it gets casted to "int (*)(...)".
2019-07-05 08:28:52 +00:00
sevan 168837a76f Add rcsid 2019-06-29 20:50:01 +00:00
hannken 544f1cdcc6 import new CDDL dtrace and ZFS code from FreeBSD svn r315983
Add files missing from the initial import.
2019-06-26 11:47:53 +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 9c87a63a8c Disable assertion: illumos 7793 ztest fails assertion in dmu_tx_willuse_space 2019-06-21 10:59:50 +00:00
skrll ebc5b22cbe Toolify 2019-06-20 14:33:04 +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 490062b29c Add native vfs_suspend()/vfs_resume() before and after
zfs_suspend_fs()/zfs_resume_fs() and get rid of dead "z_sa_hdl == NULL"
znodes before vfs_resume() to keep the vnode cache consistent.

Live rollback should work now.

PR port-xen/54273 ("zpool create pool xbd2" panics DOMU kernel)
2019-06-17 08:09:57 +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 566111e6f4 Add fstrans_start()/fstrans_done() and bounds check to zfs_netbsd_getpages(). 2019-06-17 08:08:21 +00:00
hannken 3202242d92 Skip atime update on dead "z_sa_hdl == NULL" znodes. 2019-06-17 08:07:56 +00:00
kamil 2b1dd5795a Fix build with -Wgnu-designator in the ZFS code
struct buf buf = { b_bcount: MAXPHYS }; is a legacy style designator
extension and this raised a compiler error reported by a.rin@mix.
2019-06-12 04:20:18 +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 94984370e5 Try to retrieve the per-disk maximum transfer size and use it instead
of MAXPHYS.  Eagerly waiting for the merge of tls-maxphys.

Addresses PR port-xen/54273: "zpool create pool xbd2" panics DOMU kernel
2019-06-11 09:04:37 +00:00
hannken ed2fdc797c Sync with upstream r315983. 2019-06-07 10:31:21 +00:00
hannken f96d3fedeb Remove "dist/cmd/stat" containing only one left over and unneeded file. 2019-06-06 15:59:23 +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 58fcc332f4 Switch module solaris to native XDR. 2019-06-05 16:28:06 +00:00
hannken e8ace0777f Use native XDR for libnvpair in userland. 2019-06-04 08:45:17 +00:00
hannken a26bd2a865 upport wedges as vdevs, use DIOCGWEDGEINFO before DIOCGPARTINFO.
PR kern/54219 zpool create pool dk5 causes kernel panic
2019-05-26 10:22:59 +00:00
hannken 0d3564d150 Add missing part of kmem_cache cleanup. Use Solaris argument order for
kmem_cache destructors, umem_cache_alloc() and umem_cache_free() too.
2019-05-26 10:21:00 +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 c54265e62b Implement disk_rename()/iostat_rename() to rename a disk.
Use it from zvol_rename_minor() when renaming a ZVOL.
2019-05-22 08:47:02 +00:00
hannken 72cdecc56a Add missing zvol_close() to zfsdev_close().
Change zvol_size_changed() to initialize "zv->zv_volsize"
and initialize only "dg_secsize" and "dg_secperunit".
Calling disk_set_info() will initialize the remaining
parts of the geometry.

Set "doread" in zvol_strategy() to make reading from
device possible.

Reorganize/add disk_busy()/disk_unbusy() instrumentation.

Redo zvol_ioctl() to implement DIOCGWEDGEINFO and let
disk_ioctl() process the remaining ioctls.
2019-05-22 08:46:27 +00:00
hannken da01880b38 Enable the zvol minor management to create and remove device nodes. 2019-05-22 08:45:32 +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
hannken d609d7d444 Add support for fifos, character and block devices. 2019-04-15 12:59:38 +00:00
hannken b75299830a Make ZFS exportable by NFS, implement zfsctl_vptofh(),
zfs_netbsd_vptofh() and zfs_netbsd_fhtovp().

Undo changes to now completely unused zfs_fhtovp().
2019-03-18 09:22:14 +00:00
hannken adb2c81d25 Implement zfsctl_lookup_objset() to look up "zfsvfs" of an mounted snapshot. 2019-03-18 09:21:31 +00:00
hannken a9b5e877b6 Set "mnt_stat.f_fsid" and "mnt_stat.f_fsidx" from the objset guid
like FreeBSD and Illumos do.

Use "f_fsid" for "va_fsid" and cheat NFSD to export snapshots under
".zfs" by setting these snaphots "f_fsidx" to the parents "f_fsidx".
2019-03-18 09:20:58 +00:00
hannken 80fc19ea39 As zfs_netbsd_getpages() ignores "a_count" and processes exactly one page
return an error if "a_count != 1".
2019-03-18 09:20:15 +00:00
hannken 94e5a2a219 Change zfs_readdir() to use malloc() instead of kmem_alloc() to
allocate cookies.  Required by protocol, caller uses free().
2019-03-18 09:19:39 +00:00
kamil e7e18034ff Reserve DTrace sdt and fdt major numbers
Register cmajor 252 for fbt and 253 for sdt.

Previously the major number was picked randomly and it causes conflicts
with preallocated values for different devices.
2019-03-09 18:53:52 +00:00
hannken 44e38a6483 Always set "cn_namelen" in addition to "cn_nameptr".
Fix vnode locking for REMOVE, RMDIR and RENAME.
2019-02-22 09:01:32 +00:00
hannken 583a153e11 Move fstrans_unmount() to vfs_rele(), just before it would free the mount.
Don't take a mount reference for fstrans as it gets notified about the release.

Defer the final free of the mount to fstrans_mount_dtor() when fstrans
has released all references to this mount.  Prevents the mount's memory
to be reused as a new mount before fstrans released all references.

Address PR kern/53928 modules/t_builtin:disable test case randomly fails.
2019-02-20 10:08:37 +00:00
rin d7e5ad524a Fix DIAGNOSTIC build; replace FreeBSD-specific function with ours. 2019-02-13 08:46:40 +00:00
rin 1f6814c121 Fix build with DIAGNOSTIC:
ASSERT() is enabled ifdef DEBUG, not DIAGNOSTIC.
2019-02-12 14:31:45 +00:00
tnn 7d56d81472 -Wno-format-truncation is only needed when using GCC 2019-02-11 17:49:37 +00:00
christos a27520238a use sizeof() properly (gcc-7) 2019-02-06 17:56:57 +00:00
christos d5c5b6e7a1 uses the idiom len = snprintf(&tmp, 1, ...) to compute length.
needs -Wno-format-truncation
2019-02-06 04:23:16 +00:00
hannken bd6f3d517a Implement the ZFS control directory ".zfs" and its subdirectory 'snapshot".
Automatically mount snapshots on access of ".zfs/snapshot/<snapname>".
2019-02-05 09:55:48 +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
hannken 2b2eb8edaf zfs_netbsd_reclaim(): validate "z_log" before zil_commit(). 2019-02-05 09:50:18 +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 8027df3b0b Pass unmount flags down to syscall, "zfs unmount -f" now works. 2019-01-12 10:44:05 +00:00
hannken 1917967c61 The ZFS onexit routines expect opening ZFS_DEV with O_EXCL to return
a cloned device with an unique minor number.

Use fd_clone() on this condition to return a cloned device descriptor.
2019-01-12 10:43:33 +00:00
hannken 256b65dcc0 Disable valid assertion "!(flags & TQ_NOQUEUE)" as "zfs send" triggers it. 2019-01-12 10:42:40 +00:00
hannken b7f32ae1de Need FOF_UPDATE_OFFSET to update the offset on plain files.
Running "zfs send" to plain files no longer writes garbage.
2019-01-12 10:42:09 +00:00
hannken ddb2d27412 There is no such function read_rflags(), probably meant x86_read_flags(). 2019-01-12 10:41:31 +00:00
hannken f62cfdb432 Even though zfs_netbsd_putpages() cannot use ZFS_ENTER() it has
to respect the teardown lock.

Enter z_teardown_lock as reader and ZFS_EXIT().

Instead of ZFS_VERIFY_ZP() return without writing and without
error from zfs_putapage() if "z_sa_hdl == NULL".
2019-01-05 09:20:29 +00:00
hannken 467c245f51 Cannot use ZFS_ENTER() / ZFS_EXIT() as zfs_netbsd_putpages() is used
during vnode reclaim.

Add missing protection with fstrans.
2019-01-01 10:09:26 +00:00
hannken c28128baab As already noted in XXX comment do a zil_commit() on reclaim. 2019-01-01 10:08:42 +00:00
hannken 5836607404 Cannot hold zfs object across call to vcache_get() as it might
deadlock with another reclaim.

Add vfs operation zfs_newvnode() to create a new zfs node and
hold the zfs object in zfs_loadvnode() and zfs_newvnode() only.
2019-01-01 10:08:00 +00:00
hannken 2595f06922 Drop v_interlock for zfs_range_lock(), another thread might hold part
of this range and wait for v_interlock.
2018-12-13 10:20:51 +00:00
hannken 398893d51c Operation zfs_range_lock() needs range as (offset,length), not as (low,high). 2018-12-13 10:20:20 +00:00
hannken 0b243f3ebe Don't allow module to init before mp_online. 2018-12-13 10:19:47 +00:00
sevan a8174c34c4 Describe how unaccounted changes are detected without Star Trek references, for
everyone in 2018.

Thanks to maya & gdt
2018-12-10 03:58:30 +00:00
christos ddcb7de5af fix printf warnings. 2018-12-09 18:01:01 +00:00
sevan 861b7e9a71 Spelling 2018-12-08 14:55:53 +00:00
wiz e1f1a9870c Improve man page. 2018-12-08 12:18:37 +00:00
sevan 23472bf8b1 Include ztest(1) in builds. 2018-12-08 01:47:21 +00:00
sevan ee544a8d7f Add a draft manual for ztest(1), based on the comments from zfstest.c (WIP). 2018-12-08 01:28:27 +00:00
hannken e9166d7318 We have component names as counted strings (cn_nameptr, cn_namelen) but
ZFS expects a null-terminated name.

Always create a copy with PNBUF_GET()/strlcpy()/PNBUF_PUT().

For LOOKUP use a small buffer on stack and allocate/free compomnent names
longer than 30 chars.
2018-12-06 10:00:40 +00:00
hannken b4b8646326 Add missing ZFS_OBJ_HOLD_ENTER() / ZFS_OBJ_HOLD_EXIT() to zfs_zget_cleaner(). 2018-12-06 09:58:52 +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
hannken 6ac427e315 Redo the access check for setting va_flags in zfs_netbsd_setattr().
Use user flag UF_NODUMP instead of UF_IMMUTABLE for the test as it
is the only user flag supported by all tested file systems.

PR kern/47656 test zfs_flags.
2018-11-28 10:01:28 +00:00
hannken e4ec60fc8e Add missing access check for REMOVE into zfs_netbsd_lookup().
PR kern/47656 test zfs_dirperms.
2018-11-28 09:58:58 +00:00
hannken 5cbc5ce853 Add missing access check for setting va_Xtime into zfs_netbsd_setattr().
PR kern/47656 test zfs_times.
2018-11-28 09:57:59 +00:00
hannken 1d96c4a33f We expect VOP_ACCESS() to return EACCESS as general error.
Change zfs_netbsd_access() to translate the common EPERM to EACCES.
2018-11-28 09:57:16 +00:00
hannken bc6110ce9c Don't try to release a NULL vnode in zfs_netbsd_rename(). 2018-11-28 09:56:40 +00:00
hannken 29da203472 Remove an early test for "source and target are equal" from zfs_rename()
that broke BSD semantics.
2018-11-28 09:56:09 +00:00
hannken 6d68550383 Add missing sa_buf_rele() into zfs_zget_cleaner(). 2018-11-28 09:55:36 +00:00
hannken 1f58a7d1b1 Always unbusy pages in zfs_putapage() after the data has been written
into the DMU.  Running fsx no longer hangs the kernel.
2018-11-28 09:55:06 +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 c3426bd36f Need <dev/mm.h> for mm_md_direct_mapped_phys.
It turns out this code always sees __HAVE_MM_MD_DIRECT_MAPPED_PHYS as
disabled on amd64, for reasons that I shall address forthwith, but it
is enabled on aarch64 and so the MKZFS=yes build breaks.
2018-11-15 04:55:49 +00:00
riastradh 6af8fc2044 Be consistent about _KERNEL vs _HARDKERNEL in zfs.
As it happens, on x86 both _HARDKERNEL and _KERNEL get defined; see
the conditional in sys/rump/Makefile.rump that _refrains_ from
defining _RUMPKERNEL on x86.

So the only version of this code that has been tested is the one with
all of it included.  But on, e.g., aarch64, we do not get _HARDKERNEL
here, and the code fails to build because some things use the field
struct spa::spa_deadman_cycid under _KERNEL when it is declared only
under _HARDKERNEL.

If there's a reason _not_ to use this in rump -- and it's not obvious
to me why -- then all access to the field needs to agree to use
_HARDKERNEL.
2018-11-15 04:55:38 +00:00
riastradh 3c01401a94 Omit unused definition with broken cpp conditional. 2018-11-15 04:55:26 +00:00
riastradh ec4edf7a44 Omit conflicting definition that breaks build on aarch64. 2018-11-15 04:55:17 +00:00
riastradh 30279c00db "PRIu64", not llu, to print uint64_t. 2018-11-15 04:55:06 +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 b87aa2b0b0 prefix all nv* symbols with opensolaris_ 2018-10-23 22:25:21 +00:00
sevan 1982879545 Sync with version on Brendan's site
http://www.brendangregg.com/DTrace/iosnoop
2018-10-01 13:28:07 +00:00
sevan bee48df196 Fix comment markers.
https://github.com/opendtrace/toolkit/issues/11
2018-09-29 19:40:58 +00:00
martin b30151731a Do not initialize .vfs_fhtovp twice 2018-09-16 06:09:01 +00:00
christos be58bd6f37 The macros kidmap_getsidby{u,g}id always return 1 from sid.h on NetBSD,
and clang is complaining about the impossible... So initialize rid and
be done with it, it is the least intrusive fix.
2018-09-14 19:06:53 +00:00
christos 3085e9459c handle clang stupidity 2018-09-07 02:25:40 +00:00
christos 7c0e6d1ccc remove duplicate typedef (it is in sunddi.h) 2018-09-06 00:44:43 +00:00
riastradh d1579b2d70 Rename min/max -> uimin/uimax for better honesty.
These functions are defined on unsigned int.  The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.

HOWEVER!  Some subsystems have

	#define min(a, b)	((a) < (b) ? (a) : (b))
	#define max(a, b)	((a) > (b) ? (a) : (b))

even though our standard name for that is MIN/MAX.  Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.

To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.

I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:

cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))

It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate.  But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all.  (Who knows, maybe in some cases integer
truncation is actually intended!)
2018-09-03 16:29:22 +00:00
christos 49c18b3098 Avoid uninitialized warning. 2018-08-20 06:47:16 +00:00
christos 54ddcf50a8 use the right variables (fix cut-n-pastos) 2018-08-18 12:00:11 +00:00
christos 3d1aec003a make sure rid and idx are initialized. 2018-08-18 11:59:25 +00:00
christos 4122fc0e66 vdev_inuse might not be called and spare_guid contains random stuff. 2018-08-18 11:58:59 +00:00
christos 2df913e657 get rid of kernelbase 2018-08-16 14:14:51 +00:00
christos bb6b99b5bf handle variable kernel vm min address 2018-08-12 16:07:27 +00:00
hannken 1471f8ff92 Initialize z_lockf for new znodes.
Ok: Chuck Silvers
2018-07-31 09:33:50 +00:00
maxv 753a273974 Replace KERN_BASE by VM_MIN_KERNEL_ADDRESS. Also add XXX on INKERNEL. 2018-07-27 07:32:59 +00:00
kamil cd35dc3d84 Rework the changes to DTRACE/ZFS files that were fixing Clang/LLVM build
Rever changes to upstream files and replace them with additional -Wno-
compiler argument flags.

Tested with base LLVM.

Requested by <chuq>
2018-06-29 11:33:46 +00:00
gson 7c2276b8da Use space between words 2018-06-16 15:18:33 +00:00
maya 93c55cb558 Avoid declaring ulonglong_t.
Comment here already says it isn't necessary and will be removed.
Hasten the process for us and avoid the problematic typedef.

This is useful because u_longlong_t would otherwise need to be
provided by compat headers.
2018-06-13 04:21:21 +00:00
kamil d2d2a14700 Replace HAVE_GCC with ACTIVE_CC == gcc checks
Kernel modules build with GCC and Clang/LLVM.

Requested by <joerg>
2018-06-07 13:21:44 +00:00
kamil 60490a027e Correct compilation of osnet/dev/systrace/systrace.c under Clang
Mark arguments to dtrace_probe_lookup() with __UNCONST().
The proper fix constifying it causes pollution of const in too many files.

This could be done with -W flags, but they are incompatible between
compilers.

This is a step forward functional MKLLVM=yes HAVE_LLVM=yes build.

Sponsored by <The NetBSD Foundation>
2018-06-06 17:47:10 +00:00
kamil 3982d87926 Correct compilation of osnet/dev/profile/profile.c under Clang
Constify char* types when initialized with liternals.

This could be done with -W flags, but they are incompatible between
compilers.

This is a step forward functional MKLLVM=yes HAVE_LLVM=yes build.

Sponsored by <The NetBSD Foundation>
2018-06-06 17:19:49 +00:00
kamil afef2ab3de Correct compilation of osnet/dev/dtrace/x86/dis_tables.c under Clang
Constify dgr_suffix.

This could be done with -W flags, but they are incompatible between
compilers.

This is a step forward functional MKLLVM=yes HAVE_LLVM=yes build.

Sponsored by <The NetBSD Foundation>
2018-06-06 17:16:56 +00:00
kamil 9a546da821 Correct compilation of osnet/dev/dtrace/dtrace_hacks.c under Clang
Use __UNCONST() to remove const from an argument.

This could be done with -W flags, but they are incompatible between
compilers.

This is a step forward functional MKLLVM=yes HAVE_LLVM=yes build.

Sponsored by <The NetBSD Foundation>
2018-06-06 15:54:03 +00:00
kamil 03c04814f0 Correct compilation of osnet/dist/uts/common/dtrace/dtrace.c under Clang
Add missing const keywords in dtrace_strncmp().

Initialize lim1 and lim2 to zero always. This prevents a false positive
about potentially unset but used variable.

This could be done with -W flags, but they are incompatible between
compilers.

This is a step forward functional MKLLVM=yes HAVE_LLVM=yes build.

Sponsored by <The NetBSD Foundation>
2018-06-06 15:24:57 +00:00
kamil ec5a3bbdb8 Swap conditions HAVE_LLVM -> HAVE_GCC 2018-06-06 15:01:13 +00:00
kamil 76b9fb4568 Make cddl/osnet/Makefile.zfs compatible with MKLLVM=yes
Clang/LLVM does not recognize:
 - -Wno-discarded-qualifiers

This is a step forward functional MKLLVM=yes HAVE_LLVM=yes build.

Sponsored by <The NetBSD Foundation>
2018-06-06 14:47:54 +00:00
kamil 8627ada168 Correct compilation of osnet/dist/cmd/dtrace/dtrace.c under Clang
Add missing const keywords.

This could be done with -W flags, but they are incompatible between
compilers.

This is a step forward functional MKLLVM=yes HAVE_LLVM=yes build.

Sponsored by <The NetBSD Foundation>
2018-06-06 14:46:58 +00:00
kamil 54f848644c Make cddl/osnet/usr.sbin/dtrace -W compatible with MKLLVM=yes
Clang/LLVM does not recognize:
 - -Wno-discarded-qualifiers
 - -Wno-unused-but-set-variable

This is a step forward functional MKLLVM=yes HAVE_LLVM=yes build.

Sponsored by <The NetBSD Foundation>
2018-06-06 14:31:45 +00:00
kamil 38533b841d Make cddl/osnet/lib/libdtrace buildable with MKLLVM=yes
Clang/LLVM does not recognize:
 - -Wno-maybe-uninitialized
 - -Wno-unused-but-set-variable

MKGCC=yes still builds the distribution.

This is a step forward functional MKLLVM=yes HAVE_LLVM=yes build.

Sponsored by <The NetBSD Foundation>
2018-06-06 14:18:39 +00:00
christos cc268b724c remove <sys/proc.h> done in the dtrace header now. 2018-06-05 12:04:19 +00:00
christos 61c2ab4099 add <sys/proc.h> because the header needs proc_t kthread_t etc. 2018-06-04 21:36:03 +00:00
christos fbc4edde8d better to put this (<sys/proc.h>) in the dtrace header where the definitions
are needed.
2018-06-04 21:35:29 +00:00
kre fea21eb07e The (dtrace version of) <sys/proc.h> is needed for kthread_t
(same as the amd64 version).   This should fix (one of) the
current i386 build breakages.
2018-06-04 20:12:45 +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
chs 01d6e97218 avoid calling kpause() with a delay of 0. 2018-06-03 03:05:56 +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
christos a4bb88f1bb Use a constant to prevent dynamic array allocation which messes up SSP. 2018-06-02 01:19:46 +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
kre 12c661f52d Build fix attempt, use TOOL_AWK (with fallback to "awk") rather than "nawk". 2018-05-29 01:09:49 +00:00
chs 710a39faba add some new files missed by my script:
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 23:47:39 +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
chs 3227e6cf66 import new CDDL dtrace and ZFS code from FreeBSD svn r315983. 2018-05-28 20:52:50 +00:00
christos bacfdb6969 add casts 2018-01-07 20:02:52 +00:00
christos 7eaaf56ed8 add trivial handling for DW_ATE_UTF, does not work. 2017-12-31 03:08:49 +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 7de85f86e1 kill another wrong ELFSIZE setting. 2017-11-06 04:43:50 +00:00
christos eed7a256a0 need to undef KERN_ELFSIZE too here... 2017-11-06 03:51:37 +00:00
sevan 35823e7391 Include scripts from the DTrace Toolkit if DTrace support is enabled.
The following scripts are installed:
dtruss    - a DTrace version of truss.
execsnoop - snoop process execution as it occurs.
opensnoop - snoop file opens as they occur.
procsystime - print process system call time details.

ok riastradh
2017-09-17 00:00:39 +00:00
abhinav 062266a272 Undo the previous
While it fixed the problem of trailing spaces, but if the probe specifier
contained leading spaces, it would brake dtrace. The proper fix would be
to skip the leading spaces in the string as well.

However, it would result in a bigger diff for a very small benefit. While
a new import of dtrace is impending, it's better not to have this change.

Discussed with christos.
2017-06-05 21:19:32 +00:00
abhinav 143b096d8f Fix the trailing space in the probe specifier's name in dtrace(1)'s output.
When using dtrace using one of the tracing options, such as -n, -P, -i, -f etc.,
the first line of output from dtrace one is something like this:

sudo dtrace -n 'syscall:::entry /pid == 100/ {@num[probefunc] = count();}'
dtrace: description 'syscall:::entry ' matched 482 probes

There is a trailing space at the end of the probe specifier name ('syscall:::entry ').
This happens beucase dtrace tries to separate the probe name from the predicate and actions
using `{' and `/' as the separators but doesn't consider space also as a possible separator.

Output after this change:
sudo dtrace -n 'syscall:::entry /pid == 100/ {@num[probefunc] = count();}'
dtrace: description 'syscall:::entry' matched 482 probes

ok christos@
2017-06-05 17:11:10 +00:00
joerg 47fb074ea2 Fix argument order. 2017-05-26 22:50:35 +00:00
riastradh 7f7aad09bd Make VOP_RECLAIM do the last unlock of the vnode.
VOP_RECLAIM naturally has exclusive access to the vnode, so having it
locked on entry is not strictly necessary -- but it means if there
are any final operations that must be done on the vnode, such as
ffs_update, requiring exclusive access to it, we can now kassert that
the vnode is locked in those operations.

We can't just have the caller release the last lock because some file
systems don't use genfs_lock, and require the vnode to remain valid
for VOP_UNLOCK to work, notably unionfs.
2017-05-26 14:20:59 +00:00
abhinav 9f1571e578 Fix a typo: s/intepretation/interpretation 2017-05-12 21:01:36 +00:00
abhinav 8a253e32f4 Change section number from 1M to 1
The man page gets installed in section 1 anyway.

Ok christos, mrg
2017-05-12 20:58:35 +00:00
riastradh 6fa7b15833 Change VOP_REMOVE and VOP_RMDIR to preserve lock/ref on dvp.
No change to vp -- the plan is to replace the node by the
componentname in the vop parameters, and let all directory vops do
lookups internally.

Proposed on tech-kern with no objections:
https://mail-index.netbsd.org/tech-kern/2017/04/17/msg021825.html
2017-04-26 03:02:47 +00:00
riastradh 87fb32292e Make VOP_INACTIVE preserve vnode lock on return.
Discussed on tech-kern:
https://mail-index.netbsd.org/tech-kern/2017/04/01/msg021751.html

Ride 7.99.68, a bumpy bus of incremental vfs improvements!
2017-04-11 14:24:59 +00:00
chs 44b9f41144 apply changes equivalent to freebsd r256822, r267759 and r298171:
fix the dtrace "args" variable to return correct values.
simplify the invop handlers a bit by changing the second argument
from a pointer into the stack to a pointer to the trapframe.
2017-02-27 06:46:59 +00:00
hannken 326db3aaf6 Add generic genfs_suspendctl() and use it for all file systems.
Layered file systems need work.
2017-02-17 08:31:23 +00:00
chs e2632a59f3 put back the include of dtrace_bsd.h, it actually is needed. 2017-02-01 21:59:09 +00:00
chs 82ba364bfa fix this module to depend on the solaris module rather than the dtrace module.
remove an unneeded header.
2017-02-01 20:06:21 +00:00
chs 769e07db09 add some missing bits from freebsd r211554:
remove the DOODAD from prochandler().
we are now DOODAD-compatible with current freebsd.
2017-02-01 20:02:22 +00:00
christos 398615dda3 Rearrange headers 2017-01-12 23:12:59 +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
christos 05cc892852 arrange for .in files to be rebuilt. 2016-12-19 01:26:31 +00:00
christos 8a4f73aacb simple path fixes 2016-12-12 16:30:03 +00:00
christos e3e83e546b PR/51539: Henning Petersen: replace , with ; 2016-10-09 14:05:12 +00:00
pgoyette 06402e0a42 Move kern_ctf.c into the dtrace_fbt module (the only place it is used)
rather than including in kernels with KDTRACE_HOOKS defined.  Update
the dtrace_fbt module to depend on the zlib module.

Bump kernel version to avoid module mismatch.

Welcome to 7.99.38 !
2016-09-16 03:10:45 +00:00
hannken 7139aab724 Remove now obsolete operation vcache_remove().
Welcome to 7.99.36
2016-08-20 12:37:06 +00:00
christos c4b5e49df8 include bsd.init.mnk for consistency and set NOLINT since this overrides
MKLINT which can be re-set from /etc/mk.conf.
2016-08-04 17:07:23 +00:00
christos bf745eac2e machdep.booted_kernel is not an absolute path, make it so. Now u_int is
found but its parent is not :-)
2016-08-03 16:37:02 +00:00
pgoyette 29ec3266f4 Use C99 initializers for the cdevsw
No functional change intended or expected.
2016-07-17 02:09:10 +00:00
pgoyette 2f144b973e Add missing dp_proc_unlock() in error path.
From PR kern/51285 (Henning Petersen)

XXX Pullup to 7 and 7-0
2016-06-30 00:23:36 +00:00
pgoyette b8fd0470b4 One more removal of a redefined symbol while loading dtrace module.
Should finish the issues with PR kern/51265
2016-06-23 06:44: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
pgoyette 37f3aa12f4 Import fix from FreeBSD - see [1], [2] references below...
Fix DTrace's panic() action.

It would previously call into some unfinished Solaris compatibility code
and return without actually calling panic(9). The compatibility code is
unneeded, however, so just remove it and have dtrace_panic() call vpanic(9)
directly.

Fixes immediate problem in PR-51265.  However, this now reveals another
redefined symbol 'strpbrk' in the required module "solaris".


[1] https://svnweb.freebsd.org/changeset/base/281916
[2] http://lists.freebsd.org/pipermail/svn-src-head/2015-April/071019.html
2016-06-23 04:35:35 +00:00
christos 4a082de2f6 fix dup definitions in module. 2016-06-18 21:41:08 +00:00
mlelstv ccd8c06444 Make assertion of linker_file #ifdef __FreeBSD__. Fixes DIAGNOSTIC build. 2016-06-16 06:08:06 +00:00
christos 2964f15a7a Grr, gcc-5.4 creates DW_AT_typedef without DW_AT_type for HARD_REG_SET!
<1><c26b>: Abbrev Number: 4 (DW_TAG_typedef)
    <c26c>   DW_AT_name        : (indirect string, offset: 0x16e30): HARD_REG_ELT_TYPE
    <c270>   DW_AT_decl_file   : 57
    <c271>   DW_AT_decl_line   : 43
    <c272>   DW_AT_type        : <0x70>
 <1><c276>: Abbrev Number: 102 (DW_TAG_typedef)
    <c277>   DW_AT_name        : (indirect string, offset: 0x2f954): HARD_REG_SET
    <c27b>   DW_AT_decl_file   : 57
    <c27c>   DW_AT_decl_line   : 54
2016-06-08 21:32:27 +00:00
chs 760a7ed1e9 apply the ustack() parts of freebsd r211608:
r211608 | rpaulo | 2010-08-22 03:53:32 -0700 (Sun, 22 Aug 2010) | 8 lines

	Kernel DTrace support for:
	o uregs  (sson@)
	o ustack (sson@)
	o /dev/dtrace/helper device (needed for USDT probes)

	The work done by me was:
	Sponsored by:   The FreeBSD Foundation

plus a few netbsd-specific tweaks from me.
fixes PR 50790.
2016-05-14 21:19:05 +00:00
christos d7245a7577 include stdio.h for NULL 2016-04-28 11:45:02 +00:00
christos f107a05fec remove incorrect comment 2016-04-28 11:38:41 +00:00
christos 4187cd60b2 Introduce dt_bootfile() and use it to avoid hard-coded kernel values. Fixes
dtrace hang for kernels not named netbsd.
2016-04-28 00:02:40 +00:00
christos cb19fc18b8 Apply revision 274569 from FreeBSD:
Only compare visitation counters if they've both been set for the current
type graph walk.
2016-04-10 23:37:10 +00:00
christos 0aab751630 fix test. 2016-04-09 17:58:46 +00:00
christos eabf50fc2e properly check for type id overflow 2016-04-09 17:51:50 +00:00
riastradh 989878b760 Add autounload logic to dtrace module prototype. 2016-04-09 15:18:48 +00:00
riastradh 51346d2825 Disable autoload if there are any profile probes. 2016-04-09 15:17:58 +00:00
riastradh 7256e74462 Prevent autounload while cyclics are still in use. 2016-04-09 14:50:08 +00:00
riastradh 0def3bc2ac Fix module name of dtrace_profile. 2016-04-04 05:15:07 +00:00
christos ccd8517e35 write references as pointers XXX: 2016-03-18 17:11:04 +00:00
christos 8db25f0638 treat class line struct and union 2016-03-18 17:08:45 +00:00
christos dd09ff20c8 Add support for c++ classes. 2016-03-18 17:07:23 +00:00
christos 63ffeeee3f spell restrict 2016-03-18 16:37:09 +00:00
christos 3e0f598a15 fix printf format 2016-03-18 16:32:03 +00:00
christos 714b78ffa0 Add references, comments. 2016-03-18 16:24:26 +00:00
christos 096b9466af add references. 2016-03-18 16:12:46 +00:00
christos 4a929da448 Add references. 2016-03-18 15:26:31 +00:00
christos 22c82d5b7b - Add processing for c++ references.
- Make sure we load the DIE that contains the types of array elements so
  we can resolve them later.
- Print t_id (die offsets) in hex.
2016-03-18 14:55:34 +00:00
christos f15ed7b01a swap first, then write. 2016-03-18 13:23:00 +00:00
christos cdd20e12b2 Avoid longjmp clobbering 2016-03-17 03:05:55 +00:00
joerg fbba0696d4 Drop FreeBSD RCS ID, add NetBSD's. 2016-03-11 05:02:32 +00:00
christos 603f28d89d remove comment I used to test. 2016-03-01 21:45:10 +00:00
christos f485d9df89 Build as PIC if requested 2016-03-01 21:30:40 +00:00
joerg 2f04f4ac92 Don't crash when relocbase was 0. 2016-03-01 21:09:17 +00:00
joerg f2e47b4038 Merge r274564 from FreeBSD:
Fix a couple of bugs around the handling of structs and unions of size zero.
These would cause ctfconvert(1) to return an error when attempting to
resolve valid C types.
2016-03-01 14:52:14 +00:00
riastradh a37e72fe0d Let MKCTF alone control whether we build libctf.
If MKDTRACE=yes MKCTF=no makes no sense, we can express that
somewhere else, not as a confusing set lists error at the end -- as
far as I know, there's no way to express MKDTRACE *or* MKCTF as a
condition for set list entries.
2016-02-29 17:46:54 +00:00
riastradh 9e84fa00b8 uint64_t can't be negative. 2016-02-29 16:19:20 +00:00
riastradh a9ebcda81c Sprinkle some more zfs range lock reference count kasserts.
From a debugging session months ago, might as well share them.
2016-02-29 16:18:37 +00:00
riastradh 0ba9aea45e Cast int64_t to long long before printfing with %lld.
Not doing so broke something months ago and I forgot why.
2016-02-29 16:14:57 +00:00
riastradh 886308980e Add __printflike as appropriate. 2016-02-29 02:19:37 +00:00
christos 042ef76aff - Add missing ioctl.h
- Hide dprintf
2016-02-28 19:10:45 +00:00
christos 91780cc76d hook drti 2016-02-28 19:10:10 +00:00
joerg f247f26769 Make the default CPP path a list and check if they are access(2)able.
If no match is found, fallback to looking for cpp in PATH.
2016-02-24 21:11:34 +00:00
joerg 5e22f35b4d Keep the if chain going. 2016-02-21 13:33:47 +00:00
joerg 486516affa Clang 3.7 and newer provide the array size via DW_AT_count, not via
DW_AT_upper_bound. Recognize the former as well as the latter.
2016-02-20 23:09:03 +00:00
joerg 4fa4785fa4 Don't nuke input on errors, it makes debugging a nightmare. 2016-02-20 22:08:44 +00:00
joerg f9442aa68f Shuffle include order to avoid missing free on glibc. 2016-02-20 21:50:02 +00:00
christos 604231c4f0 - don't barf if the object does not have DWARF debug data.
- bump size of types to 1K to avoid string overflow
(both are needed for the new elftoolchain).
2016-02-20 02:39:47 +00:00
joerg b0b911ff3e Don't use #pragma weak to implicitly change argument types. 2016-02-19 19:25:59 +00:00
joerg e9ae0934d6 dmu_objset_rename is an alias for dsl_dataset_rename, but differs in
constness of the first argument. Newer clang checks for this and
prohibits it, so just be consistent by constifying the latter.
2016-02-19 19:25:22 +00:00
christos c628030d37 reduce ifdefs 2016-02-13 21:37:12 +00:00
joerg 66313330f0 SDT is not a disease. Use const consistently. 2016-02-06 18:19:59 +00:00
riastradh 8e1ee72c35 Need nbtool_config.h for __dead in tools. 2016-02-05 20:39:50 +00:00
riastradh 32e3d5d381 Need nbtools_config.h for __unused.
Fixes

.../src/tools/ctfmerge/../../external/cddl/osnet/dist/tools/ctf/common/list.c:73:47: error: expected ';', ',' or ')' before '__unused'
 list_defcmp(void *d1, void *d2, void *private __unused)
                                               ^~~~~~~~

on non-NetBSD systems, where <assert.h>, <stdlib.h>, <stdio.h>, and
<sys/types.h> don't define __unused.
2016-02-05 19:56:00 +00:00
roy 871759c0d7 Fix the actual issue rather than silencing the warning.
Thanks to gson@
2016-02-05 10:14:49 +00:00
roy f4a5ac8842 Add -Wno-format-nonliteral 2016-02-04 21:26:48 +00:00
roy 5baa0e8c89 dtrace needs Wno-format-security for clang it seems. 2016-02-04 20:06:29 +00:00
roy a118806971 Add some __printflike and __dead love. Init some structs fully. 2016-02-04 20:05:53 +00:00
roy 80df5a39da Fix build. 2016-02-04 18:47:14 +00:00
roy 440c6b2902 Mark more functions as __printflike and __dead. 2016-02-04 18:46:37 +00:00
roy 5e1375a115 Mark more functions as __dead. 2016-02-04 17:47:43 +00:00
roy dd3d664f77 Disable -Wformat-nonliteral here to build. 2016-02-04 17:42:34 +00:00