From: Radosław Korzeniewski Date: Fri, 26 Nov 2021 17:20:24 +0000 (+0100) Subject: pluginlib: Remove smart_lock. X-Git-Tag: Beta-15.0.0~745 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b94b221834a4dea6b926da30e3e754031ae3b61d;p=thirdparty%2Fbacula.git pluginlib: Remove smart_lock. --- diff --git a/bacula/src/plugins/fd/pluginlib/Makefile b/bacula/src/plugins/fd/pluginlib/Makefile index cf0e29246..9f1dc3b45 100644 --- a/bacula/src/plugins/fd/pluginlib/Makefile +++ b/bacula/src/plugins/fd/pluginlib/Makefile @@ -26,21 +26,17 @@ PLUGINCTXOBJ = $(filter %.lo,$(PLUGINCTXSRC:.cpp=.lo)) COMMCTXSRC = commctx.h SMARTALISTSRC = smartalist.h SMARTPTRSRC = smartptr.h -SMARTMUTEXSRC = smartmutex.h -SMARTLOCKSRC = smartlock.h - -PLUGINLIBSTEST = pluginlib_test.cpp $(PLUGINLIBSSRC) $(UNITTESTSOBJ) $(INIOBJ) -PLUGINLIBSTESTOBJ = $(filter %.lo,$(PLUGINLIBSTEST:.cpp=.lo)) -ISO8601TEST = iso8601_test.cpp $(ISO8601SRC) $(UNITTESTSOBJ) -ISO8601TESTOBJ = $(filter %.lo,$(ISO8601TEST:.cpp=.lo)) -COMMCTXTEST = commctx_test.cpp $(COMMCTXSRC) $(SMARTALISTSRC) $(PLUGINLIBSOBJ) $(UNITTESTSOBJ) $(INIOBJ) -COMMCTXTESTOBJ = $(filter %.lo,$(COMMCTXTEST:.cpp=.lo)) -SMARTALISTTEST = smartalist_test.cpp $(SMARTALISTSRC) $(PLUGINLIBSOBJ) $(UNITTESTSOBJ) $(INIOBJ) -SMARTALISTTESTOBJ = $(filter %.lo,$(SMARTALISTTEST:.cpp=.lo)) -SMARTPTRTEST = smartptr_test.cpp $(SMARTPTRSRC) $(PLUGINLIBSOBJ) $(UNITTESTSOBJ) $(INIOBJ) -SMARTPTRTESTOBJ = $(filter %.lo,$(SMARTPTRTEST:.cpp=.lo)) -SMARTLOCKTEST = smartlock_test.cpp $(SMARTLOCKSRC) $(SMARTMUTEXSRC) $(UNITTESTSOBJ) -SMARTLOCKTESTOBJ = $(filter %.lo,$(SMARTLOCKTEST:.cpp=.lo)) + +PLUGINLIBSTEST = pluginlib_test.cpp $(PLUGINLIBSSRC) +PLUGINLIBSTESTOBJ = $(filter %.lo,$(PLUGINLIBSTEST:.cpp=.lo)) $(INIOBJ) $(UNITTESTSOBJ) +ISO8601TEST = iso8601_test.cpp $(ISO8601SRC) +ISO8601TESTOBJ = $(filter %.lo,$(ISO8601TEST:.cpp=.lo)) $(UNITTESTSOBJ) +COMMCTXTEST = commctx_test.cpp $(COMMCTXSRC) $(SMARTALISTSRC) +COMMCTXTESTOBJ = $(filter %.lo,$(COMMCTXTEST:.cpp=.lo)) $(INIOBJ) $(PLUGINLIBSOBJ) $(UNITTESTSOBJ) +SMARTALISTTEST = smartalist_test.cpp $(SMARTALISTSRC) +SMARTALISTTESTOBJ = $(filter %.lo,$(SMARTALISTTEST:.cpp=.lo)) $(INIOBJ) $(PLUGINLIBSOBJ) $(UNITTESTSOBJ) +SMARTPTRTEST = smartptr_test.cpp $(SMARTPTRSRC) +SMARTPTRTESTOBJ = $(filter %.lo,$(SMARTPTRTEST:.cpp=.lo)) $(INIOBJ) $(PLUGINLIBSOBJ) $(UNITTESTSOBJ) METAPLUGINTEST = metaplugin_test.cpp $(METAPLUGINSRC) METAPLUGINTESTOBJ = $(filter %.lo,$(METAPLUGINTEST:.cpp=.lo)) $(PTCOMMOBJ) $(PLUGINLIBSOBJ) $(METAPLUGINOBJ) $(UNITTESTSOBJ) $(LIBBACOBJ) $(LIBBACCFGOBJ) @@ -51,7 +47,7 @@ TESTMETAPLUGINBACKENDOBJ = $(TESTMETAPLUGINBACKENDSRC:.c=.lo) # COMMONPLUGINOBJ = $(PLUGINLIBSOBJ) $(ISO8601OBJ) $(EXECPROGOBJ) COMMONPLUGINOBJ = $(PLUGINLIBSOBJ) $(PTCOMMOBJ) $(METAPLUGINOBJ) $(PLUGINCLASSOBJ) $(PLUGINBASEOBJ) # COMMONPLUGINTESTS = iso8601_test -COMMONPLUGINTESTS = pluginlib_test smartalist_test smartptr_test commctx_test smartlock_test iso8601_test +COMMONPLUGINTESTS = pluginlib_test smartalist_test smartptr_test commctx_test iso8601_test .c.lo: @echo "Compiling $< ..." diff --git a/bacula/src/plugins/fd/pluginlib/metaplugin.cpp b/bacula/src/plugins/fd/pluginlib/metaplugin.cpp index cba68d140..05ef0bb47 100644 --- a/bacula/src/plugins/fd/pluginlib/metaplugin.cpp +++ b/bacula/src/plugins/fd/pluginlib/metaplugin.cpp @@ -1207,7 +1207,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); - removed on request + // lock_guard lg(&pctx->mutex); - removed on request if (job_cancelled) { return bRC_Error; @@ -2177,7 +2177,7 @@ bRC METAPLUGIN::pluginIO(bpContext *ctx, struct io_pkt *io) { // synchronie access to job_cancelled variable - // smart_lock lg(&mutex); - removed on request + // lock_guard lg(&mutex); - removed on request if (job_cancelled) { return bRC_Error; } @@ -2507,7 +2507,7 @@ bRC METAPLUGIN::endBackupFile(bpContext *ctx) { // synchronie access to job_cancelled variable - // smart_lock lg(&mutex); - removed on request + // lock_guard lg(&mutex); - removed on request if (job_cancelled) { return bRC_Error; } @@ -2611,7 +2611,7 @@ bRC METAPLUGIN::createFile(bpContext *ctx, struct restore_pkt *rp) { // synchronie access to job_cancelled variable - // smart_lock lg(&mutex); - removed on request + // lock_guard lg(&mutex); - removed on request if (job_cancelled) { return bRC_Error; } @@ -2723,7 +2723,7 @@ bRC METAPLUGIN::handleXACLdata(bpContext *ctx, struct xacl_pkt *xacl) { { // synchronie access to job_cancelled variable - // smart_lock lg(&mutex); - removed on request + // lock_guard lg(&mutex); - removed on request if (job_cancelled) { return bRC_Error; } @@ -2795,7 +2795,7 @@ bRC METAPLUGIN::queryParameter(bpContext *ctx, struct query_pkt *qp) { // synchronie access to job_cancelled variable - // smart_lock lg(&mutex); - removed on request + // lock_guard lg(&mutex); - removed on request if (job_cancelled) { return bRC_Error; } @@ -2913,7 +2913,7 @@ bRC METAPLUGIN::metadataRestore(bpContext *ctx, struct meta_pkt *mp) { { // synchronie access to job_cancelled variable - // smart_lock lg(&mutex); - removed on request + // lock_guard lg(&mutex); - removed on request if (job_cancelled) { return bRC_Error; } @@ -2975,7 +2975,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); - removed on request + // lock_guard lg(&mutex); - removed on request if (!job_cancelled) { if (::checkFile != NULL) { return ::checkFile(ctx, fname); @@ -3020,7 +3020,7 @@ bRC backendctx_termination_func(PTCOMM *ptcomm, void *cp) */ void METAPLUGIN::terminate_backends_oncancel(bpContext *ctx) { - // smart_lock lg(&mutex); - removed on request + // lock_guard 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/pluginctx.cpp b/bacula/src/plugins/fd/pluginlib/pluginctx.cpp index 00299e26d..6c4b128bf 100644 --- a/bacula/src/plugins/fd/pluginlib/pluginctx.cpp +++ b/bacula/src/plugins/fd/pluginlib/pluginctx.cpp @@ -986,7 +986,7 @@ namespace pluginlib // extract original plugin context, basically it should be `this` PLUGINCLASS *pctx = (PLUGINCLASS *)ctx->pContext; // this ensures that handlePluginEvent is thread safe for extracted pContext - // smart_lock lg(&pctx->mutex); - removed on request + // lock_guard lg(&pctx->mutex); - removed on request if (job_cancelled) { return bRC_Error; @@ -1931,7 +1931,7 @@ namespace pluginlib { // synchronie access to job_cancelled variable - // smart_lock lg(&mutex); - removed on request + // lock_guard lg(&mutex); - removed on request if (job_cancelled) { return bRC_Error; } @@ -2214,7 +2214,7 @@ namespace pluginlib { // synchronie access to job_cancelled variable - // smart_lock lg(&mutex); - removed on request + // lock_guard lg(&mutex); - removed on request if (job_cancelled) { return bRC_Error; } @@ -2316,7 +2316,7 @@ namespace pluginlib { // synchronie access to job_cancelled variable - // smart_lock lg(&mutex); - removed on request + // lock_guard lg(&mutex); - removed on request if (job_cancelled) { return bRC_Error; } @@ -2428,7 +2428,7 @@ namespace pluginlib { { // synchronie access to job_cancelled variable - // smart_lock lg(&mutex); - removed on request + // lock_guard lg(&mutex); - removed on request if (job_cancelled) { return bRC_Error; } @@ -2500,7 +2500,7 @@ namespace pluginlib { // synchronie access to job_cancelled variable - // smart_lock lg(&mutex); - removed on request + // lock_guard lg(&mutex); - removed on request if (job_cancelled) { return bRC_Error; } @@ -2618,7 +2618,7 @@ namespace pluginlib { { // synchronie access to job_cancelled variable - // smart_lock lg(&mutex); - removed on request + // lock_guard lg(&mutex); - removed on request if (job_cancelled) { return bRC_Error; } @@ -2680,7 +2680,7 @@ namespace pluginlib if ((!CUSTOMNAMESPACE && isourpluginfname(PLUGINPREFIX, fname)) || (CUSTOMNAMESPACE && isourpluginfname(PLUGINNAMESPACE, fname))) { // synchronie access to job_cancelled variable - // smart_lock lg(&mutex); - removed on request + // lock_guard lg(&mutex); - removed on request if (!job_cancelled) { if (::checkFile != NULL) { return ::checkFile(ctx, fname);