Commit Graph

407 Commits

Author SHA1 Message Date
pjd
4b161aa66e Fix detection of file system being shared. After this change commands like:
# zfs unshare -a
	# zfs destroy foo/bar
	# zfs rename foo/bar foo/baz

should properly remove exported file systems.

MFC after:	3 days
2009-09-07 20:10:33 +00:00
pjd
34877df084 Teach zdb(8) how to obtain GEOM provider size.
PR:		kern/133134
Reported by:	Philipp Wuensche <cryx-freebsd@h3q.com>
MFC after:	3 days
2009-09-07 14:44:04 +00:00
pjd
2a9e26ee0b Fix receive when dataset has no / in its name.
Submitted by:	James R. Van Artsdalen <james-freebsd-current@jrv.org>
Approved by:	re (kib)
2009-08-17 09:34:00 +00:00
pjd
6ccc3544c4 Remove files that are no longer used.
Discussed with:	kmacy
Approved by:	re (kib)
2009-08-17 08:03:02 +00:00
kensmith
9c2c634ee9 Bump the version of all non-symbol-versioned shared libraries in
preparation for 8.0-RELEASE.  Add the previous version of those
libraries to ObsoleteFiles.inc and bump __FreeBSD_Version.

Reviewed by:    kib
Approved by:    re (rwatson)
2009-07-19 17:25:24 +00:00
pjd
d8377a604c The mutex_owned() macro should operate on kmutex_t and not on mutex_t.
This fixes 'zdb <poolname>' crash.

Reported by:	avg
Approved by:	re (kib)
2009-07-09 20:22:05 +00:00
sson
536e43cd2e Fix lockstat breakage to arm/powerpc buildworld.
Thanks to IBM char's are unsigned on arm/powerpc.

Approved by:	gnn (mentor)
2009-05-27 22:41:28 +00:00
sson
dc2eb1b92a Add the OpenSolaris lockstat(1M) command. Requires the dtrace driver,
the lockstat provider, and the ksyms(4) pseudo driver kernel modules.

Approved by:	gnn (mentor)
2009-05-27 01:30:23 +00:00
kmacy
78c3549a9f atomic.S has been renamed opensolaris_atomic.S to avoid collisions 2009-05-09 05:39:35 +00:00
kmacy
1665b71c81 define VN_RELE_ASYNC for use by libzpool 2009-05-07 23:02:51 +00:00
rdivacky
4cd01fc223 Switch over to gnu99 compilation on default for userland.
Tested by:	make universe
Tested by:	ports exp build (done by pav)
Reviewed by:	ru
Reviewed by:	silence on arch
Approved by:	ed (mentor)
2009-03-14 17:55:16 +00:00
jhb
c8283e83be Correct the sense of the "use32" terenary operator so that it uses
'lib32' for 32-bit binaries on amd64 and 'lib' for 64-bit binaries.
Remove an #ifdef __i386__ that defined use32 to the wrong value on
i386 to workaround the bug in the terenary operator.

MFC after:	1 month
2009-01-16 22:16:54 +00:00
rwatson
25e9243909 Include param.h instead of types.h before mount.h so that the nested
include of param.h can be removed from audit.h.

MFC after:	3 days
2008-12-29 18:59:50 +00:00
rwatson
97550ee034 Including mount.h requires including param.h.
MFC after:	3 weeks
2008-12-27 14:17:15 +00:00
pjd
86c4fc0123 IFp4: Don't rely on disk IDs and always use vdev guids, which means always look
up for components by reading metadata. This might be slower when there are big
number of disks in the system, but is definiately more reliable.
2008-11-22 13:33:06 +00:00
pjd
eb404aafac Fix a warning on amd64 caused by using int for request argument instead of
unsigned long:

WARNING pid 12888 (zfs/zpool): ioctl sign-extension ioctl ffffffffcc285aXX

Reported by:	kris
2008-11-18 00:03:38 +00:00
pjd
bbe899b96e Update ZFS from version 6 to 13 and bring some FreeBSD-specific changes.
This bring huge amount of changes, I'll enumerate only user-visible changes:

- Delegated Administration

	Allows regular users to perform ZFS operations, like file system
	creation, snapshot creation, etc.

- L2ARC

	Level 2 cache for ZFS - allows to use additional disks for cache.
	Huge performance improvements mostly for random read of mostly
	static content.

- slog

	Allow to use additional disks for ZFS Intent Log to speed up
	operations like fsync(2).

- vfs.zfs.super_owner

	Allows regular users to perform privileged operations on files stored
	on ZFS file systems owned by him. Very careful with this one.

- chflags(2)

	Not all the flags are supported. This still needs work.

- ZFSBoot

	Support to boot off of ZFS pool. Not finished, AFAIK.

	Submitted by:	dfr

- Snapshot properties

- New failure modes

	Before if write requested failed, system paniced. Now one
	can select from one of three failure modes:
	- panic - panic on write error
	- wait - wait for disk to reappear
	- continue - serve read requests if possible, block write requests

- Refquota, refreservation properties

	Just quota and reservation properties, but don't count space consumed
	by children file systems, clones and snapshots.

- Sparse volumes

	ZVOLs that don't reserve space in the pool.

- External attributes

	Compatible with extattr(2).

- NFSv4-ACLs

	Not sure about the status, might not be complete yet.

	Submitted by:	trasz

- Creation-time properties

- Regression tests for zpool(8) command.

Obtained from:	OpenSolaris
2008-11-17 20:49:29 +00:00
rodrigc
9f34c4004d Merge latest DTrace changes from Perforce.
Approved by:	jb
2008-11-05 19:35:09 +00:00
imp
6538abe8be Mips doesn't have a long double that's different in size from double. 2008-09-18 19:54:02 +00:00
attilio
a7d0f2bbf3 Add a missing file change from the VOP_GETATTR() argument axing. 2008-08-28 18:00:20 +00:00
jb
b96c45bfb8 Don't need to include vmem.h anymore. 2008-05-23 22:44:46 +00:00
jb
b64f9e972e Add the dtrace client app to the build. 2008-05-22 23:06:19 +00:00
jb
8a79fc60dc Add the DTrace build tools. 2008-05-22 08:04:49 +00:00
jb
c0a128b2a4 Oops, these files belonged under src/sys, not src. Sorry. 2008-05-22 07:46:01 +00:00
jb
f5c9887752 This commit was generated by cvs2svn to compensate for changes in r179191,
which included commits to RCS files with non-trunk default branches.
2008-05-22 07:00:07 +00:00
jb
d9b7f78c73 Vendor import (really!) of the OpenSolaris bits for DTrace. 2008-05-22 07:00:07 +00:00
jb
1f1c4e3e67 Add the DTrace libraries and D library scripts. 2008-05-22 04:26:42 +00:00
jb
d318ba34ed Add Solaris compatibility definitions for things we don't really want in
FreeBSD headers.
2008-05-21 00:26:38 +00:00
jb
3719d4861d * Handle the different ioctl design.
* Add a couple of FreeBSD action extensions.
2008-04-26 05:09:19 +00:00
jb
7bc32bb24c Make this file compile cleanly. 2008-04-26 05:07:54 +00:00
jb
66387460cd Leave out some header files. 2008-04-26 05:07:07 +00:00
jb
f16781162b * Handle building on FreeBSD for i386 and amd64.
* Add stubs for the other FreeBSD arches.
* Make the file compile cleanly.
2008-04-26 05:05:48 +00:00
jb
85357324f2 * Make this file compile cleanly.
* Add FreeBSD constructor/destructor definitions.
2008-04-26 05:03:22 +00:00
jb
625e71e402 * Add FreeBSD action extensions.
* Get the kernel module file name rather than hard-coding it like on Solaris.
* Use FreeBSD's process library API.
* Handle FreeBSD's different lock types.
* Get the list of loaded providers via a syscall.
2008-04-26 05:01:29 +00:00
jb
195c17a375 * Handle the different ioctl design.
* Make this file compile cleanly.
2008-04-26 04:57:45 +00:00
jb
14d04ad607 There is a lot of commented out code here which applies to future work
for userland tracing.

For now we need the basic functions to be in place so that DTrace can
be used for kernel tracing.
2008-04-26 04:56:46 +00:00
jb
ab746bef99 Leave out a header file. 2008-04-26 04:54:58 +00:00
jb
47935bea9d Merge FreeBSD include file changes with some code that should have come
in on the vendor branch.
2008-04-26 04:53:24 +00:00
jb
118f217464 * Use FreeBSD's process library instead of the Solaris one.
* There are a few placeholders in here for which there isn't libproc
  support code yet. This is relevent to userland tracing. This set of
  commits is designed to get kernel tracing up and running, with the
  userland stuff to follow later.
2008-04-26 04:51:45 +00:00
jb
729d998abb Leave out the hook that Solaris has into it's rtld. 2008-04-26 04:49:02 +00:00
jb
ba64b2a3fa * Add a couple of action definitions for FreeBSD extensions.
* Handle the different ioctl design.
* Add support for the get and set error location.
* Add support for freopen().
2008-04-26 04:47:16 +00:00
jb
2d46247bf5 * Handle the different ioctl design.
* Make the file compile cleanly.
2008-04-26 04:44:34 +00:00
jb
ace3d24b37 There are many places in libdtrace where errno can be set. When an
error is returned all the way back to the dtrace app, it's hard to
figure out where that error came from.

Add a couple of functions to get and set the error location which can
be optionally compiled into the library.
2008-04-26 04:43:19 +00:00
jb
fd0fbf31aa Add some error definitions for FreeBSD action extensions. 2008-04-26 04:40:38 +00:00
jb
befef11246 * Make this file compile cleanly.
* Use FreeBSD's kld syscalls to get kernel module information instead
  of using an object file system like Solaris uses.
2008-04-26 04:39:26 +00:00
jb
52ee64efcd * Handle the different ioctl design.
* Use FreeBSD's process library API.
* Make the file compile cleanly.
2008-04-26 04:37:01 +00:00
jb
5bfe3a7665 Just leave out a few includes to compile this on FreeBSD. 2008-04-26 04:34:50 +00:00
jb
f1ca15c2de * Get the maximum number of CPUs via a sysctl.
* Handle the different ioctl design.
* Support the freopen() changes.
* Use functions in FreeBSD's process library rather than the CDDL
  library that Solaris has which sits on top of their process file
  system and is therefore unsuitable for use on FreeBSD. The libproc
  API for FreeBSD is deliberately different to that on Solaris because
  Sun wouldn't release the libproc.h header under a BSD license.
2008-04-26 04:33:15 +00:00
jb
fe5ac1ba72 * Define YY_INPUT for flex since input() can't be re-defined.
* On FreeBSD define both LITTLE_ENDIAN and BIG_ENDIAN and then set the
  BYTE_ORDER to the one we are using. On Solaris they define one or
  the other but not both. For us to keep using FreeBSD header files,
  we need to use endian definitions the same way we do in pure BSD
  code.
2008-04-26 04:26:23 +00:00
jb
a656947bce Make this compile cleanly. 2008-04-26 04:22:32 +00:00
jb
2879d0ed4f Handle the different level of indirection between ioctl on SYSV vs BSD. 2008-04-26 04:20:11 +00:00
jb
37e61e49bf freopen() on FreeBSD behaves differently to the Solaris one. 2008-04-26 04:18:35 +00:00
jb
105579b1e6 * Use a portable POSIX timed wait.
* Handle the different ioctl format.
2008-04-26 04:16:17 +00:00
jb
71dafcd844 * Fix a function prototype.
* Allow for the different level of indirection between SYSV's ioctl and BSD's.
* Map a couple of sysconf definitions to one that FreeBSD has.
2008-04-26 04:13:23 +00:00
jb
db2123cf65 Simplify for FreeBSD for now, bypassing the multibyte char variables
that Solaris has. We may need to revisit this issue later.
2008-04-26 04:11:16 +00:00
jb
7063bf54fd Solaris has code which makes zlib optional, so they have to jump through
some hoops to get the compression functions. On FreeBSD have libz and
can just link against it.
2008-04-26 04:09:13 +00:00
jb
6e4e8caae1 'echo' behaviour differs between SYSV and BSD. 2008-04-26 04:03:58 +00:00
jb
17d482cf8c A lot of changes to make this code compile cleanly on FreeBSD. 2008-04-26 04:01:35 +00:00
jb
134952ed1b Use FreeBSD's libdwarf which is BSD licensed instead of the GPL'd one that
is used in Solaris.
2008-04-26 03:59:24 +00:00
jb
4e2e3671df We need to be consistent with prototype definitions. It isn't OK to
use 'const' and just override it whenever we feel like it. If we use
it at all, then we need to do it properly.

Add a couple of functions that were useful in getting this code ported.
2008-04-26 03:56:49 +00:00
jb
c8faa11c4f Make this file compile cleanly. 2008-04-26 03:54:23 +00:00
jb
4f3d158a74 Apply FreeBSD changes. 2008-04-26 03:47:34 +00:00
jb
36ed3b8831 On FreeBSD we can't afford to have a build fail simply because there
was some sort of CTF conversion error.
2008-04-26 03:44:47 +00:00
jb
221a9b981e Add a missing include file. We care about function prototype definitions. 2008-04-26 03:40:56 +00:00
jb
6a2b90b707 Apply FreeBSD changes.
There is an incomplete piece of code in here which requires the process
handling library which is still under development.
2008-04-26 03:39:02 +00:00
jb
7cf5dd8cd4 * Set the path to perl on FreeBSD.
* Use the FreeBSD shell.
* On FreeBSD the tests run from the OBJDIR, so output files go there
  rather than in the source tree like they do on Solaris.
* FreeBSD doesn't need a special path to the compiler.
2008-04-26 03:36:28 +00:00
jb
92d707013b Set the path to perl on FreeBSD. 2008-04-26 03:34:22 +00:00
jb
1b79cc0861 Port these test files to work under FreeBSD. 2008-04-26 03:32:20 +00:00
jb
52c14c7a3f Vendor import of the full userland contrib part of DTrace support from
OpenSolaris. This commit resets files to match the versions in the
OpenSolaris tree as of 2008/04/10.

The changes in this import from the previous import are the ones that
will subsequently re-applied to take files off the vendor branch. This
is unfortunately necessary because the Solaris developers won't allow
FreeBSD support #ifdefs in their source code because that creates
'dead code' (stuff that they never compile).
2008-04-26 00:54:52 +00:00
jb
c597f58d4f This commit was generated by cvs2svn to compensate for changes in r178528,
which included commits to RCS files with non-trunk default branches.
2008-04-26 00:54:52 +00:00
jb
cb8ce77727 Vendor import of DTrace support files from OpenSolaris. 2008-04-25 23:33:18 +00:00
jb
18b082dc88 This commit was generated by cvs2svn to compensate for changes in r178525,
which included commits to RCS files with non-trunk default branches.
2008-04-25 23:33:18 +00:00
jb
ce71c4333f Vendor import of the CTF (Compact C Type Format) code used by DTrace
from OpenSolaris.
2008-04-25 09:07:28 +00:00
jb
b63bf93fe6 This commit was generated by cvs2svn to compensate for changes in r178481,
which included commits to RCS files with non-trunk default branches.
2008-04-25 09:07:28 +00:00
jb
e01c5b1252 Vendor import of libraries for DTrace from OpenSolaris. 2008-04-25 09:04:09 +00:00
jb
d4d782d7b1 This commit was generated by cvs2svn to compensate for changes in r178479,
which included commits to RCS files with non-trunk default branches.
2008-04-25 09:04:09 +00:00
jb
871ee96d6f Vendor import of the DTrace app and test suite from OpenSolaris. 2008-04-25 06:56:31 +00:00
jb
41b995a0c9 This commit was generated by cvs2svn to compensate for changes in r178476,
which included commits to RCS files with non-trunk default branches.
2008-04-25 06:56:31 +00:00
jb
d018fd8cf0 Add FreeBSD IDs to files that originate in FreeBSD. 2008-04-22 07:43:00 +00:00
ru
0f0375e36a Remove options MK_LIBKSE and DEFAULT_THREAD_LIB now that we no longer
build libkse.  This should fix WITHOUT_LIBTHR builds as a side effect.
2008-03-29 17:44:40 +00:00
jb
5794ada908 The sources covered by Sun's CDDL have been repo copied below the
src/cddl and src/sys/cddl directories per the core@ decision following
the license review.

This change modifies the affected Makefiles to reference the sources
in their new location.
2008-03-27 23:21:25 +00:00
jb
769c37d0ba Remove _SOLARIS_C_SOURCE now that it doesn't do anything in FreeBSD
headers. All OpenSolaris compatibility comes via the set of specific
compatibility headers in src/compat/opensolaris and
src/sys/compat/opensolaris.
2007-11-28 22:58:09 +00:00
jb
148af6bc9b Remove a couple of definitions which now exist in compatibility headers. 2007-11-28 22:10:36 +00:00
jb
817ac88e3e Add more OpenSolaris compatibilty headers. 2007-11-28 21:40:07 +00:00
obrien
a1598920aa Tweak the handling of "WITHOUT_LIBPTHREAD". Also remove the accidental
treatment of 'LIBKSE' as an "old style" knob.

Submitted by:	ru
Approved by:	re(kensmith)
2007-10-09 23:31:11 +00:00
obrien
eb3f6a9e74 Repo copy libpthreads to libkse.
This introduces the WITHOUT_LIBKSE nob,
and changes WITHOUT_LIBPTHREADS to mean with neither threading libs.
Approved by:	re(kensmith)
2007-10-09 13:42:34 +00:00
ru
c05a2547c6 Don't build bits that depend on the pthreads support if a
system was configured without such support.

Approved by:	re (kensmith)
2007-10-01 18:23:24 +00:00
ru
62d48a1604 Fixed static linkage (build with -DNO_SHARED).
Approved by:	re (kensmith)
2007-10-01 18:17:24 +00:00
pjd
a4c30a2063 Now that we have CDDLed code in the tree, add CDDL license.
Discussed with:	core
Approved by:	re (kensmith)
2007-09-23 07:04:50 +00:00
simokawa
194ebb69c9 Use ioctl() to get correct media size so that we can locate
ZFS labels in the tail of the media.

Approved by: re (kensmith), pjd
2007-08-07 12:42:03 +00:00
pjd
9eba2904d1 - Reduce number of atomic operations needed to be implemented in asm by
implementing some of them using existing ones.
- Allow to compile ZFS on all archs and use atomic operations surrounded
  by global mutex on archs we don't have or can't have all atomic
  operations needed by ZFS.
2007-06-08 12:35:47 +00:00
pjd
1effa32b66 Use provider's ident to handle situations when disks are moved around
and show up with different names: first try to open provider using
remembered name and compare its ident, if equal, this is our provider,
if not equal or there is no provider with such name, find provider with
remembered ident and don't care about the name.
2007-05-06 01:39:39 +00:00
pjd
cf2d754ee0 Clean up a little.
Obtained from:	OpenSolaris
2007-05-06 01:23:03 +00:00
pjd
2cd524ebed Improve sharenfs option handling, so it is possible to give hosts list.
Before the change the command above:

	# zfs set sharenfs=freefall.freebsd.org,69.147.83.54 tank/foo

was translated to:

/tank/foo -freefall.freebsd.org -69.147.83.54

instead of:

/tank/foo freefall.freebsd.org 69.147.83.54

This commit corrects this.
2007-04-21 13:17:23 +00:00
pjd
24d4489802 MFp4:
@118370	Correct typo.

@118371	Integrate changes from vendor.

@118491	Show backtrace on unexpected code paths.

@118494	Integrate changes from vendor.

@118504	Fix sendfile(2). I had two ways of fixing it:
	1. Fixing sendfile(2) itself to use VOP_GETPAGES() instead of
	   hacking around with vn_rdwr(UIO_NOCOPY), which was suggested
	   by ups.
	2. Modify ZFS behaviour to handle this special case.

	Although 1 is more correct, I've choosen 2, because hack from 1
	have a side-effect of beeing faster - it reads ahead MAXBSIZE
	bytes instead of reading page by page. This is not easy to implement
	with VOP_GETPAGES(), at least not for me in this very moment.

	Reported by:	Andrey V. Elsukov <bu7cher@yandex.ru>

@118525	Reorganize the code to reduce diff.

@118526	This code path is expected. It is simply when file is opened with
	O_FSYNC flag.

	Reported by:	kris
	Reported by:	Michal Suszko <dry@dry.pl>
2007-04-21 12:02:57 +00:00
pjd
485e86be3b Fix build breakage. Most of ZFS code is also compiled in userland and I
should really stop forgetting about that.
2007-04-17 21:38:15 +00:00
pjd
5c0f9c4bd3 Link libzpool, ztest and zdb against libpthread.
Requested by:	ru
2007-04-17 15:52:37 +00:00
ru
fc861d6ddf Apply a set of style.Makefile(5) changes to src/cddl/ makefiles.
There are some insignificant non-style changes as well.

Not fixed: makefiles use ${LIBTHR} that doesn't exist, thus
breaking "make checkdpadd" and not tracking dependencies
properly.

Approved by:	pjd
2007-04-16 21:20:26 +00:00
simokawa
2867905cf5 In FreeBSD,
- cv_timedwait() takes delta instead of absolute time,
- we need ioctl() for mediasize.

Reviewed by: pjd
2007-04-14 14:39:38 +00:00
pjd
f2c622ab52 MFp4: Synchronize with vendor (mostly 'zfs rename -r'). 2007-04-12 23:16:02 +00:00
pjd
3a0d881c5a MFp4: Add missing kmem_size() definition. 2007-04-10 13:26:45 +00:00
pjd
adf9b82198 MFp4: Hide under '#ifdef _KERNEL' only what's really needed. 2007-04-10 12:52:14 +00:00
pjd
2b260dcd5e MFp4: Synchronize with recent OpenSolaris changes. 2007-04-08 16:29:25 +00:00
pjd
f04caa18dd If we cannot open /dev/zfs try to load zfs.ko automatically and reopen. 2007-04-08 03:02:08 +00:00
pjd
65ca3ed324 Move atomic.S files to directories that better fit OpenSolaris directory
layout.
2007-04-07 23:54:54 +00:00
des
fa363796e1 Build ZFS on amd64 and pc98.
Approved by:	pjd@
2007-04-07 19:12:10 +00:00
pjd
3b005d3302 Please welcome ZFS - The last word in file systems.
ZFS file system was ported from OpenSolaris operating system. The code in under
CDDL license.

I'd like to thank all SUN developers that created this great piece of software.

Supported by:	Wheel LTD (http://www.wheel.pl/)
Supported by:	The FreeBSD Foundation (http://www.freebsdfoundation.org/)
Supported by:	Sentex (http://www.sentex.net/)
2007-04-06 01:09:06 +00:00