From e886722d6549dae1e8cd0a5f221895154d34bda4 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Fri, 24 May 2013 12:35:43 +0200 Subject: [PATCH] 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 --- ChangeLog | 6 ++++++ libisofs/fs_image.c | 13 ++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) 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;