From 6dfdd8c1c2876296cedbbff0a6fc7e205abe4307 Mon Sep 17 00:00:00 2001
From: Max Kellermann <max.kellermann@gmail.com>
Date: Wed, 15 May 2024 14:55:10 +0200
Subject: [PATCH] db/update/Walk: use Storage::OpenFile()

---
 src/db/update/Walk.cxx | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/src/db/update/Walk.cxx b/src/db/update/Walk.cxx
index cafda30e0..d6101d6e3 100644
--- a/src/db/update/Walk.cxx
+++ b/src/db/update/Walk.cxx
@@ -17,6 +17,7 @@
 #include "storage/FileInfo.hxx"
 #include "input/InputStream.hxx"
 #include "input/Error.hxx"
+#include "input/WaitReady.hxx"
 #include "util/StringCompare.hxx"
 #include "util/StringSplit.hxx"
 #include "util/UriExtract.hxx"
@@ -307,18 +308,19 @@ UpdateWalk::SkipSymlink(const Directory *directory,
 }
 
 static void
-LoadExcludeListOrThrow(const Storage &storage, const Directory &directory,
+LoadExcludeListOrThrow(Storage &storage, const Directory &directory,
 		       ExcludeList &exclude_list)
 {
 	Mutex mutex;
-	auto is = InputStream::OpenReady(storage.MapUTF8(PathTraitsUTF8::Build(directory.GetPath(),
-									       ".mpdignore")).c_str(),
-					 mutex);
+	auto is = storage.OpenFile(PathTraitsUTF8::Build(directory.GetPath(),
+							 ".mpdignore"),
+				   mutex);
+	LockWaitReady(*is);
 	exclude_list.Load(std::move(is));
 }
 
 static void
-LoadExcludeListOrLog(const Storage &storage, const Directory &directory,
+LoadExcludeListOrLog(Storage &storage, const Directory &directory,
 		     ExcludeList &exclude_list) noexcept
 {
 	try {
@@ -456,7 +458,7 @@ UpdateWalk::DirectoryMakeUriParentChecked(Directory &root,
 
 static void
 LoadExcludeLists(std::forward_list<ExcludeList> &lists,
-		 const Storage &storage, const Directory &directory) noexcept
+		 Storage &storage, const Directory &directory) noexcept
 {
 	assert(!lists.empty());
 
@@ -468,7 +470,7 @@ LoadExcludeLists(std::forward_list<ExcludeList> &lists,
 }
 
 static auto
-LoadExcludeLists(const Storage &storage, const Directory &directory) noexcept
+LoadExcludeLists(Storage &storage, const Directory &directory) noexcept
 {
 	std::forward_list<ExcludeList> lists;
 	lists.emplace_front();