FSSYNC-Client: Consistent use of partition name

Over time the FSSYNC code has collected examples where the partition
path is passed rather than the partition name.  In Unix this is the
same (/vicepX), but on windows the path is the DOS device (C:).

This checkin changes FSSYNC client code to always use the partition
name.

This checkin does not address FSSYNC server or SALVSYNC.

Change-Id: I3c5b63103ab0cbd6c2c6c73b9dc737eca22b7d4c
Reviewed-on: http://gerrit.openafs.org/5521
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
This commit is contained in:
Rod Widdowson 2011-09-29 15:34:48 +01:00 committed by Jeffrey Altman
parent 0d76ca3c5b
commit b4f96eb78d
3 changed files with 9 additions and 5 deletions

View File

@ -207,7 +207,11 @@ extern afs_int32 FSYNC_GenericOp(void * ext_hdr, size_t ext_len,
int command, int reason,
SYNC_response * res);
/* volume operations control interface */
/*
* volume operations control interface
*
* FSYNC_VolOp must be called with the partition name and not the partition path.
*/
extern afs_int32 FSYNC_VolOp(VolumeId volume, char *partName, int com, int reason,
SYNC_response * res);

View File

@ -4319,7 +4319,7 @@ LockVolume(struct SalvInfo *salvinfo, VolumeId volumeId)
afs_printable_uint32_lu(volumeId));
}
code = FSYNC_VerifyCheckout(volumeId, salvinfo->fileSysPathName, FSYNC_VOL_OFF, FSYNC_SALVAGE);
code = FSYNC_VerifyCheckout(volumeId, salvinfo->fileSysPartition->name, FSYNC_VOL_OFF, FSYNC_SALVAGE);
if (code == SYNC_DENIED) {
/* need to retry checking out volumes */
return -1;

View File

@ -2781,7 +2781,7 @@ attach_volume_header(Error *ec, Volume *vp, struct DiskPartition64 *partp,
SYNC_response res;
memset(&res, 0, sizeof(res));
if (FSYNC_VolOp(volid, VPartitionPath(partp), FSYNC_VOL_NEEDVOLUME, mode, &res)
if (FSYNC_VolOp(volid, partp->name, FSYNC_VOL_NEEDVOLUME, mode, &res)
!= SYNC_OK) {
if (res.hdr.reason == FSYNC_SALVAGE) {
@ -2917,7 +2917,7 @@ attach_volume_header(Error *ec, Volume *vp, struct DiskPartition64 *partp,
#if defined(AFS_DEMAND_ATTACH_FS) && defined(FSSYNC_BUILD_CLIENT)
if (!peek && *ec == 0 && retry == 0 && VMustCheckoutVolume(mode)) {
code = FSYNC_VerifyCheckout(volid, VPartitionPath(partp), FSYNC_VOL_NEEDVOLUME, mode);
code = FSYNC_VerifyCheckout(volid, partp->name, FSYNC_VOL_NEEDVOLUME, mode);
if (code == SYNC_DENIED) {
/* must retry checkout; fileserver no longer thinks we have
@ -5765,7 +5765,7 @@ VScheduleSalvage_r(Volume * vp)
* set the volume to an exclusive state and drop the lock
* around the SALVSYNC call
*/
strlcpy(partName, VPartitionPath(vp->partition), sizeof(partName));
strlcpy(partName, vp->partition->name, sizeof(partName));
state_save = VChangeState_r(vp, VOL_STATE_SALVSYNC_REQ);
VOL_UNLOCK;