mirror of
https://github.com/kdave/btrfs-progs
synced 2025-05-01 07:27:59 +00:00
btrfs-progs: use for loop for scan_devices
for() is more suitable than while() in this code block. Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
17e1e872d4
commit
1593aa711a
@ -873,8 +873,7 @@ static int scan_devices(struct recover_control *rc)
|
|||||||
devidx++;
|
devidx++;
|
||||||
}
|
}
|
||||||
|
|
||||||
i = 0;
|
for (i = 0; i < devidx; i++) {
|
||||||
while (i < devidx) {
|
|
||||||
ret = pthread_join(t_scans[i], (void **)&t_rets[i]);
|
ret = pthread_join(t_scans[i], (void **)&t_rets[i]);
|
||||||
if (ret || t_rets[i]) {
|
if (ret || t_rets[i]) {
|
||||||
ret = 1;
|
ret = 1;
|
||||||
@ -882,7 +881,6 @@ static int scan_devices(struct recover_control *rc)
|
|||||||
cancel_to = devnr - 1;
|
cancel_to = devnr - 1;
|
||||||
goto out1;
|
goto out1;
|
||||||
}
|
}
|
||||||
i++;
|
|
||||||
}
|
}
|
||||||
out1:
|
out1:
|
||||||
while (ret && (cancel_from <= cancel_to)) {
|
while (ret && (cancel_from <= cancel_to)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user