Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions externs.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#ifndef _EXTERNS_H_
#define _EXTERNS_H_

#define FUSE_USE_VERSION 26
#define FUSE_USE_VERSION 31

#include <fuse.h>
#include <fuse3/fuse.h>

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
Expand Down
2 changes: 1 addition & 1 deletion initialize.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

void check_mount(){

if (gpthpro(&mount) != 0)
if (gpthpro(&mount_dir) != 0)
fail(ERR_NO_MOUNT);

};
Expand Down
2 changes: 1 addition & 1 deletion initialize.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@

#include "retriever/retriever.h"

void initialize();
void initialize(struct file_system_info *fsinfo);

#endif
10 changes: 5 additions & 5 deletions operations.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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;
Expand All @@ -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);
Expand All @@ -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]);
Expand Down
8 changes: 4 additions & 4 deletions operations.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#ifndef _OPERATIONS_H_
#define _OPERATIONS_H_

#define FUSE_USE_VERSION 26
#define FUSE_USE_VERSION 31

#include <fuse.h>
#include <fuse3/fuse.h>

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);

Expand Down
8 changes: 4 additions & 4 deletions parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

};
Expand All @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions rdiff-backup-fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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";
Expand Down
2 changes: 1 addition & 1 deletion retriever/limit.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ struct cache {
};

int cache_add(node_t *);
int cache_delete();
int cache_delete(struct file_system_info *fsinfo);

// public:

Expand Down
2 changes: 2 additions & 0 deletions support/gtree.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include <fcntl.h>
#include <assert.h>
#include <stdio.h>
#include <time.h>

#include "gtree.h"
#include "gutils.h"
Expand Down