int afs_osicred_initialized = 0;
afs_ucred_t afs_osi_cred;
-afs_lock_t afs_xosi; /* lock is for tvattr */
extern struct osi_dev cacheDev;
extern struct vfs *afs_cacheVfsp;
osi_Panic("UFSOpen called for non-UFS cache\n");
}
if (!afs_osicred_initialized) {
- /* valid for alpha_osf, SunOS, Ultrix */
+ /* valid for SunOS, Ultrix */
memset(&afs_osi_cred, 0, sizeof(afs_ucred_t));
crhold(&afs_osi_cred); /* don't let it evaporate, since it is static */
afs_osicred_initialized = 1;
}
- afile = (struct osi_file *)osi_AllocSmallSpace(sizeof(struct osi_file));
+ afile = osi_AllocSmallSpace(sizeof(struct osi_file));
setuerror(0);
AFS_GUNLOCK();
ip = (struct inode *)igetinode(afs_cacheVfsp, (dev_t) cacheDev.dev,
afs_int32 code;
struct vattr tvattr;
AFS_STATCNT(osi_Stat);
- ObtainWriteLock(&afs_xosi, 320);
AFS_GUNLOCK();
code = VOP_GETATTR(afile->vnode, &tvattr, &afs_osi_cred, VSYNC);
AFS_GLOCK();
astat->mtime = tvattr.va_mtime.tv_sec;
astat->atime = tvattr.va_atime.tv_sec;
}
- ReleaseWriteLock(&afs_xosi);
return code;
}
code = afs_osi_Stat(afile, &tstat);
if (code || tstat.size <= asize)
return code;
- ObtainWriteLock(&afs_xosi, 321);
VATTR_NULL(&tvattr);
/* note that this credential swapping stuff is only necessary because
* of ufs's references directly to u.u_cred instead of to
code = VOP_SETATTR(afile->vnode, &tvattr, &afs_osi_cred, 0);
AFS_GLOCK();
set_p_cred(u.u_procp, oldCred); /* restore */
- ReleaseWriteLock(&afs_xosi);
return code;
}
* down. No point in crashing when we are already shutting down
*/
if (!afile) {
- if (!afs_shuttingdown)
+ if (afs_shuttingdown == AFS_RUNNING)
osi_Panic("osi_Read called with null param");
else
return -EIO;
}
setuerror(code);
if (code > 0) {
- code *= -1;
+ code = -code;
}
}
return code;
("\n\n\n*** Cache partition is FULL - Decrease cachesize!!! ***\n\n");
setuerror(code);
if (code > 0) {
- code *= -1;
+ code = -code;
}
}
if (afile->proc) {