diff options
author | ian <ian@FreeBSD.org> | 2015-02-11 22:55:24 +0000 |
---|---|---|
committer | ian <ian@FreeBSD.org> | 2015-02-11 22:55:24 +0000 |
commit | f8178723e9bb3e51a017187b2a3694e110ad5202 (patch) | |
tree | f1c6cb0a9a16de5c5aae59f0978cc9c2a2d77234 /lib/libstand/ext2fs.c | |
parent | ba124c2ef35f4bf14972d64b724ac66e69bbed26 (diff) | |
download | FreeBSD-src-f8178723e9bb3e51a017187b2a3694e110ad5202.zip FreeBSD-src-f8178723e9bb3e51a017187b2a3694e110ad5202.tar.gz |
MFC r276079, r276087:
Add a divisor parameter to twiddle() so that callers can request that
output only happen on every Nth call.
Add a new loader(8) variable, twiddle_divisor, allowing control over the
output frequency of the "twiddle" IO progress indicator.
Diffstat (limited to 'lib/libstand/ext2fs.c')
-rw-r--r-- | lib/libstand/ext2fs.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/libstand/ext2fs.c b/lib/libstand/ext2fs.c index e0afb3e..d0b91e0 100644 --- a/lib/libstand/ext2fs.c +++ b/lib/libstand/ext2fs.c @@ -353,7 +353,7 @@ ext2fs_open(const char *upath, struct open_file *f) /* allocate space and read super block */ fs = (struct ext2fs *)malloc(sizeof(*fs)); fp->f_fs = fs; - twiddle(); + twiddle(1); error = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, EXT2_SBLOCK, EXT2_SBSIZE, (char *)fs, &buf_size); if (error) @@ -395,7 +395,7 @@ ext2fs_open(const char *upath, struct open_file *f) len = blkgrps * fs->fs_bsize; fp->f_bg = malloc(len); - twiddle(); + twiddle(1); error = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, EXT2_SBLOCK + EXT2_SBSIZE / DEV_BSIZE, len, (char *)fp->f_bg, &buf_size); @@ -507,7 +507,7 @@ ext2fs_open(const char *upath, struct open_file *f) if (error) goto out; - twiddle(); + twiddle(1); error = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, fsb_to_db(fs, disk_block), fs->fs_bsize, buf, &buf_size); @@ -568,7 +568,7 @@ read_inode(ino_t inumber, struct open_file *f) * Read inode and save it. */ buf = malloc(fs->fs_bsize); - twiddle(); + twiddle(1); error = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, ino_to_db(fs, fp->f_bg, inumber), fs->fs_bsize, buf, &rsize); if (error) @@ -665,7 +665,7 @@ block_map(struct open_file *f, daddr_t file_block, daddr_t *disk_block_p) if (fp->f_blk[level] == (char *)0) fp->f_blk[level] = malloc(fs->fs_bsize); - twiddle(); + twiddle(1); error = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, fsb_to_db(fp->f_fs, ind_block_num), fs->fs_bsize, fp->f_blk[level], &fp->f_blksize[level]); @@ -723,7 +723,7 @@ buf_read_file(struct open_file *f, char **buf_p, size_t *size_p) bzero(fp->f_buf, block_size); fp->f_buf_size = block_size; } else { - twiddle(); + twiddle(4); error = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, fsb_to_db(fs, disk_block), block_size, fp->f_buf, &fp->f_buf_size); |