From b3d9dcb855060a9e1cb5b2140983111030fab1a0 Mon Sep 17 00:00:00 2001 From: Felix Frank Date: Thu, 2 Jul 2009 09:02:50 +0200 Subject: [PATCH] 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 --- src/afs/afs_fetchstore.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) 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 { -- 2.39.5