Skip to content

Commit 51c8a54

Browse files
committed
kvs: refactor lookup_common to take kvs ctx
Problem: In the near future the kvs ctx will be needed by callers to lookup_common(). Have callers to lookup_common() pass the kvs ctx as a parameter instead of the void * arg.
1 parent ab4b1a3 commit 51c8a54

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/modules/kvs/kvs.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1273,11 +1273,10 @@ static void lookup_wait_error_cb (wait_t *w, int errnum, void *arg)
12731273
}
12741274

12751275
static lookup_t *lookup_common (flux_t *h, flux_msg_handler_t *mh,
1276-
const flux_msg_t *msg, void *arg,
1276+
const flux_msg_t *msg, struct kvs_ctx *ctx,
12771277
flux_msg_handler_f replay_cb,
12781278
bool *stall)
12791279
{
1280-
struct kvs_ctx *ctx = arg;
12811280
int flags;
12821281
const char *ns = NULL;
12831282
const char *key;
@@ -1431,11 +1430,12 @@ static lookup_t *lookup_common (flux_t *h, flux_msg_handler_t *mh,
14311430
static void lookup_request_cb (flux_t *h, flux_msg_handler_t *mh,
14321431
const flux_msg_t *msg, void *arg)
14331432
{
1433+
struct kvs_ctx *ctx = arg;
14341434
lookup_t *lh;
14351435
json_t *val;
14361436
bool stall = false;
14371437

1438-
if (!(lh = lookup_common (h, mh, msg, arg, lookup_request_cb,
1438+
if (!(lh = lookup_common (h, mh, msg, ctx, lookup_request_cb,
14391439
&stall))) {
14401440
if (stall)
14411441
return;
@@ -1467,13 +1467,14 @@ static void lookup_request_cb (flux_t *h, flux_msg_handler_t *mh,
14671467
static void lookup_plus_request_cb (flux_t *h, flux_msg_handler_t *mh,
14681468
const flux_msg_t *msg, void *arg)
14691469
{
1470+
struct kvs_ctx *ctx = arg;
14701471
lookup_t *lh;
14711472
json_t *val = NULL;
14721473
const char *root_ref;
14731474
int root_seq;
14741475
bool stall = false;
14751476

1476-
if (!(lh = lookup_common (h, mh, msg, arg, lookup_plus_request_cb,
1477+
if (!(lh = lookup_common (h, mh, msg, ctx, lookup_plus_request_cb,
14771478
&stall))) {
14781479
if (stall)
14791480
return;

0 commit comments

Comments
 (0)