summaryrefslogtreecommitdiff
path: root/lib/sqfs/blk_proc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqfs/blk_proc')
-rw-r--r--lib/sqfs/blk_proc/deduplicate.c6
-rw-r--r--lib/sqfs/blk_proc/fragtbl.c12
-rw-r--r--lib/sqfs/blk_proc/internal.h6
3 files changed, 12 insertions, 12 deletions
diff --git a/lib/sqfs/blk_proc/deduplicate.c b/lib/sqfs/blk_proc/deduplicate.c
index 34e4e37..08a108e 100644
--- a/lib/sqfs/blk_proc/deduplicate.c
+++ b/lib/sqfs/blk_proc/deduplicate.c
@@ -25,7 +25,7 @@ int store_block_location(sqfs_block_processor_t *proc, uint64_t offset,
}
proc->blocks[proc->num_blocks].offset = offset;
- proc->blocks[proc->num_blocks].signature = MK_BLK_SIG(chksum, size);
+ proc->blocks[proc->num_blocks].hash = MK_BLK_HASH(chksum, size);
proc->num_blocks += 1;
return 0;
}
@@ -36,8 +36,8 @@ size_t deduplicate_blocks(sqfs_block_processor_t *proc, size_t count)
for (i = 0; i < proc->file_start; ++i) {
for (j = 0; j < count; ++j) {
- if (proc->blocks[i + j].signature !=
- proc->blocks[proc->file_start + j].signature)
+ if (proc->blocks[i + j].hash !=
+ proc->blocks[proc->file_start + j].hash)
break;
}
diff --git a/lib/sqfs/blk_proc/fragtbl.c b/lib/sqfs/blk_proc/fragtbl.c
index 2467036..39e8136 100644
--- a/lib/sqfs/blk_proc/fragtbl.c
+++ b/lib/sqfs/blk_proc/fragtbl.c
@@ -49,7 +49,7 @@ static int grow_deduplication_list(sqfs_block_processor_t *proc)
}
static int store_fragment(sqfs_block_processor_t *proc, sqfs_block_t *frag,
- uint64_t signature)
+ uint64_t hash)
{
int err = grow_deduplication_list(proc);
@@ -58,7 +58,7 @@ static int store_fragment(sqfs_block_processor_t *proc, sqfs_block_t *frag,
proc->frag_list[proc->frag_list_num].index = proc->frag_block->index;
proc->frag_list[proc->frag_list_num].offset = proc->frag_block->size;
- proc->frag_list[proc->frag_list_num].signature = signature;
+ proc->frag_list[proc->frag_list_num].hash = hash;
proc->frag_list_num += 1;
sqfs_inode_set_frag_location(frag->inode, proc->frag_block->index,
@@ -75,14 +75,14 @@ static int store_fragment(sqfs_block_processor_t *proc, sqfs_block_t *frag,
int handle_fragment(sqfs_block_processor_t *proc, sqfs_block_t *frag,
sqfs_block_t **blk_out)
{
- uint64_t signature;
+ uint64_t hash;
size_t i, size;
int err;
- signature = MK_BLK_SIG(frag->checksum, frag->size);
+ hash = MK_BLK_HASH(frag->checksum, frag->size);
for (i = 0; i < proc->frag_list_num; ++i) {
- if (proc->frag_list[i].signature == signature) {
+ if (proc->frag_list[i].hash == hash) {
sqfs_inode_set_frag_location(frag->inode,
proc->frag_list[i].index,
proc->frag_list[i].offset);
@@ -116,7 +116,7 @@ int handle_fragment(sqfs_block_processor_t *proc, sqfs_block_t *frag,
proc->frag_block->flags = SQFS_BLK_FRAGMENT_BLOCK;
}
- err = store_fragment(proc, frag, signature);
+ err = store_fragment(proc, frag, hash);
if (err)
goto fail;
diff --git a/lib/sqfs/blk_proc/internal.h b/lib/sqfs/blk_proc/internal.h
index 3d27b04..b6a0342 100644
--- a/lib/sqfs/blk_proc/internal.h
+++ b/lib/sqfs/blk_proc/internal.h
@@ -27,7 +27,7 @@
#endif
-#define MK_BLK_SIG(chksum, size) \
+#define MK_BLK_HASH(chksum, size) \
(((uint64_t)(size) << 32) | (uint64_t)(chksum))
#define INIT_BLOCK_COUNT (128)
@@ -35,13 +35,13 @@
typedef struct {
uint64_t offset;
- uint64_t signature;
+ uint64_t hash;
} blk_info_t;
typedef struct {
uint32_t index;
uint32_t offset;
- uint64_t signature;
+ uint64_t hash;
} frag_info_t;