From 057754389863aa18cbf36b1f2a556a422ea2f4b5 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Wed, 21 Mar 2012 14:07:11 +0100 Subject: [PATCH] Move rbtree into lib/ And make ARRAY_SIZE() generally available, also outside gfio. Signed-off-by: Jens Axboe --- Makefile | 2 +- fio.h | 4 +++- gclient.c | 2 +- gfio.c | 2 +- gfio.h | 2 -- iolog.h | 2 +- rbtree.c => lib/rbtree.c | 0 rbtree.h => lib/rbtree.h | 0 8 files changed, 7 insertions(+), 7 deletions(-) rename rbtree.c => lib/rbtree.c (100%) rename rbtree.h => lib/rbtree.h (100%) diff --git a/Makefile b/Makefile index 1d3cc856..063823d1 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ GTK_LDFLAGS = `pkg-config --libs gtk+-2.0 gthread-2.0` SOURCE := gettime.c ioengines.c init.c stat.c log.c time.c filesetup.c \ eta.c verify.c memory.c io_u.c parse.c mutex.c options.c \ - rbtree.c smalloc.c filehash.c profile.c debug.c lib/rand.c \ + lib/rbtree.c smalloc.c filehash.c profile.c debug.c lib/rand.c \ lib/num2str.c lib/ieee754.c $(wildcard crc/*.c) engines/cpu.c \ engines/mmap.c engines/sync.c engines/null.c engines/net.c \ memalign.c server.c client.c iolog.c backend.c libfio.c flow.c \ diff --git a/fio.h b/fio.h index 28198b9c..393f381d 100644 --- a/fio.h +++ b/fio.h @@ -20,7 +20,7 @@ struct thread_data; #include "thread_options.h" #include "flist.h" #include "fifo.h" -#include "rbtree.h" +#include "lib/rbtree.h" #include "arch/arch.h" #include "os/os.h" #include "mutex.h" @@ -551,4 +551,6 @@ static inline void td_io_u_free_notify(struct thread_data *td) extern const char *fio_get_arch_string(int); extern const char *fio_get_os_string(int); +#define ARRAY_SIZE(x) (sizeof((x)) / (sizeof((x)[0]))) + #endif diff --git a/gclient.c b/gclient.c index dfdd8704..deb20f06 100644 --- a/gclient.c +++ b/gclient.c @@ -736,7 +736,7 @@ static void gfio_show_io_depths(GtkWidget *vbox, struct thread_stat *ts) GType types[FIO_IO_U_MAP_NR + 1]; int i; const char *labels[] = { "Depth", "0", "1", "2", "4", "8", "16", "32", "64", ">= 64" }; - const int nr_labels = ARRAYSIZE(labels); + const int nr_labels = ARRAY_SIZE(labels); frame = gtk_frame_new("IO depths"); gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 5); diff --git a/gfio.c b/gfio.c index e4d1f218..274dea8f 100644 --- a/gfio.c +++ b/gfio.c @@ -1389,7 +1389,7 @@ static GtkWidget *new_client_page(struct gui_entry *ge) gtk_container_add(GTK_CONTAINER(bottom_align), ge->buttonbox); gtk_box_pack_start(GTK_BOX(main_vbox), bottom_align, FALSE, FALSE, 0); - add_buttons(ge, buttonspeclist, ARRAYSIZE(buttonspeclist)); + add_buttons(ge, buttonspeclist, ARRAY_SIZE(buttonspeclist)); /* * Set up thread status progress bar diff --git a/gfio.h b/gfio.h index dd4ee3d8..71b2db74 100644 --- a/gfio.h +++ b/gfio.h @@ -144,8 +144,6 @@ struct gfio_client { unsigned int nr_du; }; -#define ARRAYSIZE(x) (sizeof((x)) / (sizeof((x)[0]))) - #define GFIO_MIME "text/fio" extern void gfio_view_log(struct gui *ui); diff --git a/iolog.h b/iolog.h index 18d3c6c5..0d6b5062 100644 --- a/iolog.h +++ b/iolog.h @@ -1,7 +1,7 @@ #ifndef FIO_IOLOG_H #define FIO_IOLOG_H -#include "rbtree.h" +#include "lib/rbtree.h" #include "lib/ieee754.h" #include "ioengine.h" diff --git a/rbtree.c b/lib/rbtree.c similarity index 100% rename from rbtree.c rename to lib/rbtree.c diff --git a/rbtree.h b/lib/rbtree.h similarity index 100% rename from rbtree.h rename to lib/rbtree.h -- 2.25.1