From 618b6ea03057da666319ff346382f353ff6641b3 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Fri, 11 Sep 2015 11:19:50 +0200 Subject: [PATCH 1/8] fuse_nfs: Add mknod Libnfs already has exports for mknod, hook them up to the fuse example. Signed-off-by: Alexander Graf --- examples/fuse_nfs.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/examples/fuse_nfs.c b/examples/fuse_nfs.c index 5d82b69..3c0e553 100644 --- a/examples/fuse_nfs.c +++ b/examples/fuse_nfs.c @@ -197,10 +197,16 @@ static int fuse_nfs_mkdir(const char *path, mode_t mode) return ret; } +static int fuse_nfs_mknod(const char *path, mode_t mode, dev_t rdev) +{ + return nfs_mknod(nfs, path, mode, rdev); +} + static struct fuse_operations nfs_oper = { .create = fuse_nfs_create, .getattr = fuse_nfs_getattr, .mkdir = fuse_nfs_mkdir, + .mknod = fuse_nfs_mknod, .open = fuse_nfs_open, .read = fuse_nfs_read, .readdir = fuse_nfs_readdir, From 50aabd0729e9e443bf61dbd550e48f4d23fba26e Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Fri, 11 Sep 2015 11:20:42 +0200 Subject: [PATCH 2/8] fuse_nfs: Add symlink Libnfs already has exports for symlink, hook them up to the fuse example. Signed-off-by: Alexander Graf --- examples/fuse_nfs.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/examples/fuse_nfs.c b/examples/fuse_nfs.c index 3c0e553..759f35b 100644 --- a/examples/fuse_nfs.c +++ b/examples/fuse_nfs.c @@ -202,6 +202,11 @@ static int fuse_nfs_mknod(const char *path, mode_t mode, dev_t rdev) return nfs_mknod(nfs, path, mode, rdev); } +static int fuse_nfs_symlink(const char *from, const char *to) +{ + return nfs_symlink(nfs, from, to); +} + static struct fuse_operations nfs_oper = { .create = fuse_nfs_create, .getattr = fuse_nfs_getattr, @@ -215,6 +220,7 @@ static struct fuse_operations nfs_oper = { .rmdir = fuse_nfs_rmdir, .unlink = fuse_nfs_unlink, .utime = fuse_nfs_utime, + .symlink = fuse_nfs_symlink, .write = fuse_nfs_write, }; From 37fd16ee087472dbbdb7bc7c10781a7ff91a3764 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Fri, 11 Sep 2015 11:21:30 +0200 Subject: [PATCH 3/8] fuse_nfs: Add rename Libnfs already has exports for rename, hook them up to the fuse example. Signed-off-by: Alexander Graf --- examples/fuse_nfs.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/examples/fuse_nfs.c b/examples/fuse_nfs.c index 759f35b..647de2e 100644 --- a/examples/fuse_nfs.c +++ b/examples/fuse_nfs.c @@ -207,6 +207,11 @@ static int fuse_nfs_symlink(const char *from, const char *to) return nfs_symlink(nfs, from, to); } +static int fuse_nfs_rename(const char *from, const char *to) +{ + return nfs_rename(nfs, from, to); +} + static struct fuse_operations nfs_oper = { .create = fuse_nfs_create, .getattr = fuse_nfs_getattr, @@ -220,6 +225,7 @@ static struct fuse_operations nfs_oper = { .rmdir = fuse_nfs_rmdir, .unlink = fuse_nfs_unlink, .utime = fuse_nfs_utime, + .rename = fuse_nfs_rename, .symlink = fuse_nfs_symlink, .write = fuse_nfs_write, }; From d1709ab57371080ed699667b7bed13abfca6154c Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Fri, 11 Sep 2015 11:22:27 +0200 Subject: [PATCH 4/8] fuse_nfs: Add link Libnfs already has exports for link, hook them up to the fuse example. Signed-off-by: Alexander Graf --- examples/fuse_nfs.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/examples/fuse_nfs.c b/examples/fuse_nfs.c index 647de2e..b40fa73 100644 --- a/examples/fuse_nfs.c +++ b/examples/fuse_nfs.c @@ -212,9 +212,15 @@ static int fuse_nfs_rename(const char *from, const char *to) return nfs_rename(nfs, from, to); } +static int fuse_nfs_link(const char *from, const char *to) +{ + return nfs_link(nfs, from, to); +} + static struct fuse_operations nfs_oper = { .create = fuse_nfs_create, .getattr = fuse_nfs_getattr, + .link = fuse_nfs_link, .mkdir = fuse_nfs_mkdir, .mknod = fuse_nfs_mknod, .open = fuse_nfs_open, From 315112b923cd7845ce9703e60e0c30e582e93c39 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Fri, 11 Sep 2015 11:23:02 +0200 Subject: [PATCH 5/8] fuse_nfs: Add chmod Libnfs already has exports for chmod, hook them up to the fuse example. Signed-off-by: Alexander Graf --- examples/fuse_nfs.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/examples/fuse_nfs.c b/examples/fuse_nfs.c index b40fa73..ad15579 100644 --- a/examples/fuse_nfs.c +++ b/examples/fuse_nfs.c @@ -217,7 +217,13 @@ static int fuse_nfs_link(const char *from, const char *to) return nfs_link(nfs, from, to); } +static int fuse_nfs_chmod(const char *path, mode_t mode) +{ + return nfs_chmod(nfs, path, mode); +} + static struct fuse_operations nfs_oper = { + .chmod = fuse_nfs_chmod, .create = fuse_nfs_create, .getattr = fuse_nfs_getattr, .link = fuse_nfs_link, From b66121610d21e8e5187dd16691d15e159e0cfcd8 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Fri, 11 Sep 2015 11:23:34 +0200 Subject: [PATCH 6/8] fuse_nfs: Add chown Libnfs already has exports for chown, hook them up to the fuse example. Signed-off-by: Alexander Graf --- examples/fuse_nfs.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/examples/fuse_nfs.c b/examples/fuse_nfs.c index ad15579..d84b590 100644 --- a/examples/fuse_nfs.c +++ b/examples/fuse_nfs.c @@ -222,8 +222,14 @@ static int fuse_nfs_chmod(const char *path, mode_t mode) return nfs_chmod(nfs, path, mode); } +static int fuse_nfs_chown(const char *path, uid_t uid, gid_t gid) +{ + return nfs_chown(nfs, path, uid, gid); +} + static struct fuse_operations nfs_oper = { .chmod = fuse_nfs_chmod, + .chown = fuse_nfs_chown, .create = fuse_nfs_create, .getattr = fuse_nfs_getattr, .link = fuse_nfs_link, From 9439361243c7e35a2cfcb66fad21a107e5e64609 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Fri, 11 Sep 2015 11:24:07 +0200 Subject: [PATCH 7/8] fuse_nfs: Add truncate Libnfs already has exports for truncate, hook them up to the fuse example. Signed-off-by: Alexander Graf --- examples/fuse_nfs.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/examples/fuse_nfs.c b/examples/fuse_nfs.c index d84b590..acc8806 100644 --- a/examples/fuse_nfs.c +++ b/examples/fuse_nfs.c @@ -227,6 +227,11 @@ static int fuse_nfs_chown(const char *path, uid_t uid, gid_t gid) return nfs_chown(nfs, path, uid, gid); } +static int fuse_nfs_truncate(const char *path, off_t size) +{ + return nfs_truncate(nfs, path, size); +} + static struct fuse_operations nfs_oper = { .chmod = fuse_nfs_chmod, .chown = fuse_nfs_chown, @@ -245,6 +250,7 @@ static struct fuse_operations nfs_oper = { .utime = fuse_nfs_utime, .rename = fuse_nfs_rename, .symlink = fuse_nfs_symlink, + .truncate = fuse_nfs_truncate, .write = fuse_nfs_write, }; From 883f660430f1be1f7796c275f4ae0d85101ed478 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Fri, 11 Sep 2015 11:24:45 +0200 Subject: [PATCH 8/8] fuse_nfs: Add fsync Libnfs already has exports for fsync, hook them up to the fuse example. Signed-off-by: Alexander Graf --- examples/fuse_nfs.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/examples/fuse_nfs.c b/examples/fuse_nfs.c index acc8806..5f7eb7b 100644 --- a/examples/fuse_nfs.c +++ b/examples/fuse_nfs.c @@ -232,10 +232,19 @@ static int fuse_nfs_truncate(const char *path, off_t size) return nfs_truncate(nfs, path, size); } +static int fuse_nfs_fsync(const char *path, int isdatasync, + struct fuse_file_info *fi) +{ + struct nfsfh *nfsfh = (struct nfsfh *)fi->fh; + + return nfs_fsync(nfs, nfsfh); +} + static struct fuse_operations nfs_oper = { .chmod = fuse_nfs_chmod, .chown = fuse_nfs_chown, .create = fuse_nfs_create, + .fsync = fuse_nfs_fsync, .getattr = fuse_nfs_getattr, .link = fuse_nfs_link, .mkdir = fuse_nfs_mkdir,