1. 04 6月, 2009 1 次提交
    • J
      ocfs2: Add statistics for the checksum and ecc operations. · 73be192b
      Joel Becker 提交于
      It would be nice to know how often we get checksum failures.  Even
      better, how many of them we can fix with the single bit ecc.  So, we add
      a statistics structure.  The structure can be installed into debugfs
      wherever the user wants.
      
      For ocfs2, we'll put it in the superblock-specific debugfs directory and
      pass it down from our higher-level functions.  The stats are only
      registered with debugfs when the filesystem supports metadata ecc.
      Signed-off-by: NJoel Becker <joel.becker@oracle.com>
      73be192b
  2. 06 1月, 2009 5 次提交
    • J
      ocfs2: One more hamming code optimization. · 58896c4d
      Joel Becker 提交于
      The previous optimization used a fast find-highest-bit-set operation to
      give us a good starting point in calc_code_bit().  This version lets the
      caller cache the previous code buffer bit offset.  Thus, the next call
      always starts where the last one left off.
      
      This reduces the calculation another 39%, for a total 80% reduction from
      the original, naive implementation.  At least, on my machine.  This also
      brings the parity calculation to within an order of magnitude of the
      crc32 calculation.
      Signed-off-by: NJoel Becker <joel.becker@oracle.com>
      Signed-off-by: NMark Fasheh <mfasheh@suse.com>
      58896c4d
    • J
      ocfs2: Another hamming code optimization. · 7bb458a5
      Joel Becker 提交于
      In the calc_code_bit() function, we must find all powers of two beneath
      the code bit number, *after* it's shifted by those powers of two.  This
      requires a loop to see where it ends up.
      
      We can optimize it by starting at its most significant bit.  This shaves
      32% off the time, for a total of 67.6% shaved off of the original, naive
      implementation.
      Signed-off-by: NJoel Becker <joel.becker@oracle.com>
      Signed-off-by: NMark Fasheh <mfasheh@suse.com>
      7bb458a5
    • J
      ocfs2: Don't hand-code xor in ocfs2_hamming_encode(). · e798b3f8
      Joel Becker 提交于
      When I wrote ocfs2_hamming_encode(), I was following documentation of
      the algorithm and didn't have quite the (possibly still imperfect) grasp
      of it I do now.  As part of this, I literally hand-coded xor.  I would
      test a bit, and then add that bit via xor to the parity word.
      
      I can, of course, just do a single xor of the parity word and the source
      word (the code buffer bit offset).  This cuts CPU usage by 53% on a
      mostly populated buffer (an inode containing utmp.h inline).
      
      Joel
      Signed-off-by: NJoel Becker <joel.becker@oracle.com>
      Signed-off-by: NMark Fasheh <mfasheh@suse.com>
      e798b3f8
    • J
      ocfs2: block read meta ecc. · d6b32bbb
      Joel Becker 提交于
      Add block check calls to the read_block validate functions.  This is the
      almost all of the read-side checking of metaecc.  xattr buckets are not checked
      yet.   Writes are also unchecked, and so a read-write mount will quickly fail.
      Signed-off-by: NJoel Becker <joel.becker@oracle.com>
      Signed-off-by: NMark Fasheh <mfasheh@suse.com>
      d6b32bbb
    • J
      ocfs2: Add the underlying blockcheck code. · 70ad1ba7
      Joel Becker 提交于
      This is the code that computes crc32 and ecc for ocfs2 metadata blocks.
      There are high-level functions that check whether the filesystem has the
      ecc feature, mid-level functions that work on a single block or array of
      buffer_heads, and the low-level ecc hamming code that can handle
      multiple buffers like crc32_le().
      
      It's not hooked up to the filesystem yet.
      Signed-off-by: NJoel Becker <joel.becker@oracle.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Signed-off-by: NMark Fasheh <mfasheh@suse.com>
      70ad1ba7