From 650223868cae563749fc7bfe4edb8746790fc435 Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Wed, 16 Mar 2011 11:48:08 -0500 Subject: [PATCH] DAFS: DFlushVolume outside of vol glock DFlushVolume may traverse a long list of directory objects, and can even hit the disk, so we should drop the glock for it. This should be safe in DAFS, since we already transition the volume to an exclusive state before doing this, and DFlushVolume only deals with structures internal to the directory package and maintains its own locking. Reviewed-on: http://gerrit.openafs.org/4242 Tested-by: BuildBot Reviewed-by: Derrick Brashear (cherry picked from commit a18175f479437f3a4fe68460538927630070cd13) Change-Id: I355c53c6f224c5471da70827f30511986abeac27 Reviewed-on: http://gerrit.openafs.org/5767 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- src/vol/volume.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/vol/volume.c b/src/vol/volume.c index b10acdd51..72aab74c9 100644 --- a/src/vol/volume.c +++ b/src/vol/volume.c @@ -4268,15 +4268,17 @@ VCloseVolumeHandles_r(Volume * vp) VolState state_save; state_save = VChangeState_r(vp, VOL_STATE_OFFLINING); + + VOL_UNLOCK; #endif - /* demand attach fs - * - * XXX need to investigate whether we can perform - * DFlushVolume outside of vol_glock_mutex... - * - * VCloseVnodeFiles_r drops the glock internally */ DFlushVolume(vp->hashid); + +#ifdef AFS_DEMAND_ATTACH_FS + VOL_LOCK; +#endif + + /* DAFS: VCloseVnodeFiles_r drops the glock internally */ VCloseVnodeFiles_r(vp); #ifdef AFS_DEMAND_ATTACH_FS @@ -4320,13 +4322,17 @@ VReleaseVolumeHandles_r(Volume * vp) VolState state_save; state_save = VChangeState_r(vp, VOL_STATE_DETACHING); + + VOL_UNLOCK; #endif - /* XXX need to investigate whether we can perform - * DFlushVolume outside of vol_glock_mutex... */ DFlushVolume(vp->hashid); - VReleaseVnodeFiles_r(vp); /* releases the glock internally */ +#ifdef AFS_DEMAND_ATTACH_FS + VOL_LOCK; +#endif + + VReleaseVnodeFiles_r(vp); /* DAFS: releases the glock internally */ #ifdef AFS_DEMAND_ATTACH_FS VOL_UNLOCK; -- 2.39.5