wok-6.x rev 18001
fusecloop: block devices are ... block aligned (512 bytes)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sat Apr 25 17:12:51 2015 +0200 (2015-04-25) |
parents | f30d62ef1081 |
children | f0deba3de1ee |
files | fusecloop/stuff/fusecloop.u |
line diff
1.1 --- a/fusecloop/stuff/fusecloop.u Sat Apr 25 12:57:51 2015 +0200 1.2 +++ b/fusecloop/stuff/fusecloop.u Sat Apr 25 17:12:51 2015 +0200 1.3 @@ -209,7 +209,7 @@ 1.4 + table_size = ntohl(tail.table_size); 1.5 + table = malloc(table_size); 1.6 + len = i = num_blocks * (ntohl(tail.index_size) & 255); 1.7 -+ lastlen = ntohl(tail.index_size) / 256; 1.8 ++ lastlen = ntohl(tail.index_size) & ~0x1FF; 1.9 + offsets = malloc(num_blocks * sizeof(*offsets)); 1.10 + if (!table || !offsets || 1.11 + read(handle, table, table_size) != table_size || 1.12 @@ -344,7 +344,7 @@ 1.13 1.14 --- create_compressed_fs.c 1.15 +++ create_compressed_fs.c 1.16 -@@ -0,0 +1,149 @@ 1.17 +@@ -0,0 +1,148 @@ 1.18 +#ifdef FIND_BEST_COMPRESSION 1.19 +#include <compress.h> 1.20 +extern "C" { 1.21 @@ -474,8 +474,7 @@ 1.22 + } 1.23 + index[n] = ntohl(len); 1.24 + } 1.25 -+ if (block_size >= 0x1000000) lastlen = 0; 1.26 -+ tail.index_size = ntohl(sizeof(*index) + 256*(lastlen % 0xFFffFF)); 1.27 ++ tail.index_size = ntohl(sizeof(*index) + (lastlen & ~0x1FF)); 1.28 + tail.num_blocks = ntohl(n); 1.29 + n *= sizeof(*index); 1.30 + len = n + n/1000 + 12;