more reverting
diff --git a/example/fusexmp_fh.c b/example/fusexmp_fh.c
index 17bd77e..432ff6f 100644
--- a/example/fusexmp_fh.c
+++ b/example/fusexmp_fh.c
@@ -193,20 +193,6 @@
return 0;
}
-static int xmp_ftruncate(const char *path, off_t size,
- struct fuse_file_info *fi)
-{
- int res;
-
- (void) path;
-
- res = ftruncate(fi->fh, size);
- if(res == -1)
- return -errno;
-
- return 0;
-}
-
static int xmp_utime(const char *path, struct utimbuf *buf)
{
int res;
@@ -231,28 +217,6 @@
return 0;
}
-static int xmp_create(const char *path, mode_t mode, struct fuse_file_info *fi)
-{
- int fd;
- struct stat stbuf;
-
- fd = open(path, fi->flags | O_NOFOLLOW, mode);
- if(fd == -1)
- return -errno;
-
- if (fstat(fd, &stbuf) == -1) {
- close(fd);
- return -EIO;
- }
- if (!S_ISREG(stbuf.st_mode)) {
- close(fd);
- return -EISDIR;
- }
-
- fi->fh = fd;
- return 0;
-}
-
static int xmp_read(const char *path, char *buf, size_t size, off_t offset,
struct fuse_file_info *fi)
{
@@ -367,7 +331,6 @@
.chmod = xmp_chmod,
.chown = xmp_chown,
.truncate = xmp_truncate,
- .ftruncate = xmp_ftruncate,
.utime = xmp_utime,
.open = xmp_open,
.read = xmp_read,
@@ -375,7 +338,6 @@
.statfs = xmp_statfs,
.release = xmp_release,
.fsync = xmp_fsync,
- .create = xmp_create,
#ifdef HAVE_SETXATTR
.setxattr = xmp_setxattr,
.getxattr = xmp_getxattr,
diff --git a/include/fuse.h b/include/fuse.h
index 39982dc..8175718 100644
--- a/include/fuse.h
+++ b/include/fuse.h
@@ -298,23 +298,6 @@
* Introduced in version 2.3
*/
void (*destroy) (void *);
-
- /**
- * Check file access permissions
- *
- * Need not be implemented. Will only be called for the access()
- * system call, and for the open() system call, unless a new file
- * is created (file didn't exist and O_CREAT was given). If the
- * 'default_permissions' mount option is given, this method is
- * never called.
- *
- * Introduced in version 2.4
- */
- int (*access) (const char *, int);
-
- int (*create) (const char *, mode_t, struct fuse_file_info *);
-
- int (*ftruncate) (const char *, off_t, struct fuse_file_info *);
};
/** Extra context that may be needed by some filesystems
diff --git a/lib/fuse.c b/lib/fuse.c
index 2209212..b52febb 100644
--- a/lib/fuse.c
+++ b/lib/fuse.c
@@ -664,15 +664,12 @@
return err;
}
-static int do_truncate(struct fuse *f, const char *path, struct stat *attr,
- struct fuse_file_info *fi)
+static int do_truncate(struct fuse *f, const char *path, struct stat *attr)
{
int err;
err = -ENOSYS;
- if (fi && f->op.ftruncate)
- err = f->op.ftruncate(path, attr->st_size, fi);
- else if (f->op.truncate)
+ if (f->op.truncate)
err = f->op.truncate(path, attr->st_size);
return err;
@@ -699,6 +696,8 @@
char *path;
int err;
+ (void) fi;
+
err = -ENOENT;
pthread_rwlock_rdlock(&f->tree_lock);
path = get_path(f, ino);
@@ -711,7 +710,7 @@
if (!err && (valid & (FUSE_SET_ATTR_UID | FUSE_SET_ATTR_GID)))
err = do_chown(f, path, attr, valid);
if (!err && (valid & FUSE_SET_ATTR_SIZE))
- err = do_truncate(f, path, attr, fi);
+ err = do_truncate(f, path, attr);
if (!err && (valid & (FUSE_SET_ATTR_ATIME | FUSE_SET_ATTR_MTIME)) == (FUSE_SET_ATTR_ATIME | FUSE_SET_ATTR_MTIME))
err = do_utime(f, path, attr);
if (!err)