diff options
author | Poornima G <pgurusid@redhat.com> | 2015-12-16 05:45:03 -0500 |
---|---|---|
committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2016-05-19 02:28:07 -0700 |
commit | 8facd588f20ef8305b6f6b53da0f6d54d300093b (patch) | |
tree | 066a5c1d7f7bf4c56685be859ca5c256e4d8c1e8 /rpc | |
parent | 005d18a623dc49397e2a83a7fb80607ae0a9aed9 (diff) |
upcall: pass dict with xattrs on xattr invalidation
In case of xattr invalidation, return a dict containing
the updated xattrs.
[ndevos: move chunks to change 12995 and only address the xattrs-dict here]
Change-Id: I8733f06a519a9a0f24be1bb4b2c38c9c9dce0ce2
BUG: 1211863
Signed-off-by: Poornima G <pgurusid@redhat.com>
Reviewed-on: http://review.gluster.org/12996
Smoke: Gluster Build System <jenkins@build.gluster.com>
CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Reviewed-by: soumya k <skoduri@redhat.com>
Tested-by: soumya k <skoduri@redhat.com>
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 */ |