diff options
-rw-r--r-- | lib/fuse.c | 42 |
1 files changed, 21 insertions, 21 deletions
@@ -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, |