#include <rx/xdr.h>
#include <afs/nfs.h>
-#include <afs/afs_assert.h>
#include <lwp.h>
#include <lock.h>
#include <afs/afsint.h>
retry:
tclient = h_FindClient_r(*tconn);
if (!tclient) {
- ViceLog(0, ("CallPreamble: Couldn't get CPS. Too many lockers\n"));
+ ViceLog(0, ("CallPreamble: Couldn't get client.\n"));
H_UNLOCK;
return VBUSY;
}
parentwhentargetnotdir = NULL;
}
- fsstats_StartXfer(&fsstats);
+ fsstats_StartXfer(&fsstats, FS_STATS_XFERIDX_FETCHDATA);
/* actually do the data transfer */
errorCode =
parentwhentargetnotdir = NULL;
}
- fsstats_StartXfer(&fsstats);
+ fsstats_StartXfer(&fsstats, FS_STATS_XFERIDX_STOREDATA);
errorCode =
StoreData_RXStyle(volptr, targetptr, Fid, client, acall, Pos, Length,
ViceLog(25, ("Rename : calling CopyOnWrite on target dir\n"));
if ((errorCode = CopyOnWrite(fileptr, volptr, 0, MAXFSIZE)))
goto Bad_Rename;
+ /* since copyonwrite would mean fileptr has a new handle, do it here */
+ FidZap(&filedir);
+ SetDirHandle(&filedir, fileptr);
}
/* If the new name exists already, delete it and the file it points to */
FDH_SYNC(fdP);
}
if (errorCode) {
+ Error tmp_errorCode = 0;
afs_sfsize_t nfSize = FDH_SIZE(fdP);
osi_Assert(nfSize >= 0);
/* something went wrong: adjust size and return */
if (origfdP) FDH_REALLYCLOSE(origfdP);
FDH_CLOSE(fdP);
/* set disk usage to be correct */
- VAdjustDiskUsage(&errorCode, volptr,
+ VAdjustDiskUsage(&tmp_errorCode, volptr,
(afs_sfsize_t) (nBlocks(nfSize) -
nBlocks(NewLength)), 0);
+ if (tmp_errorCode) {
+ errorCode = tmp_errorCode;
+ }
return errorCode;
}
if (origfdP) { /* finish CopyOnWrite */