dcavalca / rpms / qemu

Forked from rpms/qemu a year ago
Clone

Blame 0079-virtiofsd-rename-unref_inode-to-unref_inode_lolocked.patch

1d442b
From: Miklos Szeredi <mszeredi@redhat.com>
1d442b
Date: Mon, 27 Jan 2020 19:01:48 +0000
1d442b
Subject: [PATCH] virtiofsd: rename unref_inode() to unref_inode_lolocked()
1d442b
MIME-Version: 1.0
1d442b
Content-Type: text/plain; charset=UTF-8
1d442b
Content-Transfer-Encoding: 8bit
1d442b
1d442b
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
1d442b
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
1d442b
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
1d442b
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
1d442b
(cherry picked from commit 95d2715791c60b5dc2d22e4eb7b83217273296fa)
1d442b
---
1d442b
 tools/virtiofsd/passthrough_ll.c | 15 ++++++++-------
1d442b
 1 file changed, 8 insertions(+), 7 deletions(-)
1d442b
1d442b
diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c
1d442b
index 8b1784ff7b..de12e75a9e 100644
1d442b
--- a/tools/virtiofsd/passthrough_ll.c
1d442b
+++ b/tools/virtiofsd/passthrough_ll.c
1d442b
@@ -148,8 +148,8 @@ static const struct fuse_opt lo_opts[] = {
1d442b
 };
1d442b
 static bool use_syslog = false;
1d442b
 static int current_log_level;
1d442b
-
1d442b
-static void unref_inode(struct lo_data *lo, struct lo_inode *inode, uint64_t n);
1d442b
+static void unref_inode_lolocked(struct lo_data *lo, struct lo_inode *inode,
1d442b
+                                 uint64_t n);
1d442b
 
1d442b
 static struct {
1d442b
     pthread_mutex_t mutex;
1d442b
@@ -586,7 +586,7 @@ retry:
1d442b
     return 0;
1d442b
 
1d442b
 fail_unref:
1d442b
-    unref_inode(lo, p, 1);
1d442b
+    unref_inode_lolocked(lo, p, 1);
1d442b
 fail:
1d442b
     if (retries) {
1d442b
         retries--;
1d442b
@@ -624,7 +624,7 @@ fallback:
1d442b
     res = lo_parent_and_name(lo, inode, path, &parent);
1d442b
     if (res != -1) {
1d442b
         res = utimensat(parent->fd, path, tv, AT_SYMLINK_NOFOLLOW);
1d442b
-        unref_inode(lo, parent, 1);
1d442b
+        unref_inode_lolocked(lo, parent, 1);
1d442b
     }
1d442b
 
1d442b
     return res;
1d442b
@@ -1027,7 +1027,7 @@ fallback:
1d442b
     res = lo_parent_and_name(lo, inode, path, &parent);
1d442b
     if (res != -1) {
1d442b
         res = linkat(parent->fd, path, dfd, name, 0);
1d442b
-        unref_inode(lo, parent, 1);
1d442b
+        unref_inode_lolocked(lo, parent, 1);
1d442b
     }
1d442b
 
1d442b
     return res;
1d442b
@@ -1141,7 +1141,8 @@ static void lo_unlink(fuse_req_t req, fuse_ino_t parent, const char *name)
1d442b
     fuse_reply_err(req, res == -1 ? errno : 0);
1d442b
 }
1d442b
 
1d442b
-static void unref_inode(struct lo_data *lo, struct lo_inode *inode, uint64_t n)
1d442b
+static void unref_inode_lolocked(struct lo_data *lo, struct lo_inode *inode,
1d442b
+                                 uint64_t n)
1d442b
 {
1d442b
     if (!inode) {
1d442b
         return;
1d442b
@@ -1181,7 +1182,7 @@ static void lo_forget_one(fuse_req_t req, fuse_ino_t ino, uint64_t nlookup)
1d442b
              (unsigned long long)ino, (unsigned long long)inode->refcount,
1d442b
              (unsigned long long)nlookup);
1d442b
 
1d442b
-    unref_inode(lo, inode, nlookup);
1d442b
+    unref_inode_lolocked(lo, inode, nlookup);
1d442b
 }
1d442b
 
1d442b
 static void lo_forget(fuse_req_t req, fuse_ino_t ino, uint64_t nlookup)