struct host *thost;
struct client *tclient;
int translate = 0;
- int held;
H_LOCK;
tclient = h_FindClient_r(aconn);
if (thost->hostFlags & HERRORTRANS)
translate = 1;
h_ReleaseClient_r(tclient);
- held = h_Held_r(thost);
- if (held)
- h_Release_r(thost);
- if (ahost && ahost != thost) {
- char hoststr[16], hoststr2[16];
- ViceLog(0, ("CallPostamble: ahost %s:%d (%x) != thost %s:%d (%x)\n",
- afs_inet_ntoa_r(ahost->host, hoststr), ntohs(ahost->port),
- ahost,
- afs_inet_ntoa_r(thost->host, hoststr2), ntohs(thost->port),
- thost));
- h_Release_r(ahost);
- } else if (!ahost) {
- char hoststr[16];
- ViceLog(0, ("CallPostamble: null ahost for thost %s:%d (%x)\n",
- afs_inet_ntoa_r(thost->host, hoststr), ntohs(thost->port),
- thost));
+
+ if (ahost) {
+ if (ahost != thost) {
+ /* host/client recycle */
+ char hoststr[16], hoststr2[16];
+ ViceLog(0, ("CallPostamble: ahost %s:%d (%p) != thost "
+ "%s:%d (%p)\n",
+ afs_inet_ntoa_r(ahost->host, hoststr),
+ ntohs(ahost->port),
+ ahost,
+ afs_inet_ntoa_r(thost->host, hoststr2),
+ ntohs(thost->port),
+ thost));
+ }
+ /* return the reference taken in CallPreamble */
+ h_Release_r(ahost);
+ } else {
+ char hoststr[16];
+ ViceLog(0, ("CallPostamble: null ahost for thost %s:%d (%p)\n",
+ afs_inet_ntoa_r(thost->host, hoststr),
+ ntohs(thost->port),
+ thost));
}
+
+ /* return the reference taken in local h_FindClient_r--h_ReleaseClient_r
+ * does not decrement refcount on client->host */
+ h_Release_r(thost);
+
busyout:
H_UNLOCK;
return (translate ? sys_error_to_et(ret) : ret);
SetDirHandle(&childdir, *targetptr);
if (IsEmpty(&childdir) != 0)
return (EEXIST);
- DZap(&childdir);
+ DZap((afs_int32 *) &childdir);
FidZap(&childdir);
(*targetptr)->delete = 1;
} else if ((--(*targetptr)->disk.linkCount) == 0)
afs_sfsize_t tPos, tLen;
#ifdef AFS_64BIT_ENV
-#ifndef AFS_LARGEFILE_ENV
- if (Pos + Len > 0x7fffffff)
- return EFBIG;
-#endif /* !AFS_LARGEFILE_ENV */
tPos = (afs_sfsize_t) Pos;
tLen = (afs_sfsize_t) Len;
#else /* AFS_64BIT_ENV */
&rights, &anyrights)))
goto Bad_BulkStatus;
/* set volume synchronization information, but only once per call */
- if (i == nfiles)
+ if (i == 0)
SetVolumeSync(Sync, volptr);
/* Are we allowed to fetch Fid's status? */
}
/* set volume synchronization information, but only once per call */
- if (i == nfiles)
+ if (i == 0)
SetVolumeSync(Sync, volptr);
/* Are we allowed to fetch Fid's status? */
afs_fsize_t tFileLength;
#ifdef AFS_64BIT_ENV
-#ifndef AFS_LARGEFILE_ENV
- if (FileLength > 0x7fffffff)
- return EFBIG;
-#endif /* !AFS_LARGEFILE_ENV */
tPos = (afs_fsize_t) Pos;
tLength = (afs_fsize_t) Length;
tFileLength = (afs_fsize_t) FileLength;
/* Actually create the New directory in the directory package */
SetDirHandle(&dir, targetptr);
- assert(!(MakeDir(&dir, OutFid, DirFid)));
+ assert(!(MakeDir(&dir, (afs_int32 *)OutFid, (afs_int32 *)DirFid)));
DFlush();
VN_SET_LEN(targetptr, (afs_fsize_t) Length(&dir));
dataBytes = 1 * sizeof(afs_int32);
dataBuffP = (afs_uint32 *) malloc(dataBytes);
dataBuffP[0] = VICED_CAPABILITY_ERRORTRANS | VICED_CAPABILITY_WRITELOCKACL;
-#if defined(AFS_64BIT_ENV) && defined(AFS_LARGEFILE_ENV)
+#if defined(AFS_64BIT_ENV)
dataBuffP[0] |= VICED_CAPABILITY_64BITFILES;
#endif
if (saneacls)
afs_int32 *vd, *addr;
Error errorCode = 0; /* return code to caller */
struct client *client = 0;
- struct rx_connection *tcon = rx_ConnectionOf(acall);
ViceLog(1, ("SRXAFS_FlushCPS\n"));
FS_LOCK;
Len = 0;
}
- if (Pos + Len > tlen)
- Len = tlen - Pos; /* get length we should send */
+ if (Pos + Len > tlen) /* get length we should send */
+ Len = ((tlen - Pos) < 0) ? 0 : tlen - Pos;
+
(void)FDH_SEEK(fdP, Pos, 0);
{
afs_int32 high, low;
if (Pos == 0) CopyOnWrite_off0++;
if (CoW_len > CopyOnWrite_maxsize) CopyOnWrite_maxsize = CoW_len;
- ViceLog(1, ("StoreData : calling CopyOnWrite on vnode %lu.%lu (%s) off 0x%llx size 0x%llx\n",
- V_id(volptr), targetptr->vnodeNumber, V_name(volptr), 0, Pos));
+ ViceLog(1, ("StoreData : calling CopyOnWrite on vnode %u.%u (%s) "
+ "off 0x0 size 0x%llx\n",
+ afs_printable_VolumeId_u(V_id(volptr)),
+ afs_printable_VnodeId_u(targetptr->vnodeNumber),
+ V_name(volptr), Pos));
if ((errorCode = CopyOnWrite(targetptr, volptr, 0, Pos))) {
ViceLog(25, ("StoreData : CopyOnWrite failed\n"));
volptr->partition->flags &= ~PART_DONTUPDATE;
#else /* AFS_NT40_ENV */
errorCode = rx_Readv(Call, tiov, &tnio, RX_MAXIOVECS, rlen);
#endif /* AFS_NT40_ENV */
-#if FS_STATS_DETAILED
- (*a_bytesStoredP) += errorCode;
-#endif /* FS_STATS_DETAILED */
if (errorCode <= 0) {
errorCode = -32;
break;
}
+#if FS_STATS_DETAILED
+ (*a_bytesStoredP) += errorCode;
+#endif /* FS_STATS_DETAILED */
rlen = errorCode;
#ifdef AFS_NT40_ENV
errorCode = FDH_WRITE(fdP, tbuffer, rlen);
if (origfdP) { /* finish CopyOnWrite */
if ( (CoW_off = Pos + Length) < NewLength) {
errorCode = CopyOnWrite2(origfdP, fdP, CoW_off, CoW_len = NewLength - CoW_off);
- ViceLog(1, ("StoreData : CopyOnWrite2 on vnode %lu.%lu (%s) off 0x%llx size 0x%llx returns %d\n",
- V_id(volptr), targetptr->vnodeNumber, V_name(volptr), CoW_off, CoW_len, errorCode));
+ ViceLog(1, ("StoreData : CopyOnWrite2 on vnode %u.%u (%s) "
+ "off 0x%llx size 0x%llx returns %d\n",
+ afs_printable_VolumeId_u(V_id(volptr)),
+ afs_printable_VnodeId_u(targetptr->vnodeNumber),
+ V_name(volptr), CoW_off, CoW_len, errorCode));
}
FDH_CLOSE(origfdP);
}
return 0;
if (in < 0 || in > 511)
return in;
- if (in >= VICE_SPECIAL_ERRORS && in <= VIO || in == VRESTRICTED)
+ if ((in >= VICE_SPECIAL_ERRORS && in <= VIO) || in == VRESTRICTED)
return in;
if (sys2et[in] != 0)
return sys2et[in];