Remove compatibility path handling
authorMiklos Szeredi <mszeredi@suse.cz>
Fri, 20 Jul 2012 07:45:09 +0000 (09:45 +0200)
committerMiklos Szeredi <mszeredi@suse.cz>
Fri, 20 Jul 2012 07:45:09 +0000 (09:45 +0200)
This means that now NULL is a valid path for operations that take a file
descriptor if the file was unlinked and hard_remove option is specified.

example/fusexmp_fh.c
include/fuse.h
lib/fuse.c
lib/modules/iconv.c
lib/modules/subdir.c

index 2b0f6166840d0975df0078d8db18a402e8e824d4..8c5a524011b73dc386e62c7ba645b802687ed389 100644 (file)
@@ -554,7 +554,6 @@ static struct fuse_operations xmp_oper = {
        .lock           = xmp_lock,
        .flock          = xmp_flock,
 
-       .flag_nullpath_ok = 1,
 #if HAVE_UTIMENSAT
        .flag_utime_omit_ok = 1,
 #endif
index 7522cb6f1f8f60fc5391f8eaffd4cd2e9715b565..a23dadbbc6ba6131f131aa7a601c67241c346619 100644 (file)
@@ -446,18 +446,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:
@@ -465,10 +453,9 @@ struct fuse_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.
+        * 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;
 
@@ -481,7 +468,7 @@ struct fuse_operations {
        /**
         * Reserved flags, don't set
         */
-       unsigned int flag_reserved:29;
+       unsigned int flag_reserved:30;
 
        /**
         * Ioctl
index a0c4183fb80f93dc6decd131ab34a399f8c0e01d..929482277271a845dff2d73bfceff9e5c1ed028f 100644 (file)
@@ -128,7 +128,6 @@ struct fuse {
        struct fuse_config conf;
        int intr_installed;
        struct fuse_fs *fs;
-       int nullpath_ok;
        int utime_omit_ok;
        int curr_ticket;
        struct lock_queue_element *lockq;
@@ -1124,7 +1123,7 @@ static int get_path_nullok(struct fuse *f, fuse_ino_t nodeid, char **path)
                *path = NULL;
        } else {
                err = get_path_common(f, nodeid, NULL, path, NULL);
-               if (err == -ENOENT && f->nullpath_ok)
+               if (err == -ENOENT)
                        err = 0;
        }
 
@@ -2896,14 +2895,8 @@ static void fuse_do_release(struct fuse *f, fuse_ino_t ino, const char *path,
 {
        struct node *node;
        int unlink_hidden = 0;
-       const char *compatpath;
 
-       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, path, fi);
 
        pthread_mutex_lock(&f->lock);
        node = get_node(f, ino);
@@ -3334,16 +3327,11 @@ static void fuse_lib_releasedir(fuse_req_t req, fuse_ino_t ino,
        struct fuse_file_info fi;
        struct fuse_dh *dh = get_dirhandle(llfi, &fi);
        char *path;
-       const char *compatpath;
 
        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, path, &fi);
        fuse_finish_interrupt(f, req, &d);
        free_path(f, ino, path);
 
@@ -4321,7 +4309,6 @@ static int fuse_push_module(struct fuse *f, const char *module,
        }
        newfs->m = m;
        f->fs = newfs;
-       f->nullpath_ok = newfs->op.flag_nullpath_ok && f->nullpath_ok;
        f->conf.nopath = newfs->op.flag_nopath && f->conf.nopath;
        f->utime_omit_ok = newfs->op.flag_utime_omit_ok && f->utime_omit_ok;
        return 0;
@@ -4416,7 +4403,6 @@ struct fuse *fuse_new(struct fuse_chan *ch, struct fuse_args *args,
                goto out_free;
 
        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;
 
@@ -4476,7 +4462,6 @@ struct fuse *fuse_new(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);
        }
index 33923f3881fa270738155a340226e5ea90348d7c..bc3694edec984141a35c8685a962dada2e652d39 100644 (file)
@@ -631,7 +631,6 @@ static const struct fuse_operations iconv_oper = {
        .flock          = iconv_flock,
        .bmap           = iconv_bmap,
 
-       .flag_nullpath_ok = 1,
        .flag_nopath = 1,
 };
 
index 3a76cbbd725d2735350c7067ba67383d906855aa..52b91e16802ab34d63b0c0319fb2267e6b5725dc 100644 (file)
@@ -614,7 +614,6 @@ static const struct fuse_operations subdir_oper = {
        .flock          = subdir_flock,
        .bmap           = subdir_bmap,
 
-       .flag_nullpath_ok = 1,
        .flag_nopath = 1,
 };