Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 54103
Collapse All | Expand All

(-)squashfs2.0/squashfs-tools/mksquashfs.c (-3 / +10 lines)
Lines 62-67 Link Here
62
int total_compressed = 0, total_uncompressed = 0;
62
int total_compressed = 0, total_uncompressed = 0;
63
63
64
int fd;
64
int fd;
65
unsigned char* read_buffer_base;
65
66
66
/* superblock attributes */
67
/* superblock attributes */
67
int noI = 0, noD = 0, check_data = 0, block_size = SQUASHFS_FILE_SIZE, block_log;
68
int noI = 0, noD = 0, check_data = 0, block_size = SQUASHFS_FILE_SIZE, block_log;
Lines 853-862 Link Here
853
	return start_bytes;
854
	return start_bytes;
854
}
855
}
855
856
857
void setup_read_buffer(void* p)
858
{	
859
	read_buffer_base = (unsigned char*) p;
860
}
856
861
857
unsigned char *read_from_buffer(unsigned int *start, unsigned int avail_bytes)
862
unsigned char *read_from_buffer(unsigned int *start, unsigned int avail_bytes)
858
{
863
{
859
	unsigned char *v = (unsigned char *) *start;
864
	unsigned char *v = read_buffer_base + *start;
860
	*start += avail_bytes;	
865
	*start += avail_bytes;	
861
	return v;
866
	return v;
862
}
867
}
Lines 923-929 Link Here
923
struct file_info *duplicate(unsigned char *(get_next_file_block)(unsigned int *, unsigned int), unsigned int file_start, int bytes, unsigned int **block_list, int *start, int blocks, struct fragment **fragment, char *frag_data, int frag_bytes)
928
struct file_info *duplicate(unsigned char *(get_next_file_block)(unsigned int *, unsigned int), unsigned int file_start, int bytes, unsigned int **block_list, int *start, int blocks, struct fragment **fragment, char *frag_data, int frag_bytes)
924
{
929
{
925
	unsigned short checksum = get_checksum(get_next_file_block, file_start, bytes);
930
	unsigned short checksum = get_checksum(get_next_file_block, file_start, bytes);
926
	unsigned short fragment_checksum = get_checksum(read_from_buffer, (unsigned int) frag_data, frag_bytes);
931
	setup_read_buffer(frag_data);
932
	unsigned short fragment_checksum = get_checksum(read_from_buffer, 0, frag_bytes);
927
	struct file_info *dupl_ptr = bytes ? dupl[checksum] : frag_dups[fragment_checksum];
933
	struct file_info *dupl_ptr = bytes ? dupl[checksum] : frag_dups[fragment_checksum];
928
934
929
935
Lines 1043-1049 Link Here
1043
1049
1044
	close(file);
1050
	close(file);
1045
	if(whole_file) {
1051
	if(whole_file) {
1046
		if(duplicate_checking && (dupl_ptr = duplicate(read_from_buffer, (unsigned int) c_buffer, file_bytes, &block_listp, &start, blocks, &fragment, buff, frag_bytes)) == NULL) {
1052
		setup_read_buffer(c_buffer);
1053
		if(duplicate_checking && (dupl_ptr = duplicate(read_from_buffer, 0, file_bytes, &block_listp, &start, blocks, &fragment, buff, frag_bytes)) == NULL) {
1047
			*duplicate_file = TRUE;
1054
			*duplicate_file = TRUE;
1048
			goto wr_inode;
1055
			goto wr_inode;
1049
		}
1056
		}
(-)squashfs2.0/squashfs-tools/read_fs.c (-1 / +1 lines)
Lines 420-426 Link Here
420
	printf("Read existing filesystem, %d inodes scanned\n", files);
420
	printf("Read existing filesystem, %d inodes scanned\n", files);
421
421
422
	if(inode.inode_type == SQUASHFS_DIR_TYPE) {
422
	if(inode.inode_type == SQUASHFS_DIR_TYPE) {
423
		if((directory_table = squashfs_readdir(fd, !((int) root_name), sBlk->directory_table_start + inode.start_block,
423
		if((directory_table = squashfs_readdir(fd, !root_name, sBlk->directory_table_start + inode.start_block,
424
						inode.offset, inode.file_size, sBlk, push_directory_entry)) == NULL) {
424
						inode.offset, inode.file_size, sBlk, push_directory_entry)) == NULL) {
425
			ERROR("read_filesystem: Could not read root directory\n");
425
			ERROR("read_filesystem: Could not read root directory\n");
426
			goto error;
426
			goto error;

Return to bug 54103