mirror of
https://git.openafs.org/openafs.git
synced 2025-01-20 16:00:12 +00:00
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. Change-Id: I2c9d0b8cf0ddc7f4182347706b2c26d86f69725e Reviewed-on: http://gerrit.openafs.org/7515 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@dementix.org>
This commit is contained in:
parent
fff80cb198
commit
a43f0e4717
@ -1986,21 +1986,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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user