aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGravatar Nikolaus Rath <Nikolaus@rath.org>2016-10-20 15:45:32 -0700
committerGravatar Nikolaus Rath <Nikolaus@rath.org>2016-10-20 15:45:32 -0700
commit1d9f26f3736cc4703c2e988d87f5dd119bcd736d (patch)
treea2e7aabb5ce872585d0005eed196de9c0fdb029c /lib
parent8ee553dac0297cfd75cbdd2d9cfdce37e22ef4ee (diff)
Turn fuse_operations.nopath_flag into fuse_config.nullpath_ok
Modifying struct fuse_config in the init() handler is the canonical way to adjust file-system implementation specific settings. There is no need to have flags in struct fuse_operations.
Diffstat (limited to 'lib')
-rw-r--r--lib/fuse.c8
-rw-r--r--lib/modules/iconv.c4
-rw-r--r--lib/modules/subdir.c4
3 files changed, 7 insertions, 9 deletions
diff --git a/lib/fuse.c b/lib/fuse.c
index 1595cc8..df6e3a0 100644
--- a/lib/fuse.c
+++ b/lib/fuse.c
@@ -1193,7 +1193,7 @@ static int get_path_nullok(struct fuse *f, fuse_ino_t nodeid, char **path)
{
int err = 0;
- if (f->conf.nopath) {
+ if (f->conf.nullpath_ok) {
*path = NULL;
} else {
err = get_path_common(f, nodeid, NULL, path, NULL);
@@ -2958,7 +2958,7 @@ static void fuse_do_release(struct fuse *f, fuse_ino_t ino, const char *path,
if(unlink_hidden) {
if (path) {
fuse_fs_unlink(f->fs, path);
- } else if (f->conf.nopath) {
+ } else if (f->conf.nullpath_ok) {
char *unlinkpath;
if (get_path(f, ino, &unlinkpath) == 0)
@@ -4480,7 +4480,6 @@ static int fuse_push_module(struct fuse *f, const char *module,
}
newfs->m = m;
f->fs = newfs;
- f->conf.nopath = newfs->op.flag_nopath && f->conf.nopath;
return 0;
}
@@ -4596,7 +4595,6 @@ struct fuse *fuse_new(struct fuse_args *args,
goto out_delete_context_key;
f->fs = fs;
- f->conf.nopath = fs->op.flag_nopath;
/* Oh f**k, this is ugly! */
if (!fs->op.lock) {
@@ -4650,7 +4648,7 @@ struct fuse *fuse_new(struct fuse_args *args,
goto out_free_fs;
if (f->conf.debug) {
- fprintf(stderr, "nopath: %i\n", f->conf.nopath);
+ fprintf(stderr, "nullpath_ok: %i\n", f->conf.nullpath_ok);
}
/* Trace topmost layer by default */
diff --git a/lib/modules/iconv.c b/lib/modules/iconv.c
index b0453be..5d1e959 100644
--- a/lib/modules/iconv.c
+++ b/lib/modules/iconv.c
@@ -561,6 +561,8 @@ static void *iconv_init(struct fuse_conn_info *conn,
{
struct iconv *ic = iconv_get();
fuse_fs_init(ic->next, conn, cfg);
+ /* Don't touch cfg->nullpath_ok, we can work with
+ either */
return ic;
}
@@ -612,8 +614,6 @@ static const struct fuse_operations iconv_oper = {
.lock = iconv_lock,
.flock = iconv_flock,
.bmap = iconv_bmap,
-
- .flag_nopath = 1,
};
static const struct fuse_opt iconv_opts[] = {
diff --git a/lib/modules/subdir.c b/lib/modules/subdir.c
index 708edf3..9478e4e 100644
--- a/lib/modules/subdir.c
+++ b/lib/modules/subdir.c
@@ -547,6 +547,8 @@ static void *subdir_init(struct fuse_conn_info *conn,
{
struct subdir *d = subdir_get();
fuse_fs_init(d->next, conn, cfg);
+ /* Don't touch cfg->nullpath_ok, we can work with
+ either */
return d;
}
@@ -594,8 +596,6 @@ static const struct fuse_operations subdir_oper = {
.lock = subdir_lock,
.flock = subdir_flock,
.bmap = subdir_bmap,
-
- .flag_nopath = 1,
};
static const struct fuse_opt subdir_opts[] = {