aboutsummaryrefslogtreecommitdiffstats
path: root/src/storage/CompositeStorage.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-02-27 18:51:28 +0100
committerMax Kellermann <max@duempel.org>2014-02-27 20:49:13 +0100
commit2a16fc74fd354484a70efcc5b6dbfcdd73ee5f5a (patch)
tree787b0efd5f39ca58714c4a3b4ab5d46ad75e8156 /src/storage/CompositeStorage.cxx
parentf65254680a8521631ecdd722ff522f574da20d8f (diff)
downloadmpd-2a16fc74fd354484a70efcc5b6dbfcdd73ee5f5a.tar.gz
mpd-2a16fc74fd354484a70efcc5b6dbfcdd73ee5f5a.tar.xz
mpd-2a16fc74fd354484a70efcc5b6dbfcdd73ee5f5a.zip
CompositeStorage: add method GetMount()
Diffstat (limited to 'src/storage/CompositeStorage.cxx')
-rw-r--r--src/storage/CompositeStorage.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/storage/CompositeStorage.cxx b/src/storage/CompositeStorage.cxx
index 9a27270df..ac6fcecd9 100644
--- a/src/storage/CompositeStorage.cxx
+++ b/src/storage/CompositeStorage.cxx
@@ -210,6 +210,19 @@ CompositeStorage::~CompositeStorage()
{
}
+Storage *
+CompositeStorage::GetMount(const char *uri)
+{
+ const ScopeLock protect(mutex);
+
+ auto result = FindStorage(uri);
+ if (*result.uri != 0)
+ /* not a mount point */
+ return nullptr;
+
+ return result.directory->storage;
+}
+
void
CompositeStorage::Mount(const char *uri, Storage *storage)
{