diff --git a/ChangeLog b/ChangeLog index f7e5635..46acbc0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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 =============================================================================== * Bug fix: GPT header CRC was computed from all 512 bytes rather than from 92. diff --git a/libisofs/fs_image.c b/libisofs/fs_image.c index 7a9d185..79b3cba 100644 --- a/libisofs/fs_image.c +++ b/libisofs/fs_image.c @@ -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 * 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->node.type = LIBISO_FILE;