Commit Graph

1406 Commits

Author SHA1 Message Date
Brian Behlendorf ae9ef8987f Merge branch 'linux-libspl' into refs/top-bases/linux-zfs-branch 2010-05-18 13:42:34 -07:00
Brian Behlendorf c98946e318 Add missing CDDL headers. 2010-05-18 13:38:06 -07:00
Brian Behlendorf c5004e8fb1 Merge branch 'linux-libspl' into refs/top-bases/linux-zfs-branch 2010-05-18 12:53:04 -07:00
Brian Behlendorf 2a80af91ed Remove nvpair_alloc_system.c change in libspl topic branch.
A change to the nvpair implementation should not have been made in
the libspl-topic branch.  This patch fixes that accident by reverting
the change and providing the missing libspl header to allow the
proper building of nvpair_alloc_system.c without the need to modify it.
2010-05-18 12:47:08 -07:00
Brian Behlendorf 9c65da32f1 Merge branch 'linux-legacy' into refs/top-bases/linux-zfs-branch 2010-05-18 12:17:18 -07:00
Brian Behlendorf a056f3de6d Revert linux-legacy topic branch.
These changes were made when some development was still occuring
under RHEL4.  Since then the needed fopendir() and atopen() APIs
have become commonly available under Linux.  Since I have no
intention of supporting systems as old as RHEL4 we can safely
drop the topic branch.
2010-05-18 12:10:13 -07:00
Brian Behlendorf feb723fa7d Merge branch 'linux-events' into refs/top-bases/linux-zfs-branch 2010-05-14 12:55:10 -07:00
Brian Behlendorf 97d19a5e45 Add linux-events topic branch for zevent handling.
This topic branch leverages the Solaris style FMA call points
in ZFS to create a user space visible event notification system
under Linux.  This new system is called zevent and it unifies
all previous Solaris style ereports and sysevent notifications.

Under this Linux specific scheme when a sysevent or ereport event
occurs an nvlist describing the event is created which looks almost
exactly like a Solaris ereport.  These events are queued up in the
kernel when they occur and conditionally logged to the console.
It is then up to a user space application to consume the events
and do whatever it likes with them.

To make this possible the existing /dev/zfs ABI has been extended
with two new ioctls which behave as follows.

* ZFS_IOC_EVENTS_NEXT
Get the next pending event.  The kernel will keep track of the last
event consumed by the file descriptor and provide the next one if
available.  If no new events are available the ioctl() will block
waiting for the next event.  This ioctl may also be called in a
non-blocking mode by setting zc.zc_guid = ZEVENT_NONBLOCK.  In the
non-blocking case if no events are available ENOENT will be returned.
It is possible that ESHUTDOWN will be returned if the ioctl() is
called while module unloading is in progress.  And finally ENOMEM
may occur if the provided nvlist buffer is not large enough to
contain the entire event.

* ZFS_IOC_EVENTS_CLEAR
Clear are events queued by the kernel.  The kernel will keep a fairly
large number of recent events queued, use this ioctl to clear the
in kernel list.  This will effect all user space processes consuming
events.

The zpool command has been extended to use this events ABI with the
'events' subcommand.  You may run 'zpool events -v' to output a
verbose log of all recent events.  This is very similar to the
Solaris 'fmdump -ev' command with the key difference being it also
includes what would be considered sysevents under Solaris.  You
may also run in follow mode with the '-f' option.  To clear the
in kernel event queue use the '-c' option.

$ sudo cmd/zpool/zpool events -fv
TIME                        CLASS
May 13 2010 16:31:15.777711000 ereport.fs.zfs.config.sync
        class = "ereport.fs.zfs.config.sync"
        ena = 0x40982b7897700001
        detector = (embedded nvlist)
                version = 0x0
                scheme = "zfs"
                pool = 0xed976600de75dfa6
        (end detector)

        time = 0x4bec8bc3 0x2e5aed98
        pool = "zpios"
        pool_guid = 0xed976600de75dfa6
        pool_context = 0x0

While the 'zpool events' command is handy for interactive debugging
it is not expected to be the primary consumer of zevents.  This ABI
was primarily added to facilitate the addition of a user space
monitoring daemon.  This daemon would consume all events posted by
the kernel and based on the type of event perform an action.  For
most events simply forwarding them on to syslog is likely enough.
But this interface also cleanly allows for more sophisticated
actions to be taken such as generating an email for a failed drive
2010-05-14 12:40:44 -07:00
Brian Behlendorf 821a652a56 Merge commit 'refs/top-bases/linux-libspl' into linux-libspl 2010-05-14 11:01:17 -07:00
Brian Behlendorf 7088870ae6 Merge commit 'refs/top-bases/linux-legacy' into linux-legacy 2010-05-14 11:00:41 -07:00
Brian Behlendorf 6ae8aa39ab Merge branch 'linux-docs' into refs/top-bases/linux-zfs-branch 2010-05-14 10:59:57 -07:00
Brian Behlendorf 20ee89f0f2 Add nvpair_alloc_fixed.c in to libnvpair build. 2010-05-14 10:55:02 -07:00
Brian Behlendorf 3809bc6ac5 Merge branch 'linux-libspl' into refs/top-bases/linux-zfs-branch 2010-05-14 10:44:12 -07:00
Brian Behlendorf 9b8aa5f57e Extend libspl as required for linux FMA integration.
These changes lay some of the ground work for supporting something
similar to FMA event under Solaris.  In particular these changes
add or modify the following areas.

First off an implementation of the gethrestime() function is added
to libspl.  Secondly, the missing type processorid_t has been added.
And finally the lib/libspl/include/sys/fm/{protocol.h|util.h} stub
headers have been removed in favor of updating the full versions
in module/zfs/include/sys/fm/{protocol.h|util.h} to work cleanly
in both user and kernel space.
2010-05-14 10:33:00 -07:00
Brian Behlendorf 8e870b63d0 Merge branch 'linux-have-sysevent' into refs/top-bases/linux-zfs-branch 2010-04-29 13:15:30 -07:00
Brian Behlendorf d6f1146154 Remove changes from linux-have-sysevent to prepare for topic branch removal. 2010-04-29 13:12:25 -07:00
Brian Behlendorf 35afc56620 Merge branch 'linux-libspl' into refs/top-bases/linux-zfs-branch 2010-04-29 12:33:39 -07:00
Brian Behlendorf c14cca5c07 Add fm_init/fm_fini stubs for user space FMA update. 2010-04-29 12:25:18 -07:00
Brian Behlendorf 0ff721ce5d Merge commit 'refs/top-bases/linux-libspl' into linux-libspl 2010-04-29 11:02:17 -07:00
Brian Behlendorf 0461f831ed Merge commit 'refs/top-bases/linux-legacy' into linux-legacy 2010-04-29 11:01:47 -07:00
Brian Behlendorf 208e42ffe6 Merge commit 'refs/top-bases/linux-have-sysevent' into linux-have-sysevent 2010-04-29 11:01:23 -07:00
Brian Behlendorf ea12ca13bf Merge commit 'refs/top-bases/linux-kernel-module' into linux-kernel-module 2010-04-29 11:01:22 -07:00
Brian Behlendorf 76d877a211 Merge branch 'linux-docs' into refs/top-bases/linux-zfs-branch 2010-04-29 11:00:49 -07:00
Brian Behlendorf 4d5d0f9ef5 Include FMA source and headers in build system 2010-04-29 10:55:27 -07:00
Brian Behlendorf fb427cf371 Merge branch 'linux-libspl' into refs/top-bases/linux-zfs-branch 2010-03-23 14:58:27 -07:00
Brian Behlendorf ee2a998f37 Move zfs_config.h include to command line -include
Remove the few places in the code where zfs_config.h is included.
It is now added to the gcc compile line to ensure the config results
2010-03-23 14:54:00 -07:00
Brian Behlendorf 20894b4487 Merge branch 'linux-libspl' into refs/top-bases/linux-zfs-branch 2010-03-10 12:09:33 -08:00
Brian Behlendorf c7c19c1259 Merge branch 'linux-user-disk' into refs/top-bases/linux-zfs-branch 2010-03-10 12:09:32 -08:00
Ricardo M. Correia 2c79a2fa6a Fix a few zdb bugs when trying to open a pool
Specifically, the following bugs are fixed in this patch:

1) zdb wasn't getting the correct device size when the vdev is a
block device.  In Solaris, fstat64() returns the device size but
in Linux an ioctl() is needed.

2) We were opening block devices with O_DIRECT, which caused pread64()
to fail with EINVAL due to memory alignment issues.  This was fixed by
the previous umem cache alignment fix in stub implementation to align
objects correctly.  But we still needed to add a check for the error here.

3) We also make sure that we don't try to open a block device in write
mode in userspace.  This shouldn't happen, because zdb opens devices
in read-only mode, and ztest only uses files.
2010-03-10 12:03:48 -08:00
Ricardo M. Correia c557557e4a Add umem_alloc_aligned() and honor cache_align field for umem caches
Under linux we open block devices with O_DIRECT which means we must
provide aligned memory buffers.  This patch adds the needed umem
interfaces or in the case of caches simply honors alignment provided
at cache creation time.
2010-03-10 11:51:43 -08:00
Brian Behlendorf 3670186d0a Merge commit 'refs/top-bases/linux-libspl' into linux-libspl 2010-03-10 09:59:28 -08:00
Brian Behlendorf 1186ea3781 Merge commit 'refs/top-bases/linux-user-disk' into linux-user-disk 2010-03-10 09:59:14 -08:00
Brian Behlendorf 211edca1cc Merge commit 'refs/top-bases/linux-legacy' into linux-legacy 2010-03-10 09:59:00 -08:00
Brian Behlendorf 724a450233 Merge commit 'refs/top-bases/linux-have-sysevent' into linux-have-sysevent 2010-03-10 09:58:38 -08:00
Brian Behlendorf c1c14c18c8 Merge commit 'refs/top-bases/linux-kernel-module' into linux-kernel-module 2010-03-10 09:58:37 -08:00
Brian Behlendorf a97cedc2df Merge branch 'linux-docs' into refs/top-bases/linux-zfs-branch 2010-03-10 09:58:07 -08:00
Brian Behlendorf 7223b8df33 Merge commit 'refs/top-bases/zfs-branch' into zfs-branch 2010-03-10 09:58:04 -08:00
Brian Behlendorf 54cf7ab2bc Merge branch 'fix-branch' into refs/top-bases/zfs-branch 2010-03-10 09:58:03 -08:00
Brian Behlendorf 166355dcf0 Merge branch 'fix-error-handling' into refs/top-bases/fix-branch 2010-03-10 09:54:43 -08:00
Ricardo M. Correia 62a0ac8f22 Fix some incorrect error handling.
In vn_open(), if fstat64() returned an error, the real errno
was being obscured by calling close().

Add error handling for both pwrite64() calls in vn_rdwr().
2010-03-10 09:53:53 -08:00
Brian Behlendorf 6521b99461 Merge branch 'linux-user-disk' into refs/top-bases/linux-zfs-branch 2010-03-09 13:43:29 -08:00
Ricardo M. Correia f1c8b3a435 Fix duplicate uuid_t typedef.
This typedef is being done in both lib/libefi/include/sys/uuid.h and
/usr/include/uuid/uuid.h, both of which are included in lib/libefi/rdwr_efi.c.

This leads to the following error:

In file included from ../../lib/libefi/include/sys/efi_partition.h:29,
                 from ../../lib/libefi/rdwr_efi.c:41:
../../lib/libefi/include/sys/uuid.h:81: error: redefinition of typedef 'uuid_t'
/usr/include/uuid/uuid.h:19: note: previous declaration of 'uuid_t' was here

The reason that we didn't see this before, is because of a strange feature in
gcc where some types of warnings/errors are silently ignored if they come from
system headers. But depending on the order of how system headers end up
included, libefi's uuid.h may actually be included after uuid/uuid.h, which
leads to the error above.

It is safe to remove this duplicate typedef because we are already
dependent on the linux uuid.h header and it's exceptionally unlikely
they will ever change the size.
2010-03-09 13:38:55 -08:00
Brian Behlendorf fdab6de381 Merge commit 'refs/top-bases/linux-libspl' into linux-libspl 2010-03-09 12:31:32 -08:00
Brian Behlendorf 4b2b113239 Merge commit 'refs/top-bases/linux-user-disk' into linux-user-disk 2010-03-09 12:31:18 -08:00
Brian Behlendorf d9f3a394cb Merge commit 'refs/top-bases/linux-legacy' into linux-legacy 2010-03-09 12:31:04 -08:00
Brian Behlendorf feac56bf5a Merge commit 'refs/top-bases/linux-have-sysevent' into linux-have-sysevent 2010-03-09 12:30:44 -08:00
Brian Behlendorf 17a96f44f3 Merge commit 'refs/top-bases/linux-kernel-module' into linux-kernel-module 2010-03-09 12:30:43 -08:00
Brian Behlendorf 573328741b Merge branch 'linux-have-fm' into refs/top-bases/linux-zfs-branch 2010-03-09 12:30:21 -08:00
Brian Behlendorf 8f63d438cd Merge commit 'refs/top-bases/zfs-branch' into zfs-branch 2010-03-09 12:30:18 -08:00
Brian Behlendorf 48e74ed68b Merge branch 'feature-branch' into refs/top-bases/zfs-branch
Conflicts:

	cmd/ztest/ztest.c
2010-03-09 12:30:03 -08:00