Skip to content

Commit

Permalink
Merge pull request #1116 from garlick/kvs_misc
Browse files Browse the repository at this point in the history
KVS lua refcount fix, drop unused deprecated functions
  • Loading branch information
grondo authored Jul 20, 2017
2 parents 3bd59f3 + 2872e39 commit 0673cf2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 32 deletions.
2 changes: 1 addition & 1 deletion src/bindings/lua/flux-lua.c
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,7 @@ static int kvswatch_cb_common (const char *key, kvsdir_t *dir,
assert (lua_isuserdata (L, -1));

if (dir) {
lua_push_kvsdir (L, dir);
lua_push_kvsdir_external (L, dir); // take a reference
lua_pushnil (L);
}
else if (val) {
Expand Down
24 changes: 0 additions & 24 deletions src/common/libkvs/kvs_classic.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,22 +242,6 @@ int kvs_put_int64 (flux_t *h, const char *key, int64_t val)
return flux_kvs_txn_pack (txn, 0, key, "I", val);
}

int kvs_put_double (flux_t *h, const char *key, double val)
{
flux_kvs_txn_t *txn = get_default_txn (h);
if (!txn)
return -1;
return flux_kvs_txn_pack (txn, 0, key, "f", val);
}

int kvs_put_boolean (flux_t *h, const char *key, bool val)
{
flux_kvs_txn_t *txn = get_default_txn (h);
if (!txn)
return -1;
return flux_kvs_txn_pack (txn, 0, key, "b", (int)val);
}

int kvs_unlink (flux_t *h, const char *key)
{
flux_kvs_txn_t *txn = get_default_txn (h);
Expand All @@ -282,14 +266,6 @@ int kvs_mkdir (flux_t *h, const char *key)
return flux_kvs_txn_mkdir (txn, 0, key);
}

int kvs_put_treeobj (flux_t *h, const char *key, const char *treeobj)
{
flux_kvs_txn_t *txn = get_default_txn (h);
if (!txn)
return -1;
return flux_kvs_txn_put (txn, FLUX_KVS_TREEOBJ, key, treeobj);
}

int kvs_copy (flux_t *h, const char *from, const char *to)
{
flux_kvs_txn_t *txn = get_default_txn (h);
Expand Down
3 changes: 0 additions & 3 deletions src/common/libkvs/kvs_classic.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,9 @@ int kvs_put (flux_t *h, const char *key, const char *json_str);
int kvs_put_string (flux_t *h, const char *key, const char *val);
int kvs_put_int (flux_t *h, const char *key, int val);
int kvs_put_int64 (flux_t *h, const char *key, int64_t val);
int kvs_put_double (flux_t *h, const char *key, double val);
int kvs_put_boolean (flux_t *h, const char *key, bool val);
int kvs_unlink (flux_t *h, const char *key);
int kvs_symlink (flux_t *h, const char *key, const char *target);
int kvs_mkdir (flux_t *h, const char *key);
int kvs_put_treeobj (flux_t *h, const char *key, const char *treeobj);
int kvs_copy (flux_t *h, const char *from, const char *to);
int kvs_move (flux_t *h, const char *from, const char *to);

Expand Down
12 changes: 8 additions & 4 deletions t/kvs/basic.c
Original file line number Diff line number Diff line change
Expand Up @@ -748,10 +748,14 @@ void cmd_put_treeobj (flux_t *h, int argc, char **argv)
if (!val)
log_msg_exit ("put-treeobj: you must specify a value as key=val");
*val++ = '\0';
if (kvs_put_treeobj (h, key, val) < 0)
log_err_exit ("kvs_put_treeobj %s=%s", key, val);
if (kvs_commit (h, 0) < 0)
log_err_exit ("kvs_commit");
flux_kvs_txn_t *txn;
if (!(txn = flux_kvs_txn_create ()))
log_err_exit ("flux_kvs_txn_create");
if (flux_kvs_txn_put (txn, FLUX_KVS_TREEOBJ, key, val) < 0)
log_err_exit ("flux_kvs_txn_put %s=%s", key, val);
if (flux_kvs_commit (h, 0, txn) < 0)
log_err_exit ("flux_kvs_commit");
flux_kvs_txn_destroy (txn);
free (key);
}

Expand Down

0 comments on commit 0673cf2

Please sign in to comment.