Refresh linux-have-sysevent

This commit is contained in:
Brian Behlendorf 2008-12-05 12:14:06 -08:00
parent fd606af35c
commit cc13ead89c
4 changed files with 18 additions and 10 deletions

View File

@ -1 +1 @@
zfs-branch
linux-kernel-module

18
.topmsg
View File

@ -1,11 +1,15 @@
From: Brian Behlendorf <behlendorf1@llnl.gov>
Subject: [PATCH] linux kernel module
Subject: [PATCH] linux have sysevent
Setup linux kernel module support, this includes:
- zfs context for kernel/user
- kernel module build system integration
- kernel module macros
- kernel module symbol export
- kernel module options
Use sysevent if HAVE_SYSEVENT defined
We don't have FMA in Linux, so disable spa_event_notify() to allow
compilation. It would be a good idea to code at least some kind of
ad-hoc notification for such events, e.g., make it output some syslog
messages when a disk faults/fails.
Also, I think it's FMA in Solaris that is responsible for triggering the
hot spares when a disk starts failing, so we should also think about
doing this in Linux.
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>

View File

@ -530,7 +530,11 @@ extern int spa_prop_get(spa_t *spa, nvlist_t **nvp);
extern void spa_prop_clear_bootfs(spa_t *spa, uint64_t obj, dmu_tx_t *tx);
/* asynchronous event notification */
#ifdef HAVE_SYSEVENT
extern void spa_event_notify(spa_t *spa, vdev_t *vdev, const char *name);
#else
#define spa_event_notify(s,v,n) ((void)0)
#endif
#ifdef ZFS_DEBUG
#define dprintf_bp(bp, fmt, ...) do { \

View File

@ -4252,10 +4252,10 @@ spa_has_active_shared_spare(spa_t *spa)
* in the userland libzpool, as we don't want consumers to misinterpret ztest
* or zdb as real changes.
*/
#ifdef HAVE_SYSEVENT
void
spa_event_notify(spa_t *spa, vdev_t *vd, const char *name)
{
#ifdef _KERNEL
sysevent_t *ev;
sysevent_attr_list_t *attr = NULL;
sysevent_value_t value;
@ -4300,8 +4300,8 @@ done:
if (attr)
sysevent_free_attr(attr);
sysevent_free(ev);
#endif
}
#endif /* HAVE_SYSEVENT */
#if defined(_KERNEL) && defined(HAVE_SPL)
/* state manipulation functions */