diff mbox series

[073/104] virtiofsd: passthrough_ll: clean up cache related options

Message ID 20191212163904.159893-74-dgilbert@redhat.com (mailing list archive)
State New, archived
Headers show
Series virtiofs daemon [all] | expand

Commit Message

Dr. David Alan Gilbert Dec. 12, 2019, 4:38 p.m. UTC
From: Miklos Szeredi <mszeredi@redhat.com>

 - 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>
---
 tools/virtiofsd/passthrough_ll.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

Comments

Daniel P. Berrangé Jan. 7, 2020, 11:24 a.m. UTC | #1
On Thu, Dec 12, 2019 at 04:38:33PM +0000, Dr. David Alan Gilbert (git) wrote:
> From: Miklos Szeredi <mszeredi@redhat.com>
> 
>  - 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>
> ---
>  tools/virtiofsd/passthrough_ll.c | 20 ++++++++++----------
>  1 file changed, 10 insertions(+), 10 deletions(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


Regards,
Daniel
diff mbox series

Patch

diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c
index 1b84d4f313..cd26db74cf 100644
--- a/tools/virtiofsd/passthrough_ll.c
+++ b/tools/virtiofsd/passthrough_ll.c
@@ -102,8 +102,8 @@  struct lo_cred {
 };
 
 enum {
-    CACHE_NEVER,
-    CACHE_NORMAL,
+    CACHE_NONE,
+    CACHE_AUTO,
     CACHE_ALWAYS,
 };
 
@@ -139,8 +139,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 },
@@ -483,7 +483,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;
@@ -1525,7 +1525,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;
@@ -1610,7 +1610,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;
@@ -2427,7 +2427,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:
@@ -2503,11 +2503,11 @@  int main(int argc, char *argv[])
     lo.root.is_symlink = false;
     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;