diff --git a/configure.ac b/configure.ac index aef73ab..80690eb 100644 --- a/configure.ac +++ b/configure.ac @@ -15,7 +15,7 @@ AC_PROG_CC dnl checks for libraries AC_CHECK_LIB([z], [gzgets],,[AC_MSG_ERROR(No zlib library!)]) -PKG_CHECK_MODULES([FUSE], [fuse], [], [AC_MSG_ERROR(No fuse library!)]) +PKG_CHECK_MODULES([FUSE3], [fuse3], [], [AC_MSG_ERROR(No fuse3 library!)]) dnl checks for header files @@ -46,12 +46,12 @@ AC_TYPE_SIZE_T dnl checking type of system to provide proper compile and linking flags case ${host} in - *-*-linux-*) AC_SUBST(CFLAGS, ["-Wall -O3 `pkg-config --cflags fuse`"]) - AC_SUBST(LDFLAGS, ["`pkg-config --cflags --libs fuse` -lz"]);; - *-*-bsd-*) AC_SUBST(CFLAGS, ["-Wall -O3 `pkg-config --cflags fuse`"]) - AC_SUBST(LDFLAGS, ["`pkg-config --cflags --libs fuse` -lz"]);; - *-*-darwin*) AC_SUBST(CFLAGS, ["-Wall -O3 `pkg-config --cflags fuse`"]) - AC_SUBST(LDFLAGS, ["`pkg-config --cflags --libs fuse` -lz"]);; + *-*-linux-*) AC_SUBST(CFLAGS, ["-Wall -O3 `pkg-config --cflags fuse3`"]) + AC_SUBST(LIBS, ["`pkg-config --cflags --libs fuse3` -lz"]);; + *-*-bsd-*) AC_SUBST(CFLAGS, ["-Wall -O3 `pkg-config --cflags fuse3`"]) + AC_SUBST(LIBS, ["`pkg-config --cflags --libs fuse3` -lz"]);; + *-*-darwin*) AC_SUBST(CFLAGS, ["-Wall -O3 `pkg-config --cflags fuse3`"]) + AC_SUBST(LIBS, ["`pkg-config --cflags --libs fuse3` -lz"]);; *) AC_MSG_WARN(No automatic flags for this host system; set compile/linking flags manually);; esac diff --git a/externs.h b/externs.h index 1084970..7021bc4 100644 --- a/externs.h +++ b/externs.h @@ -1,11 +1,11 @@ #ifndef _EXTERNS_H_ #define _EXTERNS_H_ -#define FUSE_USE_VERSION 26 +#define FUSE_USE_VERSION 31 -#include +#include -extern char *mount; +extern char *mount_dir; // directory where data directory should be created extern char *tmp_dir; // directory where file system's data will be kept diff --git a/initialize.c b/initialize.c index 6067669..1cff77e 100644 --- a/initialize.c +++ b/initialize.c @@ -5,7 +5,7 @@ void check_mount(){ - if (gpthpro(&mount) != 0) + if (gpthpro(&mount_dir) != 0) fail(ERR_NO_MOUNT); }; diff --git a/initialize.h b/initialize.h index 748459d..7923c17 100644 --- a/initialize.h +++ b/initialize.h @@ -18,6 +18,6 @@ #include "retriever/retriever.h" -void initialize(); +void initialize(struct file_system_info *fsinfo); #endif diff --git a/operations.c b/operations.c index 6068fbd..9123c9a 100644 --- a/operations.c +++ b/operations.c @@ -10,7 +10,7 @@ // public: -int revs_getattr(const char *path, struct stat *stbuf){ +int revs_getattr(const char *path, struct stat *stbuf, struct fuse_file_info *fileinfo){ struct stats *stats; memset(stbuf, 0, sizeof(struct stat)); @@ -39,7 +39,7 @@ int revs_getattr(const char *path, struct stat *stbuf){ }; -int revs_readdir(const char *path, void *buf, fuse_fill_dir_t filler, off_t offset, struct fuse_file_info *fi){ +int revs_readdir(const char *path, void *buf, fuse_fill_dir_t filler, off_t offset, struct fuse_file_info *fi, enum fuse_readdir_flags flags){ (void) offset; (void) fi; @@ -53,8 +53,8 @@ int revs_readdir(const char *path, void *buf, fuse_fill_dir_t filler, off_t offs gstrdel(stats->path); free(stats); - filler(buf, ".", NULL, 0); - filler(buf, "..", NULL, 0); + filler(buf, ".", NULL, 0, flags); + filler(buf, "..", NULL, 0, flags); debug(1, "Reading content of the eturned directory\n"); char **content = get_children(file_system_info, path); @@ -63,7 +63,7 @@ int revs_readdir(const char *path, void *buf, fuse_fill_dir_t filler, off_t offs return 0; } for (i = 0; content[i] != 0; i++) - filler(buf, content[i], NULL, 0); + filler(buf, content[i], NULL, 0, flags); debug(1, "There were %d children in this directory;\n", i); for (i = 0; content[i] != 0; i++) free(content[i]); diff --git a/operations.h b/operations.h index ce893f9..b1f35b4 100644 --- a/operations.h +++ b/operations.h @@ -1,13 +1,13 @@ #ifndef _OPERATIONS_H_ #define _OPERATIONS_H_ -#define FUSE_USE_VERSION 26 +#define FUSE_USE_VERSION 31 -#include +#include -int revs_getattr(const char *path, struct stat *stbuf); +int revs_getattr(const char *path, struct stat *stbuf, struct fuse_file_info *fileinfo); -int revs_readdir(const char *path, void *buf, fuse_fill_dir_t filler, off_t offset, struct fuse_file_info *fi); +int revs_readdir(const char *path, void *buf, fuse_fill_dir_t filler, off_t offset, struct fuse_file_info *fi, enum fuse_readdir_flags flags); int revs_readlink(const char *, char *, size_t); diff --git a/parse.c b/parse.c index e1a5596..9dfa475 100644 --- a/parse.c +++ b/parse.c @@ -160,9 +160,9 @@ void parse_repo(struct file_system_info *fsinfo, int argc, char** argv, int *ind void parse_mount(char *arg){ - if (mount != NULL) + if (mount_dir != NULL) fail(ERR_PARAMETRES); - if (gstrcpy(&mount, arg) != 0) + if (gstrcpy(&mount_dir, arg) != 0) fail(-1); }; @@ -182,12 +182,12 @@ int parse(struct file_system_info *fsinfo, int argc, char **argv){ for (i = 1; i < argc; i++){ if (isOption(argv[i]) == 1) parse_option(fsinfo, argc, argv, &i); - else if (mount == NULL) + else if (mount_dir == NULL) parse_mount(argv[i]); else parse_repo(fsinfo, argc, argv, &i); }; - if (mount == NULL) + if (mount_dir == NULL) fail(ERR_NO_MOUNT); if (fsinfo->repo_count == 0) fail(ERR_NO_REPO); diff --git a/rdiff-backup-fs.c b/rdiff-backup-fs.c index caf17ea..b20dfba 100644 --- a/rdiff-backup-fs.c +++ b/rdiff-backup-fs.c @@ -3,7 +3,7 @@ #include "parse.h" #include "initialize.h" -char *mount = NULL; +char *mount_dir = NULL; char *tmp_dir = NULL; char *data_dir = NULL; @@ -30,7 +30,7 @@ int run(int argc, char **argv){ args = calloc(3 + 2, sizeof(char *)); args[0] = argv[0]; - args[1] = mount; + args[1] = mount_dir; options_count = 2; if (debug){ args[options_count] = "-d"; diff --git a/retriever/limit.c b/retriever/limit.c index a53fb84..8eb2168 100644 --- a/retriever/limit.c +++ b/retriever/limit.c @@ -22,7 +22,7 @@ struct cache { }; int cache_add(node_t *); -int cache_delete(); +int cache_delete(struct file_system_info *fsinfo); // public: diff --git a/support/gtree.c b/support/gtree.c index 871211d..e6a5947 100644 --- a/support/gtree.c +++ b/support/gtree.c @@ -1,5 +1,7 @@ #include #include +#include +#include #include "gtree.h" #include "gutils.h"