]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
STABLE14-tiger-updates-20060220
authorChaskiel M Grundman <cg2v@andrew.cmu.edu>
Mon, 27 Feb 2006 20:37:47 +0000 (20:37 +0000)
committerDerrick Brashear <shadow@dementia.org>
Mon, 27 Feb 2006 20:37:47 +0000 (20:37 +0000)
update lpioctl, setattr and free tuios

(cherry picked from commit ff1d11169bc19aeb451a97e8ccdc14e1109031e7)

src/afs/DARWIN/osi_file.c
src/afs/VNOPS/afs_vnop_read.c
src/afs/VNOPS/afs_vnop_write.c
src/sys/afssyscalls.c

index f607580d61a77c883ea544fa47a0a2282b6ccbf8..7d8fc61584de2c155cbed737acef64325038440c 100644 (file)
@@ -247,7 +247,7 @@ osi_UFSTruncate(register struct osi_file *afile, afs_int32 asize)
 #ifdef AFS_DARWIN80_ENV
     VATTR_INIT(&tvattr);
     VATTR_SET(&tvattr, va_size, asize);
-    code = vnode_getattr(afile->vnode, &tvattr, afs_osi_ctxtp);
+    code = vnode_setattr(afile->vnode, &tvattr, afs_osi_ctxtp);
 #else
     VATTR_NULL(&tvattr);
     tvattr.va_size = asize;
index c3da3fa99977653baacd713e494c60d741ada5ed..9a104e168375f079deb8f392ce2874fc1888e1ed 100644 (file)
@@ -353,6 +353,12 @@ afs_MemRead(register struct vcache *avc, struct uio *auio,
 
        if (len <= 0)
            break;              /* surprise eof */
+#ifdef AFS_DARWIN80_ENV
+       if (tuiop) {
+           uio_free(tuiop);
+           tuiop = 0;
+       }
+#endif
     }                          /* the whole while loop */
 
     /*
@@ -880,6 +886,12 @@ afs_UFSRead(register struct vcache *avc, struct uio *auio,
        filePos += len;
        if (len <= 0)
            break;              /* surprise eof */
+#ifdef AFS_DARWIN80_ENV
+       if (tuiop) {
+           uio_free(tuiop);
+           tuiop = 0;
+       }
+#endif
     }
 
     /* if we make it here with tdc non-zero, then it is the last chunk we
index ffcec3389a0b34090895eb2d2321b900f9b34fdc..8392169bceaa6ac3b4807cfd607848c339807dbb 100644 (file)
@@ -106,7 +106,7 @@ afs_MemWrite(register struct vcache *avc, struct uio *auio, int aio,
 #endif
     afs_int32 error;
 #ifdef AFS_DARWIN80_ENV
-    uio_t tuiop;
+    uio_t tuiop = NULL;
 #else
     struct uio tuio;
     struct uio *tuiop = &tuio;
@@ -264,6 +264,8 @@ afs_MemWrite(register struct vcache *avc, struct uio *auio, int aio,
        }
 
 #ifdef  AFS_DARWIN80_ENV
+        if (tuiop)
+           uio_free(tuiop);
        trimlen = len;
        tuiop = afsio_darwin_partialcopy(auio, trimlen);
 #else
@@ -366,7 +368,7 @@ afs_UFSWrite(register struct vcache *avc, struct uio *auio, int aio,
 #endif
     afs_int32 error;
 #ifdef AFS_DARWIN80_ENV
-    uio_t tuiop;
+    uio_t tuiop = NULL;
 #else
     struct uio tuio;
     struct uio *tuiop = &tuio;
@@ -527,6 +529,8 @@ afs_UFSWrite(register struct vcache *avc, struct uio *auio, int aio,
        }
 
 #ifdef  AFS_DARWIN80_ENV
+       if (tuiop)
+           uio_free(tuiop);
        trimlen = len;
        tuiop = afsio_darwin_partialcopy(auio, trimlen);
 #else
index cd44fbdc2ea1846658ff7776e77ca45dd6811e3c..e2335d4ee87dcd65891cecdfec03ef3ab79fb67e 100644 (file)
@@ -340,13 +340,17 @@ lpioctl(char *path, int cmd, char *cmarg, int follow)
     int errcode, rval;
 
 #if defined(AFS_LINUX20_ENV)
-    rval = proc_afs_syscall(AFSCALL_PIOCTL, (long)path, cmd, (long)cmarg, follow, &errcode);
+    rval = proc_afs_syscall(AFSCALL_PIOCTL, (long)path, cmd, (long)cmarg, 
+                           follow, &errcode);
 
     if(rval)
-    errcode = syscall(AFS_SYSCALL, AFSCALL_PIOCTL, path, cmd, cmarg, follow);
+       errcode = syscall(AFS_SYSCALL, AFSCALL_PIOCTL, path, cmd, cmarg, 
+                         follow);
 #elif defined(AFS_DARWIN80_ENV)
-    if (ioctl_afs_syscall(AFSCALL_PIOCTL,(long)path,cmd,(long)cmarg,follow,0,0,&errcode))
-        errcode=ENOSYS;
+    rval = ioctl_afs_syscall(AFSCALL_PIOCTL, (long)path, cmd, (long)cmarg,
+                            follow, 0, 0, &errcode);
+    if (rval)
+       errcode = rval;
 #else
     errcode = syscall(AFS_SYSCALL, AFSCALL_PIOCTL, path, cmd, cmarg, follow);
 #endif