[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 074/109] virtiofsd: passthrough_ll: clean up cache related opt
From: |
Dr. David Alan Gilbert (git) |
Subject: |
[PATCH v2 074/109] virtiofsd: passthrough_ll: clean up cache related options |
Date: |
Tue, 21 Jan 2020 12:23:58 +0000 |
From: Miklos Szeredi <address@hidden>
- 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 <address@hidden>
Signed-off-by: Dr. David Alan Gilbert <address@hidden>
Reviewed-by: Daniel P. Berrangé <address@hidden>
---
tools/virtiofsd/helper.c | 3 +++
tools/virtiofsd/passthrough_ll.c | 20 ++++++++++----------
2 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/tools/virtiofsd/helper.c b/tools/virtiofsd/helper.c
index 36eb273d8e..93bb0713a9 100644
--- a/tools/virtiofsd/helper.c
+++ b/tools/virtiofsd/helper.c
@@ -146,6 +146,9 @@ void fuse_cmdline_help(void)
" -f foreground operation\n"
" --daemonize run in background\n"
" -s disable multi-threaded operation\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"
" level could be one of \"debug, "
"info, warn, err\"\n"
diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c
index f71085bf1b..528820aa71 100644
--- a/tools/virtiofsd/passthrough_ll.c
+++ b/tools/virtiofsd/passthrough_ll.c
@@ -101,8 +101,8 @@ struct lo_cred {
};
enum {
- CACHE_NEVER,
- CACHE_NORMAL,
+ CACHE_NONE,
+ CACHE_AUTO,
CACHE_ALWAYS,
};
@@ -138,8 +138,8 @@ static const struct fuse_opt lo_opts[] = {
{ "no_xattr", offsetof(struct lo_data, xattr), 0 },
{ "timeout=%lf", offsetof(struct lo_data, timeout), 0 },
{ "timeout=", offsetof(struct lo_data, timeout_set), 1 },
- { "cache=never", offsetof(struct lo_data, cache), CACHE_NEVER },
- { "cache=auto", offsetof(struct lo_data, cache), CACHE_NORMAL },
+ { "cache=none", offsetof(struct lo_data, cache), CACHE_NONE },
+ { "cache=auto", offsetof(struct lo_data, cache), CACHE_AUTO },
{ "cache=always", offsetof(struct lo_data, cache), CACHE_ALWAYS },
{ "norace", offsetof(struct lo_data, norace), 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");
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) {
fuse_log(FUSE_LOG_DEBUG, "lo_init: disabling readdirplus\n");
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;
err = lo_do_lookup(req, parent, name, &e);
}
- if (lo->cache == CACHE_NEVER) {
+ if (lo->cache == CACHE_NONE) {
fi->direct_io = 1;
} else if (lo->cache == CACHE_ALWAYS) {
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;
- if (lo->cache == CACHE_NEVER) {
+ if (lo->cache == CACHE_NONE) {
fi->direct_io = 1;
} else if (lo->cache == CACHE_ALWAYS) {
fi->keep_cache = 1;
@@ -2395,7 +2395,7 @@ int main(int argc, char *argv[])
lo.root.next = lo.root.prev = &lo.root;
lo.root.fd = -1;
lo.root.fuse_ino = FUSE_ROOT_ID;
- lo.cache = CACHE_NORMAL;
+ lo.cache = CACHE_AUTO;
/*
* Set up the ino map like this:
@@ -2470,11 +2470,11 @@ int main(int argc, char *argv[])
}
if (!lo.timeout_set) {
switch (lo.cache) {
- case CACHE_NEVER:
+ case CACHE_NONE:
lo.timeout = 0.0;
break;
- case CACHE_NORMAL:
+ case CACHE_AUTO:
lo.timeout = 1.0;
break;
--
2.24.1
- [PATCH v2 064/109] virtiofsd: Handle hard reboot, (continued)
- [PATCH v2 064/109] virtiofsd: Handle hard reboot, Dr. David Alan Gilbert (git), 2020/01/21
- [PATCH v2 066/109] vhost-user: Print unexpected slave message types, Dr. David Alan Gilbert (git), 2020/01/21
- [PATCH v2 067/109] contrib/libvhost-user: Protect slave fd with mutex, Dr. David Alan Gilbert (git), 2020/01/21
- [PATCH v2 068/109] virtiofsd: passthrough_ll: add renameat2 support, Dr. David Alan Gilbert (git), 2020/01/21
- [PATCH v2 069/109] virtiofsd: passthrough_ll: disable readdirplus on cache=never, Dr. David Alan Gilbert (git), 2020/01/21
- [PATCH v2 071/109] virtiofsd: rename unref_inode() to unref_inode_lolocked(), Dr. David Alan Gilbert (git), 2020/01/21
- [PATCH v2 072/109] virtiofsd: fail when parent inode isn't known in lo_do_lookup(), Dr. David Alan Gilbert (git), 2020/01/21
- [PATCH v2 070/109] virtiofsd: passthrough_ll: control readdirplus, Dr. David Alan Gilbert (git), 2020/01/21
- [PATCH v2 073/109] virtiofsd: extract root inode init into setup_root(), Dr. David Alan Gilbert (git), 2020/01/21
- [PATCH v2 074/109] virtiofsd: passthrough_ll: clean up cache related options,
Dr. David Alan Gilbert (git) <=
- [PATCH v2 075/109] virtiofsd: passthrough_ll: use hashtable, Dr. David Alan Gilbert (git), 2020/01/21
- [PATCH v2 076/109] virtiofsd: Clean up inodes on destroy, Dr. David Alan Gilbert (git), 2020/01/21
- [PATCH v2 077/109] virtiofsd: support nanosecond resolution for file timestamp, Dr. David Alan Gilbert (git), 2020/01/21
- [PATCH v2 078/109] virtiofsd: fix error handling in main(), Dr. David Alan Gilbert (git), 2020/01/21
- [PATCH v2 079/109] virtiofsd: cleanup allocated resource in se, Dr. David Alan Gilbert (git), 2020/01/21
- [PATCH v2 080/109] virtiofsd: fix memory leak on lo.source, Dr. David Alan Gilbert (git), 2020/01/21
- [PATCH v2 081/109] virtiofsd: add helper for lo_data cleanup, Dr. David Alan Gilbert (git), 2020/01/21
- [PATCH v2 082/109] virtiofsd: Prevent multiply running with same vhost_user_socket, Dr. David Alan Gilbert (git), 2020/01/21
- [PATCH v2 083/109] virtiofsd: enable PARALLEL_DIROPS during INIT, Dr. David Alan Gilbert (git), 2020/01/21