Browse Source

remove unnecessary libfuse flags nopath, nullpath_ok, and utime_omit_ok

pull/780/head
Antonio SJ Musumeci 5 years ago
parent
commit
c0990644e8
  1. 108
      libfuse/include/fuse.h
  2. 372
      libfuse/lib/fuse.c
  3. 4
      src/fuse_copy_file_range.cpp
  4. 4
      src/fuse_copy_file_range.hpp
  5. 3
      src/fuse_fallocate.cpp
  6. 3
      src/fuse_fallocate.hpp
  7. 3
      src/fuse_fgetattr.cpp
  8. 3
      src/fuse_fgetattr.hpp
  9. 3
      src/fuse_flush.cpp
  10. 3
      src/fuse_flush.hpp
  11. 3
      src/fuse_fsync.cpp
  12. 3
      src/fuse_fsync.hpp
  13. 3
      src/fuse_fsyncdir.cpp
  14. 3
      src/fuse_fsyncdir.hpp
  15. 3
      src/fuse_ftruncate.cpp
  16. 3
      src/fuse_ftruncate.hpp
  17. 3
      src/fuse_ioctl.cpp
  18. 3
      src/fuse_ioctl.hpp
  19. 6
      src/fuse_read.cpp
  20. 6
      src/fuse_read.hpp
  21. 3
      src/fuse_read_buf.cpp
  22. 3
      src/fuse_read_buf.hpp
  23. 3
      src/fuse_release.cpp
  24. 3
      src/fuse_release.hpp
  25. 3
      src/fuse_releasedir.cpp
  26. 3
      src/fuse_releasedir.hpp
  27. 6
      src/fuse_write.cpp
  28. 6
      src/fuse_write.hpp
  29. 6
      src/fuse_write_buf.cpp
  30. 6
      src/fuse_write_buf.hpp
  31. 4
      src/mergerfs.cpp

108
libfuse/include/fuse.h

@ -176,7 +176,7 @@ struct fuse_operations {
* *
* Changed in version 2.2 * Changed in version 2.2
*/ */
int (*read) (const char *, char *, size_t, off_t,
int (*read) (char *, size_t, off_t,
struct fuse_file_info *); struct fuse_file_info *);
/** Write data to an open file /** Write data to an open file
@ -187,7 +187,7 @@ struct fuse_operations {
* *
* Changed in version 2.2 * Changed in version 2.2
*/ */
int (*write) (const char *, const char *, size_t, off_t,
int (*write) (const char *, size_t, off_t,
struct fuse_file_info *); struct fuse_file_info *);
/** Get file system statistics /** Get file system statistics
@ -222,7 +222,7 @@ struct fuse_operations {
* *
* Changed in version 2.2 * Changed in version 2.2
*/ */
int (*flush) (const char *, struct fuse_file_info *);
int (*flush) (struct fuse_file_info *);
/** Release an open file /** Release an open file
* *
@ -238,7 +238,7 @@ struct fuse_operations {
* *
* Changed in version 2.2 * Changed in version 2.2
*/ */
int (*release) (const char *, struct fuse_file_info *);
int (*release) (struct fuse_file_info *);
/** Synchronize file contents /** Synchronize file contents
* *
@ -247,7 +247,7 @@ struct fuse_operations {
* *
* Changed in version 2.2 * Changed in version 2.2
*/ */
int (*fsync) (const char *, int, struct fuse_file_info *);
int (*fsync) (int, struct fuse_file_info *);
/** Set extended attributes */ /** Set extended attributes */
int (*setxattr) (const char *, const char *, const char *, size_t, int); int (*setxattr) (const char *, const char *, const char *, size_t, int);
@ -305,7 +305,7 @@ struct fuse_operations {
* *
* Introduced in version 2.3 * Introduced in version 2.3
*/ */
int (*releasedir) (const char *, struct fuse_file_info *);
int (*releasedir) (struct fuse_file_info *);
/** Synchronize directory contents /** Synchronize directory contents
* *
@ -314,7 +314,7 @@ struct fuse_operations {
* *
* Introduced in version 2.3 * Introduced in version 2.3
*/ */
int (*fsyncdir) (const char *, int, struct fuse_file_info *);
int (*fsyncdir) (int, struct fuse_file_info *);
/** /**
* Initialize filesystem * Initialize filesystem
@ -376,7 +376,7 @@ struct fuse_operations {
* *
* Introduced in version 2.5 * Introduced in version 2.5
*/ */
int (*ftruncate) (const char *, off_t, struct fuse_file_info *);
int (*ftruncate) (off_t, struct fuse_file_info *);
/** /**
* Get attributes from an open file * Get attributes from an open file
@ -390,7 +390,7 @@ struct fuse_operations {
* *
* Introduced in version 2.5 * Introduced in version 2.5
*/ */
int (*fgetattr) (const char *, struct stat *, struct fuse_file_info *, fuse_timeouts_t *);
int (*fgetattr) (struct stat *, struct fuse_file_info *, fuse_timeouts_t *);
/** /**
* Perform POSIX file locking operation * Perform POSIX file locking operation
@ -424,7 +424,7 @@ struct fuse_operations {
* *
* Introduced in version 2.6 * Introduced in version 2.6
*/ */
int (*lock) (const char *, struct fuse_file_info *, int cmd,
int (*lock) (struct fuse_file_info *, int cmd,
struct flock *); struct flock *);
/** /**
@ -451,43 +451,6 @@ struct fuse_operations {
*/ */
int (*bmap) (const char *, size_t blocksize, uint64_t *idx); int (*bmap) (const char *, size_t blocksize, uint64_t *idx);
/**
* Flag indicating that the filesystem can accept a NULL path
* as the first argument for the following operations:
*
* read, write, flush, release, fsync, readdir, releasedir,
* fsyncdir, ftruncate, fgetattr, lock, ioctl and poll
*
* If this flag is set these operations continue to work on
* unlinked files even if "-ohard_remove" option was specified.
*/
unsigned int flag_nullpath_ok:1;
/**
* Flag indicating that the path need not be calculated for
* the following operations:
*
* read, write, flush, release, fsync, readdir, releasedir,
* fsyncdir, ftruncate, fgetattr, lock, ioctl and poll
*
* Closely related to flag_nullpath_ok, but if this flag is
* set then the path will not be calculaged even if the file
* wasn't unlinked. However the path can still be non-NULL if
* it needs to be calculated for some other reason.
*/
unsigned int flag_nopath:1;
/**
* Flag indicating that the filesystem accepts special
* UTIME_NOW and UTIME_OMIT values in its utimens operation.
*/
unsigned int flag_utime_omit_ok:1;
/**
* Reserved flags, don't set
*/
unsigned int flag_reserved:29;
/** /**
* Ioctl * Ioctl
* *
@ -503,8 +466,7 @@ struct fuse_operations {
* *
* Introduced in version 2.8 * Introduced in version 2.8
*/ */
int (*ioctl) (const char *fusepath,
unsigned long cmd,
int (*ioctl) (unsigned long cmd,
void *arg, void *arg,
struct fuse_file_info *ffi, struct fuse_file_info *ffi,
unsigned int flags, unsigned int flags,
@ -528,7 +490,7 @@ struct fuse_operations {
* *
* Introduced in version 2.8 * Introduced in version 2.8
*/ */
int (*poll) (const char *, struct fuse_file_info *,
int (*poll) (struct fuse_file_info *,
struct fuse_pollhandle *ph, unsigned *reventsp); struct fuse_pollhandle *ph, unsigned *reventsp);
/** Write contents of buffer to an open file /** Write contents of buffer to an open file
@ -539,7 +501,7 @@ struct fuse_operations {
* *
* Introduced in version 2.9 * Introduced in version 2.9
*/ */
int (*write_buf) (const char *, struct fuse_bufvec *buf, off_t off,
int (*write_buf) (struct fuse_bufvec *buf, off_t off,
struct fuse_file_info *); struct fuse_file_info *);
/** Store data from an open file in a buffer /** Store data from an open file in a buffer
@ -558,7 +520,7 @@ struct fuse_operations {
* *
* Introduced in version 2.9 * Introduced in version 2.9
*/ */
int (*read_buf) (const char *, struct fuse_bufvec **bufp,
int (*read_buf) (struct fuse_bufvec **bufp,
size_t size, off_t off, struct fuse_file_info *); size_t size, off_t off, struct fuse_file_info *);
/** /**
* Perform BSD file locking operation * Perform BSD file locking operation
@ -580,7 +542,7 @@ struct fuse_operations {
* *
* Introduced in version 2.9 * Introduced in version 2.9
*/ */
int (*flock) (const char *, struct fuse_file_info *, int op);
int (*flock) (struct fuse_file_info *, int op);
/** /**
* Allocates space for an open file * Allocates space for an open file
@ -592,8 +554,7 @@ struct fuse_operations {
* *
* Introduced in version 2.9.1 * Introduced in version 2.9.1
*/ */
int (*fallocate) (const char *, int, off_t, off_t,
struct fuse_file_info *);
int (*fallocate) (int, off_t, off_t,struct fuse_file_info *);
/** /**
* Copy a range of data from one file to another * Copy a range of data from one file to another
@ -610,10 +571,8 @@ struct fuse_operations {
* data from the source and writing to the destination. Effectively * data from the source and writing to the destination. Effectively
* doing an inefficient copy of the data. * doing an inefficient copy of the data.
*/ */
ssize_t (*copy_file_range)(const char *path_in,
struct fuse_file_info *fi_in,
ssize_t (*copy_file_range)(struct fuse_file_info *fi_in,
off_t offset_in, off_t offset_in,
const char *path_out,
struct fuse_file_info *fi_out, struct fuse_file_info *fi_out,
off_t offset_out, off_t offset_out,
size_t size, size_t size,
@ -859,7 +818,6 @@ int fuse_fs_getattr(struct fuse_fs *fs,
fuse_timeouts_t *timeout); fuse_timeouts_t *timeout);
int fuse_fs_fgetattr(struct fuse_fs *fs, int fuse_fs_fgetattr(struct fuse_fs *fs,
const char *path,
struct stat *buf, struct stat *buf,
struct fuse_file_info *fi, struct fuse_file_info *fi,
fuse_timeouts_t *timeout); fuse_timeouts_t *timeout);
@ -871,23 +829,23 @@ int fuse_fs_rmdir(struct fuse_fs *fs, const char *path);
int fuse_fs_symlink(struct fuse_fs *fs, const char *linkname, int fuse_fs_symlink(struct fuse_fs *fs, const char *linkname,
const char *path); const char *path);
int fuse_fs_link(struct fuse_fs *fs, const char *oldpath, const char *newpath); int fuse_fs_link(struct fuse_fs *fs, const char *oldpath, const char *newpath);
int fuse_fs_release(struct fuse_fs *fs, const char *path,
int fuse_fs_release(struct fuse_fs *fs,
struct fuse_file_info *fi); struct fuse_file_info *fi);
int fuse_fs_open(struct fuse_fs *fs, const char *path, int fuse_fs_open(struct fuse_fs *fs, const char *path,
struct fuse_file_info *fi); struct fuse_file_info *fi);
int fuse_fs_read(struct fuse_fs *fs, const char *path, char *buf, size_t size,
int fuse_fs_read(struct fuse_fs *fs, char *buf, size_t size,
off_t off, struct fuse_file_info *fi); off_t off, struct fuse_file_info *fi);
int fuse_fs_read_buf(struct fuse_fs *fs, const char *path,
int fuse_fs_read_buf(struct fuse_fs *fs,
struct fuse_bufvec **bufp, size_t size, off_t off, struct fuse_bufvec **bufp, size_t size, off_t off,
struct fuse_file_info *fi); struct fuse_file_info *fi);
int fuse_fs_write(struct fuse_fs *fs, const char *path, const char *buf,
int fuse_fs_write(struct fuse_fs *fs, const char *buf,
size_t size, off_t off, struct fuse_file_info *fi); size_t size, off_t off, struct fuse_file_info *fi);
int fuse_fs_write_buf(struct fuse_fs *fs, const char *path,
int fuse_fs_write_buf(struct fuse_fs *fs,
struct fuse_bufvec *buf, off_t off, struct fuse_bufvec *buf, off_t off,
struct fuse_file_info *fi); struct fuse_file_info *fi);
int fuse_fs_fsync(struct fuse_fs *fs, const char *path, int datasync,
int fuse_fs_fsync(struct fuse_fs *fs, int datasync,
struct fuse_file_info *fi); struct fuse_file_info *fi);
int fuse_fs_flush(struct fuse_fs *fs, const char *path,
int fuse_fs_flush(struct fuse_fs *fs,
struct fuse_file_info *fi); struct fuse_file_info *fi);
int fuse_fs_statfs(struct fuse_fs *fs, const char *path, struct statvfs *buf); int fuse_fs_statfs(struct fuse_fs *fs, const char *path, struct statvfs *buf);
int fuse_fs_opendir(struct fuse_fs *fs, const char *path, int fuse_fs_opendir(struct fuse_fs *fs, const char *path,
@ -895,20 +853,20 @@ int fuse_fs_opendir(struct fuse_fs *fs, const char *path,
int fuse_fs_readdir(struct fuse_fs *fs, int fuse_fs_readdir(struct fuse_fs *fs,
struct fuse_file_info *fi, struct fuse_file_info *fi,
fuse_dirents_t *buf); fuse_dirents_t *buf);
int fuse_fs_fsyncdir(struct fuse_fs *fs, const char *path, int datasync,
int fuse_fs_fsyncdir(struct fuse_fs *fs, int datasync,
struct fuse_file_info *fi); struct fuse_file_info *fi);
int fuse_fs_releasedir(struct fuse_fs *fs, const char *path,
int fuse_fs_releasedir(struct fuse_fs *fs,
struct fuse_file_info *fi); struct fuse_file_info *fi);
int fuse_fs_create(struct fuse_fs *fs, const char *path, mode_t mode, int fuse_fs_create(struct fuse_fs *fs, const char *path, mode_t mode,
struct fuse_file_info *fi); struct fuse_file_info *fi);
int fuse_fs_lock(struct fuse_fs *fs, const char *path,
int fuse_fs_lock(struct fuse_fs *fs,
struct fuse_file_info *fi, int cmd, struct flock *lock); struct fuse_file_info *fi, int cmd, struct flock *lock);
int fuse_fs_flock(struct fuse_fs *fs, const char *path,
int fuse_fs_flock(struct fuse_fs *fs,
struct fuse_file_info *fi, int op); struct fuse_file_info *fi, int op);
int fuse_fs_chmod(struct fuse_fs *fs, const char *path, mode_t mode); int fuse_fs_chmod(struct fuse_fs *fs, const char *path, mode_t mode);
int fuse_fs_chown(struct fuse_fs *fs, const char *path, uid_t uid, gid_t gid); int fuse_fs_chown(struct fuse_fs *fs, const char *path, uid_t uid, gid_t gid);
int fuse_fs_truncate(struct fuse_fs *fs, const char *path, off_t size); int fuse_fs_truncate(struct fuse_fs *fs, const char *path, off_t size);
int fuse_fs_ftruncate(struct fuse_fs *fs, const char *path, off_t size,
int fuse_fs_ftruncate(struct fuse_fs *fs, off_t size,
struct fuse_file_info *fi); struct fuse_file_info *fi);
int fuse_fs_utimens(struct fuse_fs *fs, const char *path, int fuse_fs_utimens(struct fuse_fs *fs, const char *path,
const struct timespec tv[2]); const struct timespec tv[2]);
@ -928,13 +886,13 @@ int fuse_fs_removexattr(struct fuse_fs *fs, const char *path,
const char *name); const char *name);
int fuse_fs_bmap(struct fuse_fs *fs, const char *path, size_t blocksize, int fuse_fs_bmap(struct fuse_fs *fs, const char *path, size_t blocksize,
uint64_t *idx); uint64_t *idx);
int fuse_fs_ioctl(struct fuse_fs *fs, const char *path, unsigned long cmd, void *arg,
int fuse_fs_ioctl(struct fuse_fs *fs, unsigned long cmd, void *arg,
struct fuse_file_info *fi, unsigned int flags, struct fuse_file_info *fi, unsigned int flags,
void *data, uint32_t *out_bufsz); void *data, uint32_t *out_bufsz);
int fuse_fs_poll(struct fuse_fs *fs, const char *path,
int fuse_fs_poll(struct fuse_fs *fs,
struct fuse_file_info *fi, struct fuse_pollhandle *ph, struct fuse_file_info *fi, struct fuse_pollhandle *ph,
unsigned *reventsp); unsigned *reventsp);
int fuse_fs_fallocate(struct fuse_fs *fs, const char *path, int mode,
int fuse_fs_fallocate(struct fuse_fs *fs, int mode,
off_t offset, off_t length, struct fuse_file_info *fi); off_t offset, off_t length, struct fuse_file_info *fi);
void fuse_fs_init(struct fuse_fs *fs, struct fuse_conn_info *conn); void fuse_fs_init(struct fuse_fs *fs, struct fuse_conn_info *conn);
void fuse_fs_destroy(struct fuse_fs *fs); void fuse_fs_destroy(struct fuse_fs *fs);
@ -942,9 +900,7 @@ void fuse_fs_destroy(struct fuse_fs *fs);
int fuse_fs_prepare_hide(struct fuse_fs *fs, const char *path, uint64_t *fh); int fuse_fs_prepare_hide(struct fuse_fs *fs, const char *path, uint64_t *fh);
int fuse_fs_free_hide(struct fuse_fs *fs, uint64_t fh); int fuse_fs_free_hide(struct fuse_fs *fs, uint64_t fh);
ssize_t fuse_fs_copy_file_range(struct fuse_fs *fs, ssize_t fuse_fs_copy_file_range(struct fuse_fs *fs,
const char *path_in,
struct fuse_file_info *fi_in, off_t off_in, struct fuse_file_info *fi_in, off_t off_in,
const char *path_out,
struct fuse_file_info *fi_out, off_t off_out, struct fuse_file_info *fi_out, off_t off_out,
size_t len, int flags); size_t len, int flags);

372
libfuse/lib/fuse.c

@ -59,7 +59,6 @@ struct fuse_config {
unsigned int gid; unsigned int gid;
unsigned int umask; unsigned int umask;
int remember; int remember;
int nopath;
int debug; int debug;
int use_ino; int use_ino;
int set_mode; int set_mode;
@ -133,8 +132,6 @@ struct fuse
struct fuse_config conf; struct fuse_config conf;
int intr_installed; int intr_installed;
struct fuse_fs *fs; struct fuse_fs *fs;
int nullpath_ok;
int utime_omit_ok;
struct lock_queue_element *lockq; struct lock_queue_element *lockq;
int pagesize; int pagesize;
struct list_head partial_slabs; struct list_head partial_slabs;
@ -1080,28 +1077,6 @@ static int get_path(struct fuse *f, fuse_ino_t nodeid, char **path)
return get_path_common(f, nodeid, NULL, path, NULL); return get_path_common(f, nodeid, NULL, path, NULL);
} }
static
int
get_path_nullok(struct fuse *f,
fuse_ino_t nodeid,
char **path)
{
int err = 0;
if(f->conf.nopath)
{
*path = NULL;
}
else
{
err = get_path_common(f,nodeid,NULL,path,NULL);
if((err == -ENOENT) && f->nullpath_ok)
err = 0;
}
return err;
}
static int get_path_name(struct fuse *f, fuse_ino_t nodeid, const char *name, static int get_path_name(struct fuse *f, fuse_ino_t nodeid, const char *name,
char **path) char **path)
{ {
@ -1398,14 +1373,14 @@ static int fuse_compat_open(struct fuse_fs *fs, const char *path,
return err; return err;
} }
static int fuse_compat_release(struct fuse_fs *fs, const char *path,
static int fuse_compat_release(struct fuse_fs *fs,
struct fuse_file_info *fi) struct fuse_file_info *fi)
{ {
if (!fs->compat || fs->compat >= 22) if (!fs->compat || fs->compat >= 22)
return fs->op.release(path, fi);
return fs->op.release(fi);
else else
return ((struct fuse_operations_compat2 *) &fs->op) return ((struct fuse_operations_compat2 *) &fs->op)
->release(path, fi->flags);
->release(NULL, fi->flags);
} }
static int fuse_compat_opendir(struct fuse_fs *fs, const char *path, static int fuse_compat_opendir(struct fuse_fs *fs, const char *path,
@ -1480,10 +1455,10 @@ static inline int fuse_compat_open(struct fuse_fs *fs, char *path,
return fs->op.open(path, fi); return fs->op.open(path, fi);
} }
static inline int fuse_compat_release(struct fuse_fs *fs, const char *path,
static inline int fuse_compat_release(struct fuse_fs *fs,
struct fuse_file_info *fi) struct fuse_file_info *fi)
{ {
return fs->op.release(path, fi);
return fs->op.release(fi);
} }
static inline int fuse_compat_opendir(struct fuse_fs *fs, const char *path, static inline int fuse_compat_opendir(struct fuse_fs *fs, const char *path,
@ -1519,30 +1494,18 @@ fuse_fs_getattr(struct fuse_fs *fs,
int int
fuse_fs_fgetattr(struct fuse_fs *fs, fuse_fs_fgetattr(struct fuse_fs *fs,
const char *path,
struct stat *buf, struct stat *buf,
struct fuse_file_info *fi, struct fuse_file_info *fi,
fuse_timeouts_t *timeout) fuse_timeouts_t *timeout)
{ {
fuse_get_context()->private_data = fs->user_data;
if(fs->op.fgetattr)
{
if(fs->debug)
fprintf(stderr,"fgetattr[%llu] %s\n",(unsigned long long)fi->fh,path);
if(fs->op.fgetattr == NULL)
return -ENOSYS;
return fs->op.fgetattr(path,buf,fi,timeout);
}
else if(path && fs->op.getattr)
{
if(fs->debug)
fprintf(stderr,"getattr %s\n",path);
fuse_get_context()->private_data = fs->user_data;
if(fs->debug)
fprintf(stderr,"fgetattr[%llu]\n",(unsigned long long)fi->fh);
return fs->op.getattr(path,buf,timeout);
}
else
{
return -ENOSYS;
}
return fs->op.fgetattr(buf,fi,timeout);
} }
int int
@ -1635,7 +1598,7 @@ int fuse_fs_link(struct fuse_fs *fs, const char *oldpath, const char *newpath)
} }
} }
int fuse_fs_release(struct fuse_fs *fs, const char *path,
int fuse_fs_release(struct fuse_fs *fs,
struct fuse_file_info *fi) struct fuse_file_info *fi)
{ {
fuse_get_context()->private_data = fs->user_data; fuse_get_context()->private_data = fs->user_data;
@ -1645,7 +1608,7 @@ int fuse_fs_release(struct fuse_fs *fs, const char *path,
fi->flush ? "+flush" : "", fi->flush ? "+flush" : "",
(unsigned long long) fi->fh, fi->flags); (unsigned long long) fi->fh, fi->flags);
return fuse_compat_release(fs, path, fi);
return fuse_compat_release(fs, fi);
} else { } else {
return 0; return 0;
} }
@ -1708,7 +1671,7 @@ static void fuse_free_buf(struct fuse_bufvec *buf)
} }
} }
int fuse_fs_read_buf(struct fuse_fs *fs, const char *path,
int fuse_fs_read_buf(struct fuse_fs *fs,
struct fuse_bufvec **bufp, size_t size, off_t off, struct fuse_bufvec **bufp, size_t size, off_t off,
struct fuse_file_info *fi) struct fuse_file_info *fi)
{ {
@ -1723,7 +1686,7 @@ int fuse_fs_read_buf(struct fuse_fs *fs, const char *path,
size, (unsigned long long) off, fi->flags); size, (unsigned long long) off, fi->flags);
if (fs->op.read_buf) { if (fs->op.read_buf) {
res = fs->op.read_buf(path, bufp, size, off, fi);
res = fs->op.read_buf(bufp, size, off, fi);
} else { } else {
struct fuse_bufvec *buf; struct fuse_bufvec *buf;
void *mem; void *mem;
@ -1741,7 +1704,7 @@ int fuse_fs_read_buf(struct fuse_fs *fs, const char *path,
buf->buf[0].mem = mem; buf->buf[0].mem = mem;
*bufp = buf; *bufp = buf;
res = fs->op.read(path, mem, size, off, fi);
res = fs->op.read(mem, size, off, fi);
if (res >= 0) if (res >= 0)
buf->buf[0].size = res; buf->buf[0].size = res;
} }
@ -1763,13 +1726,13 @@ int fuse_fs_read_buf(struct fuse_fs *fs, const char *path,
} }
} }
int fuse_fs_read(struct fuse_fs *fs, const char *path, char *mem, size_t size,
int fuse_fs_read(struct fuse_fs *fs, char *mem, size_t size,
off_t off, struct fuse_file_info *fi) off_t off, struct fuse_file_info *fi)
{ {
int res; int res;
struct fuse_bufvec *buf = NULL; struct fuse_bufvec *buf = NULL;
res = fuse_fs_read_buf(fs, path, &buf, size, off, fi);
res = fuse_fs_read_buf(fs, &buf, size, off, fi);
if (res == 0) { if (res == 0) {
struct fuse_bufvec dst = FUSE_BUFVEC_INIT(size); struct fuse_bufvec dst = FUSE_BUFVEC_INIT(size);
@ -1781,7 +1744,7 @@ int fuse_fs_read(struct fuse_fs *fs, const char *path, char *mem, size_t size,
return res; return res;
} }
int fuse_fs_write_buf(struct fuse_fs *fs, const char *path,
int fuse_fs_write_buf(struct fuse_fs *fs,
struct fuse_bufvec *buf, off_t off, struct fuse_bufvec *buf, off_t off,
struct fuse_file_info *fi) struct fuse_file_info *fi)
{ {
@ -1801,7 +1764,7 @@ int fuse_fs_write_buf(struct fuse_fs *fs, const char *path,
fi->flags); fi->flags);
if (fs->op.write_buf) { if (fs->op.write_buf) {
res = fs->op.write_buf(path, buf, off, fi);
res = fs->op.write_buf(buf, off, fi);
} else { } else {
void *mem = NULL; void *mem = NULL;
struct fuse_buf *flatbuf; struct fuse_buf *flatbuf;
@ -1825,7 +1788,7 @@ int fuse_fs_write_buf(struct fuse_fs *fs, const char *path,
flatbuf = &tmp.buf[0]; flatbuf = &tmp.buf[0];
} }
res = fs->op.write(path, flatbuf->mem, flatbuf->size,
res = fs->op.write(flatbuf->mem, flatbuf->size,
off, fi); off, fi);
out_free: out_free:
free(mem); free(mem);
@ -1845,17 +1808,17 @@ out:
} }
} }
int fuse_fs_write(struct fuse_fs *fs, const char *path, const char *mem,
int fuse_fs_write(struct fuse_fs *fs, const char *mem,
size_t size, off_t off, struct fuse_file_info *fi) size_t size, off_t off, struct fuse_file_info *fi)
{ {
struct fuse_bufvec bufv = FUSE_BUFVEC_INIT(size); struct fuse_bufvec bufv = FUSE_BUFVEC_INIT(size);
bufv.buf[0].mem = (void *) mem; bufv.buf[0].mem = (void *) mem;
return fuse_fs_write_buf(fs, path, &bufv, off, fi);
return fuse_fs_write_buf(fs, &bufv, off, fi);
} }
int fuse_fs_fsync(struct fuse_fs *fs, const char *path, int datasync,
int fuse_fs_fsync(struct fuse_fs *fs, int datasync,
struct fuse_file_info *fi) struct fuse_file_info *fi)
{ {
fuse_get_context()->private_data = fs->user_data; fuse_get_context()->private_data = fs->user_data;
@ -1864,13 +1827,13 @@ int fuse_fs_fsync(struct fuse_fs *fs, const char *path, int datasync,
fprintf(stderr, "fsync[%llu] datasync: %i\n", fprintf(stderr, "fsync[%llu] datasync: %i\n",
(unsigned long long) fi->fh, datasync); (unsigned long long) fi->fh, datasync);
return fs->op.fsync(path, datasync, fi);
return fs->op.fsync(datasync, fi);
} else { } else {
return -ENOSYS; return -ENOSYS;
} }
} }
int fuse_fs_fsyncdir(struct fuse_fs *fs, const char *path, int datasync,
int fuse_fs_fsyncdir(struct fuse_fs *fs, int datasync,
struct fuse_file_info *fi) struct fuse_file_info *fi)
{ {
fuse_get_context()->private_data = fs->user_data; fuse_get_context()->private_data = fs->user_data;
@ -1879,13 +1842,13 @@ int fuse_fs_fsyncdir(struct fuse_fs *fs, const char *path, int datasync,
fprintf(stderr, "fsyncdir[%llu] datasync: %i\n", fprintf(stderr, "fsyncdir[%llu] datasync: %i\n",
(unsigned long long) fi->fh, datasync); (unsigned long long) fi->fh, datasync);
return fs->op.fsyncdir(path, datasync, fi);
return fs->op.fsyncdir(datasync, fi);
} else { } else {
return -ENOSYS; return -ENOSYS;
} }
} }
int fuse_fs_flush(struct fuse_fs *fs, const char *path,
int fuse_fs_flush(struct fuse_fs *fs,
struct fuse_file_info *fi) struct fuse_file_info *fi)
{ {
fuse_get_context()->private_data = fs->user_data; fuse_get_context()->private_data = fs->user_data;
@ -1894,7 +1857,7 @@ int fuse_fs_flush(struct fuse_fs *fs, const char *path,
fprintf(stderr, "flush[%llu]\n", fprintf(stderr, "flush[%llu]\n",
(unsigned long long) fi->fh); (unsigned long long) fi->fh);
return fs->op.flush(path, fi);
return fs->op.flush(fi);
} else { } else {
return -ENOSYS; return -ENOSYS;
} }
@ -1915,7 +1878,7 @@ int fuse_fs_statfs(struct fuse_fs *fs, const char *path, struct statvfs *buf)
} }
} }
int fuse_fs_releasedir(struct fuse_fs *fs, const char *path,
int fuse_fs_releasedir(struct fuse_fs *fs,
struct fuse_file_info *fi) struct fuse_file_info *fi)
{ {
fuse_get_context()->private_data = fs->user_data; fuse_get_context()->private_data = fs->user_data;
@ -1924,7 +1887,7 @@ int fuse_fs_releasedir(struct fuse_fs *fs, const char *path,
fprintf(stderr, "releasedir[%llu] flags: 0x%x\n", fprintf(stderr, "releasedir[%llu] flags: 0x%x\n",
(unsigned long long) fi->fh, fi->flags); (unsigned long long) fi->fh, fi->flags);
return fs->op.releasedir(path, fi);
return fs->op.releasedir(fi);
} else { } else {
return 0; return 0;
} }
@ -1981,7 +1944,7 @@ int fuse_fs_create(struct fuse_fs *fs, const char *path, mode_t mode,
} }
} }
int fuse_fs_lock(struct fuse_fs *fs, const char *path,
int fuse_fs_lock(struct fuse_fs *fs,
struct fuse_file_info *fi, int cmd, struct flock *lock) struct fuse_file_info *fi, int cmd, struct flock *lock)
{ {
fuse_get_context()->private_data = fs->user_data; fuse_get_context()->private_data = fs->user_data;
@ -2000,13 +1963,13 @@ int fuse_fs_lock(struct fuse_fs *fs, const char *path,
(unsigned long long) lock->l_len, (unsigned long long) lock->l_len,
(unsigned long long) lock->l_pid); (unsigned long long) lock->l_pid);
return fs->op.lock(path, fi, cmd, lock);
return fs->op.lock(fi, cmd, lock);
} else { } else {
return -ENOSYS; return -ENOSYS;
} }
} }
int fuse_fs_flock(struct fuse_fs *fs, const char *path,
int fuse_fs_flock(struct fuse_fs *fs,
struct fuse_file_info *fi, int op) struct fuse_file_info *fi, int op)
{ {
fuse_get_context()->private_data = fs->user_data; fuse_get_context()->private_data = fs->user_data;
@ -2021,7 +1984,7 @@ int fuse_fs_flock(struct fuse_fs *fs, const char *path,
(xop == LOCK_UN ? "LOCK_UN" : "???")), (xop == LOCK_UN ? "LOCK_UN" : "???")),
(op & LOCK_NB) ? "|LOCK_NB" : ""); (op & LOCK_NB) ? "|LOCK_NB" : "");
} }
return fs->op.flock(path, fi, op);
return fs->op.flock(fi, op);
} else { } else {
return -ENOSYS; return -ENOSYS;
} }
@ -2069,26 +2032,16 @@ int fuse_fs_truncate(struct fuse_fs *fs, const char *path, off_t size)
} }
} }
int fuse_fs_ftruncate(struct fuse_fs *fs, const char *path, off_t size,
int fuse_fs_ftruncate(struct fuse_fs *fs, off_t size,
struct fuse_file_info *fi) struct fuse_file_info *fi)
{ {
fuse_get_context()->private_data = fs->user_data; fuse_get_context()->private_data = fs->user_data;
if (fs->op.ftruncate) {
if (fs->debug)
fprintf(stderr, "ftruncate[%llu] %llu\n",
(unsigned long long) fi->fh,
(unsigned long long) size);
if (fs->debug)
fprintf(stderr, "ftruncate[%llu] %llu\n",
(unsigned long long) fi->fh,
(unsigned long long) size);
return fs->op.ftruncate(path, size, fi);
} else if (path && fs->op.truncate) {
if (fs->debug)
fprintf(stderr, "truncate %s %llu\n", path,
(unsigned long long) size);
return fs->op.truncate(path, size);
} else {
return -ENOSYS;
}
return fs->op.ftruncate(size, fi);
} }
int fuse_fs_utimens(struct fuse_fs *fs, const char *path, int fuse_fs_utimens(struct fuse_fs *fs, const char *path,
@ -2262,7 +2215,7 @@ int fuse_fs_removexattr(struct fuse_fs *fs, const char *path, const char *name)
} }
} }
int fuse_fs_ioctl(struct fuse_fs *fs, const char *path, unsigned long cmd, void *arg,
int fuse_fs_ioctl(struct fuse_fs *fs, unsigned long cmd, void *arg,
struct fuse_file_info *fi, unsigned int flags, struct fuse_file_info *fi, unsigned int flags,
void *data, uint32_t *out_size) void *data, uint32_t *out_size)
{ {
@ -2272,12 +2225,12 @@ int fuse_fs_ioctl(struct fuse_fs *fs, const char *path, unsigned long cmd, void
fprintf(stderr, "ioctl[%llu] 0x%lx flags: 0x%x\n", fprintf(stderr, "ioctl[%llu] 0x%lx flags: 0x%x\n",
(unsigned long long) fi->fh, cmd, flags); (unsigned long long) fi->fh, cmd, flags);
return fs->op.ioctl(path, cmd, arg, fi, flags, data, out_size);
return fs->op.ioctl(cmd, arg, fi, flags, data, out_size);
} else } else
return -ENOSYS; return -ENOSYS;
} }
int fuse_fs_poll(struct fuse_fs *fs, const char *path,
int fuse_fs_poll(struct fuse_fs *fs,
struct fuse_file_info *fi, struct fuse_pollhandle *ph, struct fuse_file_info *fi, struct fuse_pollhandle *ph,
unsigned *reventsp) unsigned *reventsp)
{ {
@ -2289,7 +2242,7 @@ int fuse_fs_poll(struct fuse_fs *fs, const char *path,
fprintf(stderr, "poll[%llu] ph: %p\n", fprintf(stderr, "poll[%llu] ph: %p\n",
(unsigned long long) fi->fh, ph); (unsigned long long) fi->fh, ph);
res = fs->op.poll(path, fi, ph, reventsp);
res = fs->op.poll(fi, ph, reventsp);
if (fs->debug && !res) if (fs->debug && !res)
fprintf(stderr, " poll[%llu] revents: 0x%x\n", fprintf(stderr, " poll[%llu] revents: 0x%x\n",
@ -2300,29 +2253,26 @@ int fuse_fs_poll(struct fuse_fs *fs, const char *path,
return -ENOSYS; return -ENOSYS;
} }
int fuse_fs_fallocate(struct fuse_fs *fs, const char *path, int mode,
int fuse_fs_fallocate(struct fuse_fs *fs, int mode,
off_t offset, off_t length, struct fuse_file_info *fi) off_t offset, off_t length, struct fuse_file_info *fi)
{ {
fuse_get_context()->private_data = fs->user_data; fuse_get_context()->private_data = fs->user_data;
if (fs->op.fallocate) { if (fs->op.fallocate) {
if (fs->debug) if (fs->debug)
fprintf(stderr, "fallocate %s mode %x, offset: %llu, length: %llu\n",
path,
fprintf(stderr, "fallocate mode %x, offset: %llu, length: %llu\n",
mode, mode,
(unsigned long long) offset, (unsigned long long) offset,
(unsigned long long) length); (unsigned long long) length);
return fs->op.fallocate(path, mode, offset, length, fi);
return fs->op.fallocate(mode, offset, length, fi);
} else } else
return -ENOSYS; return -ENOSYS;
} }
ssize_t ssize_t
fuse_fs_copy_file_range(struct fuse_fs *fs_, fuse_fs_copy_file_range(struct fuse_fs *fs_,
const char *path_in_,
struct fuse_file_info *ffi_in_, struct fuse_file_info *ffi_in_,
off_t off_in_, off_t off_in_,
const char *path_out_,
struct fuse_file_info *ffi_out_, struct fuse_file_info *ffi_out_,
off_t off_out_, off_t off_out_,
size_t len_, size_t len_,
@ -2333,10 +2283,8 @@ fuse_fs_copy_file_range(struct fuse_fs *fs_,
if(fs_->op.copy_file_range == NULL) if(fs_->op.copy_file_range == NULL)
return -ENOSYS; return -ENOSYS;
return fs_->op.copy_file_range(path_in_,
ffi_in_,
return fs_->op.copy_file_range(ffi_in_,
off_in_, off_in_,
path_out_,
ffi_out_, ffi_out_,
off_out_, off_out_,
len_, len_,
@ -2399,7 +2347,7 @@ lookup_path(struct fuse *f,
memset(e,0,sizeof(struct fuse_entry_param)); memset(e,0,sizeof(struct fuse_entry_param));
if(fi) if(fi)
res = fuse_fs_fgetattr(f->fs,path,&e->attr,fi,&e->timeout);
res = fuse_fs_fgetattr(f->fs,&e->attr,fi,&e->timeout);
else else
res = fuse_fs_getattr(f->fs,path,&e->attr,&e->timeout); res = fuse_fs_getattr(f->fs,path,&e->attr,&e->timeout);
@ -2691,10 +2639,10 @@ fuse_lib_getattr(fuse_req_t req,
memset(&buf, 0, sizeof(buf)); memset(&buf, 0, sizeof(buf));
err = 0;
path = NULL; path = NULL;
err = (((fi == NULL) || (f->fs->op.fgetattr == NULL)) ?
get_path(f,ino,&path) :
get_path_nullok(f,ino,&path));
if((fi == NULL) || (f->fs->op.fgetattr == NULL))
err = get_path(f,ino,&path);
if(!err) if(!err)
{ {
@ -2704,7 +2652,7 @@ fuse_lib_getattr(fuse_req_t req,
err = ((fi == NULL) ? err = ((fi == NULL) ?
fuse_fs_getattr(f->fs,path,&buf,&timeout) : fuse_fs_getattr(f->fs,path,&buf,&timeout) :
fuse_fs_fgetattr(f->fs,path,&buf,fi,&timeout));
fuse_fs_fgetattr(f->fs,&buf,fi,&timeout));
fuse_finish_interrupt(f,req,&d); fuse_finish_interrupt(f,req,&d);
@ -2778,10 +2726,10 @@ fuse_lib_setattr(fuse_req_t req,
memset(&buf,0,sizeof(buf)); memset(&buf,0,sizeof(buf));
err = 0;
path = NULL; path = NULL;
err = ((fi == NULL) ?
get_path(f,ino,&path) :
get_path_nullok(f,ino,&path));
if(fi == NULL)
err = get_path(f,ino,&path);
if(!err) if(!err)
{ {
@ -2808,10 +2756,10 @@ fuse_lib_setattr(fuse_req_t req,
if(!err && (valid & FATTR_SIZE)) if(!err && (valid & FATTR_SIZE))
err = ((fi == NULL) ? err = ((fi == NULL) ?
fuse_fs_truncate(f->fs,path,attr->st_size) : fuse_fs_truncate(f->fs,path,attr->st_size) :
fuse_fs_ftruncate(f->fs,path,attr->st_size,fi));
fuse_fs_ftruncate(f->fs,attr->st_size,fi));
#ifdef HAVE_UTIMENSAT #ifdef HAVE_UTIMENSAT
if(!err && f->utime_omit_ok && (valid & (FATTR_ATIME | FATTR_MTIME)))
if(!err && (valid & (FATTR_ATIME | FATTR_MTIME)))
{ {
struct timespec tv[2]; struct timespec tv[2];
@ -2851,7 +2799,7 @@ fuse_lib_setattr(fuse_req_t req,
if (!err) if (!err)
err = ((fi == NULL) ? err = ((fi == NULL) ?
fuse_fs_getattr(f->fs,path,&buf,&timeout) : fuse_fs_getattr(f->fs,path,&buf,&timeout) :
fuse_fs_fgetattr(f->fs,path,&buf,fi,&timeout));
fuse_fs_fgetattr(f->fs,&buf,fi,&timeout));
fuse_finish_interrupt(f,req,&d); fuse_finish_interrupt(f,req,&d);
free_path(f,ino,path); free_path(f,ino,path);
@ -2935,7 +2883,7 @@ static void fuse_lib_mknod(fuse_req_t req, fuse_ino_t parent, const char *name,
if (!err) { if (!err) {
err = lookup_path(f, parent, name, path, &e, err = lookup_path(f, parent, name, path, &e,
&fi); &fi);
fuse_fs_release(f->fs, path, &fi);
fuse_fs_release(f->fs, &fi);
} }
} }
if (err == -ENOSYS) { if (err == -ENOSYS) {
@ -3123,21 +3071,15 @@ static void fuse_lib_link(fuse_req_t req, fuse_ino_t ino, fuse_ino_t newparent,
reply_entry(req, &e, err); reply_entry(req, &e, err);
} }
static void fuse_do_release(struct fuse *f, fuse_ino_t ino, const char *path,
static void fuse_do_release(struct fuse *f, fuse_ino_t ino,
struct fuse_file_info *fi) struct fuse_file_info *fi)
{ {
struct node *node; struct node *node;
uint64_t fh; uint64_t fh;
int was_hidden; int was_hidden;
const char *compatpath;
fh = 0; fh = 0;
if (path != NULL || f->nullpath_ok || f->conf.nopath)
compatpath = path;
else
compatpath = "-";
fuse_fs_release(f->fs, compatpath, fi);
fuse_fs_release(f->fs, fi);
pthread_mutex_lock(&f->lock); pthread_mutex_lock(&f->lock);
node = get_node(f, ino); node = get_node(f, ino);
@ -3180,12 +3122,12 @@ fuse_lib_create(fuse_req_t req,
err = lookup_path(f, parent, name, path, &e, fi); err = lookup_path(f, parent, name, path, &e, fi);
if(err) if(err)
{ {
fuse_fs_release(f->fs, path, fi);
fuse_fs_release(f->fs, fi);
} }
else if(!S_ISREG(e.attr.st_mode)) else if(!S_ISREG(e.attr.st_mode))
{ {
err = -EIO; err = -EIO;
fuse_fs_release(f->fs, path, fi);
fuse_fs_release(f->fs, fi);
forget_node(f, e.ino, 1); forget_node(f, e.ino, 1);
} }
} }
@ -3201,7 +3143,7 @@ fuse_lib_create(fuse_req_t req,
if (fuse_reply_create(req, &e, fi) == -ENOENT) { if (fuse_reply_create(req, &e, fi) == -ENOENT) {
/* The open syscall was interrupted, so it /* The open syscall was interrupted, so it
must be cancelled */ must be cancelled */
fuse_do_release(f, e.ino, path, fi);
fuse_do_release(f, e.ino, fi);
forget_node(f, e.ino, 1); forget_node(f, e.ino, 1);
} }
} }
@ -3239,7 +3181,7 @@ open_auto_cache(struct fuse *f,
struct stat stbuf; struct stat stbuf;
pthread_mutex_unlock(&f->lock); pthread_mutex_unlock(&f->lock);
err = fuse_fs_fgetattr(f->fs,path,&stbuf,fi,&timeout);
err = fuse_fs_fgetattr(f->fs,&stbuf,fi,&timeout);
pthread_mutex_lock(&f->lock); pthread_mutex_lock(&f->lock);
if(!err) if(!err)
@ -3288,7 +3230,7 @@ fuse_lib_open(fuse_req_t req,
pthread_mutex_unlock(&f->lock); pthread_mutex_unlock(&f->lock);
/* The open syscall was interrupted, so it must be cancelled */ /* The open syscall was interrupted, so it must be cancelled */
if(fuse_reply_open(req, fi) == -ENOENT) if(fuse_reply_open(req, fi) == -ENOENT)
fuse_do_release(f, ino, path, fi);
fuse_do_release(f, ino, fi);
} }
else else
{ {
@ -3303,18 +3245,12 @@ static void fuse_lib_read(fuse_req_t req, fuse_ino_t ino, size_t size,
{ {
struct fuse *f = req_fuse_prepare(req); struct fuse *f = req_fuse_prepare(req);
struct fuse_bufvec *buf = NULL; struct fuse_bufvec *buf = NULL;
char *path;
int res; int res;
struct fuse_intr_data d;
res = get_path_nullok(f, ino, &path);
if (res == 0) {
struct fuse_intr_data d;
fuse_prepare_interrupt(f, req, &d);
res = fuse_fs_read_buf(f->fs, path, &buf, size, off, fi);
fuse_finish_interrupt(f, req, &d);
free_path(f, ino, path);
}
fuse_prepare_interrupt(f, req, &d);
res = fuse_fs_read_buf(f->fs, &buf, size, off, fi);
fuse_finish_interrupt(f, req, &d);
if (res == 0) if (res == 0)
fuse_reply_data(req, buf, FUSE_BUF_SPLICE_MOVE); fuse_reply_data(req, buf, FUSE_BUF_SPLICE_MOVE);
@ -3329,18 +3265,13 @@ static void fuse_lib_write_buf(fuse_req_t req, fuse_ino_t ino,
struct fuse_file_info *fi) struct fuse_file_info *fi)
{ {
struct fuse *f = req_fuse_prepare(req); struct fuse *f = req_fuse_prepare(req);
char *path;
int res; int res;
struct fuse_intr_data d;
res = get_path_nullok(f, ino, &path);
if (res == 0) {
struct fuse_intr_data d;
fuse_prepare_interrupt(f, req, &d);
res = fuse_fs_write_buf(f->fs, path, buf, off, fi);
fuse_finish_interrupt(f, req, &d);
free_path(f, ino, path);
}
fuse_prepare_interrupt(f, req, &d);
res = fuse_fs_write_buf(f->fs, buf, off, fi);
fuse_finish_interrupt(f, req, &d);
free_path(f, ino, NULL);
if (res >= 0) if (res >= 0)
fuse_reply_write(req, res); fuse_reply_write(req, res);
@ -3352,18 +3283,13 @@ static void fuse_lib_fsync(fuse_req_t req, fuse_ino_t ino, int datasync,
struct fuse_file_info *fi) struct fuse_file_info *fi)
{ {
struct fuse *f = req_fuse_prepare(req); struct fuse *f = req_fuse_prepare(req);
char *path;
int err; int err;
struct fuse_intr_data d;
err = get_path_nullok(f, ino, &path);
if (!err) {
struct fuse_intr_data d;
fuse_prepare_interrupt(f, req, &d);
err = fuse_fs_fsync(f->fs, datasync, fi);
fuse_finish_interrupt(f, req, &d);
fuse_prepare_interrupt(f, req, &d);
err = fuse_fs_fsync(f->fs, path, datasync, fi);
fuse_finish_interrupt(f, req, &d);
free_path(f, ino, path);
}
reply_err(req, err); reply_err(req, err);
} }
@ -3414,7 +3340,7 @@ static void fuse_lib_opendir(fuse_req_t req, fuse_ino_t ino,
if (fuse_reply_open(req, llfi) == -ENOENT) { if (fuse_reply_open(req, llfi) == -ENOENT) {
/* The opendir syscall was interrupted, so it /* The opendir syscall was interrupted, so it
must be cancelled */ must be cancelled */
fuse_fs_releasedir(f->fs, path, &fi);
fuse_fs_releasedir(f->fs, &fi);
pthread_mutex_destroy(&dh->lock); pthread_mutex_destroy(&dh->lock);
free(dh); free(dh);
} }
@ -3576,22 +3502,13 @@ fuse_lib_releasedir(fuse_req_t req_,
struct fuse_dh *dh; struct fuse_dh *dh;
struct fuse_intr_data d; struct fuse_intr_data d;
struct fuse_file_info fi; struct fuse_file_info fi;
char *path;
const char *compatpath;
f = req_fuse_prepare(req_); f = req_fuse_prepare(req_);
dh = get_dirhandle(llfi_,&fi); dh = get_dirhandle(llfi_,&fi);
get_path_nullok(f,ino_,&path);
if (path != NULL || f->nullpath_ok || f->conf.nopath)
compatpath = path;
else
compatpath = "-";
fuse_prepare_interrupt(f,req_,&d); fuse_prepare_interrupt(f,req_,&d);
fuse_fs_releasedir(f->fs,compatpath,&fi);
fuse_fs_releasedir(f->fs,&fi);
fuse_finish_interrupt(f,req_,&d); fuse_finish_interrupt(f,req_,&d);
free_path(f,ino_,path);
/* Done to keep race condition between last readdir reply and the unlock */ /* Done to keep race condition between last readdir reply and the unlock */
pthread_mutex_lock(&dh->lock); pthread_mutex_lock(&dh->lock);
@ -3607,19 +3524,15 @@ static void fuse_lib_fsyncdir(fuse_req_t req, fuse_ino_t ino, int datasync,
{ {
struct fuse *f = req_fuse_prepare(req); struct fuse *f = req_fuse_prepare(req);
struct fuse_file_info fi; struct fuse_file_info fi;
char *path;
int err; int err;
struct fuse_intr_data d;
get_dirhandle(llfi, &fi); get_dirhandle(llfi, &fi);
err = get_path_nullok(f, ino, &path);
if (!err) {
struct fuse_intr_data d;
fuse_prepare_interrupt(f, req, &d);
err = fuse_fs_fsyncdir(f->fs, path, datasync, &fi);
fuse_finish_interrupt(f, req, &d);
free_path(f, ino, path);
}
fuse_prepare_interrupt(f, req, &d);
err = fuse_fs_fsyncdir(f->fs, datasync, &fi);
fuse_finish_interrupt(f, req, &d);
reply_err(req, err); reply_err(req, err);
} }
@ -3783,33 +3696,17 @@ fuse_lib_copy_file_range(fuse_req_t req_,
size_t len_, size_t len_,
int flags_) int flags_)
{ {
int err;
ssize_t rv; ssize_t rv;
char *path_in;
char *path_out;
struct fuse *f; struct fuse *f;
struct fuse_intr_data d; struct fuse_intr_data d;
f = req_fuse_prepare(req_); f = req_fuse_prepare(req_);
err = get_path_nullok(f,nodeid_in_,&path_in);
if(err)
return reply_err(req_,err);
err = get_path_nullok(f,nodeid_out_,&path_out);
if(err)
{
free_path(f,nodeid_in_,path_in);
return reply_err(req_,err);
}
fuse_prepare_interrupt(f,req_,&d); fuse_prepare_interrupt(f,req_,&d);
rv = fuse_fs_copy_file_range(f->fs, rv = fuse_fs_copy_file_range(f->fs,
path_in,
ffi_in_, ffi_in_,
off_in_, off_in_,
path_out,
ffi_out_, ffi_out_,
off_out_, off_out_,
len_, len_,
@ -3821,9 +3718,6 @@ fuse_lib_copy_file_range(fuse_req_t req_,
fuse_reply_write(req_,rv); fuse_reply_write(req_,rv);
else else
reply_err(req_,rv); reply_err(req_,rv);
free_path(f,nodeid_in_,path_in);
free_path(f,nodeid_out_,path_out);
} }
static struct lock *locks_conflict(struct node *node, const struct lock *lock) static struct lock *locks_conflict(struct node *node, const struct lock *lock)
@ -3946,7 +3840,7 @@ static void lock_to_flock(struct lock *lock, struct flock *flock)
} }
static int fuse_flush_common(struct fuse *f, fuse_req_t req, fuse_ino_t ino, static int fuse_flush_common(struct fuse *f, fuse_req_t req, fuse_ino_t ino,
const char *path, struct fuse_file_info *fi)
struct fuse_file_info *fi)
{ {
struct fuse_intr_data d; struct fuse_intr_data d;
struct flock lock; struct flock lock;
@ -3958,8 +3852,8 @@ static int fuse_flush_common(struct fuse *f, fuse_req_t req, fuse_ino_t ino,
memset(&lock, 0, sizeof(lock)); memset(&lock, 0, sizeof(lock));
lock.l_type = F_UNLCK; lock.l_type = F_UNLCK;
lock.l_whence = SEEK_SET; lock.l_whence = SEEK_SET;
err = fuse_fs_flush(f->fs, path, fi);
errlock = fuse_fs_lock(f->fs, path, fi, F_SETLK, &lock);
err = fuse_fs_flush(f->fs, fi);
errlock = fuse_fs_lock(f->fs, fi, F_SETLK, &lock);
fuse_finish_interrupt(f, req, &d); fuse_finish_interrupt(f, req, &d);
if (errlock != -ENOSYS) { if (errlock != -ENOSYS) {
@ -3982,20 +3876,17 @@ static void fuse_lib_release(fuse_req_t req, fuse_ino_t ino,
{ {
struct fuse *f = req_fuse_prepare(req); struct fuse *f = req_fuse_prepare(req);
struct fuse_intr_data d; struct fuse_intr_data d;
char *path;
int err = 0; int err = 0;
get_path_nullok(f, ino, &path);
if (fi->flush) { if (fi->flush) {
err = fuse_flush_common(f, req, ino, path, fi);
err = fuse_flush_common(f, req, ino, fi);
if (err == -ENOSYS) if (err == -ENOSYS)
err = 0; err = 0;
} }
fuse_prepare_interrupt(f, req, &d); fuse_prepare_interrupt(f, req, &d);
fuse_do_release(f, ino, path, fi);
fuse_do_release(f, ino, fi);
fuse_finish_interrupt(f, req, &d); fuse_finish_interrupt(f, req, &d);
free_path(f, ino, path);
reply_err(req, err); reply_err(req, err);
} }
@ -4004,12 +3895,9 @@ static void fuse_lib_flush(fuse_req_t req, fuse_ino_t ino,
struct fuse_file_info *fi) struct fuse_file_info *fi)
{ {
struct fuse *f = req_fuse_prepare(req); struct fuse *f = req_fuse_prepare(req);
char *path;
int err; int err;
get_path_nullok(f, ino, &path);
err = fuse_flush_common(f, req, ino, path, fi);
free_path(f, ino, path);
err = fuse_flush_common(f, req, ino, fi);
reply_err(req, err); reply_err(req, err);
} }
@ -4019,17 +3907,13 @@ static int fuse_lock_common(fuse_req_t req, fuse_ino_t ino,
int cmd) int cmd)
{ {
struct fuse *f = req_fuse_prepare(req); struct fuse *f = req_fuse_prepare(req);
char *path;
int err; int err;
struct fuse_intr_data d;
fuse_prepare_interrupt(f, req, &d);
err = fuse_fs_lock(f->fs, fi, cmd, lock);
fuse_finish_interrupt(f, req, &d);
err = get_path_nullok(f, ino, &path);
if (!err) {
struct fuse_intr_data d;
fuse_prepare_interrupt(f, req, &d);
err = fuse_fs_lock(f->fs, path, fi, cmd, lock);
fuse_finish_interrupt(f, req, &d);
free_path(f, ino, path);
}
return err; return err;
} }
@ -4081,17 +3965,13 @@ static void fuse_lib_flock(fuse_req_t req, fuse_ino_t ino,
struct fuse_file_info *fi, int op) struct fuse_file_info *fi, int op)
{ {
struct fuse *f = req_fuse_prepare(req); struct fuse *f = req_fuse_prepare(req);
char *path;
int err; int err;
struct fuse_intr_data d;
fuse_prepare_interrupt(f, req, &d);
err = fuse_fs_flock(f->fs, fi, op);
fuse_finish_interrupt(f, req, &d);
err = get_path_nullok(f, ino, &path);
if (err == 0) {
struct fuse_intr_data d;
fuse_prepare_interrupt(f, req, &d);
err = fuse_fs_flock(f->fs, path, fi, op);
fuse_finish_interrupt(f, req, &d);
free_path(f, ino, path);
}
reply_err(req, err); reply_err(req, err);
} }
@ -4124,7 +4004,7 @@ static void fuse_lib_ioctl(fuse_req_t req, fuse_ino_t ino, unsigned long cmd, vo
struct fuse *f = req_fuse_prepare(req); struct fuse *f = req_fuse_prepare(req);
struct fuse_intr_data d; struct fuse_intr_data d;
struct fuse_file_info fi; struct fuse_file_info fi;
char *path, *out_buf = NULL;
char *out_buf = NULL;
int err; int err;
uint32_t out_bufsz = out_bufsz_; uint32_t out_bufsz = out_bufsz_;
@ -4148,17 +4028,12 @@ static void fuse_lib_ioctl(fuse_req_t req, fuse_ino_t ino, unsigned long cmd, vo
if (out_buf) if (out_buf)
memcpy(out_buf, in_buf, in_bufsz); memcpy(out_buf, in_buf, in_bufsz);
err = get_path_nullok(f, ino, &path);
if (err)
goto err;
fuse_prepare_interrupt(f, req, &d); fuse_prepare_interrupt(f, req, &d);
err = fuse_fs_ioctl(f->fs, path, cmd, arg, &fi, flags,
err = fuse_fs_ioctl(f->fs, cmd, arg, &fi, flags,
out_buf ?: (void *)in_buf, &out_bufsz); out_buf ?: (void *)in_buf, &out_bufsz);
fuse_finish_interrupt(f, req, &d); fuse_finish_interrupt(f, req, &d);
free_path(f, ino, path);
fuse_reply_ioctl(req, err, out_buf, out_bufsz); fuse_reply_ioctl(req, err, out_buf, out_bufsz);
goto out; goto out;
@ -4173,17 +4048,13 @@ static void fuse_lib_poll(fuse_req_t req, fuse_ino_t ino,
{ {
struct fuse *f = req_fuse_prepare(req); struct fuse *f = req_fuse_prepare(req);
struct fuse_intr_data d; struct fuse_intr_data d;
char *path;
int err; int err;
unsigned revents = 0; unsigned revents = 0;
err = get_path_nullok(f, ino, &path);
if (!err) {
fuse_prepare_interrupt(f, req, &d);
err = fuse_fs_poll(f->fs, path, fi, ph, &revents);
fuse_finish_interrupt(f, req, &d);
free_path(f, ino, path);
}
fuse_prepare_interrupt(f, req, &d);
err = fuse_fs_poll(f->fs, fi, ph, &revents);
fuse_finish_interrupt(f, req, &d);
if (!err) if (!err)
fuse_reply_poll(req, revents); fuse_reply_poll(req, revents);
else else
@ -4195,16 +4066,12 @@ static void fuse_lib_fallocate(fuse_req_t req, fuse_ino_t ino, int mode,
{ {
struct fuse *f = req_fuse_prepare(req); struct fuse *f = req_fuse_prepare(req);
struct fuse_intr_data d; struct fuse_intr_data d;
char *path;
int err; int err;
err = get_path_nullok(f, ino, &path);
if (!err) {
fuse_prepare_interrupt(f, req, &d);
err = fuse_fs_fallocate(f->fs, path, mode, offset, length, fi);
fuse_finish_interrupt(f, req, &d);
free_path(f, ino, path);
}
fuse_prepare_interrupt(f, req, &d);
err = fuse_fs_fallocate(f->fs, mode, offset, length, fi);
fuse_finish_interrupt(f, req, &d);
reply_err(req, err); reply_err(req, err);
} }
@ -4509,7 +4376,6 @@ static const struct fuse_opt fuse_lib_opts[] = {
FUSE_LIB_OPT("gid=%d", gid, 0), FUSE_LIB_OPT("gid=%d", gid, 0),
FUSE_LIB_OPT("noforget", remember, -1), FUSE_LIB_OPT("noforget", remember, -1),
FUSE_LIB_OPT("remember=%u", remember, 0), FUSE_LIB_OPT("remember=%u", remember, 0),
FUSE_LIB_OPT("nopath", nopath, 1),
FUSE_LIB_OPT("intr", intr, 1), FUSE_LIB_OPT("intr", intr, 1),
FUSE_LIB_OPT("intr_signal=%d", intr_signal, 0), FUSE_LIB_OPT("intr_signal=%d", intr_signal, 0),
FUSE_LIB_OPT("threads=%d", threads, 0), FUSE_LIB_OPT("threads=%d", threads, 0),
@ -4525,7 +4391,6 @@ static void fuse_lib_help(void)
" -o gid=N set file group\n" " -o gid=N set file group\n"
" -o noforget never forget cached inodes\n" " -o noforget never forget cached inodes\n"
" -o remember=T remember cached inodes for T seconds (0s)\n" " -o remember=T remember cached inodes for T seconds (0s)\n"
" -o nopath don't supply path if not necessary\n"
" -o intr allow requests to be interrupted\n" " -o intr allow requests to be interrupted\n"
" -o intr_signal=NUM signal to send on interrupt (%i)\n" " -o intr_signal=NUM signal to send on interrupt (%i)\n"
" -o threads=NUM number of worker threads. 0 = autodetect.\n" " -o threads=NUM number of worker threads. 0 = autodetect.\n"
@ -4679,9 +4544,6 @@ struct fuse *fuse_new_common(struct fuse_chan *ch, struct fuse_args *args,
fs->compat = compat; fs->compat = compat;
f->fs = fs; f->fs = fs;
f->nullpath_ok = fs->op.flag_nullpath_ok;
f->conf.nopath = fs->op.flag_nopath;
f->utime_omit_ok = fs->op.flag_utime_omit_ok;
/* Oh f**k, this is ugly! */ /* Oh f**k, this is ugly! */
if (!fs->op.lock) { if (!fs->op.lock) {
@ -4712,12 +4574,6 @@ struct fuse *fuse_new_common(struct fuse_chan *ch, struct fuse_args *args,
fuse_session_add_chan(f->se, ch); fuse_session_add_chan(f->se, ch);
if (f->conf.debug) {
fprintf(stderr, "nullpath_ok: %i\n", f->nullpath_ok);
fprintf(stderr, "nopath: %i\n", f->conf.nopath);
fprintf(stderr, "utime_omit_ok: %i\n", f->utime_omit_ok);
}
/* Trace topmost layer by default */ /* Trace topmost layer by default */
srand(time(NULL)); srand(time(NULL));
f->fs->debug = f->conf.debug; f->fs->debug = f->conf.debug;

4
src/fuse_copy_file_range.cpp

@ -49,10 +49,8 @@ namespace l
namespace FUSE namespace FUSE
{ {
ssize_t ssize_t
copy_file_range(const char *path_in_,
struct fuse_file_info *ffi_in_,
copy_file_range(struct fuse_file_info *ffi_in_,
off_t offset_in_, off_t offset_in_,
const char *path_out_,
struct fuse_file_info *ffi_out_, struct fuse_file_info *ffi_out_,
off_t offset_out_, off_t offset_out_,
size_t size_, size_t size_,

4
src/fuse_copy_file_range.hpp

@ -19,10 +19,8 @@
namespace FUSE namespace FUSE
{ {
ssize_t ssize_t
copy_file_range(const char *path_in,
struct fuse_file_info *ffi_in,
copy_file_range(struct fuse_file_info *ffi_in,
off_t offset_in, off_t offset_in,
const char *path_out,
struct fuse_file_info *ffi_out, struct fuse_file_info *ffi_out,
off_t offset_out, off_t offset_out,
size_t size, size_t size,

3
src/fuse_fallocate.cpp

@ -40,8 +40,7 @@ namespace l
namespace FUSE namespace FUSE
{ {
int int
fallocate(const char *fusepath_,
int mode_,
fallocate(int mode_,
off_t offset_, off_t offset_,
off_t len_, off_t len_,
fuse_file_info *ffi_) fuse_file_info *ffi_)

3
src/fuse_fallocate.hpp

@ -19,8 +19,7 @@
namespace FUSE namespace FUSE
{ {
int int
fallocate(const char *fusepath_,
int mode_,
fallocate(int mode_,
off_t offset_, off_t offset_,
off_t len_, off_t len_,
fuse_file_info *ffi_); fuse_file_info *ffi_);

3
src/fuse_fgetattr.cpp

@ -45,8 +45,7 @@ namespace l
namespace FUSE namespace FUSE
{ {
int int
fgetattr(const char *fusepath_,
struct stat *st_,
fgetattr(struct stat *st_,
fuse_file_info *ffi_, fuse_file_info *ffi_,
fuse_timeouts_t *timeout_) fuse_timeouts_t *timeout_)
{ {

3
src/fuse_fgetattr.hpp

@ -25,8 +25,7 @@
namespace FUSE namespace FUSE
{ {
int int
fgetattr(const char *fusepath,
struct stat *st,
fgetattr(struct stat *st,
fuse_file_info *ffi, fuse_file_info *ffi,
fuse_timeouts_t *timeout); fuse_timeouts_t *timeout);
} }

3
src/fuse_flush.cpp

@ -42,8 +42,7 @@ namespace l
namespace FUSE namespace FUSE
{ {
int int
flush(const char *fusepath_,
fuse_file_info *ffi_)
flush(fuse_file_info *ffi_)
{ {
FileInfo *fi = reinterpret_cast<FileInfo*>(ffi_->fh); FileInfo *fi = reinterpret_cast<FileInfo*>(ffi_->fh);

3
src/fuse_flush.hpp

@ -21,6 +21,5 @@
namespace FUSE namespace FUSE
{ {
int int
flush(const char *path_,
fuse_file_info *ffi_);
flush(fuse_file_info *ffi_);
} }

3
src/fuse_fsync.cpp

@ -43,8 +43,7 @@ namespace l
namespace FUSE namespace FUSE
{ {
int int
fsync(const char *fusepath_,
int isdatasync_,
fsync(int isdatasync_,
fuse_file_info *ffi_) fuse_file_info *ffi_)
{ {
FileInfo *fi = reinterpret_cast<FileInfo*>(ffi_->fh); FileInfo *fi = reinterpret_cast<FileInfo*>(ffi_->fh);

3
src/fuse_fsync.hpp

@ -21,7 +21,6 @@
namespace FUSE namespace FUSE
{ {
int int
fsync(const char *fusepath_,
int isdatasync_,
fsync(int isdatasync_,
fuse_file_info *ffi_); fuse_file_info *ffi_);
} }

3
src/fuse_fsyncdir.cpp

@ -42,8 +42,7 @@ namespace l
namespace FUSE namespace FUSE
{ {
int int
fsyncdir(const char *fusepath_,
int isdatasync_,
fsyncdir(int isdatasync_,
fuse_file_info *ffi_) fuse_file_info *ffi_)
{ {
DirInfo *di = reinterpret_cast<DirInfo*>(ffi_->fh); DirInfo *di = reinterpret_cast<DirInfo*>(ffi_->fh);

3
src/fuse_fsyncdir.hpp

@ -21,7 +21,6 @@
namespace FUSE namespace FUSE
{ {
int int
fsyncdir(const char *fusepath_,
int isdatasync_,
fsyncdir(int isdatasync_,
fuse_file_info *ffi_); fuse_file_info *ffi_);
} }

3
src/fuse_ftruncate.cpp

@ -38,8 +38,7 @@ namespace l
namespace FUSE namespace FUSE
{ {
int int
ftruncate(const char *fusepath_,
off_t size_,
ftruncate(off_t size_,
fuse_file_info *ffi_) fuse_file_info *ffi_)
{ {
FileInfo *fi = reinterpret_cast<FileInfo*>(ffi_->fh); FileInfo *fi = reinterpret_cast<FileInfo*>(ffi_->fh);

3
src/fuse_ftruncate.hpp

@ -24,7 +24,6 @@
namespace FUSE namespace FUSE
{ {
int int
ftruncate(const char *fusepath_,
off_t size_,
ftruncate(off_t size_,
fuse_file_info *ffi_); fuse_file_info *ffi_);
} }

3
src/fuse_ioctl.cpp

@ -374,8 +374,7 @@ namespace l
namespace FUSE namespace FUSE
{ {
int int
ioctl(const char *fusepath_,
unsigned long cmd_,
ioctl(unsigned long cmd_,
void *arg_, void *arg_,
fuse_file_info *ffi_, fuse_file_info *ffi_,
unsigned int flags_, unsigned int flags_,

3
src/fuse_ioctl.hpp

@ -21,8 +21,7 @@
namespace FUSE namespace FUSE
{ {
int int
ioctl(const char *fusepath_,
unsigned long cmd_,
ioctl(unsigned long cmd_,
void *arg_, void *arg_,
fuse_file_info *ffi_, fuse_file_info *ffi_,
unsigned int flags_, unsigned int flags_,

6
src/fuse_read.cpp

@ -62,8 +62,7 @@ namespace l
namespace FUSE namespace FUSE
{ {
int int
read(const char *fusepath_,
char *buf_,
read(char *buf_,
size_t count_, size_t count_,
off_t offset_, off_t offset_,
fuse_file_info *ffi_) fuse_file_info *ffi_)
@ -78,8 +77,7 @@ namespace FUSE
} }
int int
read_null(const char *fusepath_,
char *buf_,
read_null(char *buf_,
size_t count_, size_t count_,
off_t offset_, off_t offset_,
fuse_file_info *ffi_) fuse_file_info *ffi_)

6
src/fuse_read.hpp

@ -21,15 +21,13 @@
namespace FUSE namespace FUSE
{ {
int int
read(const char *fusepath_,
char *buf_,
read(char *buf_,
size_t count_, size_t count_,
off_t offset_, off_t offset_,
fuse_file_info *ffi_); fuse_file_info *ffi_);
int int
read_null(const char *fusepath_,
char *buf_,
read_null(char *buf_,
size_t count_, size_t count_,
off_t offset_, off_t offset_,
fuse_file_info *ffi_); fuse_file_info *ffi_);

3
src/fuse_read_buf.cpp

@ -54,8 +54,7 @@ namespace l
namespace FUSE namespace FUSE
{ {
int int
read_buf(const char *fusepath_,
fuse_bufvec **bufp_,
read_buf(fuse_bufvec **bufp_,
size_t size_, size_t size_,
off_t offset_, off_t offset_,
fuse_file_info *ffi_) fuse_file_info *ffi_)

3
src/fuse_read_buf.hpp

@ -23,8 +23,7 @@
namespace FUSE namespace FUSE
{ {
int int
read_buf(const char *fusepath_,
struct fuse_bufvec **buf_,
read_buf(struct fuse_bufvec **buf_,
size_t size_, size_t size_,
off_t offset_, off_t offset_,
fuse_file_info *ffi_); fuse_file_info *ffi_);

3
src/fuse_release.cpp

@ -50,8 +50,7 @@ namespace l
namespace FUSE namespace FUSE
{ {
int int
release(const char *fusepath_,
fuse_file_info *ffi_)
release(fuse_file_info *ffi_)
{ {
const Config &config = Config::ro(); const Config &config = Config::ro();
FileInfo *fi = reinterpret_cast<FileInfo*>(ffi_->fh); FileInfo *fi = reinterpret_cast<FileInfo*>(ffi_->fh);

3
src/fuse_release.hpp

@ -21,6 +21,5 @@
namespace FUSE namespace FUSE
{ {
int int
release(const char *fusepath_,
fuse_file_info *ffi_);
release(fuse_file_info *ffi_);
} }

3
src/fuse_releasedir.cpp

@ -34,8 +34,7 @@ namespace l
namespace FUSE namespace FUSE
{ {
int int
releasedir(const char *fusepath_,
fuse_file_info *ffi_)
releasedir(fuse_file_info *ffi_)
{ {
DirInfo *di = reinterpret_cast<DirInfo*>(ffi_->fh); DirInfo *di = reinterpret_cast<DirInfo*>(ffi_->fh);

3
src/fuse_releasedir.hpp

@ -21,6 +21,5 @@
namespace FUSE namespace FUSE
{ {
int int
releasedir(const char *fusepath_,
fuse_file_info *ffi_);
releasedir(fuse_file_info *ffi_);
} }

6
src/fuse_write.cpp

@ -115,8 +115,7 @@ namespace l
namespace FUSE namespace FUSE
{ {
int int
write(const char *fusepath_,
const char *buf_,
write(const char *buf_,
size_t count_, size_t count_,
off_t offset_, off_t offset_,
fuse_file_info *ffi_) fuse_file_info *ffi_)
@ -131,8 +130,7 @@ namespace FUSE
} }
int int
write_null(const char *fusepath_,
const char *buf_,
write_null(const char *buf_,
size_t count_, size_t count_,
off_t offset_, off_t offset_,
fuse_file_info *ffi_) fuse_file_info *ffi_)

6
src/fuse_write.hpp

@ -21,15 +21,13 @@
namespace FUSE namespace FUSE
{ {
int int
write(const char *fusepath_,
const char *buf_,
write(const char *buf_,
size_t count_, size_t count_,
off_t offset_, off_t offset_,
fuse_file_info *ffi_); fuse_file_info *ffi_);
int int
write_null(const char *fusepath_,
const char *buf_,
write_null(const char *buf_,
size_t count_, size_t count_,
off_t offset_, off_t offset_,
fuse_file_info *ffi_); fuse_file_info *ffi_);

6
src/fuse_write_buf.cpp

@ -87,8 +87,7 @@ namespace l
namespace FUSE namespace FUSE
{ {
int int
write_buf(const char *fusepath_,
fuse_bufvec *src_,
write_buf(fuse_bufvec *src_,
off_t offset_, off_t offset_,
fuse_file_info *ffi_) fuse_file_info *ffi_)
{ {
@ -103,8 +102,7 @@ namespace FUSE
} }
int int
write_buf_null(const char *fusepath_,
fuse_bufvec *src_,
write_buf_null(fuse_bufvec *src_,
off_t offset_, off_t offset_,
fuse_file_info *ffi_) fuse_file_info *ffi_)
{ {

6
src/fuse_write_buf.hpp

@ -23,14 +23,12 @@
namespace FUSE namespace FUSE
{ {
int int
write_buf(const char *fusepath_,
struct fuse_bufvec *buf_,
write_buf(struct fuse_bufvec *buf_,
off_t offset_, off_t offset_,
fuse_file_info *ffi_); fuse_file_info *ffi_);
int int
write_buf_null(const char *fusepath_,
struct fuse_bufvec *buf_,
write_buf_null(struct fuse_bufvec *buf_,
off_t offset_, off_t offset_,
fuse_file_info *ffi_); fuse_file_info *ffi_);
} }

4
src/mergerfs.cpp

@ -80,10 +80,6 @@ namespace l
get_fuse_operations(struct fuse_operations &ops, get_fuse_operations(struct fuse_operations &ops,
const bool nullrw) const bool nullrw)
{ {
ops.flag_nullpath_ok = true;
ops.flag_nopath = true;
ops.flag_utime_omit_ok = true;
ops.access = FUSE::access; ops.access = FUSE::access;
ops.bmap = NULL; ops.bmap = NULL;
ops.chmod = FUSE::chmod; ops.chmod = FUSE::chmod;

Loading…
Cancel
Save