summaryrefslogtreecommitdiffstats
path: root/cmd/zed
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/zed')
-rw-r--r--cmd/zed/agents/zfs_diagnosis.c2
-rw-r--r--cmd/zed/agents/zfs_mod.c4
-rw-r--r--cmd/zed/agents/zfs_retire.c4
-rw-r--r--cmd/zed/zed.c2
-rw-r--r--cmd/zed/zed_conf.c6
-rw-r--r--cmd/zed/zed_disk_event.c2
-rw-r--r--cmd/zed/zed_event.c22
-rw-r--r--cmd/zed/zed_exec.c6
-rw-r--r--cmd/zed/zed_log.c16
-rw-r--r--cmd/zed/zed_strings.c2
-rw-r--r--cmd/zed/zed_strings.h11
11 files changed, 36 insertions, 41 deletions
diff --git a/cmd/zed/agents/zfs_diagnosis.c b/cmd/zed/agents/zfs_diagnosis.c
index f10a42ffd..2f2a26cd9 100644
--- a/cmd/zed/agents/zfs_diagnosis.c
+++ b/cmd/zed/agents/zfs_diagnosis.c
@@ -378,7 +378,7 @@ zfs_case_solve(fmd_hdl_t *hdl, zfs_case_t *zcp, const char *faultname,
boolean_t serialize;
nvlist_t *fru = NULL;
#ifdef _HAS_FMD_TOPO
- nvlist_t *fmri
+ nvlist_t *fmri;
topo_hdl_t *thp;
int err;
#endif
diff --git a/cmd/zed/agents/zfs_mod.c b/cmd/zed/agents/zfs_mod.c
index ca18ccf1a..8733de596 100644
--- a/cmd/zed/agents/zfs_mod.c
+++ b/cmd/zed/agents/zfs_mod.c
@@ -343,7 +343,7 @@ zfs_process_add(zpool_handle_t *zhp, nvlist_t *vdev, boolean_t labeled)
list_insert_tail(&g_device_list, device);
zed_log_msg(LOG_INFO, " zpool_label_disk: async '%s' (%llu)",
- leafname, (u_longlong_t) guid);
+ leafname, (u_longlong_t)guid);
return; /* resumes at EC_DEV_ADD.ESC_DISK for partition */
@@ -373,7 +373,7 @@ zfs_process_add(zpool_handle_t *zhp, nvlist_t *vdev, boolean_t labeled)
}
zed_log_msg(LOG_INFO, " zpool_label_disk: resume '%s' (%llu)",
- physpath, (u_longlong_t) guid);
+ physpath, (u_longlong_t)guid);
(void) snprintf(devpath, sizeof (devpath), "%s%s",
DEV_BYID_PATH, new_devid);
diff --git a/cmd/zed/agents/zfs_retire.c b/cmd/zed/agents/zfs_retire.c
index 80617df08..444f23ac8 100644
--- a/cmd/zed/agents/zfs_retire.c
+++ b/cmd/zed/agents/zfs_retire.c
@@ -417,11 +417,11 @@ zfs_retire_recv(fmd_hdl_t *hdl, fmd_event_t *ep, nvlist_t *nvl,
/*
* Note: on zfsonlinux statechange events are more than just
- * healthy ones so we need to confim the actual state value.
+ * healthy ones so we need to confirm the actual state value.
*/
if (strcmp(class, "resource.fs.zfs.statechange") == 0 &&
nvlist_lookup_uint64(nvl, FM_EREPORT_PAYLOAD_ZFS_VDEV_STATE,
- &state) == 0 && state == VDEV_STATE_HEALTHY) {;
+ &state) == 0 && state == VDEV_STATE_HEALTHY) {
zfs_vdev_repair(hdl, nvl);
return;
}
diff --git a/cmd/zed/zed.c b/cmd/zed/zed.c
index 55ab68cd0..bba8b8f64 100644
--- a/cmd/zed/zed.c
+++ b/cmd/zed/zed.c
@@ -255,7 +255,7 @@ main(int argc, char *argv[])
zed_log_msg(LOG_NOTICE,
"ZFS Event Daemon %s-%s (PID %d)",
- ZFS_META_VERSION, ZFS_META_RELEASE, (int) getpid());
+ ZFS_META_VERSION, ZFS_META_RELEASE, (int)getpid());
if (zed_conf_open_state(zcp) < 0)
exit(EXIT_FAILURE);
diff --git a/cmd/zed/zed_conf.c b/cmd/zed/zed_conf.c
index 6dfd14e56..a79fe862d 100644
--- a/cmd/zed/zed_conf.c
+++ b/cmd/zed/zed_conf.c
@@ -513,7 +513,7 @@ zed_conf_write_pid(struct zed_conf *zcp)
/*
* Write PID file.
*/
- n = snprintf(buf, sizeof (buf), "%d\n", (int) getpid());
+ n = snprintf(buf, sizeof (buf), "%d\n", (int)getpid());
if ((n < 0) || (n >= sizeof (buf))) {
errno = ERANGE;
zed_log_msg(LOG_ERR, "Failed to write PID file \"%s\": %s",
@@ -637,7 +637,7 @@ zed_conf_read_state(struct zed_conf *zcp, uint64_t *eidp, int64_t etime[])
"Failed to read state file: %s", strerror(errno));
return (-1);
}
- if (lseek(zcp->state_fd, 0, SEEK_SET) == (off_t) -1) {
+ if (lseek(zcp->state_fd, 0, SEEK_SET) == (off_t)-1) {
zed_log_msg(LOG_WARNING,
"Failed to reposition state file offset: %s",
strerror(errno));
@@ -687,7 +687,7 @@ zed_conf_write_state(struct zed_conf *zcp, uint64_t eid, int64_t etime[])
"Failed to write state file: %s", strerror(errno));
return (-1);
}
- if (lseek(zcp->state_fd, 0, SEEK_SET) == (off_t) -1) {
+ if (lseek(zcp->state_fd, 0, SEEK_SET) == (off_t)-1) {
zed_log_msg(LOG_WARNING,
"Failed to reposition state file offset: %s",
strerror(errno));
diff --git a/cmd/zed/zed_disk_event.c b/cmd/zed/zed_disk_event.c
index 10f24c996..76b8e91c8 100644
--- a/cmd/zed/zed_disk_event.c
+++ b/cmd/zed/zed_disk_event.c
@@ -283,7 +283,7 @@ zed_udev_monitor(void *arg)
if (strcmp(class, EC_DEV_STATUS) == 0 &&
udev_device_get_property_value(dev, "DM_UUID") &&
udev_device_get_property_value(dev, "MPATH_SBIN_PATH")) {
- tmp = (char *) udev_device_get_devnode(dev);
+ tmp = (char *)udev_device_get_devnode(dev);
tmp2 = zfs_get_underlying_path(tmp);
if (tmp && tmp2 && (strcmp(tmp, tmp2) != 0)) {
/*
diff --git a/cmd/zed/zed_event.c b/cmd/zed/zed_event.c
index c614f4fe8..1a5f15ebf 100644
--- a/cmd/zed/zed_event.c
+++ b/cmd/zed/zed_event.c
@@ -489,7 +489,7 @@ _zed_event_add_int64_array(uint64_t eid, zed_strings_t *zsp,
name = nvpair_name(nvp);
(void) nvpair_value_int64_array(nvp, &i64p, &nelem);
for (i = 0, p = buf; (i < nelem) && (buflen > 0); i++) {
- n = snprintf(p, buflen, "%lld ", (u_longlong_t) i64p[i]);
+ n = snprintf(p, buflen, "%lld ", (u_longlong_t)i64p[i]);
if ((n < 0) || (n >= buflen))
return (_zed_event_add_array_err(eid, name));
p += n;
@@ -521,7 +521,7 @@ _zed_event_add_uint64_array(uint64_t eid, zed_strings_t *zsp,
fmt = _zed_event_value_is_hex(name) ? "0x%.16llX " : "%llu ";
(void) nvpair_value_uint64_array(nvp, &u64p, &nelem);
for (i = 0, p = buf; (i < nelem) && (buflen > 0); i++) {
- n = snprintf(p, buflen, fmt, (u_longlong_t) u64p[i]);
+ n = snprintf(p, buflen, fmt, (u_longlong_t)u64p[i]);
if ((n < 0) || (n >= buflen))
return (_zed_event_add_array_err(eid, name));
p += n;
@@ -603,7 +603,7 @@ _zed_event_add_nvpair(uint64_t eid, zed_strings_t *zsp, nvpair_t *nvp)
_zed_event_add_var(eid, zsp, prefix, name, "%d", i8);
break;
case DATA_TYPE_INT8:
- (void) nvpair_value_int8(nvp, (int8_t *) &i8);
+ (void) nvpair_value_int8(nvp, (int8_t *)&i8);
_zed_event_add_var(eid, zsp, prefix, name, "%d", i8);
break;
case DATA_TYPE_UINT8:
@@ -611,7 +611,7 @@ _zed_event_add_nvpair(uint64_t eid, zed_strings_t *zsp, nvpair_t *nvp)
_zed_event_add_var(eid, zsp, prefix, name, "%u", i8);
break;
case DATA_TYPE_INT16:
- (void) nvpair_value_int16(nvp, (int16_t *) &i16);
+ (void) nvpair_value_int16(nvp, (int16_t *)&i16);
_zed_event_add_var(eid, zsp, prefix, name, "%d", i16);
break;
case DATA_TYPE_UINT16:
@@ -619,7 +619,7 @@ _zed_event_add_nvpair(uint64_t eid, zed_strings_t *zsp, nvpair_t *nvp)
_zed_event_add_var(eid, zsp, prefix, name, "%u", i16);
break;
case DATA_TYPE_INT32:
- (void) nvpair_value_int32(nvp, (int32_t *) &i32);
+ (void) nvpair_value_int32(nvp, (int32_t *)&i32);
_zed_event_add_var(eid, zsp, prefix, name, "%d", i32);
break;
case DATA_TYPE_UINT32:
@@ -627,15 +627,15 @@ _zed_event_add_nvpair(uint64_t eid, zed_strings_t *zsp, nvpair_t *nvp)
_zed_event_add_var(eid, zsp, prefix, name, "%u", i32);
break;
case DATA_TYPE_INT64:
- (void) nvpair_value_int64(nvp, (int64_t *) &i64);
+ (void) nvpair_value_int64(nvp, (int64_t *)&i64);
_zed_event_add_var(eid, zsp, prefix, name,
- "%lld", (longlong_t) i64);
+ "%lld", (longlong_t)i64);
break;
case DATA_TYPE_UINT64:
(void) nvpair_value_uint64(nvp, &i64);
_zed_event_add_var(eid, zsp, prefix, name,
(_zed_event_value_is_hex(name) ? "0x%.16llX" : "%llu"),
- (u_longlong_t) i64);
+ (u_longlong_t)i64);
/*
* shadow readable strings for vdev state pairs
*/
@@ -653,9 +653,9 @@ _zed_event_add_nvpair(uint64_t eid, zed_strings_t *zsp, nvpair_t *nvp)
_zed_event_add_var(eid, zsp, prefix, name, "%g", d);
break;
case DATA_TYPE_HRTIME:
- (void) nvpair_value_hrtime(nvp, (hrtime_t *) &i64);
+ (void) nvpair_value_hrtime(nvp, (hrtime_t *)&i64);
_zed_event_add_var(eid, zsp, prefix, name,
- "%llu", (u_longlong_t) i64);
+ "%llu", (u_longlong_t)i64);
break;
case DATA_TYPE_NVLIST:
_zed_event_add_var(eid, zsp, prefix, name,
@@ -889,7 +889,7 @@ zed_event_service(struct zed_conf *zcp)
_zed_event_add_env_preserve(eid, zsp);
_zed_event_add_var(eid, zsp, ZED_VAR_PREFIX, "PID",
- "%d", (int) getpid());
+ "%d", (int)getpid());
_zed_event_add_var(eid, zsp, ZED_VAR_PREFIX, "ZEDLET_DIR",
"%s", zcp->zedlet_dir);
subclass = _zed_event_get_subclass(class);
diff --git a/cmd/zed/zed_exec.c b/cmd/zed/zed_exec.c
index 36ca9f345..075943f99 100644
--- a/cmd/zed/zed_exec.c
+++ b/cmd/zed/zed_exec.c
@@ -54,7 +54,7 @@ _zed_exec_create_env(zed_strings_t *zsp)
if (!buf)
return (NULL);
- pp = (char **) buf;
+ pp = (char **)buf;
p = buf + (num_ptrs * sizeof (char *));
i = 0;
for (q = zed_strings_first(zsp); q; q = zed_strings_next(zsp)) {
@@ -66,7 +66,7 @@ _zed_exec_create_env(zed_strings_t *zsp)
}
pp[i] = NULL;
assert(buf + buflen == p);
- return ((char **) buf);
+ return ((char **)buf);
}
/*
@@ -131,7 +131,7 @@ _zed_exec_fork_child(uint64_t eid, const char *dir, const char *prog,
*/
for (n = 0; n < 1000; n++) {
wpid = waitpid(pid, &status, WNOHANG);
- if (wpid == (pid_t) -1) {
+ if (wpid == (pid_t)-1) {
if (errno == EINTR)
continue;
zed_log_msg(LOG_WARNING,
diff --git a/cmd/zed/zed_log.c b/cmd/zed/zed_log.c
index ae1e2cd1f..0697b7175 100644
--- a/cmd/zed/zed_log.c
+++ b/cmd/zed/zed_log.c
@@ -66,11 +66,11 @@ zed_log_pipe_open(void)
{
if ((_ctx.pipe_fd[0] != -1) || (_ctx.pipe_fd[1] != -1))
zed_log_die("Invalid use of zed_log_pipe_open in PID %d",
- (int) getpid());
+ (int)getpid());
if (pipe(_ctx.pipe_fd) < 0)
zed_log_die("Failed to create daemonize pipe in PID %d: %s",
- (int) getpid(), strerror(errno));
+ (int)getpid(), strerror(errno));
}
/*
@@ -85,12 +85,12 @@ zed_log_pipe_close_reads(void)
if (_ctx.pipe_fd[0] < 0)
zed_log_die(
"Invalid use of zed_log_pipe_close_reads in PID %d",
- (int) getpid());
+ (int)getpid());
if (close(_ctx.pipe_fd[0]) < 0)
zed_log_die(
"Failed to close reads on daemonize pipe in PID %d: %s",
- (int) getpid(), strerror(errno));
+ (int)getpid(), strerror(errno));
_ctx.pipe_fd[0] = -1;
}
@@ -110,12 +110,12 @@ zed_log_pipe_close_writes(void)
if (_ctx.pipe_fd[1] < 0)
zed_log_die(
"Invalid use of zed_log_pipe_close_writes in PID %d",
- (int) getpid());
+ (int)getpid());
if (close(_ctx.pipe_fd[1]) < 0)
zed_log_die(
"Failed to close writes on daemonize pipe in PID %d: %s",
- (int) getpid(), strerror(errno));
+ (int)getpid(), strerror(errno));
_ctx.pipe_fd[1] = -1;
}
@@ -135,7 +135,7 @@ zed_log_pipe_wait(void)
if (_ctx.pipe_fd[0] < 0)
zed_log_die("Invalid use of zed_log_pipe_wait in PID %d",
- (int) getpid());
+ (int)getpid());
for (;;) {
n = read(_ctx.pipe_fd[0], &c, sizeof (c));
@@ -144,7 +144,7 @@ zed_log_pipe_wait(void)
continue;
zed_log_die(
"Failed to read from daemonize pipe in PID %d: %s",
- (int) getpid(), strerror(errno));
+ (int)getpid(), strerror(errno));
}
if (n == 0) {
break;
diff --git a/cmd/zed/zed_strings.c b/cmd/zed/zed_strings.c
index 6942e9fbb..51b872ac7 100644
--- a/cmd/zed/zed_strings.c
+++ b/cmd/zed/zed_strings.c
@@ -206,7 +206,7 @@ zed_strings_first(zed_strings_t *zsp)
if (!zsp->iteratorp)
return (NULL);
- return (((zed_strings_node_t *) zsp->iteratorp)->val);
+ return (((zed_strings_node_t *)zsp->iteratorp)->val);
}
diff --git a/cmd/zed/zed_strings.h b/cmd/zed/zed_strings.h
index 6177c7657..37a84cad7 100644
--- a/cmd/zed/zed_strings.h
+++ b/cmd/zed/zed_strings.h
@@ -17,16 +17,11 @@
typedef struct zed_strings zed_strings_t;
-zed_strings_t * zed_strings_create(void);
-
+zed_strings_t *zed_strings_create(void);
void zed_strings_destroy(zed_strings_t *zsp);
-
int zed_strings_add(zed_strings_t *zsp, const char *key, const char *s);
-
-const char * zed_strings_first(zed_strings_t *zsp);
-
-const char * zed_strings_next(zed_strings_t *zsp);
-
+const char *zed_strings_first(zed_strings_t *zsp);
+const char *zed_strings_next(zed_strings_t *zsp);
int zed_strings_count(zed_strings_t *zsp);
#endif /* !ZED_STRINGS_H */