* Truncate the element to reclaim its space
*/
tfile = afs_CFileOpen(&tdc->f.inode);
+ osi_Assert(tfile);
afs_CFileTruncate(tfile, 0);
afs_CFileClose(tfile);
afs_AdjustSize(tdc, 0);
if ((lock & 2)) {
/* Truncate the chunk so zeroes get filled properly */
file = afs_CFileOpen(&tdc->f.inode);
+ osi_Assert(file);
afs_CFileTruncate(file, 0);
afs_CFileClose(file);
afs_AdjustSize(tdc, 0);
/* no data in file to read at this position */
UpgradeSToWLock(&tdc->lock, 607);
file = afs_CFileOpen(&tdc->f.inode);
+ osi_Assert(file);
afs_CFileTruncate(file, 0);
afs_CFileClose(file);
afs_AdjustSize(tdc, 0);
*/
DZap(tdc); /* pages in cache may be old */
file = afs_CFileOpen(&tdc->f.inode);
+ osi_Assert(file);
afs_RemoveVCB(&avc->f.fid);
tdc->f.states |= DWriting;
tdc->dflags |= DFFetching;
afs_CFileTruncate(file, size); /* prune it */
} else {
if (!setLocks || slowPass) {
- ObtainWriteLock(&afs_xcbhash, 453);
- afs_DequeueCallback(avc);
- avc->f.states &= ~(CStatd | CUnique);
- avc->callback = NULL;
- ReleaseWriteLock(&afs_xcbhash);
- if (avc->f.fid.Fid.Vnode & 1 || (vType(avc) == VDIR))
- osi_dnlc_purgedp(avc);
+ afs_StaleVCacheFlags(avc, AFS_STALEVC_CLEARCB, CUnique);
} else {
/* Something lost. Forget about performance, and go
* back with a vcache write lock.
ReleaseWriteLock(&tdc->lock);
afs_PutDCache(tdc);
if (!afs_IsDynroot(avc)) {
- ObtainWriteLock(&afs_xcbhash, 454);
- afs_DequeueCallback(avc);
- avc->f.states &= ~(CStatd | CUnique);
- ReleaseWriteLock(&afs_xcbhash);
- if (avc->f.fid.Fid.Vnode & 1 || (vType(avc) == VDIR))
- osi_dnlc_purgedp(avc);
+ afs_StaleVCacheFlags(avc, 0, CUnique);
/*
* Locks held:
* avc->lock(W); assert(!setLocks || slowPass)
/* Open the files. */
tfile_src = afs_CFileOpen(&adc->f.inode);
tfile_dst = afs_CFileOpen(&new_dc->f.inode);
+ osi_Assert(tfile_src);
+ osi_Assert(tfile_dst);
/* And now copy dir dcache data into this dcache,
* 4k at a time.