summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Lippincott <spectral@google.com>2022-09-12 12:26:53 -0700
committerNikolaus Rath <Nikolaus@rath.org>2023-01-04 09:41:56 +0000
commit30d423ee74496505f89e9db1cb23aafb1cc653a8 (patch)
tree5a9cfe4437c2f48bf97d3c324c5a1fc8426de74e
parent06be4565bfffb9fe1de9e8f4d5b09ea700451dec (diff)
downloadfuse-30d423ee74496505f89e9db1cb23aafb1cc653a8.tar.gz
Move try_get_path2 earlier in the file
-rw-r--r--lib/fuse.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/lib/fuse.c b/lib/fuse.c
index 17850e3..606c3dd 100644
--- a/lib/fuse.c
+++ b/lib/fuse.c
@@ -1091,6 +1091,27 @@ static void queue_element_unlock(struct fuse *f, struct lock_queue_element *qe)
}
}
+static int try_get_path2(struct fuse *f, fuse_ino_t nodeid1, const char *name1,
+ fuse_ino_t nodeid2, const char *name2,
+ char **path1, char **path2,
+ struct node **wnode1, struct node **wnode2)
+{
+ int err;
+
+ /* FIXME: locking two paths needs deadlock checking */
+ err = try_get_path(f, nodeid1, name1, path1, wnode1, true);
+ if (!err) {
+ err = try_get_path(f, nodeid2, name2, path2, wnode2, true);
+ if (err) {
+ struct node *wn1 = wnode1 ? *wnode1 : NULL;
+
+ unlock_path(f, nodeid1, wn1, NULL);
+ free(*path1);
+ }
+ }
+ return err;
+}
+
static void queue_element_wakeup(struct fuse *f, struct lock_queue_element *qe)
{
int err;
@@ -1307,27 +1328,6 @@ static int check_dir_loop(struct fuse *f,
}
#endif
-static int try_get_path2(struct fuse *f, fuse_ino_t nodeid1, const char *name1,
- fuse_ino_t nodeid2, const char *name2,
- char **path1, char **path2,
- struct node **wnode1, struct node **wnode2)
-{
- int err;
-
- /* FIXME: locking two paths needs deadlock checking */
- err = try_get_path(f, nodeid1, name1, path1, wnode1, true);
- if (!err) {
- err = try_get_path(f, nodeid2, name2, path2, wnode2, true);
- if (err) {
- struct node *wn1 = wnode1 ? *wnode1 : NULL;
-
- unlock_path(f, nodeid1, wn1, NULL);
- free(*path1);
- }
- }
- return err;
-}
-
static int get_path2(struct fuse *f, fuse_ino_t nodeid1, const char *name1,
fuse_ino_t nodeid2, const char *name2,
char **path1, char **path2,