#ifdef AFS_DISCON_ENV
afs_int32 afs_is_disconnected;
-afs_int32 afs_is_logging;
afs_int32 afs_is_discon_rw;
/* On reconnection, turn this knob on until it finishes,
* then turn it off.
DECL_PIOCTL(PRxStatProc);
DECL_PIOCTL(PRxStatPeer);
DECL_PIOCTL(PPrefetchFromTape);
-DECL_PIOCTL(PFsCmd);
+DECL_PIOCTL(PResidencyCmd);
DECL_PIOCTL(PCallBackAddr);
DECL_PIOCTL(PDiscon);
DECL_PIOCTL(PNFSNukeCreds);
PBogus, /* 64 -- arla: force cache check */
PBogus, /* 65 -- arla: break callback */
PPrefetchFromTape, /* 66 -- MR-AFS: prefetch file from tape */
- PFsCmd, /* 67 -- RXOSD: generic commnd interface */
+ PResidencyCmd, /* 67 -- MR-AFS: generic commnd interface */
PBogus, /* 68 -- arla: fetch stats */
PGetVnodeXStatus2, /* 69 - get caller access and some vcache status */
};
switch (acom & 0xff) {
case 1:
- avc->states |= CSafeStore;
+ avc->f.states |= CSafeStore;
avc->asynchrony = 0;
+ /* SXW - Should we force a MetaData flush for this flag setting */
break;
/* case 2 used to be abort store, but this is no longer provided,
register struct cell *tcell;
register afs_int32 i;
- tcell = afs_GetCell(avc->fid.Cell, READ_LOCK);
+ tcell = afs_GetCell(avc->f.fid.Cell, READ_LOCK);
if (tcell) {
i = strlen(tcell->cellName) + 1; /* bytes to copy out */
AFS_STATCNT(PGetFID);
if (!avc)
return EINVAL;
- memcpy(aout, (char *)&avc->fid, sizeof(struct VenusFid));
+ memcpy(aout, (char *)&avc->f.fid, sizeof(struct VenusFid));
*aoutSize = sizeof(struct VenusFid);
return 0;
}
DECL_PIOCTL(PSetAcl)
{
register afs_int32 code;
- struct conn *tconn;
+ struct afs_conn *tconn;
struct AFSOpaque acl;
struct AFSVolSync tsync;
struct AFSFetchStatus OutStatus;
acl.AFSOpaque_val = ain;
do {
- tconn = afs_Conn(&avc->fid, areq, SHARED_LOCK);
+ tconn = afs_Conn(&avc->f.fid, areq, SHARED_LOCK);
if (tconn) {
XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_STOREACL);
RX_AFS_GUNLOCK();
code =
- RXAFS_StoreACL(tconn->id, (struct AFSFid *)&avc->fid.Fid,
+ RXAFS_StoreACL(tconn->id, (struct AFSFid *)&avc->f.fid.Fid,
&acl, &OutStatus, &tsync);
RX_AFS_GLOCK();
XSTATS_END_TIME;
} else
code = -1;
} while (afs_Analyze
- (tconn, code, &avc->fid, areq, AFS_STATS_FS_RPCIDX_STOREACL,
+ (tconn, code, &avc->f.fid, areq, AFS_STATS_FS_RPCIDX_STOREACL,
SHARED_LOCK, NULL));
/* now we've forgotten all of the access info */
ObtainWriteLock(&afs_xcbhash, 455);
avc->callback = 0;
afs_DequeueCallback(avc);
- avc->states &= ~(CStatd | CUnique);
+ avc->f.states &= ~(CStatd | CUnique);
ReleaseWriteLock(&afs_xcbhash);
- if (avc->fid.Fid.Vnode & 1 || (vType(avc) == VDIR))
+ if (avc->f.fid.Fid.Vnode & 1 || (vType(avc) == VDIR))
osi_dnlc_purgedp(avc);
+
+ /* SXW - Should we flush metadata here? */
return code;
}
struct AFSVolSync tsync;
struct AFSFetchStatus OutStatus;
afs_int32 code;
- struct conn *tconn;
+ struct afs_conn *tconn;
struct AFSFid Fid;
XSTATS_DECLS;
AFS_STATCNT(PGetAcl);
if (!avc)
return EINVAL;
- Fid.Volume = avc->fid.Fid.Volume;
- Fid.Vnode = avc->fid.Fid.Vnode;
- Fid.Unique = avc->fid.Fid.Unique;
- if (avc->states & CForeign) {
+ Fid.Volume = avc->f.fid.Fid.Volume;
+ Fid.Vnode = avc->f.fid.Fid.Vnode;
+ Fid.Unique = avc->f.fid.Fid.Unique;
+ if (avc->f.states & CForeign) {
/*
* For a dfs xlator acl we have a special hack so that the
* xlator will distinguish which type of acl will return. So
}
acl.AFSOpaque_val = aout;
do {
- tconn = afs_Conn(&avc->fid, areq, SHARED_LOCK);
+ tconn = afs_Conn(&avc->f.fid, areq, SHARED_LOCK);
if (tconn) {
*aout = 0;
XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_FETCHACL);
} else
code = -1;
} while (afs_Analyze
- (tconn, code, &avc->fid, areq, AFS_STATS_FS_RPCIDX_FETCHACL,
+ (tconn, code, &avc->f.fid, areq, AFS_STATS_FS_RPCIDX_FETCHACL,
SHARED_LOCK, NULL));
if (code == 0) {
AFS_STATCNT(PGetFileCell);
if (!avc)
return EINVAL;
- tcell = afs_GetCell(avc->fid.Cell, READ_LOCK);
+ tcell = afs_GetCell(avc->f.fid.Cell, READ_LOCK);
if (!tcell)
return ESRCH;
strcpy(aout, tcell->cellName);
char volName[32];
char *offLineMsg = afs_osi_Alloc(256);
char *motd = afs_osi_Alloc(256);
- register struct conn *tc;
+ register struct afs_conn *tc;
register afs_int32 code = 0;
struct AFSFetchVolumeStatus volstat;
register char *cp;
OfflineMsg = offLineMsg;
MOTD = motd;
do {
- tc = afs_Conn(&avc->fid, areq, SHARED_LOCK);
+ tc = afs_Conn(&avc->f.fid, areq, SHARED_LOCK);
if (tc) {
XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_GETVOLUMESTATUS);
RX_AFS_GUNLOCK();
code =
- RXAFS_GetVolumeStatus(tc->id, avc->fid.Fid.Volume, &volstat,
+ RXAFS_GetVolumeStatus(tc->id, avc->f.fid.Fid.Volume, &volstat,
&Name, &OfflineMsg, &MOTD);
RX_AFS_GLOCK();
XSTATS_END_TIME;
} else
code = -1;
} while (afs_Analyze
- (tc, code, &avc->fid, areq, AFS_STATS_FS_RPCIDX_GETVOLUMESTATUS,
+ (tc, code, &avc->f.fid, areq, AFS_STATS_FS_RPCIDX_GETVOLUMESTATUS,
SHARED_LOCK, NULL));
if (code)
char volName[32];
char *offLineMsg = afs_osi_Alloc(256);
char *motd = afs_osi_Alloc(256);
- register struct conn *tc;
+ register struct afs_conn *tc;
register afs_int32 code = 0;
struct AFSFetchVolumeStatus volstat;
struct AFSStoreVolumeStatus storeStat;
goto out;
}
- tvp = afs_GetVolume(&avc->fid, areq, READ_LOCK);
+ tvp = afs_GetVolume(&avc->f.fid, areq, READ_LOCK);
if (tvp) {
if (tvp->states & (VRO | VBackup)) {
afs_PutVolume(tvp, READ_LOCK);
storeStat.Mask |= AFS_SETMAXQUOTA;
}
do {
- tc = afs_Conn(&avc->fid, areq, SHARED_LOCK);
+ tc = afs_Conn(&avc->f.fid, areq, SHARED_LOCK);
if (tc) {
XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_SETVOLUMESTATUS);
RX_AFS_GUNLOCK();
code =
- RXAFS_SetVolumeStatus(tc->id, avc->fid.Fid.Volume, &storeStat,
+ RXAFS_SetVolumeStatus(tc->id, avc->f.fid.Fid.Volume, &storeStat,
volName, offLineMsg, motd);
RX_AFS_GLOCK();
XSTATS_END_TIME;
} else
code = -1;
} while (afs_Analyze
- (tc, code, &avc->fid, areq, AFS_STATS_FS_RPCIDX_SETVOLUMESTATUS,
+ (tc, code, &avc->f.fid, areq, AFS_STATS_FS_RPCIDX_SETVOLUMESTATUS,
SHARED_LOCK, NULL));
if (code)
if (code) {
goto out;
}
- tfid.Cell = avc->fid.Cell;
- tfid.Fid.Volume = avc->fid.Fid.Volume;
- if (!tfid.Fid.Unique && (avc->states & CForeign)) {
+ tfid.Cell = avc->f.fid.Cell;
+ tfid.Fid.Volume = avc->f.fid.Fid.Volume;
+ if (!tfid.Fid.Unique && (avc->f.states & CForeign)) {
tvc = afs_LookupVCache(&tfid, areq, NULL, avc, bufp);
} else {
tvc = afs_GetVCache(&tfid, areq, NULL, NULL);
{
int i;
struct srvAddr *sa;
- struct conn *tc;
+ struct afs_conn *tc;
struct unixuser *tu;
afs_int32 retValue;
AFS_STATCNT(PFindVolume);
if (!avc)
return EINVAL;
- tvp = afs_GetVolume(&avc->fid, areq, READ_LOCK);
+ tvp = afs_GetVolume(&avc->f.fid, areq, READ_LOCK);
if (tvp) {
cp = aout;
for (i = 0; i < MAXHOSTS; i++) {
*/
DECL_PIOCTL(PRemoveCallBack)
{
- register struct conn *tc;
+ register struct afs_conn *tc;
register afs_int32 code = 0;
struct AFSCallBack CallBacks_Array[1];
struct AFSCBFids theFids;
AFS_STATCNT(PRemoveCallBack);
if (!avc)
return EINVAL;
- if (avc->states & CRO)
+ if (avc->f.states & CRO)
return 0; /* read-only-ness can't change */
ObtainWriteLock(&avc->lock, 229);
theFids.AFSCBFids_len = 1;
theCBs.AFSCBs_len = 1;
- theFids.AFSCBFids_val = (struct AFSFid *)&avc->fid.Fid;
+ theFids.AFSCBFids_val = (struct AFSFid *)&avc->f.fid.Fid;
theCBs.AFSCBs_val = CallBacks_Array;
CallBacks_Array[0].CallBackType = CB_DROPPED;
if (avc->callback) {
do {
- tc = afs_Conn(&avc->fid, areq, SHARED_LOCK);
+ tc = afs_Conn(&avc->f.fid, areq, SHARED_LOCK);
if (tc) {
XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_GIVEUPCALLBACKS);
RX_AFS_GUNLOCK();
}
/* don't set code on failure since we wouldn't use it */
} while (afs_Analyze
- (tc, code, &avc->fid, areq,
+ (tc, code, &avc->f.fid, areq,
AFS_STATS_FS_RPCIDX_GIVEUPCALLBACKS, SHARED_LOCK, NULL));
ObtainWriteLock(&afs_xcbhash, 457);
afs_DequeueCallback(avc);
avc->callback = 0;
- avc->states &= ~(CStatd | CUnique);
+ avc->f.states &= ~(CStatd | CUnique);
ReleaseWriteLock(&afs_xcbhash);
- if (avc->fid.Fid.Vnode & 1 || (vType(avc) == VDIR))
+ if (avc->f.fid.Fid.Vnode & 1 || (vType(avc) == VDIR))
osi_dnlc_purgedp(avc);
}
ReleaseWriteLock(&avc->lock);
char *bufp;
struct sysname_info sysState;
afs_size_t offset, len;
- register struct conn *tc;
+ register struct afs_conn *tc;
register struct dcache *tdc;
register struct vcache *tvc;
struct AFSFetchStatus OutDirStatus;
afs_PutDCache(tdc);
goto out;
}
- tfid.Cell = avc->fid.Cell;
- tfid.Fid.Volume = avc->fid.Fid.Volume;
- if (!tfid.Fid.Unique && (avc->states & CForeign)) {
+ tfid.Cell = avc->f.fid.Cell;
+ tfid.Fid.Volume = avc->f.fid.Fid.Volume;
+ if (!tfid.Fid.Unique && (avc->f.states & CForeign)) {
tvc = afs_LookupVCache(&tfid, areq, NULL, avc, bufp);
} else {
tvc = afs_GetVCache(&tfid, areq, NULL, NULL);
ObtainWriteLock(&avc->lock, 231);
osi_dnlc_remove(avc, bufp, tvc);
do {
- tc = afs_Conn(&avc->fid, areq, SHARED_LOCK);
+ tc = afs_Conn(&avc->f.fid, areq, SHARED_LOCK);
if (tc) {
XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_REMOVEFILE);
RX_AFS_GUNLOCK();
code =
- RXAFS_RemoveFile(tc->id, (struct AFSFid *)&avc->fid.Fid, bufp,
+ RXAFS_RemoveFile(tc->id, (struct AFSFid *)&avc->f.fid.Fid, bufp,
&OutDirStatus, &tsync);
RX_AFS_GLOCK();
XSTATS_END_TIME;
} else
code = -1;
} while (afs_Analyze
- (tc, code, &avc->fid, areq, AFS_STATS_FS_RPCIDX_REMOVEFILE,
+ (tc, code, &avc->f.fid, areq, AFS_STATS_FS_RPCIDX_REMOVEFILE,
SHARED_LOCK, NULL));
if (code) {
ReleaseWriteLock(&tdc->lock);
afs_PutDCache(tdc); /* drop ref count */
}
- avc->states &= ~CUnique; /* For the dfs xlator */
+ avc->f.states &= ~CUnique; /* For the dfs xlator */
ReleaseWriteLock(&avc->lock);
code = 0;
out:
if (!afs_resourceinit_flag) /* afs daemons haven't started yet */
return EIO; /* Inappropriate ioctl for device */
- volume = avc->fid.Fid.Volume; /* who to zap */
- cell = avc->fid.Cell;
+ volume = avc->f.fid.Fid.Volume; /* who to zap */
+ cell = avc->f.fid.Cell;
/*
* Clear stat'd flag from all vnodes from this volume; this will invalidate all
*/
loop:
ObtainReadLock(&afs_xvcache);
- i = VCHashV(&avc->fid);
+ i = VCHashV(&avc->f.fid);
for (tq = afs_vhashTV[i].prev; tq != &afs_vhashTV[i]; tq = uq) {
uq = QPrev(tq);
tvc = QTOVH(tq);
- if (tvc->fid.Fid.Volume == volume && tvc->fid.Cell == cell) {
- if (tvc->states & CVInit) {
+ if (tvc->f.fid.Fid.Volume == volume && tvc->f.fid.Cell == cell) {
+ if (tvc->f.states & CVInit) {
ReleaseReadLock(&afs_xvcache);
- afs_osi_Sleep(&tvc->states);
+ afs_osi_Sleep(&tvc->f.states);
goto loop;
}
#ifdef AFS_DARWIN80_ENV
- if (tvc->states & CDeadVnode) {
+ if (tvc->f.states & CDeadVnode) {
ReleaseReadLock(&afs_xvcache);
- afs_osi_Sleep(&tvc->states);
+ afs_osi_Sleep(&tvc->f.states);
goto loop;
}
#endif
ObtainWriteLock(&afs_xcbhash, 458);
afs_DequeueCallback(tvc);
- tvc->states &= ~(CStatd | CDirty);
+ tvc->f.states &= ~(CStatd | CDirty);
ReleaseWriteLock(&afs_xcbhash);
- if (tvc->fid.Fid.Vnode & 1 || (vType(tvc) == VDIR))
+ if (tvc->f.fid.Fid.Vnode & 1 || (vType(tvc) == VDIR))
osi_dnlc_purgedp(tvc);
afs_TryToSmush(tvc, *acred, 1);
ReleaseWriteLock(&tvc->lock);
return EACCES;
memset(&stat, 0, sizeof(struct vcxstat));
- stat.fid = avc->fid;
- hset32(stat.DataVersion, hgetlo(avc->m.DataVersion));
+ stat.fid = avc->f.fid;
+ hset32(stat.DataVersion, hgetlo(avc->f.m.DataVersion));
stat.lock = avc->lock;
- stat.parentVnode = avc->parentVnode;
- stat.parentUnique = avc->parentUnique;
+ stat.parentVnode = avc->f.parent.vnode;
+ stat.parentUnique = avc->f.parent.unique;
hset(stat.flushDV, avc->flushDV);
hset(stat.mapDV, avc->mapDV);
- stat.truncPos = avc->truncPos;
+ stat.truncPos = avc->f.truncPos;
{ /* just grab the first two - won't break anything... */
struct axscache *ac;
}
stat.callback = afs_data_pointer_to_int32(avc->callback);
stat.cbExpires = avc->cbExpires;
- stat.anyAccess = avc->anyAccess;
+ stat.anyAccess = avc->f.anyAccess;
stat.opens = avc->opens;
stat.execsOrWriters = avc->execsOrWriters;
stat.flockCount = avc->flockCount;
stat.mvstat = avc->mvstat;
- stat.states = avc->states;
+ stat.states = avc->f.states;
memcpy(aout, (char *)&stat, sizeof(struct vcxstat));
*aoutSize = sizeof(struct vcxstat);
return 0;
memset(&stat, 0, sizeof(struct vcxstat2));
stat.cbExpires = avc->cbExpires;
- stat.anyAccess = avc->anyAccess;
+ stat.anyAccess = avc->f.anyAccess;
stat.mvstat = avc->mvstat;
stat.callerAccess = afs_GetAccessBits(avc, ~0, areq);
if (code) {
goto out;
}
- tfid.Cell = avc->fid.Cell;
- tfid.Fid.Volume = avc->fid.Fid.Volume;
- if (!tfid.Fid.Unique && (avc->states & CForeign)) {
+ tfid.Cell = avc->f.fid.Cell;
+ tfid.Fid.Volume = avc->f.fid.Fid.Volume;
+ if (!tfid.Fid.Unique && (avc->f.states & CForeign)) {
tvc = afs_LookupVCache(&tfid, areq, NULL, avc, bufp);
} else {
tvc = afs_GetVCache(&tfid, areq, NULL, NULL);
ObtainWriteLock(&tvc->lock, 649);
ObtainWriteLock(&afs_xcbhash, 650);
afs_DequeueCallback(tvc);
- tvc->states &= ~(CStatd | CDirty); /* next reference will re-stat cache entry */
+ tvc->f.states &= ~(CStatd | CDirty); /* next reference will re-stat cache entry */
ReleaseWriteLock(&afs_xcbhash);
/* now find the disk cache entries */
afs_TryToSmush(tvc, *acred, 1);
osi_dnlc_purgedp(tvc);
- if (tvc->linkData && !(tvc->states & CCore)) {
+ if (tvc->linkData && !(tvc->f.states & CCore)) {
afs_osi_Free(tvc->linkData, strlen(tvc->linkData) + 1);
tvc->linkData = NULL;
}
{
register afs_int32 code, code1;
afs_int32 bytes;
- struct conn *tc;
+ struct afs_conn *tc;
struct rx_call *tcall;
struct AFSVolSync tsync;
struct AFSFetchStatus OutStatus;
if (ain && (ainSize == 3 * sizeof(afs_int32)))
Fid = (struct AFSFid *)ain;
else
- Fid = &avc->fid.Fid;
- tfid.Cell = avc->fid.Cell;
+ Fid = &avc->f.fid.Fid;
+ tfid.Cell = avc->f.fid.Cell;
tfid.Fid.Volume = Fid->Volume;
tfid.Fid.Vnode = Fid->Vnode;
tfid.Fid.Unique = Fid->Unique;
tvc = afs_GetVCache(&tfid, areq, NULL, NULL);
if (!tvc) {
afs_Trace3(afs_iclSetp, CM_TRACE_PREFETCHCMD, ICL_TYPE_POINTER, tvc,
- ICL_TYPE_FID, &tfid, ICL_TYPE_FID, &avc->fid);
+ ICL_TYPE_FID, &tfid, ICL_TYPE_FID, &avc->f.fid);
return ENOENT;
}
afs_Trace3(afs_iclSetp, CM_TRACE_PREFETCHCMD, ICL_TYPE_POINTER, tvc,
- ICL_TYPE_FID, &tfid, ICL_TYPE_FID, &tvc->fid);
+ ICL_TYPE_FID, &tfid, ICL_TYPE_FID, &tvc->f.fid);
do {
- tc = afs_Conn(&tvc->fid, areq, SHARED_LOCK);
+ tc = afs_Conn(&tvc->f.fid, areq, SHARED_LOCK);
if (tc) {
RX_AFS_GUNLOCK();
tcall = rx_NewCall(tc->id);
code =
- StartRXAFS_FetchData(tcall, (struct AFSFid *)&tvc->fid.Fid, 0,
+ StartRXAFS_FetchData(tcall, (struct AFSFid *)&tvc->f.fid.Fid, 0,
0);
if (!code) {
bytes = rx_Read(tcall, (char *)aout, sizeof(afs_int32));
} else
code = -1;
} while (afs_Analyze
- (tc, code, &tvc->fid, areq, AFS_STATS_FS_RPCIDX_RESIDENCYRPCS,
+ (tc, code, &tvc->f.fid, areq, AFS_STATS_FS_RPCIDX_RESIDENCYRPCS,
SHARED_LOCK, NULL));
/* This call is done only to have the callback things handled correctly */
afs_FetchStatus(tvc, &tfid, areq, &OutStatus);
return code;
}
-DECL_PIOCTL(PFsCmd)
+DECL_PIOCTL(PResidencyCmd)
{
register afs_int32 code;
- struct conn *tc;
+ struct afs_conn *tc;
struct vcache *tvc;
- struct FsCmdInputs *Inputs;
- struct FsCmdOutputs *Outputs;
+ struct ResidencyCmdInputs *Inputs;
+ struct ResidencyCmdOutputs *Outputs;
struct VenusFid tfid;
struct AFSFid *Fid;
- Inputs = (struct FsCmdInputs *)ain;
- Outputs = (struct FsCmdOutputs *)aout;
+ Inputs = (struct ResidencyCmdInputs *)ain;
+ Outputs = (struct ResidencyCmdOutputs *)aout;
if (!avc)
return EINVAL;
- if (!ain || ainSize != sizeof(struct FsCmdInputs))
+ if (!ain || ainSize != sizeof(struct ResidencyCmdInputs))
return EINVAL;
Fid = &Inputs->fid;
if (!Fid->Volume)
- Fid = &avc->fid.Fid;
+ Fid = &avc->f.fid.Fid;
- tfid.Cell = avc->fid.Cell;
+ tfid.Cell = avc->f.fid.Cell;
tfid.Fid.Volume = Fid->Volume;
tfid.Fid.Vnode = Fid->Vnode;
tfid.Fid.Unique = Fid->Unique;
if (Inputs->command) {
do {
- tc = afs_Conn(&tvc->fid, areq, SHARED_LOCK);
+ tc = afs_Conn(&tvc->f.fid, areq, SHARED_LOCK);
if (tc) {
RX_AFS_GUNLOCK();
code =
- RXAFS_FsCmd(tc->id, Fid, Inputs,
- (struct FsCmdOutputs *)aout);
+ RXAFS_ResidencyCmd(tc->id, Fid, Inputs,
+ (struct ResidencyCmdOutputs *)aout);
RX_AFS_GLOCK();
} else
code = -1;
} while (afs_Analyze
- (tc, code, &tvc->fid, areq,
+ (tc, code, &tvc->f.fid, areq,
AFS_STATS_FS_RPCIDX_RESIDENCYRPCS, SHARED_LOCK, NULL));
/* This call is done to have the callback things handled correctly */
afs_FetchStatus(tvc, &tfid, areq, &Outputs->status);
afs_PutVCache(tvc);
if (!code) {
- *aoutSize = sizeof(struct FsCmdOutputs);
+ *aoutSize = sizeof(struct ResidencyCmdOutputs);
}
return code;
}
int srvAddrCount;
struct server *ts;
struct srvAddr *sa;
- struct conn *tc;
+ struct afs_conn *tc;
afs_int32 i, j;
struct unixuser *tu;
struct srvAddr **addrs;
ObtainWriteLock(&afs_discon_lock, 998);
afs_in_sync = 1;
+ afs_MarkAllServersUp();
code = afs_ResyncDisconFiles(areq, *acred);
afs_in_sync = 0;
if (code && !force) {
- printf("Files not synchronized properly, still in discon state. \
- Please retry or use \"force\".\n");
+ printf("Files not synchronized properly, still in discon state. \n"
+ "Please retry or use \"force\".\n");
+ mode = 0;
} else {
+ if (force) {
+ afs_DisconDiscardAll(*acred);
+ }
+ afs_ClearAllStatdFlag();
afs_is_disconnected = 0;
afs_is_discon_rw = 0;
printf("\nSync succeeded. You are back online.\n");
memcpy(aout, &mode, sizeof(afs_int32));
*aoutSize = sizeof(afs_int32);
- return 0;
+ return code;
#else
return EINVAL;
#endif