From: Jens Axboe Date: Thu, 24 Jun 2010 07:22:41 +0000 (+0200) Subject: Make fill_device detect bdev sizes too X-Git-Tag: fio-1.41.4~5 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=68b0316f581c3c881d7dbf7c9dafef4a10100a66;ds=sidebyside Make fill_device detect bdev sizes too Signed-off-by: Jens Axboe --- diff --git a/filesetup.c b/filesetup.c index 9cc48726..8aa9fc74 100644 --- a/filesetup.c +++ b/filesetup.c @@ -517,7 +517,7 @@ struct fio_mount { static unsigned long long get_fs_free_counts(struct thread_data *td) { struct flist_head *n, *tmp; - unsigned long long ret; + unsigned long long ret = 0; struct fio_mount *fm; FLIST_HEAD(list); struct fio_file *f; @@ -527,6 +527,12 @@ static unsigned long long get_fs_free_counts(struct thread_data *td) struct stat sb; char buf[256]; + if (f->filetype == FIO_TYPE_BD) { + ret += f->real_file_size; + continue; + } else if (f->filetype != FIO_TYPE_FILE) + continue; + strcpy(buf, f->file_name); if (stat(buf, &sb) < 0) { @@ -556,7 +562,6 @@ static unsigned long long get_fs_free_counts(struct thread_data *td) flist_add(&fm->list, &list); } - ret = 0; flist_for_each_safe(n, tmp, &list) { unsigned long long sz;