summaryrefslogtreecommitdiffstats
path: root/xlators/features/upcall/src/upcall-internal.c
diff options
context:
space:
mode:
authorPoornima G <pgurusid@redhat.com>2015-12-16 05:45:03 -0500
committerPranith Kumar Karampuri <pkarampu@redhat.com>2016-05-19 02:28:07 -0700
commit8facd588f20ef8305b6f6b53da0f6d54d300093b (patch)
tree066a5c1d7f7bf4c56685be859ca5c256e4d8c1e8 /xlators/features/upcall/src/upcall-internal.c
parent005d18a623dc49397e2a83a7fb80607ae0a9aed9 (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 'xlators/features/upcall/src/upcall-internal.c')
-rw-r--r--xlators/features/upcall/src/upcall-internal.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/xlators/features/upcall/src/upcall-internal.c b/xlators/features/upcall/src/upcall-internal.c
index f9005df2ed7..f3c81aff15c 100644
--- a/xlators/features/upcall/src/upcall-internal.c
+++ b/xlators/features/upcall/src/upcall-internal.c
@@ -435,6 +435,16 @@ upcall_reaper_thread_init (xlator_t *this)
return ret;
}
+int
+up_filter_virtual_xattr (dict_t *d, char *k, data_t *v, void *tmp)
+{
+ if (is_virtual_xattr (k) == _gf_true) {
+ dict_del (d, k);
+ }
+
+ return 0;
+}
+
/*
* Given a client, first fetch upcall_entry_t from the inode_ctx client list.
* Later traverse through the client list of that upcall entry. If this client
@@ -448,7 +458,8 @@ upcall_reaper_thread_init (xlator_t *this)
void
upcall_cache_invalidate (call_frame_t *frame, xlator_t *this, client_t *client,
inode_t *inode, uint32_t flags, struct iatt *stbuf,
- struct iatt *p_stbuf, struct iatt *oldp_stbuf)
+ struct iatt *p_stbuf, struct iatt *oldp_stbuf,
+ dict_t *xattr)
{
upcall_client_t *up_client = NULL;
upcall_client_t *up_client_entry = NULL;
@@ -524,11 +535,12 @@ upcall_cache_invalidate (call_frame_t *frame, xlator_t *this, client_t *client,
* Also if the file is frequently accessed, set
* expire_time_attr to 0.
*/
- upcall_client_cache_invalidate(this,
+ upcall_client_cache_invalidate (this,
up_inode_ctx->gfid,
up_client_entry,
flags, stbuf,
- p_stbuf, oldp_stbuf);
+ p_stbuf, oldp_stbuf,
+ xattr);
}
if (!found) {
@@ -551,7 +563,7 @@ upcall_client_cache_invalidate (xlator_t *this, uuid_t gfid,
upcall_client_t *up_client_entry,
uint32_t flags, struct iatt *stbuf,
struct iatt *p_stbuf,
- struct iatt *oldp_stbuf)
+ struct iatt *oldp_stbuf, dict_t *xattr)
{
struct gf_upcall up_req = {0,};
struct gf_upcall_cache_invalidation ca_req = {0,};
@@ -577,6 +589,7 @@ upcall_client_cache_invalidate (xlator_t *this, uuid_t gfid,
ca_req.p_stat = *p_stbuf;
if (oldp_stbuf)
ca_req.oldp_stat = *oldp_stbuf;
+ ca_req.dict = xattr;
up_req.data = &ca_req;
up_req.event_type = GF_UPCALL_CACHE_INVALIDATION;
@@ -641,7 +654,7 @@ upcall_cache_forget (xlator_t *this, inode_t *inode, upcall_inode_ctx_t *up_inod
up_inode_ctx->gfid,
up_client_entry,
flags, NULL,
- NULL, NULL);
+ NULL, NULL, NULL);
}
}