Skip to content

Commit

Permalink
CIFS support via samba, sync only.
Browse files Browse the repository at this point in the history
  • Loading branch information
mtanski committed Jan 19, 2015
1 parent 5fb4b36 commit 7fd3535
Show file tree
Hide file tree
Showing 8 changed files with 538 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Makefile
Expand Up @@ -107,6 +107,10 @@ ifdef CONFIG_GFAPI
CFLAGS += "-DGFAPI_USE_FADVISE"
endif
endif
ifdef CONFIG_CIFS
SOURCE += engines/cifs.c
SOURCE += engines/cifs_sync.c
endif

ifeq ($(CONFIG_TARGET_OS), Linux)
SOURCE += diskutil.c fifo.c blktrace.c cgroup.c trim.c engines/sg.c \
Expand Down
34 changes: 34 additions & 0 deletions configure
Expand Up @@ -163,6 +163,8 @@ for opt do
;;
--enable-libhdfs) libhdfs="yes"
;;
--disable-cifs) disable_cifs="yes"
;;
--help)
show_help="yes"
;;
Expand Down Expand Up @@ -1270,6 +1272,35 @@ if test "$libhdfs" = "yes" ; then
fi
echo "HDFS engine $libhdfs"

##########################################
# Check if we have the right samba libraries for CIFS
# Need path to headers with SMBCLI_CFLAGS
cifs="no"
cat > $TMPC << EOF
#include <stdbool.h>
#include <stdint.h>
#include <samba_util.h>
#include <smb_cli.h>
int main(int argc, char **argv)
{
struct smbcli_state *s = smbcli_state_init(NULL);
return 0;
}
EOF
SMBCLI_LIBS=$(pkg-config --libs netapi smbclient smbclient-raw dcerpc samba-hostconfig samba-credentials gensec)
SMBCLI_CFLAGS=$(pkg-config --cflags netapi smbclient smbclient-raw dcerpc samba-hostconfig samba-credentials gensec)
if test "$disable_cifs" != "yes" && compile_prog "$SMBCLI_CFLAGS" "$SMBCLI_LIBS" "cifs"; then
LIBS="$LIBS $SMBCLI_LIBS"
# TODO: Figure out how to make this work
LIBS="$LIBS -Wl,-rpath /usr/lib/x86_64-linux-gnu/samba /usr/lib/x86_64-linux-gnu/samba/liberrors.so.0 /usr/lib/x86_64-linux-gnu/samba/libcli-ldap.so.0"
CFLAGS="$CFLAGS $SMBCLI_CFLAGS"
cifs="yes"
fi
echo "Samba CIFS client $cifs"


#############################################################################

if test "$wordsize" = "64" ; then
Expand Down Expand Up @@ -1414,6 +1445,9 @@ fi
if test "$libhdfs" = "yes" ; then
output_sym "CONFIG_LIBHDFS"
fi
if test "$cifs" = "yes"; then
output_sym "CONFIG_CIFS"
fi

if test "$zlib" = "no" ; then
echo "Consider installing zlib-dev (zlib-devel), some fio features depend on it."
Expand Down

0 comments on commit 7fd3535

Please sign in to comment.