From: Jens Axboe Date: Tue, 28 Oct 2014 15:00:06 +0000 (-0600) Subject: engines/rbd: add support for rbd_invalidate_cache() X-Git-Tag: fio-2.1.14~30 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=903b2812e9c772d30677b6768e6e00d6d16bc801 engines/rbd: add support for rbd_invalidate_cache() Signed-off-by: Jens Axboe --- diff --git a/configure b/configure index 58f02fa5..da637a97 100755 --- a/configure +++ b/configure @@ -1202,6 +1202,26 @@ if test "$disable_rbd" != "yes" && compile_prog "" "-lrbd -lrados" "rbd"; then fi echo "Rados Block Device engine $rbd" +########################################## +# check for rbd_invaidate_cache() +rbd_inval="no" +if test "$rbd" = "yes"; then +cat > $TMPC << EOF +#include + +int main(int argc, char **argv) +{ + rbd_image_t image; + + return rbd_invalidate_cache(image); +} +EOF +if compile_prog "" "-lrbd -lrados" "rbd"; then + rbd_inval="yes" +fi +echo "rbd_invalidate_cache $rbd_inval" +fi + ########################################## # Check whether we have setvbuf setvbuf="no" @@ -1489,6 +1509,9 @@ fi if test "$rbd" = "yes" ; then output_sym "CONFIG_RBD" fi +if test "$rbd_inval" = "yes" ; then + output_sym "CONFIG_RBD_INVAL" +fi if test "$setvbuf" = "yes" ; then output_sym "CONFIG_SETVBUF" fi diff --git a/engines/rbd.c b/engines/rbd.c index 5160c32a..e4155da2 100644 --- a/engines/rbd.c +++ b/engines/rbd.c @@ -445,7 +445,13 @@ static int fio_rbd_open(struct thread_data *td, struct fio_file *f) static int fio_rbd_invalidate(struct thread_data *td, struct fio_file *f) { +#if defined(CONFIG_RBD_INVAL) + struct rbd_data *rbd_data = td->io_ops->data; + + return rbd_invalidate_cache(rbd_data->image); +#else return 0; +#endif } static void fio_rbd_io_u_free(struct thread_data *td, struct io_u *io_u)