summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/syncop.c
diff options
context:
space:
mode:
authorRaghavendra G <rgowdapp@redhat.com>2018-02-13 09:09:39 +0530
committerRaghavendra G <rgowdapp@redhat.com>2018-02-13 12:14:17 +0530
commitadb266baa16f807745102ba925aa8a1028f8580a (patch)
tree0499ef28408d9a5072bfb0b02c803a7ee66db8b7 /libglusterfs/src/syncop.c
parente67cd078c5fea1026838d5197f8773c82e29425c (diff)
libglusterfs/syncop: Add syncop_entrylk
Change-Id: Idd86b9f0fa144c2316ab6276e2def28b696ae18a BUG: 1543279 Signed-off-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'libglusterfs/src/syncop.c')
-rw-r--r--libglusterfs/src/syncop.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/libglusterfs/src/syncop.c b/libglusterfs/src/syncop.c
index 202b3aba4ab..5cae4fbb3a0 100644
--- a/libglusterfs/src/syncop.c
+++ b/libglusterfs/src/syncop.c
@@ -3104,6 +3104,43 @@ syncop_inodelk (xlator_t *subvol, const char *volume, loc_t *loc, int32_t cmd,
}
int32_t
+syncop_entrylk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, dict_t *xdata)
+{
+ struct syncargs *args = NULL;
+
+ args = cookie;
+ args->op_ret = op_ret;
+ args->op_errno = op_errno;
+ if (xdata)
+ args->xdata = dict_ref (xdata);
+
+ __wake (args);
+ return 0;
+}
+
+int
+syncop_entrylk (xlator_t *subvol, const char *volume, loc_t *loc,
+ const char *basename, entrylk_cmd cmd, entrylk_type type,
+ dict_t *xdata_in, dict_t **xdata_out)
+{
+ struct syncargs args = {0, };
+
+ SYNCOP (subvol, (&args), syncop_entrylk_cbk, subvol->fops->entrylk,
+ volume, loc, basename, cmd, type, xdata_in);
+
+ if (xdata_out)
+ *xdata_out = args.xdata;
+ else if (args.xdata)
+ dict_unref (args.xdata);
+
+ if (args.op_ret < 0)
+ return -args.op_errno;
+
+ return args.op_ret;
+}
+
+int32_t
syncop_xattrop_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno, dict_t *dict,
dict_t *xdata)