summaryrefslogtreecommitdiffstats
path: root/api/src/glfs-handleops.c
diff options
context:
space:
mode:
authorSoumya Koduri <skoduri@redhat.com>2018-04-27 15:12:08 +0530
committerPoornima G <pgurusid@redhat.com>2018-05-04 17:12:19 +0000
commitb04066721bf4a240f61b83bd87bbb27437c5fe4f (patch)
treedd1a4c7dcfe372f3182e51a5d8f1dba6af82ea94 /api/src/glfs-handleops.c
parentb42a048d3a76c7f377399f18d30f0a8a930f9d05 (diff)
gfapi : RECALL_LEASE implementation
Right now there are two types of upcalls * poll method * registering callback But callback can be registered per fs and same callback fn shall be used for any lease recall with object handle as argument as done for cache invalidation. TODO: RECALL LEASE for each glfd (for future reference) (may be needed fo Samba as they do not deal with object handles. In case of RECALL_LEASE, we could associate separate cbk function for each glfd either by - extending pub_glfs_lease to accept new args (recall_cbk_fn, cookie) - or by defining new API "glfs_register_recall_cbk_fn (glfd, recall_cbk_fn, cookie) . In such cases, flag it and instead of calling below upcall functions, define a new one to go through the glfd list and invoke each of theirs recall_cbk_fn. Plus added following as well * passed lease id to dict in required arguments * added flag check in pub_glfs_open Updates: #350 Change-Id: I07a971f0f26ec6aae0b9f9a5613504317dee153b Signed-off-by: Soumya Koduri <skoduri@redhat.com> Signed-off-by: Poornima G <pgurusid@redhat.com> Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
Diffstat (limited to 'api/src/glfs-handleops.c')
-rw-r--r--api/src/glfs-handleops.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/api/src/glfs-handleops.c b/api/src/glfs-handleops.c
index f8193408ec0..cb37de30e4a 100644
--- a/api/src/glfs-handleops.c
+++ b/api/src/glfs-handleops.c
@@ -622,6 +622,7 @@ pub_glfs_h_open (struct glfs *fs, struct glfs_object *object, int flags)
xlator_t *subvol = NULL;
inode_t *inode = NULL;
loc_t loc = {0, };
+ dict_t *fop_attr = NULL;
/* validate in args */
if ((fs == NULL) || (object == NULL)) {
@@ -678,6 +679,10 @@ pub_glfs_h_open (struct glfs *fs, struct glfs_object *object, int flags)
GLFS_LOC_FILL_INODE (inode, loc, out);
/* fop/op */
+ ret = get_fop_attr_thrd_key (&fop_attr);
+ if (ret)
+ gf_msg_debug ("gfapi", 0, "Getting leaseid from thread failed");
+
ret = syncop_open (subvol, &loc, flags, glfd->fd, NULL, NULL);
DECODE_SYNCOP_ERR (ret);
@@ -688,6 +693,8 @@ out:
if (inode)
inode_unref (inode);
+ if (fop_attr)
+ dict_unref (fop_attr);
if (ret && glfd) {
GF_REF_PUT (glfd);