Commit Graph

92 Commits

Author SHA1 Message Date
John Birrell
187379693c * Handle the different ioctl design.
* Add a couple of FreeBSD action extensions.
2008-04-26 05:09:19 +00:00
John Birrell
41ec19c071 Make this file compile cleanly. 2008-04-26 05:07:54 +00:00
John Birrell
2c981f99ef Leave out some header files. 2008-04-26 05:07:07 +00:00
John Birrell
2693feb411 * 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
John Birrell
5fe26f7c08 * Make this file compile cleanly.
* Add FreeBSD constructor/destructor definitions.
2008-04-26 05:03:22 +00:00
John Birrell
fb24b944be * 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
John Birrell
132df6e9ab * Handle the different ioctl design.
* Make this file compile cleanly.
2008-04-26 04:57:45 +00:00
John Birrell
5ec5669275 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
John Birrell
84098f48c6 Leave out a header file. 2008-04-26 04:54:58 +00:00
John Birrell
cccc7d47c0 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
John Birrell
bbda5851ce * 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
John Birrell
d46d190310 Leave out the hook that Solaris has into it's rtld. 2008-04-26 04:49:02 +00:00
John Birrell
f5a736457d * 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
John Birrell
cd14ec8113 * Handle the different ioctl design.
* Make the file compile cleanly.
2008-04-26 04:44:34 +00:00
John Birrell
768c574fc0 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
John Birrell
79673c5671 Add some error definitions for FreeBSD action extensions. 2008-04-26 04:40:38 +00:00
John Birrell
f1e56186ea * 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
John Birrell
d9ce014461 * Handle the different ioctl design.
* Use FreeBSD's process library API.
* Make the file compile cleanly.
2008-04-26 04:37:01 +00:00
John Birrell
40de299f6b Just leave out a few includes to compile this on FreeBSD. 2008-04-26 04:34:50 +00:00
John Birrell
b29602e4d8 * 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
John Birrell
51e031e870 * 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
John Birrell
c839260786 Make this compile cleanly. 2008-04-26 04:22:32 +00:00
John Birrell
df5c121dfe Handle the different level of indirection between ioctl on SYSV vs BSD. 2008-04-26 04:20:11 +00:00
John Birrell
29f89dfce7 freopen() on FreeBSD behaves differently to the Solaris one. 2008-04-26 04:18:35 +00:00
John Birrell
1cbe5a9868 * Use a portable POSIX timed wait.
* Handle the different ioctl format.
2008-04-26 04:16:17 +00:00
John Birrell
a76c5ce792 * 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
John Birrell
18db5bcf28 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
John Birrell
76429c36b0 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
John Birrell
abb532f661 'echo' behaviour differs between SYSV and BSD. 2008-04-26 04:03:58 +00:00
John Birrell
20594ebf90 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
John Birrell
6ff6d951ad 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
John Birrell
cc6a651e49 Remove a couple of definitions which now exist in compatibility headers. 2007-11-28 22:10:36 +00:00
Pawel Jakub Dawidek
433c2705cd Clean up a little.
Obtained from:	OpenSolaris
2007-05-06 01:23:03 +00:00
Pawel Jakub Dawidek
9de81c7273 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
Pawel Jakub Dawidek
3d357b8835 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
Hidetoshi Shimokawa
01498c0b83 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
Pawel Jakub Dawidek
6704017a15 MFp4: Synchronize with vendor (mostly 'zfs rename -r'). 2007-04-12 23:16:02 +00:00
Pawel Jakub Dawidek
9d0fe178e6 MFp4: Add missing kmem_size() definition. 2007-04-10 13:26:45 +00:00
Pawel Jakub Dawidek
5b9528e2d4 MFp4: Hide under '#ifdef _KERNEL' only what's really needed. 2007-04-10 12:52:14 +00:00
Pawel Jakub Dawidek
ffe54ff0ec MFp4: Synchronize with recent OpenSolaris changes. 2007-04-08 16:29:25 +00:00
Pawel Jakub Dawidek
902cbe0df8 If we cannot open /dev/zfs try to load zfs.ko automatically and reopen. 2007-04-08 03:02:08 +00:00
Pawel Jakub Dawidek
f0a75d274a 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