diff options
Diffstat (limited to 'rpc')
-rw-r--r-- | rpc/xdr/src/glusterfs3.h | 44 |
1 files changed, 29 insertions, 15 deletions
diff --git a/rpc/xdr/src/glusterfs3.h b/rpc/xdr/src/glusterfs3.h index b1d43f95e87..5e1f516457b 100644 --- a/rpc/xdr/src/glusterfs3.h +++ b/rpc/xdr/src/glusterfs3.h @@ -325,23 +325,24 @@ gf_stat_from_iatt (struct gf_iatt *gf_stat, struct iatt *iatt) gf_stat->ia_ctime_nsec = iatt->ia_ctime_nsec ; } -static inline void -gf_proto_cache_invalidation_from_upcall (gfs3_cbk_cache_invalidation_req *gf_c_req, +static inline int +gf_proto_cache_invalidation_from_upcall (xlator_t *this, + gfs3_cbk_cache_invalidation_req *gf_c_req, struct gf_upcall *gf_up_data) { struct gf_upcall_cache_invalidation *gf_c_data = NULL; int is_cache_inval = 0; int ret = -1; - GF_VALIDATE_OR_GOTO(THIS->name, gf_c_req, out); - GF_VALIDATE_OR_GOTO(THIS->name, gf_up_data, out); + GF_VALIDATE_OR_GOTO(this->name, gf_c_req, out); + GF_VALIDATE_OR_GOTO(this->name, gf_up_data, out); is_cache_inval = ((gf_up_data->event_type == GF_UPCALL_CACHE_INVALIDATION) ? 1 : 0); - GF_VALIDATE_OR_GOTO(THIS->name, is_cache_inval, out); + GF_VALIDATE_OR_GOTO(this->name, is_cache_inval, out); gf_c_data = (struct gf_upcall_cache_invalidation *)gf_up_data->data; - GF_VALIDATE_OR_GOTO(THIS->name, gf_c_data, out); + GF_VALIDATE_OR_GOTO(this->name, gf_c_data, out); gf_c_req->gfid = uuid_utoa (gf_up_data->gfid); gf_c_req->event_type = gf_up_data->event_type; @@ -351,29 +352,35 @@ gf_proto_cache_invalidation_from_upcall (gfs3_cbk_cache_invalidation_req *gf_c_r gf_stat_from_iatt (&gf_c_req->parent_stat, &gf_c_data->p_stat); gf_stat_from_iatt (&gf_c_req->oldparent_stat, &gf_c_data->oldp_stat); + ret = 0; + GF_PROTOCOL_DICT_SERIALIZE (this, gf_c_data->dict, &(gf_c_req->xdata).xdata_val, + (gf_c_req->xdata).xdata_len, ret, out); + if (ret > 0) + ret = -ret; out: - return; + return ret; } -static inline void -gf_proto_cache_invalidation_to_upcall (gfs3_cbk_cache_invalidation_req *gf_c_req, +static inline int +gf_proto_cache_invalidation_to_upcall (xlator_t *this, + gfs3_cbk_cache_invalidation_req *gf_c_req, struct gf_upcall *gf_up_data) { struct gf_upcall_cache_invalidation *gf_c_data = NULL; int ret = -1; - GF_VALIDATE_OR_GOTO(THIS->name, gf_c_req, out); - GF_VALIDATE_OR_GOTO(THIS->name, gf_up_data, out); + GF_VALIDATE_OR_GOTO(this->name, gf_c_req, out); + GF_VALIDATE_OR_GOTO(this->name, gf_up_data, out); gf_c_data = (struct gf_upcall_cache_invalidation *)gf_up_data->data; - GF_VALIDATE_OR_GOTO(THIS->name, gf_c_data, out); + GF_VALIDATE_OR_GOTO(this->name, gf_c_data, out); ret = gf_uuid_parse (gf_c_req->gfid, gf_up_data->gfid); if (ret) { - gf_log (THIS->name, GF_LOG_WARNING, "gf_uuid_parse(%s) failed", + gf_log (this->name, GF_LOG_WARNING, "gf_uuid_parse(%s) failed", gf_c_req->gfid); gf_up_data->event_type = GF_UPCALL_EVENT_NULL; - return; + goto out; } gf_up_data->event_type = gf_c_req->event_type; @@ -384,7 +391,14 @@ gf_proto_cache_invalidation_to_upcall (gfs3_cbk_cache_invalidation_req *gf_c_req gf_stat_to_iatt (&gf_c_req->parent_stat, &gf_c_data->p_stat); gf_stat_to_iatt (&gf_c_req->oldparent_stat, &gf_c_data->oldp_stat); + ret = 0; + GF_PROTOCOL_DICT_UNSERIALIZE (this, gf_c_data->dict, + (gf_c_req->xdata).xdata_val, + (gf_c_req->xdata).xdata_len, ret, + ret, out); + if (ret > 0) + ret = -ret; out: - return; + return ret; } #endif /* !_GLUSTERFS3_H */ |