]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
repair: remove unused strided secondary sb scan logic
authorBrian Foster <bfoster@redhat.com>
Thu, 5 Feb 2015 23:28:52 +0000 (10:28 +1100)
committerDave Chinner <david@fromorbit.com>
Thu, 5 Feb 2015 23:28:52 +0000 (10:28 +1100)
commit8216a58f8e709b0eade780c989b05f426b729ea0
tree55ba0399c834e551fe49e3db3d2eb098922ad968
parent6d23d9a5dad9003d3b4e8e970c393f90a137d10d
repair: remove unused strided secondary sb scan logic

verify_set_primary_sb() scans and verifies secondary superblocks based
on the primary sb. It currently defines a maximum number of 8
superblocks to scan per iteration. It also implements a strided
algorithm that appears intended to ultimately scan every secondary,
albeit in a strided order.

Given that the algorithm is written to hit every sb and the stride value
is initialized as follows:

num_sbs = MIN(NUM_SBS, rsb->sb_agcount);
skip = howmany(num_sbs, rsb->sb_agcount);

... which is guaranteed to be 1 since the howmany() parameters are
backwards, the strided algorithm doesn't appear to accomplish anything
that can't be done with a simple for loop. In other words, despite the
max value and strided algorithm, repair always scans all of the
secondary superblocks in incremental order.

Therefore, remove the strided algorithm bits and replace with a simple
for loop. As a result of this cleanup, also remove the 'checked' buffer
used to track repeated ag visits and the now unused NUM_SBS definition.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
repair/globals.h
repair/sb.c