The sort weight of data files loaded from ISO image is now 2 exp 28 to 1

rather than 2 exp 31 - 1 to - 2 exp 31
This commit is contained in:
Thomas Schmitt 2013-05-24 12:35:43 +02:00
parent b80b339de3
commit e886722d65
2 changed files with 18 additions and 1 deletions

View File

@ -1,3 +1,9 @@
bzr branch lp:libisofs/for-libisoburn (to become libisofs-1.3.2.tar.gz)
===============================================================================
* The sort weight of data files loaded from ISO image is now 2 exp 28 to 1
rather than 2 exp 31 - 1 to - 2 exp 31
libisofs-1.3.0.tar.gz Fri May 17 2013 libisofs-1.3.0.tar.gz Fri May 17 2013
=============================================================================== ===============================================================================
* Bug fix: GPT header CRC was computed from all 512 bytes rather than from 92. * Bug fix: GPT header CRC was computed from all 512 bytes rather than from 92.

View File

@ -3104,8 +3104,19 @@ int image_builder_create_node(IsoNodeBuilder *builder, IsoImage *image,
/* /*
* and we set the sort weight based on the block on image, to * and we set the sort weight based on the block on image, to
* improve performance on image modifying. * improve performance on image modifying.
*
* This was too obtrusive because it occupied the highest
* possible weight ranks:
* file->sort_weight = INT_MAX - data->sections[0].block;
*
* So a try to be more nice and rely on caching with tiles
* of at least 16 blocks. This occupies a range within
* the interval of 1 to 2 exp 28 = 268,435,456.
* (Dividing each number separately saves from integer
* rollover problems.)
*/ */
file->sort_weight = INT_MAX - data->sections[0].block; file->sort_weight =
fsdata->nblocks / 16 - data->sections[0].block / 16 + 1;
file->stream = stream; file->stream = stream;
file->node.type = LIBISO_FILE; file->node.type = LIBISO_FILE;