From d99f074eb73d5228528961a78c13419c2c4c26ae Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 24 Jan 2012 18:20:58 +0100 Subject: directory: replace dirvec with doubly linked list Random access is not needed, and a linked list is easier to manage: we don't need to (re-)allocate the pointer array. --- src/db/simple_db_plugin.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/db') diff --git a/src/db/simple_db_plugin.c b/src/db/simple_db_plugin.c index 7b13d0a2..816f4503 100644 --- a/src/db/simple_db_plugin.c +++ b/src/db/simple_db_plugin.c @@ -24,6 +24,7 @@ #include "db_selection.h" #include "db_visitor.h" #include "db_save.h" +#include "db_lock.h" #include "conf.h" #include "glib_compat.h" #include "directory.h" @@ -266,8 +267,11 @@ simple_db_visit(struct db *_db, const struct db_selection *selection, !visitor->directory(directory, ctx, error_r)) return false; - return directory_walk(directory, selection->recursive, - visitor, ctx, error_r); + db_lock(); + bool ret = directory_walk(directory, selection->recursive, + visitor, ctx, error_r); + db_unlock(); + return ret; } const struct db_plugin simple_db_plugin = { -- cgit v1.2.3