"Fossies" - the Fresh Open Source Software Archive

Member "glusterfs-8.2/xlators/debug/error-gen/src/error-gen.h" (16 Sep 2020, 1488 Bytes) of package /linux/misc/glusterfs-8.2.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "error-gen.h" see the Fossies "Dox" file reference documentation.

    1 /*
    2    Copyright (c) 2008-2012 Red Hat, Inc. <http://www.redhat.com>
    3    This file is part of GlusterFS.
    4 
    5    This file is licensed to you under your choice of the GNU Lesser
    6    General Public License, version 3 or any later version (LGPLv3 or
    7    later), or the GNU General Public License, version 2 (GPLv2), in all
    8    cases as published by the Free Software Foundation.
    9 */
   10 #ifndef _ERROR_GEN_H
   11 #define _ERROR_GEN_H
   12 
   13 #include "error-gen-mem-types.h"
   14 
   15 #define GF_FAILURE_DEFAULT 10
   16 
   17 /*
   18  * Pseudo-errors refer to errors beyond the scope of traditional <-1, op_errno>
   19  * returns. This facilitates the ability to return unexpected, but not -1 values
   20  * and/or to inject operations that lead to implicit error conditions. The range
   21  * for pseudo errors resides at a high value to avoid conflicts with the errno
   22  * range.
   23  */
   24 enum GF_PSEUDO_ERRORS {
   25     GF_ERROR_SHORT_WRITE = 1000, /* short writev return value */
   26     GF_ERROR_MAX
   27 };
   28 
   29 typedef struct {
   30     int enable[GF_FOP_MAXVALUE];
   31     int op_count;
   32     /*
   33      * This is only an iteration number in the random-failure case.  For
   34      * the normal controlled-probability case, it's actually a numerator
   35      * for the failure probability (see FAILURE_GRANULARITY declaration).
   36      * It's just not worth blowing up the diff by changing it.
   37      */
   38     int failure_iter_no;
   39     int error_no_int;
   40     gf_boolean_t random_failure;
   41     gf_lock_t lock;
   42 } eg_t;
   43 
   44 typedef struct {
   45     int error_no_count;
   46     int error_no[20];
   47 } sys_error_t;
   48 
   49 #endif