Commit Graph

494 Commits

Author SHA1 Message Date
riastradh 5aa555542e Use the upstream xdr, with a rename dance to avoid clash with libc.
The upstream xdr provides some functionality expected by the upstream
libnvpair which our libc's xdr does not provide.

When modifying, double-check that libnvpair.so defines no xdr_*
symbols, only _solaris_xdr_*.  (XXX Put this note somewhere...)
2015-04-10 22:44:20 +00:00
riastradh cee8cbe23f GCC doesn't speak #pragma init, try __attribute__((constructor)). 2015-04-10 22:38:30 +00:00
riastradh 708e4d7282 One usually puts .c, not .o, files in SRCS. 2015-04-10 22:36:50 +00:00
riastradh 495fdb2f81 Initialize variables. Don't bother supporting nv doubles. 2015-04-10 22:29:35 +00:00
riastradh 0126bcdf7e Use 0, not NULL, for zero integer constant. 2015-04-10 22:28:27 +00:00
riastradh f7e5f84747 Use dprintf, not printf, for debug messages. 2015-04-10 20:55:38 +00:00
riastradh 7c5ca5f421 Use CPPFLAGS, not CFLAGS, so this actually takes effect. 2015-04-10 20:34:16 +00:00
riastradh d4677cf380 Disable mmap on zfs for now.
The implementation is not coherent with read/write, and apparently it
is is so broken that write(2) on a region mapped from a zfs file will
often fail with EINVAL because something passes an offset that is too
large to getpages.
2015-04-10 19:59:10 +00:00
riastradh 057ee3c54c Pass NetBSD VA_UTIMES_NULL through to ZFS as Solaris ATTR_UTIME.
Makes t_unpriv:zfs_times fail the wrong way instead of silently
allowing the change.
2015-04-09 20:18:28 +00:00
riastradh 3d61be1880 Advisory locking for zfs. 2015-04-09 19:47:05 +00:00
riastradh 5b72b2208e Remove some vestigial #if 0 sections. 2015-04-09 19:35:55 +00:00
riastradh bc95daf1f6 Fix vattr_init_mask: mode is mode_t, not u_short.
Fixes fs/vfs/t_vnops:zfs_attrs test.
2015-04-09 05:32:53 +00:00
riastradh 8aa34a7d8b Fix return code of rmdir(nonempty) in zfs: ENOTEMPTY, not EEXIST. 2015-04-09 05:02:28 +00:00
riastradh 6c33e40a21 These are expressions, not statements. No semicolon. 2015-03-19 22:57:45 +00:00
riastradh 222dd8ff89 Move initialization of XUIO_XUZC_PRIV out of #ifdef PORT_SOLARIS.
This code is not currently used, so no functional change, but it may
be used when we hook zfs into the ubc.
2015-03-19 17:16:22 +00:00
christos 71da105a96 fix reversed test. 2015-03-10 12:17:50 +00:00
riastradh bf803657e5 Rewrite dtrace provider prototype from scratch. 2015-03-09 03:43:02 +00:00
christos 4d0ad52103 keep track of the number of enabled probes and set the lockstat_dtrace_enabled
flag appropriately.
2015-03-09 01:42:26 +00:00
riastradh 07b5668221 Remove debug prints, simplify fini logic. 2015-03-09 01:07:27 +00:00
christos bf089fd6e2 - remove device stuff
- compress ops
- terminate array of probes
2015-03-09 00:53:39 +00:00
riastradh 409555c5e2 Rewrite dtrace lockstat from the Solaris version and simplify.
- Fix mutex_adaptive probes to use the right lockstat flags.
- Install lockstat_probe_func on module load, not trace enable.
- Use a more sensible memory barrier arrangement.
2015-03-08 23:56:59 +00:00
christos 007a77aa4b preliminary support from riastradh (does not work yet, toxic) 2015-03-08 04:13:46 +00:00
christos aadbd1256a we have space for 2 more arguments so use it. 2015-03-07 17:47:09 +00:00
christos 6d7ab7eb57 constify 2015-03-07 15:14:29 +00:00
christos c0342a4ea1 - cleanup FreeBSD ifdefs
- remove unused code
- adjust to NetBSD struct emul and types.
2015-03-07 15:14:09 +00:00
christos 56bb5331f6 XXX: Use only a single thread. We seem to have a bug in our threading code
that causes us to hang in the ksem code if we use more than one.
2015-03-06 11:49:30 +00:00
ozaki-r 45c3185cfc Fix inconsistency between module and internal names of sdt and fbt
PR 49697
OK wiz@
2015-02-26 10:31:52 +00:00
ozaki-r 9ce3434ff9 Fix module unload of dtrace, sdt and fbt
- Don't unload when there are users of dtrace
- Forbid auto unloading (not supported for now)

PR 49695
2015-02-26 09:10:52 +00:00
ozaki-r 2be0e59f43 Fix dtrace build for arm with gcc 4.8 2015-02-21 15:13:20 +00:00
ozaki-r 3bcb5a6ccb Fix dtrace build error with gcc 4.8 on i386 and arm
_ILP32 is required by dt_popc.

The fix is inspired by FreeBSD.
2015-02-21 15:00:30 +00:00
ozaki-r 47d3523379 Add assert 2015-02-18 03:08:38 +00:00
ozaki-r 99f05559ed Don't return success when the target CPU is offline
dt_status originally expected the behavior.

This fixes a segfault happens in dt_aggregate_go (a user of dt_status)
that depends on the behavior.
2015-02-18 03:07:56 +00:00
christos bf418d8f39 PR/49667: Henning Petersen: Missing initialization of values in dt_parser.c 2015-02-14 15:55:05 +00:00
christos 92111d5005 PR/49666: Henning Petersen: initialization of instr wrong in dt_cg.c NULL
instead of 0 for uint32_t.
2015-02-14 15:53:23 +00:00
christos 92e3cdde4e delete error(1) strings. 2015-02-07 20:33:22 +00:00
christos b8c591ba5d check and fix printf formats, negative array indices, uninitialized variables,
shadowed variables.
2015-02-07 20:30:03 +00:00
wiz 659c05d388 Comment out currently unused dtrace_dof_char function (for clang build). 2015-01-31 13:36:29 +00:00
hannken aaf5c384d9 Change zfs to vcache.
- zfs_loadvnode() is based on zfs_zget() plus zfs_znode_alloc().
2014-12-05 09:13:32 +00:00
hannken f43b9b375a Remove vnode creation from zfs_create_fs() and zfs_create_share_dir()
as a vnode is not needed here.

Inspired by FreeBSD r253603.
2014-12-05 09:12:29 +00:00
christos be13e1550a don't fail for anonymous unions. 2014-11-01 23:21:31 +00:00
justin 3cf1fc0878 Add libraries in order that they will link if static as well as dynamic 2014-10-30 21:15:13 +00:00
joerg 18fd8dcd8d SPEC_MAXOFFSET_T doesn't exist anywhere else, so don't use it here
either.
2014-07-28 10:01:23 +00:00
ryoon 4575a9c0a5 Fix dtrace kernel module build.
Add nodiscard to cdevsw.
They are not fixed in fallocate/fdiscard changes.
2014-07-26 04:54:20 +00:00
christos 02cb0c6eaf Introduce a selector function to the vfs vnode iterator so that we don't
need to vget() vnodes that we are not interested at, and optimize locking
a bit. Iterator changes reviewed by Hannken (thanks), the rest of the bugs
are mine.
2014-05-24 16:34:03 +00:00
christos 7081cf9a59 need bsd.own.mk 2014-04-28 21:56:20 +00:00
christos 0b24109d1b make compilable from the kernel 2014-04-22 15:12:35 +00:00
christos c8ad22d607 Add fake atomic 64 ops for those who don't have them.
XXX: used to be arm, now it is also i386.
2014-04-22 15:02:38 +00:00
maxv 23f76b6d00 An (un)privileged user can easily make the kernel dereference a NULL
pointer.

The kernel allows 'data' to be NULL; it's the fs's responsibility to
ensure that it isn't NULL (if the fs actually needs data).

ok christos@
2014-04-16 18:55:17 +00:00
riastradh 418e8d3033 Don't forget ZFS_EXIT after ZFS_ENTER. 2014-04-09 22:41:38 +00:00
riastradh c83470498f Try vflush, which may fail, before we mark the file system mounted. 2014-04-09 22:40:32 +00:00
christos 897d836e1d Handle assembly code built with -g 2014-04-05 23:33:15 +00:00
ozaki-r b7c3845c47 Complete migrating to snprintf_blkptr 2014-03-28 03:46:56 +00:00
ozaki-r c5002aae34 Fix migrating to snprintf_blkptr 2014-03-28 03:18:24 +00:00
ozaki-r 2821606826 Add missing 4th argument of ddt_object_name 2014-03-28 03:11:00 +00:00
ozaki-r 4e2e658100 Fix some snprintf 2014-03-28 02:58:36 +00:00
ozaki-r bc3ce11eda Add missing 3rd argument of nicenum 2014-03-28 02:50:18 +00:00
apb 6713b766dd format is a pointer, so sizeof(format) is not a good length
to pass to snprintf.  Try to calculate the correct length,
taking into account the amount of space already used.
2014-03-27 19:34:39 +00:00
christos a2d437b386 kill sprintf 2014-03-27 15:50:48 +00:00
ozaki-r 1339b2cc13 Add MKCTF
This variable separates CTF stuffs from MKDTRACE; we can build DTrace
solely without building and using them. This allows us to use DTrace
even if CTF stuffs have problems (actually they have now).

This variable would be merged into MKDTRACE eventually, once CTF stuffs
work correctly again.
2014-03-25 09:52:55 +00:00
ozaki-r 4ae43925ec Exclude mvsoctmr_* functions from FBT targets
Probing them doesn't work for DTrace/arm for some reason.

Anyway with this fix, DTrace/arm works on SHEEVAPLUG
as well as BEAGLEBONE.
2014-03-19 11:14:12 +00:00
hannken 33b1d7765e Change zfs_sync() to use vfs_vnode_iterator. 2014-03-17 09:37:41 +00:00
ozaki-r e2fc5c59a0 Use MACHINE_CPU instead of MACHINE_ARCH with pattern matching
Include bsd.own.mk to use MACHINE_CPU.

Advised by matt@
2014-03-16 06:51:43 +00:00
ozaki-r f27e224fab Look up arm directory on MACHINE_ARCH=*arm* 2014-03-16 05:11:19 +00:00
ozaki-r 609ba481a5 Implement DTrace FBT provider for ARM
- Finding probable functions
- Replacing instructions
- Emulating instructions

It is tested only on ARMv7 CPUs yet, for example,
-m evbarm (-a earm) kernel=BEAGLEBONE.
2014-03-15 08:00:19 +00:00
ozaki-r 48e9045322 Enable invop handler on module load
It sets a fbt handler to dtrace_invop_jump_addr on module load,
which is used to call the dtrace probing function from the trap
handler.
2014-03-15 07:49:15 +00:00
ozaki-r 26e6962bfe Make arm/dtrace_isa.c buildable
This is a band-aid for build, but it works anyway.
We have to do a real fix in the future.
2014-03-15 07:43:01 +00:00
ozaki-r 18c3aa4966 Fix header inclusions 2014-03-10 06:38:22 +00:00
ozaki-r 7ea504b141 Make arm/dtrace_subr.c buildable
The change just imports the code from
http://people.freebsd.org/~gonzo/arm/dtrace-arm.diff
and tweaks for NetBSD.
2014-03-10 03:04:57 +00:00
christos 60a5bae159 Tidy up paths. 2014-03-09 22:01:31 +00:00
christos 0afc3eb7f2 put back our local fixes:
- don't die on unresolved types.
- it is ok to have 0 sized arrays in structs
- forward enum decls.
2014-03-09 20:48:01 +00:00
christos cf96d463d6 Temporarily add a -S flag to limit the number of threads. 2014-03-09 19:14:15 +00:00
christos e3afac50d3 fix constant name 2014-03-09 17:07:46 +00:00
christos 7016e57516 use merged ctf rules 2014-03-09 17:05:23 +00:00
christos abe7c4c08a Merge ctf build rules. 2014-03-09 17:05:01 +00:00
christos 381ca28d6d sync with freebsd 2014-03-09 17:04:00 +00:00
ozaki-r 959d62341c Prepare dtrace_isa.c for build
- Tidy up header file inclusions
- Replace curcpu with cpu_number()
- Fix argument of dtrace_getreg
- Tweak for gcc 4.8

Note that the file is still not buildable.
2014-03-08 11:46:01 +00:00
ozaki-r e9ddbe399c Fix build of DTrace with GCC 4.8
Use __diagused for a variable which is only referred by KASSERT.

Advised by matt@
2014-03-07 02:37:16 +00:00
tron f7ff511838 Fix build of DTrace with GCC 4.8. 2014-03-05 20:14:15 +00:00
ozaki-r f6c17acba3 Add cyclic_machdep.c for ARM
The code is still almost same as i386's one.
2014-03-05 06:35:44 +00:00
ozaki-r bee7b32afb Add defined(__arm__) 2014-03-05 06:12:00 +00:00
ozaki-r 9d2dfffd73 Use native atomic function instead of DTrace's own one
So we don't need to implement it for each architecture.

This change is from FreeBSD (not as-is though).
2014-03-05 06:06:42 +00:00
ozaki-r 7ee4c5ecd0 Fix dtrace_cas32 logic
- compare with cmp, not new
- return old value
2014-03-05 03:09:17 +00:00
ozaki-r 1bf04388c3 Use uint32_t instead of u_int32_t 2014-03-05 02:00:24 +00:00
ozaki-r 07efccf499 Add missing END for each function 2014-03-04 11:07:40 +00:00
ozaki-r bc132bbc2a Get rid of unused variable definition za from mount.h
There is no user for it. Even worse, it breaks dtrace build for arm.
2014-03-04 09:24:42 +00:00
ozaki-r ad5eab92b9 Fix wrong conditional statement in dtrace_debug_output
Reported in PR kern/48547 by ozaki-r.
2014-03-04 03:20:49 +00:00
christos 0d8247f549 Don't core-dump if a type cannot be resolved. Still gives an error. 2014-03-03 00:09:52 +00:00
hannken 97834f7ba0 Change vnode operation lookup to return the resulting vnode *vpp unlocked.
Change cache_lookup() to return an unlocked vnode.

Discussed on tech-kern@

Welcome to 6.99.31
2014-02-07 15:29:20 +00:00
hannken 04c776e5c8 Change vnode operations create, mknod, mkdir and symlink to return
the resulting vnode *vpp unlocked.

Discussed on tech-kern@

Welcome to 6.99.30
2014-01-23 10:13:55 +00:00
hannken 1139274440 Change vnode operations create, mknod, mkdir and symlink to keep the
directory node dvp locked on return.

Discussed on tech-kern@

Welcome to 6.99.29
2014-01-17 10:55:01 +00:00
riz 11beb836b0 Replace llx with PRIx64 and some llu with PRIu64 in format strings. 2014-01-12 17:49:30 +00:00
riz f664413dc2 Field width is an int, so cast the result of strlen() appropriately. 2014-01-12 17:48:59 +00:00
riz b3fba11357 Disable the extra-args warning for printf formats in dtrace.c 2014-01-12 17:48:25 +00:00
matt 99de37ccf7 Don't define ptrdiff_t since that's done in the NetBSD <sys/types.h> 2013-12-12 18:20:49 +00:00
christos b90de0d04a fix one more mountlist instant 2013-11-25 22:48:05 +00:00
hannken 65b1f85ab6 Vnode API cleanup pass 1.
- Make these defines and functions private to vfs_vnode.c:

  VC_MASK, VC_LOCK, DOCLOSE, VI_IANCTREDO and VI_INACTNOW
  vclean() and vrelel()

- Remove the long time unused lwp argument from vrecycle().

- Remove vtryget(), it is responsible for ugly hacks and doesn't
  look that effective.

Presented on tech-kern.

Welcome to 6.99.25
2013-10-29 09:53:51 +00:00
christos 419fd4e177 NetBSD does not have vn_in_dnlc 2013-10-21 15:31:26 +00:00
christos e1fe9cc144 use proper format strings. 2013-10-19 23:07:39 +00:00
christos 50a36d05ad don't use IO_APPEND. In the vdev_file.c we end up appending to our virtual
file as a filesystem! With this change:

    $ dd if=/dev/zero of=disk1 count=266144
    $ zpool create crap $PWD/disk1

mounts /crap and it seems to work ok, until I try unmounting
2013-09-23 20:44:24 +00:00
christos 4f1b5d5104 not nice to play with resid before checking for error, but this is how they
fixed it, and I am following suit. I would have preferred if (error && resid)
instead.
2013-09-23 20:41:19 +00:00
christos 618c231990 Hack: Instead of dying in vrele with a kernel assertion, detect that the
usecount of the vnode is 0 and treat it as a noop. This is wrong, buf it
get us through the VN_RELE() after the close in vdev_file.c
2013-09-23 19:44:21 +00:00
christos 54639fcdc3 Don't forget to destroy the mutex we created to the zfsvfs transient object,
otherwise if we load and unload the module the lockdebug code will blow chunks.
2013-09-23 19:42:42 +00:00
joerg 975a152cfc If a library needs a symbol from another library, pull that library in
explicitly, even if the DT_NEEDED closure would normally already ensure
the presence.
2013-09-11 23:04:09 +00:00
christos b964869221 -D and -I are CPPFLAGS 2013-09-10 11:23:20 +00:00
christos 22898e3a43 Make dtrace/zfs compile on arm based on the diff from:
http://people.freebsd.org/~gonzo/arm/dtrace-arm.diff
Completely untested, kernel support not added.
2013-06-21 19:16:00 +00:00
christos 7733018eca rename delay to xdelay to avoid conflicts. 2013-06-21 16:22:45 +00:00
christos ea65093059 stub out for now 2013-04-14 16:52:47 +00:00
christos 1dd1e91a24 add a stub for arm 2013-04-14 16:39:59 +00:00
christos 213aef742a let zfs autoload too. 2013-03-04 01:14:35 +00:00
christos db9ff9a846 print the function name that was not found. 2013-03-03 18:18:13 +00:00
christos c43c276ced autoload tracing modules. 2013-03-03 18:16:35 +00:00
christos 9776ad40b3 need to be a DRIVER class module to be able to autoload when /dev/dtrace/dtrace
is opened.
2013-03-03 16:56:15 +00:00
tron 53529c743e Fix dodgy arguments to snprintf(3) which cause a warning that breaks
the build (at least with "USE_SSP" set to "yes").
2013-02-20 22:45:12 +00:00
christos 55ad42a55f Avoid comparison between pointer and integer. 2013-01-26 20:15:50 +00:00
wiz 3c7ce2aac6 Put optional args before non-optional ones. 2013-01-20 23:51:40 +00:00
wiz 519dc5efd2 Sort options in SYNOPSIS and text.
XXX: please check if SYNOPSIS are correct, I think they missing some .Op.
2013-01-19 01:22:12 +00:00
christos d3d2c27409 add man pages 2013-01-18 19:58:43 +00:00
christos a83c8cf9a9 Handle enum forward declarations. 2013-01-18 16:23:48 +00:00
dsl a34e002f26 Spell cprng_fast() properly 2013-01-03 17:12:05 +00:00
dsl 278835249a Use cprgn_fast() not rnd_extract_data().
The latter isn't in any header files any more.
2013-01-03 16:42:55 +00:00
dsl 51f5533426 Compilation fixes:
- include sys/ioctl.h
- NULL isn't an int constant
- %llf isn't a printf format
2013-01-03 16:41:51 +00:00
tron 888f2d7310 Include "sys/ioctl.h" for the prototype of ioctl(2) which fixes the build. 2013-01-02 21:19:13 +00:00
dsl 6c6b743ee5 I've NFI why this code has userspace stuff playing with 'struct proc *'
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.
2013-01-02 16:31:24 +00:00
dsl be6d96d7d9 Explicitly include sys/ioctl.h 2013-01-02 10:33:49 +00:00
dsl 07465819ee Replace alloca(256) with an array.
The code ended up using alloca() from libc - which 'just can't work' (tm).
It is also pointless!
2013-01-02 10:33:19 +00:00
dsl b4041ccef0 Comment out the unused 'struct proc p0;'
This is userspace, it isn't supposed to know what a 'struct proc' is.
2013-01-01 19:03:26 +00:00
dsl f337b6c74a This needs an explicit include of sys/ioctl.h.
XXX: There is some crappy code in here :-)
2013-01-01 19:02:19 +00:00
chs 8f4ea3c47b adapt the profile dtrace provider to netbsd. 2012-12-07 03:11:17 +00:00
chs 11c69f2d20 adapt the cyclic module and profile dtrace provider to netbsd.
for now, just hook the cyclic callback into hardclock().
2012-12-02 01:05:16 +00:00
chs a32db86a29 update cyclic module to the freebsd 8-stable version as of svn r219520. 2012-12-02 00:05:38 +00:00
christos 7c1cb982d4 we have _SC_PHYS_PAGES now 2012-11-04 19:12:41 +00:00
riastradh d9310ec72a Use 0 for MS_NOMNTTAB since we have no mnttab anyway. 2012-10-20 22:11:38 +00:00
joerg fdd8614af9 Hack to avoid missing macro to unbuild the tree. 2012-10-20 11:37:37 +00:00
riastradh 0041a2c6fe Let's try that again without the static... 2012-10-19 22:19:15 +00:00
riastradh e75d983bfe Add omitted secpolicy_vnode_utime_modify, for zfs. 2012-10-19 19:58:33 +00:00
riastradh 4797828821 Back out accidental commit of errno kludge for rmdir(".") &c.
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.
2012-10-18 14:29:44 +00:00
riastradh 2111fc7126 Take a first whack at making zfs permissions work.
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.
2012-10-18 14:22:57 +00:00
riastradh 8e972045d7 Restore _PC_NO_TRUNC in zfs_netbsd_pathconf.
Accidentally clobbered it in a previous commit while moving patches
around between source trees -- oops.
2012-10-16 00:04:15 +00:00
riastradh 6d6cb07bff Fail lookup of .. in a deleted directory with ENOENT.
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.
2012-10-15 23:51:11 +00:00
riastradh 1baf22d09c Fix various issues in zfs life cycle, locking, and vop protocol.
- 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.
2012-10-15 23:08:19 +00:00
riastradh 1b44cf7c91 secpolicy_vnode_access must be called with the vnode lock held.
Don't unlock the vnode and then tell the caller about what the world
was like while the vnode was locked.  The world changes fast.
2012-10-15 22:50:25 +00:00
riastradh 2ea30100de Simplify zfs dirlock reference counting.
No need to pass dzp around; dl has a pointer to it.
2012-10-15 22:43:50 +00:00
riastradh b2ba8fafaa Do reference counting for zfs range lock waiters.
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.
2012-10-15 14:15:59 +00:00
riastradh f1e3330bc7 Do reference counting for zfs dirlock waiters.
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.
2012-10-15 14:03:06 +00:00
njoly 172b16130f No need to include files more than once. 2012-10-11 08:01:23 +00:00
njoly 6b1609c666 Add _PC_NO_TRUNC support in zfs_netbsd_pathconf(). 2012-10-01 18:19:18 +00:00
riz 91aa9460ce Don't build with debugging (-g) by default. 2012-09-05 23:08:42 +00:00
pooka fa4bf43b79 For now, make vop_islocked more like vop_lock and vop_unlock (i.e. don't
even attempt to do anything).
2012-09-01 16:19:00 +00:00
christos ffd8412325 PR/46660: Henning Petersen: Fix typo in deviceid.c 2012-07-05 13:55:58 +00:00
njoly b813bd15cb Use CTLTYPE_QUAD for uint64_t type in sysctl_createv. 2012-06-19 21:25:26 +00:00
chs 22738551d6 reduce diff to freebsd:
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".
2012-06-16 17:31:47 +00:00
chs 6e9ead4606 make dtrace work on amd64. 2012-06-11 15:18:05 +00:00
jym 57d7988f76 Now that pool_cache_invalidate() is synchronous and can handle per-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
2012-06-05 22:51:47 +00:00
dsl f7622c11cc Not sure why this has just started to fail!
But it really isn't a good idea to compare a uint64_t to NULL.
2012-06-03 10:53:51 +00:00
christos 27e3db30d5 Add FREAD for the benefit of kauth! 2012-04-26 23:34:09 +00:00
wiz 2b8cc88a65 Use the correct path in dt_module.c.
From clang via Henning Petersen in PR 46009.
2012-02-13 13:05:36 +00:00
wiz 6ef3ca5393 Use the correct MACHINE_ARCH for amd64.
Remove temporary hack while here.
From Henning Petersen in PR 46001.
2012-02-13 12:52:54 +00:00
para e62ee4d475 extending vmem(9) to be able to allocated resources for it's own needs.
simplifying uvm_map handling (no special kernel entries anymore no relocking)
make malloc(9) a thin wrapper around kmem(9)
(with private interface for interrupt safety reasons)

releng@ acknowledged
2012-01-27 19:48:38 +00:00
darran 9a00affba3 Fix a segfault in ctfmerge.
GCC can generate bogus dwarf attributes with DW_AT_byte_size set to 0xFFFFFFFF.
See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35998 .

GCC is currently doing this for external/bsd/tmux/dist/compat/imsg-buffer.c:
    readelf -a --debug-dump imsg-buffer.o
	...
	 <2><6e3>: Abbrev Number: 32 (DW_TAG_union_type)
	    <6e4>   DW_AT_byte_size   : 0xffffffff
	    <6e8>   DW_AT_decl_file   : 1
	    <6e9>   DW_AT_decl_line   : 229
	    <6ea>   DW_AT_sibling     : <0x705>

This resulted in ctfconvert generating a faulty CTF entry which then caused the
segfault in ctfmerge.

The fix has ctfconvert check for the bogus 0xFFFFFFFF value and works around it.
It also adds some protection to ctfmerge to avoid the segfault and fail
more gracefully if the error should occur in the future.
2012-01-10 08:42:22 +00:00
christos dd89f66f56 make this compile again. VOP_CLOSE is really vn_close() through macros. 2011-11-21 17:51:03 +00:00
christos bde7230620 correct declaration of vn_close()
XXX: Should all those dup declarations be here?
2011-11-21 05:50:11 +00:00
christos 6a2b307489 close file in a way that it does not trigger an assertion :-)
now zpool create works again.
2011-11-21 00:24:24 +00:00
christos eb50a1b80e enough with the compile time warnings. 2011-11-20 02:54:25 +00:00
yamt fb69e65229 make aggregate work for > 1 cpus 2011-10-19 11:03:52 +00:00
yamt f34e2253c6 because our xcall stuff can't be used in softint, use kernel threads
for cleaner/deadman low-level cyclic replacement.  PR/44905
2011-10-19 11:02:08 +00:00
yamt ad773a12d3 fbt_provide_module_cb: exclude some functions known unsafe to probe 2011-10-19 10:55:50 +00:00
hannken 34f54c83be As vnalloc() always allocates with PR_WAITOK there is no longer the need
to test its result for NULL.
2011-10-07 09:35:04 +00:00
christos b6f6e1bfbd fix a shadow variable warning. 2011-09-09 17:48:39 +00:00
christos a222eb155b catch up with vmem_alloc signature change. 2011-09-07 21:32:07 +00:00
christos 4aa752a401 fix shadow warnings.
XXX: might be a good idea to kill global 'cpu' and 'version' variables.
2011-08-31 21:57:16 +00:00
uebayasi eab2487254 Fix a local var name. 2011-07-30 10:12:14 +00:00
uebayasi 6ed9c23d3b KNF. 2011-07-29 13:10:23 +00:00
yamt e3bb2d6eba mark this driver D_MPSAFE 2011-07-26 12:54:28 +00:00
yamt afe833af51 fix a merge botch in rev.1.7 2011-07-26 12:33:23 +00:00
yamt 696f2a9301 remove debug printfs 2011-07-26 12:28:39 +00:00
yamt 7695ef3cd1 remove a debug printf 2011-07-26 12:28:01 +00:00
yamt 223b285dcf fix a kmem_alloc/free size mismatch 2011-07-26 12:26:33 +00:00
tron 71477abcdc Fix uninitialized variables reported by GCC 4.5. 2011-07-20 19:51:57 +00:00
christos 9b1cdf6a14 better fix for gcc uninitialized. 2011-07-18 02:47:52 +00:00
christos 6e03a05a94 fix gcc uninitialized warnings 2011-07-18 00:43:35 +00:00
christos 6c10492aaa fix uninitialized gcc variables 2011-07-18 00:42:40 +00:00
joerg 3eb244d801 Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.
2011-07-17 20:54:30 +00:00
rmind 1ab522108e Fix ZFS build. 2011-06-12 14:47:20 +00:00
mrg b156c02e66 v_interlock is now a pointer to kmutex_t, use it as one.
fixes many of the 5.99.53 build issues in zfs, but not all of them.
2011-06-12 04:43:11 +00:00
christos 4e14e91053 fix missing prototypes. 2011-05-15 18:33:33 +00:00
rmind 756122ce22 Remove unused M_MOUNT. 2011-04-02 04:57:35 +00:00
joerg e2e40b270e Don't define acl_alloc and acl_free during kernel builds.
Fixes module build with clang.
2011-03-15 00:48:04 +00:00
pooka eb63257707 adjust some pretty likely broken assertion (stksize is hardcoded
from caller, but not used here).  now zpool doesn't cause a
kernel crash anymore.
2011-03-10 19:35:24 +00:00
pooka 3140523bc0 pass in correct variable, the old code can't possibly be correct. 2011-03-10 19:32:39 +00:00
riz 3406e189a5 #include <sys/debug.h> (from the ZFS sources) so that ASSERT() is
defined, and we don't get problems like kern/44430.  This is
more a workaround than a fix, but at least I can load zfs now.

ok haad@
2011-03-09 23:55:46 +00:00
riz c29d7160e5 If the config is zero size, don't try to read it.
OK haad@
2011-03-09 23:49:06 +00:00
pooka 1c44cbfd96 Don't allow module to init if root is not mounted since the modcmd
wants to traverse the file system.  This *might* fix statically
linking zfs support into the kernel (at least it fixes rump kernel
bootstrap).
2011-01-21 13:08:42 +00:00
pooka 51f08b56c8 fix kobj_open_file_vnode()
patch from haad
2011-01-21 12:24:24 +00:00
haad c7287ec04b Fix zfs Makefiles + debug, don't add -g by default only when MKDEBUG is
enabled. Fix header assert conflicts + bump WARNS for some libs.
2011-01-13 23:18:23 +00:00
dholland 42bae07fce Remove references to SAVESTART in zfs. 2011-01-02 05:12:03 +00:00
haad bec5c61e50 Define vn_getattr in zfs_context.h. 2010-12-28 16:44:45 +00:00
haad bca088ab45 Fix problem where vnode vp_size was not updated when vndoe was already allocated,
for vdev. This makes ztest survive ztest_vdev_LUN_growth test. Replace dummy
VOP_GETATTR with vn_getattr routine which reset vp_size and vattr_size accordingly
to reality.
2010-12-28 13:36:09 +00:00
haad 8f7b707f59 libzfs_fru_clear was not ported to NetBSD disable it foor now. 2010-12-24 16:13:58 +00:00
haad 363aa1ba89 Whitespace police. 2010-12-15 22:49:42 +00:00
haad 59385470cf Only KM_SLEEP | KM_NOSLEEP can be passed down to kmem layer, clean up
tqflags from internal taskq flags (TQ_FRONT) before calling kmem_alloc.
2010-12-15 22:09:14 +00:00