The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/contrib/openzfs/include/os/freebsd/spl/sys/mod_os.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*
    2  * Copyright (c) 2020 iXsystems, Inc.
    3  * All rights reserved.
    4  *
    5  * Redistribution and use in source and binary forms, with or without
    6  * modification, are permitted provided that the following conditions
    7  * are met:
    8  * 1. Redistributions of source code must retain the above copyright
    9  *    notice, this list of conditions and the following disclaimer.
   10  * 2. Redistributions in binary form must reproduce the above copyright
   11  *    notice, this list of conditions and the following disclaimer in the
   12  *    documentation and/or other materials provided with the distribution.
   13  *
   14  * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
   15  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   16  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   17  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
   18  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   19  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   20  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   21  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   22  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   23  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   24  * SUCH DAMAGE.
   25  *
   26  * $FreeBSD$
   27  */
   28 
   29 #ifndef _SPL_MOD_H
   30 #define _SPL_MOD_H
   31 
   32 #include <sys/sysctl.h>
   33 
   34 #define ZMOD_RW CTLFLAG_RWTUN
   35 #define ZMOD_RD CTLFLAG_RDTUN
   36 
   37 #define ZFS_MODULE_PARAM(scope_prefix, name_prefix, name, type, perm, desc) \
   38     SYSCTL_DECL(_vfs_ ## scope_prefix); \
   39     SYSCTL_##type(_vfs_ ## scope_prefix, OID_AUTO, name, perm, \
   40         &name_prefix ## name, 0, desc)
   41 
   42 #define ZFS_MODULE_PARAM_ARGS   SYSCTL_HANDLER_ARGS
   43 
   44 #define ZFS_MODULE_PARAM_CALL_IMPL(parent, name, perm, args, desc) \
   45     SYSCTL_DECL(parent); \
   46     SYSCTL_PROC(parent, OID_AUTO, name, CTLFLAG_MPSAFE | perm | args, desc)
   47 
   48 #define ZFS_MODULE_PARAM_CALL( \
   49     scope_prefix, name_prefix, name, func, _, perm, desc) \
   50         ZFS_MODULE_PARAM_CALL_IMPL(_vfs_ ## scope_prefix, name, perm, \
   51             func ## _args(name_prefix ## name), desc)
   52 
   53 #define ZFS_MODULE_VIRTUAL_PARAM_CALL ZFS_MODULE_PARAM_CALL
   54 
   55 #define param_set_arc_u64_args(var) \
   56     CTLTYPE_U64, &var, 0, param_set_arc_u64, "QU"
   57 
   58 #define param_set_arc_int_args(var) \
   59     CTLTYPE_INT, &var, 0, param_set_arc_int, "I"
   60 
   61 #define param_set_arc_min_args(var) \
   62     CTLTYPE_U64, NULL, 0, param_set_arc_min, "QU"
   63 
   64 #define param_set_arc_max_args(var) \
   65     CTLTYPE_U64, NULL, 0, param_set_arc_max, "QU"
   66 
   67 #define param_set_arc_free_target_args(var) \
   68     CTLTYPE_UINT, NULL, 0, param_set_arc_free_target, "IU"
   69 
   70 #define param_set_arc_no_grow_shift_args(var) \
   71     CTLTYPE_INT, NULL, 0, param_set_arc_no_grow_shift, "I"
   72 
   73 #define param_set_deadman_failmode_args(var) \
   74     CTLTYPE_STRING, NULL, 0, param_set_deadman_failmode, "A"
   75 
   76 #define param_set_deadman_synctime_args(var) \
   77     CTLTYPE_U64, NULL, 0, param_set_deadman_synctime, "QU"
   78 
   79 #define param_set_deadman_ziotime_args(var) \
   80     CTLTYPE_U64, NULL, 0, param_set_deadman_ziotime, "QU"
   81 
   82 #define param_set_multihost_interval_args(var) \
   83     CTLTYPE_U64, NULL, 0, param_set_multihost_interval, "QU"
   84 
   85 #define param_set_slop_shift_args(var) \
   86     CTLTYPE_INT, NULL, 0, param_set_slop_shift, "I"
   87 
   88 #define param_set_min_auto_ashift_args(var) \
   89     CTLTYPE_UINT, NULL, 0, param_set_min_auto_ashift, "IU"
   90 
   91 #define param_set_max_auto_ashift_args(var) \
   92     CTLTYPE_UINT, NULL, 0, param_set_max_auto_ashift, "IU"
   93 
   94 #define fletcher_4_param_set_args(var) \
   95     CTLTYPE_STRING, NULL, 0, fletcher_4_param, "A"
   96 
   97 #define blake3_param_set_args(var) \
   98     CTLTYPE_STRING, NULL, 0, blake3_param, "A"
   99 
  100 #include <sys/kernel.h>
  101 #define module_init(fn) \
  102 static void \
  103 wrap_ ## fn(void *dummy __unused) \
  104 { \
  105         fn(); \
  106 } \
  107 SYSINIT(zfs_ ## fn, SI_SUB_LAST, SI_ORDER_FIRST, wrap_ ## fn, NULL)
  108 
  109 #define module_init_early(fn) \
  110 static void \
  111 wrap_ ## fn(void *dummy __unused) \
  112 { \
  113         fn(); \
  114 } \
  115 SYSINIT(zfs_ ## fn, SI_SUB_INT_CONFIG_HOOKS, SI_ORDER_FIRST, wrap_ ## fn, NULL)
  116 
  117 #define module_exit(fn) \
  118 static void \
  119 wrap_ ## fn(void *dummy __unused) \
  120 { \
  121         fn(); \
  122 } \
  123 SYSUNINIT(zfs_ ## fn, SI_SUB_LAST, SI_ORDER_FIRST, wrap_ ## fn, NULL)
  124 
  125 #endif /* SPL_MOD_H */

Cache object: f5a9e461df4aba822569ab024f6140b4


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.