From 9d8bbbb8f68a0c45bfbb2e891cdbd9b9a1121259 Mon Sep 17 00:00:00 2001 From: Poornima G Date: Thu, 25 Aug 2016 10:09:20 +0530 Subject: upcall: Mark the clients as accessed on readdirp entries Currently when a client performs a readdirp it is not stored in upcall, as one of the clients that have accessed the files. Hence, when any other client modifies the file, the client that had performed readdirp will not get any notifications. Fix this by adding the clients to upcall database when they perform readdirp. Change-Id: I7767f1e26bf1bd1f67702a6d01f8aa64526ccc46 BUG: 1369430 Signed-off-by: Poornima G Reviewed-on: http://review.gluster.org/15313 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: soumya k Reviewed-by: Niels de Vos --- xlators/features/upcall/src/upcall.c | 43 +++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) (limited to 'xlators') diff --git a/xlators/features/upcall/src/upcall.c b/xlators/features/upcall/src/upcall.c index c7b74ed3c29..2e1dd60187d 100644 --- a/xlators/features/upcall/src/upcall.c +++ b/xlators/features/upcall/src/upcall.c @@ -1303,6 +1303,47 @@ err: return 0; } +int32_t +up_readdirp_cbk (call_frame_t *frame, void *cookie, xlator_t *this, + int32_t op_ret, int32_t op_errno, gf_dirent_t *entries, + dict_t *xdata) +{ + client_t *client = NULL; + uint32_t flags = 0; + upcall_local_t *local = NULL; + gf_dirent_t *entry = NULL; + + EXIT_IF_UPCALL_OFF (this, out); + + client = frame->root->client; + local = frame->local; + + if ((op_ret < 0) || !local) { + goto out; + } + flags = UP_UPDATE_CLIENT; + upcall_cache_invalidate (frame, this, client, local->inode, flags, + NULL, NULL, NULL, NULL); + + /* upcall_cache_invalidate optimises, by not calling inode_ctx_get + * if local->upcall_inode_ctx is set. Hence before processing + * the readdir entries unset this */ + local->upcall_inode_ctx = NULL; + list_for_each_entry (entry, &entries->list, list) { + if (entry->inode == NULL) { + continue; + } + upcall_cache_invalidate (frame, this, client, entry->inode, + flags, &entry->d_stat, NULL, NULL, + NULL); + } + +out: + UPCALL_STACK_UNWIND (readdirp, frame, op_ret, op_errno, entries, xdata); + + return 0; +} + int32_t up_readdirp (call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, off_t off, dict_t *dict) @@ -1319,7 +1360,7 @@ up_readdirp (call_frame_t *frame, xlator_t *this, } out: - STACK_WIND (frame, up_readdir_cbk, + STACK_WIND (frame, up_readdirp_cbk, FIRST_CHILD(this), FIRST_CHILD(this)->fops->readdirp, fd, size, off, dict); -- cgit me='h' value='v3.1.1qa11'/>
diff options
context:
space:
mode:
authorPranith Kumar K <pranithk@gluster.com>2011-08-06 14:00:03 +0530
committerAnand Avati <avati@gluster.com>2011-08-06 06:33:52 -0700
commit0cf100b58c34b40eb7f35fa6913996539e0e3aa9 (patch)
tree982ed41c5c172f9d8e93054ab438ea3bec08b088 /mod_glusterfs/apache/1.3
parent4e116e2af014754e88170986820312e755617476 (diff)
LICENSE: s/GNU Affero General Public/GNU General Public/
Change-Id: I3914467611e573cccee0d22df93920cf1b2eb79f BUG: 3348 Reviewed-on: http://review.gluster.com/182 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@gluster.com>
Diffstat (limited to 'mod_glusterfs/apache/1.3')
-rw-r--r--mod_glusterfs/apache/1.3/src/mod_glusterfs.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/mod_glusterfs/apache/1.3/src/mod_glusterfs.c b/mod_glusterfs/apache/1.3/src/mod_glusterfs.c
index 80e5da85f2e..d0979471893 100644
--- a/mod_glusterfs/apache/1.3/src/mod_glusterfs.c
+++ b/mod_glusterfs/apache/1.3/src/mod_glusterfs.c
@@ -3,16 +3,16 @@
This file is part of GlusterFS.
GlusterFS is free software; you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published
+ it under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 3 of the License,
or (at your option) any later version.
GlusterFS is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Affero General Public License for more details.
+ General Public License for more details.
- You should have received a copy of the GNU Affero General Public License
+ You should have received a copy of the GNU General Public License
along with this program. If not, see
<http://www.gnu.org/licenses/>.
*/