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;
* 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);
+#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
/*
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 =
AFS_GUNLOCK();
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();
VOP_LOCK(tfile->vnode, LK_EXCLUSIVE, current_proc());
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);
+#endif
#ifndef AFS_VM_RDWR_ENV
/*
* If write is implemented via VM, afs_fsync() is called from the high-level