From 00dd3a18d244435db5c1e11a0ce83fda1ccbeaa8 Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Thu, 13 Jul 2006 19:18:15 +0000 Subject: [PATCH] DEVEL15-vpurge-needs-no-lock-20060713 don't hold the VOL_LOCK during vpurgevolume volserver's transaction stuff (NewTrans, actually) precludes any problem (cherry picked from commit 6878e0b6348a649768274adbce77500fbd45caa4) --- src/vol/purge.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/vol/purge.c b/src/vol/purge.c index dd94a27ec..5a64b87d8 100644 --- a/src/vol/purge.c +++ b/src/vol/purge.c @@ -63,8 +63,11 @@ static void PurgeIndex_r(Volume * vp, VnodeClass class); static void PurgeHeader_r(Volume * vp); static void PurgeHeader(Volume * vp); +/* No lock needed. Only the volserver will call this, and only one transaction + * can have a given volume (volid/partition pair) in use at a time + */ void -VPurgeVolume_r(Error * ec, Volume * vp) +VPurgeVolume(Error * ec, Volume * vp) { struct DiskPartition *tpartp = vp->partition; char purgePath[MAXPATHLEN]; @@ -86,14 +89,6 @@ VPurgeVolume_r(Error * ec, Volume * vp) FSYNC_VolOp(V_id(vp), tpartp->name, FSYNC_VOL_BREAKCBKS, 0, NULL); } -void -VPurgeVolume(Error * ec, Volume * vp) -{ - VOL_LOCK; - VPurgeVolume_r(ec, vp); - VOL_UNLOCK; -} - #define MAXOBLITATONCE 1000 /* delete a portion of an index, adjusting offset appropriately. Returns 0 if things work and we should be called again, 1 if success full and done, and -1 -- 2.39.5