tabled: use new cld api
PATCH 1/1 tabled: use new cld api
Signed-off-by Colin McCabe <[email protected]>
--- server/cldu.c | 21 +++++++++------------ 1 files changed, 9 insertions(+), 12 deletions(-)
server/cldu.c +9 -12
@@ -545,8 +545,8 @@ static int cldu_put_cb(struct cldc_call_opts *carg, enum cle_err_codes errc)static int cldu_get_1_cb (struct cldc_call_opts *carg,enum cle_err_codes errc) {struct cld_session *sp = carg->private; -const char *ptr; -int dir_len; +char *ptr; +size_t dir_len;int total_len, rec_len, name_len;char buf[65 ];
@@ -558,8 +558,7 @@ static int cldu_get_1_cb(struct cldc_call_opts *carg, enum cle_err_codes errc)if (debugging)applog (LOG_DEBUG ,"Known tabled nodes" ); - ptr = carg->u.get.buf; - dir_len = carg->u.get.size; +cldc_call_opts_get_data (carg, &ptr, &dir_len);while (dir_len) { name_len =GUINT16_FROM_LE (*(uint16_t *)ptr); rec_len = name_len +2 ;
@@ -670,8 +669,8 @@ static int cldu_get_x_cb(struct cldc_call_opts *carg, enum cle_err_codes errc)struct cld_session *sp = carg->private;struct cldc_call_opts copts;int rc; -const char *ptr; -int dir_len; +char *ptr; +size_t dir_len;int total_len, rec_len, name_len;char buf[65 ];
@@ -683,8 +682,7 @@ static int cldu_get_x_cb(struct cldc_call_opts *carg, enum cle_err_codes errc)if (debugging)applog (LOG_DEBUG ,"Known Chunk nodes" ); - ptr = carg->u.get.buf; - dir_len = carg->u.get.size; +cldc_call_opts_get_data (carg, &ptr, &dir_len);while (dir_len) { name_len =GUINT16_FROM_LE (*(uint16_t *)ptr); rec_len = name_len +2 ;
@@ -807,16 +805,15 @@ static int cldu_get_y_cb(struct cldc_call_opts *carg, enum cle_err_codes errc)struct cld_session *sp = carg->private;struct cldc_call_opts copts;int rc; -const char *ptr; -int len; +char *ptr; +size_t len;if (errc !=CLE_OK ) {applog (LOG_ERR ,"CLD get(%s) failed: %d" , sp->yfname, errc); goto close_and_next;/* spaghetti */ } - ptr = carg->u.get.buf; - len = carg->u.get.size; +cldc_call_opts_get_data (carg, &ptr, &len);stor_parse (sp->yfname, ptr, len); close_and_next:
Signature · 1 line
1.6.2.5
Quoted 1 line · Colin McCabe
Signed-off-by Colin McCabe<[email protected]>
A very similar patch is needed for chunkd's server/cldu.c... did my spam filter eat it?
Jeff
Hmm...I don't think chunkd needs a patch... at least at change a129ef0d5c. It doesn't touch carg->u.get.buf or carg->u.get.size, since it never calls cldc_get.
Colin
Quoted 12 lines · Jeff Garzik
Quoted 2 lines · Colin McCabe
Signed-off-by Colin McCabe<[email protected]>A very similar patch is needed for chunkd's
server/cldu.c... did my spam filter eat it?Jeff
Jeff Garzik
AppliedQuoted 4 lines · Colin McCabe
Signed-off-by Colin McCabe<[email protected]>--- server/cldu.c | 21 +++++++++------------ 1 files changed, 9 insertions(+), 12 deletions(-)
applied