From a2fa4e6e7be4d99225a7843372c449728b20237a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rados=C5=82aw=20Korzeniewski?= Date: Thu, 24 Jun 2021 16:20:35 +0200 Subject: [PATCH] metaplugin - Remove locking on request. --- .../src/plugins/fd/pluginlib/metaplugin.cpp | 20 +++++++++---------- bacula/src/plugins/fd/pluginlib/metaplugin.h | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/bacula/src/plugins/fd/pluginlib/metaplugin.cpp b/bacula/src/plugins/fd/pluginlib/metaplugin.cpp index d445e058e..ce15c27d3 100644 --- a/bacula/src/plugins/fd/pluginlib/metaplugin.cpp +++ b/bacula/src/plugins/fd/pluginlib/metaplugin.cpp @@ -1161,7 +1161,7 @@ bRC METAPLUGIN::handlePluginEvent(bpContext *ctx, bEvent *event, void *value) // extract original plugin context, basically it should be `this` METAPLUGIN *pctx = (METAPLUGIN *)ctx->pContext; // this ensures that handlePluginEvent is thread safe for extracted pContext - smart_lock lg(&pctx->mutex); + // smart_lock lg(&pctx->mutex); - removed on request if (job_cancelled) { return bRC_Error; @@ -1862,7 +1862,7 @@ bRC METAPLUGIN::pluginIO(bpContext *ctx, struct io_pkt *io) { // synchronie access to job_cancelled variable - smart_lock lg(&mutex); + // smart_lock lg(&mutex); - removed on request if (job_cancelled) { return bRC_Error; } @@ -1981,7 +1981,7 @@ bRC METAPLUGIN::startBackupFile(bpContext *ctx, struct save_pkt *sp) { // synchronie access to job_cancelled variable - smart_lock lg(&mutex); + // smart_lock lg(&mutex); - removed on request if (job_cancelled) { return bRC_Error; } @@ -2174,7 +2174,7 @@ bRC METAPLUGIN::endBackupFile(bpContext *ctx) { // synchronie access to job_cancelled variable - smart_lock lg(&mutex); + // smart_lock lg(&mutex); - removed on request if (job_cancelled) { return bRC_Error; } @@ -2245,7 +2245,7 @@ bRC METAPLUGIN::createFile(bpContext *ctx, struct restore_pkt *rp) { // synchronie access to job_cancelled variable - smart_lock lg(&mutex); + // smart_lock lg(&mutex); - removed on request if (job_cancelled) { return bRC_Error; } @@ -2375,7 +2375,7 @@ bRC METAPLUGIN::handleXACLdata(bpContext *ctx, struct xacl_pkt *xacl) { { // synchronie access to job_cancelled variable - smart_lock lg(&mutex); + // smart_lock lg(&mutex); - removed on request if (job_cancelled) { return bRC_Error; } @@ -2454,7 +2454,7 @@ bRC METAPLUGIN::queryParameter(bpContext *ctx, struct query_pkt *qp) { // synchronie access to job_cancelled variable - smart_lock lg(&mutex); + // smart_lock lg(&mutex); - removed on request if (job_cancelled) { return bRC_Error; } @@ -2542,7 +2542,7 @@ bRC METAPLUGIN::metadataRestore(bpContext *ctx, struct meta_pkt *mp) { { // synchronie access to job_cancelled variable - smart_lock lg(&mutex); + // smart_lock lg(&mutex); - removed on request if (job_cancelled) { return bRC_Error; } @@ -2604,7 +2604,7 @@ bRC METAPLUGIN::checkFile(bpContext * ctx, char *fname) if ((!CUSTOMNAMESPACE && isourpluginfname(PLUGINPREFIX, fname)) || (CUSTOMNAMESPACE && isourpluginfname(PLUGINNAMESPACE, fname))) { // synchronie access to job_cancelled variable - smart_lock lg(&mutex); + // smart_lock lg(&mutex); - removed on request if (!job_cancelled) { if (::checkFile != NULL) { return ::checkFile(ctx, fname); @@ -2649,7 +2649,7 @@ bRC backendctx_termination_func(PTCOMM *ptcomm, void *cp) */ void METAPLUGIN::terminate_backends_oncancel(bpContext *ctx) { - smart_lock lg(&mutex); + // smart_lock lg(&mutex); - removed on request if (job_cancelled) { DMSG0(ctx, DINFO, "Ensure backend termination on cancelled job\n"); backend.foreach_command_status(backendctx_termination_func, ctx); diff --git a/bacula/src/plugins/fd/pluginlib/metaplugin.h b/bacula/src/plugins/fd/pluginlib/metaplugin.h index cd6b89ea0..b74658d43 100644 --- a/bacula/src/plugins/fd/pluginlib/metaplugin.h +++ b/bacula/src/plugins/fd/pluginlib/metaplugin.h @@ -180,7 +180,7 @@ private: }; bool job_cancelled; // it signal the metaplugin that job was cancelled - smart_mutex mutex; // mutex to synchronize data access + // smart_mutex mutex; // mutex to synchronize data access - removed on request bool backend_available; // When `False` then backend program is unuseable or unavailable POOL_MEM backend_error; // Holds the error string when backend program is unavailable MODE mode; // Plugin mode of operation -- 2.47.3