Fix up some style
authorJens Axboe <axboe@kernel.dk>
Wed, 7 Jun 2017 14:52:47 +0000 (08:52 -0600)
committerJens Axboe <axboe@kernel.dk>
Wed, 7 Jun 2017 14:52:47 +0000 (08:52 -0600)
The offset-as-percent was a little different than what we usually
do, clean it up.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
filesetup.c
options.c

index 683a5c55c12f4347fea4d10f90de49e6c4cd1dc1..13079e493c50d34ea127e645ae5f250815fcc612 100644 (file)
@@ -833,18 +833,22 @@ static unsigned long long get_fs_free_counts(struct thread_data *td)
 uint64_t get_start_offset(struct thread_data *td, struct fio_file *f)
 {
        struct thread_options *o = &td->o;
-       unsigned long long align_bs;  /* align the offset to this block size */
-       unsigned long long offset;  /* align_bs-aligned offset */
+       unsigned long long align_bs;
+       unsigned long long offset;
 
        if (o->file_append && f->filetype == FIO_TYPE_FILE)
                return f->real_file_size;
 
        if (o->start_offset_percent > 0) {
-               /* if blockalign is provided, find the min across read, write, and trim */
+               /*
+                * if blockalign is provided, find the min across read, write,
+                * and trim
+                */
                if (fio_option_is_set(o, ba)) {
                        align_bs = (unsigned long long) min(o->ba[DDIR_READ], o->ba[DDIR_WRITE]);
                        align_bs = min((unsigned long long) o->ba[DDIR_TRIM], align_bs);
-               } else {  /* else take the minimum block size */
+               } else {
+                       /* else take the minimum block size */
                        align_bs = td_min_bs(td);
                }
 
@@ -852,14 +856,18 @@ uint64_t get_start_offset(struct thread_data *td, struct fio_file *f)
                offset = (f->real_file_size * o->start_offset_percent / 100) +
                        (td->subjob_number * o->offset_increment);
 
-               /* block align the offset at the next available boundary at
-                  ceiling(offset / align_bs) * align_bs */
+               /*
+                * block align the offset at the next available boundary at
+                * ceiling(offset / align_bs) * align_bs
+                */
                offset = (offset / align_bs + (offset % align_bs != 0)) * align_bs;
 
-       } else {  /* start_offset_percent not set */
+       } else {
+               /* start_offset_percent not set */
                offset = o->start_offset +
                                td->subjob_number * o->offset_increment;
        }
+
        return offset;
 }
 
index dcee7e55a90efe4fbe38dc250296d4849537def5..2daa983e0d9b2ef1002bd10ed6156fe8e5ba486f 100644 (file)
--- a/options.c
+++ b/options.c
@@ -1389,7 +1389,8 @@ static int str_offset_cb(void *data, unsigned long long *__val)
        if (parse_is_percent(v)) {
                td->o.start_offset = 0;
                td->o.start_offset_percent = -1ULL - v;
-               dprint(FD_PARSE, "SET start_offset_percent %d\n", td->o.start_offset_percent);
+               dprint(FD_PARSE, "SET start_offset_percent %d\n",
+                                       td->o.start_offset_percent);
        } else
                td->o.start_offset = v;