From dc1258bfe46d30059119a3294285a114ec2bcd36 Mon Sep 17 00:00:00 2001 From: Poornima G Date: Sat, 18 Nov 2017 15:19:13 +0530 Subject: libglusterfs: Add put fop Problem: It had been a longtime request to implement put fop in gluster. put fop in gluster may not have the exact sementics of HTTP PUT, but can be easily extended to do so. The subsequent patches, will contain more semantics on the put fop and its guarentees. Why compound fop framework is not used for put? Compound fop framework currently doesn't allow compounding of entry fop and inode fops, i.e. fops on multiple inodes cannot be combined in compound fop. Updates #353 Change-Id: Idb7891b3e056d46d570bb7e31bad1b6a28656ada Signed-off-by: Poornima G --- libglusterfs/src/cluster-syncop.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'libglusterfs/src/cluster-syncop.c') diff --git a/libglusterfs/src/cluster-syncop.c b/libglusterfs/src/cluster-syncop.c index 50542eb7c16..aa9cea75ba3 100644 --- a/libglusterfs/src/cluster-syncop.c +++ b/libglusterfs/src/cluster-syncop.c @@ -303,6 +303,18 @@ cluster_writev_cbk (call_frame_t *frame, void *cookie, xlator_t *this, } +int32_t +cluster_put_cbk (call_frame_t *frame, void *cookie, xlator_t *this, + int32_t op_ret, int32_t op_errno, inode_t *inode, + struct iatt *buf, struct iatt *preparent, + struct iatt *postparent, dict_t *xdata) +{ + FOP_CBK (put, frame, cookie, op_ret, op_errno, inode, buf, preparent, + postparent, xdata); + return 0; +} + + int32_t cluster_flush_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, @@ -685,6 +697,20 @@ cluster_writev (xlator_t **subvols, unsigned char *on, int numsubvols, return cluster_fop_success_fill (replies, numsubvols, output); } +int32_t +cluster_put (xlator_t **subvols, unsigned char *on, int numsubvols, + default_args_cbk_t *replies, unsigned char *output, + call_frame_t *frame, xlator_t *this, loc_t *loc, + mode_t mode, mode_t umask, uint32_t flags, struct iovec *vector, + int32_t count, off_t offset, struct iobref *iobref, dict_t *xattr, + dict_t *xdata) +{ + FOP_ONLIST (subvols, on, numsubvols, replies, output, frame, put, loc, + mode, umask, flags, vector, count, offset, iobref, xattr, + xdata); + return cluster_fop_success_fill (replies, numsubvols, output); +} + int32_t cluster_readv (xlator_t **subvols, unsigned char *on, int numsubvols, default_args_cbk_t *replies, unsigned char *output, -- cgit