From 6562656f69dae5a7c9251ae86e12a1a45dbfd7f9 Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Sun, 26 Apr 2015 10:40:18 +0530 Subject: syncop: Implement syncop_fxattrop Backport of http://review.gluster.org/10382 BUG: 1216303 Change-Id: I4433002906efc6894b4ff8de8fefe8b7bc954dcf Signed-off-by: Pranith Kumar K Reviewed-on: http://review.gluster.org/10438 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- libglusterfs/src/syncop.c | 20 ++++++++++++++++++++ libglusterfs/src/syncop.h | 3 +++ 2 files changed, 23 insertions(+) (limited to 'libglusterfs') diff --git a/libglusterfs/src/syncop.c b/libglusterfs/src/syncop.c index c930193cb3c..9224abaeeed 100644 --- a/libglusterfs/src/syncop.c +++ b/libglusterfs/src/syncop.c @@ -2936,3 +2936,23 @@ syncop_xattrop (xlator_t *subvol, loc_t *loc, gf_xattrop_flags_t flags, return args.op_ret; } + +int +syncop_fxattrop (xlator_t *subvol, fd_t *fd, gf_xattrop_flags_t flags, + dict_t *dict, dict_t *xdata_in, dict_t **xdata_out) +{ + struct syncargs args = {0, }; + + SYNCOP (subvol, (&args), syncop_xattrop_cbk, subvol->fops->fxattrop, + fd, flags, dict, 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; +} diff --git a/libglusterfs/src/syncop.h b/libglusterfs/src/syncop.h index 4eebd56e5f8..f41706a9d37 100644 --- a/libglusterfs/src/syncop.h +++ b/libglusterfs/src/syncop.h @@ -509,4 +509,7 @@ int syncop_ipc (xlator_t *subvol, int op, dict_t *xdata_in, dict_t **xdata_out); int syncop_xattrop (xlator_t *subvol, loc_t *loc, gf_xattrop_flags_t flags, dict_t *dict, dict_t *xdata_in, dict_t **xdata_out); +int +syncop_fxattrop (xlator_t *subvol, fd_t *fd, gf_xattrop_flags_t flags, + dict_t *dict, dict_t *xdata_in, dict_t **xdata_out); #endif /* _SYNCOP_H */ -- cgit