volatile
#endif
afs_int32 error;
+#ifdef AFS_DARWIN80_ENV
+ uio_t tuiop;
+#else
struct uio tuio;
+ struct uio *tuiop = &tuio;
struct iovec *tvec; /* again, should have define */
+#endif
register afs_int32 code;
struct vrequest treq;
*/
avc->m.Date = startDate;
-#if defined(AFS_HPUX_ENV) || defined(AFS_GFS_ENV)
+#if defined(AFS_HPUX_ENV)
#if defined(AFS_HPUX101_ENV)
if ((totalLength + filePos) >> 9 >
(p_rlimit(u.u_procp))[RLIMIT_FSIZE].rlim_cur) {
#else
-#ifdef AFS_HPUX_ENV
if ((totalLength + filePos) >> 9 > u.u_rlimit[RLIMIT_FSIZE].rlim_cur) {
-#else
- if (totalLength + filePos > u.u_rlimit[RLIMIT_FSIZE].rlim_cur) {
-#endif
#endif
if (!noLock)
ReleaseWriteLock(&avc->lock);
* as will fit */
len = max - offset;
}
+
+#ifdef AFS_DARWIN80_ENV
+ trimlen = len;
+ tuiop = afsio_darwin_partialcopy(auio, trimlen);
+ uio_setoffset(tuiop, offset);
+#else
/* mung uio structure to be right for this transfer */
afsio_copy(auio, &tuio, tvec);
trimlen = len;
afsio_trim(&tuio, trimlen);
tuio.afsio_offset = offset;
+#endif
- code = afs_MemWriteUIO(tdc->f.inode, &tuio);
+ code = afs_MemWriteUIO(tdc->f.inode, tuiop);
if (code) {
void *mep; /* XXX in prototype world is struct memCacheEntry * */
error = code;
break;
}
/* otherwise we've written some, fixup length, etc and continue with next seg */
- len = len - tuio.afsio_resid; /* compute amount really transferred */
+ len = len - AFS_UIO_RESID(tuiop); /* compute amount really transferred */
tlen = len;
afsio_skip(auio, tlen); /* advance auio over data written */
/* compute new file size */
avc->vc_error = error;
if (!noLock)
ReleaseWriteLock(&avc->lock);
+#ifdef AFS_DARWIN80_ENV
+ uio_free(tuiop);
+#else
osi_FreeSmallSpace(tvec);
-#ifdef AFS_DEC_ENV
- /* next, on GFS systems, we update g_size so that lseek's relative to EOF will
- * work. GFS is truly a poorly-designed interface! */
- afs_gfshack((struct gnode *)avc);
#endif
error = afs_CheckCode(error, &treq, 6);
return error;
volatile
#endif
afs_int32 error;
+#ifdef AFS_DARWIN80_ENV
+ uio_t tuiop;
+#else
struct uio tuio;
+ struct uio *tuiop = &tuio;
struct iovec *tvec; /* again, should have define */
+#endif
struct osi_file *tfile;
register afs_int32 code;
struct vrequest treq;
#if defined(AFS_SUN56_ENV)
auio->uio_loffset = 0;
#endif
- filePos = auio->afsio_offset = avc->m.Length;
+ filePos = avc->m.Length;
+#ifdef AFS_DARWIN80_ENV
+ uio_setoffset(auio, avc->m.Length);
+#else
+ auio->afsio_offset = avc->m.Length;
+#endif
}
#endif
/*
*/
avc->m.Date = startDate;
-#if defined(AFS_HPUX_ENV) || defined(AFS_GFS_ENV)
+#if defined(AFS_HPUX_ENV)
#if defined(AFS_HPUX101_ENV)
if ((totalLength + filePos) >> 9 >
p_rlimit(u.u_procp)[RLIMIT_FSIZE].rlim_cur) {
#else
-#ifdef AFS_HPUX_ENV
if ((totalLength + filePos) >> 9 > u.u_rlimit[RLIMIT_FSIZE].rlim_cur) {
-#else
- if (totalLength + filePos > u.u_rlimit[RLIMIT_FSIZE].rlim_cur) {
-#endif
#endif
if (!noLock)
ReleaseWriteLock(&avc->lock);
afs_FakeOpen(avc);
#endif
avc->states |= CDirty;
+#ifndef AFS_DARWIN80_ENV
tvec = (struct iovec *)osi_AllocSmallSpace(sizeof(struct iovec));
+#endif
while (totalLength > 0) {
/*
* The following line is necessary because afs_GetDCache with
* as will fit */
len = max - offset;
}
+
+#ifdef AFS_DARWIN80_ENV
+ trimlen = len;
+ tuiop = afsio_darwin_partialcopy(auio, trimlen);
+ uio_setoffset(tuiop, offset);
+#else
/* mung uio structure to be right for this transfer */
afsio_copy(auio, &tuio, tvec);
trimlen = len;
afsio_trim(&tuio, trimlen);
tuio.afsio_offset = offset;
+#endif
+
#if defined(AFS_AIX41_ENV)
AFS_GUNLOCK();
code =
}
#elif defined(AFS_LINUX20_ENV)
AFS_GUNLOCK();
- code = osi_file_uio_rdwr(tfile, &tuio, UIO_WRITE);
+ code = osi_rdwr(tfile, &tuio, UIO_WRITE);
+ AFS_GLOCK();
+#elif defined(AFS_DARWIN80_ENV)
+ AFS_GUNLOCK();
+ code = VOP_WRITE(tfile->vnode, tuiop, 0, afs_osi_ctxtp);
AFS_GLOCK();
#elif defined(AFS_DARWIN_ENV)
AFS_GUNLOCK();
break;
}
/* otherwise we've written some, fixup length, etc and continue with next seg */
- len = len - tuio.afsio_resid; /* compute amount really transferred */
+ len = len - AFS_UIO_RESID(tuiop); /* compute amount really transferred */
tlen = len;
afsio_skip(auio, tlen); /* advance auio over data written */
/* compute new file size */
avc->vc_error = error;
if (!noLock)
ReleaseWriteLock(&avc->lock);
+#ifdef AFS_DARWIN80_ENV
+ uio_free(tuiop);
+#else
osi_FreeSmallSpace(tvec);
-#ifdef AFS_DEC_ENV
- /* next, on GFS systems, we update g_size so that lseek's relative to EOF will
- * work. GFS is truly a poorly-designed interface! */
- afs_gfshack((struct gnode *)avc);
#endif
#ifndef AFS_VM_RDWR_ENV
/*
return code;
}
-
-
-#if !defined (AFS_AIX_ENV) && !defined (AFS_HPUX_ENV) && !defined (AFS_SUN5_ENV) && !defined(AFS_SGI_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_XBSD_ENV)
+#ifdef AFS_OSF_ENV
#ifdef AFS_DUX50_ENV
#define vno_close(X) vn_close((X), 0, NOCRED)
#elif defined(AFS_DUX40_ENV)
afd->f_flag &= ~(FSHLOCK | FEXLOCK);
code = vno_close(afd);
if (flags)
-#if defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SUN_ENV) && !defined(AFS_SUN5_ENV)
HandleFlock(tvc, LOCK_UN, &treq, u.u_procp->p_pid,
1 /*onlymine */ );
-#else
- HandleFlock(tvc, LOCK_UN, &treq, 0, 1 /*onlymine */ );
-#endif
-#ifdef AFS_DEC_ENV
- grele((struct gnode *)tvc);
-#else
AFS_RELE(AFSTOV(tvc));
-#endif
closeDone = 1;
}
}
struct flid *flp;
#endif
#endif
-#elif defined(AFS_SUN_ENV) || defined(AFS_SUN5_ENV)
-#ifdef AFS_SUN5_ENV
+#elif defined(AFS_SUN5_ENV)
afs_close(OSI_VC_ARG(avc), aflags, count, offset, acred)
offset_t offset;
-#else
-afs_close(OSI_VC_ARG(avc), aflags, count, acred)
-#endif
int count;
#else
afs_close(OSI_VC_ARG(avc), aflags, acred)
afs_PutFakeStat(&fakestat);
return 0;
}
-#elif defined(AFS_SUN_ENV) || defined(AFS_SGI_ENV)
+#elif defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV)
if (count > 1) {
/* The vfs layer may call this repeatedly with higher "count"; only on the last close (i.e. count = 1) we should actually proceed with the close. */
afs_PutFakeStat(&fakestat);
afs_chkpgoob(&avc->v, btoc(avc->m.Length));
#else /* AFS_SGI_ENV */
if (avc->flockCount) { /* Release Lock */
-#if defined(AFS_OSF_ENV) || defined(AFS_SUN_ENV)
+#if defined(AFS_OSF_ENV)
HandleFlock(avc, LOCK_UN, &treq, u.u_procp->p_pid, 1 /*onlymine */ );
#else
HandleFlock(avc, LOCK_UN, &treq, 0, 1 /*onlymine */ );
int
#ifdef AFS_OSF_ENV
-afs_fsync(avc, fflags, acred, waitfor)
- int fflags;
- int waitfor;
+afs_fsync(OSI_VC_DECL(avc), int fflags, struct AFS_UCRED *acred, int waitfor)
#else /* AFS_OSF_ENV */
#if defined(AFS_SGI_ENV) || defined(AFS_SUN53_ENV)
-afs_fsync(OSI_VC_ARG(avc), flag, acred
+afs_fsync(OSI_VC_DECL(avc), int flag, struct AFS_UCRED *acred
#ifdef AFS_SGI65_ENV
- , start, stop
-#endif
+ , off_t start, off_t stop
+#endif /* AFS_SGI65_ENV */
)
-#else
-afs_fsync(avc, acred)
-#endif
-#endif
-OSI_VC_DECL(avc);
- struct AFS_UCRED *acred;
-#if defined(AFS_SGI_ENV) || defined(AFS_SUN53_ENV)
- int flag;
-#ifdef AFS_SGI65_ENV
- off_t start, stop;
-#endif
+#else /* !OSF && !SUN53 && !SGI */
+afs_fsync(OSI_VC_DECL(avc), struct AFS_UCRED *acred)
+#endif
#endif
{
register afs_int32 code;