From: Andrew Deason Date: Thu, 31 May 2012 21:41:15 +0000 (-0500) Subject: DAFS: Preattach, not attach, in FSYNC_Drop X-Git-Tag: upstream/1.6.6_pre2^2~99 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=ab524b5ed55bdcd296bea28ec717c0708e0c2553;p=packages%2Fo%2Fopenafs.git DAFS: Preattach, not attach, in FSYNC_Drop FSYNC_Drop currently attaches volumes that were checked out by the dropped fssync handler, but not checked back in, in order to make the volume available again. For DAFS, however, a full attachment is unnecessary; just preattach instead. Reviewed-on: http://gerrit.openafs.org/7515 Tested-by: BuildBot Reviewed-by: Derrick Brashear (cherry picked from commit a43f0e4717fd72727ae325eb4437cef065419cdd) Change-Id: Iaa2320808c4855516192b164de9778c9019a4559 Reviewed-on: http://gerrit.openafs.org/9481 Tested-by: BuildBot Reviewed-by: Derrick Brashear Reviewed-by: Andrew Deason Reviewed-by: Michael Meffie Reviewed-by: Stephan Wiesand --- diff --git a/src/vol/fssync-server.c b/src/vol/fssync-server.c index 8678fd59d..e3830e158 100644 --- a/src/vol/fssync-server.c +++ b/src/vol/fssync-server.c @@ -2008,21 +2008,32 @@ FSYNC_Drop(osi_socket fd) struct offlineInfo *p; int i; Error error; +#ifndef AFS_DEMAND_ATTACH_FS char tvolName[VMAXPATHLEN]; +#endif VOL_LOCK; p = OfflineVolumes[FindHandler(fd)]; for (i = 0; i < MAXOFFLINEVOLUMES; i++) { if (p[i].volumeID) { - Volume *vp; +#ifdef AFS_DEMAND_ATTACH_FS + vp = VPreAttachVolumeById_r(&error, p[i].partName, p[i].volumeID); + if (vp) { + VCreateReservation_r(vp); + VWaitExclusiveState_r(vp); + VDeregisterVolOp_r(vp); + VCancelReservation_r(vp); + } +#else tvolName[0] = OS_DIRSEPC; sprintf(&tvolName[1], VFORMAT, afs_printable_uint32_lu(p[i].volumeID)); vp = VAttachVolumeByName_r(&error, p[i].partName, tvolName, V_VOLUPD); if (vp) VPutVolume_r(vp); +#endif /* !AFS_DEMAND_ATTACH_FS */ p[i].volumeID = 0; } }