afs_globalVFS = afsp;
afsp->vfs_bsize = 8192;
+#ifdef AFS_64BIT_CLIENT
+ afsp->vfs_flag |= VFS_DEVMOUNT;
+#endif /* AFS_64BIT_CLIENT */
afsp->vfs_fsid.val[0] = AFS_VFSMAGIC; /* magic */
afsp->vfs_fsid.val[1] = AFS_VFSFSID;
va.va_size = length;
error = afs_setattr(vp, &va, cred);
afs_Trace4(afs_iclSetp, CM_TRACE_GFTRUNC, ICL_TYPE_POINTER, (afs_int32)vp,
- ICL_TYPE_LONG, flags, ICL_TYPE_LONG, length, ICL_TYPE_LONG, error);
+ ICL_TYPE_LONG, flags,
+ ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(length),
+ ICL_TYPE_LONG, error);
return(error);
}
AFS_STATCNT(afs_gn_rdwr);
if (vcp->vc_error) {
- if (op == UIO_WRITE)
+ if (op == UIO_WRITE) {
+ afs_Trace2(afs_iclSetp, CM_TRACE_GRDWR1,
+ ICL_TYPE_POINTER, (afs_int32)vp,
+ ICL_TYPE_LONG, vcp->vc_error);
return vcp->vc_error;
- else
+ } else
return EIO;
}
* We do a similar thing on the afs_read/write interface.
*/
if (op == UIO_WRITE) {
+#ifdef AFS_64BIT_CLIENT
+ if (ubuf->afsio_offset < afs_vmMappingEnd) {
+#endif /* AFS_64BIT_ENV */
ObtainWriteLock(&vcp->lock,240);
vcp->states |= CDirty; /* Set the dirty bit */
afs_FakeOpen(vcp);
ReleaseWriteLock(&vcp->lock);
+#ifdef AFS_64BIT_CLIENT
+ }
+#endif /* AFS_64BIT_ENV */
}
error = afs_vm_rdwr(vp, ubuf, op, flags, cred);
if (op == UIO_WRITE) {
+#ifdef AFS_64BIT_CLIENT
+ if (ubuf->afsio_offset < afs_vmMappingEnd) {
+#endif /* AFS_64BIT_ENV */
ObtainWriteLock(&vcp->lock,241);
afs_FakeClose(vcp, cred); /* XXXX For nfs trans and cores XXXX */
ReleaseWriteLock(&vcp->lock);
+#ifdef AFS_64BIT_CLIENT
+ }
+#endif /* AFS_64BIT_ENV */
}
if (vattrp != NULL && error == 0)
afs_gn_getattr(vp, vattrp, cred);
return(error);
}
-
#define AFS_MAX_VM_CHUNKS 10
afs_vm_rdwr(vp, uiop, rw, ioflag, credp)
register struct vnode *vp;
{
register afs_int32 code = 0;
register int i;
- afs_int32 blockSize, fileSize;
- afs_int32 xfrSize, xfrOffset;
+ afs_int32 blockSize;
+ afs_size_t fileSize, xfrOffset, offset, old_offset;
+ afs_int32 xfrSize;
+#ifdef AFS_64BIT_CLIENT
+ afs_size_t finalOffset;
+ afs_int32 toffset;
+ int mixed = 0;
+#endif /* AFS_64BIT_CLIENT */
register struct vcache *vcp = (struct vcache *)vp;
struct dcache *tdc;
- register afs_int32 start_offset;
- int save_resid = uiop->afsio_resid;
- int old_offset, first_page;
- int offset, count, len;
+ afs_size_t start_offset;
+ afs_int32 save_resid = uiop->afsio_resid;
+ int first_page, last_page, pages;
+ int count, len;
int counter = 0;
struct vrequest treq;
goto fail;
}
+#ifndef AFS_64BIT_CLIENT
/* check for "file too big" error, which should really be done above us */
if (rw == UIO_WRITE && xfrSize + fileSize > get_ulimit()) {
code = EFBIG;
goto fail;
}
+#endif /* AFS_64BIT_CLIENT */
+
+#ifdef AFS_64BIT_CLIENT
+ if (xfrOffset + xfrSize > afs_vmMappingEnd) {
+ if (xfrOffset < afs_vmMappingEnd) {
+ /* special case of a buffer crossing the VM mapping line */
+ struct uio tuio;
+ struct iovec tvec[16]; /* Should have access to #define */
+ afs_int32 tsize;
+
+ mixed = 1;
+ finalOffset = xfrOffset + xfrSize;
+ tsize = (afs_size_t) (xfrOffset + xfrSize - afs_vmMappingEnd);
+ afsio_copy(uiop, &tuio, tvec);
+ afsio_skip(&tuio, xfrSize - tsize);
+ afsio_trim(&tuio, tsize);
+ tuio.afsio_offset = afs_vmMappingEnd;
+ ReleaseReadLock(&vcp->lock);
+ ObtainWriteLock(&vcp->lock,243);
+ afs_FakeClose(vcp, credp); /* XXXX For nfs trans and cores XXXX */
+ ReleaseWriteLock(&vcp->lock);
+ code = afs_direct_rdwr(vp, &tuio, rw, ioflag, credp);
+ ObtainWriteLock(&vcp->lock,244);
+ afs_FakeOpen(vcp); /* XXXX For nfs trans and cores XXXX */
+ ReleaseWriteLock(&vcp->lock);
+ ObtainReadLock(&vcp->lock);
+ if (code) goto fail;
+ xfrSize = (afs_size_t) (afs_vmMappingEnd - xfrOffset);
+ afsio_trim(uiop, xfrSize);
+ } else {
+ ReleaseReadLock(&vcp->lock);
+ code = afs_direct_rdwr(vp, uiop, rw, ioflag, credp);
+ return code;
+ }
+ }
+#endif /* AFS_64BIT_CLIENT */
if (!vcp->vmh) {
/* Consider V_INTRSEG too for interrupts */
xfrSize = fileSize - xfrOffset;
if (xfrSize <= 0) goto fail;
ReleaseReadLock(&vcp->lock);
+#ifdef AFS_64BIT_CLIENT
+ toffset = xfrOffset;
+ uiop->afsio_offset = xfrOffset;
+ afs_Trace3(afs_iclSetp, CM_TRACE_VMWRITE,
+ ICL_TYPE_POINTER, vcp,
+ ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(xfrOffset),
+ ICL_TYPE_INT32, xfrSize);
+ AFS_GUNLOCK();
+ code = vm_move(vcp->segid, toffset, xfrSize, rw, uiop);
+#else /* AFS_64BIT_CLIENT */
AFS_GUNLOCK();
code = vm_move(vcp->segid, xfrOffset, xfrSize, rw, uiop);
+#endif /* AFS_64BIT_CLIENT */
AFS_GLOCK();
/*
* If at a chunk boundary and staying within chunk,
}
ReleaseWriteLock(&vcp->lock);
}
+#ifdef AFS_64BIT_CLIENT
+ if (mixed) {
+ uiop->afsio_offset = finalOffset;
+ }
+#endif /* AFS_64BIT_CLIENT */
return code;
}
/* UIO_WRITE */
+ start_offset = uiop->afsio_offset;
+ afs_Trace3(afs_iclSetp, CM_TRACE_VMWRITE,
+ ICL_TYPE_POINTER, vcp,
+ ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(start_offset),
+ ICL_TYPE_INT32, xfrSize);
ReleaseReadLock(&vcp->lock);
ObtainWriteLock(&vcp->lock,400);
vcp->m.Date = osi_Time(); /* Set file date (for ranlib) */
/* extend file */
/* un-protect last page. */
- vm_protectp(vcp->vmh, vcp->m.Length/PAGESIZE, 1, FILEKEY);
+ last_page = vcp->m.Length/PAGESIZE;
+ vm_protectp(vcp->vmh, last_page, 1, FILEKEY);
if (xfrSize + xfrOffset > fileSize) {
vcp->m.Length = xfrSize+xfrOffset;
}
* at once. Otherwise, we'll write one chunk at a time, flushing
* some of it to disk.
*/
- start_offset = uiop->afsio_offset;
count = 0;
/* Only create a page to avoid excess VM access if we're writing a
/* All data goes to this one chunk. */
AFS_GUNLOCK();
old_offset = uiop->afsio_offset;
+#ifdef AFS_64BIT_CLIENT
+ uiop->afsio_offset = xfrOffset;
+ toffset = xfrOffset;
+ code = vm_move(vcp->segid, toffset, xfrSize, rw, uiop);
+#else /* AFS_64BIT_CLIENT */
code = vm_move(vcp->segid, xfrOffset, xfrSize, rw, uiop);
+#endif /* AFS_64BIT_CLIENT */
AFS_GLOCK();
xfrOffset += len;
xfrSize = 0;
AFS_GUNLOCK();
old_offset = uiop->afsio_offset;
+#ifdef AFS_64BIT_CLIENT
+ toffset = xfrOffset;
+ code = vm_move(vcp->segid, toffset, len, rw, &tuio);
+#else /* AFS_64BIT_CLIENT */
code = vm_move(vcp->segid, xfrOffset, len, rw, &tuio);
+#endif /* AFS_64BIT_CLIENT */
AFS_GLOCK();
len -= tuio.afsio_resid;
afsio_skip(uiop, len);
}
first_page = old_offset >> PGSHIFT;
+ pages = 1 + ((old_offset + (len - 1)) >> PGSHIFT) - first_page;
+ afs_Trace3(afs_iclSetp, CM_TRACE_VMWRITE2,
+ ICL_TYPE_POINTER, (afs_int32) vcp,
+ ICL_TYPE_INT32, first_page,
+ ICL_TYPE_INT32, pages);
AFS_GUNLOCK();
- code = vm_writep(vcp->segid, first_page,
- 1 + ((old_offset + (len - 1)) >> PGSHIFT) - first_page);
+ code = vm_writep(vcp->segid, first_page, pages);
if (++count > AFS_MAX_VM_CHUNKS) {
count = 0;
vms_iowait(vcp->segid);
if (code == 0 && (vcp->states & CDirty)) {
code = afs_DoPartialWrite(vcp, &treq);
}
- vm_protectp(vcp->vmh, vcp->m.Length/PAGESIZE, 1, RDONLY);
+ vm_protectp(vcp->vmh, last_page, 1, RDONLY);
ReleaseWriteLock(&vcp->lock);
/* If requested, fsync the file after every write */
if (code == EDQUOT || code == ENOSPC)
uiop->afsio_resid = save_resid;
}
+#ifdef AFS_64BIT_CLIENT
+ if (mixed) {
+ uiop->afsio_offset = finalOffset;
+ }
+#endif /* AFS_64BIT_CLIENT */
fail:
ReleaseReadLock(&vcp->lock);
+ afs_Trace2(afs_iclSetp, CM_TRACE_VMWRITE3,
+ ICL_TYPE_POINTER, vcp,
+ ICL_TYPE_INT32, code);
return code;
}
+afs_direct_rdwr(vp, uiop, rw, ioflag, credp)
+ register struct vnode *vp;
+ struct uio *uiop;
+ enum uio_rw rw;
+ int ioflag;
+ struct ucred *credp;
+{
+ register afs_int32 code = 0;
+ afs_int32 xfrSize;
+ afs_size_t fileSize, xfrOffset, offset, old_offset;
+ struct vcache *vcp = (struct vcache *)vp;
+ afs_int32 save_resid = uiop->afsio_resid;
+ struct vrequest treq;
+
+ if (code = afs_InitReq(&treq, credp)) return code;
+
+ /* special case easy transfer; apparently a lot are done */
+ if ((xfrSize=uiop->afsio_resid) == 0) return 0;
+
+ ObtainReadLock(&vcp->lock);
+ fileSize = vcp->m.Length;
+ if (rw == UIO_WRITE && (ioflag & IO_APPEND)) { /* handle IO_APPEND mode */
+ uiop->afsio_offset = fileSize;
+ }
+ /* compute xfrOffset now, and do some checks */
+ xfrOffset = uiop->afsio_offset;
+ if (xfrOffset < 0 || xfrOffset + xfrSize < 0) {
+ code = EINVAL;
+ ReleaseReadLock(&vcp->lock);
+ goto fail;
+ }
+
+ /* check for "file too big" error, which should really be done above us */
+#ifdef notdef
+ if (rw == UIO_WRITE && xfrSize + fileSize > get_ulimit()) {
+ code = EFBIG;
+ ReleaseReadLock(&vcp->lock);
+ goto fail;
+ }
+#endif
+ ReleaseReadLock(&vcp->lock);
+ if (rw == UIO_WRITE) {
+ ObtainWriteLock(&vcp->lock,400);
+ vcp->m.Date = osi_Time(); /* Set file date (for ranlib) */
+ /* extend file */
+ if (xfrSize + xfrOffset > fileSize) {
+ vcp->m.Length = xfrSize+xfrOffset;
+ }
+ ReleaseWriteLock(&vcp->lock);
+ }
+ afs_Trace3(afs_iclSetp, CM_TRACE_DIRECTRDWR,
+ ICL_TYPE_POINTER, (afs_int32)vp,
+ ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(uiop->afsio_offset),
+ ICL_TYPE_LONG, uiop->afsio_resid);
+ code = afs_rdwr(vp, uiop, rw, ioflag, credp);
+ if (code != 0) {
+ uiop->afsio_resid = save_resid;
+ } else {
+ uiop->afsio_offset = xfrOffset + xfrSize;
+ if (uiop->afsio_resid > 0) {
+ /* should zero here the remaining buffer */
+ uiop->afsio_resid = 0;
+ }
+ /* Purge dirty chunks of file if there are too many dirty chunks.
+ * Inside the write loop, we only do this at a chunk boundary.
+ * Clean up partial chunk if necessary at end of loop.
+ */
+ if (AFS_CHUNKBASE(uiop->afsio_offset) != AFS_CHUNKBASE(xfrOffset)) {
+ ObtainWriteLock(&vcp->lock,402);
+ code = afs_DoPartialWrite(vcp, &treq);
+ vcp->states |= CDirty;
+ ReleaseWriteLock(&vcp->lock);
+ }
+ }
+
+ fail:
+ return code;
+}
+
static int lock_normalize(vp, lckdat, offset, cred)
struct vnode *vp;
typedef struct uio {
struct iovec *uio_iov;
int uio_iovcnt;
- int uio_offset;
+ afs_offs_t uio_offset;
uio_seg_t uio_seg;
int uio_resid;
uio_flag_t uio_flag;
cacheInode = dp->d_inode->i_ino;
cacheDev.dev = dp->d_inode->i_dev;
- afs_fsfragsize = dp->d_inode->i_sb->s_blocksize;
+ afs_fsfragsize = dp->d_inode->i_sb->s_blocksize - 1;
afs_cacheSBp = dp->d_inode->i_sb;
dput(dp);
* Setup a uio struct.
*/
void setup_uio(uio_t *uiop, struct iovec *iovecp, char *buf,
- int pos, int count, uio_flag_t flag,
+ afs_offs_t pos, int count, uio_flag_t flag,
uio_seg_t seg)
{
iovecp->iov_base = buf;
extern int osi_rdwr(int rw, struct osi_file *file, caddr_t addrp, size_t asize,
size_t *resid);
extern void inline setup_uio(uio_t *uiop, struct iovec *iovecp, char *buf,
- int pos, int count, uio_flag_t flag,
+ afs_offs_t pos, int count, uio_flag_t flag,
uio_seg_t seg);
extern int osi_file_uio_rdwr(struct osi_file *osifile, uio_t *uiop, int rw);
extern void afs_osi_SetTime(osi_timeval_t *tvp);
typedef struct vattr {
int va_type; /* One of v_types above. */
- size_t va_size;
+ afs_size_t va_size;
unsigned long va_blocks;
unsigned long va_blocksize;
int va_mask; /* AT_xxx operation to perform. */
AFS_GLOCK();
afs_Trace4(afs_iclSetp, CM_TRACE_READOP, ICL_TYPE_POINTER, vcp,
- ICL_TYPE_INT32, (int)*offp,
+ ICL_TYPE_OFFSET, offp,
ICL_TYPE_INT32, count,
ICL_TYPE_INT32, 99999);
if (code)
code = -code;
else {
- osi_FlushPages(vcp, credp); /* ensure stale pages are gone */
- AFS_GUNLOCK();
- code = generic_file_read(fp, buf, count, offp);
- AFS_GLOCK();
+#ifdef AFS_64BIT_CLIENT
+ if (*offp + count > afs_vmMappingEnd) {
+ uio_t tuio;
+ struct iovec iov;
+ afs_size_t oldOffset = *offp;
+ afs_int32 xfered = 0;
+
+ if (*offp < afs_vmMappingEnd) {
+ /* special case of a buffer crossing the VM mapping end */
+ afs_int32 tcount = afs_vmMappingEnd - *offp;
+ count -= tcount;
+ osi_FlushPages(vcp, credp); /* ensure stale pages are gone */
+ AFS_GUNLOCK();
+ code = generic_file_read(fp, buf, tcount, offp);
+ AFS_GLOCK();
+ if (code != tcount) {
+ goto done;
+ }
+ xfered = tcount;
+ }
+ setup_uio(&tuio, &iov, buf + xfered, (afs_offs_t) *offp, count,
+ UIO_READ, AFS_UIOSYS);
+ code = afs_read(vcp, &tuio, credp, 0, 0, 0);
+ xfered += count - tuio.uio_resid;
+ if (code != 0) {
+ code = xfered;
+ *offp += count - tuio.uio_resid;
+ } else {
+ code = xfered;
+ *offp += count;
+ }
+done:
+ } else {
+#endif /* AFS_64BIT_CLIENT */
+ osi_FlushPages(vcp, credp); /* ensure stale pages are gone */
+ AFS_GUNLOCK();
+ code = generic_file_read(fp, buf, count, offp);
+ AFS_GLOCK();
+#ifdef AFS_64BIT_CLIENT
+ }
+#endif /* AFS_64BIT_CLIENT */
}
afs_Trace4(afs_iclSetp, CM_TRACE_READOP, ICL_TYPE_POINTER, vcp,
- ICL_TYPE_INT32, (int)*offp,
+ ICL_TYPE_OFFSET, offp,
ICL_TYPE_INT32, count,
ICL_TYPE_INT32, code);
AFS_GLOCK();
afs_Trace4(afs_iclSetp, CM_TRACE_WRITEOP, ICL_TYPE_POINTER, vcp,
- ICL_TYPE_INT32, (int)*offp, ICL_TYPE_INT32, count,
- ICL_TYPE_INT32, (fp->f_flags & O_APPEND) ? 99998 : 99999);
+ ICL_TYPE_OFFSET, offp,
+ ICL_TYPE_INT32, count,
+ ICL_TYPE_INT32, (fp->f_flags & O_APPEND) ? 99998 : 99999);
/* get a validated vcache entry */
ObtainWriteLock(&vcp->lock, 529);
afs_FakeOpen(vcp);
ReleaseWriteLock(&vcp->lock);
- AFS_GUNLOCK();
if (code)
code = -code;
else {
- code = generic_file_write(fp, buf, count, offp);
+#ifdef AFS_64BIT_CLIENT
+ if (*offp + count > afs_vmMappingEnd) {
+ uio_t tuio;
+ struct iovec iov;
+ afs_size_t oldOffset = *offp;
+ afs_int32 xfered = 0;
+
+ if (*offp < afs_vmMappingEnd) {
+ /* special case of a buffer crossing the VM mapping end */
+ afs_int32 tcount = afs_vmMappingEnd - *offp;
+ count -= tcount;
+ AFS_GUNLOCK();
+ code = generic_file_write(fp, buf, tcount, offp);
+ AFS_GLOCK();
+ if (code != tcount) {
+ goto done;
+ }
+ xfered = tcount;
+ }
+ setup_uio(&tuio, &iov, buf + xfered, (afs_offs_t) *offp, count,
+ UIO_WRITE, AFS_UIOSYS);
+ code = afs_write(vcp, &tuio, fp->f_flags, credp, 0);
+ xfered += count - tuio.uio_resid;
+ if (code != 0) {
+ code = xfered;
+ *offp += count - tuio.uio_resid;
+ } else {
+ /* Purge dirty chunks of file if there are too many dirty chunks.
+ * Inside the write loop, we only do this at a chunk boundary.
+ * Clean up partial chunk if necessary at end of loop.
+ */
+ if (AFS_CHUNKBASE(tuio.afsio_offset) != AFS_CHUNKBASE(oldOffset)) {
+ ObtainWriteLock(&vcp->lock,402);
+ code = afs_DoPartialWrite(vcp, &treq);
+ vcp->states |= CDirty;
+ ReleaseWriteLock(&vcp->lock);
+ }
+ code = xfered;
+ *offp += count;
+ ObtainWriteLock(&vcp->lock,400);
+ vcp->m.Date = osi_Time(); /* Set file date (for ranlib) */
+ /* extend file */
+ if (*offp > vcp->m.Length) {
+ vcp->m.Length = *offp;
+ }
+ ReleaseWriteLock(&vcp->lock);
+ }
+done:
+ } else {
+#endif /* AFS_64BIT_CLIENT */
+ AFS_GUNLOCK();
+ code = generic_file_write(fp, buf, count, offp);
+ AFS_GLOCK();
+#ifdef AFS_64BIT_CLIENT
+ }
+#endif /* AFS_64BIT_CLIENT */
}
- AFS_GLOCK();
ObtainWriteLock(&vcp->lock, 530);
vcp->m.Date = osi_Time(); /* set modification time */
afs_FakeClose(vcp, credp);
if (code>=0)
- code2 = afs_DoPartialWrite(vcp, &treq);
+ code2 = afs_DoPartialWrite(vcp, &treq);
if (code2 && code >=0)
- code = (ssize_t) -code2;
+ code = (ssize_t) -code2;
ReleaseWriteLock(&vcp->lock);
afs_Trace4(afs_iclSetp, CM_TRACE_WRITEOP, ICL_TYPE_POINTER, vcp,
- ICL_TYPE_INT32, (int)*offp, ICL_TYPE_INT32, count,
- ICL_TYPE_INT32, code);
+ ICL_TYPE_OFFSET, offp,
+ ICL_TYPE_INT32, count,
+ ICL_TYPE_INT32, code);
AFS_GUNLOCK();
crfree(credp);
struct DirEntry *de;
ino_t ino;
int len;
- int origOffset;
+ afs_size_t origOffset, tlen;
cred_t *credp = crref();
AFS_GLOCK();
}
/* get a reference to the entire directory */
- tdc = afs_GetDCache(avc, 0, &treq, &origOffset, &len, 1);
+ tdc = afs_GetDCache(avc, (afs_size_t) 0, &treq, &origOffset, &tlen, 1);
+ len = tlen;
if (!tdc) {
AFS_GUNLOCK();
return -ENOENT;
afid.Fid.Unique=ntohl(de->fid.vunique);
if ((avc->states & CForeign) == 0 &&
(ntohl(de->fid.vnode) & 1)) {
- type=DT_DIR;
} else if ((tvc=afs_FindVCache(&afid,0,0,0,0))) {
if (tvc->mvstat) {
type=DT_DIR;
} else if (((tvc->states) & (CStatd|CTruth))) {
- /* CTruth will be set if the object has
+ /* CTruth will be set if the object has
*ever* been statd */
vtype=vType(tvc);
if (vtype == VDIR)
type=DT_LNK; */
/* what other types does AFS support? */
}
- /* clean up from afs_FindVCache */
- afs_PutVCache(tvc, WRITE_LOCK);
+ /* clean up from afs_FindVCache */
+ afs_PutVCache(tvc, WRITE_LOCK);
}
code = (*filldir)(dirbuf, de->name, len, offset, ino, type);
}
#else
- code = (*filldir)(dirbuf, de->name, len, offset, ino);
+ code = (*filldir)(dirbuf, de->name, len, offset, ino);
#endif
DRelease(de, 0);
if (code)
AFS_GLOCK();
#if defined(AFS_LINUX24_ENV)
afs_Trace3(afs_iclSetp, CM_TRACE_GMAP, ICL_TYPE_POINTER, vcp,
- ICL_TYPE_POINTER, vmap->vm_start,
- ICL_TYPE_INT32, vmap->vm_end - vmap->vm_start);
+ ICL_TYPE_POINTER, vmap->vm_start,
+ ICL_TYPE_INT32, vmap->vm_end - vmap->vm_start);
#else
afs_Trace4(afs_iclSetp, CM_TRACE_GMAP, ICL_TYPE_POINTER, vcp,
ICL_TYPE_POINTER, vmap->vm_start,
}
vmap->vm_ops = &afs_private_mmap_ops;
}
-
-
+
+
/* Add an open reference on the first mapping. */
if (vcp->mapcnt == 0) {
vcp->execsOrWriters++;
cred_t *credp;
struct vrequest treq;
struct inode *ip = (struct inode *)dp->d_inode;
-
+
unsigned long timeout = 3*HZ; /* 3 seconds */
-
+
if (!(flags & LOOKUP_CONTINUE)) {
long diff = CURRENT_TIME - dp->d_parent->d_inode->i_mtime;
-
+
if (diff < 15*60)
timeout = 0;
}
-
+
if (time_after(jiffies, dp->d_time + timeout))
goto out_bad;
-
+
out_valid:
return 1;
-
+
out_bad:
return 0;
}
if (putback) {
dp->d_time = jiffies;
d_add(dp, NULL); /* means definitely does _not_ exist */
- }
+ }
}
crfree(credp);
return -code;
AFS_GUNLOCK();
if (!code) {
- /* update time so it doesn't expire immediately */
+ /* update time so it doesn't expire immediately */
newdp->d_time = jiffies;
d_move(olddp, newdp);
}
uio_t tuio;
struct iovec iov;
- setup_uio(&tuio, &iov, target, 0, maxlen, UIO_READ, seg);
+ setup_uio(&tuio, &iov, target, (afs_offs_t) 0, maxlen, UIO_READ, seg);
code = afs_readlink((struct vcache*)ip, &tuio, credp);
crfree(credp);
char *name;
struct dentry *res;
+
AFS_GLOCK();
name = osi_Alloc(PATH_MAX+1);
if (!name) {
cred_t *credp = crref();
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
char *address;
- loff_t offset = pp->index << PAGE_CACHE_SHIFT;
+ afs_offs_t offset = pp->index << PAGE_CACHE_SHIFT;
#else
ulong address = afs_linux_page_address(pp);
- loff_t offset = pageoff(pp);
+ afs_offs_t offset = pageoff(pp);
#endif
uio_t tuio;
struct iovec iovec;
ICL_TYPE_POINTER, pp,
ICL_TYPE_INT32, cnt,
ICL_TYPE_INT32, 99999); /* not a possible code value */
-
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
address = kmap(pp);
ClearPageError(pp);
memset((void*)(address+(PAGESIZE-tuio.uio_resid)), 0,
tuio.uio_resid);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
- flush_dcache_page(pp);
- SetPageUptodate(pp);
+ flush_dcache_page(pp);
+ SetPageUptodate(pp);
#else
- set_bit(PG_uptodate, &pp->flags);
+ set_bit(PG_uptodate, &pp->flags);
#endif
}
unsigned long end_index;
unsigned offset = PAGE_CACHE_SIZE;
long status;
-
+
inode = (struct inode *) mapping->host;
end_index = inode->i_size >> PAGE_CACHE_SHIFT;
{
struct vcache *vcp = (struct vcache *) ip;
char *buffer;
- loff_t base;
+ afs_offs_t base;
int code = 0;
cred_t *credp;
uio_t tuio;
kunmap(pp);
return code;
-}
+}
static int
afs_linux_updatepage(struct file *file, struct page *page,
ICL_TYPE_POINTER, pp,
ICL_TYPE_INT32, atomic_read(&pp->count),
ICL_TYPE_INT32, 99999);
- setup_uio(&tuio, &iovec, page_addr + offset, pageoff(pp) + offset, count,
- UIO_WRITE, AFS_UIOSYS);
+ setup_uio(&tuio, &iovec, page_addr + offset, (afs_offs_t)(pageoff(pp) + offset),
+ count, UIO_WRITE, AFS_UIOSYS);
code = afs_write(vcp, &tuio, fp->f_flags, credp, 0);
AFS_STATCNT(afs_access);
afs_Trace3(afs_iclSetp, CM_TRACE_ACCESS, ICL_TYPE_POINTER, avc,
- ICL_TYPE_INT32, amode, ICL_TYPE_INT32, avc->m.Length);
+ ICL_TYPE_INT32, amode,
+ ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(avc->m.Length));
if (code = afs_InitReq(&treq, acred)) return code;
code = afs_VerifyVCache(avc, &treq);
AFS_STATCNT(afs_getattr);
afs_Trace2(afs_iclSetp, CM_TRACE_GETATTR, ICL_TYPE_POINTER, avc,
- ICL_TYPE_INT32, avc->m.Length);
+ ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(avc->m.Length));
#if defined(AFS_SUN5_ENV)
if (flags & ATTR_HINT) {
AFS_STATCNT(afs_setattr);
afs_Trace2(afs_iclSetp, CM_TRACE_SETATTR, ICL_TYPE_POINTER, avc,
- ICL_TYPE_INT32, avc->m.Length);
+ ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(avc->m.Length));
if (code = afs_InitReq(&treq, acred)) return code;
if (avc->states & CRO) {
code=EROFS;
if (attrs->va_size != -1) {
#endif
#endif
+ afs_size_t tsize = attrs->va_size;
ObtainWriteLock(&avc->lock,128);
avc->states |= CDirty;
- code = afs_TruncateAllSegments(avc, (afs_int32)attrs->va_size, &treq, acred);
+ code = afs_TruncateAllSegments(avc, tsize, &treq, acred);
/* if date not explicitly set by this call, set it ourselves, since we
* changed the data */
if (!(astat.Mask & AFS_SETMODTIME)) {
struct AFSCallBack CallBack;
afs_int32 now;
struct dcache *tdc;
- afs_int32 offset, len;
+ afs_size_t offset, len;
struct server *hostp=0;
struct vcache *tvc;
struct volume* volp = 0;
goto done;
}
- tdc = afs_GetDCache(adp, 0, &treq, &offset, &len, 1);
+ tdc = afs_GetDCache(adp, (afs_size_t) 0, &treq, &offset, &len, 1);
ObtainWriteLock(&adp->lock,135);
/*
/* Don't update the vcache entry unless the stats are current. */
if (avc->states & CStatd) {
hset(avc->m.DataVersion, avers);
+#ifdef AFS_64BIT_CLIENT
+ FillInt64(avc->m.Length, astat->Length_hi, astat->Length);
+#else /* AFS_64BIT_ENV */
avc->m.Length = astat->Length;
+#endif /* AFS_64BIT_ENV */
avc->m.Date = astat->ClientModTime;
}
if (ok) {
register struct conn *tc;
struct VenusFid newFid;
register struct dcache *tdc;
- afs_int32 offset, len;
+ afs_size_t offset, len;
register struct vcache *tvc;
struct AFSStoreStatus InStatus;
struct AFSFetchStatus OutFidStatus, OutDirStatus;
InStatus.ClientModTime = osi_Time();
InStatus.UnixModeBits = attrs->va_mode & 0xffff; /* only care about protection bits */
InStatus.Group = (afs_int32)acred->cr_gid;
- tdc = afs_GetDCache(adp, 0, &treq, &offset, &len, 1);
+ tdc = afs_GetDCache(adp, (afs_size_t) 0, &treq, &offset, &len, 1);
ObtainWriteLock(&adp->lock,153);
do {
tc = afs_Conn(&adp->fid, &treq, SHARED_LOCK);
register struct vcache *tvc = (struct vcache *)0;
register afs_int32 code;
register struct conn *tc;
- afs_int32 offset, len;
+ afs_size_t offset, len;
struct AFSFetchStatus OutDirStatus;
struct AFSVolSync tsync;
XSTATS_DECLS
goto done;
}
- tdc = afs_GetDCache(adp, 0, &treq, &offset, &len, 1); /* test for error below */
+ tdc = afs_GetDCache(adp, (afs_size_t) 0, &treq, &offset, &len, 1); /* test for error below */
ObtainWriteLock(&adp->lock,154);
if (tdc && (adp->states & CForeign)) {
struct VenusFid unlinkFid;
register struct dcache *tdc;
register afs_int32 code;
register struct conn *tc;
- afs_int32 offset, len;
+ afs_size_t offset, len;
struct AFSFetchStatus OutFidStatus, OutDirStatus;
struct AFSVolSync tsync;
XSTATS_DECLS
goto done;
}
- tdc = afs_GetDCache(adp, 0, &treq, &offset, &len, 1); /* test for error below */
+ tdc = afs_GetDCache(adp, (afs_size_t) 0, &treq, &offset, &len, 1); /* test for error below */
ObtainWriteLock(&adp->lock,145);
do {
tc = afs_Conn(&adp->fid, &treq, SHARED_LOCK);
#ifdef AFS_OSF_ENV
afs_PutVCache(adp, WRITE_LOCK);
#endif /* AFS_OSF_ENV */
- return afs_CheckCode(code, &treq);
+ return afs_CheckCode(code, &treq, 24);
}
struct dcache *dcp; /* chunk containing the dir block */
char *statMemp; /* status memory block */
char *cbfMemp; /* callback and fid memory block */
- long temp; /* temp for holding chunk length, &c. */
+ afs_size_t temp; /* temp for holding chunk length, &c. */
struct AFSFid *fidsp; /* file IDs were collecting */
struct AFSCallBack *cbsp; /* call back pointers */
struct AFSCallBack *tcbp; /* temp callback ptr */
long startTime; /* time we started the call,
* for callback expiration base
*/
- int statSeqNo; /* Valued of file size to detect races */
+ afs_size_t statSeqNo; /* Valued of file size to detect races */
int code; /* error code */
long newIndex; /* new index in the dir */
struct DirEntry *dirEntryp; /* dir entry we are examining */
code = afs_VerifyVCache(adp, areqp);
if (code) goto done;
- dcp = afs_GetDCache(adp, 0, areqp, &temp, &temp, 1);
+ dcp = afs_GetDCache(adp, (afs_size_t) 0, areqp, &temp, &temp, 1);
if (!dcp) {
code = ENOENT;
goto done;
{
register struct dcache *tdc;
- afs_int32 dirOffset, dirLen;
+ afs_size_t dirOffset, dirLen;
ino_t theDir;
struct VenusFid tfid;
/* now we have to lookup the next fid */
- tdc = afs_GetDCache(adp, 0, &treq, &dirOffset, &dirLen, 1);
+ tdc = afs_GetDCache(adp, (afs_size_t) 0, &treq, &dirOffset, &dirLen, 1);
if (!tdc) {
*avcp = (struct vcache *)0; /* redundant, but harmless */
code = EIO;
struct AFS_UCRED *acred;
daddr_t albn;
int noLock;
- struct buf **abpp; {
- afs_int32 totalLength;
- afs_int32 transferLength;
- afs_int32 filePos;
+ struct buf **abpp;
+{
+ afs_size_t totalLength;
+ afs_size_t transferLength;
+ afs_size_t filePos;
+ afs_size_t offset, len, tlen;
+ afs_int32 trimlen;
struct dcache *tdc=0;
- afs_int32 offset, len, error, trybusy=1;
+ afs_int32 error, trybusy=1;
struct uio tuio;
struct iovec *tvec;
char *tfile;
totalLength = auio->afsio_resid;
filePos = auio->afsio_offset;
afs_Trace4(afs_iclSetp, CM_TRACE_READ, ICL_TYPE_POINTER, avc,
- ICL_TYPE_INT32, filePos, ICL_TYPE_INT32, totalLength,
- ICL_TYPE_INT32, avc->m.Length);
+ ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(filePos),
+ ICL_TYPE_INT32, totalLength,
+ ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(avc->m.Length));
error = 0;
transferLength = 0;
if (!noLock)
/* start the daemon (may already be running, however) */
tdc->flags |= DFFetchReq;
bp = afs_BQueue(BOP_FETCH, avc, B_DONTWAIT, 0, acred,
- (long)filePos, (long) tdc, 0L, 0L);
+ (afs_size_t)filePos, (afs_size_t) tdc,
+ (afs_size_t) 0, (afs_size_t) 0);
if (!bp) {
tdc->flags &= ~DFFetchReq;
trybusy = 0; /* Avoid bkg daemon since they're too busy */
also not at eof, so may have to supply fake zeros */
len = AFS_CHUNKTOSIZE(tdc->f.chunk) - offset; /* bytes left in chunk addr space */
if (len > totalLength) len = totalLength; /* and still within xfr request */
- code = avc->m.Length - offset; /* and still within file */
- if (len > code) len = code;
+ tlen = avc->m.Length - offset; /* and still within file */
+ if (len > tlen) len = tlen;
if (len > AFS_ZEROS) len = sizeof(afs_zeros); /* and in 0 buffer */
afsio_copy(auio, &tuio, tvec);
- afsio_trim(&tuio, len);
- AFS_UIOMOVE(afs_zeros, len, UIO_READ, &tuio, code);
+ trimlen = len;
+ afsio_trim(&tuio, trimlen);
+ AFS_UIOMOVE(afs_zeros, trimlen, UIO_READ, &tuio, code);
if (code) {
error = code;
break;
/* mung uio structure to be right for this transfer */
afsio_copy(auio, &tuio, tvec);
- afsio_trim(&tuio, len);
+ trimlen = len;
+ afsio_trim(&tuio, trimlen);
tuio.afsio_offset = offset;
code = afs_MemReadUIO(tdc->f.inode, &tuio);
}
/* otherwise we've read some, fixup length, etc and continue with next seg */
len = len - tuio.afsio_resid; /* compute amount really transferred */
- afsio_skip(auio, len); /* update input uio structure */
+ trimlen = len;
+ afsio_skip(auio, trimlen); /* update input uio structure */
totalLength -= len;
transferLength += len;
filePos += len;
struct AFS_UCRED *acred, struct vrequest *areq)
{
register struct dcache *tdc;
- register afs_int32 offset;
- afs_int32 j1, j2; /* junk vbls for GetDCache to trash */
+ afs_size_t offset;
+ afs_size_t j1, j2; /* junk vbls for GetDCache to trash */
offset = adc->f.chunk+1; /* next chunk we'll need */
offset = AFS_CHUNKTOBASE(offset); /* base of next chunk */
#ifdef AFS_SUN5_ENVX
mutex_exit(&tdc->lock);
#endif
- bp = afs_BQueue(BOP_FETCH, avc, B_DONTWAIT, 0, acred, (long)offset,
- (long) tdc, 1L, 0L, 0L);
+ bp = afs_BQueue(BOP_FETCH, avc, B_DONTWAIT, 0, acred,
+ (afs_size_t) offset, (afs_size_t) tdc,
+ (afs_size_t) 1, (afs_size_t) 0);
if (!bp) {
/* Bkg table full; just abort non-important prefetching to avoid deadlocks */
tdc->flags &= ~(DFNextStarted | DFFetchReq);
struct AFS_UCRED *acred;
int noLock;
daddr_t albn;
- struct buf **abpp; {
+ struct buf **abpp;
+{
struct vrequest treq;
int offDiff;
struct dcache *tdc;
auio->afsio_offset -= avc->quick.minLoc;
+ afs_Trace4(afs_iclSetp, CM_TRACE_READFAST, ICL_TYPE_POINTER, avc,
+ ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(auio->afsio_offset),
+ ICL_TYPE_INT32, auio->afsio_resid,
+ ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(avc->m.Length));
+
tfile = (struct osi_file *)osi_UFSOpen(tdc->f.inode);
#ifdef AFS_AIX_ENV
struct AFS_UCRED *acred;
daddr_t albn;
int noLock;
- struct buf **abpp; {
- afs_int32 totalLength;
- afs_int32 transferLength;
- afs_int32 filePos;
+ struct buf **abpp;
+{
+ afs_size_t totalLength;
+ afs_size_t transferLength;
+ afs_size_t filePos;
+ afs_size_t offset, len, tlen;
+ afs_int32 trimlen;
struct dcache *tdc=0;
- afs_int32 offset, len, error;
+ afs_int32 error;
struct uio tuio;
struct iovec *tvec;
struct osi_file *tfile;
totalLength = auio->afsio_resid;
filePos = auio->afsio_offset;
afs_Trace4(afs_iclSetp, CM_TRACE_READ, ICL_TYPE_POINTER, avc,
- ICL_TYPE_INT32, filePos, ICL_TYPE_INT32, totalLength,
- ICL_TYPE_INT32, avc->m.Length);
+ ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(filePos),
+ ICL_TYPE_INT32, totalLength,
+ ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(avc->m.Length));
error = 0;
transferLength = 0;
if (!noLock)
munlocked = 1;
#endif
bp = afs_BQueue(BOP_FETCH, avc, B_DONTWAIT, 0, acred,
- (long)filePos, (long) tdc, 0L, 0L);
+ (afs_size_t)filePos, (afs_size_t) tdc,
+ (afs_size_t) 0, (afs_size_t) 0);
if (!bp) {
/* Bkg table full; retry deadlocks */
tdc->flags &= ~DFFetchReq;
also not at eof, so may have to supply fake zeros */
len = AFS_CHUNKTOSIZE(tdc->f.chunk) - offset; /* bytes left in chunk addr space */
if (len > totalLength) len = totalLength; /* and still within xfr request */
- code = avc->m.Length - offset; /* and still within file */
- if (len > code) len = code;
+ tlen = avc->m.Length - offset; /* and still within file */
+ if (len > tlen) len = tlen;
if (len > AFS_ZEROS) len = sizeof(afs_zeros); /* and in 0 buffer */
afsio_copy(auio, &tuio, tvec);
- afsio_trim(&tuio, len);
- AFS_UIOMOVE(afs_zeros, len, UIO_READ, &tuio, code);
+ trimlen = len;
+ afsio_trim(&tuio, trimlen);
+ AFS_UIOMOVE(afs_zeros, trimlen, UIO_READ, &tuio, code);
if (code) {
error = code;
break;
tfile = (struct osi_file *)osi_UFSOpen(tdc->f.inode);
/* mung uio structure to be right for this transfer */
afsio_copy(auio, &tuio, tvec);
- afsio_trim(&tuio, len);
+ trimlen = len;
+ afsio_trim(&tuio, trimlen);
tuio.afsio_offset = offset;
#ifdef AFS_AIX_ENV
#ifdef AFS_AIX41_ENV
}
/* otherwise we've read some, fixup length, etc and continue with next seg */
len = len - tuio.afsio_resid; /* compute amount really transferred */
- afsio_skip(auio, len); /* update input uio structure */
+ trimlen = len;
+ afsio_skip(auio, trimlen); /* update input uio structure */
totalLength -= len;
transferLength += len;
filePos += len;
#else
int rlen;
#endif
-int off;
+afs_size_t off;
{
int code = 0;
#if defined(AFS_SUN56_ENV)
#endif
OSI_VC_DECL(avc);
struct uio *auio;
- struct AFS_UCRED *acred; {
+ struct AFS_UCRED *acred;
+{
struct vrequest treq;
register struct dcache *tdc;
- afs_int32 origOffset, len, dirsiz;
+ afs_size_t origOffset, tlen;
+ afs_int32 len, dirsiz;
int code = 0;
struct DirEntry *ode = 0, *nde = 0;
int o_slen = 0, n_slen = 0;
code = afs_VerifyVCache(avc, &treq);
if (code) goto done;
/* get a reference to the entire directory */
- tdc = afs_GetDCache(avc, 0, &treq, &origOffset, &len, 1);
+ tdc = afs_GetDCache(avc, (afs_size_t) 0, &treq, &origOffset, &tlen, 1);
+ len = tlen;
if (!tdc) {
code = ENOENT;
goto done;
struct AFS_UCRED *acred; {
struct vrequest treq;
register struct dcache *tdc;
- afs_int32 origOffset, len;
+ afs_size_t origOffset, len;
int code = 0;
struct DirEntry *ode = 0, *nde = 0;
int o_slen = 0, n_slen = 0;
code = afs_VerifyVCache(avc, &treq);
if (code) goto done;
/* get a reference to the entire directory */
- tdc = afs_GetDCache(avc, 0, &treq, &origOffset, &len, 1);
+ tdc = afs_GetDCache(avc, (afs_size_t) 0, &treq, &origOffset, &len, 1);
if (!tdc) {
code = ENOENT;
goto done;
#endif
struct vrequest *areq;
register struct vcache *avc; {
- register afs_int32 nextChunk, pos;
+ register afs_int32 nextChunk;
register struct dcache *tdc;
- afs_int32 offset, len;
+ afs_size_t pos, offset, len;
AFS_STATCNT(FetchWholeEnchilada);
if ((avc->states & CStatd) == 0) return; /* don't know size */
return code;
}
- tdc = afs_GetDCache(adp, 0, &treq, &offset, &len, 1); /* test for error below */
+ tdc = afs_GetDCache(adp, (afs_size_t) 0, &treq, &offset, &len, 1); /* test for error below */
ObtainWriteLock(&adp->lock,142);
/*
* fileFid in order to handle ".." invalidation at the very end.
*/
code = 0;
- tdc1 = afs_GetDCache(aodp, 0, &treq, &offset, &len, 0);
+ tdc1 = afs_GetDCache(aodp, (afs_size_t) 0, &treq, &offset, &len, 0);
if (!tdc1) {
code = ENOENT;
}
struct conn *tc;
struct VenusFid newFid;
struct dcache *tdc;
- afs_int32 offset, len, alen;
+ afs_size_t offset, len;
+ afs_int32 alen;
struct server *hostp=0;
struct vcache *tvc;
struct AFSStoreStatus InStatus;
InStatus.UnixModeBits = 0755;
alen++; /* add in the null */
}
- tdc = afs_GetDCache(adp, 0, &treq, &offset, &len, 1);
+ tdc = afs_GetDCache(adp, (afs_size_t) 0, &treq, &offset, &len, 1);
volp = afs_FindVolume(&adp->fid, READ_LOCK); /*parent is also in same vol*/
ObtainWriteLock(&adp->lock,156);
ObtainSharedLock(&afs_xvcache,17); /* prevent others from creating this entry */
{
register struct dcache *tdc;
register char *tp;
- afs_int32 offset, len, alen;
+ afs_size_t offset, len;
+ afs_int32 tlen, alen;
register afs_int32 code;
AFS_STATCNT(afs_MemHandleLink);
protected 755, we add a null to the end of */
if (!avc->linkData) {
void *addr;
- tdc = afs_GetDCache(avc, 0, areq, &offset, &len, 0);
+ tdc = afs_GetDCache(avc, (afs_size_t) 0, areq, &offset, &len, 0);
if (!tdc) {
return EIO;
}
else alen = len; /* mt point */
tp = afs_osi_Alloc(alen); /* make room for terminating null */
addr = afs_MemCacheOpen(tdc->f.inode);
- code = afs_MemReadBlk(addr, 0, tp, len);
+ tlen = len;
+ code = afs_MemReadBlk(addr, 0, tp, tlen);
tp[alen-1] = 0;
afs_PutDCache(tdc);
if (code != len) {
afs_UFSHandleLink(avc, areq)
register struct vcache *avc;
- struct vrequest *areq; {
+ struct vrequest *areq;
+{
register struct dcache *tdc;
register char *tp;
char *tfile;
- afs_int32 offset, len, alen;
+ afs_size_t offset, len;
+ afs_int32 tlen, alen;
register afs_int32 code;
/* two different formats, one for links protected 644, have a "." at the end
we add a null to the end of */
AFS_STATCNT(afs_UFSHandleLink);
if (!avc->linkData) {
- tdc = afs_GetDCache(avc, 0, areq, &offset, &len, 0);
+ tdc = afs_GetDCache(avc, (afs_size_t) 0, areq, &offset, &len, 0);
+ afs_Trace3(afs_iclSetp, CM_TRACE_UFSLINK, ICL_TYPE_POINTER, avc,
+ ICL_TYPE_POINTER, tdc,
+ ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(avc->m.Length));
if (!tdc) {
return EIO;
}
tfile = osi_UFSOpen (tdc->f.inode);
if (avc->m.Mode & 0111) alen = len+1; /* regular link */
else alen = len; /* mt point */
- tp = afs_osi_Alloc(alen); /* make room for terminating null */
- code = afs_osi_Read(tfile, -1, tp, len);
+ tp = afs_osi_Alloc(alen); /* make room for terminating null */
+ tlen = len;
+ code = afs_osi_Read(tfile, -1, tp, tlen);
tp[alen-1] = 0;
osi_UFSClose(tfile);
afs_PutDCache(tdc);
- if (code != len) {
+ if (code != tlen) {
afs_osi_Free(tp, alen);
return EIO;
}
afs_readlink(OSI_VC_ARG(avc), auio, acred)
OSI_VC_DECL(avc);
struct uio *auio;
- struct AFS_UCRED *acred; {
+ struct AFS_UCRED *acred;
+{
register afs_int32 code;
struct vrequest treq;
register char *tp;
register struct vcache *avc;
struct uio *auio;
int aio, noLock;
- struct AFS_UCRED *acred; {
- afs_int32 totalLength;
- afs_int32 transferLength;
- afs_int32 filePos;
+ struct AFS_UCRED *acred;
+{
+ afs_size_t totalLength;
+ afs_size_t transferLength;
+ afs_size_t filePos;
+ afs_size_t offset, len;
+ afs_int32 tlen, trimlen;
afs_int32 startDate;
afs_int32 max;
register struct dcache *tdc;
#ifdef _HIGHC_
volatile
#endif
- afs_int32 offset, len, error;
+ afs_int32 error;
struct uio tuio;
struct iovec *tvec; /* again, should have define */
char *tfile;
error = 0;
transferLength = 0;
afs_Trace4(afs_iclSetp, CM_TRACE_WRITE, ICL_TYPE_POINTER, avc,
- ICL_TYPE_INT32, filePos, ICL_TYPE_INT32, totalLength,
- ICL_TYPE_INT32, avc->m.Length);
+ ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(filePos),
+ ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(totalLength),
+ ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(avc->m.Length));
if (!noLock) {
afs_MaybeWakeupTruncateDaemon();
ObtainWriteLock(&avc->lock,126);
*/
if (noLock) {
tdc = afs_FindDCache(avc, filePos);
- if (tdc) {
- offset = filePos - AFS_CHUNKTOBASE(tdc->f.chunk);
- len = tdc->f.chunkBytes - offset;
- }
} else if (afs_blocksUsed > (CM_WAITFORDRAINPCT*afs_cacheBlocks)/100) {
tdc = afs_FindDCache(avc, filePos);
if (tdc) {
(tdc->flags & DFFetching)) {
afs_PutDCache(tdc);
tdc = NULL;
- } else {
- offset = filePos - AFS_CHUNKTOBASE(tdc->f.chunk);
- len = tdc->f.chunkBytes - offset;
}
}
if (!tdc) {
tdc->flags |= DFEntryMod;
}
len = totalLength; /* write this amount by default */
+ offset = filePos - AFS_CHUNKTOBASE(tdc->f.chunk);
max = AFS_CHUNKTOSIZE(tdc->f.chunk); /* max size of this chunk */
if (max <= len + offset) { /*if we'd go past the end of this chunk */
/* it won't all fit in this chunk, so write as much
}
/* mung uio structure to be right for this transfer */
afsio_copy(auio, &tuio, tvec);
- afsio_trim(&tuio, len);
+ trimlen = len;
+ afsio_trim(&tuio, trimlen);
tuio.afsio_offset = offset;
code = afs_MemWriteUIO(tdc->f.inode, &tuio);
}
/* otherwise we've written some, fixup length, etc and continue with next seg */
len = len - tuio.afsio_resid; /* compute amount really transferred */
- afsio_skip(auio, len); /* advance auio over data written */
+ tlen = len;
+ afsio_skip(auio, tlen); /* advance auio over data written */
/* compute new file size */
- if (offset + len > tdc->f.chunkBytes)
- afs_AdjustSize(tdc, offset+len);
+ if (offset + len > tdc->f.chunkBytes) {
+ afs_int32 toffset = offset+len;
+ afs_AdjustSize(tdc, toffset);
+ }
totalLength -= len;
transferLength += len;
filePos += len;
register struct vcache *avc;
struct uio *auio;
int aio, noLock;
- struct AFS_UCRED *acred; {
- afs_int32 totalLength;
- afs_int32 transferLength;
- afs_int32 filePos;
+ struct AFS_UCRED *acred;
+{
+ afs_size_t totalLength;
+ afs_size_t transferLength;
+ afs_size_t filePos;
+ afs_size_t offset, len;
+ afs_int32 tlen;
+ afs_int32 trimlen;
afs_int32 startDate;
afs_int32 max;
register struct dcache *tdc;
#ifdef _HIGHC_
volatile
#endif
- afs_int32 offset, len, error;
+ afs_int32 error;
struct uio tuio;
struct iovec *tvec; /* again, should have define */
struct osi_file *tfile;
error = 0;
transferLength = 0;
afs_Trace4(afs_iclSetp, CM_TRACE_WRITE, ICL_TYPE_POINTER, avc,
- ICL_TYPE_INT32, filePos, ICL_TYPE_INT32, totalLength,
- ICL_TYPE_INT32, avc->m.Length);
+ ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(filePos),
+ ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(totalLength),
+ ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(avc->m.Length));
if (!noLock) {
afs_MaybeWakeupTruncateDaemon();
ObtainWriteLock(&avc->lock,556);
/* read the cached info */
if (noLock) {
tdc = afs_FindDCache(avc, filePos);
- if (tdc) {
- offset = filePos - AFS_CHUNKTOBASE(tdc->f.chunk);
- len = tdc->f.chunkBytes - offset;
- }
} else if (afs_blocksUsed > (CM_WAITFORDRAINPCT*afs_cacheBlocks)/100) {
tdc = afs_FindDCache(avc, filePos);
if (tdc) {
(tdc->flags & DFFetching)) {
afs_PutDCache(tdc);
tdc = NULL;
- } else {
- offset = filePos - AFS_CHUNKTOBASE(tdc->f.chunk);
- len = tdc->f.chunkBytes - offset;
}
}
if (!tdc) {
}
tfile = (struct osi_file *)osi_UFSOpen(tdc->f.inode);
len = totalLength; /* write this amount by default */
+ offset = filePos - AFS_CHUNKTOBASE(tdc->f.chunk);
max = AFS_CHUNKTOSIZE(tdc->f.chunk); /* max size of this chunk */
if (max <= len + offset) { /*if we'd go past the end of this chunk */
/* it won't all fit in this chunk, so write as much
}
/* mung uio structure to be right for this transfer */
afsio_copy(auio, &tuio, tvec);
- afsio_trim(&tuio, len);
+ trimlen = len;
+ afsio_trim(&tuio, trimlen);
tuio.afsio_offset = offset;
#ifdef AFS_AIX_ENV
#ifdef AFS_AIX41_ENV
}
/* otherwise we've written some, fixup length, etc and continue with next seg */
len = len - tuio.afsio_resid; /* compute amount really transferred */
- afsio_skip(auio, len); /* advance auio over data written */
+ tlen = len;
+ afsio_skip(auio, tlen); /* advance auio over data written */
/* compute new file size */
- if (offset + len > tdc->f.chunkBytes)
- afs_AdjustSize(tdc, offset+len);
+ if (offset + len > tdc->f.chunkBytes) {
+ afs_int32 toffset = offset+len;
+ afs_AdjustSize(tdc, toffset);
+ }
totalLength -= len;
transferLength += len;
filePos += len;
return 0; /* nothing to do */
/* otherwise, call afs_StoreDCache (later try to do this async, if possible) */
afs_Trace2(afs_iclSetp, CM_TRACE_PARTIALWRITE, ICL_TYPE_POINTER, avc,
- ICL_TYPE_INT32, avc->m.Length);
+ ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(avc->m.Length));
#if defined(AFS_SUN5_ENV)
code = afs_StoreAllSegments(avc, areq, AFS_ASYNC | AFS_VMSYNC_INVAL);
#else
#endif
/* at least one daemon is idle, so ask it to do the store.
Also, note that we don't lock it any more... */
- tb = afs_BQueue(BOP_STORE, avc, 0, 1, acred, (long)acred->cr_uid,
- 0L, 0L, 0L);
+ tb = afs_BQueue(BOP_STORE, avc, 0, 1, acred,
+ (afs_size_t) acred->cr_uid, (afs_size_t) 0,
+ (afs_size_t) 0, (afs_size_t) 0);
/* sleep waiting for the store to start, then retrieve error code */
while ((tb->flags & BUVALID) == 0) {
tb->flags |= BUWAIT;
struct brequest {
struct vcache *vnode; /* vnode to use, with vrefcount bumped */
struct AFS_UCRED *cred; /* credentials to use for operation */
- long parm[BPARMS]; /* random parameters - long's work for
- * both 32 and 64 bit platforms.
- */
+ afs_size_t parm[BPARMS]; /* random parameters */
afs_int32 code; /* return code */
short refCount; /* use counter for this structure */
char opcode; /* what to do (store, fetch, etc) */
#define SRVR_MULTIHOMED 0x40
#define SRVR_ISGONE 0x80
#define SNO_INLINEBULK 0x100
+#define SNO_64BIT 0x200
+
+#define afs_serverSetNo64Bit(s) ((s)->srvr->server->flags |= SNO_64BIT)
+#define afs_serverHasNo64Bit(s) ((s)->srvr->server->flags & SNO_64BIT)
struct server {
union {
#endif
#define AFS_MAXDV 0x7fffffff /* largest dataversion number */
+#ifdef AFS_64BIT_CLIENT
+#define AFS_NOTRUNC 0x7fffffffffffffffLL /* largest positive int64 number */
+#else /* AFS_64BIT_CLIENT */
#define AFS_NOTRUNC 0x7fffffff /* largest dataversion number */
+#endif /* AFS_64BIT_CLIENT */
extern afs_int32 vmPageHog; /* counter for # of vnodes which are page hogs. */
struct dcache * dc;
afs_uint32 stamp;
struct osi_file * f;
- afs_uint32 minLoc; /* smallest offset into dc. */
- afs_uint32 len; /* largest offset into dc. */
+ afs_offs_t minLoc; /* smallest offset into dc. */
+ afs_offs_t len; /* largest offset into dc. */
};
extern afs_uint32 afs_stampValue; /* stamp for pair's usage */
struct vcache *hnext; /* Hash next */
struct VenusFid fid;
struct mstat {
- afs_uint32 Length;
+ afs_size_t Length;
afs_hyper_t DataVersion;
afs_uint32 Date;
afs_uint32 Owner;
char *linkData; /* Link data if a symlink. */
afs_hyper_t flushDV; /* data version last flushed from text */
afs_hyper_t mapDV; /* data version last flushed from map */
- afs_uint32 truncPos; /* truncate file to this position at next store */
+ afs_size_t truncPos; /* truncate file to this position at next store */
struct server *callback; /* The callback host, if any */
afs_uint32 cbExpires; /* time the callback expires */
struct afs_q callsort; /* queue in expiry order, sort of */
struct dcache {
struct afs_q lruq; /* Free queue for in-memory images */
afs_rwlock_t lock; /* XXX */
- short refCount; /* Associated reference count. */
+ afs_size_t validPos; /* number of valid bytes during fetch */
afs_int32 index; /* The index in the CacheInfo file*/
+ short refCount; /* Associated reference count. */
short flags; /* more flags bits */
- afs_int32 validPos; /* number of valid bytes during fetch */
struct fcache f; /* disk image */
afs_int32 stamp; /* used with vtodc struct for hints */
};
/* If network troubles, mark server as having bogued out again. */
/* VRESTARTING is < 0 because of backward compatibility issues
* with 3.4 file servers and older cache managers */
+#ifdef AFS_64BIT_CLIENT
+ if (acode == -455)
+ acode = 455;
+#endif /* AFS_64BIT_CLIENT */
if ((acode < 0) && (acode != VRESTARTING)) {
afs_ServerDown(sa);
ForceNewConnections(sa); /*multi homed clients lock:afs_xsrvAddr?*/
int type;
{
if (type == ICL_TYPE_HYPER || type == ICL_TYPE_STRING
- || type == ICL_TYPE_FID)
+ || type == ICL_TYPE_FID || type == ICL_TYPE_INT64)
return 1;
else
return 0;
ICL_APPENDINT32(logp, (afs_int32)((struct afs_hyper_t *)p1)->high);
ICL_APPENDINT32(logp, (afs_int32)((struct afs_hyper_t *)p1)->low);
}
+ else if (t1 == ICL_TYPE_INT64) {
+#ifdef AFSLITTLE_ENDIAN
+#ifdef AFS_64BIT_CLIENT
+ ICL_APPENDINT32(logp, (afs_int32)((afs_int32 *)p1)[1]);
+ ICL_APPENDINT32(logp, (afs_int32)((afs_int32 *)p1)[0]);
+#else /* AFS_64BIT_CLIENT */
+ ICL_APPENDINT32(logp, (afs_int32) p1);
+ ICL_APPENDINT32(logp, (afs_int32) 0);
+#endif /* AFS_64BIT_CLIENT */
+#else /* AFSLITTLE_ENDIAN */
+#ifdef AFS_64BIT_CLIENT
+ ICL_APPENDINT32(logp, (afs_int32)((afs_int32 *)p1)[0]);
+ ICL_APPENDINT32(logp, (afs_int32)((afs_int32 *)p1)[1]);
+#else /* AFS_64BIT_CLIENT */
+ ICL_APPENDINT32(logp, (afs_int32) 0);
+ ICL_APPENDINT32(logp, (afs_int32) p1);
+#endif /* AFS_64BIT_CLIENT */
+#endif /* AFSLITTLE_ENDIAN */
+ }
else if (t1 == ICL_TYPE_FID) {
ICL_APPENDINT32(logp, (afs_int32)((afs_int32 *)p1)[0]);
ICL_APPENDINT32(logp, (afs_int32)((afs_int32 *)p1)[1]);
ICL_APPENDINT32(logp, (afs_int32)((struct afs_hyper_t *)p2)->high);
ICL_APPENDINT32(logp, (afs_int32)((struct afs_hyper_t *)p2)->low);
}
+ else if (t2 == ICL_TYPE_INT64) {
+#ifdef AFSLITTLE_ENDIAN
+#ifdef AFS_64BIT_CLIENT
+ ICL_APPENDINT32(logp, (afs_int32)((afs_int32 *)p2)[1]);
+ ICL_APPENDINT32(logp, (afs_int32)((afs_int32 *)p2)[0]);
+#else /* AFS_64BIT_CLIENT */
+ ICL_APPENDINT32(logp, (afs_int32) p2);
+ ICL_APPENDINT32(logp, (afs_int32) 0);
+#endif /* AFS_64BIT_CLIENT */
+#else /* AFSLITTLE_ENDIAN */
+#ifdef AFS_64BIT_CLIENT
+ ICL_APPENDINT32(logp, (afs_int32)((afs_int32 *)p2)[0]);
+ ICL_APPENDINT32(logp, (afs_int32)((afs_int32 *)p2)[1]);
+#else /* AFS_64BIT_CLIENT */
+ ICL_APPENDINT32(logp, (afs_int32) 0);
+ ICL_APPENDINT32(logp, (afs_int32) p2);
+#endif /* AFS_64BIT_CLIENT */
+#endif /* AFSLITTLE_ENDIAN */
+ }
else if (t2 == ICL_TYPE_FID) {
ICL_APPENDINT32(logp, (afs_int32)((afs_int32 *)p2)[0]);
ICL_APPENDINT32(logp, (afs_int32)((afs_int32 *)p2)[1]);
ICL_APPENDINT32(logp, (afs_int32)((struct afs_hyper_t *)p3)->high);
ICL_APPENDINT32(logp, (afs_int32)((struct afs_hyper_t *)p3)->low);
}
+ else if (t3 == ICL_TYPE_INT64) {
+#ifdef AFSLITTLE_ENDIAN
+#ifdef AFS_64BIT_CLIENT
+ ICL_APPENDINT32(logp, (afs_int32)((afs_int32 *)p3)[1]);
+ ICL_APPENDINT32(logp, (afs_int32)((afs_int32 *)p3)[0]);
+#else /* AFS_64BIT_CLIENT */
+ ICL_APPENDINT32(logp, (afs_int32) p3);
+ ICL_APPENDINT32(logp, (afs_int32) 0);
+#endif /* AFS_64BIT_CLIENT */
+#else /* AFSLITTLE_ENDIAN */
+#ifdef AFS_64BIT_CLIENT
+ ICL_APPENDINT32(logp, (afs_int32)((afs_int32 *)p3)[0]);
+ ICL_APPENDINT32(logp, (afs_int32)((afs_int32 *)p3)[1]);
+#else /* AFS_64BIT_CLIENT */
+ ICL_APPENDINT32(logp, (afs_int32) 0);
+ ICL_APPENDINT32(logp, (afs_int32) p3);
+#endif /* AFS_64BIT_CLIENT */
+#endif /* AFSLITTLE_ENDIAN */
+ }
else if (t3 == ICL_TYPE_FID) {
ICL_APPENDINT32(logp, (afs_int32)((afs_int32 *)p3)[0]);
ICL_APPENDINT32(logp, (afs_int32)((afs_int32 *)p3)[1]);
ICL_APPENDINT32(logp, (afs_int32)((struct afs_hyper_t *)p4)->high);
ICL_APPENDINT32(logp, (afs_int32)((struct afs_hyper_t *)p4)->low);
}
+ else if (t4 == ICL_TYPE_INT64) {
+#ifdef AFSLITTLE_ENDIAN
+#ifdef AFS_64BIT_CLIENT
+ ICL_APPENDINT32(logp, (afs_int32)((afs_int32 *)p4)[1]);
+ ICL_APPENDINT32(logp, (afs_int32)((afs_int32 *)p4)[0]);
+#else /* AFS_64BIT_CLIENT */
+ ICL_APPENDINT32(logp, (afs_int32) p4);
+ ICL_APPENDINT32(logp, (afs_int32) 0);
+#endif /* AFS_64BIT_CLIENT */
+#else /* AFSLITTLE_ENDIAN */
+#ifdef AFS_64BIT_CLIENT
+ ICL_APPENDINT32(logp, (afs_int32)((afs_int32 *)p4)[0]);
+ ICL_APPENDINT32(logp, (afs_int32)((afs_int32 *)p4)[1]);
+#else /* AFS_64BIT_CLIENT */
+ ICL_APPENDINT32(logp, (afs_int32) 0);
+ ICL_APPENDINT32(logp, (afs_int32) p4);
+#endif /* AFS_64BIT_CLIENT */
+#endif /* AFSLITTLE_ENDIAN */
+ }
else if (t4 == ICL_TYPE_FID) {
ICL_APPENDINT32(logp, (afs_int32)((afs_int32 *)p4)[0]);
ICL_APPENDINT32(logp, (afs_int32)((afs_int32 *)p4)[1]);
a_result->lock.pid_writer = 0;
a_result->lock.src_indicator = 0;
#endif /* AFS_OSF20_ENV */
+#ifdef AFS_64BIT_CLIENT
+ a_result->Length = (afs_int32) tvc->m.Length & 0xffffffff;
+#else /* AFS_64BIT_CLIENT */
a_result->Length = tvc->m.Length;
+#endif /* AFS_64BIT_CLIENT */
a_result->DataVersion = hgetlo(tvc->m.DataVersion);
a_result->callback = afs_data_pointer_to_int32(tvc->callback); /* XXXX Now a pointer; change it XXXX */
a_result->cbExpires = tvc->cbExpires;
} /*SRXAFSCB_GetCE*/
+int SRXAFSCB_GetCE64(a_call, a_index, a_result)
+ struct rx_call *a_call;
+ afs_int32 a_index;
+ struct AFSDBCacheEntry64 *a_result;
+
+{ /*SRXAFSCB_GetCE64*/
+
+ register int i; /*Loop variable*/
+ register struct vcache *tvc; /*Ptr to current cache entry*/
+ int code; /*Return code*/
+ XSTATS_DECLS;
+
+#ifdef RX_ENABLE_LOCKS
+ AFS_GLOCK();
+#endif /* RX_ENABLE_LOCKS */
+
+ XSTATS_START_CMTIME(AFS_STATS_CM_RPCIDX_GETCE);
+
+ AFS_STATCNT(SRXAFSCB_GetCE64);
+ for (i = 0; i < VCSIZE; i++) {
+ for (tvc = afs_vhashT[i]; tvc; tvc = tvc->hnext) {
+ if (a_index == 0)
+ goto searchDone;
+ a_index--;
+ } /*Zip through current hash chain*/
+ } /*Zip through hash chains*/
+
+ searchDone:
+ if (tvc == (struct vcache *) 0) {
+ /*Past EOF*/
+ code = 1;
+ goto fcnDone;
+ }
+
+ /*
+ * Copy out the located entry.
+ */
+ a_result->addr = afs_data_pointer_to_int32(tvc);
+ a_result->cell = tvc->fid.Cell;
+ a_result->netFid.Volume = tvc->fid.Fid.Volume;
+ a_result->netFid.Vnode = tvc->fid.Fid.Vnode;
+ a_result->netFid.Unique = tvc->fid.Fid.Unique;
+ a_result->lock.waitStates = tvc->lock.wait_states;
+ a_result->lock.exclLocked = tvc->lock.excl_locked;
+ a_result->lock.readersReading = tvc->lock.readers_reading;
+ a_result->lock.numWaiting = tvc->lock.num_waiting;
+#if defined(INSTRUMENT_LOCKS)
+ a_result->lock.pid_last_reader = tvc->lock.pid_last_reader;
+ a_result->lock.pid_writer = tvc->lock.pid_writer;
+ a_result->lock.src_indicator = tvc->lock.src_indicator;
+#else
+ /* On osf20 , the vcache does not maintain these three fields */
+ a_result->lock.pid_last_reader = 0;
+ a_result->lock.pid_writer = 0;
+ a_result->lock.src_indicator = 0;
+#endif /* AFS_OSF20_ENV */
+#ifdef AFS_64BIT_ENV
+ a_result->Length = tvc->m.Length;
+#else /* AFS_64BIT_ENV */
+#ifdef AFS_64BIT_CLIENT
+ a_result->Length = tvc->m.Length;
+#else /* AFS_64BIT_CLIENT */
+ a_result->Length.high = 0;
+ a_result->Length.low = tvc->m.Length;
+#endif /* AFS_64BIT_CLIENT */
+#endif /* AFS_64BIT_ENV */
+ a_result->DataVersion = hgetlo(tvc->m.DataVersion);
+ a_result->callback = afs_data_pointer_to_int32(tvc->callback); /* XXXX Now a pointer; change it XXXX */
+ a_result->cbExpires = tvc->cbExpires;
+ a_result->refCount = VREFCOUNT(tvc);
+ a_result->opens = tvc->opens;
+ a_result->writers = tvc->execsOrWriters;
+ a_result->mvstat = tvc->mvstat;
+ a_result->states = tvc->states;
+ code = 0;
+
+ /*
+ * Return our results.
+ */
+fcnDone:
+ XSTATS_END_TIME;
+
+#ifdef RX_ENABLE_LOCKS
+ AFS_GUNLOCK();
+#endif /* RX_ENABLE_LOCKS */
+
+ return(code);
+
+} /*SRXAFSCB_GetCE64*/
+
/*------------------------------------------------------------------------
* EXPORTED SRXAFSCB_GetLock
return 0;
}
+
+/*------------------------------------------------------------------------
+ * EXPORTED SRXAFSCB_FetchData
+ *
+ * Description:
+ * Routine to do third party move from a remioserver to the original
+ * issuer of an ArchiveData request. Presently supported only by the
+ * "fs" command, not by the AFS client.
+ *
+ * Arguments:
+ * rxcall: Ptr to Rx call on which this request came in.
+ * Fid: pointer to AFSFid structure.
+ * Fd: File descriptor inside fs command.
+ * Position: Offset in the file.
+ * Length: Data length to transfer.
+ * TotalLength: Pointer to total file length field
+ *
+ * Returns:
+ * 0 on success
+ *
+ * Environment:
+ * Nothing interesting.
+ *
+ * Side Effects:
+ *------------------------------------------------------------------------*/
+SRXAFSCB_FetchData(rxcall, Fid, Fd, Position, Length, TotalLength)
+ struct rx_call *rxcall;
+ struct AFSFid *Fid;
+ afs_int32 Fd;
+ afs_int64 Position;
+ afs_int64 Length;
+ afs_int64 *TotalLength;
+{
+ return ENOSYS;
+}
+
+/*------------------------------------------------------------------------
+ * EXPORTED SRXAFSCB_StoreData
+ *
+ * Description:
+ * Routine to do third party move from a remioserver to the original
+ * issuer of a RetrieveData request. Presently supported only by the
+ * "fs" command, not by the AFS client.
+ *
+ * Arguments:
+ * rxcall: Ptr to Rx call on which this request came in.
+ * Fid: pointer to AFSFid structure.
+ * Fd: File descriptor inside fs command.
+ * Position: Offset in the file.
+ * Length: Data length to transfer.
+ * TotalLength: Pointer to total file length field
+ *
+ * Returns:
+ * 0 on success
+ *
+ * Environment:
+ * Nothing interesting.
+ *
+ * Side Effects:
+ * As advertised.
+ *------------------------------------------------------------------------*/
+SRXAFSCB_StoreData(rxcall, Fid, Fd, Position, Length, TotalLength)
+ struct rx_call *rxcall;
+ struct AFSFid *Fid;
+ afs_int32 Fd;
+ afs_int64 Position;
+ afs_int64 Length;
+ afs_int64 *TotalLength;
+{
+ return ENOSYS;
+}
#else /* AFS_NOCHUNKING */
extern afs_int32 afs_OtherCSize, afs_LogChunk, afs_FirstCSize;
+#ifdef AFS_64BIT_CLIENT
+#ifdef AFS_VM_RDWR_ENV
+extern afs_size_t afs_vmMappingEnd;
+#endif /* AFS_VM_RDWR_ENV */
+#endif /* AFS_64BIT_CLIENT */
#define AFS_OTHERCSIZE (afs_OtherCSize)
#define AFS_LOGCHUNK (afs_LogChunk)
afs_OtherCSize)
#define AFS_CHUNKTOBASE(chunk) ((chunk == 0) ? 0 : \
- (afs_FirstCSize + ((chunk - 1) << afs_LogChunk)))
+ ((afs_size_t) afs_FirstCSize + ((afs_size_t) (chunk - 1) << afs_LogChunk)))
#define AFS_CHUNKTOSIZE(chunk) ((chunk == 0) ? afs_FirstCSize : afs_OtherCSize)
#define afs_GetVolSlot() (*(afs_cacheType->GetVolSlot))()
#define afs_HandleLink(avc, areq) (*(afs_cacheType->HandleLink))(avc, areq)
-#define afs_CacheFetchProc(call, file, base, adc, avc, toxfer, xfered) \
- (*(afs_cacheType->FetchProc))(call, file, base, adc, avc, toxfer, xfered)
+#define afs_CacheFetchProc(call, file, base, adc, avc, toxfer, xfered, length) \
+ (*(afs_cacheType->FetchProc))(call, file, (afs_size_t)base, adc, avc, (afs_size_t *)toxfer, (afs_size_t *)xfered, length)
#define afs_CacheStoreProc(call, file, bytes, avc, wake, toxfer, xfered) \
(*(afs_cacheType->StoreProc))(call, file, bytes, avc, wake, toxfer, xfered)
#ifdef AFS_LINUX22_ENV
struct dentry *dp = NULL;
#endif
- afs_int32 offset, len;
+ afs_size_t offset, len;
struct vrequest treq;
afs_int32 code;
tvc = (struct vcache *) tvn;
#endif
/* here we know its an afs vnode, so we can get the data for the chunk */
- tdc = afs_GetDCache(tvc, ab->parm[1], &treq, &offset, &len, 1);
+ tdc = afs_GetDCache(tvc, (afs_size_t) ab->parm[1], &treq, &offset, &len, 1);
if (tdc) {
afs_PutDCache(tdc);
}
register struct brequest *ab; {
register struct dcache *tdc;
register struct vcache *tvc;
- afs_int32 offset, len;
+ afs_size_t offset, len;
struct vrequest treq;
AFS_STATCNT(BPrefetch);
if (len = afs_InitReq(&treq, ab->cred)) return;
tvc = ab->vnode;
- tdc = afs_GetDCache(tvc, (afs_int32)ab->parm[0], &treq, &offset, &len, 1);
+ tdc = afs_GetDCache(tvc, (afs_size_t)ab->parm[0], &treq, &offset, &len, 1);
if (tdc) {
afs_PutDCache(tdc);
}
tdc = (struct dcache *) (ab->parm[1]);
tdc->flags &= ~DFFetchReq;
afs_osi_Wakeup(&tdc->validPos);
- if (ab->parm[2]) {
+ if ((afs_size_t)ab->parm[2]) {
#ifdef AFS_SUN5_ENVX
mutex_enter(&tdc->lock);
tdc->refCount--;
register struct vcache *avc;
struct AFS_UCRED *acred;
/* On 64 bit platforms, "long" does the right thing. */
- long aparm0, aparm1, aparm2, aparm3;
+ afs_size_t aparm0, aparm1, aparm2, aparm3;
{
register int i;
register struct brequest *tb;
* --------------------- Exported definitions ---------------------
*/
afs_lock_t afs_xdcache; /*Lock: alloc new disk cache entries*/
-afs_int32 afs_freeDCList; /*Free list for disk cache entries*/
-afs_int32 afs_freeDCCount; /*Count of elts in freeDCList*/
+afs_int32 afs_freeDCList; /*Free list for disk cache entries*/
+afs_int32 afs_freeDCCount; /*Count of elts in freeDCList*/
afs_int32 afs_discardDCList; /*Discarded disk cache entries*/
afs_int32 afs_discardDCCount; /*Count of elts in discardDCList*/
struct dcache *afs_freeDSList; /*Free list for disk slots */
struct osi_file *afs_cacheInodep = 0; /* file for CacheItems inode */
struct afs_q afs_DLRU; /*dcache LRU*/
afs_int32 afs_dhashsize = 1024;
-afs_int32 *afs_dvhashTbl; /*Data cache hash table*/
-afs_int32 *afs_dchashTbl; /*Data cache hash table*/
-afs_int32 *afs_dvnextTbl; /*Dcache hash table links */
-afs_int32 *afs_dcnextTbl; /*Dcache hash table links */
+afs_int32 *afs_dvhashTbl; /*Data cache hash table*/
+afs_int32 *afs_dchashTbl; /*Data cache hash table*/
+afs_int32 *afs_dvnextTbl; /*Dcache hash table links */
+afs_int32 *afs_dcnextTbl; /*Dcache hash table links */
struct dcache **afs_indexTable; /*Pointers to dcache entries*/
-afs_hyper_t *afs_indexTimes; /*Dcache entry Access times*/
-afs_int32 *afs_indexUnique; /*dcache entry Fid.Unique */
+afs_hyper_t *afs_indexTimes; /*Dcache entry Access times*/
+afs_int32 *afs_indexUnique; /*dcache entry Fid.Unique */
unsigned char *afs_indexFlags; /*(only one) Is there data there?*/
-afs_hyper_t afs_indexCounter; /*Fake time for marking index
+afs_hyper_t afs_indexCounter; /*Fake time for marking index
entries*/
afs_int32 afs_cacheFiles =0; /*Size of afs_indexTable*/
-afs_int32 afs_cacheBlocks; /*1K blocks in cache*/
-afs_int32 afs_cacheStats; /*Stat entries in cache*/
-afs_int32 afs_blocksUsed; /*Number of blocks in use*/
+afs_int32 afs_cacheBlocks; /*1K blocks in cache*/
+afs_int32 afs_cacheStats; /*Stat entries in cache*/
+afs_int32 afs_blocksUsed; /*Number of blocks in use*/
afs_int32 afs_blocksDiscarded; /*Blocks freed but not truncated */
-afs_int32 afs_fsfragsize = 1023; /*Underlying Filesystem minimum unit
+afs_int32 afs_fsfragsize = 1023; /*Underlying Filesystem minimum unit
*of disk allocation usually 1K
*this value is (truefrag -1 ) to
*save a bunch of subtracts... */
+#ifdef AFS_64BIT_CLIENT
+#ifdef AFS_VM_RDWR_ENV
+afs_size_t afs_vmMappingEnd; /* for large files (>= 2GB) the VM
+ * mapping an 32bit addressing machines
+ * can only be used below the 2 GB
+ * line. From this point upwards we
+ * must do direct I/O into the cache
+ * files. The value should be on a
+ * chunk boundary. */
+#endif /* AFS_VM_RDWR_ENV */
+#endif /* AFS_64BIT_CLIENT */
/* The following is used to ensure that new dcache's aren't obtained when
* the cache is nearly full.
}
} /*afs_StoreWarn*/
+void afs_MaybeWakeupTruncateDaemon() {
+ if (!afs_CacheTooFull && afs_CacheIsTooFull()) {
+ afs_CacheTooFull = 1;
+ if (!afs_TruncateDaemonRunning)
+ afs_osi_Wakeup((char *)afs_CacheTruncateDaemon);
+ } else if (!afs_TruncateDaemonRunning &&
+ afs_blocksDiscarded > CM_MAXDISCARDEDCHUNKS) {
+ afs_osi_Wakeup((char *)afs_CacheTruncateDaemon);
+ }
+}
+
/* Keep statistics on run time for afs_CacheTruncateDaemon. This is a
* struct so we need only export one symbol for AIX.
*/
int CTD_nSleeps;
} CTD_stats;
-void afs_MaybeWakeupTruncateDaemon() {
- if (!afs_CacheTooFull && afs_CacheIsTooFull()) {
- afs_CacheTooFull = 1;
- if (!afs_TruncateDaemonRunning)
- afs_osi_Wakeup((char *)afs_CacheTruncateDaemon);
- } else if (!afs_TruncateDaemonRunning &&
- afs_blocksDiscarded > CM_MAXDISCARDEDCHUNKS) {
- afs_osi_Wakeup((char *)afs_CacheTruncateDaemon);
- }
-}
-
u_int afs_min_cache = 0;
void afs_CacheTruncateDaemon() {
osi_timeval_t CTD_tmpTime;
*/
void
-afs_AdjustSize(adc, anewSize)
+afs_AdjustSize(adc, newSize)
register struct dcache *adc;
- register afs_int32 anewSize;
+ register afs_int32 newSize;
{ /*afs_AdjustSize*/
register afs_int32 oldSize;
AFS_STATCNT(afs_AdjustSize);
+
adc->flags |= DFEntryMod;
oldSize = ((adc->f.chunkBytes + afs_fsfragsize)^afs_fsfragsize)>>10;/* round up */
- adc->f.chunkBytes = anewSize;
- anewSize = ((anewSize + afs_fsfragsize)^afs_fsfragsize)>>10;/* round up */
- if (anewSize > oldSize) {
+ adc->f.chunkBytes = newSize;
+ newSize = ((newSize + afs_fsfragsize)^afs_fsfragsize)>>10;/* round up */
+ if (newSize > oldSize) {
/* We're growing the file, wakeup the daemon */
afs_MaybeWakeupTruncateDaemon();
}
- afs_blocksUsed += (anewSize - oldSize);
+ afs_blocksUsed += (newSize - oldSize);
afs_stats_cmperf.cacheBlocksInUse = afs_blocksUsed; /* XXX */
} /*afs_AdjustSize*/
*
* Environment:
* The anumber parameter is just a hint; at least one entry MUST be
- * moved, of we'll panic. We must be called with afs_xdcache
+ * moved, or we'll panic. We must be called with afs_xdcache
* write-locked. We should try to satisfy both anumber and aneedspace,
* whichever is more demanding - need to do several things:
* 1. only grab up to anumber victims if aneedSpace <= 0, not
*/
if (tdc->refCount == 1) {
unsigned char chunkFlags;
+ afs_size_t tchunkoffset;
afid = &tdc->f.fid;
/* xdcache is lower than the xvcache lock */
MReleaseWriteLock(&afs_xdcache);
skip = 0;
if (tdc->refCount > 1) skip = 1;
if (tvc) {
+ tchunkoffset = AFS_CHUNKTOBASE(tdc->f.chunk);
chunkFlags = afs_indexFlags[tdc->index];
if (phase == 0 && osi_Active(tvc)) skip = 1;
if (phase > 0 && osi_Active(tvc) && (tvc->states & CDCLock)
if (chunkFlags & IFDataMod) skip = 1;
afs_Trace4(afs_iclSetp, CM_TRACE_GETDOWND,
ICL_TYPE_POINTER, tvc, ICL_TYPE_INT32, skip,
- ICL_TYPE_INT32,
- (afs_int32)(chunkFlags & IFDirtyPages),
- ICL_TYPE_INT32, AFS_CHUNKTOBASE(tdc->f.chunk));
+ ICL_TYPE_INT32, tdc->index,
+ ICL_TYPE_OFFSET,
+ ICL_HANDLE_OFFSET(tchunkoffset));
#if defined(AFS_SUN5_ENV)
/*
if (skip) {
/* skip this guy and mark him as recently used */
afs_indexFlags[tdc->index] |= IFFlag;
+ afs_Trace4(afs_iclSetp, CM_TRACE_GETDOWND,
+ ICL_TYPE_POINTER, tvc, ICL_TYPE_INT32, 2,
+ ICL_TYPE_INT32, tdc->index,
+ ICL_TYPE_OFFSET,
+ ICL_HANDLE_OFFSET(tchunkoffset));
}
else {
/* flush this dude from the data cache and reclaim;
* melt it down for parts. Note that any concurrent
* (new possibility!) calls to GetDownD won't touch
* this guy because his reference count is > 0. */
+ afs_Trace4(afs_iclSetp, CM_TRACE_GETDOWND,
+ ICL_TYPE_POINTER, tvc, ICL_TYPE_INT32, 3,
+ ICL_TYPE_INT32, tdc->index,
+ ICL_TYPE_OFFSET,
+ ICL_HANDLE_OFFSET(tchunkoffset));
#ifndef AFS_DEC_ENV
AFS_STATCNT(afs_gget);
#endif
register int i;
AFS_STATCNT(afs_TryToSmush);
afs_Trace2(afs_iclSetp, CM_TRACE_TRYTOSMUSH, ICL_TYPE_POINTER, avc,
- ICL_TYPE_INT32, avc->m.Length);
+ ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(avc->m.Length));
sync = 1; /* XX Temp testing XX*/
#if defined(AFS_SUN5_ENV)
struct dcache *afs_FindDCache(avc, abyte)
register struct vcache *avc;
- afs_int32 abyte;
+ afs_size_t abyte;
{ /*afs_FindDCache*/
register struct rx_call *acall;
struct osi_file *afile;
register afs_int32 alen;
+ afs_size_t *abytesToXferP;
+ afs_size_t *abytesXferredP;
struct vcache *avc;
int *shouldWake;
- afs_int32 *abytesToXferP;
- afs_int32 *abytesXferredP;
{ /* afs_UFSCacheStoreProc*/
afs_int32 code, got;
(*abytesXferredP) = 0;
#endif /* AFS_NOSTATS */
- afs_Trace3(afs_iclSetp, CM_TRACE_STOREPROC, ICL_TYPE_POINTER, avc,
- ICL_TYPE_INT32, avc->m.Length, ICL_TYPE_INT32, alen);
+ afs_Trace4(afs_iclSetp, CM_TRACE_STOREPROC, ICL_TYPE_POINTER, avc,
+ ICL_TYPE_FID, &(avc->fid),
+ ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(avc->m.Length),
+ ICL_TYPE_INT32, alen);
tbuffer = osi_AllocLargeSpace(AFS_LRALLOCSIZ);
while (alen > 0) {
tlen = (alen > AFS_LRALLOCSIZ ? AFS_LRALLOCSIZ : alen);
osi_FreeLargeSpace(tbuffer);
return EIO;
}
+ afs_Trace1(afs_iclSetp, CM_TRACE_STOREPROC2, ICL_TYPE_INT32, got);
+if (got == 0) printf("StoreProc: got == 0\n");
#ifdef RX_ENABLE_LOCKS
AFS_GUNLOCK();
#endif /* RX_ENABLE_LOCKS */
afs_wakeup(avc);
}
}
+ afs_Trace4(afs_iclSetp, CM_TRACE_STOREPROC, ICL_TYPE_POINTER, avc,
+ ICL_TYPE_FID, &(avc->fid),
+ ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(avc->m.Length),
+ ICL_TYPE_INT32, alen);
osi_FreeLargeSpace(tbuffer);
return 0;
*/
static int afs_UFSCacheFetchProc(acall, afile, abase, adc, avc,
- abytesToXferP, abytesXferredP)
+ abytesToXferP, abytesXferredP, lengthFound)
register struct rx_call *acall;
- afs_int32 abase;
+ afs_size_t abase;
+ afs_size_t *abytesToXferP;
+ afs_size_t *abytesXferredP;
struct dcache *adc;
struct vcache *avc;
struct osi_file *afile;
- afs_int32 *abytesToXferP;
- afs_int32 *abytesXferredP;
-
+ afs_int32 lengthFound;
{ /*UFS_CacheFetchProc*/
-
afs_int32 length;
register afs_int32 code;
register char *tbuffer;
register int tlen;
- int moredata;
+ int moredata = 0;
AFS_STATCNT(UFS_CacheFetchProc);
afile->offset = 0; /* Each time start from the beginning */
+ length = lengthFound;
#ifndef AFS_NOSTATS
(*abytesToXferP) = 0;
(*abytesXferredP) = 0;
#endif /* AFS_NOSTATS */
tbuffer = osi_AllocLargeSpace(AFS_LRALLOCSIZ);
do {
+ if (moredata) {
#ifdef RX_ENABLE_LOCKS
- AFS_GUNLOCK();
+ AFS_GUNLOCK();
#endif /* RX_ENABLE_LOCKS */
- code = rx_Read(acall, (char *)&length, sizeof(afs_int32));
+ code = rx_Read(acall, (char *)&length, sizeof(afs_int32));
+ length = ntohl(length);
#ifdef RX_ENABLE_LOCKS
- AFS_GLOCK();
+ AFS_GLOCK();
#endif /* RX_ENABLE_LOCKS */
- if (code != sizeof(afs_int32)) {
- osi_FreeLargeSpace(tbuffer);
- code = rx_Error(acall);
- return (code?code:-1); /* try to return code, not -1 */
+ if (code != sizeof(afs_int32)) {
+ osi_FreeLargeSpace(tbuffer);
+ code = rx_Error(acall);
+ return (code?code:-1); /* try to return code, not -1 */
+ }
}
- length = ntohl(length);
/*
* The fetch protocol is extended for the AFS/DFS translator
* to allow multiple blocks of data, each with its own length,
#endif /* AFS_NOSTATS */
if (code != tlen) {
osi_FreeLargeSpace(tbuffer);
+ afs_Trace3(afs_iclSetp, CM_TRACE_FETCH64READ,
+ ICL_TYPE_POINTER, avc, ICL_TYPE_INT32, code,
+ ICL_TYPE_INT32, length);
return -34;
}
code = afs_osi_Write(afile, -1, tbuffer, tlen);
* aflags : Settings as follows:
* 1 : Set locks
* 2 : Return after creating entry.
+ * 4 : called from afs_vnop_write.c
+ * *alen contains length of data to be written.
* OUT:
* aoffset : Set to the offset within the chunk where the resident
* byte is located.
struct dcache *afs_GetDCache(avc, abyte, areq, aoffset, alen, aflags)
register struct vcache *avc; /*Held*/
- afs_int32 abyte;
+ afs_size_t abyte;
+ afs_size_t *aoffset, *alen;
int aflags;
- afs_int32 *aoffset, *alen;
register struct vrequest *areq;
{ /*afs_GetDCache*/
afs_int32 index;
afs_int32 us;
afs_int32 chunk;
- afs_int32 maxGoodLength; /* amount of good data at server */
+ afs_size_t maxGoodLength; /* amount of good data at server */
struct rx_call *tcall;
- afs_int32 Position = 0;
- afs_int32 size; /* size of segment to transfer */
+ afs_size_t Position = 0;
+#ifdef AFS_64BIT_CLIENT
+ afs_size_t tsize;
+#endif /* AFS_64BIT_CLIENT */
+ afs_int32 size, tlen; /* size of segment to transfer */
+ afs_size_t lengthFound; /* as returned from server */
struct tlocal1 *tsmall;
register struct dcache *tdc;
register struct osi_file *file;
register struct conn *tc;
int downDCount = 0;
+ int doAdjustSize = 0;
+ int doReallyAdjustSize = 0;
+ int overWriteWholeChunk = 0;
XSTATS_DECLS
#ifndef AFS_NOSTATS
struct afs_stats_xferData *xferP; /* Ptr to this op's xfer struct */
osi_timeval_t xferStartTime, /*FS xfer start time*/
xferStopTime; /*FS xfer stop time*/
- afs_int32 bytesToXfer; /* # bytes to xfer*/
- afs_int32 bytesXferred; /* # bytes actually xferred*/
+ afs_size_t bytesToXfer; /* # bytes to xfer*/
+ afs_size_t bytesXferred; /* # bytes actually xferred*/
struct afs_stats_AccessInfo *accP; /*Ptr to access record in stats*/
int fromReplica; /*Are we reading from a replica?*/
int numFetchLoops; /*# times around the fetch/analyze loop*/
* Determine the chunk number and offset within the chunk corresponding
* to the desired byte.
*/
- if (vType(avc) == VDIR) {
+ if (avc->fid.Fid.Vnode & 1) { /* if (vType(avc) == VDIR) */
chunk = 0;
}
else {
* read rpcs on newly created files (dv of 0) since only then we guarantee
* that this chunk's data hasn't been filled by another client.
*/
- if (!hiszero(avc->m.DataVersion))
- aflags &= ~4;
+ size = AFS_CHUNKSIZE(abyte);
+ tlen = *alen;
+ Position = AFS_CHUNKTOBASE(chunk);
+ afs_Trace4(afs_iclSetp, CM_TRACE_GETDCACHE3,
+ ICL_TYPE_INT32, tlen,
+ ICL_TYPE_INT32, aflags,
+ ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(abyte),
+ ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(Position));
+ if ((aflags & 4) && (hiszero(avc->m.DataVersion)))
+ doAdjustSize = 1;
+ if ((aflags & 4) && (abyte == Position) && (tlen >= size))
+ overWriteWholeChunk = 1;
+ if (doAdjustSize || overWriteWholeChunk) {
#if defined(AFS_AIX32_ENV) || defined(AFS_SGI_ENV)
-#ifdef AFS_SGI_ENV
-#ifdef AFS_SGI64_ENV
- if (aflags & 4) adjustsize = NBPP;
-#else
- if (aflags & 4) adjustsize = 8192;
-#endif
-#else
- if (aflags & 4) adjustsize = 4096;
-#endif
- if (AFS_CHUNKTOBASE(chunk)+adjustsize >= avc->m.Length &&
-#else
-#if defined(AFS_SUN_ENV) || defined(AFS_OSF_ENV)
- if (((aflags & 4) || (AFS_CHUNKTOBASE(chunk) >= avc->m.Length)) &&
-#else
- if (AFS_CHUNKTOBASE(chunk) >= avc->m.Length &&
-#endif
-#endif
- !hsame(avc->m.DataVersion, tdc->f.versionNo)) {
- /* no data in file to read at this position */
- if (setLocks) {
- ReleaseReadLock(&avc->lock);
- ObtainWriteLock(&avc->lock,64);
- }
- /* check again, now that we have a write lock */
+ #ifdef AFS_SGI_ENV
+ #ifdef AFS_SGI64_ENV
+ if (doAdjustSize) adjustsize = NBPP;
+ #else /* AFS_SGI64_ENV */
+ if (doAdjustSize) adjustsize = 8192;
+ #endif /* AFS_SGI64_ENV */
+ #else /* AFS_SGI_ENV */
+ if (doAdjustSize) adjustsize = 4096;
+ #endif /* AFS_SGI_ENV */
+ if (AFS_CHUNKTOBASE(chunk)+adjustsize >= avc->m.Length &&
+#else /* defined(AFS_AIX32_ENV) || defined(AFS_SGI_ENV) */
+ #if defined(AFS_SUN_ENV) || defined(AFS_OSF_ENV)
+ if ((doAdjustSize || (AFS_CHUNKTOBASE(chunk) >= avc->m.Length)) &&
+ #else
+ if (AFS_CHUNKTOBASE(chunk) >= avc->m.Length &&
+ #endif
+#endif /* defined(AFS_AIX32_ENV) || defined(AFS_SGI_ENV) */
+ !hsame(avc->m.DataVersion, tdc->f.versionNo))
+ doReallyAdjustSize = 1;
+ if (doReallyAdjustSize || overWriteWholeChunk) {
+ doReallyAdjustSize = 0;
+ /* no data in file to read at this position */
+ if (setLocks) {
+ ReleaseReadLock(&avc->lock);
+ ObtainWriteLock(&avc->lock,64);
+ }
+ /* check again, now that we have a write lock */
#if defined(AFS_AIX32_ENV) || defined(AFS_SGI_ENV)
- if (AFS_CHUNKTOBASE(chunk)+adjustsize >= avc->m.Length &&
+ if (AFS_CHUNKTOBASE(chunk)+adjustsize >= avc->m.Length &&
#else
#if defined(AFS_SUN_ENV) || defined(AFS_OSF_ENV)
- if (((aflags & 4) || (AFS_CHUNKTOBASE(chunk) >= avc->m.Length)) &&
+ if ((doAdjustSize || (AFS_CHUNKTOBASE(chunk) >= avc->m.Length)) &&
#else
- if (AFS_CHUNKTOBASE(chunk) >= avc->m.Length &&
+ if (AFS_CHUNKTOBASE(chunk) >= avc->m.Length &&
#endif
#endif
- !hsame(avc->m.DataVersion, tdc->f.versionNo)) {
- file = afs_CFileOpen(tdc->f.inode);
- afs_CFileTruncate(file, 0);
- afs_CFileClose(file);
- afs_AdjustSize(tdc, 0);
- hset(tdc->f.versionNo, avc->m.DataVersion);
- tdc->flags |= DFEntryMod;
- }
- if (setLocks) {
- ReleaseWriteLock(&avc->lock);
- ObtainReadLock(&avc->lock);
+ !hsame(avc->m.DataVersion, tdc->f.versionNo))
+ doReallyAdjustSize = 1;
+ if (doReallyAdjustSize || overWriteWholeChunk) {
+ file = afs_CFileOpen(tdc->f.inode);
+ afs_CFileTruncate(file, 0);
+ afs_CFileClose(file);
+ afs_AdjustSize(tdc, 0);
+ hset(tdc->f.versionNo, avc->m.DataVersion);
+ tdc->flags |= DFEntryMod;
+ }
+ if (setLocks) {
+ ReleaseWriteLock(&avc->lock);
+ ObtainReadLock(&avc->lock);
+ }
}
}
if (setLocks) ReleaseReadLock(&avc->lock);
/*
- * We must read in the whole chunk iff the version number doesn't
+ * We must read in the whole chunk if the version number doesn't
* match.
*/
if (aflags & 2) {
osi_Assert(setLocks || WriteLocked(&avc->lock));
if (setLocks) ObtainReadLock(&avc->lock);
- if (!hsame(avc->m.DataVersion, tdc->f.versionNo)) {
+ if (!hsame(avc->m.DataVersion, tdc->f.versionNo) && !overWriteWholeChunk) {
/*
* Version number mismatch.
*/
(accP->unreplicatedRefs)++;
#endif /* AFS_NOSTATS */
/* this is a cache miss */
- afs_stats_cmperf.dcacheMisses++;
- afs_Trace3(afs_iclSetp, CM_TRACE_FETCHPROC, ICL_TYPE_POINTER, avc,
- ICL_TYPE_INT32, Position, ICL_TYPE_INT32, size);
+ afs_Trace4(afs_iclSetp, CM_TRACE_FETCHPROC, ICL_TYPE_POINTER, avc,
+ ICL_TYPE_FID, &(avc->fid),
+ ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(Position),
+ ICL_TYPE_INT32, size);
+ if (size) afs_stats_cmperf.dcacheMisses++;
+ code = 0;
/*
* Dynamic root support: fetch data from local memory.
*/
/*
* Not a dynamic vnode: do the real fetch.
*/
- do {
+ if (size) do {
tc = afs_Conn(&avc->fid, areq, SHARED_LOCK);
if (tc) {
+ afs_int32 length_hi, length, bytes;
#ifndef AFS_NOSTATS
numFetchLoops++;
if (fromReplica)
XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_FETCHDATA);
+#ifdef AFS_64BIT_CLIENT
+ length_hi = code = 0;
+ if (!afs_serverHasNo64Bit(tc)) {
+ tsize = size;
+#ifdef RX_ENABLE_LOCKS
+ AFS_GUNLOCK();
+#endif /* RX_ENABLE_LOCKS */
+ code = StartRXAFS_FetchData64(tcall,
+ (struct AFSFid *) &avc->fid.Fid,
+ Position, tsize);
+ if (code != 0) {
+#ifdef RX_ENABLE_LOCKS
+ AFS_GLOCK();
+#endif /* RX_ENABLE_LOCKS */
+ } else {
+ bytes = rx_Read(tcall, (char *)&length_hi, sizeof(afs_int32));
+#ifdef RX_ENABLE_LOCKS
+ AFS_GLOCK();
+#endif /* RX_ENABLE_LOCKS */
+ if (bytes == sizeof(afs_int32)) {
+ length_hi = ntohl(length_hi);
+ } else {
+ length_hi = 0;
+ code = rx_Error(tcall);
+#ifdef RX_ENABLE_LOCKS
+ AFS_GUNLOCK();
+#endif /* RX_ENABLE_LOCKS */
+ code1 = rx_EndCall(tcall, code);
+#ifdef RX_ENABLE_LOCKS
+ AFS_GLOCK();
+#endif /* RX_ENABLE_LOCKS */
+ afs_Trace2(afs_iclSetp, CM_TRACE_FETCH64CODE,
+ ICL_TYPE_POINTER, avc, ICL_TYPE_INT32, code);
+ tcall = (struct rx_call *) 0;
+ }
+ }
+ }
+ if (code == RXGEN_OPCODE || afs_serverHasNo64Bit(tc)) {
+ if (Position > 0xFFFFFFFF) {
+ code = EFBIG;
+ } else {
+ afs_int32 pos;
+ pos = Position;
+#ifdef RX_ENABLE_LOCKS
+ AFS_GUNLOCK();
+#endif /* RX_ENABLE_LOCKS */
+ if (!tcall)
+ tcall = rx_NewCall(tc->id);
+ code = StartRXAFS_FetchData(tcall,
+ (struct AFSFid *) &avc->fid.Fid, pos, size);
+#ifdef RX_ENABLE_LOCKS
+ AFS_GLOCK();
+#endif /* RX_ENABLE_LOCKS */
+ }
+ afs_serverSetNo64Bit(tc);
+ }
+ if (code == 0) {
+#ifdef RX_ENABLE_LOCKS
+ AFS_GUNLOCK();
+#endif /* RX_ENABLE_LOCKS */
+ bytes = rx_Read(tcall, (char *)&length, sizeof(afs_int32));
+#ifdef RX_ENABLE_LOCKS
+ AFS_GLOCK();
+#endif /* RX_ENABLE_LOCKS */
+ if (bytes == sizeof(afs_int32)) {
+ length = ntohl(length);
+ } else {
+ code = rx_Error(tcall);
+ }
+ }
+ FillInt64(lengthFound, length_hi, length);
+ afs_Trace3(afs_iclSetp, CM_TRACE_FETCH64LENG,
+ ICL_TYPE_POINTER, avc, ICL_TYPE_INT32, code,
+ ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(lengthFound));
+#else /* AFS_64BIT_CLIENT */
#ifdef RX_ENABLE_LOCKS
AFS_GUNLOCK();
#endif /* RX_ENABLE_LOCKS */
#ifdef RX_ENABLE_LOCKS
AFS_GLOCK();
#endif /* RX_ENABLE_LOCKS */
+ if (code == 0) {
+#ifdef RX_ENABLE_LOCKS
+ AFS_GUNLOCK();
+#endif /* RX_ENABLE_LOCKS */
+ bytes = rx_Read(tcall, (char *)&length, sizeof(afs_int32));
+#ifdef RX_ENABLE_LOCKS
+ AFS_GLOCK();
+#endif /* RX_ENABLE_LOCKS */
+ if (bytes == sizeof(afs_int32)) {
+ length = ntohl(length);
+ } else {
+ code = rx_Error(tcall);
+ }
+ }
+#endif /* AFS_64BIT_CLIENT */
if (code == 0) {
#ifndef AFS_NOSTATS
xferP = &(afs_stats_cmfullperf.rpc.fsXferTimes[AFS_STATS_FS_XFERIDX_FETCHDATA]);
osi_GetuTime(&xferStartTime);
- code = afs_CacheFetchProc(tcall, file, Position, tdc, avc,
- &bytesToXfer, &bytesXferred);
+ code = afs_CacheFetchProc(tcall, file,
+ (afs_size_t) Position, tdc, avc,
+ &bytesToXfer, &bytesXferred, length);
osi_GetuTime(&xferStopTime);
(xferP->numXfers)++;
}
}
#else
- code = afs_CacheFetchProc(tcall, file, Position, tdc, avc, 0, 0);
+ code = afs_CacheFetchProc(tcall, file, Position, tdc, avc, 0, 0, length);
#endif /* AFS_NOSTATS */
}
if (code == 0) {
#endif /* RX_ENABLE_LOCKS */
}
XSTATS_END_TIME;
- code1 = rx_EndCall(tcall, code);
+#ifdef RX_ENABLE_LOCKS
+ AFS_GUNLOCK();
+#endif /* RX_ENABLE_LOCKS */
+ if (tcall)
+ code1 = rx_EndCall(tcall, code);
+#ifdef RX_ENABLE_LOCKS
+ AFS_GLOCK();
+#endif /* RX_ENABLE_LOCKS */
UpgradeSToWLock(&avc->lock,27);
}
else {
{ /*afs_InitCacheFile*/
register afs_int32 code;
-#ifdef AFS_LINUX22_ENV
+#if defined(AFS_LINUX22_ENV)
struct dentry *filevp;
#else
struct vnode *filevp;
afs_dcentries = aDentries;
afs_blocksUsed = 0;
QInit(&afs_DLRU);
-
-
}
/*
afs_cacheStats = astatSize;
afs_vcacheInit(astatSize);
afs_dcacheInit(afiles, ablocks, aDentries, achunk, aflags);
+#ifdef AFS_64BIT_CLIENT
+#ifdef AFS_VM_RDWR_ENV
+ afs_vmMappingEnd = AFS_CHUNKBASE(0x7fffffff);
+#endif /* AFS_VM_RDWR_ENV */
+#endif /* AFS_64BIT_CLIENT */
#if defined(AFS_AIX_ENV)
{
osi_Panic("afs_MemCacheOpen: invalid block #");
}
mep = (memCache + blkno);
+ afs_Trace4(afs_iclSetp, CM_TRACE_MEMOPEN,
+ ICL_TYPE_INT32, blkno,
+ ICL_TYPE_POINTER, mep,
+ ICL_TYPE_POINTER, mep->data,
+ ICL_TYPE_STRING, mep->data);
return (void *) mep;
}
int bytesToWrite;
AFS_STATCNT(afs_MemWriteBlk);
MObtainWriteLock(&mceP->afs_memLock,561);
- if (size + offset > mceP->dataSize) {
+ if (offset + size > mceP->dataSize) {
char *oldData = mceP->data;
mceP->data = afs_osi_Alloc(size+offset);
return 0;
}
-afs_MemCacheStoreProc(acall, mceP, alen, avc, shouldWake, abytesToXferP, abytesXferredP)
+afs_MemCacheStoreProc(acall, mceP, alen, avc, shouldWake, abytesToXferP, abytesXferredP, length)
register struct memCacheEntry *mceP;
register struct rx_call *acall;
register afs_int32 alen;
struct vcache *avc;
int *shouldWake;
- afs_int32 *abytesToXferP;
- afs_int32 *abytesXferredP;
+ afs_size_t *abytesToXferP;
+ afs_size_t *abytesXferredP;
+ afs_int32 length;
{
*/
tiov = (struct iovec *) osi_AllocSmallSpace(sizeof(struct iovec)*RX_MAXIOVECS);
if(!tiov) {
- osi_Panic("afs_MemCacheFetchProc: osi_AllocSmallSpace for iovecs returned NULL\n");
+ osi_Panic("afs_MemCacheStoreProc: osi_AllocSmallSpace for iovecs returned NULL\n");
}
#ifdef notdef
else *shouldWake = 1;
}
#endif /* notdef */
-
+
while (alen > 0) {
tlen = (alen > AFS_LRALLOCSIZ? AFS_LRALLOCSIZ : alen);
+#ifdef RX_ENABLE_LOCKS
+ AFS_GUNLOCK();
+#endif /* RX_ENABLE_LOCKS */
code = rx_WritevAlloc(acall, tiov, &tnio, RX_MAXIOVECS, tlen);
+#ifdef RX_ENABLE_LOCKS
+ AFS_GLOCK();
+#endif /* RX_ENABLE_LOCKS */
if (code <= 0) {
osi_FreeSmallSpace(tiov);
return -33;
osi_FreeSmallSpace(tiov);
return -33;
}
+#ifdef RX_ENABLE_LOCKS
+ AFS_GUNLOCK();
+#endif /* RX_ENABLE_LOCKS */
code = rx_Writev(acall, tiov, tnio, tlen);
+#ifdef RX_ENABLE_LOCKS
+ AFS_GLOCK();
+#endif /* RX_ENABLE_LOCKS */
#ifndef AFS_NOSTATS
(*abytesXferredP) += code;
#endif /* AFS_NOSTATS */
return 0;
}
-afs_MemCacheFetchProc(acall, mceP, abase, adc, avc, abytesToXferP, abytesXferredP)
+afs_MemCacheFetchProc(acall, mceP, abase, adc, avc, abytesToXferP, abytesXferredP, lengthFound)
register struct rx_call *acall;
- afs_int32 abase;
+ afs_size_t abase;
+ afs_size_t *abytesToXferP;
+ afs_size_t *abytesXferredP;
struct dcache *adc;
struct vcache *avc;
register struct memCacheEntry *mceP;
- afs_int32 *abytesToXferP;
- afs_int32 *abytesXferredP;
-
- {
- afs_int32 length;
+ afs_int32 lengthFound;
+{
register afs_int32 code;
- register int tlen, offset=0;
- int moredata;
+ afs_int32 length;
+ int moredata = 0;
struct iovec *tiov; /* no data copying with iovec */
+ register int tlen, offset=0;
int tnio; /* temp for iovec size */
AFS_STATCNT(afs_MemCacheFetchProc);
+ length = lengthFound;
+ afs_Trace4(afs_iclSetp, CM_TRACE_MEMFETCH,
+ ICL_TYPE_POINTER, avc,
+ ICL_TYPE_POINTER, mceP,
+ ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(abase),
+ ICL_TYPE_INT32, length);
#ifndef AFS_NOSTATS
(*abytesToXferP) = 0;
(*abytesXferredP) = 0;
osi_Panic("afs_MemCacheFetchProc: osi_AllocSmallSpace for iovecs returned NULL\n");
}
do {
- code = rx_Read(acall, (char *)&length, sizeof(afs_int32));
- if (code != sizeof(afs_int32)) {
- code = rx_Error(acall);
- osi_FreeSmallSpace(tiov);
- return (code?code:-1); /* try to return code, not -1 */
+ if (moredata) {
+#ifdef RX_ENABLE_LOCKS
+ AFS_GUNLOCK();
+#endif /* RX_ENABLE_LOCKS */
+ code = rx_Read(acall, (char *)&length, sizeof(afs_int32));
+ length = ntohl(length);
+#ifdef RX_ENABLE_LOCKS
+ AFS_GLOCK();
+#endif /* RX_ENABLE_LOCKS */
+ if (code != sizeof(afs_int32)) {
+ code = rx_Error(acall);
+ osi_FreeSmallSpace(tiov);
+ return (code?code:-1); /* try to return code, not -1 */
+ }
}
- length = ntohl(length);
/*
* The fetch protocol is extended for the AFS/DFS translator
* to allow multiple blocks of data, each with its own length,
#endif /* AFS_NOSTATS */
while (length > 0) {
tlen = (length > AFS_LRALLOCSIZ? AFS_LRALLOCSIZ : length);
+#ifdef RX_ENABLE_LOCKS
+ AFS_GUNLOCK();
+#endif /* RX_ENABLE_LOCKS */
code = rx_Readv(acall, tiov, &tnio, RX_MAXIOVECS, tlen);
+#ifdef RX_ENABLE_LOCKS
+ AFS_GLOCK();
+#endif /* RX_ENABLE_LOCKS */
#ifndef AFS_NOSTATS
(*abytesXferredP) += code;
#endif /* AFS_NOSTATS */
if (code <= 0) {
+ afs_Trace3(afs_iclSetp, CM_TRACE_FETCH64READ,
+ ICL_TYPE_POINTER, avc, ICL_TYPE_INT32, code,
+ ICL_TYPE_INT32, length);
osi_FreeSmallSpace(tiov);
return -34;
}
struct VenusFid tfid;
char *bufp;
struct sysname_info sysState;
- afs_int32 offset, len;
+ afs_size_t offset, len;
AFS_STATCNT(PNewStatMount);
if (!avc) return EINVAL;
if (vType(avc) != VDIR) {
return ENOTDIR;
}
- tdc = afs_GetDCache(avc, 0, areq, &offset, &len, 1);
+ tdc = afs_GetDCache(avc, (afs_size_t) 0, areq, &offset, &len, 1);
if (!tdc) return ENOENT;
Check_AtSys(avc, ain, &sysState, areq);
do {
register afs_int32 code;
char *bufp;
struct sysname_info sysState;
- afs_int32 offset, len;
+ afs_size_t offset, len;
register struct conn *tc;
register struct dcache *tdc;
register struct vcache *tvc;
if (code) return code;
if (vType(avc) != VDIR) return ENOTDIR;
- tdc = afs_GetDCache(avc, 0, areq, &offset, &len, 1); /* test for error below */
+ tdc = afs_GetDCache(avc, (afs_size_t) 0, areq, &offset, &len, 1); /* test for error below */
if (!tdc) return ENOENT;
Check_AtSys(avc, ain, &sysState, areq);
do {
struct VenusFid tfid;
char *bufp;
struct sysname_info sysState;
- afs_int32 offset, len;
+ afs_size_t offset, len;
AFS_STATCNT(PFlushMount);
if (!avc) return EINVAL;
if (vType(avc) != VDIR) {
return ENOTDIR;
}
- tdc = afs_GetDCache(avc, 0, areq, &offset, &len, 1);
+ tdc = afs_GetDCache(avc, (afs_size_t) 0, areq, &offset, &len, 1);
if (!tdc) return ENOENT;
Check_AtSys(avc, ain, &sysState, areq);
do {
struct AFSVolSync tsync;
register afs_int32 code;
register struct rx_call *tcall;
- afs_int32 tlen;
+ afs_size_t tlen, base = 0;
XSTATS_DECLS
AFS_STATCNT(afs_StoreMini);
#ifdef RX_ENABLE_LOCKS
AFS_GUNLOCK();
#endif /* RX_ENABLE_LOCKS */
+retry:
tcall = rx_NewCall(tc->id);
#ifdef RX_ENABLE_LOCKS
AFS_GLOCK();
InStatus.Mask = AFS_SETMODTIME;
InStatus.ClientModTime = avc->m.Date;
XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_STOREDATA);
+ afs_Trace4(afs_iclSetp, CM_TRACE_STOREDATA64,
+ ICL_TYPE_FID, &avc->fid.Fid,
+ ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(base),
+ ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(tlen),
+ ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(avc->m.Length));
#ifdef RX_ENABLE_LOCKS
AFS_GUNLOCK();
#endif /* RX_ENABLE_LOCKS */
+#ifdef AFS_64BIT_CLIENT
+ if (!afs_serverHasNo64Bit(tc)) {
+ code = StartRXAFS_StoreData64(tcall,
+ (struct AFSFid *)&avc->fid.Fid,
+ &InStatus, avc->m.Length,
+ base, tlen);
+ } else {
+ afs_int32 l1, l2;
+ l1 = avc->m.Length;
+ l2 = tlen;
+ code = StartRXAFS_StoreData(tcall,
+ (struct AFSFid *)&avc->fid.Fid,
+ &InStatus, l1, 0, l2);
+ }
+#else /* AFS_64BIT_CLIENT */
code = StartRXAFS_StoreData(tcall,
(struct AFSFid *)&avc->fid.Fid,
&InStatus, avc->m.Length, 0, tlen);
+#endif /* AFS_64BIT_CLIENT */
if (code == 0) {
code = EndRXAFS_StoreData(tcall, &OutStatus, &tsync);
+#ifdef AFS_64BIT_CLIENT
+ if (code == RXGEN_OPCODE) {
+ afs_serverSetNo64Bit(tc);
+ code = rx_EndCall(tcall, code);
+ goto retry;
+ }
+#endif /* AFS_64BIT_CLIENT */
}
code = rx_EndCall(tcall, code);
#ifdef RX_ENABLE_LOCKS
afs_hyper_t newDV, oldDV; /* DV when we start, and finish, respectively */
struct dcache **dcList, **dclist;
unsigned int i, j, minj, maxj, moredata, high, off;
- unsigned long tlen;
+ afs_size_t tlen;
+ afs_size_t maxStoredLength; /* highest offset we've written to server. */
int safety;
- int maxStoredLength; /* highest offset we've written to server. */
#ifndef AFS_NOSTATS
struct afs_stats_xferData *xferP; /* Ptr to this op's xfer struct */
osi_timeval_t xferStartTime, /*FS xfer start time*/
xferStopTime; /*FS xfer stop time*/
- afs_int32 bytesToXfer; /* # bytes to xfer*/
- afs_int32 bytesXferred; /* # bytes actually xferred*/
+ afs_size_t bytesToXfer; /* # bytes to xfer*/
+ afs_size_t bytesXferred; /* # bytes actually xferred*/
#endif /* AFS_NOSTATS */
foreign = (avc->states & CForeign);
dcList = (struct dcache **) osi_AllocLargeSpace(AFS_LRALLOCSIZ);
afs_Trace2(afs_iclSetp, CM_TRACE_STOREALL, ICL_TYPE_POINTER, avc,
- ICL_TYPE_INT32, avc->m.Length);
+ ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(avc->m.Length));
#ifndef AFS_AIX32_ENV
/* In the aix vm implementation we need to do the vm_writep even
* on the memcache case since that's we adjust the file's size
(afs_indexUnique[index] == avc->fid.Fid.Unique)) {
tdc = afs_GetDSlot(index, 0); /* refcount+1. */
if (!FidCmp( &tdc->f.fid, &avc->fid ) && tdc->f.chunk >= minj ) {
-
off = tdc->f.chunk - minj;
if (off < NCHUNKSATONCE) {
if ( dcList[ off ] )
j++;
if (tlen <= 0)
break;
- }
- else {
+ } else {
moredata = TRUE;
lockedPutDCache(tdc);
if (j == NCHUNKSATONCE)
if (j) {
static afs_uint32 lp1 = 10000, lp2 = 10000;
struct AFSStoreStatus InStatus;
- afs_uint32 base, bytes, nchunks;
+ afs_size_t base, bytes;
+ afs_uint32 nchunks;
int nomore;
unsigned int first;
int *shouldwake;
InStatus.Mask |= AFS_FSYNC;
}
tlen = lmin(avc->m.Length, avc->truncPos);
+ afs_Trace4(afs_iclSetp, CM_TRACE_STOREDATA64,
+ ICL_TYPE_FID, &avc->fid.Fid,
+ ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(base),
+ ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(bytes),
+ ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(tlen));
do {
stored = 0;
tc = afs_Conn(&avc->fid, areq);
if (tc) {
+restart:
#ifdef RX_ENABLE_LOCKS
AFS_GUNLOCK();
#endif /* RX_ENABLE_LOCKS */
tcall = rx_NewCall(tc->id);
+#ifdef AFS_64BIT_CLIENT
+ if (!afs_serverHasNo64Bit(tc)) {
+ code = StartRXAFS_StoreData64(tcall,
+ (struct AFSFid *) &avc->fid.Fid,
+ &InStatus, base, bytes, tlen);
+ } else {
+ if (tlen > 0xFFFFFFFF) {
+ code = EFBIG;
+ } else {
+ afs_int32 t1, t2, t3;
+ t1 = base;
+ t2 = bytes;
+ t3 = tlen;
+ code = StartRXAFS_StoreData(tcall,
+ (struct AFSFid *) &avc->fid.Fid,
+ &InStatus, t1, t2, t3);
+ }
+ }
+#else /* AFS_64BIT_CLIENT */
code = StartRXAFS_StoreData(tcall, (struct AFSFid *) &avc->fid.Fid,
&InStatus, base, bytes, tlen);
+#endif /* AFS_64BIT_CLIENT */
#ifdef RX_ENABLE_LOCKS
AFS_GLOCK();
#endif /* RX_ENABLE_LOCKS */
storeallmissing++;
continue; /* panic? */
}
+ afs_Trace4(afs_iclSetp, CM_TRACE_STOREALL2,
+ ICL_TYPE_POINTER, avc,
+ ICL_TYPE_INT32, tdc->f.chunk,
+ ICL_TYPE_INT32, tdc->index,
+ ICL_TYPE_INT32, tdc->f.inode);
shouldwake = 0;
if (nomore) {
if (avc->asynchrony == -1) {
}
}
#else
- code = afs_CacheStoreProc(tcall, tfile, tdc->f.chunkBytes, avc,
- shouldwake, &lp1, &lp2);
+ code = afs_CacheStoreProc(tcall, tfile, tdc->f.chunkBytes,
+ avc, shouldwake, &lp1, &lp2);
#endif /* AFS_NOSTATS */
afs_CFileClose(tfile);
+#ifdef AFS_64BIT_CLIENT
+ if (code == RXGEN_OPCODE) {
+ afs_serverSetNo64Bit(tc);
+ goto restart;
+ }
+#endif /* AFS_64BIT_CLIENT */
if ((tdc->f.chunkBytes < afs_OtherCSize) &&
(i < (nchunks-1))) {
int bsent, tlen, tlen1=0, sbytes = afs_OtherCSize - tdc->f.chunkBytes;
AFS_STATCNT(afs_InvalidateAllSegments);
afs_Trace2(afs_iclSetp, CM_TRACE_INVALL, ICL_TYPE_POINTER, avc,
- ICL_TYPE_INT32, avc->m.Length);
+ ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(avc->m.Length));
hash = DVHash(&avc->fid);
avc->truncPos = AFS_NOTRUNC; /* don't truncate later */
avc->states &= ~CExtendedFile; /* not any more */
* held.
*/
afs_TruncateAllSegments(avc, alen, areq, acred)
- afs_int32 alen;
+ afs_size_t alen;
register struct vcache *avc;
struct vrequest *areq;
struct AFS_UCRED *acred;
avc->states |= CExtendedFile;
avc->m.Length = alen;
afs_Trace3(afs_iclSetp, CM_TRACE_TRUNCALL1, ICL_TYPE_POINTER, avc,
- ICL_TYPE_INT32, avc->m.Length, ICL_TYPE_INT32, alen);
+ ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(avc->m.Length),
+ ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(alen));
return 0;
}
afs_Trace3(afs_iclSetp, CM_TRACE_TRUNCALL2, ICL_TYPE_POINTER, avc,
- ICL_TYPE_INT32, avc->m.Length, ICL_TYPE_INT32, alen);
+ ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(avc->m.Length),
+ ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(alen));
#if (defined(AFS_SUN5_ENV))
afs_int32 C_shutdown_BKG; /* afs_call.c*/
afs_int32 C_shutdown_afstest; /* afs_call.c*/
afs_int32 C_SRXAFSCB_GetCE; /* afs_callback.c*/
+ afs_int32 C_SRXAFSCB_GetCE64; /* afs_callback.c*/
afs_int32 C_ClearCallBack; /* afs_callback.c*/
afs_int32 C_SRXAFSCB_GetLock; /* afs_callback.c*/
afs_int32 C_SRXAFSCB_CallBack; /* afs_callback.c*/
ec CM_TRACE_VMRW, "vmrw vp 0x%lx, write=0x%x, off=0x%x, len=0x%x"
ec CM_TRACE_STRATEGYDONE, "strategy done vp 0x%lx code 0x%x left 0x%x"
ec CM_TRACE_FLUSHV, "flushv vp 0x%lx states 0x%x"
- ec CM_TRACE_GETDOWND, "getdownd vp 0x%lx skip 0x%x idxf 0x%x coff 0x%x"
+ ec CM_TRACE_GETDOWND, "getdownd vp 0x%lx skip 0x%x index %d coff (0x%x, 0x%x)"
ec CM_TRACE_ACTCCORE, "ActiveCore vp 0x%lx XoW 0x%x"
- ec CM_TRACE_WVCACHE, "RXAFS_StoreStatus vp 0x%lx len 0x%x"
+ ec CM_TRACE_WVCACHE, "RXAFS_StoreStatus vp 0x%lx len (0x%x, 0x%x)"
ec CM_TRACE_TRYTOSMUSH, "TryToSmush vp 0x%lx len 0x%x"
- ec CM_TRACE_STOREPROC, "StoreProc vp 0x%lx tlen 0x%x alen 0x%x"
- ec CM_TRACE_FETCHPROC, "FetchProc vp 0x%lx pos 0x%x size 0x%x"
- ec CM_TRACE_SIMPLEVSTAT, "SimpleVStat vp 0x%lx old len 0x%x new len 0x%x"
- ec CM_TRACE_PROCESSFS, "ProcessFS vp 0x%lx old len 0x%x new len 0x%x"
- ec CM_TRACE_STOREALL, "StoreAll vp 0x%lx len 0x%x"
+ ec CM_TRACE_STOREPROC, "StoreProc vp 0x%lx fid (%x:%d.%d.%d) m.Length (0x%x, 0x%x) alen 0x%x"
+ ec CM_TRACE_FETCHPROC, "FetchProc vp 0x%lx fid (%x:%d.%d.%d) pos (0x%x, 0x%x) size 0x%x"
+ ec CM_TRACE_SIMPLEVSTAT, "SimpleVStat vp 0x%lx old len (0x%x, 0x%x) new len (0x%x, 0x%x)"
+ ec CM_TRACE_PROCESSFS, "ProcessFS vp 0x%lx old len (0x%x, 0x%x) new len (0x%x, 0x%x)"
+ ec CM_TRACE_STOREALL, "StoreAll vp 0x%lx len (0x%x, 0x%x)"
ec CM_TRACE_INVALL, "InvalAll vp 0x%lx len 0x%x"
ec CM_TRACE_TRUNCALL1, "TruncAll vp 0x%lx old len 0x%x new len 0x%x"
ec CM_TRACE_TRUNCALL2,"TruncAll vp 0x%lx vlen 0x%x len 0x%x"
ec CM_TRACE_GSETATTR, "Gn_setattr vp 0x%lx (returns 0x%x)"
ec CM_TRACE_GFCLEAR, "Gn_fclear vp 0x%lx offset 0x%x len 0x%x (returns 0x%x)"
ec CM_TRACE_GFSYNC, "Gn_fsync vp 0x%lx flags 0x%x (returns 0x%x)"
- ec CM_TRACE_GFTRUNC, "Gn_ftrunc vp 0x%lx flags 0x%x len 0x%x (returns 0x%x)"
+ ec CM_TRACE_GFTRUNC, "Gn_ftrunc vp 0x%lx flags 0x%x len (0x%x, 0x%x) (returns 0x%x)"
ec CM_TRACE_GRDWR, "Gn_rdwr vp 0x%lx flags 0x%x op 0x%x (returns 0x%x)"
ec CM_TRACE_GLOCKCTL, "Gn_locktl vp 0x%lx cmd 0x%x (returns 0x%x)"
ec CM_TRACE_GIOCTL, "Gn_ioctl vp 0x%lx cmd 0x%x (returns 0x%x)"
ec CM_TRACE_STUFFVCACHE, "StuffVcache 0x%lx callback host 0x%lx expires %u (in %u secs)"
ec CM_TRACE_GETDCACHE1, "Getdcache vp 0x%lx failed to find chunk 0x%x"
ec CM_TRACE_GETDCACHE2, "GetdCache vp 0x%lx dcache 0x%lx dcache low-version 0x%x, vcache low-version 0x%x"
+ ec CM_TRACE_GETDCACHE3, "GetdCache tlen 0x%x size 0x%x abyte (0x%x, 0x%x) Position (0x%x, 0x%x)"
ec CM_TRACE_STOREMINI, "storemini vp 0x%lx length 0x%x"
ec CM_TRACE_STOREDCACHE, "StoreDCache vp 0x%lx chunk 0x%x length 0x%x at position 0x%x"
ec CM_TRACE_STOREDCACHEDONE, "StoreDCache Done for vp 0x%lx (returns 0x%x)"
ec CM_TRACE_SETPAG, "Setpag returns 0x%x"
ec CM_TRACE_OPEN, "Open 0x%x flags 0x%x"
ec CM_TRACE_CLOSE, "Close 0x%lx flags 0x%x"
- ec CM_TRACE_WRITE, "Write vp 0x%lx off 0x%x resid 0x%x file length 0x%x"
- ec CM_TRACE_READ, "Read vp 0x%lx off 0x%x resid 0x%x file length 0x%x"
- ec CM_TRACE_PARTIALWRITE, "Partial write vp 0x%lx length 0x%x"
- ec CM_TRACE_GETATTR, "Getattr vp 0x%lx len 0x%x"
- ec CM_TRACE_SETATTR, "Setattr vp 0x%lx len 0x%x"
- ec CM_TRACE_ACCESS, "Access vp 0x%lx mode 0x%x len 0x%x"
+ ec CM_TRACE_WRITE, "Write vp 0x%lx off (0x%x, 0x%x) resid (0x%x, 0x%x) file length (0x%x, 0x%x)"
+ ec CM_TRACE_READ, "Read vp 0x%lx off (0x%x, 0x%x) resid 0x%x file length (0x%x, 0x%x)"
+ ec CM_TRACE_PARTIALWRITE, "Partial write vp 0x%lx length (0x%x, 0x%x)"
+ ec CM_TRACE_GETATTR, "Getattr vp 0x%lx len (0x%x, 0x%x)"
+ ec CM_TRACE_SETATTR, "Setattr vp 0x%lx len (0x%x, 0x%x)"
+ ec CM_TRACE_ACCESS, "Access vp 0x%lx mode 0x%x len (0x%x, 0x%x)"
ec CM_TRACE_LOOKUP, "Lookup adp 0x%lx name %s fid (%d:%d.%d.%d), code=%d"
ec CM_TRACE_LOOKUP1, "Mount point is to vp 0x%lx fid (%d:%d.%d.%d)"
ec CM_TRACE_CREATE, "create file in vp 0x%lx name %s mode 0x%x"
ec CM_TRACE_NFS3IN1, "Nfs3 Root fid client 0x%lx fid (%x:%d.%d.%d)"
ec CM_TRACE_VGET, "Vget vp 0x%lx uid %x fid (%x:%d.%d.%d)"
ec CM_TRACE_VFSROOT, "vfs root vp 0x%lx, code %d"
- ec CM_TRACE_READOP, "Iread ip 0x%lx pos 0x%x count 0x%x code %x"
- ec CM_TRACE_WRITEOP, "Iwrite ip 0x%lx pos 0x%x count 0x%x code %x"
+ ec CM_TRACE_READOP, "Iread ip x%lx pos (0x%x, 0x%x) count 0x%x code %x"
+ ec CM_TRACE_WRITEOP, "Iwrite ip 0x%lx pos (0x%x, 0x%x) count 0x%x code %x"
ec CM_TRACE_READPAGE, "Ireadpage ip 0x%lx pp 0x%x count 0x%x code %x"
ec CM_TRACE_UPDATEPAGE, "Iupdatepage ip 0x%lx pp 0x%x count 0x%x code %d"
ec CM_TRACE_VM_CLOSE, "VMclose ip 0x%lx mapcnt %d opens %d XoW %d"
- ec CM_TRACE_PREFETCHCMD, "PrefetchCmd tvc 0x%x tfid (%d:%d.%d.%d) fid (%d:%d.%d.%d)"
- ec CM_TRACE_RESIDCMD, "ResidencyCmd tvc 0x%x command %d fid (%d:%d.%d.%d)"
+ ec CM_TRACE_FETCH64, "FetchProc for vp = 0x%lx oldserver was %d, found length (0x%x, 0x%x)"
+ ec CM_TRACE_UFSLINK, "UFSHandleLink: vp = 0x%lx, tdc 0 0x%lx, len (0x%x, 0x%x)"
+ ec CM_TRACE_VMRDWR, "afs_vm_rdwr: vp = 0x%lx, xfrSize 0x%lx, toffset 0x%x"
+ ec CM_TRACE_READFAST, "ReadFast vp 0x%lx off (0x%x, 0x%x) resid 0x%x file length (0x%x, 0x%x)"
+ ec CM_TRACE_FETCH64CODE, "StartRX_FetchData64 for vp 0x%x returned %d"
+ ec CM_TRACE_FETCH64LENG, "FetchData64 for vp 0x%x code = %d, length = (0x%x, 0x%x)"
+ ec CM_TRACE_FETCH64READ, "FetchData64 for vp 0x%x code = %d, length = 0x%x"
+ ec CM_TRACE_VMWRITE, "afs_vm_rdwr: vp 0x%x offset (0x%x, 0x%x) length 0x%x"
+ ec CM_TRACE_VMWRITE2, "afs_vm_rdwr: vp 0x%x first page 0x%x pages %d"
+ ec CM_TRACE_VMSTOREALL, "osi_VM_StoreAllSegments for vp 0x%x call %d"
+ ec CM_TRACE_PARTIALWRITE0, "Partial write currDirty %d maxDirty %d"
+ ec CM_TRACE_DIRECTRDWR, "direct_rdwr: vp 0x%x offset (0x%x, 0x%x) resid 0x%x"
+ ec CM_TRACE_GOPRDWR, "gop_rdwr: offset (0x%x, 0x%x) len 0x%x resid 0x%x code %d"
+ ec CM_TRACE_GRDWR1, "Gn_rdwr error vp 0x%lx returns %d"
+ ec CM_TRACE_READTDC, "UFSRead: vp 0x%lx tdc 0x%x at %d refcount 0x%x"
+ ec CM_TRACE_MEMFETCH, "MemFetch: vp 0x%x mceP 0x%x offset (0x%x, 0x%x) length 0x%x"
+ ec CM_TRACE_VMWRITE3, "afs_vm_rdwr: vp 0x%x code %d"
+ ec CM_TRACE_STOREALL2, "StoreAll 2 vp 0x%x chunk 0x%x index %d inode %d"
+ ec CM_TRACE_MEMOPEN, "MemOpen blkno %d mceP 0x%x data 0x%x = %s"
+ ec CM_TRACE_VCACHE2INODE, "vcache2inode: avc 0x%x event %d"
+ ec CM_TRACE_STOREDATA64, "StoreData64: fid (%d:%d.%d.%d) offs (0x%x, 0x%x) len (0x%x, 0x%x) file length (0x%x, 0x%x)"
+ ec CM_TRACE_RESIDCMD, "ResidencyCmd tvc 0x%x command %d fid (%d:%d.%d.%d)"
+ ec CM_TRACE_PREFETCHCMD, "PrefetchCmd tvc 0x%x tfid (%d:%d.%d.%d) fid (%d:%d.%d.%d)"
+ ec CM_TRACE_STOREPROC2, "StoreProc got 0x%x"
+ ec CM_TRACE_ADJUSTSIZE, "AdjustSize index %d oldSize %d newSize %d blocksUsed %d"
end
struct vrequest *areq;
{ /*afs_SimpleVStat*/
+ afs_size_t length;
AFS_STATCNT(afs_SimpleVStat);
#ifdef AFS_SGI_ENV
#endif
{
+#ifdef AFS_64BIT_ClIENT
+ FillInt64(length, astat->Length_hi, astat->Length);
+#else /* AFS_64BIT_CLIENT */
+ length = astat->Length;
+#endif /* AFS_64BIT_CLIENT */
#if defined(AFS_SGI_ENV)
osi_Assert((valusema(&avc->vc_rwlock) <= 0) &&
(OSI_GET_LOCKID() == avc->vc_rwlockid));
- if (astat->Length < avc->m.Length) {
+ if (length < avc->m.Length) {
vnode_t *vp = (vnode_t *)avc;
osi_Assert(WriteLocked(&avc->lock));
ReleaseWriteLock(&avc->lock);
AFS_GUNLOCK();
- PTOSSVP(vp, (off_t)astat->Length, (off_t)MAXLONG);
+ PTOSSVP(vp, (off_t)length, (off_t)MAXLONG);
AFS_GLOCK();
ObtainWriteLock(&avc->lock,67);
}
/* if writing the file, don't fetch over this value */
afs_Trace3(afs_iclSetp, CM_TRACE_SIMPLEVSTAT,
ICL_TYPE_POINTER, avc,
- ICL_TYPE_INT32, avc->m.Length,
- ICL_TYPE_INT32, astat->Length);
- avc->m.Length = astat->Length;
+ ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(avc->m.Length),
+ ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(length));
+ avc->m.Length = length;
avc->m.Date = astat->ClientModTime;
}
avc->m.Owner = astat->Owner;
AFS_STATCNT(afs_WriteVCache);
afs_Trace2(afs_iclSetp, CM_TRACE_WVCACHE, ICL_TYPE_POINTER, avc,
- ICL_TYPE_INT32, avc->m.Length);
+ ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(avc->m.Length));
do {
tc = afs_Conn(&avc->fid, areq, SHARED_LOCK);
{ /*afs_ProcessFS*/
register int i;
+ afs_size_t length;
AFS_STATCNT(afs_ProcessFS);
+#ifdef AFS_64BIT_CLIENT
+ FillInt64(length, astat->Length_hi, astat->Length);
+#else /* AFS_64BIT_CLIENT */
+ length = astat->Length;
+#endif /* AFS_64BIT_CLIENT */
/* WARNING: afs_DoBulkStat uses the Length field to store a sequence
* number for each bulk status request. Under no circumstances
* should afs_DoBulkStat store a sequence number if the new
* values.
*/
afs_Trace3(afs_iclSetp, CM_TRACE_PROCESSFS, ICL_TYPE_POINTER, avc,
- ICL_TYPE_INT32, avc->m.Length,
- ICL_TYPE_INT32, astat->Length);
- avc->m.Length = astat->Length;
+ ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(avc->m.Length),
+ ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(length));
+ avc->m.Length = length;
avc->m.Date = astat->ClientModTime;
}
hset64(avc->m.DataVersion, astat->dataVersionHigh, astat->DataVersion);
MACRO_BEGIN \
if ((t1) == ICL_TYPE_STRING) { \
tsize = (int)((unsigned)(strlen((char *)(p1)) + 4) >> 2); \
- } else if ((t1) == ICL_TYPE_HYPER) \
+ } else if ((t1) == ICL_TYPE_HYPER || (t1) == ICL_TYPE_INT64) \
tsize = 2; \
else if ((t1) == ICL_TYPE_FID) \
tsize = 4; \
#define ICL_TYPE_STRING 4
#define ICL_TYPE_FID 5
#define ICL_TYPE_UNIXDATE 6
+#define ICL_TYPE_INT64 8
+
+#ifdef AFS_64BIT_CLIENT
+#define ICL_TYPE_OFFSET ICL_TYPE_INT64
+#define ICL_HANDLE_OFFSET(x) (&x)
+#else /* AFS_64BIT_CLIENT */
+#define ICL_TYPE_OFFSET ICL_TYPE_INT64
+#define ICL_HANDLE_OFFSET(x) (x)
+#endif /* AFS_64BIT_CLIENT */
/* max # of words put in the printf buffer per parameter */
#define ICL_MAXEXPANSION 4
#define AFS_SYSCALL 137
#define AFS_64BIT_IOPS_ENV 1
#define AFS_NAMEI_ENV 1 /* User space interface to file system */
+#define AFS_64BIT_ENV 1
+#define AFS_64BIT_CLIENT 1
#if defined(__KERNEL__) && !defined(KDUMP_KERNEL)
#include <linux/config.h>
#define AFS_AIX41_ENV 1
#define AFS_AIX42_ENV 1
+#define AFS_64BIT_ENV 1
+#define AFS_64BIT_CLIENT 1
+
#include <afs/afs_sysnames.h>
/* Global lock in AFS part of client. */
#ifndef AFS_PARAM_H
#define AFS_PARAM_H
+#define AFS_64BIT_ENV 1
+#define AFS_64BIT_CLIENT 1
+
#define AFS_VFS_ENV 1
/* Used only in vfsck code; is it needed any more???? */
#define RXK_LISTENER_ENV 1
#include "../h/mbuf.h"
#endif
#else /* !defined(UKERNEL) */
+#include "../afs/stds.h"
#include "../afs/sysincludes.h"
#endif /* !defined(UKERNEL) */
#include "../afs/afs_osi.h"
OUT afs_uint32 *serverVersion,
OUT afs_uint32 *configCount,
OUT cacheConfig *config
-) = 218;
+) = 218;
+
+#ifdef RESIDENCY
+/* Used in MR-AFS for third party move of data between remioserver and "fs" */
+proc FetchData(IN struct AFSFid *Fid,
+ afs_int32 Filesdescriptor,
+ afs_int64 Position,
+ afs_int64 Length,
+ OUT afs_int64 *TotalLength) split = 65536;
+
+proc StoreData(IN struct AFSFid *Fid,
+ afs_int32 Filesdescriptor,
+ afs_int64 Position,
+ afs_int64 Length,
+ OUT afs_int64 *TotalLength) split = 65537;
+#endif /* RESIDENCY */
+
+proc GetCE64(
+ IN afs_int32 index,
+ OUT AFSDBCacheEntry64 *ce
+) = 65538;
%#define Directory 2
%#define SymbolicLink 3
-%#ifdef KERNEL
-%#define xdr_array(a,b,c,d,e,f) xdr_arrayN(a,b,c,d,e,f)
+%#ifdef KERNEL
+%#define xdr_array(a,b,c,d,e,f) xdr_arrayN(a,b,c,d,e,f)
%#endif
struct BD {
afs_uint32 UnixModeBits;
afs_uint32 ParentVnode;
afs_uint32 ParentUnique;
- afs_uint32 SegSize;
+ afs_uint32 ResidencyMask;
afs_uint32 ClientModTime;
afs_uint32 ServerModTime;
afs_uint32 Group;
afs_uint32 SyncCounter;
afs_uint32 dataVersionHigh; /* For AFS/DFS translator, hi bits of dvn */
afs_uint32 lockCount;
- afs_uint32 spare3;
+ afs_uint32 Length_hi;
afs_uint32 errorCode;
};
%#include "../afs/longc_procs.h"
%#endif
-const FLUSHMAX = 10;
-typedef afs_int32 ViceIds<FLUSHMAX>;
-typedef afs_int32 IPAddrs<FLUSHMAX>;
+%#define MAXCMDINT64S 3
+%#define MAXCMDINT32S 200
+%#define MAXCMDCHARS 256
+%#define CMD_GETRESIDENCIES 1
+%#define CMD_CHANGERESIDENCIES 2
+%#define CMD_IMPORTRESIDENCIES 3
+%#define CMD_GETEXTVOLATTR 4
+%#define CMD_SETEXTVOLATTR 5
+%#define CMD_GETACCESSHISTORY 6
+%#define CMD_MIGRATEFILE 7
+%#define CMD_CHECKHSMMETADATA 8
+%#define CMD_FETCHSTATUS 9
+
+%#define VOLATTR_DESIREDRESIDENCYMASK 1
+%#define VOLATTR_UNDESIREDRESIDENCYMASK 2
+%#define VOLATTR_SETSPECIALACCESSFLAG 4
+struct ExtendedVolAttrInputs {
+ afs_uint32 Mask;
+ afs_uint32 Volume;
+ afs_uint32 DesiredResidencyMask;
+ afs_uint32 Spare1[10];
+ afs_uint32 UnDesiredResidencyMask;
+ afs_uint32 Spare2[9];
+ afs_uint32 SpecialAccessFlag;
+};
-%#define MAXCMDINT64S 3
-%#define MAXCMDINT32S 200
-%#define MAXCMDCHARS 256
+struct ExtendedVolAttrOutputs {
+ afs_uint32 DesiredResidencyMask;
+ afs_uint32 Spare1[10];
+ afs_uint32 UnDesiredResidencyMask;
+ afs_uint32 Spare2[9];
+ afs_uint32 SpecialAccessFlag;
+};
+
+struct TagsArray {
+ afs_uint32 TagsArray_len;
+ afs_uint32 TagsArray_val[184];
+};
+
+struct AccessHistory {
+ afs_uint64 Size;
+ afs_uint32 ModTime;
+ afs_uint32 NonSpoolingFetches;
+ afs_uint32 UserSpoolingFetches;
+ afs_uint32 MigratorSpoolingFetches;
+ afs_uint32 LastUserMigrationEvent;
+ afs_uint32 MigrateMe;
+ afs_uint32 Time0;
+ afs_uint32 Type0;
+ afs_uint32 LocalAccess0;
+ afs_uint32 Residency0;
+ afs_uint32 Time1;
+ afs_uint32 Type1;
+ afs_uint32 LocalAccess1;
+ afs_uint32 Residency1;
+ afs_uint32 Time2;
+ afs_uint32 Type2;
+ afs_uint32 LocalAccess2;
+ afs_uint32 Residency2;
+ afs_uint32 Time3;
+ afs_uint32 Type3;
+ afs_uint32 LocalAccess3;
+ afs_uint32 Residency3;
+ afs_uint32 Time4;
+ afs_uint32 Type4;
+ afs_uint32 LocalAccess4;
+ afs_uint32 Residency4;
+};
+
+struct AccessHistoryOld {
+ afs_uint32 Size;
+ afs_uint32 ModTime;
+ afs_uint32 NonSpoolingFetches;
+ afs_uint32 UserSpoolingFetches;
+ afs_uint32 MigratorSpoolingFetches;
+ afs_uint32 LastUserMigrationEvent;
+ afs_uint32 MigrateMe;
+ afs_uint32 Time0;
+ afs_uint32 Type0;
+ afs_uint32 LocalAccess0;
+ afs_uint32 Residency0;
+ afs_uint32 Time1;
+ afs_uint32 Type1;
+ afs_uint32 LocalAccess1;
+ afs_uint32 Residency1;
+ afs_uint32 Time2;
+ afs_uint32 Type2;
+ afs_uint32 LocalAccess2;
+ afs_uint32 Residency2;
+ afs_uint32 Time3;
+ afs_uint32 Type3;
+ afs_uint32 LocalAccess3;
+ afs_uint32 Residency3;
+ afs_uint32 Time4;
+ afs_uint32 Type4;
+ afs_uint32 LocalAccess4;
+ afs_uint32 Residency4;
+};
struct ResidencyCmdInputs {
afs_int32 command;
afs_int64 int64s[MAXCMDINT64S];
afs_uint32 int32s[MAXCMDINT32S];
char chars[MAXCMDCHARS];
-};
+};
+
+const FLUSHMAX = 10;
+typedef afs_int32 ViceIds<FLUSHMAX>;
+typedef afs_int32 IPAddrs<FLUSHMAX>;
package RXAFS_
prefix S
statindex 7
FetchData(
- IN AFSFid *Fid,
- afs_int32 Pos,
- afs_int32 Length,
- OUT AFSFetchStatus *OutStatus,
- AFSCallBack *CallBack,
+ IN AFSFid *Fid,
+ afs_int32 Pos,
+ afs_int32 Length,
+ OUT AFSFetchStatus *OutStatus,
+ AFSCallBack *CallBack,
AFSVolSync *Sync
) split = 130;
FetchACL(
- IN AFSFid *Fid,
- OUT AFSOpaque *AccessList,
- AFSFetchStatus *OutStatus,
+ IN AFSFid *Fid,
+ OUT AFSOpaque *AccessList,
+ AFSFetchStatus *OutStatus,
AFSVolSync *Sync
) = 131;
FetchStatus(
- IN AFSFid *Fid,
- OUT AFSFetchStatus *OutStatus,
- AFSCallBack *CallBack,
+ IN AFSFid *Fid,
+ OUT AFSFetchStatus *OutStatus,
+ AFSCallBack *CallBack,
AFSVolSync *Sync
) = 132;
StoreData(
- IN AFSFid *Fid,
- AFSStoreStatus *InStatus,
- afs_int32 Pos,
- afs_int32 Length,
- afs_int32 FileLength,
- OUT AFSFetchStatus *OutStatus,
+ IN AFSFid *Fid,
+ AFSStoreStatus *InStatus,
+ afs_int32 Pos,
+ afs_int32 Length,
+ afs_int32 FileLength,
+ OUT AFSFetchStatus *OutStatus,
AFSVolSync *Sync
) split = 133;
StoreACL(
- IN AFSFid *Fid,
- AFSOpaque *AccessList,
- OUT AFSFetchStatus *OutStatus,
+ IN AFSFid *Fid,
+ AFSOpaque *AccessList,
+ OUT AFSFetchStatus *OutStatus,
AFSVolSync *Sync
) = 134;
StoreStatus(
- IN AFSFid *Fid,
- AFSStoreStatus *InStatus,
- OUT AFSFetchStatus *OutStatus,
+ IN AFSFid *Fid,
+ AFSStoreStatus *InStatus,
+ OUT AFSFetchStatus *OutStatus,
AFSVolSync *Sync
) = 135;
RemoveFile(
- IN AFSFid *DirFid,
- string Name<AFSNAMEMAX>,
- OUT AFSFetchStatus *OutStatus,
+ IN AFSFid *DirFid,
+ string Name<AFSNAMEMAX>,
+ OUT AFSFetchStatus *OutStatus,
AFSVolSync *Sync
) = 136;
CreateFile(
- IN AFSFid *DirFid,
- string Name<AFSNAMEMAX>,
- AFSStoreStatus *InStatus,
- OUT AFSFid *OutFid,
- AFSFetchStatus *OutFidStatus,
- AFSFetchStatus *OutDirStatus,
- AFSCallBack *CallBack,
+ IN AFSFid *DirFid,
+ string Name<AFSNAMEMAX>,
+ AFSStoreStatus *InStatus,
+ OUT AFSFid *OutFid,
+ AFSFetchStatus *OutFidStatus,
+ AFSFetchStatus *OutDirStatus,
+ AFSCallBack *CallBack,
AFSVolSync *Sync) = 137;
Rename(
- IN AFSFid *OldDirFid,
- string OldName<AFSNAMEMAX>,
- AFSFid *NewDirFid,
- string NewName<AFSNAMEMAX>,
- OUT AFSFetchStatus *OutOldDirStatus,
- AFSFetchStatus *OutNewDirStatus,
+ IN AFSFid *OldDirFid,
+ string OldName<AFSNAMEMAX>,
+ AFSFid *NewDirFid,
+ string NewName<AFSNAMEMAX>,
+ OUT AFSFetchStatus *OutOldDirStatus,
+ AFSFetchStatus *OutNewDirStatus,
AFSVolSync *Sync
) = 138;
Symlink(
- IN AFSFid *DirFid,
- string Name<AFSNAMEMAX>,
- string LinkContents<AFSPATHMAX>,
- AFSStoreStatus *InStatus,
- OUT AFSFid *OutFid,
- AFSFetchStatus *OutFidStatus,
- AFSFetchStatus *OutDirStatus,
+ IN AFSFid *DirFid,
+ string Name<AFSNAMEMAX>,
+ string LinkContents<AFSPATHMAX>,
+ AFSStoreStatus *InStatus,
+ OUT AFSFid *OutFid,
+ AFSFetchStatus *OutFidStatus,
+ AFSFetchStatus *OutDirStatus,
AFSVolSync *Sync
) = 139;
Link(
- IN AFSFid *DirFid,
- string Name<AFSNAMEMAX>,
- AFSFid *ExistingFid,
- OUT AFSFetchStatus *OutFidStatus,
- AFSFetchStatus *OutDirStatus,
+ IN AFSFid *DirFid,
+ string Name<AFSNAMEMAX>,
+ AFSFid *ExistingFid,
+ OUT AFSFetchStatus *OutFidStatus,
+ AFSFetchStatus *OutDirStatus,
AFSVolSync *Sync
) = 140;
MakeDir(
- IN AFSFid *DirFid,
- string Name<AFSNAMEMAX>,
- AFSStoreStatus *InStatus,
- OUT AFSFid *OutFid,
- AFSFetchStatus *OutFidStatus,
- AFSFetchStatus *OutDirStatus,
- AFSCallBack *CallBack,
+ IN AFSFid *DirFid,
+ string Name<AFSNAMEMAX>,
+ AFSStoreStatus *InStatus,
+ OUT AFSFid *OutFid,
+ AFSFetchStatus *OutFidStatus,
+ AFSFetchStatus *OutDirStatus,
+ AFSCallBack *CallBack,
AFSVolSync *Sync
) = 141;
RemoveDir(
- IN AFSFid *DirFid,
- string Name<AFSNAMEMAX>,
- OUT AFSFetchStatus *OutDirStatus,
+ IN AFSFid *DirFid,
+ string Name<AFSNAMEMAX>,
+ OUT AFSFetchStatus *OutDirStatus,
AFSVolSync *Sync
) = 142;
OldSetLock(
- IN AFSFid *Fid,
- ViceLockType Type,
+ IN AFSFid *Fid,
+ ViceLockType Type,
AFSVolSync *Sync
) = 143;
OldExtendLock(
- IN AFSFid *Fid,
+ IN AFSFid *Fid,
AFSVolSync *Sync
) = 144;
OldReleaseLock(
- IN AFSFid *Fid,
+ IN AFSFid *Fid,
AFSVolSync *Sync
) = 145;
) = 147;
GetVolumeInfo(
- IN string VolumeName<AFSNAMEMAX>,
+ IN string VolumeName<AFSNAMEMAX>,
OUT VolumeInfo *Volumeinfo
) = 148;
GetVolumeStatus(
- IN afs_int32 Volumeid,
- OUT AFSFetchVolumeStatus *Volumestatus,
+ IN afs_int32 Volumeid,
+ OUT AFSFetchVolumeStatus *Volumestatus,
string Name<AFSNAMEMAX>,
- string OfflineMsg<AFSOPAQUEMAX>,
+ string OfflineMsg<AFSOPAQUEMAX>,
string Motd<AFSOPAQUEMAX>
) = 149;
SetVolumeStatus(
- IN afs_int32 Volumeid,
+ IN afs_int32 Volumeid,
AFSStoreVolumeStatus *Volumestatus,
string Name<AFSNAMEMAX>,
string OfflineMsg<AFSOPAQUEMAX>,
) = 151;
CheckToken(
- IN afs_int32 ViceId,
+ IN afs_int32 ViceId,
AFSOpaque *token
) = 152;
GetTime(
- OUT afs_uint32 *Seconds,
+ OUT afs_uint32 *Seconds,
afs_uint32 *USeconds
) = 153;
) = 155;
SetLock(
- IN AFSFid *Fid,
- ViceLockType Type,
+ IN AFSFid *Fid,
+ ViceLockType Type,
OUT AFSVolSync *Sync
) = 156;
ExtendLock(
- IN AFSFid *Fid,
+ IN AFSFid *Fid,
OUT AFSVolSync *Sync
) = 157;
ReleaseLock(
- IN AFSFid *Fid,
+ IN AFSFid *Fid,
OUT AFSVolSync *Sync
) = 158;
) = 162;
DFSSymlink(
- IN AFSFid *DirFid,
- string Name<AFSNAMEMAX>,
- string LinkContents<AFSPATHMAX>,
- AFSStoreStatus *InStatus,
- OUT AFSFid *OutFid,
- AFSFetchStatus *OutFidStatus,
- AFSFetchStatus *OutDirStatus,
+ IN AFSFid *DirFid,
+ string Name<AFSNAMEMAX>,
+ string LinkContents<AFSPATHMAX>,
+ AFSStoreStatus *InStatus,
+ OUT AFSFid *OutFid,
+ AFSFetchStatus *OutFidStatus,
+ AFSFetchStatus *OutDirStatus,
AFSCallBack *CallBack,
AFSVolSync *Sync
) = 163;
IN AFSFid *Fid,
IN struct ResidencyCmdInputs *Inputs,
OUT struct ResidencyCmdOutputs *Outputs
-) = 220;
+) = 220;
+
+FetchData64(
+ IN AFSFid *Fid,
+ afs_int64 Pos,
+ afs_int64 Length,
+ OUT AFSFetchStatus *OutStatus,
+ AFSCallBack *CallBack,
+ AFSVolSync *Sync
+) split = 231;
+
+StoreData64(
+ IN AFSFid *Fid,
+ AFSStoreStatus *InStatus,
+ afs_int64 Pos,
+ afs_int64 Length,
+ afs_int64 FileLength,
+ OUT AFSFetchStatus *OutStatus,
+ AFSVolSync *Sync
+) split = 233;
InlineBulkStatus(
IN AFSCBFids *FidsArray,
/*
* common.xg:
- * Common values and structures used in the AFS File Server
- * and Cache Manager interfaces.
+ * Common values and structures used in the AFS File Server
+ * and Cache Manager interfaces.
*/
%#ifndef FSINT_COMMON_XG
char states;
};
+struct AFSDBCacheEntry64 {
+ afs_int32 addr;
+ afs_int32 cell; /*Cell part of the fid*/
+ AFSFid netFid; /*Network part of the fid*/
+ afs_int64 Length;
+ afs_int32 DataVersion;
+ struct AFSDBLockDesc lock;
+ afs_int32 callback;
+ afs_int32 cbExpires;
+ short refCount;
+ short opens;
+ short writers;
+ char mvstat;
+ char states;
+};
+
struct AFSDBLock {
char name[16];
struct AFSDBLockDesc lock;
/*------------------------------------------------------------------------
- * SRXAFSCB_GetCE
+ * SRXAFSCB_GetCE64
*
* Description:
* Respond minimally to a request for returning the contents of
* As advertised.
*------------------------------------------------------------------------*/
+afs_int32 SRXAFSCB_GetCE64(rxcall)
+ struct rx_call *rxcall;
+
+{ /*SRXAFSCB_GetCE64*/
+
+#if XSTAT_FS_CALLBACK_VERBOSE
+ static char rn[] = "SRXAFSCB_GetCE64"; /*Routine name*/
+ char hostName[256]; /*Host name buffer*/
+ char *hostNameResult; /*Ptr to static*/
+
+ if (rxcall != (struct rx_call *)0) {
+ hostNameResult =
+ hostutil_GetNameByINet((afs_int32)(rxcall->conn->peer->host));
+ strcpy(hostName, hostNameResult);
+ fprintf(stderr, "[%s:%s] Called from host %s, port %d\n",
+ mn, rn, hostName, rxcall->conn->peer->port);
+ } /*Valid rxcall param*/
+#endif /* XSTAT_FS_CALLBACK_VERBOSE */
+
+ return(0);
+
+} /*SRXAFSCB_GetCE64*/
+
afs_int32 SRXAFSCB_GetCE(rxcall)
struct rx_call *rxcall;
#ifndef AFS_NT40_ENV
/* Declare Inode type. */
-#ifdef AFS_64BIT_IOPS_ENV
-#ifdef AFS_SGI62_ENV
-typedef uint64_t Inode;
-#else
+#include <afs/param.h>
#ifdef AFS_NAMEI_ENV
-#include <sys/types.h>
-#ifdef AFS_NEC_SX92_ENV
-typedef unsigned long Inode;
-#else /* AFS_NEC_SX92_ENV */
-#ifdef AFS_64BIT_ENV
-typedef afs_uint64 Inode;
-#else
-typedef u_int64_t Inode;
-#endif
-#endif /* AFS_NEC_SX92_ENV */
-#else
-error Need 64 bit Inode defined.
-#endif /* AFS_NAMEI_ENV */
-#endif /* AFS_SGI62_ENV */
-#else /* AFS_64BIT_IOPS_ENV */
-typedef unsigned int Inode;
-#endif
-
-#ifndef AFS_NAMEI_ENV
+ #include <sys/types.h>
+ #if AFS_64BIT_ENV
+ typedef afs_uint64 Inode;
+ #else
+ typedef u_int64_t Inode;
+ #endif
+#else /* AFS_NAMEI_ENV */
+ #ifdef AFS_64BIT_IOPS_ENV
+ #ifdef AFS_SGI62_ENV
+ typedef uint64_t Inode;
+ #else
+ error Need 64 bit Inode defined.
+ #endif /* AFS_SGI62_ENV */
+ #else /* AFS_64BIT_IOPS_ENV */
+ typedef unsigned int Inode;
+ #endif
#ifdef AFS_DEBUG_IOPS
extern FILE *inode_debug_log;
printfParms[pfpix++] = alp[pix];
break;
case ICL_TYPE_HYPER:
+ case ICL_TYPE_INT64:
printfTypes[pftix++] = 0;
printfParms[pfpix++] = alp[pix];
printfTypes[pftix++] = 0;
#endif /* AFS_SGI61_ENV */
break;
case ICL_TYPE_HYPER:
+ case ICL_TYPE_INT64:
fprintf(outFilep, "p%d:%x.%x ", i, alp[pix], alp[pix+1]);
break;
case ICL_TYPE_FID:
#define _LINUX_CODA_FS_I
#define _LINUX_NTFS_FS_SB_H
#define _LINUX_NTFS_FS_I_H
+#define _NCP_FS_SB
struct sysv_sb_info {};
struct affs_sb_info {};
struct ufs_sb_info {};
struct nfs_lock_info {};
struct ntfs_sb_info{};
struct ntfs_inode_info{};
+struct ncp_sb_info{};
#include <linux/types.h>
#define u32 unsigned int
#define s32 int
#include <arpa/inet.h> /* inet_ntoa() */
#if defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV)
-#ifdef AFS_SGI_ENV
+#ifdef AFS_SGI_ENV
#include <sys/vnode.h>
#endif /* AFS_SGI_ENV */
#else
-#ifdef AFS_MACH_ENV
+#ifdef AFS_MACH_ENV
#include <vfs/vfs.h>
#include <vfs/vnode.h>
#include <sys/inode.h>
int a,b;
};
#ifndef AFS_ALPHA_LINUX20_ENV
-#ifndef AFS_LINUX24_ENV
typedef struct timeval {
int tv_sec;
int tv_usec;
} timeval_t; /* Needed here since KERNEL defined. */
-#endif
#endif /*AFS_ALPHA_LINUX20_ENV*/
#if defined(AFSBIG_ENDIAN)
#define _LINUX_BYTEORDER_BIG_ENDIAN_H
#include <osi_vfs.h>
#else /* AFS_LINUX20_ENV */
#ifdef AFS_HPUX110_ENV
-#define KERNEL
-#define _KERNEL 1
+#define KERNEL
+#define _KERNEL 1
/* Declare following so sys/vnode.h will compile with KERNEL defined */
#define FILE FILe
typedef enum _spustate { /* FROM /etc/conf/h/_types.h */
- SPUSTATE_NONE = 0, /* must be 0 for proper initialization */
- SPUSTATE_IDLE, /* spu is idle */
- SPUSTATE_USER, /* spu is in user mode */
- SPUSTATE_SYSTEM, /* spu is in system mode */
- SPUSTATE_UNKNOWN, /* utility code for NEW_INTERVAL() */
- SPUSTATE_NOCHANGE /* utility code for NEW_INTERVAL() */
+ SPUSTATE_NONE = 0, /* must be 0 for proper initialization */
+ SPUSTATE_IDLE, /* spu is idle */
+ SPUSTATE_USER, /* spu is in user mode */
+ SPUSTATE_SYSTEM, /* spu is in system mode */
+ SPUSTATE_UNKNOWN, /* utility code for NEW_INTERVAL() */
+ SPUSTATE_NOCHANGE /* utility code for NEW_INTERVAL() */
} spustate_t;
#define k_off_t off_t
#include "sys/vnode.h"
printf("\ti_ino=%d, i_mode=%x, i_nlink=%d, i_uid=%d, i_gid=%d, i_size=%d\n",
vep->i_ino, vep->i_mode, vep->i_nlink, vep->i_uid, vep->i_gid,
vep->i_size);
-#ifndef AFS_LINUX24_ENV
+#ifdef AFS_LINUX24_ENV
printf("\ti_atime=%u, i_mtime=%u, i_ctime=%u, i_version=%u, i_nrpages=%u\n",
vep->i_atime, vep->i_mtime, vep->i_ctime, vep->i_version,
- vep->i_nrpages);
+ vep->i_data.nrpages);
#else
- printf("\ti_atime=%u, i_mtime=%u, i_ctime=%u, i_version=%u\n",
- vep->i_atime, vep->i_mtime, vep->i_ctime, vep->i_version
- );
+ printf("\ti_atime=%u, i_mtime=%u, i_ctime=%u, i_version=%u, i_nrpages=%u\n",
+ vep->i_atime, vep->i_mtime, vep->i_ctime, vep->i_version,
+ vep->i_nrpages);
#endif
printf("\ti_op=0x%x, i_dev=0x%x, i_rdev=0x%x, i_sb=0x%x\n",
vep->i_op, vep->i_dev, vep->i_rdev, vep->i_sb);
ptr, vep->vrefCount, vep->parentVnode, vep->parentUnique,
vep->flushDV.high, vep->flushDV.low,
vep->mapDV.high, vep->mapDV.low);
+#ifdef AFS_64BIT_CLIENT
+ printf("truncPos=(0x%x, 0x%x),\n\tcallb=x%lx, cbE=%d, opens=%d, XoW=%d, ",
+ (int) vep->truncPos >> 32, (int) vep->truncPos & 0xffffffff,
+ vep->callback, vep->cbExpires, vep->opens,
+ vep->execsOrWriters);
+#else /* AFS_64BIT_CLIENT */
printf("truncPos=%d,\n\tcallb=x%lx, cbE=%d, opens=%d, XoW=%d, ",
vep->truncPos, vep->callback, vep->cbExpires, vep->opens,
vep->execsOrWriters);
+#endif /* AFS_64BIT_CLIENT */
printf("flcnt=%d, mvstat=%d\n",
vep->flockCount, vep->mvstat);
printf("\tstates=x%x, ", vep->states);
printf("vstates=x%x, ", vep->vstates);
#endif /* AFS_SUN5_ENV */
printf("dchint=%x, anyA=0x%x\n", vep->h1.dchint, vep->anyAccess);
+#ifdef AFS_64BIT_CLIENT
+ printf("\tquick[dc=%x, stamp=%x, f=%x, min=%d, len=(0x%x, 0x%x)]\n",
+ vep->quick.dc, vep->quick.stamp, vep->quick.f,
+ vep->quick.minLoc,
+ (int)vep->quick.len >> 32, (int)vep->quick.len & 0xffffffff);
+ printf("\tmstat[len=(0x%x, 0x%x), DV=%d.%d, Date=%d, Owner=%d, Group=%d, Mode=0%o, linkc=%d]\n",
+ (int) vep->m.Length >> 32, (int) vep->m.Length & 0xffffffff,
+ vep->m.DataVersion.high,
+ vep->m.DataVersion.low, vep->m.Date, vep->m.Owner,
+ vep->m.Group, vep->m.Mode, vep->m.LinkCount);
+#else /* AFS_64BIT_CLIENT */
printf("\tquick[dc=%x, stamp=%x, f=%x, min=%d, len=%d]\n",
vep->quick.dc, vep->quick.stamp, vep->quick.f,
vep->quick.minLoc, vep->quick.len);
vep->m.Length, vep->m.DataVersion.high,
vep->m.DataVersion.low, vep->m.Date, vep->m.Owner,
vep->m.Group, vep->m.Mode, vep->m.LinkCount);
+#endif /* AFS_64BIT_CLIENT */
#else /* AFS33 */
printf("%x: refC=%d, pv=%d, pu=%d, flushDv=%d, mapDV=%d, truncPos=%d\n",
ptr, vep->vrefCount, vep->parentVnode, vep->parentUnique, vep->flushDV,
struct AFSVolSync *Sync; /* synchronization info */
{
+ int code;
+
+ code = common_FetchData (tcon, Fid, Pos, Len, OutStatus,
+ CallBack, Sync, 0);
+ return code;
+}
+
+SRXAFS_FetchData64 (tcon, Fid, Pos, Len, OutStatus, CallBack, Sync)
+ struct rx_connection *tcon; /* Rx connection handle */
+ struct AFSFid *Fid; /* Fid of file to fetch */
+ afs_int64 Pos, Len; /* Not implemented yet */
+ struct AFSFetchStatus *OutStatus; /* Returned status for Fid */
+ struct AFSCallBack *CallBack; /* If r/w return CB for Fid */
+ struct AFSVolSync *Sync; /* synchronization info */
+{
+ int code;
+ afs_int32 tPos, tLen;
+
+#ifdef AFS_64BIT_ENV
+ if (Pos + Len > 0x7fffffff)
+ return E2BIG;
+ tPos = Pos;
+ tLen = Len;
+#else /* AFS_64BIT_ENV */
+ if (Pos.high || Len.high)
+ return E2BIG;
+ tPos = Pos.low;
+ tLen = Len.low;
+#endif /* AFS_64BIT_ENV */
+
+ code = common_FetchData (tcon, Fid, tPos, tLen, OutStatus,
+ CallBack, Sync, 0);
+ return code;
+}
+
+common_FetchData (tcon, Fid, Pos, Len, OutStatus, CallBack, Sync, type)
+ struct rx_connection *tcon; /* Rx connection handle */
+ struct AFSFid *Fid; /* Fid of file to fetch */
+ afs_int32 Pos, Len; /* Not implemented yet */
+ struct AFSFetchStatus *OutStatus; /* Returned status for Fid */
+ struct AFSCallBack *CallBack; /* If r/w return CB for Fid */
+ struct AFSVolSync *Sync; /* synchronization info */
+ int type; /* 32 bit or 64 bit call */
+
+{
Vnode * targetptr = 0; /* pointer to vnode to fetch */
Vnode * parentwhentargetnotdir = 0; /* parent vnode if vptr is a file */
Vnode tparentwhentargetnotdir; /* parent vnode for GetStatus */
/* actually do the data transfer */
#if FS_STATS_DETAILED
- errorCode = FetchData_RXStyle(volptr, targetptr, tcall, Pos, Len,
+ errorCode = FetchData_RXStyle(volptr, targetptr, tcall, Pos, Len, type
&bytesToXfer, &bytesXferred);
#else
- if (errorCode = FetchData_RXStyle(volptr, targetptr, tcall, Pos, Len))
+ if (errorCode = FetchData_RXStyle(volptr, targetptr, tcall, Pos, Len, type))
goto Bad_FetchData;
#endif /* FS_STATS_DETAILED */
} /*SRXAFS_StoreData*/
+SRXAFS_StoreData64 (tcon, Fid, InStatus, Pos, Length, FileLength, OutStatus, Sync)
+ struct AFSVolSync *Sync;
+ struct rx_connection *tcon; /* Rx connection Handle */
+ struct AFSFid *Fid; /* Fid of taret file */
+ struct AFSStoreStatus *InStatus; /* Input Status for Fid */
+ afs_int64 Pos; /* Not implemented yet */ afs_int64 Length; /* Length of data to store */
+ afs_int64 FileLength; /* Length of file after store */
+ struct AFSFetchStatus *OutStatus; /* Returned status for target fid */
+{
+ int code;
+ afs_int32 tPos;
+ afs_int32 tLength;
+ afs_int32 tFileLength;
+
+#ifdef AFS_64BIT_ENV
+ if (FileLength > 0x7fffffff)
+ return E2BIG;
+ tPos = Pos;
+ tLength = Length;
+ tFileLength = FileLength;
+#else /* AFS_64BIT_ENV */
+ if (FileLength.high)
+ return E2BIG;
+ tPos = Pos.low;
+ tLength = Length.low;
+ tFileLength = FileLength.low;
+#endif /* AFS_64BIT_ENV */
+
+ code = SRXAFS_StoreData (tcon, Fid, InStatus, tPos, tLength, tFileLength,
+ OutStatus, Sync);
+ return code;
+}
SRXAFS_StoreACL (tcon, Fid, AccessList, OutStatus, Sync)
struct AFSVolSync *Sync;
# the File Server.
*/
-FetchData_RXStyle(volptr, targetptr, Call, Pos, Len, a_bytesToFetchP, a_bytesFetchedP)
+FetchData_RXStyle(volptr, targetptr, Call, Pos, Len, Int64Mode, a_bytesToFetchP, a_bytesFetchedP)
#else
-FetchData_RXStyle(volptr, targetptr, Call, Pos, Len)
+FetchData_RXStyle(volptr, targetptr, Call, Pos, Len, Int64Mode)
#endif /* FS_STATS_DETAILED */
Volume * volptr;
Vnode * targetptr;
register struct rx_call * Call;
afs_int32 Pos;
afs_int32 Len;
+afs_int32 Int64Mode;
#if FS_STATS_DETAILED
afs_int32 *a_bytesToFetchP;
afs_int32 *a_bytesFetchedP;
* back to make the cache manager happy...
*/
tlen = htonl(0);
+ if (Int64Mode)
+ rx_Write(Call, &tlen, sizeof(afs_int32)); /* send 0-length */
rx_Write(Call, &tlen, sizeof(afs_int32)); /* send 0-length */
return (0);
}
if (Pos + Len > tlen) Len = tlen - Pos; /* get length we should send */
FDH_SEEK(fdP, Pos, 0);
tlen = htonl(Len);
+ if (Int64Mode) {
+ afs_int32 zero = 0;
+ rx_Write(Call, &zero, sizeof(afs_int32)); /* High order bits */
+ }
rx_Write(Call, &tlen, sizeof(afs_int32)); /* send length on fetch */
#if FS_STATS_DETAILED
(*a_bytesToFetchP) = Len;
/* initialize return status from a vnode */
status->InterfaceVersion = 1;
status->SyncCounter = status->dataVersionHigh = status->lockCount =
- status->spare3 = status->errorCode = 0;
+ status->errorCode = 0;
+ status->ResidencyMask = 1; /* means for MR-AFS: file in /vicepr-partition */
if (targetptr->disk.type == vFile)
status->FileType = File;
else if (targetptr->disk.type == vDirectory)
status->ClientModTime = targetptr->disk.unixModifyTime; /* This might need rework */
status->ParentVnode = (status->FileType == Directory ? targetptr->vnodeNumber : parentptr->vnodeNumber);
status->ParentUnique = (status->FileType == Directory ? targetptr->disk.uniquifier : parentptr->disk.uniquifier);
- status->SegSize = 0;
status->ServerModTime = targetptr->disk.serverModifyTime;
status->Group = targetptr->disk.group;
status->lockCount = targetptr->disk.lock.lockCount;
/*------------------------------------------------------------------------
- * SRXAFSCB_GetCE
+ * SRXAFSCB_GetCE64
*
* Description:
* Respond minimally to a request for returning the contents of
* As advertised.
*------------------------------------------------------------------------*/
+afs_int32 SRXAFSCB_GetCE64(rxcall)
+ struct rx_call *rxcall;
+
+{ /*SRXAFSCB_GetCE64*/
+
+#if XSTAT_FS_CALLBACK_VERBOSE
+ static char rn[] = "SRXAFSCB_GetCE64"; /*Routine name*/
+ char hostName[256]; /*Host name buffer*/
+ char *hostNameResult; /*Ptr to static*/
+
+ if (rxcall != (struct rx_call *)0) {
+ hostNameResult =
+ hostutil_GetNameByINet((afs_int32)(rxcall->conn->peer->host));
+ strcpy(hostName, hostNameResult);
+ fprintf(stderr, "[%s:%s] Called from host %s, port %d\n",
+ mn, rn, hostName, rxcall->conn->peer->port);
+ } /*Valid rxcall param*/
+#endif /* XSTAT_FS_CALLBACK_VERBOSE */
+
+ return(0);
+
+} /*SRXAFSCB_GetCE64*/
+
afs_int32 SRXAFSCB_GetCE(rxcall)
struct rx_call *rxcall;
{ /*SRXAFSCB_GetCE*/
#if XSTAT_FS_CALLBACK_VERBOSE
- static char rn[] = "SRXAFSCB_GetCE"; /*Routine name*/
+ static char rn[] = "SRXAFSCB_GetCE"; /*Routine name*/
char hostName[256]; /*Host name buffer*/
char *hostNameResult; /*Ptr to static*/