Path: blob/main/sys/contrib/openzfs/cmd/zed/zed_conf.h
48380 views
// SPDX-License-Identifier: CDDL-1.01/*2* This file is part of the ZFS Event Daemon (ZED).3*4* Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049).5* Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC.6* Refer to the OpenZFS git commit log for authoritative copyright attribution.7*8* The contents of this file are subject to the terms of the9* Common Development and Distribution License Version 1.0 (CDDL-1.0).10* You can obtain a copy of the license from the top-level file11* "OPENSOLARIS.LICENSE" or at <http://opensource.org/licenses/CDDL-1.0>.12* You may not use this file except in compliance with the license.13*/1415#ifndef ZED_CONF_H16#define ZED_CONF_H1718#include <libzfs.h>19#include <stdint.h>20#include "zed_strings.h"2122struct zed_conf {23char *pid_file; /* abs path to pid file */24char *zedlet_dir; /* abs path to zedlet dir */25char *state_file; /* abs path to state file */2627libzfs_handle_t *zfs_hdl; /* handle to libzfs */28zed_strings_t *zedlets; /* names of enabled zedlets */29char *path; /* custom $PATH for zedlets to use */3031int pid_fd; /* fd to pid file for lock */32int state_fd; /* fd to state file */33int zevent_fd; /* fd for access to zevents */3435int16_t max_jobs; /* max zedlets to run at one time */36int32_t max_zevent_buf_len; /* max size of kernel event list */3738boolean_t do_force:1; /* true if force enabled */39boolean_t do_foreground:1; /* true if run in foreground */40boolean_t do_memlock:1; /* true if locking memory */41boolean_t do_verbose:1; /* true if verbosity enabled */42boolean_t do_zero:1; /* true if zeroing state */43boolean_t do_idle:1; /* true if idle enabled */44};4546void zed_conf_init(struct zed_conf *zcp);47void zed_conf_destroy(struct zed_conf *zcp);4849void zed_conf_parse_opts(struct zed_conf *zcp, int argc, char **argv);5051int zed_conf_scan_dir(struct zed_conf *zcp);5253int zed_conf_write_pid(struct zed_conf *zcp);5455int zed_conf_open_state(struct zed_conf *zcp);56int zed_conf_read_state(struct zed_conf *zcp, uint64_t *eidp, int64_t etime[]);57int zed_conf_write_state(struct zed_conf *zcp, uint64_t eid, int64_t etime[]);5859#endif /* !ZED_CONF_H */606162