virtiofsd: passthrough_ll: clean up cache related options
- Rename "cache=never" to "cache=none" to match 9p's similar option. - Rename CACHE_NORMAL constant to CACHE_AUTO to match the "cache=auto" option. Signed-off-by: Miklos Szeredi <mszeredi@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
This commit is contained in:
parent
3ca8a2b1c8
commit
230e777b5e
@ -145,6 +145,9 @@ void fuse_cmdline_help(void)
|
|||||||
" --syslog log to syslog (default stderr)\n"
|
" --syslog log to syslog (default stderr)\n"
|
||||||
" -f foreground operation\n"
|
" -f foreground operation\n"
|
||||||
" --daemonize run in background\n"
|
" --daemonize run in background\n"
|
||||||
|
" -o cache=<mode> cache mode. could be one of \"auto, "
|
||||||
|
"always, none\"\n"
|
||||||
|
" default: auto\n"
|
||||||
" -o log_level=<level> log level, default to \"info\"\n"
|
" -o log_level=<level> log level, default to \"info\"\n"
|
||||||
" level could be one of \"debug, "
|
" level could be one of \"debug, "
|
||||||
"info, warn, err\"\n"
|
"info, warn, err\"\n"
|
||||||
@ -156,7 +159,7 @@ void fuse_cmdline_help(void)
|
|||||||
" -o readdirplus|no_readdirplus\n"
|
" -o readdirplus|no_readdirplus\n"
|
||||||
" enable/disable readirplus\n"
|
" enable/disable readirplus\n"
|
||||||
" default: readdirplus except with "
|
" default: readdirplus except with "
|
||||||
"cache=never\n"
|
"cache=none\n"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,8 +101,8 @@ struct lo_cred {
|
|||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
CACHE_NEVER,
|
CACHE_NONE,
|
||||||
CACHE_NORMAL,
|
CACHE_AUTO,
|
||||||
CACHE_ALWAYS,
|
CACHE_ALWAYS,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -138,8 +138,8 @@ static const struct fuse_opt lo_opts[] = {
|
|||||||
{ "no_xattr", offsetof(struct lo_data, xattr), 0 },
|
{ "no_xattr", offsetof(struct lo_data, xattr), 0 },
|
||||||
{ "timeout=%lf", offsetof(struct lo_data, timeout), 0 },
|
{ "timeout=%lf", offsetof(struct lo_data, timeout), 0 },
|
||||||
{ "timeout=", offsetof(struct lo_data, timeout_set), 1 },
|
{ "timeout=", offsetof(struct lo_data, timeout_set), 1 },
|
||||||
{ "cache=never", offsetof(struct lo_data, cache), CACHE_NEVER },
|
{ "cache=none", offsetof(struct lo_data, cache), CACHE_NONE },
|
||||||
{ "cache=auto", offsetof(struct lo_data, cache), CACHE_NORMAL },
|
{ "cache=auto", offsetof(struct lo_data, cache), CACHE_AUTO },
|
||||||
{ "cache=always", offsetof(struct lo_data, cache), CACHE_ALWAYS },
|
{ "cache=always", offsetof(struct lo_data, cache), CACHE_ALWAYS },
|
||||||
{ "norace", offsetof(struct lo_data, norace), 1 },
|
{ "norace", offsetof(struct lo_data, norace), 1 },
|
||||||
{ "readdirplus", offsetof(struct lo_data, readdirplus_set), 1 },
|
{ "readdirplus", offsetof(struct lo_data, readdirplus_set), 1 },
|
||||||
@ -482,7 +482,7 @@ static void lo_init(void *userdata, struct fuse_conn_info *conn)
|
|||||||
fuse_log(FUSE_LOG_DEBUG, "lo_init: activating flock locks\n");
|
fuse_log(FUSE_LOG_DEBUG, "lo_init: activating flock locks\n");
|
||||||
conn->want |= FUSE_CAP_FLOCK_LOCKS;
|
conn->want |= FUSE_CAP_FLOCK_LOCKS;
|
||||||
}
|
}
|
||||||
if ((lo->cache == CACHE_NEVER && !lo->readdirplus_set) ||
|
if ((lo->cache == CACHE_NONE && !lo->readdirplus_set) ||
|
||||||
lo->readdirplus_clear) {
|
lo->readdirplus_clear) {
|
||||||
fuse_log(FUSE_LOG_DEBUG, "lo_init: disabling readdirplus\n");
|
fuse_log(FUSE_LOG_DEBUG, "lo_init: disabling readdirplus\n");
|
||||||
conn->want &= ~FUSE_CAP_READDIRPLUS;
|
conn->want &= ~FUSE_CAP_READDIRPLUS;
|
||||||
@ -1493,7 +1493,7 @@ static void lo_create(fuse_req_t req, fuse_ino_t parent, const char *name,
|
|||||||
fi->fh = fh;
|
fi->fh = fh;
|
||||||
err = lo_do_lookup(req, parent, name, &e);
|
err = lo_do_lookup(req, parent, name, &e);
|
||||||
}
|
}
|
||||||
if (lo->cache == CACHE_NEVER) {
|
if (lo->cache == CACHE_NONE) {
|
||||||
fi->direct_io = 1;
|
fi->direct_io = 1;
|
||||||
} else if (lo->cache == CACHE_ALWAYS) {
|
} else if (lo->cache == CACHE_ALWAYS) {
|
||||||
fi->keep_cache = 1;
|
fi->keep_cache = 1;
|
||||||
@ -1578,7 +1578,7 @@ static void lo_open(fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi)
|
|||||||
}
|
}
|
||||||
|
|
||||||
fi->fh = fh;
|
fi->fh = fh;
|
||||||
if (lo->cache == CACHE_NEVER) {
|
if (lo->cache == CACHE_NONE) {
|
||||||
fi->direct_io = 1;
|
fi->direct_io = 1;
|
||||||
} else if (lo->cache == CACHE_ALWAYS) {
|
} else if (lo->cache == CACHE_ALWAYS) {
|
||||||
fi->keep_cache = 1;
|
fi->keep_cache = 1;
|
||||||
@ -2395,7 +2395,7 @@ int main(int argc, char *argv[])
|
|||||||
lo.root.next = lo.root.prev = &lo.root;
|
lo.root.next = lo.root.prev = &lo.root;
|
||||||
lo.root.fd = -1;
|
lo.root.fd = -1;
|
||||||
lo.root.fuse_ino = FUSE_ROOT_ID;
|
lo.root.fuse_ino = FUSE_ROOT_ID;
|
||||||
lo.cache = CACHE_NORMAL;
|
lo.cache = CACHE_AUTO;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set up the ino map like this:
|
* Set up the ino map like this:
|
||||||
@ -2470,11 +2470,11 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
if (!lo.timeout_set) {
|
if (!lo.timeout_set) {
|
||||||
switch (lo.cache) {
|
switch (lo.cache) {
|
||||||
case CACHE_NEVER:
|
case CACHE_NONE:
|
||||||
lo.timeout = 0.0;
|
lo.timeout = 0.0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CACHE_NORMAL:
|
case CACHE_AUTO:
|
||||||
lo.timeout = 1.0;
|
lo.timeout = 1.0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user