summaryrefslogtreecommitdiffstats
path: root/sbin/fsck_ffs/setup.c
diff options
context:
space:
mode:
authormckusick <mckusick@FreeBSD.org>2013-02-24 06:44:29 +0000
committermckusick <mckusick@FreeBSD.org>2013-02-24 06:44:29 +0000
commitf51be3d42991b018fce27dc15fe8b9cfc9d4cfd3 (patch)
treea155aaefa3f14e813888f202776df11239e2e87a /sbin/fsck_ffs/setup.c
parent61f5e2d8e639c7305ace277d84812e884a545366 (diff)
downloadFreeBSD-src-f51be3d42991b018fce27dc15fe8b9cfc9d4cfd3.zip
FreeBSD-src-f51be3d42991b018fce27dc15fe8b9cfc9d4cfd3.tar.gz
When running with the -d option, instrument fsck_ffs to track the number,
data type, and running time of its I/O operations. No functional changes.
Diffstat (limited to 'sbin/fsck_ffs/setup.c')
-rw-r--r--sbin/fsck_ffs/setup.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sbin/fsck_ffs/setup.c b/sbin/fsck_ffs/setup.c
index ae0ea05..32abeed 100644
--- a/sbin/fsck_ffs/setup.c
+++ b/sbin/fsck_ffs/setup.c
@@ -249,6 +249,7 @@ setup(char *dev)
for (i = 0, j = 0; i < sblock.fs_cssize; i += sblock.fs_bsize, j++) {
size = sblock.fs_cssize - i < sblock.fs_bsize ?
sblock.fs_cssize - i : sblock.fs_bsize;
+ readcnt[sblk.b_type]++;
if (blread(fsreadfd, (char *)sblock.fs_csp + i,
fsbtodb(&sblock, sblock.fs_csaddr + j * sblock.fs_frag),
size) != 0 && !asked) {
@@ -322,6 +323,7 @@ readsb(int listerr)
if (bflag) {
super = bflag;
+ readcnt[sblk.b_type]++;
if ((blread(fsreadfd, (char *)&sblock, super, (long)SBLOCKSIZE)))
return (0);
if (sblock.fs_magic == FS_BAD_MAGIC) {
@@ -337,6 +339,7 @@ readsb(int listerr)
} else {
for (i = 0; sblock_try[i] != -1; i++) {
super = sblock_try[i] / dev_bsize;
+ readcnt[sblk.b_type]++;
if ((blread(fsreadfd, (char *)&sblock, super,
(long)SBLOCKSIZE)))
return (0);
@@ -439,8 +442,8 @@ sblock_init(void)
fswritefd = -1;
fsmodified = 0;
lfdir = 0;
- initbarea(&sblk);
- initbarea(&asblk);
+ initbarea(&sblk, BT_SUPERBLK);
+ initbarea(&asblk, BT_SUPERBLK);
sblk.b_un.b_buf = malloc(SBLOCKSIZE);
asblk.b_un.b_buf = malloc(SBLOCKSIZE);
if (sblk.b_un.b_buf == NULL || asblk.b_un.b_buf == NULL)
OpenPOWER on IntegriCloud