diff options
author | Loic Dachary <loic@dachary.org> | 2013-09-19 09:19:51 +0200 |
---|---|---|
committer | Loic Dachary <loic@dachary.org> | 2013-09-19 09:47:53 +0200 |
commit | 7324931d5ec8e57ff9d5ae4e5700a1a479f5a6bb (patch) | |
tree | 71abec039fbcf162bbfbf3d77bb3e605f6509770 | |
parent | def05f06edb6d48d65126e7261e91808a6d9b054 (diff) | |
download | ceph-7324931d5ec8e57ff9d5ae4e5700a1a479f5a6bb.tar.gz |
ErasureCode: plugin loading in progress flag
The bool loading data member of ErasureCodePluginRegistry is
set to true when a plugin is being loaded, to provide an observable side
effect for test purposes.
Signed-off-by: Loic Dachary <loic@dachary.org>
-rw-r--r-- | src/osd/ErasureCodePlugin.cc | 5 | ||||
-rw-r--r-- | src/osd/ErasureCodePlugin.h | 1 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/osd/ErasureCodePlugin.cc b/src/osd/ErasureCodePlugin.cc index 10b65b2604b..d8b9ae0fbbd 100644 --- a/src/osd/ErasureCodePlugin.cc +++ b/src/osd/ErasureCodePlugin.cc @@ -36,7 +36,8 @@ static ostream& _prefix(std::ostream* _dout) ErasureCodePluginRegistry ErasureCodePluginRegistry::singleton; ErasureCodePluginRegistry::ErasureCodePluginRegistry() : - lock("ErasureCodePluginRegistry::lock") + lock("ErasureCodePluginRegistry::lock"), + loading(false) { } @@ -76,7 +77,9 @@ int ErasureCodePluginRegistry::factory(const std::string &plugin_name, int r = 0; ErasureCodePlugin *plugin = get(plugin_name); if (plugin == 0) { + loading = true; r = load(plugin_name, parameters, &plugin); + loading = false; if (r != 0) return r; } diff --git a/src/osd/ErasureCodePlugin.h b/src/osd/ErasureCodePlugin.h index f1c1ccb31b3..a2feb71695a 100644 --- a/src/osd/ErasureCodePlugin.h +++ b/src/osd/ErasureCodePlugin.h @@ -41,6 +41,7 @@ namespace ceph { class ErasureCodePluginRegistry { public: Mutex lock; + bool loading; std::map<std::string,ErasureCodePlugin*> plugins; static ErasureCodePluginRegistry singleton; |