From c0990644e89e15e0d9fcbdfcd9a982e924f882a9 Mon Sep 17 00:00:00 2001 From: Antonio SJ Musumeci Date: Wed, 8 Jul 2020 19:25:23 -0400 Subject: [PATCH] remove unnecessary libfuse flags nopath, nullpath_ok, and utime_omit_ok --- libfuse/include/fuse.h | 108 +++------- libfuse/lib/fuse.c | 372 +++++++++++------------------------ src/fuse_copy_file_range.cpp | 4 +- src/fuse_copy_file_range.hpp | 4 +- src/fuse_fallocate.cpp | 3 +- src/fuse_fallocate.hpp | 3 +- src/fuse_fgetattr.cpp | 3 +- src/fuse_fgetattr.hpp | 3 +- src/fuse_flush.cpp | 3 +- src/fuse_flush.hpp | 3 +- src/fuse_fsync.cpp | 3 +- src/fuse_fsync.hpp | 3 +- src/fuse_fsyncdir.cpp | 3 +- src/fuse_fsyncdir.hpp | 3 +- src/fuse_ftruncate.cpp | 3 +- src/fuse_ftruncate.hpp | 3 +- src/fuse_ioctl.cpp | 3 +- src/fuse_ioctl.hpp | 3 +- src/fuse_read.cpp | 6 +- src/fuse_read.hpp | 6 +- src/fuse_read_buf.cpp | 3 +- src/fuse_read_buf.hpp | 3 +- src/fuse_release.cpp | 3 +- src/fuse_release.hpp | 3 +- src/fuse_releasedir.cpp | 3 +- src/fuse_releasedir.hpp | 3 +- src/fuse_write.cpp | 6 +- src/fuse_write.hpp | 6 +- src/fuse_write_buf.cpp | 6 +- src/fuse_write_buf.hpp | 6 +- src/mergerfs.cpp | 4 - 31 files changed, 180 insertions(+), 408 deletions(-) diff --git a/libfuse/include/fuse.h b/libfuse/include/fuse.h index 430bd9eb0..0717fe0df 100644 --- a/libfuse/include/fuse.h +++ b/libfuse/include/fuse.h @@ -176,7 +176,7 @@ struct fuse_operations { * * 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 *); /** Write data to an open file @@ -187,7 +187,7 @@ struct fuse_operations { * * 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 *); /** Get file system statistics @@ -222,7 +222,7 @@ struct fuse_operations { * * Changed in version 2.2 */ - int (*flush) (const char *, struct fuse_file_info *); + int (*flush) (struct fuse_file_info *); /** Release an open file * @@ -238,7 +238,7 @@ struct fuse_operations { * * Changed in version 2.2 */ - int (*release) (const char *, struct fuse_file_info *); + int (*release) (struct fuse_file_info *); /** Synchronize file contents * @@ -247,7 +247,7 @@ struct fuse_operations { * * Changed in version 2.2 */ - int (*fsync) (const char *, int, struct fuse_file_info *); + int (*fsync) (int, struct fuse_file_info *); /** Set extended attributes */ int (*setxattr) (const char *, const char *, const char *, size_t, int); @@ -305,7 +305,7 @@ struct fuse_operations { * * Introduced in version 2.3 */ - int (*releasedir) (const char *, struct fuse_file_info *); + int (*releasedir) (struct fuse_file_info *); /** Synchronize directory contents * @@ -314,7 +314,7 @@ struct fuse_operations { * * Introduced in version 2.3 */ - int (*fsyncdir) (const char *, int, struct fuse_file_info *); + int (*fsyncdir) (int, struct fuse_file_info *); /** * Initialize filesystem @@ -376,7 +376,7 @@ struct fuse_operations { * * 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 @@ -390,7 +390,7 @@ struct fuse_operations { * * 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 @@ -424,7 +424,7 @@ struct fuse_operations { * * 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 *); /** @@ -451,43 +451,6 @@ struct fuse_operations { */ 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 * @@ -503,8 +466,7 @@ struct fuse_operations { * * Introduced in version 2.8 */ - int (*ioctl) (const char *fusepath, - unsigned long cmd, + int (*ioctl) (unsigned long cmd, void *arg, struct fuse_file_info *ffi, unsigned int flags, @@ -528,7 +490,7 @@ struct fuse_operations { * * 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); /** Write contents of buffer to an open file @@ -539,7 +501,7 @@ struct fuse_operations { * * 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 *); /** Store data from an open file in a buffer @@ -558,7 +520,7 @@ struct fuse_operations { * * 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 *); /** * Perform BSD file locking operation @@ -580,7 +542,7 @@ struct fuse_operations { * * 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 @@ -592,8 +554,7 @@ struct fuse_operations { * * 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 @@ -610,10 +571,8 @@ struct fuse_operations { * data from the source and writing to the destination. Effectively * 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, - const char *path_out, struct fuse_file_info *fi_out, off_t offset_out, size_t size, @@ -859,7 +818,6 @@ int fuse_fs_getattr(struct fuse_fs *fs, fuse_timeouts_t *timeout); int fuse_fs_fgetattr(struct fuse_fs *fs, - const char *path, struct stat *buf, struct fuse_file_info *fi, 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, const char *path); 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); int fuse_fs_open(struct fuse_fs *fs, const char *path, 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); -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_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); -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_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); -int fuse_fs_flush(struct fuse_fs *fs, const char *path, +int fuse_fs_flush(struct fuse_fs *fs, struct fuse_file_info *fi); 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, @@ -895,20 +853,20 @@ int fuse_fs_opendir(struct fuse_fs *fs, const char *path, int fuse_fs_readdir(struct fuse_fs *fs, struct fuse_file_info *fi, 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); -int fuse_fs_releasedir(struct fuse_fs *fs, const char *path, +int fuse_fs_releasedir(struct fuse_fs *fs, struct fuse_file_info *fi); int fuse_fs_create(struct fuse_fs *fs, const char *path, mode_t mode, 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); -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); 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_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); int fuse_fs_utimens(struct fuse_fs *fs, const char *path, const struct timespec tv[2]); @@ -928,13 +886,13 @@ int fuse_fs_removexattr(struct fuse_fs *fs, const char *path, const char *name); int fuse_fs_bmap(struct fuse_fs *fs, const char *path, size_t blocksize, 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, 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, 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); void fuse_fs_init(struct fuse_fs *fs, struct fuse_conn_info *conn); 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_free_hide(struct fuse_fs *fs, uint64_t fh); 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, - const char *path_out, struct fuse_file_info *fi_out, off_t off_out, size_t len, int flags); diff --git a/libfuse/lib/fuse.c b/libfuse/lib/fuse.c index 600b55dc5..e3453ff57 100644 --- a/libfuse/lib/fuse.c +++ b/libfuse/lib/fuse.c @@ -59,7 +59,6 @@ struct fuse_config { unsigned int gid; unsigned int umask; int remember; - int nopath; int debug; int use_ino; int set_mode; @@ -133,8 +132,6 @@ struct fuse struct fuse_config conf; int intr_installed; struct fuse_fs *fs; - int nullpath_ok; - int utime_omit_ok; struct lock_queue_element *lockq; int pagesize; 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); } -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, char **path) { @@ -1398,14 +1373,14 @@ static int fuse_compat_open(struct fuse_fs *fs, const char *path, 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) { if (!fs->compat || fs->compat >= 22) - return fs->op.release(path, fi); + return fs->op.release(fi); else 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, @@ -1480,10 +1455,10 @@ static inline int fuse_compat_open(struct fuse_fs *fs, char *path, 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) { - return fs->op.release(path, fi); + return fs->op.release(fi); } 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 fuse_fs_fgetattr(struct fuse_fs *fs, - const char *path, struct stat *buf, struct fuse_file_info *fi, 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 @@ -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) { 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" : "", (unsigned long long) fi->fh, fi->flags); - return fuse_compat_release(fs, path, fi); + return fuse_compat_release(fs, fi); } else { 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_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); 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 { struct fuse_bufvec *buf; void *mem; @@ -1741,7 +1704,7 @@ int fuse_fs_read_buf(struct fuse_fs *fs, const char *path, buf->buf[0].mem = mem; *bufp = buf; - res = fs->op.read(path, mem, size, off, fi); + res = fs->op.read(mem, size, off, fi); if (res >= 0) 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) { int res; 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) { 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; } -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_file_info *fi) { @@ -1801,7 +1764,7 @@ int fuse_fs_write_buf(struct fuse_fs *fs, const char *path, fi->flags); if (fs->op.write_buf) { - res = fs->op.write_buf(path, buf, off, fi); + res = fs->op.write_buf(buf, off, fi); } else { void *mem = NULL; struct fuse_buf *flatbuf; @@ -1825,7 +1788,7 @@ int fuse_fs_write_buf(struct fuse_fs *fs, const char *path, flatbuf = &tmp.buf[0]; } - res = fs->op.write(path, flatbuf->mem, flatbuf->size, + res = fs->op.write(flatbuf->mem, flatbuf->size, off, fi); out_free: free(mem); @@ -1845,17 +1808,17 @@ int fuse_fs_write_buf(struct fuse_fs *fs, const char *path, } } -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) { struct fuse_bufvec bufv = FUSE_BUFVEC_INIT(size); 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) { 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", (unsigned long long) fi->fh, datasync); - return fs->op.fsync(path, datasync, fi); + return fs->op.fsync(datasync, fi); } else { 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) { 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", (unsigned long long) fi->fh, datasync); - return fs->op.fsyncdir(path, datasync, fi); + return fs->op.fsyncdir(datasync, fi); } else { 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) { 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", (unsigned long long) fi->fh); - return fs->op.flush(path, fi); + return fs->op.flush(fi); } else { 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) { 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", (unsigned long long) fi->fh, fi->flags); - return fs->op.releasedir(path, fi); + return fs->op.releasedir(fi); } else { 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) { 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_pid); - return fs->op.lock(path, fi, cmd, lock); + return fs->op.lock(fi, cmd, lock); } else { 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) { 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" : "???")), (op & LOCK_NB) ? "|LOCK_NB" : ""); } - return fs->op.flock(path, fi, op); + return fs->op.flock(fi, op); } else { 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) { 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, @@ -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, 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", (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 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, unsigned *reventsp) { @@ -2289,7 +2242,7 @@ int fuse_fs_poll(struct fuse_fs *fs, const char *path, fprintf(stderr, "poll[%llu] ph: %p\n", (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) 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; } -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) { fuse_get_context()->private_data = fs->user_data; if (fs->op.fallocate) { 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, (unsigned long long) offset, (unsigned long long) length); - return fs->op.fallocate(path, mode, offset, length, fi); + return fs->op.fallocate(mode, offset, length, fi); } else return -ENOSYS; } ssize_t fuse_fs_copy_file_range(struct fuse_fs *fs_, - const char *path_in_, struct fuse_file_info *ffi_in_, off_t off_in_, - const char *path_out_, struct fuse_file_info *ffi_out_, off_t off_out_, size_t len_, @@ -2333,10 +2283,8 @@ fuse_fs_copy_file_range(struct fuse_fs *fs_, if(fs_->op.copy_file_range == NULL) return -ENOSYS; - return fs_->op.copy_file_range(path_in_, - ffi_in_, + return fs_->op.copy_file_range(ffi_in_, off_in_, - path_out_, ffi_out_, off_out_, len_, @@ -2399,7 +2347,7 @@ lookup_path(struct fuse *f, memset(e,0,sizeof(struct fuse_entry_param)); 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 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)); + err = 0; 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) { @@ -2704,7 +2652,7 @@ fuse_lib_getattr(fuse_req_t req, err = ((fi == NULL) ? 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); @@ -2778,10 +2726,10 @@ fuse_lib_setattr(fuse_req_t req, memset(&buf,0,sizeof(buf)); + err = 0; 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) { @@ -2808,10 +2756,10 @@ fuse_lib_setattr(fuse_req_t req, if(!err && (valid & FATTR_SIZE)) err = ((fi == NULL) ? 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 - if(!err && f->utime_omit_ok && (valid & (FATTR_ATIME | FATTR_MTIME))) + if(!err && (valid & (FATTR_ATIME | FATTR_MTIME))) { struct timespec tv[2]; @@ -2851,7 +2799,7 @@ fuse_lib_setattr(fuse_req_t req, if (!err) err = ((fi == NULL) ? 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); 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) { err = lookup_path(f, parent, name, path, &e, &fi); - fuse_fs_release(f->fs, path, &fi); + fuse_fs_release(f->fs, &fi); } } 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); } -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 node *node; uint64_t fh; int was_hidden; - const char *compatpath; 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); 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); if(err) { - fuse_fs_release(f->fs, path, fi); + fuse_fs_release(f->fs, fi); } else if(!S_ISREG(e.attr.st_mode)) { err = -EIO; - fuse_fs_release(f->fs, path, fi); + fuse_fs_release(f->fs, fi); 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) { /* The open syscall was interrupted, so it must be cancelled */ - fuse_do_release(f, e.ino, path, fi); + fuse_do_release(f, e.ino, fi); forget_node(f, e.ino, 1); } } @@ -3239,7 +3181,7 @@ open_auto_cache(struct fuse *f, struct stat stbuf; 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); if(!err) @@ -3288,7 +3230,7 @@ fuse_lib_open(fuse_req_t req, pthread_mutex_unlock(&f->lock); /* The open syscall was interrupted, so it must be cancelled */ if(fuse_reply_open(req, fi) == -ENOENT) - fuse_do_release(f, ino, path, fi); + fuse_do_release(f, ino, fi); } 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_bufvec *buf = NULL; - char *path; 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) 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 *f = req_fuse_prepare(req); - char *path; 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) 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 *f = req_fuse_prepare(req); - char *path; 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); } @@ -3414,7 +3340,7 @@ static void fuse_lib_opendir(fuse_req_t req, fuse_ino_t ino, if (fuse_reply_open(req, llfi) == -ENOENT) { /* The opendir syscall was interrupted, so it must be cancelled */ - fuse_fs_releasedir(f->fs, path, &fi); + fuse_fs_releasedir(f->fs, &fi); pthread_mutex_destroy(&dh->lock); free(dh); } @@ -3576,22 +3502,13 @@ fuse_lib_releasedir(fuse_req_t req_, struct fuse_dh *dh; struct fuse_intr_data d; struct fuse_file_info fi; - char *path; - const char *compatpath; f = req_fuse_prepare(req_); 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_fs_releasedir(f->fs,compatpath,&fi); + fuse_fs_releasedir(f->fs,&fi); fuse_finish_interrupt(f,req_,&d); - free_path(f,ino_,path); /* Done to keep race condition between last readdir reply and the unlock */ 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_file_info fi; - char *path; int err; + struct fuse_intr_data d; 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); } @@ -3783,33 +3696,17 @@ fuse_lib_copy_file_range(fuse_req_t req_, size_t len_, int flags_) { - int err; ssize_t rv; - char *path_in; - char *path_out; struct fuse *f; struct fuse_intr_data d; 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); rv = fuse_fs_copy_file_range(f->fs, - path_in, ffi_in_, off_in_, - path_out, ffi_out_, off_out_, len_, @@ -3821,9 +3718,6 @@ fuse_lib_copy_file_range(fuse_req_t req_, fuse_reply_write(req_,rv); else 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) @@ -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, - const char *path, struct fuse_file_info *fi) + struct fuse_file_info *fi) { struct fuse_intr_data d; 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)); lock.l_type = F_UNLCK; 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); 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_intr_data d; - char *path; int err = 0; - get_path_nullok(f, ino, &path); if (fi->flush) { - err = fuse_flush_common(f, req, ino, path, fi); + err = fuse_flush_common(f, req, ino, fi); if (err == -ENOSYS) err = 0; } 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); - free_path(f, ino, path); 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 *f = req_fuse_prepare(req); - char *path; 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); } @@ -4019,17 +3907,13 @@ static int fuse_lock_common(fuse_req_t req, fuse_ino_t ino, int cmd) { struct fuse *f = req_fuse_prepare(req); - char *path; 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; } @@ -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 *f = req_fuse_prepare(req); - char *path; 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); } @@ -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_intr_data d; struct fuse_file_info fi; - char *path, *out_buf = NULL; + char *out_buf = NULL; int err; 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) memcpy(out_buf, in_buf, in_bufsz); - err = get_path_nullok(f, ino, &path); - if (err) - goto err; - 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); fuse_finish_interrupt(f, req, &d); - free_path(f, ino, path); fuse_reply_ioctl(req, err, out_buf, out_bufsz); 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_intr_data d; - char *path; int err; 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) fuse_reply_poll(req, revents); 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_intr_data d; - char *path; 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); } @@ -4509,7 +4376,6 @@ static const struct fuse_opt fuse_lib_opts[] = { FUSE_LIB_OPT("gid=%d", gid, 0), FUSE_LIB_OPT("noforget", remember, -1), FUSE_LIB_OPT("remember=%u", remember, 0), - FUSE_LIB_OPT("nopath", nopath, 1), FUSE_LIB_OPT("intr", intr, 1), FUSE_LIB_OPT("intr_signal=%d", intr_signal, 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 noforget never forget cached inodes\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_signal=NUM signal to send on interrupt (%i)\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; 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! */ 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); - 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 */ srand(time(NULL)); f->fs->debug = f->conf.debug; diff --git a/src/fuse_copy_file_range.cpp b/src/fuse_copy_file_range.cpp index 83691a4c2..5ab8c6c7c 100644 --- a/src/fuse_copy_file_range.cpp +++ b/src/fuse_copy_file_range.cpp @@ -49,10 +49,8 @@ namespace l namespace FUSE { 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_, - const char *path_out_, struct fuse_file_info *ffi_out_, off_t offset_out_, size_t size_, diff --git a/src/fuse_copy_file_range.hpp b/src/fuse_copy_file_range.hpp index 4961c1b58..32ed0a571 100644 --- a/src/fuse_copy_file_range.hpp +++ b/src/fuse_copy_file_range.hpp @@ -19,10 +19,8 @@ namespace FUSE { 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, - const char *path_out, struct fuse_file_info *ffi_out, off_t offset_out, size_t size, diff --git a/src/fuse_fallocate.cpp b/src/fuse_fallocate.cpp index 85f47399f..2bae361a1 100644 --- a/src/fuse_fallocate.cpp +++ b/src/fuse_fallocate.cpp @@ -40,8 +40,7 @@ namespace l namespace FUSE { int - fallocate(const char *fusepath_, - int mode_, + fallocate(int mode_, off_t offset_, off_t len_, fuse_file_info *ffi_) diff --git a/src/fuse_fallocate.hpp b/src/fuse_fallocate.hpp index fc05306a4..b00ef33fa 100644 --- a/src/fuse_fallocate.hpp +++ b/src/fuse_fallocate.hpp @@ -19,8 +19,7 @@ namespace FUSE { int - fallocate(const char *fusepath_, - int mode_, + fallocate(int mode_, off_t offset_, off_t len_, fuse_file_info *ffi_); diff --git a/src/fuse_fgetattr.cpp b/src/fuse_fgetattr.cpp index 2c0e87121..2ee99883e 100644 --- a/src/fuse_fgetattr.cpp +++ b/src/fuse_fgetattr.cpp @@ -45,8 +45,7 @@ namespace l namespace FUSE { int - fgetattr(const char *fusepath_, - struct stat *st_, + fgetattr(struct stat *st_, fuse_file_info *ffi_, fuse_timeouts_t *timeout_) { diff --git a/src/fuse_fgetattr.hpp b/src/fuse_fgetattr.hpp index a6c295185..d8a913ada 100644 --- a/src/fuse_fgetattr.hpp +++ b/src/fuse_fgetattr.hpp @@ -25,8 +25,7 @@ namespace FUSE { int - fgetattr(const char *fusepath, - struct stat *st, + fgetattr(struct stat *st, fuse_file_info *ffi, fuse_timeouts_t *timeout); } diff --git a/src/fuse_flush.cpp b/src/fuse_flush.cpp index 7d9067d1c..ee0485b35 100644 --- a/src/fuse_flush.cpp +++ b/src/fuse_flush.cpp @@ -42,8 +42,7 @@ namespace l namespace FUSE { int - flush(const char *fusepath_, - fuse_file_info *ffi_) + flush(fuse_file_info *ffi_) { FileInfo *fi = reinterpret_cast(ffi_->fh); diff --git a/src/fuse_flush.hpp b/src/fuse_flush.hpp index 8b99899e7..1785a2c5c 100644 --- a/src/fuse_flush.hpp +++ b/src/fuse_flush.hpp @@ -21,6 +21,5 @@ namespace FUSE { int - flush(const char *path_, - fuse_file_info *ffi_); + flush(fuse_file_info *ffi_); } diff --git a/src/fuse_fsync.cpp b/src/fuse_fsync.cpp index fb28b0a00..84c423cb1 100644 --- a/src/fuse_fsync.cpp +++ b/src/fuse_fsync.cpp @@ -43,8 +43,7 @@ namespace l namespace FUSE { int - fsync(const char *fusepath_, - int isdatasync_, + fsync(int isdatasync_, fuse_file_info *ffi_) { FileInfo *fi = reinterpret_cast(ffi_->fh); diff --git a/src/fuse_fsync.hpp b/src/fuse_fsync.hpp index 96766daad..6323ab216 100644 --- a/src/fuse_fsync.hpp +++ b/src/fuse_fsync.hpp @@ -21,7 +21,6 @@ namespace FUSE { int - fsync(const char *fusepath_, - int isdatasync_, + fsync(int isdatasync_, fuse_file_info *ffi_); } diff --git a/src/fuse_fsyncdir.cpp b/src/fuse_fsyncdir.cpp index 333ecdd74..7acdb5917 100644 --- a/src/fuse_fsyncdir.cpp +++ b/src/fuse_fsyncdir.cpp @@ -42,8 +42,7 @@ namespace l namespace FUSE { int - fsyncdir(const char *fusepath_, - int isdatasync_, + fsyncdir(int isdatasync_, fuse_file_info *ffi_) { DirInfo *di = reinterpret_cast(ffi_->fh); diff --git a/src/fuse_fsyncdir.hpp b/src/fuse_fsyncdir.hpp index 2f135416f..4cf878ef0 100644 --- a/src/fuse_fsyncdir.hpp +++ b/src/fuse_fsyncdir.hpp @@ -21,7 +21,6 @@ namespace FUSE { int - fsyncdir(const char *fusepath_, - int isdatasync_, + fsyncdir(int isdatasync_, fuse_file_info *ffi_); } diff --git a/src/fuse_ftruncate.cpp b/src/fuse_ftruncate.cpp index 0706968d8..aeca910fa 100644 --- a/src/fuse_ftruncate.cpp +++ b/src/fuse_ftruncate.cpp @@ -38,8 +38,7 @@ namespace l namespace FUSE { int - ftruncate(const char *fusepath_, - off_t size_, + ftruncate(off_t size_, fuse_file_info *ffi_) { FileInfo *fi = reinterpret_cast(ffi_->fh); diff --git a/src/fuse_ftruncate.hpp b/src/fuse_ftruncate.hpp index 0cb23aba1..65e0e283c 100644 --- a/src/fuse_ftruncate.hpp +++ b/src/fuse_ftruncate.hpp @@ -24,7 +24,6 @@ namespace FUSE { int - ftruncate(const char *fusepath_, - off_t size_, + ftruncate(off_t size_, fuse_file_info *ffi_); } diff --git a/src/fuse_ioctl.cpp b/src/fuse_ioctl.cpp index dd5899a0a..78a0ba77a 100644 --- a/src/fuse_ioctl.cpp +++ b/src/fuse_ioctl.cpp @@ -374,8 +374,7 @@ namespace l namespace FUSE { int - ioctl(const char *fusepath_, - unsigned long cmd_, + ioctl(unsigned long cmd_, void *arg_, fuse_file_info *ffi_, unsigned int flags_, diff --git a/src/fuse_ioctl.hpp b/src/fuse_ioctl.hpp index 8b3fdd977..23550d581 100644 --- a/src/fuse_ioctl.hpp +++ b/src/fuse_ioctl.hpp @@ -21,8 +21,7 @@ namespace FUSE { int - ioctl(const char *fusepath_, - unsigned long cmd_, + ioctl(unsigned long cmd_, void *arg_, fuse_file_info *ffi_, unsigned int flags_, diff --git a/src/fuse_read.cpp b/src/fuse_read.cpp index 682968887..eab02747f 100644 --- a/src/fuse_read.cpp +++ b/src/fuse_read.cpp @@ -62,8 +62,7 @@ namespace l namespace FUSE { int - read(const char *fusepath_, - char *buf_, + read(char *buf_, size_t count_, off_t offset_, fuse_file_info *ffi_) @@ -78,8 +77,7 @@ namespace FUSE } int - read_null(const char *fusepath_, - char *buf_, + read_null(char *buf_, size_t count_, off_t offset_, fuse_file_info *ffi_) diff --git a/src/fuse_read.hpp b/src/fuse_read.hpp index 0fa146c18..ac1ceddd6 100644 --- a/src/fuse_read.hpp +++ b/src/fuse_read.hpp @@ -21,15 +21,13 @@ namespace FUSE { int - read(const char *fusepath_, - char *buf_, + read(char *buf_, size_t count_, off_t offset_, fuse_file_info *ffi_); int - read_null(const char *fusepath_, - char *buf_, + read_null(char *buf_, size_t count_, off_t offset_, fuse_file_info *ffi_); diff --git a/src/fuse_read_buf.cpp b/src/fuse_read_buf.cpp index c726fc4ff..5d64d3268 100644 --- a/src/fuse_read_buf.cpp +++ b/src/fuse_read_buf.cpp @@ -54,8 +54,7 @@ namespace l namespace FUSE { int - read_buf(const char *fusepath_, - fuse_bufvec **bufp_, + read_buf(fuse_bufvec **bufp_, size_t size_, off_t offset_, fuse_file_info *ffi_) diff --git a/src/fuse_read_buf.hpp b/src/fuse_read_buf.hpp index 1faeb8916..a6f4ca6b6 100644 --- a/src/fuse_read_buf.hpp +++ b/src/fuse_read_buf.hpp @@ -23,8 +23,7 @@ namespace FUSE { int - read_buf(const char *fusepath_, - struct fuse_bufvec **buf_, + read_buf(struct fuse_bufvec **buf_, size_t size_, off_t offset_, fuse_file_info *ffi_); diff --git a/src/fuse_release.cpp b/src/fuse_release.cpp index 21bcd9af7..584a3c646 100644 --- a/src/fuse_release.cpp +++ b/src/fuse_release.cpp @@ -50,8 +50,7 @@ namespace l namespace FUSE { int - release(const char *fusepath_, - fuse_file_info *ffi_) + release(fuse_file_info *ffi_) { const Config &config = Config::ro(); FileInfo *fi = reinterpret_cast(ffi_->fh); diff --git a/src/fuse_release.hpp b/src/fuse_release.hpp index b871c8f03..47592b5c0 100644 --- a/src/fuse_release.hpp +++ b/src/fuse_release.hpp @@ -21,6 +21,5 @@ namespace FUSE { int - release(const char *fusepath_, - fuse_file_info *ffi_); + release(fuse_file_info *ffi_); } diff --git a/src/fuse_releasedir.cpp b/src/fuse_releasedir.cpp index 7782db716..83246fb71 100644 --- a/src/fuse_releasedir.cpp +++ b/src/fuse_releasedir.cpp @@ -34,8 +34,7 @@ namespace l namespace FUSE { int - releasedir(const char *fusepath_, - fuse_file_info *ffi_) + releasedir(fuse_file_info *ffi_) { DirInfo *di = reinterpret_cast(ffi_->fh); diff --git a/src/fuse_releasedir.hpp b/src/fuse_releasedir.hpp index ab21aa0ba..1b02fb61e 100644 --- a/src/fuse_releasedir.hpp +++ b/src/fuse_releasedir.hpp @@ -21,6 +21,5 @@ namespace FUSE { int - releasedir(const char *fusepath_, - fuse_file_info *ffi_); + releasedir(fuse_file_info *ffi_); } diff --git a/src/fuse_write.cpp b/src/fuse_write.cpp index 56a268505..0665181c4 100644 --- a/src/fuse_write.cpp +++ b/src/fuse_write.cpp @@ -115,8 +115,7 @@ namespace l namespace FUSE { int - write(const char *fusepath_, - const char *buf_, + write(const char *buf_, size_t count_, off_t offset_, fuse_file_info *ffi_) @@ -131,8 +130,7 @@ namespace FUSE } int - write_null(const char *fusepath_, - const char *buf_, + write_null(const char *buf_, size_t count_, off_t offset_, fuse_file_info *ffi_) diff --git a/src/fuse_write.hpp b/src/fuse_write.hpp index 9bc62c7e2..2725ee475 100644 --- a/src/fuse_write.hpp +++ b/src/fuse_write.hpp @@ -21,15 +21,13 @@ namespace FUSE { int - write(const char *fusepath_, - const char *buf_, + write(const char *buf_, size_t count_, off_t offset_, fuse_file_info *ffi_); int - write_null(const char *fusepath_, - const char *buf_, + write_null(const char *buf_, size_t count_, off_t offset_, fuse_file_info *ffi_); diff --git a/src/fuse_write_buf.cpp b/src/fuse_write_buf.cpp index ed4675d6a..6435a10d9 100644 --- a/src/fuse_write_buf.cpp +++ b/src/fuse_write_buf.cpp @@ -87,8 +87,7 @@ namespace l namespace FUSE { int - write_buf(const char *fusepath_, - fuse_bufvec *src_, + write_buf(fuse_bufvec *src_, off_t offset_, fuse_file_info *ffi_) { @@ -103,8 +102,7 @@ namespace FUSE } int - write_buf_null(const char *fusepath_, - fuse_bufvec *src_, + write_buf_null(fuse_bufvec *src_, off_t offset_, fuse_file_info *ffi_) { diff --git a/src/fuse_write_buf.hpp b/src/fuse_write_buf.hpp index 54c237506..c0232ddc9 100644 --- a/src/fuse_write_buf.hpp +++ b/src/fuse_write_buf.hpp @@ -23,14 +23,12 @@ namespace FUSE { int - write_buf(const char *fusepath_, - struct fuse_bufvec *buf_, + write_buf(struct fuse_bufvec *buf_, off_t offset_, fuse_file_info *ffi_); int - write_buf_null(const char *fusepath_, - struct fuse_bufvec *buf_, + write_buf_null(struct fuse_bufvec *buf_, off_t offset_, fuse_file_info *ffi_); } diff --git a/src/mergerfs.cpp b/src/mergerfs.cpp index a56a9001e..33041e4c9 100644 --- a/src/mergerfs.cpp +++ b/src/mergerfs.cpp @@ -80,10 +80,6 @@ namespace l get_fuse_operations(struct fuse_operations &ops, const bool nullrw) { - ops.flag_nullpath_ok = true; - ops.flag_nopath = true; - ops.flag_utime_omit_ok = true; - ops.access = FUSE::access; ops.bmap = NULL; ops.chmod = FUSE::chmod;