From: Liu Yuan <[email protected]>

The caller of object_cache_read/write() can handle the 'NO_CACHE' case
gracefully.

Signed-off-by: Liu Yuan <[email protected]>
---
 sheep/object_cache.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sheep/object_cache.c b/sheep/object_cache.c
index 1f3e631..00876c1 100644
--- a/sheep/object_cache.c
+++ b/sheep/object_cache.c
@@ -1087,7 +1087,7 @@ int object_cache_write(uint64_t oid, char *data, unsigned 
int datalen,
 
        entry = get_cache_entry(cache, idx);
        if (!entry) {
-               panic("cache object %" PRIx32 " doesn't exist\n", idx);
+               dprintf("cache object %" PRIx32 " doesn't exist\n", idx);
                return SD_RES_NO_CACHE;
        }
 
@@ -1115,7 +1115,7 @@ int object_cache_read(uint64_t oid, char *data, unsigned 
int datalen,
 
        entry = get_cache_entry(cache, idx);
        if (!entry) {
-               panic("cache object %" PRIx32 " doesn't exist\n", idx);
+               dprintf("cache object %" PRIx32 " doesn't exist\n", idx);
                return SD_RES_NO_CACHE;
        }
 
-- 
1.7.10.2

-- 
sheepdog mailing list
[email protected]
http://lists.wpkg.org/mailman/listinfo/sheepdog

Reply via email to