summaryrefslogtreecommitdiffstats
path: root/libglusterfs
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
parente67cd078c5fea1026838d5197f8773c82e29425c (diff)
libglusterfs/syncop: Add syncop_entrylk
Change-Id: Idd86b9f0fa144c2316ab6276e2def28b696ae18a BUG: 1543279 Signed-off-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/libglusterfs.sym1
-rw-r--r--libglusterfs/src/syncop.c37
-rw-r--r--libglusterfs/src/syncop.h5
3 files changed, 43 insertions, 0 deletions
diff --git a/libglusterfs/src/libglusterfs.sym b/libglusterfs/src/libglusterfs.sym
index 41231fc90d1..39f03cbfa44 100644
--- a/libglusterfs/src/libglusterfs.sym
+++ b/libglusterfs/src/libglusterfs.sym
@@ -938,6 +938,7 @@ syncop_getxattr
syncop_gfid_to_path
syncop_inode_find
syncop_inodelk
+syncop_entrylk
syncop_ipc
syncop_is_subvol_local
syncop_link
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)
diff --git a/libglusterfs/src/syncop.h b/libglusterfs/src/syncop.h
index 7d3afa823e3..682191f0243 100644
--- a/libglusterfs/src/syncop.h
+++ b/libglusterfs/src/syncop.h
@@ -582,4 +582,9 @@ syncop_icreate (xlator_t *subvol, loc_t *loc, mode_t mode, dict_t *xdata_out);
int
syncop_namelink (xlator_t *subvol, loc_t *loc, dict_t *xdata_out);
+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);
+
#endif /* _SYNCOP_H */