aboutsummaryrefslogtreecommitdiff
path: root/example/passthrough.c
diff options
context:
space:
mode:
authorGravatar Nikolaus Rath <Nikolaus@rath.org>2016-10-15 18:46:27 -0700
committerGravatar Nikolaus Rath <Nikolaus@rath.org>2016-10-15 18:46:27 -0700
commit73b6ff4b75cf1228ea61262c293fcb2fda5dfeea (patch)
tree059d5dbe8d2549f5bf363c6174c5887d44f1ee42 /example/passthrough.c
parentd49f2e77b4741706ec125cc62ea913ed5d39bd39 (diff)
Pass fuse_file_info to getattr, chown, chmod, truncate, utimens handlers
This obsoletes the ftruncate & fgetattr handlers. Fixes #58.
Diffstat (limited to 'example/passthrough.c')
-rw-r--r--example/passthrough.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/example/passthrough.c b/example/passthrough.c
index cf72cb2..d3d0fde 100644
--- a/example/passthrough.c
+++ b/example/passthrough.c
@@ -48,8 +48,10 @@
#include <sys/xattr.h>
#endif
-static int xmp_getattr(const char *path, struct stat *stbuf)
+static int xmp_getattr(const char *path, struct stat *stbuf,
+ struct fuse_file_info *fi)
{
+ (void) fi;
int res;
res = lstat(path, stbuf);
@@ -200,8 +202,10 @@ static int xmp_link(const char *from, const char *to)
return 0;
}
-static int xmp_chmod(const char *path, mode_t mode)
+static int xmp_chmod(const char *path, mode_t mode,
+ struct fuse_file_info *fi)
{
+ (void) fi;
int res;
res = chmod(path, mode);
@@ -211,8 +215,10 @@ static int xmp_chmod(const char *path, mode_t mode)
return 0;
}
-static int xmp_chown(const char *path, uid_t uid, gid_t gid)
+static int xmp_chown(const char *path, uid_t uid, gid_t gid,
+ struct fuse_file_info *fi)
{
+ (void) fi;
int res;
res = lchown(path, uid, gid);
@@ -222,8 +228,10 @@ static int xmp_chown(const char *path, uid_t uid, gid_t gid)
return 0;
}
-static int xmp_truncate(const char *path, off_t size)
+static int xmp_truncate(const char *path, off_t size,
+ struct fuse_file_info *fi)
{
+ (void) fi;
int res;
res = truncate(path, size);
@@ -234,8 +242,10 @@ static int xmp_truncate(const char *path, off_t size)
}
#ifdef HAVE_UTIMENSAT
-static int xmp_utimens(const char *path, const struct timespec ts[2])
+static int xmp_utimens(const char *path, const struct timespec ts[2],
+ struct fuse_file_info *fi)
{
+ (void) fi;
int res;
/* don't use utime/utimes since they follow symlinks */