}
DiskToVolumeHeader(&iheader, &diskHeader);
- if (programType == volumeUtility && mode != V_SECRETLY) {
+ if (programType == volumeUtility && mode != V_SECRETLY && mode != V_PEEK) {
if (FSYNC_askfs(iheader.id, partition, FSYNC_NEEDVOLUME, mode)
== FSYNC_DENIED) {
Log("VAttachVolume: attach of volume %u apparently denied by file server\n", iheader.id);
* takes the volume offline or not. If the volume isn't
* offline, we must not return it when we detach the volume,
* or the server will abort */
- if (mode == V_READONLY
+ if (mode == V_READONLY || mode == V_PEEK
|| (!VolumeWriteable(vp) && (mode == V_CLONE || mode == V_DUMP)))
vp->needsPutBack = 0;
else
* for all of that to happen, but if it does, probably the right
* fix is for the server to allow the return of readonly volumes
* that it doesn't think are really checked out. */
- if (programType == volumeUtility && vp == NULL && mode != V_SECRETLY) {
+ if (programType == volumeUtility && vp == NULL &&
+ mode != V_SECRETLY && mode != V_PEEK) {
FSYNC_askfs(iheader.id, partition, FSYNC_ON, 0);
} else if (programType == fileServer && vp) {
V_needsCallback(vp) = 0;
* never knows about more than one copy of the same volume--when
* a volume is moved from one partition to another on a single
* server */
+#define V_PEEK 6 /* "Peek" at the volume without telling the fileserver. This is
+ * similar to V_SECRETLY, but read-only. It is used in cases where
+ * not impacting fileserver performance is more important than
+ * getting the most recent data. */
+
#if defined(NEARINODE_HINT)
#define V_pref(vp,nearInode) nearInodeHash(V_id(vp),(nearInode)); (nearInode) %= V_partition(vp)->f_files
pntr->volid = volid;
goto drop;
}
- tv = VAttachVolumeByName(&error, pname, volname, V_READONLY);
+ tv = VAttachVolumeByName(&error, pname, volname, V_PEEK);
if (error) {
pntr->status = 0; /*things are messed up */
strcpy(pntr->name, volname);
/*
* Attach the volume, give up on the volume if we can't.
*/
- tv = VAttachVolumeByName(&error, pname, volname, V_READONLY);
+ tv = VAttachVolumeByName(&error, pname, volname, V_PEEK);
if (error) {
xInfoP->status = 0; /*things are messed up */
strcpy(xInfoP->name, volname);
pntr->volid = volid;
goto drop;
}
- tv = VAttachVolumeByName(&error, pname, volname, V_READONLY);
+ tv = VAttachVolumeByName(&error, pname, volname, V_PEEK);
if (error) {
pntr->status = 0; /*things are messed up */
strcpy(pntr->name, volname);
/*
* Attach the volume, give up on this volume if we can't.
*/
- tv = VAttachVolumeByName(&error, pname, volname, V_READONLY);
+ tv = VAttachVolumeByName(&error, pname, volname, V_PEEK);
if (error) {
xInfoP->status = 0; /*things are messed up */
strcpy(xInfoP->name, volname);