lkml.org 
[lkml]   [2006]   [Sep]   [19]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    SubjectRe: [patch 2/8] fault-injection capabilities infrastructure
    FromDon Mullis <>
    DateMon, 18 Sep 2006 22:50:54 -0700
    Replace individual structure element comments with reference
    to Documentation/fault-injection/fault-injection.txt
    
    Init "interval" to 1 (smallest useful value).
    Init "times" to 1 rather than -1 (infinity), for fewer 
    accidental system lockups.
    
    
    Signed-off-by: Don Mullis <dwm@meer.net>
    
    ---
     include/linux/fault-inject.h |   20 +++++---------------
     1 file changed, 5 insertions(+), 15 deletions(-)
    Index: linux-2.6.17/include/linux/fault-inject.h
    ===================================================================
    --- linux-2.6.17.orig/include/linux/fault-inject.h
    +++ linux-2.6.17/include/linux/fault-inject.h
    @@ -6,31 +6,21 @@
     #include <linux/types.h>
     #include <asm/atomic.h>
     
    +/*
    + * For explanation of the elements of this struct, see
    + * Documentation/fault-injection/fault-injection.txt
    + */
     struct fault_attr {
    -
    -	/* how often it should fail in percent. */
     	unsigned long probability;
    -
    -	/* the interval of failures. */
     	unsigned long interval;
    -
    -	/*
    -	 * how many times failures may happen at most.
    -	 * A value of '-1' means infinity.
    -	 */
     	atomic_t times;
    -
    -	/*
    -	 * the size of free space where memory can be allocated safely.
    -	 * A value of '0' means infinity.
    -	 */
     	atomic_t space;
     
     	unsigned long count;
     };
     
     #define DEFINE_FAULT_ATTR(name) \
    -	struct fault_attr name = { .times = ATOMIC_INIT(-1), }
    +	struct fault_attr name = { .interval=1, .times = ATOMIC_INIT(1), }
     
     int setup_fault_attr(struct fault_attr *attr, char *str);
     void should_fail_srandom(unsigned long entropy);
    
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    
    
    \
     
     \ /
      Last update: 2006-09-19 07:59    [from the cache]
    ©2003-2008