db/update/VirtualDirectory: add LockMakeVirtualDirectoryIfModified()

This commit is contained in:
Max Kellermann 2019-09-03 19:51:20 +02:00
parent 29fd3172ee
commit 12beb22c1d
2 changed files with 17 additions and 0 deletions

View File

@ -18,6 +18,7 @@
*/
#include "Walk.hxx"
#include "db/DatabaseLock.hxx"
#include "db/plugins/simple/Directory.hxx"
#include "storage/FileInfo.hxx"
@ -49,3 +50,14 @@ UpdateWalk::MakeVirtualDirectoryIfModified(Directory &parent, const char *name,
directory->device = virtual_device;
return directory;
}
Directory *
UpdateWalk::LockMakeVirtualDirectoryIfModified(Directory &parent,
const char *name,
const StorageFileInfo &info,
unsigned virtual_device) noexcept
{
const ScopeDatabaseLock protect;
return MakeVirtualDirectoryIfModified(parent, name,
info, virtual_device);
}

View File

@ -150,6 +150,11 @@ private:
const StorageFileInfo &info,
unsigned virtual_device) noexcept;
Directory *LockMakeVirtualDirectoryIfModified(Directory &parent,
const char *name,
const StorageFileInfo &info,
unsigned virtual_device) noexcept;
Directory *DirectoryMakeChildChecked(Directory &parent,
const char *uri_utf8,
const char *name_utf8) noexcept;