Hi,
actually, I do not understand this patch.
our objectid map is a list of id pairs which shows used id intervals:
[first used,first unused], [..], ..
function check_objectid_map checks whether map is correct or not, what means
that every id > than id-1.
Your change means "check only first _count_ ids". But we can have N'th id changed,
but check now only first _count_ ids. So you just canceled checking and enjoying
a speedup. Although we indeed can check only [position-1, position+1] interval
if position'th id has been changed.
But actually this check is for debugging purpose only and if it slows fsck down so
much it should be commented out.
> --- diff/reiserfsprogs-3.x.1a/fsck/uobjectid.c Mon Jan 7 08:24:36 2002
> +++ reiserfsprogs-3.x.1a/fsck/uobjectid.c Wed Jan 23 09:59:50 2002
> @@ -176,13 +176,17 @@
> }
>
>
> -static void check_objectid_map (struct id_map * map)
> +static void check_objectid_map (struct id_map * map, int count)
> {
> int i;
>
> - for (i = 1; i < map->m_used_slots_count; i ++)
> + for (i = 1; i < map->m_used_slots_count; i ++) {
> if (le32_to_cpu(map->m_begin [i - 1]) >= le32_to_cpu(map->m_begin [i]))
> die ("check_objectid_map: map corrupted");
> + if (count && i > count) {
> + return ;
> + }
> + }
> }
>
>
> @@ -209,7 +213,8 @@
> /* we can mark id as used w/o expanding of id map */
> map->m_begin[pos] = cpu_to_le32 (id);
>
> - check_objectid_map (map);
> + /* only check the part of the map we've changed */
> + check_objectid_map (map, 1);
> return 0;
> }
>
> @@ -224,7 +229,7 @@
> map->m_begin[pos] = cpu_to_le32 (id);
> map->m_begin[pos+1] = cpu_to_le32 (id + 1);
>
> - check_objectid_map (map);
> + check_objectid_map (map, 2);
>
> return 0;
> }
> @@ -241,7 +246,7 @@
> try_to_shrink_id_map (map);
> }
>
> - check_objectid_map (map);
> + check_objectid_map (map, 2);
>
> return 0;
> }
> @@ -363,7 +368,7 @@
> sb_size = reiserfs_super_block_size (fs->fs_ondisk_sb);
> sb_objectid_map = (__u32 *)((char *)(fs->fs_ondisk_sb) + sb_size);
>
> - check_objectid_map (map);
> + check_objectid_map (map, 0);
>
> max = ((fs->fs_blocksize - sb_size) >> 3 << 1);
> set_sb_oid_maxsize (fs->fs_ondisk_sb, max);
> @@ -379,7 +384,7 @@
> if (size == max)
> sb_objectid_map [max - 1] = map->m_begin [map->m_used_slots_count - 1];
>
> - check_objectid_map (map);
> + check_objectid_map (map, 0);
>
> }
--
Thanks,
Vitaly Fertman