Changeset 10924
- Timestamp:
- Jul 1, 2010, 5:09:13 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/cache.c
r10923 r10924 96 96 97 97 /* return the starting index of the longest contiguous run of blocks BUT: 98 * 1 - Length of run must be even. 99 * 2 - Run must begin with a even block. 100 * 3 - Oldest run is preferred. 98 * - Run should begin with a even block and length of run should be even. 99 * - Oldest run is preferred. 101 100 */ 102 101 static int … … 108 107 unsigned bestlen = 1; 109 108 unsigned jump; 110 time_t oldest_time = ~0;109 time_t oldest_time = tr_time() + 1; 111 110 struct run_info run; 112 111 … … 122 121 /* check alignment */ 123 122 if( len % 2 == 0 ) { 124 if( !run.is_aligned ) 123 if( !run.is_aligned ) { 125 124 /* Let it grow. Otherwise we contribute to fragmentation */ 125 if( bestlen == 1) { 126 /* But if all other blocks are non-contiguous, we prefer this one */ 127 bestpos = pos; 128 oldest_time = cache->maxBlocks - len; 129 } 126 130 continue; 131 } 127 132 } else { 128 133 if( len != 1 ) {
Note: See TracChangeset
for help on using the changeset viewer.