Subject: RFC: progressbars for fsck_ffs
To: None <tech-userlevel@netbsd.org>
From: Chris Gilbert <chris@netbsd.org>
List: tech-userlevel
Date: 11/17/2002 23:07:58
This is a multi-part message in MIME format.
--Multipart_Sun__17_Nov_2002_23:07:58_+0000_08171600
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Hi,
Having had to fsck a few large disks recently I thought it'd be handy to
see progress. So in a few spare minutes I decided to take the progress
bar code from ftp and add it into fsck_ffs. Attached is the patch for
this.
Note I'm considering checking this in as the default. Yes it makes us
look linuxy, but I like the idea I know something was happening rather
than nothing being displayed for extended periods.
Note you may get some fun effects if you are fscking multiple disks at
the same time, I'd be grateful for feedback on how good/bad that looks.
Chris
--Multipart_Sun__17_Nov_2002_23:07:58_+0000_08171600
Content-Type: application/octet-stream;
name="fsck_ffs.progressbars.patch"
Content-Disposition: attachment;
filename="fsck_ffs.progressbars.patch"
Content-Transfer-Encoding: base64
SW5kZXg6IGZzY2suaAo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09ClJDUyBmaWxlOiAvY3Zzcm9vdC9iYXNlc3JjL3NiaW4v
ZnNja19mZnMvZnNjay5oLHYKcmV0cmlldmluZyByZXZpc2lvbiAxLjI5CmRpZmYgLXUgLXAgLXIx
LjI5IGZzY2suaAotLS0gZnNjay5oCTIwMDIvMDkvMjggMjA6MTE6MDYJMS4yOQorKysgZnNjay5o
CTIwMDIvMTEvMTcgMjI6NTE6NDIKQEAgLTI3Niw0ICsyNzYsNyBAQCBzdGF0aWMgX19pbmxpbmUg
dV9pbnQ2NF90IGlzd2FwNjQoeCkKIAllbHNlIHJldHVybiB4OwogfQogCi0KKy8qIHByb2dyZXNz
YmFyIHVwZGF0ZXMgKi8KK2ludCBwcm9ncmVzczsKK3ZvaWQgc2V0dHR5d2lkdGgoaW50IGEpOwor
dm9pZCBwcm9ncmVzc2Jhcihjb25zdCBjaGFyICpkZX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yBjdXJyZW50LCBsb25nIHRv
dGFsLAorCWludCBsYXN0KQoreworCXN0YXRpYyBpbnQgbGFzdHBlcmNlbnRhZ2UgPSAtMTsKKyAg
ICBjaGFyIGJ1ZlsyNTZdOworICAgIGludCBsZW4sIHBlcmNlbnRhZ2U7CisgICAgaW50IGJhcmxl
bmd0aDsKKyAgICBpbnQgaTsKKyAgICBpbnQgbGVuZ3RoZXh0cmFzOworI2RlZmluZQlCQVJPVkVS
SEVBRAkxNgkJLyogbm9uIGAqJyBwb3J0aW9uIG9mIHByb2dyZXNzIGJhciAqLworCQkJCQkvKgor
CQkJCQkgKiBzdGFycyBzaG91bGQgY29udGFpbiBhdCBsZWFzdAorCQkJCQkgKiBzaXplb2YoYnVm
KSAtIEJBUk9WRVJIRUFEIGVudHJpZXMKKwkJCQkJICovCisgICAgc3RhdGljIGNvbnN0IGNoYXIJ
c3RhcnNbXSA9CisiKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioiCisiKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioi
CisiKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioiOworCisgICAgaWYgKCFwcm9ncmVzcykKKwlyZXR1cm47
CisgICAgCisgICAgbGVuID0gMDsKKyAgICBsZW5ndGhleHRyYXMgPSBzdHJsZW4oZGV2KSArIHN0
cmxlbihwaGFzZSk7CisgICAgcGVyY2VudGFnZSA9IChjdXJyZW50ICogMTAwKSAvIHRvdGFsOwor
ICAgIHBlcmNlbnRhZ2UgPSBNQVgocGVyY2VudGFnZSwgMCk7CisgICAgcGVyY2VudGFnZSA9IE1J
TihwZXJjZW50YWdlLCAxMDApOworCisgICAgaWYgKChwZXJjZW50YWdlID09IGxhc3RwZXJjZ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