]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
DAFS: Preattach, not attach, in FSYNC_Drop
authorAndrew Deason <adeason@sinenomine.net>
Thu, 31 May 2012 21:41:15 +0000 (16:41 -0500)
committerStephan Wiesand <stephan.wiesand@desy.de>
Tue, 3 Sep 2013 16:39:38 +0000 (09:39 -0700)
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 <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit a43f0e4717fd72727ae325eb4437cef065419cdd)

Change-Id: Iaa2320808c4855516192b164de9778c9019a4559
Reviewed-on: http://gerrit.openafs.org/9481
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/vol/fssync-server.c

index 8678fd59df88c591ac836ab3eb40c0516e587323..e3830e158322742b33acbfb02149ab387fdb9eae 100644 (file)
@@ -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;
        }
     }