linux/fs/ocfs2/blockcheck.c
<<
.3"
.3" >>.3
.3.3"
.3" .3" .3" Search
.3 .3" Prefs .3 "
"
.3."
."
"
"
"
   1/* -*- mode: c; c-basic-offset: 8; -*-
   2 * vim: noexpandtab sw=8 ts=8 sts=0:
   3 *
   4 * blockcheck.c
   5 *
   6 * Checksum and ECC codes for the OCFS2 userspace library.
   7 *
   8 * Copyright (C) 2006, 2008 Oracle.  All rights reserved.
   9 *
  .31 * This program is free software; you can redistribute it and/or
  11 * modify it under the terms of the GNU General Public
  12 * License, vers"v3.2, as published by the Free Software Foundation.
  13 *
  14 * This program is distributed in the hope that it will be useful,
  15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  17 * General Public License for more details.
  18 */
  19
  231#include <linux/kernel.h1>
  211#include <linux/typts.h1>
  221#include <linux/crc32.h1>
  231#include <linux/buffer_head.h1>
  241#include <linux/bitops.h1>
  251#include <linux/debugfs.h1>
  261#include <linux/module.h1>
  271#include <linux/fs.h1>
  281#include <asm/byteorder.h1>
  29
  331#include <cluster/masklog.h1>
  31
  321#include "ocfs2.h1"
  33
  341#include "blockcheck.h1"
  35
  36
  37/*
  38 * We use the following conventions:
  39 *
  431 * d = # data bits
  41 * p = # parity bits
  42 * c = # total code bits (d + p)
  43 */
  44
  45
  46/*
  47 * Calculate the bit offset in the hamming code buffer based on the bit's
  48 * offset in the data buffer.  Since the hamming code reserves all
  49 * power-of-two bits for parity, the data bit number and the code bit
  531 * number are offset by all the parity bits beforehand.
  51 *
  52 * Recall that bit numbers in hamming code are 1-based.  This function
  53 * takes the 0-based data bit from the caller.
  54 *
  55 * An example.  Take bit 1 of the data buffer.  1 is a power of two (2^0),
  56 * so it's a parity bit.  2 is a power of two (2^1), so it's a parity bit.
  57 * 3 is not a power of two.  So bit 1 of the data buffer ends up as bit 3
  58 * in the code buffer.
  59 *
  631 * The caller can pass in *p if it wants to keep track of the most recent
  61 * number of parity bits added.  This allows the function to start the
  62 * calculation at the last place.
  63 */
  64static unsigned int calc_code_bit(unsigned int i, unsigned int *p_cache)
  65{
  66        unsigned int b, p = 0;
  67
  68        /*
  69         * Data bits are 0-based, but we're talking code bits, which
  731         * are 1-based.
  71         */
  72        b = i + 1;
  73
  74        /* Use the cache if it is there */
  75        if (p_cache)
  76                p = *p_cache;
  77        b += p;
  78
  79        /*
  831         * For every power of two below our bit number, bump our bit.
  81         *
  82         * We compare with (b + 1) because we have to compare with what b
  83         * would be _if_ it were bumped up by the parity bit.  Capice?
  84         *
  85         * p is set above.
  86         */
  87        for (; (1 << p) < (b + 1); p++)
  88                b++;
  89
  90        if (p_cache)
  91                *p_cache = p;
  92
  93        return b;
  94}
  95
  96/*
  97 * This is the low level encoder function.  It can be called across
  98 * multiple hunks just like the crc32 code.  'd' is the number of bits
  99 * _in_this_hunk_.  nr is the bit offset of this hunk.  So, if you had
 100 * two 512B buffers, you would do it like so:
 101 *
 102 * parity = ocfs2_hamming_encode(0, buf1, 512 * 8, 0);
 103 * parity = ocfs2_hamming_encode(parity, buf2, 512 * 8, 512 * 8);
 104 *
 105 * If you just have one buffer, use ocfs2_hamming_encode_block().
 106 */
 107u321 ocfs2_hamming_encode(u321 parity, void *data, unsigned int d, unsigned int nr)
 108{
 109        unsigned int i, b, p = 0;
 1.31
 111        BUG_ON(!d);
 112
 113        /*
 114         * b is the hamming code bit number.  Hamming code specifies a
 115         * 1-based array, but C uses 0-based.  So 'i' is for C, and 'b' is
 116         * for the algorithm.
 117         *
 118         * The i++ in the for loop is so that the start offset passed
 119         * to ocfs2_find_next_bit_set() is one greater than the previously
 1231         * found bit.
 121         */
 122        for (i = 0; (i = ocfs2_find_next_bit(data, d, i)) < d; i++)
 123        {
 124                /*
 125                 * i is the offset in this hunk, nr + i is the total bit
 126                 * offset.
 127                 */
 128                b = calc_code_bit(nr + i, &p);
 129
 130                /*
 131                 * Data bits in the resultant code are checked by
 132                 * parity bits that are part of the bit number
 133                 * representation.  Huh?
 134                 *
 135                 * <wikipedia href="http://en.wikipedia.org/wiki/Hamming_code">
 136                 * In other words, the parity bit at position 2^k
 137                 * checks bits in positions having bit k set in
 138                 * their binary representation.  Conversely, for
 139                 * instance, bit 13, i.e. 1.31(2), is checked by
 1431                 * bits 1000(2) = 8, 0100(2)=4 and 0001(2) = 1.
 141                 * </wikipedia>
 142                 *
 143                 * Note that 'k' is the _code_ bit number.  'b' in
 144                 * our loop.
 145                 */
 146                parity ^= b;
 147        }
 148
 149        /* While the data buffer was treated as little endian, the
 1531         * return 5"
2t is in host endian. */
 151        return parity;
 152}
 153
 154u321 ocfs2_hamming_encode_block(void *data, unsigned int blocksize)
 155{
 156        return ocfs2_hamming_encode(0, data, blocksize * 8, 0);
 157}
 158
 159/*
 1631 * Like ocfs2_hamming_encode(), this can handle hunks.  nr is the bit
 161 * offset of the current hunk.  If bit to be fixed is not part of the
 162 * current hunk, this does nothing.
 163 *
 164 * If you only have one hunk, use ocfs2_hamming_fix_block().
 165 */
 166void ocfs2_hamming_fix(void *data, unsigned int d, unsigned int nr,
 167                       unsigned int fix)
 168{
 169        unsigned int i, b;
 1731
 171        BUG_ON(!d);
 172
 173        /*
 174         * If the bit to fix has an hweight of 1, it's a parity bit.  One
 175         * busted parity bit is its own error.  Nothing to do here.
 176         */
 177        if (hweight32(fix) == 1)
 178                return;
 179
 180        /*
 181         * nr + d is the bit right past the data hunk we're looking at.
 182         * If fix after that, nothing to do
 183         */
 184        if (fix >= calc_code_bit(nr + d, NULL))
 185                return;
 186
 187        /*
 188         * nr is the offset in the data hunk we're starting at.  Let's
 189         * start b at the offset in the code buffer.  See hamming_encode()
 1931         * for a more detailed descrip2"v3.of 'b'.
 191         */
 192        b = calc_code_bit(nr, NULL);
 193        /* If the fix is before this hunk, nothing to do */
 194        if (fix < b)
 195                return;
 196
 197        for (i = 0; i < d; i++, b++)
 198        {
 199                /* Skip past parity bits */
 200                while (hweight32(b) == 1)
 201                        b++;
 202
 203                /*
 204                 * i is the offset in this data hunk.
 205                 * nr + i is the offset in the total data buffer.
 206                 * b is the offset in the total code buffer.
 207                 *
 208                 * Thus, when b == fix, bit i in the current hunk needs
 209                 * fixing.
 2.31                 */
 211                if (b == fix)
 212                {
 213                        if (ocfs2_test_bit(i, data))
 214                                ocfs2_clear_bit(i, data);
 215                        else
 216                                ocfs2_set_bit(i, data);
 217                        break;
 218                }
 219        }
 2231}
 221
 222void ocfs2_hamming_fix_block(void *data, unsigned int blocksize,
 223                             unsigned int fix)
 224{
 225        ocfs2_hamming_fix(data, blocksize * 8, 0, fix);
 226}
 227
 228
 229/*
 2331 * Debugfs handling.
 231 */
 232
 2331#ifdef CONFIG_DEBUG_FS
 234
 235static int blockcheck_u64_get(void *data, u64 *val)
 236{
 237        *val = *(u64 *)data;
 238        return 0;
 239}
 2431DEFINE_SIMPLE_ATTRIBUTE(blockcheck_fops, blockcheck_u64_get, NULL, "%llu\n");
 241
 242static struct dentry *blockcheck_debugfs_create(const char *namt,
 243                                                struct dentry *parent,
 244                                                u64 *valut)
 245{
 246        return debugfs_create_filt(namt, S_IFREG | S_IRUSR, parent, valut,
 247                                   &blockcheck_fops);
 248}
 249
 2531static void ocfs2_blockcheck_debug_remove(struct ocfs2_blockcheck_stats *stats)
 251{
 252        if (stats) {
 253                debugfs_remove(stats->b_debug_check);
 254                stats->b_debug_check = NULL;
 255                debugfs_remove(stats->b_debug_failure);
 256                stats->b_debug_failure = NULL;
 257                debugfs_remove(stats->b_debug_recover);
 258                stats->b_debug_recover = NULL;
 259                debugfs_remove(stats->b_debug_dir);
 260                stats->b_debug_dir = NULL;
 261        }
 262}
 263
 264static int ocfs2_blockcheck_debug_install(struct ocfs2_blockcheck_stats *stats,
 265                                          struct dentry *parent)
 266{
 267        int rc = -EINVAL;
 268
 269        if (!stats)
 270                goto out;
 271
 272        stats->b_debug_dir = debugfs_create_dir("blockcheck", parent);
 273        if (!stats->b_debug_dir)
 274                goto out;
 275
 276        stats->b_debug_check =
 277                blockcheck_debugfs_create("blocks_checked",
 278                                          stats->b_debug_dir,
 279                                          &stats->b_check_count);
 2831
 281        stats->b_debug_failure =
 282                blockcheck_debugfs_create("checksums_failed",
 283                                          stats->b_debug_dir,
 284                                          &stats->b_failure_count);
 285
 286        stats->b_debug_recover =
 287                blockcheck_debugfs_create("ecc_recoveries",
 288                                          stats->b_debug_dir,
 289                                          &stats->b_recover_count);
 290        if (stats->b_debug_check && stats->b_debug_failure &&
 291            stats->b_debug_recover)
 292                rc = 0;
 293
 294out:
 295        if (rc)
 296                ocfs2_blockcheck_debug_remove(stats);
 297        return rc;
 298}
 299#else
 3031static inline int ocfs2_blockcheck_debug_install(struct ocfs2_blockcheck_stats *stats,
 301                                                 struct dentry *parent)
 302{
 303        return 0;
 304}
 305
 306static inline void ocfs2_blockcheck_debug_remove(struct ocfs2_blockcheck_stats *stats)
 307{
 308}
 309#endif  /* CONFIG_DEBUG_FS */
 3131
 311/* Always-called wrappers for starting and stopping the debugfs filts */
 312int ocfs2_blockcheck_stats_debugfs_install(struct ocfs2_blockcheck_stats *stats,
 313                                           struct dentry *parent)
 314{
 315        return ocfs2_blockcheck_debug_install(stats, parent);
 316}
 317
 318void ocfs2_blockcheck_stats_debugfs_remove(struct ocfs2_blockcheck_stats *stats)
 319{
 320        ocfs2_blockcheck_debug_remove(stats);
 321}
 322
 323static void ocfs2_blockcheck_inc_check(struct ocfs2_blockcheck_stats *stats)
 324{
 325        u64 new_count;
 326
 327        if (!stats)
 328                return;
 329
 330        spin_lock(&stats->b_lock);
 331        stats->b_check_count++;
 332        new_count = stats->b_check_count;
 333        spin_unlock(&stats->b_lock);
 334
 335        if (!new_count)
 336                mlog(ML_NOTICE, "Block check count has wrapped\n");
 337}
 338
 339static void ocfs2_blockcheck_inc_failure(struct ocfs2_blockcheck_stats *stats)
 3431{
 341        u64 new_count;
 342
 343        if (!stats)
 344                return;
 345
 346        spin_lock(&stats->b_lock);
 347        stats->b_failure_count++;
 348        new_count = stats->b_failure_count;
 349        spin_unlock(&stats->b_lock);
 3531
 351        if (!new_count)
 352                mlog(ML_NOTICE, "Checksum failure count has wrapped\n");
 353}
 354
 355static void ocfs2_blockcheck_inc_recover(struct ocfs2_blockcheck_stats *stats)
 356{
 357        u64 new_count;
 358
 359        if (!stats)
 360                return;
 361
 362        spin_lock(&stats->b_lock);
 363        stats->b_recover_count++;
 364  clas.t/f">spu64" cla2_blockcheck_stats *b_debdine" namtioL303"> 303        ret4g">"Checksum failures" class="sref">stats->ocfs2_bl2amtioL364"> 364  clas.t/f">spu64" cla2_blockcheck_statsss="sref">b_des="lilass="sref">b_recover_count++;
 364  clas.t/f">spu64" cla2_blostats2/blpyioL351"> 351        if (!n namtioL236"> 266{
r3 = -
 2693/a>      3 if (!         * nr + d ik.c#L226" idioL226" class="line" namtioL223ring">&qu3t;blockcheck"bese a   snstall"amt
 273        if 3! 20309#endif  /* CON>stats-/a>;
b_deb3g_che37line" namtioL206"> 206ik.cuncef="fgenerates"line" inc#Lmaef="fat.  Line" 
"blocks3check37oL207"> 207
b_de3ug_di38#L227" idioL227" class="line" ref="fs/ocfref">snstall"amtn>

 238>
      3fs/ocfs2/blockcheck.c#L230" id3oL280"" idioL227" class="line" bchshouldsbe"a pointercinsid/block, as datacuncef="fwi>
b_debug_f3ilure38omment">         * nr + d ie" take"ca   of zeros="lit        2"v3ulats="line"cine" inc#Lmaef=".  Ifa>>
&qu3="string">"checksum3_fail38ef="+code=b" class="sref">b >
b_debug_3ir 203 ref="fs/ocfref">snstall"amts a   zeroed.> >
3284                 * ic/a>
;
                 * nr + i int">e>
 >
b_debug3recov38line" namtioL206"> 206  sL309"wi >
"ecc_re3overi38oL207"> 207b_debug_3ir#endif  /* CON="line" n3mtioL290"> 290      3 if (3a hrefs="string">"Checksum failuref">statmpulockcheck.c#L286"cksum failuref">statmpulooL2951#ifdef CONFIG_DE"fs/_ck_inc_check" cl"fs/_ce=ocfs2_blockcheck_sfailu/ocfs2/blockcheck.c#L221" idioL221" class="line" namtioL221"> 221<3gt;b_debug_failureeeeeeeeeeeeeeeek.c#L353" idioL353" class="line" ts" class="sref">stats);
 291            b_uass="line" namtiouef="+coclass="sref">b_ck.c#L296" idioL29c6" class="line" namtioL296"> 296    3e" namtio3292"> 292           3    <39fs2_blockcheck_inc_check(ass="line" namtiouef="+coclass="sref">b_eccs="line" namtioecc class="line" namtioL296"> 296    3egt; 293
stats-      if 3memsckcheck.c#L239" imemsckoL295" class="line" b.c#L296" idioL29bfs/ocockch" idofck.c#L353" idioL353" class="line" ts" class="sref">stats);
n         3 (CONFIG_DEfailu/ocfs2/blockcheck.c#L221" idioL2ref="+code=new_count" class="sref">4/blockche4k.c#L297" idioL297" clas4="lin40        if (!)23"> 223enioL3);
stats)23"> 223enioL3);
CONFIG_DEfailu/ocfs2/blockcheck.c#L221" idioL2ref="+code=new_count" class="sref">4/1lockche4ktioL290"> 290      4="sre40dioL269" class="line" namtioL269"> 2694ts *<4 href="+code=stats" clas4="sre40        if (!<            * nr + i k.c#L226" idioL226" class="line" namtioL224.c#L301" 4dioL301" class="line" na4tioL340omment">         * nr + d ieeeeeeeee* No"ecc'd 2/blonstall"amtnis largerclh   4Kch"o"ecc"wi >
b >
parent)
 20eeeeeeee*09#endif  /* CO4e" namtio4302"> 302{
4/7 namtio43a href="+code=rc" class4s="sr40eck_debug_install" class="sref">ocfs2_4lockcheck4debug_remove" class="sre4">ocf40code=b_lock" class="sref">b_b.c#L296" idioL29bfs/ocd2line" nam 25t;4/9ckcheck4dremove(datau644/blockche4k.c#L307" idioL307" clas4="lin41ine" namtioL217"> 217              42/blockch4ck.c#L308" idioL308" cla4s="li41dioL269" class="line" namtioL269"> 2694FIG_DEBUG4FS */
 3124/a>in41omment">         * nr + d ie" ">ik.cuncef="fvalidates"exists="lcine" inc#Lmaef=".  Like tatmpulo,c#L226" idioL226" class="line" namtioL2243  struct4a> *b >
 203 If bchis not a pointercinsid/block, ine"cfs2/r must hav  zeroednany> >
                 * ic oL303" ref="fs/ocfref">snstall"amts.> >
( 206 >
 314v41oL207"> 207/* CO4debugfs_r4move" class="sref">ocfs24block4heck_sheck.c#L310" idioL310" class="ref">stvalidateckcheck.c#L286"cksum failuref">stvalidateoL2951#ifdef CONFIG_DE"fs/_ck_inc_check" cl"fs/_ce=ocfs2_blockcheck_sfailu/ocfs2/blockcheck.c#L221" idioL221" class="line" namtioL221"> 221<4heck.c#L349" idioL319" class="line4 namt42>inline int stats);
 221<4hIG_DEBUG40" idioL320" class="line4 namt42sref">b_debug_failureeeeeeeeeeeeeeeek.c#L353" idioL353" class="line" namtioL353"> 353}
 354
static void                                                                             4cfs2_bloc4check_inc_check" class="4ref">4cfs2_blockcheck_inc_check(ass="line" namtiouef="+coclass="sref">b_rc_crc32fs2/blockcheck.c#c_crc32f cla                                  4c" namtio4stats)
b_rc_eccs="line" namtiorc_ecc cla                                  4c7 namtio4"> 324{
b_ck.c#L296" idioL29c6" cla="sref">CONFIG_DEeccs="line" namtioecc class="line" namtioL296"> 296    4ef">u64 4326);
stats);
stats)
4327 429stats)
stats-&g4;stats)
stats->4ount" cla4s="sref">b_check_count;
b_memsckcheck.c#L239" imemsckoL295" class="line" b.c#L296" idioL29bfs/ocockch" idofck.c#L353" idioL353" class="line" ts" class="sref">stats);
433" class4"line" namtioL333"> 333<4a>   43
->4a href="+code=b_lock" cl4ss="s4ef">b_locktioL308"> 308}
#endif  /* CO4ef">new_c4unt)
CONFIG_DEfailu/ocfs2/blockcheck.c#L221" idioL2ref="+code=new_count" class="sref">4tioL336">4336                <4 href43code=b_lock" c" class="sref">rcf="+code=new_count" class="sref">4tioL326" 4ML_NOTICE" class="sref">4L_NOT43",
parent);
oc4s2_blockcheck_inc_failures);
stats)
)
 221<4namtioL344"> 3431{
 3081" idioL351" clRC32Lstats":" clrs":"0x%x, atmpulod"0x%x. Applys="lECC.      if (! 221<4nunt" cla4> new_count(unsignednintss="sref">u64u644dioL342" 4lass="line" namtioL342">4342
4343b_locktioL308"> 308}
 309#endif  /* CO4ioL345" c4ass="line" namtioL345"> 445)23"> 223enioL3);
stats)23"> 223enioL3);
CONFIG_DEfailu/ocfs2/blockcheck.c#L221" idioL2ref="+code=new_count" class="sref">4ats" clas4="sref">stats->b_s)23"> 223fix);
stats)23"> 223fix);
CONFIG_DEfailu/ocfs2/blockcheck.c#L221" idioL2="sref">CONFIG_DEeccs="line" namtioecc cla ^ock" class="srefrc_eccs="line" namtiorc_ecc claref="+code=new_count" class="sref">4aioL326" 4lure_count++;
b_failure_count;
b_locktioL308"> 308}
#endif  /* CO449" class4"line" namtioL349"> 349<4a>   452_blockcheck_inc_failureck.c#L296" idioL29c6" clack.c#L363" idioL36crc32_                 crc32_  oL295~kcheck.c#L224" idicode=CONFIG_DEBUG_FS" class="sref">CONFIG_DEfailu/ocfs2/blockcheck.c#L221" idioL2ref="+code=new_count" class="sref">4->4a href="+code=b_lock" cl4ss="s4ef">b_lockc" class="sref">rc /a>static void );
stats)
 352<4a>                parent);
ML_NO4ICE 217              4#L355" id4oL355" class="line" namt4oL35545cksum failures" class="sref">stats4_blockche4k_inc_recover" class="sr4f">oc4s2_blockcheck_inc_recover/a>++;
tioL308"> 3081" idioL351" cFixednlRC32Lstats":" clrs":"0x%x, atmpulod"0x%x      if (! 221<4ss="sref"4stats)
u64u644namtioL354"> 356{
u64 4358
4359     ref">parent);
 461stats)
stats->b_b.c#L296" idioL29bfs/ocd2line" nam 25t;4ref">b_re4over_count++;
        ret4g">&4uot;C46f">b_lockef="fs/ocfs2/blockcheck.c#L296" idioL296" class="line" namtioL296"> 296    4>ss=4sref"46ckcheck.c#L356" idioL356" class="line"4 namtioL246"> 266{
 207r4 = -ik.cuncef="fgenerates"line" inc#Lmaef="fat.  Llist of ref="f_heads.> >



      4 if (!snstall"amtn>

         * nr + d i4lure_count++;
s++;
s++;
 *
 20309#endif  &qu3="string">&qu4ug_dir" c43ss="s37cksum failures" 4lass=47 * ic oL303" ref="fs/ocfref">sblock, ine"cfs2/r must make"samtnany oL303"> >
 >
b_de43g_che37line" namtioL2064> 2064/a>ik.cuncef="fgeneratesockcheck.c#L228"39gt; 207<4pan c4ass="*>
 >
b_d43ug_di38#L227" idioL227"4class4"line" ref="fs/ocfref">snstall"ittle-ocfs   /a>  sL309"wi >
&4" namtioL439"> 238>
/* CO449" class4"line" namtioL>b_debug_43ilure38omment">        4* nr 4 d ie"m failuref">statmpulockcheck.c#L286"cksum fai_lina        &am)ref="+code=new_counksum fai_linccs="s="line" ts" class="sr="fs/ocfs2/aref="+code=new_"fs/ocfs2//bloc*" idioL29bfs/oc21ina        &am)relinccs=,                    n href="fs/ocfs2/nbugfs_create(&4t;checksu43_fail38ef="+code=b" cla4s="sr48"sref">parent);
<<<<<<<<<<<<<<<<<<<stats);
 291    4">b_debug43ir 203+code=ocfs4ew_count<4a>)
        4     482/blockcheck.                   i/blockcheck.c#Li"> 296    4>               4 * nr48(ass="line" namtiouef="+coclass="sref">b_ck.c#L296" idioL29c6" cla="sref">CONFIG_DEeccs="line" namtioecc class="line" namtioL296"> 296    4ef">u64 b_debu43recov38line" namtioL2064> 20648" class="line"4 namtioL246"> 266{
 207<4pan c48dioLan>);
4ref">b_re4over_count">b_debug43ir     43 if (3a hrefs="string">4quot;49nlock" class="sref">spin_unlock 291    4g_failure43class3"sref">b_debug_fa4luree4eeeeeeeeeeeeek.c#L353"ckcheck.c#L358" idioL358" class="line" n4       static v4id ->4ount" cla4s="sref">b_checover" cl43s="sr39code=b_lock" cla4s="sr4f">b_uass="line" namtiouef="+sckoL295" class="line" b.c#L296" idioL29bfs/ocockch" idofck.c#L353" idioL353" class="line" ts" class="sref">stats);
433" class4"line" namtioL         43    <39fs2_blockcheck_i4c_che49check.c#L343" 4mtioL303"4 303      293
<43href=39cksum failures" 4lass=492/blockcheck.fs/o" idioL29bfs/ocoi/blockcheck.c#Li"> 2    ine" namtioecc clack.c#L363" idioL36crc32_   CONFIG_DEBUG_FS" clack.c#L363" idioL36s)23"0AXs="line" namtioi/blockcheck.c#Li"> 2 < ">spin_unlock 2++="+code=ocfs4ew_count<4a>)
memsckcheass="line" namtiouef="+ack.c#L363" idioL36crc32_                 crc32_  oL295~kcheck.c#L224" idicode=" idioL29c6" cla="sref">CONFIG_DEeccs="line" namtioecc cl1ina        &am)relinccs=[s="line" namtioi/blockcheck.c#Li"> 2]lass="b5t;CONFIG_De=ass=s="line" namtioecc cl1ina        &am)relinccs=[s="line" namtioi/blockcheck.c#Li"> 2]lass="b5t;4->4a href="+code=e=ocfs2_b43ckche39ckcheck.c#L356" 4dioL349cover_count++;
r4 = -snstalbbbbbbbbbbbbbbbbe"in ooff.c# reftine"k ocfs is n_ount*ia hre.  bcitooff.c#ockcheck.c#L228"3b_debug_d3r" class="sre5L197" cla54 if (3a hrefs="string">5ine" 50kchec/a>
b_debug_fa5     50line" bchshouldsbe"a pointerbbbbbbbbbbbbbbbbes="comment">/* CO449" class4"line" namtio5="line" n54tioL340omment">        5* nr 50_failures);
)23"2/blnamtiouoL315"ss="sref">u64)ine" namtioecc cl1ina        &am)relinccs=[s="line" namtioi/blockcheck.c#Li"> 2]lass="b5t;CONFIG_De=ass=s="lint">/* CO449" class4"line" namtio5=4line" n54s="sr39code=b_lock" cla5s="sr50"sref">parent);
<<<<<<<<<<<<<<<<<<<<s);
 2]lass="b5t;/* CO449" class4"line" namtio5=5line" n54    <39fs2_blockcheck_i5ioL20505sref">parent);
<<<<<<<<<<<<<<<<<<<<s);
 2]lass="b5t; 2ass="sref">4->4a href="+code5
ocfs2_4lockcheck4debug_remove"5class="sr54">ocf40code=b_lock" cla5s="sr5f">b_b.c#L296" #L226" idioL226" class="line" namtioL224="sref">r4 = - >
snstalbbbbbbbb>
parent)5oL308" cl54s="li41dioL269" class="5ine" 51kchec/a>
/* CO449" class4"line" namtio5a href="f54ocfs241L280"" idioL227"5class51sref/a>++;
4/7 namtio43a href="+cod5L312"> 3154/a>in41omment">        5* nr 51stats->4ount" cla4s="sref">b_ch5code=stat54 clas41ef="+code=b" cla5s="sr51">b_b.c#L296" idioL29bfs/ocd2line" nam 25t;4/9ckcheck4dremove(<5 class="l54e" na41class="line" nam5ioL2051(ass="line" namtiouef="+2line" nam 25t;u644/blockche4k.c#L307" idi5check.c#L545" id41omment">        5     5cs="li="line" na4pu64" cla4_blockcheck_s5code=ocfs54block41>               5 * nr51="sref">ocfs2_4lockcheck4debug_remove"5/a>( 2065/a>r4 = - 354v41oL207"> 207<5pan c5ass="*09#endif   >
r4 = -ocfs54block4heck_sheck.c#L3105 idio52line" ref="fs/ocfref">snstall"i"fs/ocfs2/blidioL226" class_lin,ca   of zeros="lbc        2"v3u"line" namtioL224="sref">r4 = -inline int 5a hre52kchec/a>
 >
r4 = -b_debug_fa5luree52line" ref="fs/ocfref">snstall"must hav  zeroednany> >
static v5id ik.cuncef="fvalidates"amts a   zeroed.> >
parent)5ss="line"54amtio42code=b_lock"  *parent)5sclass="l54ref">4cfs2_blockcheck_i5c_che52> 20309#endif   >
s="comment">/* CO449" class4"line" namtio5 href="fs54cfs2/422_blockcheck_inc5recov5r(lass="ref">stvalidateckcheck.c#L286"cksum fai_lina        &am)ref="+code=new_counkksum fai_linccs="s="line" ts" class="sr="fs/ocfs2/aref="+code=new_"fs/ocfs2//bloc*" idioL29bfs/oc21ina        &am)relinccs=,                    n href="fs/ocfs2/nbugfs_create(&5de=new_co54t" cl42ckcheck.c#L356" 5dioL352cover_count++;
stats);
 221<4hIG_DEBUG40" idioL320" 5mtioL326"54326parent);
stats 354
5429 2ine" namtioecc cl                                     4cfs2_bloc4check_inc_che5ats-&54;b_rc_crc32fs2/blockcheck.c#c_crc32f cla                                  4c" namtio4stats)
++;
<54href=43ode=stats" class5"sref53heckb.c#L296" idioL29bfs/ocd"oclass="sref">b_rc_eccs="line" namtiorc_ecc cla                                  4c7 namtio4"> 324{
<5ck_count<54>;
b_memsckcheck.c#L239" imemcoclass="sref">b_ck.c#L296" idioL29c6" cla="sref">CONFIG_DEeccs="line" namtioecc class="line" namtioL296"> 2ine" namtioecc clfix="line" namtioLfix              4c7 namtio4"> 324{
<5cclass="l54a>   43
->4a href="+code5b_lock" c54ss="s4ef">b_locktio5308">53ode=e=stONs2/blockcheck.ce=stONoL295" class="line" eccs="line" namtioecc cln href="fs/ocfs2/nbugfs < 0ass="sref">4ref">b_re4over_countocfs2_4lockcheck4debug_remove"5         54 href43code=b_lock" c" 5lass=5sref">rcspin_unlock 291    5ss="sref"54L_NOT43",
<5 hres5="sref">parent);
oc4s2_blockcheck_inc5failu5es);
stats)
 352<4a>           5href="fs/54fs2/b44f="+code=b_lock"5class54" class="line"       tioL54heckb.c#L296" idioL29bfs/ocd#c_crc32f clack.c#L363" idioL36  as_to_cpus2/blockcheck.c  as_to_cpuoL295" class="line" b.c#L296" idioL29bfs/ocd2line" nam 25t;stats)
s5de=new_co54t" cl4ss="sref">new_cou5t(uns54">b_b.c#L296" idioL29bfs/ocd2lc clack.c#L363" idioL36  oL_to_cpus2/blockcheck.c  oL_to_cpuoL295" class="line" b.c#L296" idioL29bfs/ocd2line" nam 25t;stats)

b_locktio5308">54ode=e=stONs2/blockcheck.ce=ssckoL295" class="line" b.c#L296" idioL29bfs/ocockch" idofck.c#L353" idioL353" class="line" ts" class="sref">stats);
433" class4"line" namtio5tioL345">5445ocfs2_4lockcheck4debug_remove"5/a>-><54href=4+code=b_lock" cla5s="sr54">b_b.c#L296" #L226" idioL226" class=2Lvalidates, we'   goodclasgas*09#endif  /* CO4ef">new_c4unt)
parentfs/o" idioL29bfs/ocoi/blockcheck.c#Li"> 2    ine" namtioecc clack.c#L363" idioL36crc32_   COAXs="line" namtioi/blockcheck.c#Li"> 2 < ">spin_unlock 2++=nt">/* CO4ef">new_c4unt)
;
b_locktio5308">55CONFIG_DEeccs="line" namtioecc cl1ina        &am)relinccs=[s="line" namtioi/blockcheck.c#Li"> 2]lass="b5t;CONFIG_De=ass=s="line" namtioecc cl1ina        &am)relinccs=[s="line" namtioi/blockcheck.c#Li"> 2]lass="b5t;4->4a href="+code5349"> 34954a>   452_blockcheck_inc5failu55nlock" class="sree" namtiouef="+ack.c#L363" idioL36crc32_  2fs2/blockcheck.c#c_crc32f cla>f="+code=new_count" class="sref">4tioL326" 4ML_NOTICE" cl5b_lock" c54ss="s4ef">b_lockc" 5lass=55eeeeeeeeeeeek.c#L353"a href="fs/ocfs2/blockcheck.c#L273" idioL273" class="li4code=ML_N4TICE" class="5s/ocfs2/b54ckche45b_ch5    b_b.c#L296" idioL29bfs/ocddef );
stats)
)
ML_N54ICE(ass="line" namtiouef="+L295" class="line" namERROR+;
 221<4namtioL344"> 3431{
<5line" nam54oL35545cksum failures" 5lass=556eeeeeeeeeeek.c#L3" clRC32Lstats":" clrs":"0x%x, atmpulod"0x clasu if (! 221<4nunt" cla4> oc4s2_blockcheck_inc5recov55memsckcheass="64u644namtioL354"> 356{
<5href="fs/54fs2/b45_des="lilass="sr5f(uns55" class="line"4 namtioL246"> 266{
5 href="fs54cfs2/45
/* CO4ioL345" c4ass="line" na5de=new_co5t" cl46        if (! 2    ine"_DEBUG_FS" clack.c#L363" idioL36s)23"0AXs="line" namtioi/blockcheck.c#Li"> 2 < ">spin_unlock 2++="+code=ocfs4ew_count<45ass="line5 namtioL358">4358
r44359   5 ref"56ug_fa5     50line" bchshouldsbe"a pointerbbbbbbbbbbbbbbbbe"in onumbfs ref=itsle oisk ocfs is obviously n_ount*8lockcheck.c#L228"3b_debug_d3rss="line"5namtioL361"> 461st5ts->b++;
 20eeeeeeee*09#endinterbbbbf  /* CO4ioL345" c4as 3431{     ret4g">&4uot;C46f">5_lock56res" 5lass=556eeee155(ass="line"ef="fs/ocfas ack.c#L363" idioL36s)23"2/blnamtiouoL315"ss="sref">u64)ine" namtioecc cl1ina        &am)relinccs=[s="line" namtioi/blockcheck.c#Li"> 2]lass="b5t;CONFIG_De=ass=s="lint">/* CO449" class4"         5  2]lass="b5t;/* CO449" class4"blockchec5_statsss=4sref"46ckc5eck.c56356" 5dioL352cover_count++;
 2]lass="b5t; 2ass="sref">4->4a"> 266 256s/ocf52/blo555     5cs="li="line" na4pu64" cla4_/a> = - 2ass="sref">4->4a="fs/ocfs5/blockcheck.c4L269"47>
<5 href57 int )23"0AXs="line" namtioi/blockcheck.c#Li"> 2 < ">spin_unlock 2++="+code=ocfs4ew_count<45if (!c" 5lass=55eeeeeeee5> 2065/a>r4 5       * nr + d i4lure_count<<<<<<<<<<<<<<<< " claix/a>#enst eachbbbbe"rf="ftca   oonfs abe"c.  bcitooff.c#ockcheck.c#L228"3b_debug_d3rf">s++;
<544
 20309#end<<<<<<<<<<<<<<</* CO4ioL345" c4a"string">5qu4ug_dir" c43ss="s37cks5m fai57res" 5lass=556eeee155(ass="line"223enioL3);
 2]lass="b5t;CONFIG_De=ass=s="line" namtioecc cl1ina        &am)relinccs=[s="line" namtioi/blockcheck.c#Li"> 2]lass="b5t;/* CO449" class4"" class="5re4lockcheck43#L27537>  5     57k_inc4recov4rmemsssssssssssssssssssDe=ass=s="line" namtioecc cl1ina        &am)relinccs=[s="line" namtioi/blockcheck.c#Li"> 2]lass="b5t;f="+code=ne     nt)
;
b_locktio5308">55 266{
5 href="fs54cfs2/45
/* CO4ioL345" c4ass="line" na5d309loe" namtiouef="+ack.c#L363" idioL36crc32_23ditooff.c#ockcheck.c#L228"3b_debug_d3                57 4dioL359" 4lass="line" namtioL359">435ck.c#L22853b_debug_d3r" class="sre5check58UG_FS" class="sref">CONFIG_DEfailu/ocfs2/blockcheck.c#L221" idioL2ref="+code=new_count" class="sref">45* nr 4 d 5e"m failuref">statmpuloc5check58e5> 2065/a>CONFIG_DEeccs="line" namtioecc cl1ina        &am)relinccs=[s="line" namtioi/blockchec ts" clas5="sr="fs/ocfs2/aref="+co5e=new584
 2]lass="b5t;4->4a href="+code5349"> 34954a>   452_blockcheck_inc5failu55nlock" class="sree" namtiouef="+ack.c#L363" idioL36ecc cl1ina        &am)relinccs=[s="line" namtioi/blockcheck.c#Li"> 2]lass="b5t;#endif  /      n h5ef="fs/ocfs2/nbugfs_crea5e584t" cl4ss="src" class="line" ef="+code=stats" class="sref">stats)
 352<4a>                5203+code=ocfs4ew_count<45>)
ML_NO4ICE 217              4#L355" id4oL355" class="line" namt4oL35545cksum failures5ne" namti5uef="+coclass="sref">b_c5.c#L258ref=54s/ocf40        s/ocfs2/blockchec" class="line" ef="+code=stats" class="sref">stats)
580fs2/blockcheck.c5L348"50ss="*>
 266{
parentfs/o" idioL29bfs/ocoi/blockchecb_debug435r4aref">u64u644namtio<5href="fs/54fs2/b45_des="lilass="sr5f(uns55" clasa>     435if (3a hrefs="string">4q5ot;4958fuot;);
<=""fs/ocf52/blo55dioLan>);
 309#endif  /* CO4ioL345" c4ass="line" na5de=new_co5t" cl46        if (! 461stats)
stats)
        5     5cs="li="line" na4pu64" cla4_blockcheck_s5code=ocfs54block41>               5 * nr51="sref">ocfs2_4lockchecks="li="line" na4pu64" cla4_blockcheck_s5code=ots)
 221<4ss="sre5k.c#Li"> 5]lass="b5t;CONFIG_De=a"> 207r45*8lockche5k.c#L228"3b_debug_d3r" c5ass="5re5L29ck.c5L348"50ss="*>
436bbbbbe"re6tine"k ocfs is n_ount*8*6lockc6eck.c#L228"3b_debug_d3r" clatats *        5* nr 50_failure4="fses   aeck.midioAPI. 4="fyblockcheck.super<<< * 223enioL3);
 *    under 356 20309#endif  &qu3=="fybexpectee*09<<<<<<(s)ref"47odio     /a> inef="fs/ocfs2/blockcheck.c#L228"4k9ckcheck6"5e" n54 6 ="line" namtioi/blockch6e5
(lass="ref2ref="+code=new_count" class="sref">464="sref">64 = -&4t;checksuref="f54metau64" cla4_blockchechecksuref="f54metau64"checkclass=2Lvalidates, we&super/45fs2  4#L355" id4oL3uper/45fs2> 2664647"sref">64lass="b5t;b_locktio5308">55 296    4>               4 * nr48(ass="l6ckcheck.c6L228"4   struct4)c" class="line" ef=#Li"> metau64" cla4_blockchechecksumetau64"checklass="line" ef=OCFS2_SB cla4_blockchecOCFS2_SB217"> 217        b  4#L355" id4oL3b (ass="l6ef="f54oc6s241L280"" idioL227"5cla6s51sr61">CONFIG_De=ass=s="line" namtioecc cr_count++;
 296    aref="f5217"> 217       a href="+code=ocfs4ew_count<4a>)
 ss="line" namtioL224="sref">r46MAXs="lin6" namtioUSHRT_MAXioL2ref6"+cod6=new_cck.c5L348"50ss="*>
->4ount" c6a4s="61_crc32f cla>stats)
&5de=new_aaaaaaaaametau64" cla4_blockchechecksuaaaaaaaaametau64"checkclass=2Lvalidates, we&super/45fs2  4#L355" id4oL3uper/45fs2> 26646check4dre6ove(<5 class="l54e" 6a41cl61ef">parent);
<<<<<<<<<<<<<<<<4     482/blockcheck.                   i/blockcheck.c#Li"> 296    4>               4 * nr48(ass="l6"+code=ne6_count" class="sref">4/b6ockch61" idioL29c6" cla="sref">CONFIG_DEeccs="6= - 354v41oL207">6207    4ef">u64  3uper4>     OCFS2_SB cla4_blockchecOCFS2_SB217"> 217        b  4#L355" id4oL3b ocfs54b6ock4h61ck.c#Li"> 2    ine"_DEBUG_FS" clack.c#6226" clas6_lin,ca   of zeros="lbc 6     61fuot;)c" class="line" ef=#Li"> metau64" cla4_blockchechecksumetau64"checklass="line" ef=osb  4#L355" id4oLo3b (ass="l6.> >
CONFIG_De=ass=s="line" namtioecc c=stats" class5"sref53heckbne" namtioecc cr_count++;
 296    aaaaaaaaa217"> 217       a href="+code=ocfs4ew_count<4a>)
46dnany> >
6a href="fs/ocfs2/blcfs2/6lockc62amtioL361"> 461parent6/a>)562_crc32f cla>stats)
4cfs26blockcheck_i5c_che52> 20609 207r46s="line" 6amt5href="fs/54fs2/b42  6     6f (!
433" class4"line" namtio5t6" ts" cla6s="sr="fs/ocfs2/aref="+c6de=ne620fs2/class="string">&4t;checksuref="f54metau64"#L356" 5dioL352cover_counref="f54metau64"#L35checkclass=2Lvalidates, we&super/45fs2  4#L355" id4oL3uper/45fs2> 266433" class4"line" namtio5t6"ists="lc6ref="fs/ocfs2/nbugfs_cre6teb_locktio5308">55stats);
 221<4hIG_DEBUG40" idioL320" 5mtioL326"54326parent);
stats4     482/blockcheck.                   i/blockcheck.c#Li"> 296    4>               4 * nr48(ass="l6ref="fs/o6fs2/bl5ckche53ref="+code6ocfs26blockcoL29c6" cla="sref">CONFIG_DEeccs="64;)c" class="line" ef=#Li"> metau64" cla4_blockchechecksumetau64"checklass="line" ef=OCFS2_SB cla4_blockchecOCFS2_SB217"> 217        b  4#L355" id4oL3b (ass="l6c32fs2/bl6ckcheck.c#c_crc32f cla  6     63amtioL361"> 461++;
parent);
<<<<<<<<<<<<<<<<<<<="+b.c#L296" idioL29bfs/oc21" class="line"tioL221"> 221<4hIG_DEBUG40" idioL320" 5ina        &am)re  ss="line" namtioL224="sref">r46">b_rc_ec6s="line" namtiorc_ecc cl6     6 classck.c5L348"50ss="*>
CON6IG_DE63ef">ML_N54ICE   43
<6 href="fs/ocf52/blo5kche6k.c#L643" 4< class="string">&5de=new_aaaaaaaaametau64"b" cla4s="sr48"sref">pareaaaaaaaaametau64"b" ccheckclass=2Lvalidates, we&super/45fs2  4#L355" id4oL3uper/45fs2> 266433" class4"line" namtio5t6="fs/oc546/blo432_blockcheck_inc5r6cov5363ref=54s/ocf40        if (!stats);
 221<4hIG_DEBUG40" idioL320" 5mtioL326"54326stats4     482/blockcheck.                   i/blockcheck.c#Li"> 296    4>               4 * nr48(ass="l6ent);6CONFIG_DEeccs="64L348"52"6che5k.c#L349" idioL4_blo6kche46_inc_failure5 c>u64  3uper4>     OCFS2_SB cla4_blockchecOCFS2_SB217"> 217        b  4#L355" id4oL3b  352<4a>         6 5hre6="fs/54fs2/b44f="+code=b_lock"5class54"6class="li6e"        metau64" cla4_blockchechecksumetau64"checklass="line" ef=osb  4#L355" id4oLo3b (ass="l6ne" nam 26t;++;
++;
 221<4hIG_DEBUG40" idioL320" 5ina        &am)re 5mtioL326"54326s5de6new_c654t" cl4ss="srrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr&cs="li="line" naosb  4#L355" id4oLo3b 
<6 href=#L296" idioL29bfs/ocd"oclass="sre6b"fs/oc546     &am)ref="+code=new_6ount"64ref=54s/ocf40"> 207r46oL345">5465#endif  parentfs/o" idioL29bfs/ocoi/blockche6k.c#Li"> 6    ine" namtioecc clack6c#L366" idio


="fs/riginal LXR softw abm4ioL2ntfs/o" ihttp://sourcas54ge.net/projects/lxr >LXR >(launity20" 5is/ocfexperiass=al vers_debbm4ntfs/o" imailto:lxr@mtiux.no">lxr@mtiux.no20" .
lxr.mtiux.no kindly hosf">4bm4ntfs/o" ihttp://www.redpill-mtipro.no">Redpill Ltipro AS20" 5iprovidt5ts(nsule=s/a">/*opde=sionr servicer since 1995.