Remove debug messages.

Fix last segment detection.
This commit is contained in:
Moinak Ghosh 2012-07-10 21:11:31 +05:30
parent a873f92e41
commit 0091a0da02
2 changed files with 3 additions and 4 deletions

View file

@ -284,11 +284,11 @@ rabin_dedup(rabin_context_t *ctx, uchar_t *buf, ssize_t *size, ssize_t offset, s
*rabin_pos = last_offset; *rabin_pos = last_offset;
return (0); return (0);
} }
if (j < *size * 0.55) if (j > *size * 0.40)
ctx->data_type = DATA_BINARY; ctx->data_type = DATA_BINARY;
else else
ctx->data_type = DATA_TEXT; ctx->data_type = DATA_TEXT;
printf("Original size: %lld\n", *size);
// If we found at least a few chunks, perform dedup. // If we found at least a few chunks, perform dedup.
if (blknum > 2) { if (blknum > 2) {
uint64_t prev_cksum; uint64_t prev_cksum;
@ -464,7 +464,6 @@ cont:
entries[2] = htonll(pos1 - rabin_index_sz - RABIN_HDR_SIZE); entries[2] = htonll(pos1 - rabin_index_sz - RABIN_HDR_SIZE);
*size = pos1; *size = pos1;
ctx->valid = 1; ctx->valid = 1;
printf("Deduped size: %lld, blknum: %u\n", *size, blknum);
/* /*
* Remaining header entries: size of compressed index and size of * Remaining header entries: size of compressed index and size of

View file

@ -216,7 +216,7 @@ Read_Adjusted(int fd, uchar_t *buf, size_t count, ssize_t *rabin_count, void *ct
rcount = Read(fd, buf2, count); rcount = Read(fd, buf2, count);
if (rcount > 0) { if (rcount > 0) {
rcount += *rabin_count; rcount += *rabin_count;
if (!rcount < count) if (rcount == count)
rabin_dedup(rctx, buf, &rcount, *rabin_count, rabin_count); rabin_dedup(rctx, buf, &rcount, *rabin_count, rabin_count);
else else
*rabin_count = 0; *rabin_count = 0;