Skip to content

Commit

Permalink
modules/kvs: Cleanup load() function
Browse files Browse the repository at this point in the history
Remove confusing logic behind stall variable.
  • Loading branch information
chu11 committed May 18, 2017
1 parent 583c8ec commit 9591f2c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/modules/kvs/kvs.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,10 @@ static int content_load_request_send (kvs_ctx_t *ctx, const href_t ref, bool now
return -1;
}

/* Return true if load successful, false if stalling */
static bool load (kvs_ctx_t *ctx, const href_t ref, wait_t *wait, json_object **op)
{
struct cache_entry *hp = cache_lookup (ctx->cache, ref, ctx->epoch);
bool stall = false;

/* Create an incomplete hash entry if none found.
*/
Expand All @@ -249,12 +249,12 @@ static bool load (kvs_ctx_t *ctx, const href_t ref, wait_t *wait, json_object **
*/
if (!cache_entry_get_valid (hp)) {
cache_entry_wait_valid (hp, wait);
stall = true;
return false;
}

if (!stall && op)
if (op)
*op = cache_entry_get_json (hp);
return !stall;
return true;
}

static int content_store_get (flux_rpc_t *rpc, void *arg)
Expand Down

0 comments on commit 9591f2c

Please sign in to comment.