From: Jens Axboe Date: Tue, 8 Dec 2015 22:17:27 +0000 (-0700) Subject: iolog: cleanup log writing X-Git-Tag: fio-2.2.13~16 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=1c725e7021966a25ad1943ef396cf2c9990a7c55;p=fio.git iolog: cleanup log writing Signed-off-by: Jens Axboe --- diff --git a/iolog.c b/iolog.c index 961c9171..b8330bd9 100644 --- a/iolog.c +++ b/iolog.c @@ -1205,54 +1205,37 @@ void iolog_compress_exit(struct thread_data *td) #endif -static int write_iops_log(struct thread_data *td, int try) +static int __write_log(struct thread_data *td, struct io_log *log, int try) { - struct io_log *log = td->iops_log; + if (log) + return finish_log(td, log, try); - if (!log) - return 0; + return 0; +} - return finish_log(td, log, try); +static int write_iops_log(struct thread_data *td, int try) +{ + return __write_log(td, td->iops_log, try); } static int write_slat_log(struct thread_data *td, int try) { - struct io_log *log = td->slat_log; - - if (!log) - return 0; - - return finish_log(td, log, try); + return __write_log(td, td->slat_log, try); } static int write_clat_log(struct thread_data *td, int try) { - struct io_log *log = td->clat_log; - - if (!log) - return 0; - - return finish_log(td, log, try); + return __write_log(td, td->clat_log, try); } static int write_lat_log(struct thread_data *td, int try) { - struct io_log *log = td->lat_log; - - if (!log) - return 0; - - return finish_log(td, log, try); + return __write_log(td, td->lat_log, try); } static int write_bandw_log(struct thread_data *td, int try) { - struct io_log *log = td->bw_log; - - if (!log) - return 0; - - return finish_log(td, log, try); + return __write_log(td, td->bw_log, try); } enum {