Lines Matching defs:data

30  * d = # data bits
38 * offset in the data buffer. Since the hamming code reserves all
39 * power-of-two bits for parity, the data bit number and the code bit
43 * takes the 0-based data bit from the caller.
45 * An example. Take bit 1 of the data buffer. 1 is a power of two (2^0),
47 * 3 is not a power of two. So bit 1 of the data buffer ends up as bit 3
97 u32 ocfs2_hamming_encode(u32 parity, void *data, unsigned int d, unsigned int nr)
112 for (i = 0; (i = ocfs2_find_next_bit(data, d, i)) < d; i++)
139 /* While the data buffer was treated as little endian, the
144 u32 ocfs2_hamming_encode_block(void *data, unsigned int blocksize)
146 return ocfs2_hamming_encode(0, data, blocksize * 8, 0);
156 void ocfs2_hamming_fix(void *data, unsigned int d, unsigned int nr,
171 * nr + d is the bit right past the data hunk we're looking at.
178 * nr is the offset in the data hunk we're starting at. Let's
194 * i is the offset in this data hunk.
195 * nr + i is the offset in the total data buffer.
203 if (ocfs2_test_bit(i, data))
204 ocfs2_clear_bit(i, data);
206 ocfs2_set_bit(i, data);
212 void ocfs2_hamming_fix_block(void *data, unsigned int blocksize,
215 ocfs2_hamming_fix(data, blocksize * 8, 0, fix);
225 static int blockcheck_u64_get(void *data, u64 *val)
227 *val = *(u64 *)data;
337 * data is the block to be checked. bc is a pointer to the
340 * bc should be a pointer inside data, as the function will
342 * bc does not point inside data, the caller must make sure any inline
345 * The data buffer must be in on-disk endian (little endian for ocfs2).
349 void ocfs2_block_check_compute(void *data, size_t blocksize,
357 crc = crc32_le(~0, data, blocksize);
358 ecc = ocfs2_hamming_encode_block(data, blocksize);
373 * If bc is not a pointer inside data, the caller must have zeroed any
376 * Again, the data passed in should be the on-disk endian.
378 int ocfs2_block_check_validate(void *data, size_t blocksize,
395 crc = crc32_le(~0, data, blocksize);
405 ecc = ocfs2_hamming_encode_block(data, blocksize);
406 ocfs2_hamming_fix_block(data, blocksize, ecc ^ bc_ecc);
409 crc = crc32_le(~0, data, blocksize);
432 * bc should be a pointer inside data, as the function will
434 * bc does not point inside data, the caller must make sure any inline
437 * The data buffer must be in on-disk endian (little endian for ocfs2).
480 * inside data, the caller must have zeroed any inline
483 * Again, the data passed in should be the on-disk endian.
564 void ocfs2_compute_meta_ecc(struct super_block *sb, void *data,
568 ocfs2_block_check_compute(data, sb->s_blocksize, bc);
571 int ocfs2_validate_meta_ecc(struct super_block *sb, void *data,
578 rc = ocfs2_block_check_validate(data, sb->s_blocksize, bc,