SOURCE += engines/glusterfs.c
SOURCE += engines/glusterfs_sync.c
SOURCE += engines/glusterfs_async.c
+ ifdef CONFIG_GF_FADVISE
+ CFLAGS += "-DGFAPI_USE_FADVISE"
+ endif
endif
ifeq ($(CONFIG_TARGET_OS), Linux)
LIBS="-lgfapi -lglusterfs $LIBS"
gfapi="yes"
fi
-echo "Gluster API engine $gfapi"
+ echo "Gluster API engine $gfapi"
+##########################################
+# check for gfapi fadvise support
+gf_fadvise="no"
+cat > $TMPC << EOF
+#include <glusterfs/api/glfs.h>
+
+int main(int argc, char **argv)
+{
+ struct glfs_fd *fd;
+ int ret = glfs_fadvise(fd, 0, 0, 1);
+
+ return 0;
+}
+EOF
+
+if compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
+ gf_fadvise="yes"
+fi
+echo "Gluster API use fadvise $gf_fadvise"
#############################################################################
if test "$gfapi" = "yes" ; then
output_sym "CONFIG_GFAPI"
fi
+if test "$gf_fadvise" = "yes" ; then
+ output_sym "CONFIG_GF_FADVISE"
+fi
echo "LIBS+=$LIBS" >> $config_host_mak
echo "CFLAGS+=$CFLAGS" >> $config_host_mak
}
}
}
+#if defined(GFAPI_USE_FADVISE)
+ {
+ int r = 0;
+ if (td_random(td)){
+ r = glfs_fadvise(g->fd, 0, f->real_file_size, POSIX_FADV_RANDOM);
+ }else{
+ r = glfs_fadvise(g->fd, 0, f->real_file_size, POSIX_FADV_SEQUENTIAL);
+ }
+ if (r){
+ dprint(FD_FILE, "fio %p fadvise %s status %d\n", g->fs, f->file_name, r);
+ }
+ }
+#endif
dprint(FD_FILE, "fio %p created %s\n", g->fs, f->file_name);
f->fd = -1;
f->shadow_fd = -1;
struct io_u *io_u;
int io_complete;
};
+static ulong cb_count = 0, issued = 0;
static struct io_u *fio_gf_event(struct thread_data *td, int event)
{
}
if (events < min)
- usleep(10);
+ usleep(100);
else
break;
io_u->engine_data = NULL;
free(io);
}
+ fprintf(stderr, "issued %lu finished %lu\n", issued, cb_count);
}
static int fio_gf_io_u_init(struct thread_data *td, struct io_u *io_u)
dprint(FD_IO, "%s ret %lu\n", __FUNCTION__, ret);
iou->io_complete = 1;
+ cb_count ++;
}
static int fio_gf_async_queue(struct thread_data fio_unused *td, struct io_u *io_u)
io_u->error = r;
goto failed;
}
-
+ issued ++;
return FIO_Q_QUEUED;
failed:
if (r){
return r;
}
+ td->o.use_thread = 1;
g = td->io_ops->data;
g->aio_events = malloc(td->o.iodepth * sizeof(struct io_u *));
if (!g->aio_events){