#include <afsconfig.h>
#include "afs/param.h"
-RCSID
- ("$Header$");
#include "afs/sysincludes.h" /* Standard vendor system headers */
#include "afsincludes.h" /* Afs-based standard headers */
int
#ifdef AFS_SGI64_ENV
afs_open(bhv_desc_t * bhv, struct vcache **avcp, afs_int32 aflags,
- struct AFS_UCRED *acred)
+ afs_ucred_t *acred)
#else
-afs_open(struct vcache **avcp, afs_int32 aflags, struct AFS_UCRED *acred)
+afs_open(struct vcache **avcp, afs_int32 aflags, afs_ucred_t *acred)
#endif
{
register afs_int32 code;
#ifdef AFS_DISCON_ENV
if (AFS_IS_DISCONNECTED && (afs_DCacheMissingChunks(tvc) != 0)) {
ReleaseReadLock(&tvc->lock);
- /*printf("Network is down in afs_open: missing chunks\n");*/
+ /* printf("Network is down in afs_open: missing chunks\n"); */
code = ENETDOWN;
goto done;
}
goto done;
} else {
if (!afs_AccessOK
- (tvc, ((tvc->states & CForeign) ? PRSFS_READ : PRSFS_LOOKUP),
+ (tvc, ((tvc->f.states & CForeign) ? PRSFS_READ : PRSFS_LOOKUP),
&treq, CHECK_MODE_BITS)) {
code = EACCES;
+ /* printf("afs_Open: no access for dir\n"); */
goto done;
}
}
if (aflags & FTRUNC) {
/* this fixes touch */
ObtainWriteLock(&tvc->lock, 123);
- tvc->m.Date = osi_Time();
- tvc->states |= CDirty;
+ tvc->f.m.Date = osi_Time();
+ tvc->f.states |= CDirty;
ReleaseWriteLock(&tvc->lock);
}
ObtainReadLock(&tvc->lock);
if (writing)
tvc->execsOrWriters++;
tvc->opens++;
-#if defined(AFS_SGI_ENV)
+#if defined(AFS_SGI_ENV) || defined (AFS_LINUX26_ENV)
if (writing && tvc->cred == NULL) {
crhold(acred);
tvc->cred = acred;
if ((afs_preCache != 0) && (writing == 0) && (vType(tvc) != VDIR) &&
(!afs_BBusy())) {
register struct dcache *tdc;
- afs_size_t offset, len, totallen = 0;
+ afs_size_t offset, len;
tdc = afs_GetDCache(tvc, 0, &treq, &offset, &len, 1);
doing so ourselves.
*/
bp = afs_BQueue(BOP_FETCH, tvc, B_DONTWAIT, 0, acred,
- (afs_size_t) 0, (afs_size_t) 1, tdc);
+ (afs_size_t) 0, (afs_size_t) 1, tdc,
+ (void *)0, (void *)0);
if (!bp) {
tdc->mflags &= ~DFFetchReq;
}