#ifndef CM_MEMMAP_H
#define CM_MEMMAP_H 1
-#define CM_CONFIG_DATA_VERSION 1
+#define CM_CONFIG_DATA_VERSION 2
#define CM_CONFIG_DATA_MAGIC ('A' | 'F'<<8 | 'S'<<16 | CM_CONFIG_DATA_VERSION<<24)
typedef struct cm_config_data {
* to copy the dotdotFipd from the volume structure where the
* "master" copy is stored (defect 11489)
*/
- if (scp->fid.vnode == 1 && scp->fid.unique == 1) {
- scp->dotdotFid = volp->dotdotFid;
- }
-
- if (volp->ro.ID == fidp->volume)
+ if (volp->ro.ID == fidp->volume) {
scp->flags |= (CM_SCACHEFLAG_PURERO | CM_SCACHEFLAG_RO);
- else if (volp->bk.ID == fidp->volume)
+ if (scp->fid.vnode == 1 && scp->fid.unique == 1)
+ scp->dotdotFid = volp->ro.dotdotFid;
+ } else if (volp->bk.ID == fidp->volume) {
scp->flags |= CM_SCACHEFLAG_RO;
+ if (scp->fid.vnode == 1 && scp->fid.unique == 1)
+ scp->dotdotFid = volp->bk.dotdotFid;
+ } else {
+ if (scp->fid.vnode == 1 && scp->fid.unique == 1)
+ scp->dotdotFid = volp->rw.dotdotFid;
+ }
}
if (volp)
cm_PutVolume(volp);
if (code == 0) {
afs_uint32 cell, volume;
- /* save the parent of the volume root for this is the
- * place where the volume is mounted and we must remember
- * this in the volume structure rather than just in the
- * scache entry lest the scache entry gets recycled
- * (defect 11489)
- */
- lock_ObtainMutex(&volp->mx);
- volp->dotdotFid = dscp->fid;
- lock_ReleaseMutex(&volp->mx);
-
cell = cellp->cellID;
/* if the mt pt originates in a .backup volume (not a .readonly)
volp->ro.ID != 0) {
targetType = ROVOL;
}
- if (targetType == ROVOL)
+ if (targetType == ROVOL) {
volume = volp->ro.ID;
- else if (targetType == BACKVOL)
+ lock_ObtainMutex(&volp->mx);
+ volp->ro.dotdotFid = dscp->fid;
+ lock_ReleaseMutex(&volp->mx);
+ } else if (targetType == BACKVOL) {
volume = volp->bk.ID;
- else
+ lock_ObtainMutex(&volp->mx);
+ volp->bk.dotdotFid = dscp->fid;
+ lock_ReleaseMutex(&volp->mx);
+ } else {
volume = volp->rw.ID;
+ lock_ObtainMutex(&volp->mx);
+ volp->rw.dotdotFid = dscp->fid;
+ lock_ReleaseMutex(&volp->mx);
+ }
/* the rest of the fid is a magic number */
cm_SetFid(&scp->mountRootFid, cell, volume, 1, 1);
cm_VolumeStatusNotification(volp, volp->bk.ID, volp->bk.state, vl_alldown);
volp->rw.ID = volp->ro.ID = volp->bk.ID = 0;
- volp->dotdotFid.cell = 0;
- volp->dotdotFid.volume = 0;
- volp->dotdotFid.unique = 0;
- volp->dotdotFid.vnode = 0;
- volp->dotdotFid.hash = 0;
+ cm_SetFid(&volp->rw.dotdotFid, 0, 0, 0, 0);
+ cm_SetFid(&volp->ro.dotdotFid, 0, 0, 0, 0);
+ cm_SetFid(&volp->bk.dotdotFid, 0, 0, 0, 0);
volp->namep[0] ='\0';
} else {
rwNewstate = roNewstate = bkNewstate = vl_alldown;
cm_VolumeStatusNotification(volp, volp->bk.ID, volp->bk.state, vl_unknown);
volp->rw.ID = volp->ro.ID = volp->bk.ID = 0;
- volp->dotdotFid.cell = 0;
- volp->dotdotFid.volume = 0;
- volp->dotdotFid.unique = 0;
- volp->dotdotFid.vnode = 0;
- volp->dotdotFid.hash = 0;
+ cm_SetFid(&volp->rw.dotdotFid, 0, 0, 0, 0);
+ cm_SetFid(&volp->ro.dotdotFid, 0, 0, 0, 0);
+ cm_SetFid(&volp->bk.dotdotFid, 0, 0, 0, 0);
} else {
volp = &cm_data.volumeBaseAddress[cm_data.currentVolumes++];
memset(volp, 0, sizeof(cm_volume_t));
for (volp = cm_data.allVolumesp; volp; volp=volp->allNextp)
{
- sprintf(output, "%s - volp=0x%p cell=%s name=%s rwID=%u roID=%u bkID=%u flags=0x%x dotdotFid (cell=%d, volume=%d, vnode=%d, unique=%d) refCount=%u\r\n",
+ sprintf(output, "%s - volp=0x%p cell=%s name=%s rwID=%u roID=%u bkID=%u flags=0x%x refCount=%u\r\n",
cookie, volp, volp->cellp->name, volp->namep, volp->rw.ID, volp->ro.ID, volp->bk.ID, volp->flags,
- volp->dotdotFid.cell, volp->dotdotFid.volume, volp->dotdotFid.vnode, volp->dotdotFid.unique,
volp->refCount);
WriteFile(outputFile, output, (DWORD)strlen(output), &zilch, NULL);
}
#define CM_VOLUME_MAGIC ('V' | 'O' <<8 | 'L'<<16 | 'M'<<24)
typedef struct cm_vol_state {
- afs_uint32 ID; /* by mx */
struct cm_volume *nextp; /* volumeIDHashTable; by cm_volumeLock */
+ afs_uint32 ID; /* by mx */
+ struct cm_fid dotdotFid; /* parent of volume root */
cm_serverRef_t *serversp; /* by mx */
enum volstatus state; /* by mx */
afs_uint32 flags; /* by mx */
struct cm_vol_state rw; /* by cm_volumeLock */
struct cm_vol_state ro; /* by cm_volumeLock */
struct cm_vol_state bk; /* by cm_volumeLock */
- struct cm_fid dotdotFid; /* parent of volume root */
osi_mutex_t mx;
afs_uint32 flags; /* by mx */
afs_int32 refCount; /* by Interlocked operations */