Skip to content

Commit

Permalink
Merge pull request #539 from lxbsz/glfs
Browse files Browse the repository at this point in the history
glfs: add gfapi version check
  • Loading branch information
mikechristie authored Mar 14, 2019
2 parents f668cee + 37704b5 commit a8e1d67
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,11 @@ endif (with-rbd)
if (with-glfs)
find_library(GFAPI gfapi)

pkg_check_modules(GFAPI760 glusterfs-api>=7.6)
if (GFAPI760_FOUND)
set(GFAPI_VERSION 760)
endif (GFAPI760_FOUND)

# Stuff for building the glfs handler
add_library(handler_glfs
SHARED
Expand Down
8 changes: 8 additions & 0 deletions glfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "libtcmu.h"
#include "tcmur_device.h"
#include "tcmur_cmd_handler.h"
#include "version.h"

#define ALLOWED_BSOFLAGS (O_DIRECT | O_RDWR | O_LARGEFILE)

Expand Down Expand Up @@ -566,7 +567,14 @@ static void tcmu_glfs_close(struct tcmu_device *dev)
free(gfsp);
}

#if GFAPI_VERSION < 760
static void glfs_async_cbk(glfs_fd_t *fd, ssize_t ret, void *data)
#else
static void glfs_async_cbk(glfs_fd_t *fd, ssize_t ret,
struct glfs_stat *prestat,
struct glfs_stat *poststat,
void *data)
#endif
{
glfs_cbk_cookie *cookie = data;
struct tcmu_device *dev = cookie->dev;
Expand Down
2 changes: 2 additions & 0 deletions version.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
#define TCMUR_VERSION "@VERSION@"

#define DEFAULT_HANDLER_PATH "@tcmu-runner_HANDLER_PATH@"

#define GFAPI_VERSION @GFAPI_VERSION@

0 comments on commit a8e1d67

Please sign in to comment.