From: Felix Frank Date: Thu, 2 Jul 2009 07:02:50 +0000 (+0200) Subject: Storeops beautifications. X-Git-Tag: openafs-devel-1_5_62~69 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=b3d9dcb855060a9e1cb5b2140983111030fab1a0;p=packages%2Fo%2Fopenafs.git Storeops beautifications. Things can be made a lot more readable in storeOps than in the monolithic StoreProc. Also shorten a panic message that is a bit gratuitous. Reviewed-on: http://gerrit.openafs.org/108 Tested-by: Derrick Brashear Reviewed-by: Derrick Brashear --- diff --git a/src/afs/afs_fetchstore.c b/src/afs/afs_fetchstore.c index 0f189aff1..07eea44f6 100644 --- a/src/afs/afs_fetchstore.c +++ b/src/afs/afs_fetchstore.c @@ -69,17 +69,22 @@ rxfs_storeMemPrepare(void *r, afs_uint32 size, afs_uint32 *tlen) afs_int32 rxfs_storeUfsRead(void *r, struct osi_file *tfile, afs_uint32 offset, - afs_uint32 tlen, afs_uint32 *got) + afs_uint32 tlen, afs_uint32 *bytesread) { + afs_int32 code; struct rxfs_storeVariables *v = (struct rxfs_storeVariables *)r; - *got = afs_osi_Read(tfile, -1, v->tbuffer, tlen); - if ((*got < 0) + *bytesread = 0; + code = afs_osi_Read(tfile, -1, v->tbuffer, tlen); + if (code < 0) + return EIO; + *bytesread = code; + if (code == tlen) + return 0; #if defined(KERNEL_HAVE_UERROR) - || (*got != tlen && getuerror()) -#endif - ) + if (getuerror()) return EIO; +#endif return 0; } @@ -457,7 +462,7 @@ afs_MemCacheFetchProc(register struct rx_call *acall, RX_MAXIOVECS); if (!tiov) { osi_Panic - ("afs_MemCacheFetchProc: osi_AllocSmallSpace for iovecs returned NULL\n"); + ("afs_MemCacheFetchProc: osi_AllocSmallSpace returned NULL\n"); } adc->validPos = abase; do {