Windows: add cm_IsVolumeReplicated()

Given a file id indicates whether the volume it is located on
is replicated or not.

Change-Id: Icae0a387fc26e2a76b4b6f87fdb5c330da31a96b
Reviewed-on: http://gerrit.openafs.org/7758
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
This commit is contained in:
Jeffrey Altman 2012-07-06 16:02:38 -04:00
parent a9be0735b5
commit 2dbe1316a1
2 changed files with 19 additions and 0 deletions

View File

@ -1973,3 +1973,20 @@ cm_ChecksumVolumeServerList(struct cm_fid *fidp, cm_user_t *userp, cm_req_t *req
}
return cksum;
}
afs_int32
cm_IsVolumeReplicated(cm_fid_t *fidp)
{
afs_int32 replicated = 0;
cm_volume_t *volp;
cm_vol_state_t * volstatep;
volp = cm_GetVolumeByFID(fidp);
if (volp) {
volstatep = cm_VolumeStateByID(volp, fidp->volume);
replicated = (volstatep->flags & CM_VOL_STATE_FLAG_REPLICATED);
cm_PutVolume(volp);
}
return replicated;
}

View File

@ -166,5 +166,7 @@ extern afs_int32 cm_VolumeType(cm_volume_t *volp, afs_uint32 id);
extern long cm_UpdateVolumeLocation(struct cm_cell *cellp, cm_user_t *userp, cm_req_t *reqp,
cm_volume_t *volp);
extern afs_int32 cm_IsVolumeReplicated(cm_fid_t *fidp);
extern osi_rwlock_t cm_volumeLock;
#endif /* OPENAFS_WINNT_AFSD_CM_VOLUME_H */