summaryrefslogtreecommitdiffstats
path: root/api/src
diff options
context:
space:
mode:
authorSoumya Koduri <skoduri@redhat.com>2015-03-24 10:30:31 +0530
committerKaleb KEITHLEY <kkeithle@redhat.com>2015-03-31 11:16:26 -0700
commit25f97b2788a33efcb0714ad639f8db380b864982 (patch)
tree9720bdd09e04239dcd75bdb88ddc97623ec6fb44 /api/src
parente6f5ace08ad0a068cb49d3ca1274a27aa031992b (diff)
Upcall: Added xlator options to enable cache-invalidation
Added two xlator options to enable cache-invalidation and set cache-invalidation-timeout. In addition, made few minor changes in the upcall processing code in gfapi. Change-Id: Ie0b32ca8348e34e3fe4f1e7df30cc925fa4aad31 BUG: 1200271 Signed-off-by: Soumya Koduri <skoduri@redhat.com> Reviewed-on: http://review.gluster.org/9975 Reviewed-by: Meghana M <mmadhusu@redhat.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'api/src')
-rw-r--r--api/src/glfs-handleops.c23
-rw-r--r--api/src/glfs-handles.h11
2 files changed, 16 insertions, 18 deletions
diff --git a/api/src/glfs-handleops.c b/api/src/glfs-handleops.c
index e60bb8e1317..d42e0354268 100644
--- a/api/src/glfs-handleops.c
+++ b/api/src/glfs-handleops.c
@@ -1618,15 +1618,14 @@ GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_rename, 3.4.2);
* This API is used to poll for upcall events stored in the
* upcall list. Current users of this API is NFS-Ganesha.
* Incase of any event received, it will be mapped appropriately
- * into 'callback_arg' along with the handle to be passed to
- * NFS-Ganesha.
+ * into 'callback_arg' along with the handle object to be passed
+ * to NFS-Ganesha.
*
- * Application is responsible for allocating and passing the
- * references of all the pointers except for "glhandle".
- * After processing the event, it needs to free "glhandle"
+ * On success, applications need to check for 'object' to decide
+ * if any upcall event is received.
*
- * TODO: there should be a glfs api to destroy these handles,
- * maybe "glfs_destroy_object" to free the object.
+ * After processing the event, they need to free "object"
+ * using glfs_h_close(..).
*
* Also similar to I/Os, the application should ideally stop polling
* before calling glfs_fini(..). Hence making an assumption that
@@ -1635,7 +1634,7 @@ GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_rename, 3.4.2);
int
pub_glfs_h_poll_upcall (struct glfs *fs, struct callback_arg *up_arg)
{
- struct glfs_object *handle = NULL;
+ struct glfs_object *object = NULL;
uuid_t gfid;
upcall_entry *u_list = NULL;
upcall_entry *tmp = NULL;
@@ -1660,7 +1659,7 @@ pub_glfs_h_poll_upcall (struct glfs *fs, struct callback_arg *up_arg)
goto err;
}
- up_arg->handle = NULL;
+ up_arg->object = NULL;
/* Ideally applications should stop polling before calling
* 'glfs_fini'. Yet cross check if cleanup has started
@@ -1692,11 +1691,11 @@ pub_glfs_h_poll_upcall (struct glfs *fs, struct callback_arg *up_arg)
pthread_mutex_unlock (&fs->upcall_list_mutex);
if (found) {
- handle = glfs_h_create_from_handle (fs, gfid,
+ object = glfs_h_create_from_handle (fs, gfid,
GFAPI_HANDLE_LENGTH,
&up_arg->buf);
- if (!handle) {
+ if (!object) {
errno = ENOMEM;
goto out;
}
@@ -1718,7 +1717,7 @@ pub_glfs_h_poll_upcall (struct glfs *fs, struct callback_arg *up_arg)
break;
}
- up_arg->handle = handle;
+ up_arg->object = object;
up_arg->reason = reason;
up_arg->flags = u_list->flags;
up_arg->expire_time_attr = u_list->expire_time_attr;
diff --git a/api/src/glfs-handles.h b/api/src/glfs-handles.h
index a939aa0df54..5ab0799423d 100644
--- a/api/src/glfs-handles.h
+++ b/api/src/glfs-handles.h
@@ -102,17 +102,16 @@ typedef struct glfs_object glfs_object_t;
* Applications (currently NFS-Ganesha) can make use of this
* structure to read upcall notifications sent by server.
*
- * They are responsible for allocating and passing the references
- * of all the pointers except for "handle".
+ * On success, applications need to check for 'object' to decide
+ * if any upcall event is received.
*
- * After processing the event, they need to free "handle"
- * TODO: there should be a glfs api to destroy these handles,
- * maybe "glfs_destroy_object" to free the object.
+ * After processing the event, they need to free "object"
+ * using glfs_h_close(..).
*/
struct callback_arg {
struct glfs *fs; /* glfs object */
int reason; /* Upcall event type */
- struct glfs_object *handle; /* Handle which need to be acted upon */
+ struct glfs_object *object; /* Object which need to be acted upon */
int flags; /* Cache UPDATE/INVALIDATE flags */
struct stat buf; /* Latest stat of this entry */
unsigned int expire_time_attr; /* the amount of time for which