Refresh linux-have-sysevent
This commit is contained in:
parent
fd606af35c
commit
cc13ead89c
18
.topmsg
18
.topmsg
|
@ -1,11 +1,15 @@
|
||||||
From: Brian Behlendorf <behlendorf1@llnl.gov>
|
From: Brian Behlendorf <behlendorf1@llnl.gov>
|
||||||
Subject: [PATCH] linux kernel module
|
Subject: [PATCH] linux have sysevent
|
||||||
|
|
||||||
Setup linux kernel module support, this includes:
|
Use sysevent if HAVE_SYSEVENT defined
|
||||||
- zfs context for kernel/user
|
|
||||||
- kernel module build system integration
|
We don't have FMA in Linux, so disable spa_event_notify() to allow
|
||||||
- kernel module macros
|
compilation. It would be a good idea to code at least some kind of
|
||||||
- kernel module symbol export
|
ad-hoc notification for such events, e.g., make it output some syslog
|
||||||
- kernel module options
|
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>
|
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
|
||||||
|
|
|
@ -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);
|
extern void spa_prop_clear_bootfs(spa_t *spa, uint64_t obj, dmu_tx_t *tx);
|
||||||
|
|
||||||
/* asynchronous event notification */
|
/* asynchronous event notification */
|
||||||
|
#ifdef HAVE_SYSEVENT
|
||||||
extern void spa_event_notify(spa_t *spa, vdev_t *vdev, const char *name);
|
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
|
#ifdef ZFS_DEBUG
|
||||||
#define dprintf_bp(bp, fmt, ...) do { \
|
#define dprintf_bp(bp, fmt, ...) do { \
|
||||||
|
|
|
@ -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
|
* in the userland libzpool, as we don't want consumers to misinterpret ztest
|
||||||
* or zdb as real changes.
|
* or zdb as real changes.
|
||||||
*/
|
*/
|
||||||
|
#ifdef HAVE_SYSEVENT
|
||||||
void
|
void
|
||||||
spa_event_notify(spa_t *spa, vdev_t *vd, const char *name)
|
spa_event_notify(spa_t *spa, vdev_t *vd, const char *name)
|
||||||
{
|
{
|
||||||
#ifdef _KERNEL
|
|
||||||
sysevent_t *ev;
|
sysevent_t *ev;
|
||||||
sysevent_attr_list_t *attr = NULL;
|
sysevent_attr_list_t *attr = NULL;
|
||||||
sysevent_value_t value;
|
sysevent_value_t value;
|
||||||
|
@ -4300,8 +4300,8 @@ done:
|
||||||
if (attr)
|
if (attr)
|
||||||
sysevent_free_attr(attr);
|
sysevent_free_attr(attr);
|
||||||
sysevent_free(ev);
|
sysevent_free(ev);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#endif /* HAVE_SYSEVENT */
|
||||||
|
|
||||||
#if defined(_KERNEL) && defined(HAVE_SPL)
|
#if defined(_KERNEL) && defined(HAVE_SPL)
|
||||||
/* state manipulation functions */
|
/* state manipulation functions */
|
||||||
|
|
Loading…
Reference in New Issue