From 3a0400ad88f88077c37959ca8a829ffbe26f0d75 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Mon, 14 Jun 2010 15:57:09 -0700 Subject: [PATCH] Update linux-events Minor updates to linux-events to handle some upstream changes. Luckily, this was done flexibly enough the first time it wasn't much of a problem. --- lib/libzfs/libzfs_pool.c | 4 ++-- module/zfs/dsl_scan.c | 9 ++++----- module/zfs/fm.c | 2 +- module/zfs/include/sys/fm/util.h | 4 ++-- module/zfs/spa.c | 2 +- module/zfs/zfs_fm.c | 10 +++++----- 6 files changed, 15 insertions(+), 16 deletions(-) diff --git a/lib/libzfs/libzfs_pool.c b/lib/libzfs/libzfs_pool.c index cdc2d29438..e1e7d57804 100644 --- a/lib/libzfs/libzfs_pool.c +++ b/lib/libzfs/libzfs_pool.c @@ -3431,7 +3431,7 @@ zpool_get_history(zpool_handle_t *zhp, nvlist_t **nvhisp) int zpool_events_next(libzfs_handle_t *hdl, nvlist_t **nvp, int *dropped, int block) { - zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; int error = 0; *nvp = NULL; @@ -3489,7 +3489,7 @@ out: int zpool_events_clear(libzfs_handle_t *hdl, int *count) { - zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 }; char msg[1024]; (void) snprintf(msg, sizeof (msg), dgettext(TEXT_DOMAIN, diff --git a/module/zfs/dsl_scan.c b/module/zfs/dsl_scan.c index 0eb1b1f782..18e2fa1690 100644 --- a/module/zfs/dsl_scan.c +++ b/module/zfs/dsl_scan.c @@ -50,9 +50,7 @@ typedef int (scan_cb_t)(dsl_pool_t *, const blkptr_t *, const zbookmark_t *); -static scan_cb_t dsl_scan_defrag_cb; static scan_cb_t dsl_scan_scrub_cb; -static scan_cb_t dsl_scan_remove_cb; static dsl_syncfunc_t dsl_scan_cancel_sync; static void dsl_scan_sync_state(dsl_scan_t *, dmu_tx_t *tx); @@ -189,9 +187,9 @@ dsl_scan_setup_sync(void *arg1, void *arg2, dmu_tx_t *tx) if (vdev_resilver_needed(spa->spa_root_vdev, &scn->scn_phys.scn_min_txg, &scn->scn_phys.scn_max_txg)) { - spa_event_notify(spa, NULL, ESC_ZFS_RESILVER_START); + spa_event_notify(spa, NULL, FM_EREPORT_ZFS_RESILVER_START); } else { - spa_event_notify(spa, NULL, ESC_ZFS_SCRUB_START); + spa_event_notify(spa, NULL, FM_EREPORT_ZFS_SCRUB_START); } spa->spa_scrub_started = B_TRUE; @@ -292,7 +290,8 @@ dsl_scan_done(dsl_scan_t *scn, boolean_t complete, dmu_tx_t *tx) complete ? scn->scn_phys.scn_max_txg : 0, B_TRUE); if (complete) { spa_event_notify(spa, NULL, scn->scn_phys.scn_min_txg ? - ESC_ZFS_RESILVER_FINISH : ESC_ZFS_SCRUB_FINISH); + FM_EREPORT_ZFS_RESILVER_FINISH : + FM_EREPORT_ZFS_SCRUB_FINISH); } spa_errlog_rotate(spa); diff --git a/module/zfs/fm.c b/module/zfs/fm.c index 5b06d49d01..0c94ade288 100644 --- a/module/zfs/fm.c +++ b/module/zfs/fm.c @@ -432,7 +432,7 @@ static void fm_event_free(zevent_t *ev) { /* Run provided cleanup callback */ - ev->ev_cb(ev->ev_nvl); + ev->ev_cb(ev->ev_nvl, ev->ev_detector); list_destroy(&ev->ev_zpd_list); kmem_free(ev, sizeof(zevent_t)); diff --git a/module/zfs/include/sys/fm/util.h b/module/zfs/include/sys/fm/util.h index 959931939a..03eb18ea29 100644 --- a/module/zfs/include/sys/fm/util.h +++ b/module/zfs/include/sys/fm/util.h @@ -79,7 +79,7 @@ typedef struct erpt_dump { #define ZEVENT_SHUTDOWN 0x1 -typedef void zevent_cb_t(nvlist_t *); +typedef void zevent_cb_t(nvlist_t *, nvlist_t *); typedef struct zevent_s { nvlist_t *ev_nvl; /* protected by the zevent_lock */ @@ -100,7 +100,7 @@ extern void fm_fini(void); extern void fm_nvprint(nvlist_t *); extern void fm_zevent_init(zfs_private_data_t *); extern void fm_zevent_fini(zfs_private_data_t *); -extern void fm_zevent_post(nvlist_t *, zevent_cb_t *); +extern void fm_zevent_post(nvlist_t *, nvlist_t *, zevent_cb_t *); extern void fm_zevent_drain_all(int *); extern int fm_zevent_next(zfs_private_data_t *, zfs_cmd_t *); extern int fm_zevent_wait(zfs_private_data_t *); diff --git a/module/zfs/spa.c b/module/zfs/spa.c index 081a215844..74e6747da3 100644 --- a/module/zfs/spa.c +++ b/module/zfs/spa.c @@ -4038,7 +4038,7 @@ spa_vdev_detach(spa_t *spa, uint64_t guid, uint64_t pguid, int replace_done) vd->vdev_detached = B_TRUE; vdev_dirty(tvd, VDD_DTL, vd, txg); - spa_event_notify(spa, vd, ESC_ZFS_VDEV_REMOVE); + spa_event_notify(spa, vd, FM_EREPORT_ZFS_DEVICE_REMOVE); error = spa_vdev_exit(spa, vd, txg, 0); diff --git a/module/zfs/zfs_fm.c b/module/zfs/zfs_fm.c index 91d2104003..5138f49e52 100644 --- a/module/zfs/zfs_fm.c +++ b/module/zfs/zfs_fm.c @@ -235,7 +235,6 @@ zfs_ereport_start(nvlist_t **ereport_out, nvlist_t **detector_out, vd != NULL ? vd->vdev_guid : 0); fm_ereport_set(ereport, FM_EREPORT_VERSION, class, ena, detector, NULL); - fm_nvlist_destroy(detector, FM_NVA_FREE); /* * Construct the per-ereport payload, depending on which parameters are @@ -440,12 +439,13 @@ shrink_ranges(zfs_ecksum_info_t *eip) uint32_t end = r[idx].zr_end; while (idx < max - 1) { + uint32_t nstart, nend, gap; + idx++; + nstart = r[idx].zr_start; + nend = r[idx].zr_end; - uint32_t nstart = r[idx].zr_start; - uint32_t nend = r[idx].zr_end; - - uint32_t gap = nstart - end; + gap = nstart - end; if (gap < new_allowed_gap) { end = nend; continue;