Skip to content

Commit

Permalink
Merge pull request open-iscsi#541 from lxbsz/glfs
Browse files Browse the repository at this point in the history
glfs: fix build error for GFAPI version check
  • Loading branch information
mikechristie authored Mar 27, 2019
2 parents a8e1d67 + 9bb76bd commit 36316b6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,11 @@ endif (with-rbd)
if (with-glfs)
find_library(GFAPI gfapi)

pkg_check_modules(GFAPI760 glusterfs-api>=7.6)
set(GFAPI_VERSION760 0)

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

# Stuff for building the glfs handler
Expand Down
6 changes: 3 additions & 3 deletions glfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -567,13 +567,13 @@ 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
#if GFAPI_VERSION760
static void glfs_async_cbk(glfs_fd_t *fd, ssize_t ret,
struct glfs_stat *prestat,
struct glfs_stat *poststat,
void *data)
#else
static void glfs_async_cbk(glfs_fd_t *fd, ssize_t ret, void *data)
#endif
{
glfs_cbk_cookie *cookie = data;
Expand Down
2 changes: 1 addition & 1 deletion version.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

#define DEFAULT_HANDLER_PATH "@tcmu-runner_HANDLER_PATH@"

#define GFAPI_VERSION @GFAPI_VERSION@
#define GFAPI_VERSION760 @GFAPI_VERSION760@

0 comments on commit 36316b6

Please sign in to comment.