iolog: get rid of one section of CONFIG_ZLIB ifdef
authorJens Axboe <axboe@fb.com>
Thu, 3 Jul 2014 23:56:55 +0000 (17:56 -0600)
committerJens Axboe <axboe@fb.com>
Thu, 3 Jul 2014 23:56:55 +0000 (17:56 -0600)
Signed-off-by: Jens Axboe <axboe@fb.com>
iolog.c

diff --git a/iolog.c b/iolog.c
index 75ce623fe473f376df48806aa0719e4bd111167f..f9265b56dfa3cf83847d108fe0de60d89d5fb9d1 100644 (file)
--- a/iolog.c
+++ b/iolog.c
 
 static const char iolog_ver2[] = "fio version 2 iolog";
 
 
 static const char iolog_ver2[] = "fio version 2 iolog";
 
-#ifdef CONFIG_ZLIB
-
-struct iolog_compress {
-       struct flist_head list;
-       void *buf;
-       size_t len;
-       unsigned int seq;
-       int nofree;
-};
-
-#define GZ_CHUNK       131072
-
-static struct iolog_compress *get_new_chunk(unsigned int seq)
-{
-       struct iolog_compress *c;
-
-       c = malloc(sizeof(*c));
-       INIT_FLIST_HEAD(&c->list);
-       c->buf = malloc(GZ_CHUNK);
-       c->len = 0;
-       c->seq = seq;
-       c->nofree = 0;
-       return c;
-}
-
-static void free_chunk(struct iolog_compress *ic)
-{
-       if (!ic->nofree) {
-               free(ic->buf);
-               free(ic);
-       }
-}
-
-#endif
-
 void queue_io_piece(struct thread_data *td, struct io_piece *ipo)
 {
        flist_add_tail(&ipo->list, &td->io_log_list);
 void queue_io_piece(struct thread_data *td, struct io_piece *ipo)
 {
        flist_add_tail(&ipo->list, &td->io_log_list);
@@ -685,6 +650,45 @@ static void flush_samples(FILE *f, void *samples, uint64_t sample_size)
 }
 
 #ifdef CONFIG_ZLIB
 }
 
 #ifdef CONFIG_ZLIB
+
+struct iolog_flush_data {
+       struct tp_work work;
+       struct io_log *log;
+       void *samples;
+       uint64_t nr_samples;
+};
+
+struct iolog_compress {
+       struct flist_head list;
+       void *buf;
+       size_t len;
+       unsigned int seq;
+       int nofree;
+};
+
+#define GZ_CHUNK       131072
+
+static struct iolog_compress *get_new_chunk(unsigned int seq)
+{
+       struct iolog_compress *c;
+
+       c = malloc(sizeof(*c));
+       INIT_FLIST_HEAD(&c->list);
+       c->buf = malloc(GZ_CHUNK);
+       c->len = 0;
+       c->seq = seq;
+       c->nofree = 0;
+       return c;
+}
+
+static void free_chunk(struct iolog_compress *ic)
+{
+       if (!ic->nofree) {
+               free(ic->buf);
+               free(ic);
+       }
+}
+
 static int z_stream_init(z_stream *stream, int gz_hdr)
 {
        int wbits = 15;
 static int z_stream_init(z_stream *stream, int gz_hdr)
 {
        int wbits = 15;
@@ -902,13 +906,6 @@ static int finish_log(struct thread_data *td, struct io_log *log, int trylock)
 
 #ifdef CONFIG_ZLIB
 
 
 #ifdef CONFIG_ZLIB
 
-struct iolog_flush_data {
-       struct tp_work work;
-       struct io_log *log;
-       void *samples;
-       uint64_t nr_samples;
-};
-
 static int gz_work(struct tp_work *work)
 {
        struct iolog_flush_data *data;
 static int gz_work(struct tp_work *work)
 {
        struct iolog_flush_data *data;