a3470f
From 87fd48e99d6b3556aba0c4f1485b06334b8cc1cf Mon Sep 17 00:00:00 2001
a3470f
From: Raghavendra G <rgowdapp@redhat.com>
a3470f
Date: Wed, 9 May 2018 14:57:35 +0530
a3470f
Subject: [PATCH 261/271] libglusterfs/syncop: Add syncop_entrylk
a3470f
a3470f
>Change-Id: Idd86b9f0fa144c2316ab6276e2def28b696ae18a
a3470f
>BUG: 1543279
a3470f
>Signed-off-by: Raghavendra G <rgowdapp@redhat.com>
a3470f
a3470f
upstream patch: https://review.gluster.org/#/c/19556/
a3470f
BUG: 1488120
a3470f
Change-Id: I02e546bcb012545dcdaa70ea26046db05b5032f4
a3470f
Signed-off-by: Raghavendra G <rgowdapp@redhat.com>
a3470f
Reviewed-on: https://code.engineering.redhat.com/gerrit/138169
a3470f
Tested-by: RHGS Build Bot <nigelb@redhat.com>
a3470f
Reviewed-by: Nithya Balachandran <nbalacha@redhat.com>
a3470f
---
a3470f
 libglusterfs/src/syncop.c | 37 +++++++++++++++++++++++++++++++++++++
a3470f
 libglusterfs/src/syncop.h |  5 +++++
a3470f
 2 files changed, 42 insertions(+)
a3470f
a3470f
diff --git a/libglusterfs/src/syncop.c b/libglusterfs/src/syncop.c
a3470f
index b36c88d..ac40a1d 100644
a3470f
--- a/libglusterfs/src/syncop.c
a3470f
+++ b/libglusterfs/src/syncop.c
a3470f
@@ -3019,6 +3019,43 @@ syncop_inodelk (xlator_t *subvol, const char *volume, loc_t *loc, int32_t cmd,
a3470f
 }
a3470f
 
a3470f
 int32_t
a3470f
+syncop_entrylk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
a3470f
+		    int32_t op_ret, int32_t op_errno, dict_t *xdata)
a3470f
+{
a3470f
+        struct syncargs *args = NULL;
a3470f
+
a3470f
+        args = cookie;
a3470f
+        args->op_ret = op_ret;
a3470f
+        args->op_errno = op_errno;
a3470f
+        if (xdata)
a3470f
+                args->xdata = dict_ref (xdata);
a3470f
+
a3470f
+        __wake (args);
a3470f
+        return 0;
a3470f
+}
a3470f
+
a3470f
+int
a3470f
+syncop_entrylk (xlator_t *subvol, const char *volume, loc_t *loc,
a3470f
+                const char *basename, entrylk_cmd cmd, entrylk_type type,
a3470f
+                dict_t *xdata_in, dict_t **xdata_out)
a3470f
+{
a3470f
+        struct syncargs args = {0, };
a3470f
+
a3470f
+        SYNCOP (subvol, (&args), syncop_entrylk_cbk, subvol->fops->entrylk,
a3470f
+                volume, loc, basename, cmd, type, xdata_in);
a3470f
+
a3470f
+        if (xdata_out)
a3470f
+                *xdata_out = args.xdata;
a3470f
+        else if (args.xdata)
a3470f
+                dict_unref (args.xdata);
a3470f
+
a3470f
+        if (args.op_ret < 0)
a3470f
+                return -args.op_errno;
a3470f
+
a3470f
+        return args.op_ret;
a3470f
+}
a3470f
+
a3470f
+int32_t
a3470f
 syncop_xattrop_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
a3470f
                     int32_t op_ret, int32_t op_errno, dict_t *dict,
a3470f
                     dict_t *xdata)
a3470f
diff --git a/libglusterfs/src/syncop.h b/libglusterfs/src/syncop.h
a3470f
index a9cdee1..5b5ad4e 100644
a3470f
--- a/libglusterfs/src/syncop.h
a3470f
+++ b/libglusterfs/src/syncop.h
a3470f
@@ -562,4 +562,9 @@ syncop_setactivelk (xlator_t *subvol, loc_t *loc,
a3470f
                      lock_migration_info_t *locklist,  dict_t *xdata_in,
a3470f
                      dict_t **xdata_out);
a3470f
 
a3470f
+int
a3470f
+syncop_entrylk (xlator_t *subvol, const char *volume, loc_t *loc,
a3470f
+                const char *basename, entrylk_cmd cmd, entrylk_type type,
a3470f
+                dict_t *xdata_in, dict_t **xdata_out);
a3470f
+
a3470f
 #endif /* _SYNCOP_H */
a3470f
-- 
a3470f
1.8.3.1
a3470f