diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-03-31 13:21:24 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-03-31 13:21:24 +0000 |
commit | 672d4cc8c0d9d2f7420e837511bffac88777345b (patch) | |
tree | fd087cd175dceb4d41b71334cf6d9f0fcadb24c2 /src/fs/fs_download.c | |
parent | 664f658ddc0b302cc7b04d31319dba1e26f5f603 (diff) | |
download | gnunet-672d4cc8c0d9d2f7420e837511bffac88777345b.tar.gz gnunet-672d4cc8c0d9d2f7420e837511bffac88777345b.zip |
fixes
Diffstat (limited to 'src/fs/fs_download.c')
-rw-r--r-- | src/fs/fs_download.c | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/src/fs/fs_download.c b/src/fs/fs_download.c index 22fdd2141..8192b8c1f 100644 --- a/src/fs/fs_download.c +++ b/src/fs/fs_download.c | |||
@@ -98,38 +98,6 @@ compute_disk_offset (uint64_t fsize, | |||
98 | 98 | ||
99 | 99 | ||
100 | /** | 100 | /** |
101 | * Given a block at the given offset and depth, calculate the offset | ||
102 | * for the CHK at the given index. | ||
103 | * | ||
104 | * @param offset the offset of the first | ||
105 | * DBLOCK in the subtree of the | ||
106 | * identified IBLOCK | ||
107 | * @param depth the depth of the IBLOCK in the tree, 0 for DBLOCK | ||
108 | * @param k which CHK in the IBLOCK are we | ||
109 | * talking about | ||
110 | * @return offset if k=0, otherwise an appropriately | ||
111 | * larger value (i.e., if depth = 1, | ||
112 | * the returned value should be offset+k*DBLOCK_SIZE) | ||
113 | */ | ||
114 | static uint64_t | ||
115 | compute_dblock_offset (uint64_t offset, | ||
116 | unsigned int depth, | ||
117 | unsigned int k) | ||
118 | { | ||
119 | unsigned int i; | ||
120 | uint64_t lsize; /* what is the size of the sum of all DBlocks | ||
121 | that a CHK at depth i corresponds to? */ | ||
122 | |||
123 | if (depth == 0) | ||
124 | return offset; | ||
125 | lsize = DBLOCK_SIZE; | ||
126 | for (i=1;i<depth;i++) | ||
127 | lsize *= CHK_PER_INODE; | ||
128 | return offset + k * lsize; | ||
129 | } | ||
130 | |||
131 | |||
132 | /** | ||
133 | * Fill in all of the generic fields for a download event and call the | 101 | * Fill in all of the generic fields for a download event and call the |
134 | * callback. | 102 | * callback. |
135 | * | 103 | * |
@@ -1277,9 +1245,6 @@ process_result_with_request (void *cls, | |||
1277 | chk = (struct ContentHashKey*) pt; | 1245 | chk = (struct ContentHashKey*) pt; |
1278 | for (i=(prc->size / sizeof(struct ContentHashKey))-1;i>=0;i--) | 1246 | for (i=(prc->size / sizeof(struct ContentHashKey))-1;i>=0;i--) |
1279 | { | 1247 | { |
1280 | off = compute_dblock_offset (dr->offset, | ||
1281 | dr->depth, | ||
1282 | i); | ||
1283 | drc = dr->children[i]; | 1248 | drc = dr->children[i]; |
1284 | switch (drc->state) | 1249 | switch (drc->state) |
1285 | { | 1250 | { |