diff options
| author | Raghavendra Talur <rtalur@redhat.com> | 2015-03-11 18:36:01 +0530 | 
|---|---|---|
| committer | Vijay Bellur <vbellur@redhat.com> | 2015-04-08 15:14:59 +0000 | 
| commit | 346e64e578573296028efa516cd93cfaf2b17b8f (patch) | |
| tree | 5858b85260226377f23358fbd227e63d44abea5d | |
| parent | 4f0c068d8fe2654f205202e129e673aaa9342c63 (diff) | |
libglusterfs/syncop: Add xdata to all syncop calls
This patch adds support for xdata in both the
request and response path of syncops.
Few calls like lookup already had the support;
have renamed variables in few places to maintain
uniformity.
xdata passed downwards is known as xdata_in
and xdata passed upwards is known as xdata_out.
There is an old patch by Jeff Darcy at
http://review.gluster.org/#/c/8769/3 which does the
same for some selected calls. It also brings in
xdata support at gfapi level.
xdata support at gfapi level would be introduced
in subsequent patches.
Change-Id: I340e94ebaf2a38e160e65bc30732e8fe1c532dcc
BUG: 1158621
Signed-off-by: Raghavendra Talur <rtalur@redhat.com>
Reviewed-on: http://review.gluster.org/9859
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
26 files changed, 784 insertions, 413 deletions
diff --git a/api/src/glfs-fops.c b/api/src/glfs-fops.c index 9d3fa17bf40..ba95e021ee2 100644 --- a/api/src/glfs-fops.c +++ b/api/src/glfs-fops.c @@ -127,7 +127,7 @@ retry:  	}          glfd->fd->flags = flags; -	ret = syncop_open (subvol, &loc, flags, glfd->fd); +	ret = syncop_open (subvol, &loc, flags, glfd->fd, NULL, NULL);          DECODE_SYNCOP_ERR (ret);  	ESTALE_RETRY (ret, errno, reval, &loc, retry); @@ -174,7 +174,7 @@ pub_glfs_close (struct glfs_fd *glfd)  		goto out;  	} -	ret = syncop_flush (subvol, fd); +	ret = syncop_flush (subvol, fd, NULL, NULL);          DECODE_SYNCOP_ERR (ret);  out:  	fs = glfd->fs; @@ -285,7 +285,7 @@ pub_glfs_fstat (struct glfs_fd *glfd, struct stat *stat)  		goto out;  	} -	ret = syncop_fstat (subvol, fd, &iatt); +	ret = syncop_fstat (subvol, fd, &iatt, NULL, NULL);          DECODE_SYNCOP_ERR (ret);  	if (ret == 0 && stat) @@ -408,11 +408,11 @@ retry:          glfd->fd->flags = flags;  	if (ret == 0) { -		ret = syncop_open (subvol, &loc, flags, glfd->fd); +		ret = syncop_open (subvol, &loc, flags, glfd->fd, NULL, NULL);                  DECODE_SYNCOP_ERR (ret);  	} else {  		ret = syncop_create (subvol, &loc, flags, mode, glfd->fd, -				     xattr_req, &iatt); +				     &iatt, xattr_req, NULL);                  DECODE_SYNCOP_ERR (ret);  	} @@ -503,7 +503,8 @@ pub_glfs_preadv (struct glfs_fd *glfd, const struct iovec *iovec, int iovcnt,  	size = iov_length (iovec, iovcnt); -	ret = syncop_readv (subvol, fd, size, offset, 0, &iov, &cnt, &iobref); +	ret = syncop_readv (subvol, fd, size, offset, 0, &iov, &cnt, &iobref, +                            NULL, NULL);          DECODE_SYNCOP_ERR (ret);  	if (ret <= 0)  		goto out; @@ -886,7 +887,8 @@ pub_glfs_pwritev (struct glfs_fd *glfd, const struct iovec *iovec, int iovcnt,  	iov.iov_base = iobuf_ptr (iobuf);  	iov.iov_len = size; -	ret = syncop_writev (subvol, fd, &iov, 1, offset, iobref, flags); +	ret = syncop_writev (subvol, fd, &iov, 1, offset, iobref, flags, NULL, +                             NULL);          DECODE_SYNCOP_ERR (ret);  	iobuf_unref (iobuf); @@ -1077,7 +1079,7 @@ pub_glfs_fsync (struct glfs_fd *glfd)  		goto out;  	} -	ret = syncop_fsync (subvol, fd, 0); +	ret = syncop_fsync (subvol, fd, 0, NULL, NULL);          DECODE_SYNCOP_ERR (ret);  out:  	if (fd) @@ -1156,7 +1158,7 @@ pub_glfs_fdatasync (struct glfs_fd *glfd)  		goto out;  	} -	ret = syncop_fsync (subvol, fd, 1); +	ret = syncop_fsync (subvol, fd, 1, NULL, NULL);          DECODE_SYNCOP_ERR (ret);  out:  	if (fd) @@ -1202,7 +1204,7 @@ pub_glfs_ftruncate (struct glfs_fd *glfd, off_t offset)  		goto out;  	} -	ret = syncop_ftruncate (subvol, fd, offset); +	ret = syncop_ftruncate (subvol, fd, offset, NULL, NULL);          DECODE_SYNCOP_ERR (ret);  out:  	if (fd) @@ -1275,7 +1277,7 @@ retry:  	if (ret)  		goto out; -	ret = syncop_access (subvol, &loc, mode); +	ret = syncop_access (subvol, &loc, mode, NULL, NULL);          DECODE_SYNCOP_ERR (ret);  	ESTALE_RETRY (ret, errno, reval, &loc, retry); @@ -1353,7 +1355,7 @@ retry:  		goto out;  	} -	ret = syncop_symlink (subvol, &loc, data, xattr_req, &iatt); +	ret = syncop_symlink (subvol, &loc, data, &iatt, xattr_req, NULL);          DECODE_SYNCOP_ERR (ret);  	ESTALE_RETRY (ret, errno, reval, &loc, retry); @@ -1406,7 +1408,7 @@ retry:  		goto out;  	} -	ret = syncop_readlink (subvol, &loc, &linkval, bufsiz); +	ret = syncop_readlink (subvol, &loc, &linkval, bufsiz, NULL, NULL);          DECODE_SYNCOP_ERR (ret);  	if (ret > 0) {  		memcpy (buf, linkval, ret); @@ -1488,7 +1490,7 @@ retry:  		goto out;  	} -	ret = syncop_mknod (subvol, &loc, mode, dev, xattr_req, &iatt); +	ret = syncop_mknod (subvol, &loc, mode, dev, &iatt, xattr_req, NULL);          DECODE_SYNCOP_ERR (ret);  	ESTALE_RETRY (ret, errno, reval, &loc, retry); @@ -1572,7 +1574,7 @@ retry:  		goto out;  	} -	ret = syncop_mkdir (subvol, &loc, mode, xattr_req, &iatt); +	ret = syncop_mkdir (subvol, &loc, mode, &iatt, xattr_req, NULL);          DECODE_SYNCOP_ERR (ret);  	ESTALE_RETRY (ret, errno, reval, &loc, retry); @@ -1624,7 +1626,7 @@ retry:  		goto out;  	} -	ret = syncop_unlink (subvol, &loc); +	ret = syncop_unlink (subvol, &loc, NULL, NULL);          DECODE_SYNCOP_ERR (ret);  	ESTALE_RETRY (ret, errno, reval, &loc, retry); @@ -1673,7 +1675,7 @@ retry:  		goto out;  	} -	ret = syncop_rmdir (subvol, &loc, 0); +	ret = syncop_rmdir (subvol, &loc, 0, NULL, NULL);          DECODE_SYNCOP_ERR (ret);  	ESTALE_RETRY (ret, errno, reval, &loc, retry); @@ -1739,7 +1741,7 @@ retrynew:  	/* TODO: check if new or old is a prefix of the other, and fail EINVAL */ -	ret = syncop_rename (subvol, &oldloc, &newloc); +	ret = syncop_rename (subvol, &oldloc, &newloc, NULL, NULL);          DECODE_SYNCOP_ERR (ret);  	if (ret == -1 && errno == ESTALE) { @@ -1819,7 +1821,7 @@ retrynew:  	}          newloc.inode = inode_ref (oldloc.inode); -	ret = syncop_link (subvol, &oldloc, &newloc); +	ret = syncop_link (subvol, &oldloc, &newloc, NULL, NULL);          DECODE_SYNCOP_ERR (ret);  	if (ret == -1 && errno == ESTALE) { @@ -1896,7 +1898,7 @@ retry:  		goto out;  	} -	ret = syncop_opendir (subvol, &loc, glfd->fd); +	ret = syncop_opendir (subvol, &loc, glfd->fd, NULL, NULL);          DECODE_SYNCOP_ERR (ret);  	ESTALE_RETRY (ret, errno, reval, &loc, retry); @@ -2098,10 +2100,10 @@ glfd_entry_refresh (struct glfs_fd *glfd, int plus)  	if (plus)  		ret = syncop_readdirp (subvol, fd, 131072, glfd->offset, -				       NULL, &entries); +				       &entries, NULL, NULL);  	else  		ret = syncop_readdir (subvol, fd, 131072, glfd->offset, -				      &entries); +				      &entries, NULL, NULL);          DECODE_SYNCOP_ERR (ret);  	if (ret >= 0) {  		if (plus) @@ -2288,7 +2290,7 @@ retry:  	if (ret)  		goto out; -	ret = syncop_statfs (subvol, &loc, NULL, buf, NULL); +	ret = syncop_statfs (subvol, &loc, buf, NULL, NULL);          DECODE_SYNCOP_ERR (ret);  	ESTALE_RETRY (ret, errno, reval, &loc, retry); @@ -2332,7 +2334,7 @@ retry:  	if (ret)  		goto out; -	ret = syncop_setattr (subvol, &loc, iatt, valid, 0, 0); +	ret = syncop_setattr (subvol, &loc, iatt, valid, 0, 0, NULL, NULL);          DECODE_SYNCOP_ERR (ret);  	ESTALE_RETRY (ret, errno, reval, &loc, retry); @@ -2368,7 +2370,7 @@ glfs_fsetattr (struct glfs_fd *glfd, struct iatt *iatt, int valid)  		goto out;  	} -	ret = syncop_fsetattr (subvol, fd, iatt, valid, 0, 0); +	ret = syncop_fsetattr (subvol, fd, iatt, valid, 0, 0, NULL, NULL);          DECODE_SYNCOP_ERR (ret);  out:  	if (fd) @@ -2622,7 +2624,7 @@ retry:  	if (ret)  		goto out; -	ret = syncop_getxattr (subvol, &loc, &xattr, name, NULL); +	ret = syncop_getxattr (subvol, &loc, &xattr, name, NULL, NULL);          DECODE_SYNCOP_ERR (ret);  	ESTALE_RETRY (ret, errno, reval, &loc, retry); @@ -2685,7 +2687,7 @@ pub_glfs_fgetxattr (struct glfs_fd *glfd, const char *name, void *value,  		goto out;  	} -	ret = syncop_fgetxattr (subvol, fd, &xattr, name, NULL); +	ret = syncop_fgetxattr (subvol, fd, &xattr, name, NULL, NULL);          DECODE_SYNCOP_ERR (ret);  	if (ret)  		goto out; @@ -2762,7 +2764,7 @@ retry:  	if (ret)  		goto out; -	ret = syncop_getxattr (subvol, &loc, &xattr, NULL, NULL); +	ret = syncop_getxattr (subvol, &loc, &xattr, NULL, NULL, NULL);          DECODE_SYNCOP_ERR (ret);  	ESTALE_RETRY (ret, errno, reval, &loc, retry); @@ -2822,7 +2824,7 @@ pub_glfs_flistxattr (struct glfs_fd *glfd, void *value, size_t size)  		goto out;  	} -	ret = syncop_fgetxattr (subvol, fd, &xattr, NULL, NULL); +	ret = syncop_fgetxattr (subvol, fd, &xattr, NULL, NULL, NULL);          DECODE_SYNCOP_ERR (ret);  	if (ret)  		goto out; @@ -2876,7 +2878,7 @@ retry:  		goto out;  	} -	ret = syncop_setxattr (subvol, &loc, xattr, flags); +	ret = syncop_setxattr (subvol, &loc, xattr, flags, NULL, NULL);          DECODE_SYNCOP_ERR (ret);  	ESTALE_RETRY (ret, errno, reval, &loc, retry); @@ -2944,7 +2946,7 @@ pub_glfs_fsetxattr (struct glfs_fd *glfd, const char *name, const void *value,  		goto out;  	} -	ret = syncop_fsetxattr (subvol, fd, xattr, flags); +	ret = syncop_fsetxattr (subvol, fd, xattr, flags, NULL, NULL);          DECODE_SYNCOP_ERR (ret);  out:  	if (xattr) @@ -2990,7 +2992,7 @@ retry:  	if (ret)  		goto out; -	ret = syncop_removexattr (subvol, &loc, name, 0); +	ret = syncop_removexattr (subvol, &loc, name, NULL, NULL);          DECODE_SYNCOP_ERR (ret);  	ESTALE_RETRY (ret, errno, reval, &loc, retry); @@ -3045,7 +3047,7 @@ pub_glfs_fremovexattr (struct glfs_fd *glfd, const char *name)  		goto out;  	} -	ret = syncop_fremovexattr (subvol, fd, name, 0); +	ret = syncop_fremovexattr (subvol, fd, name, NULL, NULL);          DECODE_SYNCOP_ERR (ret);  out:  	if (fd) @@ -3082,7 +3084,7 @@ pub_glfs_fallocate (struct glfs_fd *glfd, int keep_size, off_t offset, size_t le  		goto out;  	} -	ret = syncop_fallocate (subvol, fd, keep_size, offset, len); +	ret = syncop_fallocate (subvol, fd, keep_size, offset, len, NULL, NULL);          DECODE_SYNCOP_ERR (ret);  out:  	if (fd) @@ -3119,7 +3121,7 @@ pub_glfs_discard (struct glfs_fd *glfd, off_t offset, size_t len)  		goto out;  	} -	ret = syncop_discard (subvol, fd, offset, len); +	ret = syncop_discard (subvol, fd, offset, len, NULL, NULL);          DECODE_SYNCOP_ERR (ret);  out:  	if (fd) @@ -3154,7 +3156,7 @@ pub_glfs_zerofill (struct glfs_fd *glfd, off_t offset, off_t len)                  goto out;          } -        ret = syncop_zerofill (subvol, fd, offset, len); +        ret = syncop_zerofill (subvol, fd, offset, len, NULL, NULL);          DECODE_SYNCOP_ERR (ret);  out:          if (fd) @@ -3414,7 +3416,7 @@ pub_glfs_posix_lock (struct glfs_fd *glfd, int cmd, struct flock *flock)  	gf_flock_from_flock (&gf_flock, flock);  	gf_flock_from_flock (&saved_flock, flock); -	ret = syncop_lk (subvol, fd, cmd, &gf_flock); +	ret = syncop_lk (subvol, fd, cmd, &gf_flock, NULL, NULL);          DECODE_SYNCOP_ERR (ret);  	gf_flock_to_flock (&gf_flock, flock); diff --git a/api/src/glfs-handleops.c b/api/src/glfs-handleops.c index 6c7f3ee67ed..acd74e56dcb 100644 --- a/api/src/glfs-handleops.c +++ b/api/src/glfs-handleops.c @@ -157,7 +157,7 @@ pub_glfs_h_stat (struct glfs *fs, struct glfs_object *object, struct stat *stat)          GLFS_LOC_FILL_INODE (inode, loc, out);          /* fop/op */ -        ret = syncop_stat (subvol, &loc, &iatt); +        ret = syncop_stat (subvol, &loc, &iatt, NULL, NULL);          DECODE_SYNCOP_ERR (ret);          /* populate out args */ @@ -265,7 +265,7 @@ glfs_h_getxattrs_common (struct glfs *fs, struct glfs_object *object,          /* populate loc */          GLFS_LOC_FILL_INODE (inode, loc, out); -        ret = syncop_getxattr (subvol, &loc, xattr, name, NULL); +        ret = syncop_getxattr (subvol, &loc, xattr, name, NULL, NULL);          DECODE_SYNCOP_ERR (ret);  out: @@ -352,7 +352,7 @@ pub_glfs_h_setattrs (struct glfs *fs, struct glfs_object *object,          GLFS_LOC_FILL_INODE (inode, loc, out);          /* fop/op */ -        ret = syncop_setattr (subvol, &loc, &iatt, glvalid, 0, 0); +        ret = syncop_setattr (subvol, &loc, &iatt, glvalid, 0, 0, NULL, NULL);          DECODE_SYNCOP_ERR (ret);  out:          loc_wipe (&loc); @@ -414,7 +414,7 @@ pub_glfs_h_setxattrs (struct glfs *fs, struct glfs_object *object,          GLFS_LOC_FILL_INODE (inode, loc, out);          /* fop/op */ -        ret = syncop_setxattr (subvol, &loc, xattr, flags); +        ret = syncop_setxattr (subvol, &loc, xattr, flags, NULL, NULL);          DECODE_SYNCOP_ERR (ret);  out: @@ -470,7 +470,7 @@ pub_glfs_h_removexattrs (struct glfs *fs, struct glfs_object *object,          GLFS_LOC_FILL_INODE (inode, loc, out);          /* fop/op */ -        ret = syncop_removexattr (subvol, &loc, name, 0); +        ret = syncop_removexattr (subvol, &loc, name, NULL, NULL);          DECODE_SYNCOP_ERR (ret);  out: @@ -550,7 +550,7 @@ pub_glfs_h_open (struct glfs *fs, struct glfs_object *object, int flags)          GLFS_LOC_FILL_INODE (inode, loc, out);          /* fop/op */ -        ret = syncop_open (subvol, &loc, flags, glfd->fd); +        ret = syncop_open (subvol, &loc, flags, glfd->fd, NULL, NULL);          DECODE_SYNCOP_ERR (ret);          glfd->fd->flags = flags; @@ -647,7 +647,7 @@ pub_glfs_h_creat (struct glfs *fs, struct glfs_object *parent, const char *path,          /* fop/op */          ret = syncop_create (subvol, &loc, flags, mode, glfd->fd, -                             xattr_req, &iatt); +                             &iatt, xattr_req, NULL);          DECODE_SYNCOP_ERR (ret);          /* populate out args */ @@ -753,7 +753,7 @@ pub_glfs_h_mkdir (struct glfs *fs, struct glfs_object *parent, const char *path,          GLFS_LOC_FILL_PINODE (inode, loc, ret, errno, out, path);          /* fop/op */ -        ret = syncop_mkdir (subvol, &loc, mode, xattr_req, &iatt); +        ret = syncop_mkdir (subvol, &loc, mode, &iatt, xattr_req, NULL);          DECODE_SYNCOP_ERR (ret);          /* populate out args */ @@ -845,7 +845,7 @@ pub_glfs_h_mknod (struct glfs *fs, struct glfs_object *parent, const char *path,          GLFS_LOC_FILL_PINODE (inode, loc, ret, errno, out, path);          /* fop/op */ -        ret = syncop_mknod (subvol, &loc, mode, dev, xattr_req, &iatt); +        ret = syncop_mknod (subvol, &loc, mode, dev, &iatt, xattr_req, NULL);          DECODE_SYNCOP_ERR (ret);          /* populate out args */ @@ -919,13 +919,13 @@ pub_glfs_h_unlink (struct glfs *fs, struct glfs_object *parent, const char *path          }          if (!IA_ISDIR(loc.inode->ia_type)) { -                ret = syncop_unlink (subvol, &loc); +                ret = syncop_unlink (subvol, &loc, NULL, NULL);                  DECODE_SYNCOP_ERR (ret);                  if (ret != 0) {                          goto out;                  }          } else { -                ret = syncop_rmdir (subvol, &loc, 0); +                ret = syncop_rmdir (subvol, &loc, 0, NULL, NULL);                  DECODE_SYNCOP_ERR (ret);                  if (ret != 0) {                          goto out; @@ -1003,7 +1003,7 @@ pub_glfs_h_opendir (struct glfs *fs, struct glfs_object *object)          GLFS_LOC_FILL_INODE (inode, loc, out);          /* fop/op */ -        ret = syncop_opendir (subvol, &loc, glfd->fd); +        ret = syncop_opendir (subvol, &loc, glfd->fd, NULL, NULL);          DECODE_SYNCOP_ERR (ret);  out: @@ -1064,7 +1064,7 @@ pub_glfs_h_access (struct glfs *fs, struct glfs_object *object, int mask)  	/* fop/op */ -	ret = syncop_access (subvol, &loc, mask); +	ret = syncop_access (subvol, &loc, mask, NULL, NULL);          DECODE_SYNCOP_ERR (ret);  out: @@ -1155,7 +1155,7 @@ pub_glfs_h_create_from_handle (struct glfs *fs, unsigned char *handle, int len,                  }          } -        ret = syncop_lookup (subvol, &loc, 0, &iatt, 0, 0); +        ret = syncop_lookup (subvol, &loc, &iatt, 0, 0, 0);          DECODE_SYNCOP_ERR (ret);          if (ret) {                  gf_log (subvol->name, GF_LOG_WARNING, @@ -1250,7 +1250,7 @@ pub_glfs_h_truncate (struct glfs *fs, struct glfs_object *object, off_t offset)          GLFS_LOC_FILL_INODE (inode, loc, out);          /* fop/op */ -        ret = syncop_truncate (subvol, &loc, (off_t)offset); +        ret = syncop_truncate (subvol, &loc, (off_t)offset, NULL, NULL);          DECODE_SYNCOP_ERR (ret);          /* populate out args */ @@ -1326,7 +1326,7 @@ pub_glfs_h_symlink (struct glfs *fs, struct glfs_object *parent,          GLFS_LOC_FILL_PINODE (inode, loc, ret, errno, out, name);          /* fop/op */ -        ret = syncop_symlink (subvol, &loc, data, xattr_req, &iatt); +        ret = syncop_symlink (subvol, &loc, data, &iatt, xattr_req, NULL);          DECODE_SYNCOP_ERR (ret);          /* populate out args */ @@ -1405,7 +1405,7 @@ pub_glfs_h_readlink (struct glfs *fs, struct glfs_object *object, char *buf,          GLFS_LOC_FILL_INODE (inode, loc, out);          /* fop/op */ -        ret = syncop_readlink (subvol, &loc, &linkval, bufsiz); +        ret = syncop_readlink (subvol, &loc, &linkval, bufsiz, NULL, NULL);          DECODE_SYNCOP_ERR (ret);          /* populate out args */ @@ -1494,7 +1494,7 @@ pub_glfs_h_link (struct glfs *fs, struct glfs_object *linksrc,          newloc.inode = inode_ref (inode);          /* fop/op */ -        ret = syncop_link (subvol, &oldloc, &newloc); +        ret = syncop_link (subvol, &oldloc, &newloc, NULL, NULL);          DECODE_SYNCOP_ERR (ret);          if (ret == 0) @@ -1589,7 +1589,7 @@ pub_glfs_h_rename (struct glfs *fs, struct glfs_object *olddir,          /* TODO: check if new or old is a prefix of the other, and fail EINVAL */ -        ret = syncop_rename (subvol, &oldloc, &newloc); +        ret = syncop_rename (subvol, &oldloc, &newloc, NULL, NULL);          DECODE_SYNCOP_ERR (ret);          if (ret == 0) diff --git a/api/src/glfs-resolve.c b/api/src/glfs-resolve.c index 7bd81c5aa37..2e351e16ecd 100644 --- a/api/src/glfs-resolve.c +++ b/api/src/glfs-resolve.c @@ -98,7 +98,7 @@ glfs_refresh_inode_safe (xlator_t *subvol, inode_t *oldinode)  	if (!loc.inode)  		return NULL; -	ret = syncop_lookup (subvol, &loc, 0, &iatt, 0, 0); +	ret = syncop_lookup (subvol, &loc, &iatt, 0, 0, 0);          DECODE_SYNCOP_ERR (ret);  	if (ret) { @@ -168,7 +168,7 @@ glfs_resolve_symlink (struct glfs *fs, xlator_t *subvol, inode_t *inode,  		goto out;  	loc.path = rpath; -	ret = syncop_readlink (subvol, &loc, &path, 4096); +	ret = syncop_readlink (subvol, &loc, &path, 4096, NULL, NULL);          DECODE_SYNCOP_ERR (ret);  	if (ret < 0) @@ -198,7 +198,7 @@ glfs_resolve_base (struct glfs *fs, xlator_t *subvol, inode_t *inode,  	if (ret < 0)  		goto out; -	ret = syncop_lookup (subvol, &loc, NULL, iatt, NULL, NULL); +	ret = syncop_lookup (subvol, &loc, iatt, NULL, NULL, NULL);          DECODE_SYNCOP_ERR (ret);  out:  	loc_wipe (&loc); @@ -283,7 +283,7 @@ glfs_resolve_component (struct glfs *fs, xlator_t *subvol, inode_t *parent,  		goto out;  	} -        ret = syncop_lookup (subvol, &loc, xattr_req, &ciatt, NULL, NULL); +        ret = syncop_lookup (subvol, &loc, &ciatt, NULL, xattr_req, NULL);          if (ret && reval) {                  /*                   * A stale mapping might exist for a dentry/inode that has been @@ -313,8 +313,8 @@ glfs_resolve_component (struct glfs *fs, xlator_t *subvol, inode_t *parent,  			goto out;  		} -		ret = syncop_lookup (subvol, &loc, xattr_req, &ciatt, -				     NULL, NULL); +		ret = syncop_lookup (subvol, &loc, &ciatt, NULL, +				     xattr_req, NULL);  	}          DECODE_SYNCOP_ERR (ret);  	if (ret) @@ -550,7 +550,7 @@ glfs_migrate_fd_locks_safe (struct glfs *fs, xlator_t *oldsubvol, fd_t *oldfd,  	newfd->lk_ctx = fd_lk_ctx_ref (oldfd->lk_ctx);  	ret = syncop_fgetxattr (oldsubvol, oldfd, &lockinfo, -				GF_XATTR_LOCKINFO_KEY, NULL); +				GF_XATTR_LOCKINFO_KEY, NULL, NULL);          DECODE_SYNCOP_ERR (ret);  	if (ret < 0) {  		gf_log (fs->volname, GF_LOG_WARNING, @@ -569,7 +569,7 @@ glfs_migrate_fd_locks_safe (struct glfs *fs, xlator_t *oldsubvol, fd_t *oldfd,  		goto out;  	} -	ret = syncop_fsetxattr (newsubvol, newfd, lockinfo, 0); +	ret = syncop_fsetxattr (newsubvol, newfd, lockinfo, 0, NULL, NULL);          DECODE_SYNCOP_ERR (ret);  	if (ret < 0) {  		gf_log (fs->volname, GF_LOG_WARNING, @@ -605,7 +605,7 @@ glfs_migrate_fd_safe (struct glfs *fs, xlator_t *newsubvol, fd_t *oldfd)  		return fd_ref (oldfd);  	if (!oldsubvol->switched) { -		ret = syncop_fsync (oldsubvol, oldfd, 0); +		ret = syncop_fsync (oldsubvol, oldfd, 0, NULL, NULL);                  DECODE_SYNCOP_ERR (ret);  		if (ret) {  			gf_log (fs->volname, GF_LOG_WARNING, @@ -648,11 +648,11 @@ glfs_migrate_fd_safe (struct glfs *fs, xlator_t *newsubvol, fd_t *oldfd)  	if (IA_ISDIR (oldinode->ia_type)) -		ret = syncop_opendir (newsubvol, &loc, newfd); +		ret = syncop_opendir (newsubvol, &loc, newfd, NULL, NULL);  	else  		ret = syncop_open (newsubvol, &loc,  				   oldfd->flags & ~(O_TRUNC|O_EXCL|O_CREAT), -				   newfd); +				   newfd, NULL, NULL);          DECODE_SYNCOP_ERR (ret);  	loc_wipe (&loc); diff --git a/heal/src/glfs-heal.c b/heal/src/glfs-heal.c index 19e6d2d96bf..770a3c6883c 100644 --- a/heal/src/glfs-heal.c +++ b/heal/src/glfs-heal.c @@ -59,7 +59,7 @@ glfsh_get_index_dir_loc (loc_t *rootloc, xlator_t *xl, loc_t *dirloc,          struct iatt   parent = {0};          ret = syncop_getxattr (xl, rootloc, &xattr, GF_XATTROP_INDEX_GFID, -                               NULL); +                               NULL, NULL);          if (ret < 0) {                  *op_errno = -ret;                  goto out; @@ -74,8 +74,7 @@ glfsh_get_index_dir_loc (loc_t *rootloc, xlator_t *xl, loc_t *dirloc,          gf_uuid_copy (dirloc->gfid, index_gfid);          dirloc->path = "";          dirloc->inode = inode_new (rootloc->inode->table); -        ret = syncop_lookup (xl, dirloc, NULL, -                             &iattr, NULL, &parent); +        ret = syncop_lookup (xl, dirloc, &iattr, &parent, NULL, NULL);          dirloc->path = NULL;          if (ret < 0) {                  *op_errno = -ret; @@ -129,7 +128,7 @@ glfsh_index_purge (xlator_t *subvol, inode_t *inode, char *name)          loc.parent = inode_ref (inode);          loc.name = name; -        ret = syncop_unlink (subvol, &loc); +        ret = syncop_unlink (subvol, &loc, NULL, NULL);          loc_wipe (&loc);          return ret; @@ -244,7 +243,8 @@ glfsh_process_entries (xlator_t *xl, fd_t *fd, gf_dirent_t *entries,                  gf_uuid_parse (entry->d_name, gfid);                  gf_uuid_copy (loc.gfid, gfid); -                ret = syncop_getxattr (this, &loc, &dict, GF_HEAL_INFO, NULL); +                ret = syncop_getxattr (this, &loc, &dict, GF_HEAL_INFO, NULL, +                                       NULL);                  if (ret)                          continue; @@ -286,7 +286,8 @@ glfsh_crawl_directory (glfs_t *fs, xlator_t *top_subvol, loc_t *rootloc,                  return ret;          while (1) { -                ret = syncop_readdir (readdir_xl, fd, 131072, offset, &entries); +                ret = syncop_readdir (readdir_xl, fd, 131072, offset, &entries, +                                      NULL, NULL);                  if (ret <= 0)                          break;                  ret = 0; @@ -347,7 +348,7 @@ glfsh_print_brick (xlator_t *xl, loc_t *rootloc)          char    *brick_end = NULL;          ret = syncop_getxattr (xl, rootloc, &xattr, GF_XATTR_PATHINFO_KEY, -                               NULL); +                               NULL, NULL);          if (ret < 0)                  goto out; @@ -555,7 +556,7 @@ glfsh_heal_splitbrain_file (glfs_t *fs, xlator_t *top_subvol, loc_t *rootloc,                  gf_uuid_parse (path, loc.gfid);                  loc.path = gf_strdup (uuid_utoa (loc.gfid));                  loc.inode = inode_new (rootloc->inode->table); -                ret = syncop_lookup (xl, &loc, xattr_req, 0, &xattr_rsp, 0); +                ret = syncop_lookup (xl, &loc, 0, 0, xattr_req, &xattr_rsp);                  if (ret) {                          op_errno = -ret;                          printf ("Lookup failed on %s:%s.\n", file, @@ -580,7 +581,7 @@ retry:          }          ret = syncop_getxattr (xl, &loc, &xattr_rsp, GF_AFR_HEAL_SBRAIN, -                               xattr_req); +                               xattr_req, NULL);          if (ret) {                  op_errno = -ret;                  printf ("Healing %s failed:%s.\n", file, strerror(op_errno)); diff --git a/libglusterfs/src/syncop-utils.c b/libglusterfs/src/syncop-utils.c index 3c0df0ab6ad..2f3b50f18cd 100644 --- a/libglusterfs/src/syncop-utils.c +++ b/libglusterfs/src/syncop-utils.c @@ -34,7 +34,7 @@ syncop_dirfd (xlator_t *subvol, loc_t *loc, fd_t **fd, int pid)                  goto out;          } -        ret = syncop_opendir (subvol, loc, dirfd); +        ret = syncop_opendir (subvol, loc, dirfd, NULL, NULL);          if (ret) {          /*           * On Linux, if the brick was not updated, opendir will @@ -88,8 +88,8 @@ syncop_ftw (xlator_t *subvol, loc_t *loc, int pid, void *data,          INIT_LIST_HEAD (&entries.list); -        while ((ret = syncop_readdirp (subvol, fd, 131072, offset, 0, -                                       &entries))) { +        while ((ret = syncop_readdirp (subvol, fd, 131072, offset, &entries, +                                       NULL, NULL))) {                  if (ret < 0)                          break; @@ -167,8 +167,8 @@ syncop_ftw_throttle (xlator_t *subvol, loc_t *loc, int pid, void *data,          INIT_LIST_HEAD (&entries.list); -        while ((ret = syncop_readdirp (subvol, fd, 131072, offset, 0, -                                       &entries))) { +        while ((ret = syncop_readdirp (subvol, fd, 131072, offset, &entries, +                                       NULL, NULL))) {                  if (ret < 0)                          break; @@ -236,7 +236,8 @@ syncop_dir_scan (xlator_t *subvol, loc_t *loc, int pid, void *data,          INIT_LIST_HEAD (&entries.list); -        while ((ret = syncop_readdir  (subvol, fd, 131072, offset, &entries))) { +        while ((ret = syncop_readdir (subvol, fd, 131072, offset, &entries, +                                      NULL, NULL))) {                  if (ret < 0)                          break; @@ -283,7 +284,8 @@ syncop_is_subvol_local (xlator_t *this, loc_t *loc, gf_boolean_t *is_local)          *is_local = _gf_false; -        ret = syncop_getxattr (this, loc, &xattr, GF_XATTR_PATHINFO_KEY, NULL); +        ret = syncop_getxattr (this, loc, &xattr, GF_XATTR_PATHINFO_KEY, NULL, +                               NULL);          if (ret < 0) {                  ret = -1;                  goto out; @@ -322,7 +324,8 @@ syncop_gfid_to_path (inode_table_t *itable, xlator_t *subvol, uuid_t gfid,          gf_uuid_copy (loc.gfid, gfid);          loc.inode = inode_new (itable); -        ret = syncop_getxattr (subvol, &loc, &xattr, GFID_TO_PATH_KEY, NULL); +        ret = syncop_getxattr (subvol, &loc, &xattr, GFID_TO_PATH_KEY, NULL, +                               NULL);          if (ret < 0)                  goto out; diff --git a/libglusterfs/src/syncop.c b/libglusterfs/src/syncop.c index e241e2c1ee0..01ca9153733 100644 --- a/libglusterfs/src/syncop.c +++ b/libglusterfs/src/syncop.c @@ -1117,20 +1117,20 @@ syncop_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,  int -syncop_lookup (xlator_t *subvol, loc_t *loc, dict_t *xdata_req, -               struct iatt *iatt, dict_t **xdata_rsp, struct iatt *parent) +syncop_lookup (xlator_t *subvol, loc_t *loc, struct iatt *iatt, +               struct iatt *parent, dict_t *xdata_in, dict_t **xdata_out)  {          struct syncargs args = {0, };          SYNCOP (subvol, (&args), syncop_lookup_cbk, subvol->fops->lookup, -                loc, xdata_req); +                loc, xdata_in);          if (iatt)                  *iatt = args.iatt1;          if (parent)                  *parent = args.iatt2; -        if (xdata_rsp) -                *xdata_rsp = args.xdata; +        if (xdata_out) +                *xdata_out = args.xdata;          else if (args.xdata)                  dict_unref (args.xdata); @@ -1176,6 +1176,9 @@ syncop_readdirp_cbk (call_frame_t *frame,          args->op_ret   = op_ret;          args->op_errno = op_errno; +        if (xdata) +                args->xdata  = dict_ref (xdata); +          if (op_ret >= 0) {                  list_for_each_entry (entry, &entries->list, list) { @@ -1199,18 +1202,24 @@ syncop_readdirp (xlator_t *subvol,                   fd_t *fd,                   size_t size,                   off_t off, -                 dict_t *dict, -                 gf_dirent_t *entries) +                 gf_dirent_t *entries, +                 dict_t *xdata_in, +                 dict_t **xdata_out)  {          struct syncargs args = {0, };          SYNCOP (subvol, (&args), syncop_readdirp_cbk, subvol->fops->readdirp, -                fd, size, off, dict); +                fd, size, off, xdata_in);          if (entries)                  list_splice_init (&args.entries.list, &entries->list);          /* TODO: need to free all the 'args.entries' in 'else' case */ +        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; @@ -1237,6 +1246,8 @@ syncop_readdir_cbk (call_frame_t *frame,          args->op_ret   = op_ret;          args->op_errno = op_errno; +        if (xdata) +                args->xdata  = dict_ref (xdata);          if (op_ret >= 0) {                  list_for_each_entry (entry, &entries->list, list) { @@ -1260,17 +1271,24 @@ syncop_readdir (xlator_t *subvol,                  fd_t *fd,                  size_t size,                  off_t off, -                gf_dirent_t *entries) +                gf_dirent_t *entries, +		dict_t *xdata_in, +                dict_t **xdata_out)  {          struct syncargs args = {0, };          SYNCOP (subvol, (&args), syncop_readdir_cbk, subvol->fops->readdir, -                fd, size, off, NULL); +                fd, size, off, xdata_in);          if (entries)                  list_splice_init (&args.entries.list, &entries->list);          /* TODO: need to free all the 'args.entries' in 'else' case */ +        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; @@ -1291,6 +1309,8 @@ syncop_opendir_cbk (call_frame_t *frame,          args->op_ret   = op_ret;          args->op_errno = op_errno; +        if (xdata) +                args->xdata  = dict_ref (xdata);          __wake (args); @@ -1300,12 +1320,19 @@ syncop_opendir_cbk (call_frame_t *frame,  int  syncop_opendir (xlator_t *subvol,                  loc_t *loc, -                fd_t *fd) +                fd_t *fd, +		dict_t *xdata_in, +                dict_t **xdata_out)  {          struct syncargs args = {0, };          SYNCOP (subvol, (&args), syncop_opendir_cbk, subvol->fops->opendir, -                loc, fd, NULL); +                loc, fd, 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; @@ -1323,6 +1350,8 @@ syncop_fsyncdir_cbk (call_frame_t *frame, void* cookie, xlator_t *this,          args->op_ret   = op_ret;          args->op_errno = op_errno; +        if (xdata) +                args->xdata  = dict_ref (xdata);          __wake (args); @@ -1330,12 +1359,18 @@ syncop_fsyncdir_cbk (call_frame_t *frame, void* cookie, xlator_t *this,  }  int -syncop_fsyncdir (xlator_t *subvol, fd_t *fd, int datasync) +syncop_fsyncdir (xlator_t *subvol, fd_t *fd, int datasync, dict_t *xdata_in, +                 dict_t **xdata_out)  {          struct syncargs args = {0, };          SYNCOP (subvol, (&args), syncop_fsyncdir_cbk, subvol->fops->fsyncdir, -                fd, datasync, NULL); +                fd, datasync, 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; @@ -1352,6 +1387,8 @@ syncop_removexattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,          args->op_ret   = op_ret;          args->op_errno = op_errno; +        if (xdata) +                args->xdata  = dict_ref (xdata);          __wake (args); @@ -1359,12 +1396,18 @@ syncop_removexattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,  }  int -syncop_removexattr (xlator_t *subvol, loc_t *loc, const char *name, dict_t *xdata) +syncop_removexattr (xlator_t *subvol, loc_t *loc, const char *name, +                    dict_t *xdata_in, dict_t **xdata_out)  {          struct syncargs args = {0, }; -        SYNCOP (subvol, (&args), syncop_removexattr_cbk, subvol->fops->removexattr, -                loc, name, xdata); +        SYNCOP (subvol, (&args), syncop_removexattr_cbk, +                subvol->fops->removexattr, loc, name, 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; @@ -1381,6 +1424,8 @@ syncop_fremovexattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,          args->op_ret   = op_ret;          args->op_errno = op_errno; +        if (xdata) +                args->xdata  = dict_ref (xdata);          __wake (args); @@ -1388,12 +1433,18 @@ syncop_fremovexattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,  }  int -syncop_fremovexattr (xlator_t *subvol, fd_t *fd, const char *name, dict_t *xdata) +syncop_fremovexattr (xlator_t *subvol, fd_t *fd, const char *name, +                     dict_t *xdata_in, dict_t **xdata_out)  {          struct syncargs args = {0, };          SYNCOP (subvol, (&args), syncop_fremovexattr_cbk, -                subvol->fops->fremovexattr, fd, name, xdata); +                subvol->fops->fremovexattr, fd, name, 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; @@ -1410,6 +1461,8 @@ syncop_setxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,          args->op_ret   = op_ret;          args->op_errno = op_errno; +        if (xdata) +                args->xdata  = dict_ref (xdata);          __wake (args); @@ -1418,12 +1471,18 @@ syncop_setxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,  int -syncop_setxattr (xlator_t *subvol, loc_t *loc, dict_t *dict, int32_t flags) +syncop_setxattr (xlator_t *subvol, loc_t *loc, dict_t *dict, int32_t flags, +		 dict_t *xdata_in, dict_t **xdata_out)  {          struct syncargs args = {0, };          SYNCOP (subvol, (&args), syncop_setxattr_cbk, subvol->fops->setxattr, -                loc, dict, flags, NULL); +                loc, dict, flags, 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; @@ -1440,6 +1499,8 @@ syncop_fsetxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,          args->op_ret   = op_ret;          args->op_errno = op_errno; +        if (xdata) +                args->xdata  = dict_ref (xdata);          __wake (args); @@ -1448,12 +1509,18 @@ syncop_fsetxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,  int -syncop_fsetxattr (xlator_t *subvol, fd_t *fd, dict_t *dict, int32_t flags) +syncop_fsetxattr (xlator_t *subvol, fd_t *fd, dict_t *dict, int32_t flags, +		  dict_t *xdata_in, dict_t **xdata_out)  {          struct syncargs args = {0, };          SYNCOP (subvol, (&args), syncop_fsetxattr_cbk, subvol->fops->fsetxattr, -                fd, dict, flags, NULL); +                fd, dict, flags, 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; @@ -1470,6 +1537,9 @@ syncop_getxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,          args->op_ret   = op_ret;          args->op_errno = op_errno; +        if (xdata) +                args->xdata  = dict_ref (xdata); +          if (op_ret >= 0)                  args->xattr = dict_ref (dict); @@ -1479,18 +1549,24 @@ syncop_getxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,  }  int -syncop_listxattr (xlator_t *subvol, loc_t *loc, dict_t **dict) +syncop_listxattr (xlator_t *subvol, loc_t *loc, dict_t **dict, dict_t *xdata_in, +                  dict_t **xdata_out)  {          struct syncargs args = {0, };          SYNCOP (subvol, (&args), syncop_getxattr_cbk, subvol->fops->getxattr, -                loc, NULL, NULL); +                loc, NULL, xdata_in);          if (dict)                  *dict = args.xattr;          else if (args.xattr)                  dict_unref (args.xattr); +        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; @@ -1498,18 +1574,23 @@ syncop_listxattr (xlator_t *subvol, loc_t *loc, dict_t **dict)  int  syncop_getxattr (xlator_t *subvol, loc_t *loc, dict_t **dict, const char *key, -                 dict_t *xdata) +                 dict_t *xdata_in, dict_t **xdata_out)  {          struct syncargs args = {0, };          SYNCOP (subvol, (&args), syncop_getxattr_cbk, subvol->fops->getxattr, -                loc, key, xdata); +                loc, key, xdata_in);          if (dict)                  *dict = args.xattr;          else if (args.xattr)                  dict_unref (args.xattr); +        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; @@ -1517,18 +1598,23 @@ syncop_getxattr (xlator_t *subvol, loc_t *loc, dict_t **dict, const char *key,  int  syncop_fgetxattr (xlator_t *subvol, fd_t *fd, dict_t **dict, const char *key, -                  dict_t *xdata) +                  dict_t *xdata_in, dict_t **xdata_out)  {          struct syncargs args = {0, };          SYNCOP (subvol, (&args), syncop_getxattr_cbk, subvol->fops->fgetxattr, -                fd, key, xdata); +                fd, key, xdata_in);          if (dict)                  *dict = args.xattr;          else if (args.xattr)                  dict_unref (args.xattr); +        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; @@ -1546,11 +1632,11 @@ syncop_statfs_cbk (call_frame_t *frame, void *cookie, xlator_t *this,          args->op_ret   = op_ret;          args->op_errno = op_errno; +        if (xdata) +                args->xdata  = dict_ref (xdata);          if (op_ret == 0) {                  args->statvfs_buf  = *buf; -                if (xdata) -                        args->xdata  = dict_ref (xdata);          }          __wake (args); @@ -1560,19 +1646,19 @@ syncop_statfs_cbk (call_frame_t *frame, void *cookie, xlator_t *this,  int -syncop_statfs (xlator_t *subvol, loc_t *loc, dict_t *xdata_req, -               struct statvfs *buf, dict_t **xdata_rsp) +syncop_statfs (xlator_t *subvol, loc_t *loc, struct statvfs *buf, +               dict_t *xdata_in, dict_t **xdata_out)  {          struct syncargs args = {0, };          SYNCOP (subvol, (&args), syncop_statfs_cbk, subvol->fops->statfs, -                loc, xdata_req); +                loc, xdata_in);          if (buf)                  *buf = args.statvfs_buf; -        if (xdata_rsp) -                *xdata_rsp = args.xdata; +        if (xdata_out) +                *xdata_out = args.xdata;          else if (args.xdata)                  dict_unref (args.xdata); @@ -1592,6 +1678,8 @@ syncop_setattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,          args->op_ret   = op_ret;          args->op_errno = op_errno; +        if (xdata) +                args->xdata  = dict_ref (xdata);          if (op_ret == 0) {                  args->iatt1  = *preop; @@ -1606,18 +1694,24 @@ syncop_setattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,  int  syncop_setattr (xlator_t *subvol, loc_t *loc, struct iatt *iatt, int valid, -                struct iatt *preop, struct iatt *postop) +                struct iatt *preop, struct iatt *postop, dict_t *xdata_in, +                dict_t **xdata_out)  {          struct syncargs args = {0, };          SYNCOP (subvol, (&args), syncop_setattr_cbk, subvol->fops->setattr, -                loc, iatt, valid, NULL); +                loc, iatt, valid, xdata_in);          if (preop)                  *preop = args.iatt1;          if (postop)                  *postop = args.iatt2; +        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; @@ -1626,18 +1720,24 @@ syncop_setattr (xlator_t *subvol, loc_t *loc, struct iatt *iatt, int valid,  int  syncop_fsetattr (xlator_t *subvol, fd_t *fd, struct iatt *iatt, int valid, -                 struct iatt *preop, struct iatt *postop) +                 struct iatt *preop, struct iatt *postop, dict_t *xdata_in, +                 dict_t **xdata_out)  {          struct syncargs args = {0, };          SYNCOP (subvol, (&args), syncop_setattr_cbk, subvol->fops->fsetattr, -                fd, iatt, valid, NULL); +                fd, iatt, valid, xdata_in);          if (preop)                  *preop = args.iatt1;          if (postop)                  *postop = args.iatt2; +        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; @@ -1654,6 +1754,8 @@ syncop_open_cbk (call_frame_t *frame, void *cookie, xlator_t *this,          args->op_ret   = op_ret;          args->op_errno = op_errno; +        if (xdata) +                args->xdata  = dict_ref (xdata);          __wake (args); @@ -1661,12 +1763,18 @@ syncop_open_cbk (call_frame_t *frame, void *cookie, xlator_t *this,  }  int -syncop_open (xlator_t *subvol, loc_t *loc, int32_t flags, fd_t *fd) +syncop_open (xlator_t *subvol, loc_t *loc, int32_t flags, fd_t *fd, +	     dict_t *xdata_in, dict_t **xdata_out)  {          struct syncargs args = {0, };          SYNCOP (subvol, (&args), syncop_open_cbk, subvol->fops->open, -                loc, flags, fd, NULL); +                loc, flags, fd, 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; @@ -1689,6 +1797,8 @@ syncop_readv_cbk (call_frame_t *frame, void *cookie, xlator_t *this,          args->op_ret   = op_ret;          args->op_errno = op_errno; +        if (xdata) +                args->xdata  = dict_ref (xdata);          if (args->op_ret >= 0) {                  if (iobref) @@ -1706,12 +1816,17 @@ syncop_readv_cbk (call_frame_t *frame, void *cookie, xlator_t *this,  int  syncop_readv (xlator_t *subvol, fd_t *fd, size_t size, off_t off,                uint32_t flags, struct iovec **vector, int *count, -              struct iobref **iobref) +              struct iobref **iobref, dict_t *xdata_in, dict_t **xdata_out)  {          struct syncargs args = {0, };          SYNCOP (subvol, (&args), syncop_readv_cbk, subvol->fops->readv, -                fd, size, off, flags, NULL); +                fd, size, off, flags, xdata_in); + +        if (xdata_out) +                *xdata_out = args.xdata; +        else if (args.xdata) +                dict_unref (args.xdata);          if (args.op_ret < 0)                  goto out; @@ -1748,6 +1863,8 @@ syncop_writev_cbk (call_frame_t *frame, void *cookie, xlator_t *this,          args->op_ret   = op_ret;          args->op_errno = op_errno; +        if (xdata) +                args->xdata  = dict_ref (xdata);          __wake (args); @@ -1757,13 +1874,18 @@ syncop_writev_cbk (call_frame_t *frame, void *cookie, xlator_t *this,  int  syncop_writev (xlator_t *subvol, fd_t *fd, const struct iovec *vector,                 int32_t count, off_t offset, struct iobref *iobref, -               uint32_t flags) +               uint32_t flags, dict_t *xdata_in, dict_t **xdata_out)  {          struct syncargs args = {0, };          SYNCOP (subvol, (&args), syncop_writev_cbk, subvol->fops->writev,                  fd, (struct iovec *) vector, count, offset, flags, iobref, -                NULL); +                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; @@ -1771,7 +1893,8 @@ syncop_writev (xlator_t *subvol, fd_t *fd, const struct iovec *vector,  }  int syncop_write (xlator_t *subvol, fd_t *fd, const char *buf, int size, -                  off_t offset, struct iobref *iobref, uint32_t flags) +                  off_t offset, struct iobref *iobref, uint32_t flags, +                  dict_t *xdata_in, dict_t **xdata_out)  {          struct syncargs args = {0,};          struct iovec    vec  = {0,}; @@ -1780,7 +1903,12 @@ int syncop_write (xlator_t *subvol, fd_t *fd, const char *buf, int size,          vec.iov_base = (void *)buf;          SYNCOP (subvol, (&args), syncop_writev_cbk, subvol->fops->writev, -                fd, &vec, 1, offset, flags, iobref, NULL); +                fd, &vec, 1, offset, flags, iobref, 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; @@ -1808,6 +1936,8 @@ syncop_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this,          args->op_ret   = op_ret;          args->op_errno = op_errno; +        if (xdata) +                args->xdata  = dict_ref (xdata);  	if (buf)  		args->iatt1 = *buf; @@ -1819,16 +1949,22 @@ syncop_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this,  int  syncop_create (xlator_t *subvol, loc_t *loc, int32_t flags, mode_t mode, -               fd_t *fd, dict_t *xdata, struct iatt *iatt) +               fd_t *fd, struct iatt *iatt, +               dict_t *xdata_in, dict_t **xdata_out)  {          struct syncargs args = {0, };          SYNCOP (subvol, (&args), syncop_create_cbk, subvol->fops->create, -                loc, flags, mode, 0, fd, xdata); +                loc, flags, mode, 0, fd, xdata_in);  	if (iatt)  		*iatt = args.iatt1; +        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; @@ -1846,6 +1982,8 @@ syncop_unlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this,          args->op_ret   = op_ret;          args->op_errno = op_errno; +        if (xdata) +                args->xdata  = dict_ref (xdata);          __wake (args); @@ -1853,12 +1991,18 @@ syncop_unlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this,  }  int -syncop_unlink (xlator_t *subvol, loc_t *loc) +syncop_unlink (xlator_t *subvol, loc_t *loc, dict_t *xdata_in, +               dict_t **xdata_out)  {          struct syncargs args = {0, };          SYNCOP (subvol, (&args), syncop_unlink_cbk, subvol->fops->unlink, loc, -                0, NULL); +                0, 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; @@ -1876,6 +2020,8 @@ syncop_rmdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,          args->op_ret   = op_ret;          args->op_errno = op_errno; +        if (xdata) +                args->xdata  = dict_ref (xdata);          __wake (args); @@ -1883,12 +2029,18 @@ syncop_rmdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,  }  int -syncop_rmdir (xlator_t *subvol, loc_t *loc, int flags) +syncop_rmdir (xlator_t *subvol, loc_t *loc, int flags, dict_t *xdata_in, +              dict_t **xdata_out)  {          struct syncargs args = {0, };          SYNCOP (subvol, (&args), syncop_rmdir_cbk, subvol->fops->rmdir, loc, -                flags, NULL); +                flags, 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; @@ -1908,6 +2060,8 @@ syncop_link_cbk (call_frame_t *frame, void *cookie, xlator_t *this,          args->op_ret = op_ret;          args->op_errno = op_errno; +        if (xdata) +                args->xdata  = dict_ref (xdata);          __wake (args); @@ -1916,12 +2070,18 @@ syncop_link_cbk (call_frame_t *frame, void *cookie, xlator_t *this,  int -syncop_link (xlator_t *subvol, loc_t *oldloc, loc_t *newloc) +syncop_link (xlator_t *subvol, loc_t *oldloc, loc_t *newloc, dict_t *xdata_in, +             dict_t **xdata_out)  {          struct syncargs args = {0, };          SYNCOP (subvol, (&args), syncop_link_cbk, subvol->fops->link, -                oldloc, newloc, NULL); +                oldloc, newloc, 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; @@ -1943,6 +2103,8 @@ syncop_rename_cbk (call_frame_t *frame, void *cookie, xlator_t *this,          args->op_ret = op_ret;          args->op_errno = op_errno; +        if (xdata) +                args->xdata  = dict_ref (xdata);          __wake (args); @@ -1951,12 +2113,18 @@ syncop_rename_cbk (call_frame_t *frame, void *cookie, xlator_t *this,  int -syncop_rename (xlator_t *subvol, loc_t *oldloc, loc_t *newloc) +syncop_rename (xlator_t *subvol, loc_t *oldloc, loc_t *newloc, +               dict_t *xdata_in, dict_t **xdata_out)  {          struct syncargs args = {0, };          SYNCOP (subvol, (&args), syncop_rename_cbk, subvol->fops->rename, -                oldloc, newloc, NULL); +                oldloc, newloc, 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; @@ -1976,6 +2144,8 @@ syncop_ftruncate_cbk (call_frame_t *frame, void *cookie, xlator_t *this,          args->op_ret   = op_ret;          args->op_errno = op_errno; +        if (xdata) +                args->xdata  = dict_ref (xdata);          __wake (args); @@ -1983,12 +2153,18 @@ syncop_ftruncate_cbk (call_frame_t *frame, void *cookie, xlator_t *this,  }  int -syncop_ftruncate (xlator_t *subvol, fd_t *fd, off_t offset) +syncop_ftruncate (xlator_t *subvol, fd_t *fd, off_t offset, dict_t *xdata_in, +                  dict_t **xdata_out)  {          struct syncargs args = {0, };          SYNCOP (subvol, (&args), syncop_ftruncate_cbk, subvol->fops->ftruncate, -                fd, offset, NULL); +                fd, offset, 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; @@ -1996,12 +2172,18 @@ syncop_ftruncate (xlator_t *subvol, fd_t *fd, off_t offset)  }  int -syncop_truncate (xlator_t *subvol, loc_t *loc, off_t offset) +syncop_truncate (xlator_t *subvol, loc_t *loc, off_t offset, dict_t *xdata_in, +                 dict_t **xdata_out)  {          struct syncargs args = {0, };          SYNCOP (subvol, (&args), syncop_ftruncate_cbk, subvol->fops->truncate, -                loc, offset, NULL); +                loc, offset, 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; @@ -2019,6 +2201,8 @@ syncop_fsync_cbk (call_frame_t *frame, void *cookie, xlator_t *this,          args->op_ret   = op_ret;          args->op_errno = op_errno; +        if (xdata) +                args->xdata  = dict_ref (xdata);          __wake (args); @@ -2027,12 +2211,18 @@ syncop_fsync_cbk (call_frame_t *frame, void *cookie, xlator_t *this,  }  int -syncop_fsync (xlator_t *subvol, fd_t *fd, int dataonly) +syncop_fsync (xlator_t *subvol, fd_t *fd, int dataonly, dict_t *xdata_in, +              dict_t **xdata_out)  {          struct syncargs args = {0, };          SYNCOP (subvol, (&args), syncop_fsync_cbk, subvol->fops->fsync, -                fd, dataonly, NULL); +                fd, dataonly, 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; @@ -2051,6 +2241,8 @@ syncop_flush_cbk (call_frame_t *frame, void *cookie, xlator_t *this,          args->op_ret   = op_ret;          args->op_errno = op_errno; +        if (xdata) +                args->xdata  = dict_ref (xdata);          __wake (args); @@ -2059,12 +2251,18 @@ syncop_flush_cbk (call_frame_t *frame, void *cookie, xlator_t *this,  }  int -syncop_flush (xlator_t *subvol, fd_t *fd) +syncop_flush (xlator_t *subvol, fd_t *fd, dict_t *xdata_in, +              dict_t **xdata_out)  {          struct syncargs args = {0};          SYNCOP (subvol, (&args), syncop_flush_cbk, subvol->fops->flush, -                fd, NULL); +                fd, 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; @@ -2074,7 +2272,8 @@ syncop_flush (xlator_t *subvol, fd_t *fd)  int  syncop_fstat_cbk (call_frame_t *frame, void *cookie, xlator_t *this, -                  int32_t op_ret, int32_t op_errno, struct iatt *stbuf, dict_t *xdata) +                  int32_t op_ret, int32_t op_errno, struct iatt *stbuf, +                  dict_t *xdata)  {          struct syncargs *args = NULL; @@ -2082,6 +2281,9 @@ syncop_fstat_cbk (call_frame_t *frame, void *cookie, xlator_t *this,          args->op_ret   = op_ret;          args->op_errno = op_errno; +        if (xdata) +                args->xdata  = dict_ref (xdata); +          if (op_ret == 0)                  args->iatt1 = *stbuf; @@ -2092,16 +2294,22 @@ syncop_fstat_cbk (call_frame_t *frame, void *cookie, xlator_t *this,  }  int -syncop_fstat (xlator_t *subvol, fd_t *fd, struct iatt *stbuf) +syncop_fstat (xlator_t *subvol, fd_t *fd, struct iatt *stbuf, dict_t *xdata_in, +              dict_t **xdata_out)  {          struct syncargs args = {0, };          SYNCOP (subvol, (&args), syncop_fstat_cbk, subvol->fops->fstat, -                fd, NULL); +                fd, xdata_in);          if (stbuf)                  *stbuf = args.iatt1; +        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; @@ -2109,16 +2317,22 @@ syncop_fstat (xlator_t *subvol, fd_t *fd, struct iatt *stbuf)  }  int -syncop_stat (xlator_t *subvol, loc_t *loc, struct iatt *stbuf) +syncop_stat (xlator_t *subvol, loc_t *loc, struct iatt *stbuf, dict_t *xdata_in, +             dict_t **xdata_out)  {          struct syncargs args = {0, };          SYNCOP (subvol, (&args), syncop_fstat_cbk, subvol->fops->stat, -                loc, NULL); +                loc, xdata_in);          if (stbuf)                  *stbuf = args.iatt1; +        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; @@ -2137,6 +2351,9 @@ syncop_symlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this,          args->op_ret   = op_ret;          args->op_errno = op_errno; +        if (xdata) +                args->xdata  = dict_ref (xdata); +  	if (buf)  		args->iatt1 = *buf; @@ -2146,17 +2363,22 @@ syncop_symlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this,  }  int -syncop_symlink (xlator_t *subvol, loc_t *loc, const char *newpath, dict_t *dict, -		struct iatt *iatt) +syncop_symlink (xlator_t *subvol, loc_t *loc, const char *newpath, +                struct iatt *iatt, dict_t *xdata_in, dict_t **xdata_out)  {          struct syncargs args = {0, };          SYNCOP (subvol, (&args), syncop_symlink_cbk, subvol->fops->symlink, -                newpath, loc, 0, dict); +                newpath, loc, 0, xdata_in);  	if (iatt)  		*iatt = args.iatt1; +        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; @@ -2174,6 +2396,8 @@ syncop_readlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this,          args->op_ret   = op_ret;          args->op_errno = op_errno; +        if (xdata) +                args->xdata  = dict_ref (xdata);          if ((op_ret != -1) && path)                  args->buffer = gf_strdup (path); @@ -2184,17 +2408,23 @@ syncop_readlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this,  }  int -syncop_readlink (xlator_t *subvol, loc_t *loc, char **buffer, size_t size) +syncop_readlink (xlator_t *subvol, loc_t *loc, char **buffer, size_t size, +		 dict_t *xdata_in, dict_t **xdata_out)  {          struct syncargs args = {0, };          SYNCOP (subvol, (&args), syncop_readlink_cbk, subvol->fops->readlink, -                loc, size, NULL); +                loc, size, xdata_in);          if (buffer)                  *buffer = args.buffer;          else GF_FREE (args.buffer); +        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; @@ -2212,6 +2442,8 @@ syncop_mknod_cbk (call_frame_t *frame, void *cookie, xlator_t *this,          args->op_ret   = op_ret;          args->op_errno = op_errno; +        if (xdata) +                args->xdata  = dict_ref (xdata);  	if (buf)  		args->iatt1 = *buf; @@ -2223,16 +2455,21 @@ syncop_mknod_cbk (call_frame_t *frame, void *cookie, xlator_t *this,  int  syncop_mknod (xlator_t *subvol, loc_t *loc, mode_t mode, dev_t rdev, -              dict_t *dict, struct iatt *iatt) +              struct iatt *iatt, dict_t *xdata_in, dict_t **xdata_out)  {          struct syncargs args = {0, };          SYNCOP (subvol, (&args), syncop_mknod_cbk, subvol->fops->mknod, -                loc, mode, rdev, 0, dict); +                loc, mode, rdev, 0, xdata_in);  	if (iatt)  		*iatt = args.iatt1; +        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; @@ -2252,6 +2489,9 @@ syncop_mkdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,          args->op_ret   = op_ret;          args->op_errno = op_errno; +        if (xdata) +                args->xdata  = dict_ref (xdata); +  	if (buf)  		args->iatt1 = *buf; @@ -2262,17 +2502,22 @@ syncop_mkdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,  int -syncop_mkdir (xlator_t *subvol, loc_t *loc, mode_t mode, dict_t *dict, -	      struct iatt *iatt) +syncop_mkdir (xlator_t *subvol, loc_t *loc, mode_t mode, struct iatt *iatt, +              dict_t *xdata_in, dict_t **xdata_out)  {          struct syncargs args = {0, };          SYNCOP (subvol, (&args), syncop_mkdir_cbk, subvol->fops->mkdir, -                loc, mode, 0, dict); +                loc, mode, 0, xdata_in);  	if (iatt)  		*iatt = args.iatt1; +        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; @@ -2289,6 +2534,9 @@ syncop_access_cbk (call_frame_t *frame, void *cookie, xlator_t *this,          args->op_ret   = op_ret;          args->op_errno = op_errno; +        if (xdata) +                args->xdata  = dict_ref (xdata); +          __wake (args);          return 0; @@ -2310,12 +2558,18 @@ syncop_access_cbk (call_frame_t *frame, void *cookie, xlator_t *this,     got is the mode of the access.  */  int -syncop_access (xlator_t *subvol, loc_t *loc, int32_t mask) +syncop_access (xlator_t *subvol, loc_t *loc, int32_t mask, dict_t *xdata_in, +               dict_t **xdata_out)  {          struct syncargs args = {0, };          SYNCOP (subvol, (&args), syncop_access_cbk, subvol->fops->access, -                loc, mask, NULL); +                loc, mask, 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; @@ -2334,6 +2588,8 @@ syncop_fallocate_cbk (call_frame_t *frame, void *cookie, xlator_t *this,          args->op_ret   = op_ret;          args->op_errno = op_errno; +        if (xdata) +                args->xdata  = dict_ref (xdata);          __wake (args); @@ -2342,12 +2598,17 @@ syncop_fallocate_cbk (call_frame_t *frame, void *cookie, xlator_t *this,  int  syncop_fallocate(xlator_t *subvol, fd_t *fd, int32_t keep_size, off_t offset, -		 size_t len) +		 size_t len, dict_t *xdata_in, dict_t **xdata_out)  {          struct syncargs args = {0, };          SYNCOP (subvol, (&args), syncop_fallocate_cbk, subvol->fops->fallocate, -                fd, keep_size, offset, len, NULL); +                fd, keep_size, offset, len, 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; @@ -2366,6 +2627,8 @@ syncop_discard_cbk (call_frame_t *frame, void *cookie, xlator_t *this,          args->op_ret   = op_ret;          args->op_errno = op_errno; +        if (xdata) +                args->xdata  = dict_ref (xdata);          __wake (args); @@ -2373,12 +2636,18 @@ syncop_discard_cbk (call_frame_t *frame, void *cookie, xlator_t *this,  }  int -syncop_discard(xlator_t *subvol, fd_t *fd, off_t offset, size_t len) +syncop_discard(xlator_t *subvol, fd_t *fd, off_t offset, size_t len, +	       dict_t *xdata_in, dict_t **xdata_out)  {          struct syncargs args = {0, };          SYNCOP (subvol, (&args), syncop_discard_cbk, subvol->fops->discard, -                fd, offset, len, NULL); +                fd, offset, len, 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; @@ -2396,6 +2665,8 @@ syncop_zerofill_cbk (call_frame_t *frame, void *cookie, xlator_t *this,          args->op_ret   = op_ret;          args->op_errno = op_errno; +        if (xdata) +                args->xdata  = dict_ref (xdata);          __wake (args); @@ -2403,12 +2674,18 @@ syncop_zerofill_cbk (call_frame_t *frame, void *cookie, xlator_t *this,  }  int -syncop_zerofill(xlator_t *subvol, fd_t *fd, off_t offset, off_t len) +syncop_zerofill(xlator_t *subvol, fd_t *fd, off_t offset, off_t len, +		dict_t *xdata_in, dict_t **xdata_out)  {          struct syncargs args = {0, };          SYNCOP (subvol, (&args), syncop_zerofill_cbk, subvol->fops->zerofill, -                fd, offset, len, NULL); +                fd, offset, len, 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; @@ -2424,12 +2701,10 @@ syncop_ipc_cbk (call_frame_t *frame, void *cookie, xlator_t *this,          args = cookie; -        if (xdata) { -                args->xdata = dict_ref(xdata); -        } -          args->op_ret   = op_ret;          args->op_errno = op_errno; +        if (xdata) +                args->xdata  = dict_ref (xdata);          __wake (args); @@ -2473,6 +2748,9 @@ syncop_lk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,          args->op_ret   = op_ret;          args->op_errno = op_errno; +        if (xdata) +                args->xdata  = dict_ref (xdata); +  	if (flock)  		args->flock = *flock;          __wake (args); @@ -2482,15 +2760,21 @@ syncop_lk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,  int -syncop_lk (xlator_t *subvol, fd_t *fd, int cmd, struct gf_flock *flock) +syncop_lk (xlator_t *subvol, fd_t *fd, int cmd, struct gf_flock *flock, +	   dict_t *xdata_in, dict_t **xdata_out)  {          struct syncargs args = {0, };          SYNCOP (subvol, (&args), syncop_lk_cbk, subvol->fops->lk, -                fd, cmd, flock, NULL); +                fd, cmd, flock, xdata_in);  	*flock = args.flock; +        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; @@ -2506,9 +2790,8 @@ syncop_inodelk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,          args->op_ret   = op_ret;          args->op_errno = op_errno; -          if (xdata) -                args->xdata = dict_ref (xdata); +                args->xdata  = dict_ref (xdata);          __wake (args); @@ -2518,19 +2801,17 @@ syncop_inodelk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,  int  syncop_inodelk (xlator_t *subvol, const char *volume, loc_t *loc, int32_t cmd, -                struct gf_flock *lock, dict_t *xdata_req, dict_t **xdata_rsp) +                struct gf_flock *lock, dict_t *xdata_in, dict_t **xdata_out)  {          struct syncargs args = {0, };          SYNCOP (subvol, (&args), syncop_inodelk_cbk, subvol->fops->inodelk, -                volume, loc, cmd, lock, xdata_req); +                volume, loc, cmd, lock, xdata_in); -        if (xdata_rsp) -                *xdata_rsp = args.xdata; -        else { -                if (args.xdata) -                        dict_unref (args.xdata); -        } +        if (xdata_out) +                *xdata_out = args.xdata; +        else if (args.xdata) +                dict_unref (args.xdata);          if (args.op_ret < 0)                  return -args.op_errno; @@ -2549,9 +2830,8 @@ syncop_xattrop_cbk (call_frame_t *frame, void *cookie, xlator_t *this,          args->op_ret   = op_ret;          args->op_errno = op_errno; -          if (xdata) -                args->xdata = dict_ref (xdata); +                args->xdata  = dict_ref (xdata);          __wake (args); @@ -2561,12 +2841,17 @@ syncop_xattrop_cbk (call_frame_t *frame, void *cookie, xlator_t *this,  int  syncop_xattrop (xlator_t *subvol, loc_t *loc, gf_xattrop_flags_t flags, -                dict_t *dict, dict_t *xdata) +                dict_t *dict, dict_t *xdata_in, dict_t **xdata_out)  {          struct syncargs args = {0, };          SYNCOP (subvol, (&args), syncop_xattrop_cbk, subvol->fops->xattrop, -                loc, flags, dict, xdata); +                loc, 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; diff --git a/libglusterfs/src/syncop.h b/libglusterfs/src/syncop.h index a9244a51552..e9d3428c512 100644 --- a/libglusterfs/src/syncop.h +++ b/libglusterfs/src/syncop.h @@ -348,99 +348,151 @@ int syncbarrier_wait (syncbarrier_t *barrier, int waitfor);  int syncbarrier_wake (syncbarrier_t *barrier);  int syncbarrier_destroy (syncbarrier_t *barrier); -int syncop_lookup (xlator_t *subvol, loc_t *loc, dict_t *xattr_req, +int syncop_lookup (xlator_t *subvol, loc_t *loc,                     /* out */ -                   struct iatt *iatt, dict_t **xattr_rsp, struct iatt *parent); +                   struct iatt *iatt, struct iatt *parent, +                   /* xdata */ +                   dict_t *xdata_in, dict_t **xdata_out);  int syncop_readdirp (xlator_t *subvol, fd_t *fd, size_t size, off_t off, -                     dict_t *dict,                       /* out */ -                     gf_dirent_t *entries); +                     gf_dirent_t *entries, +                     dict_t *xdata_in, dict_t **xdata_out);  int syncop_readdir (xlator_t *subvol, fd_t *fd, size_t size, off_t off, -                    gf_dirent_t *entries); +                    gf_dirent_t *entries, dict_t *xdata_in, dict_t **xdata_out); -int syncop_opendir (xlator_t *subvol, loc_t *loc, fd_t *fd); +int syncop_opendir (xlator_t *subvol, loc_t *loc, fd_t *fd, dict_t *xdata_in, +                    dict_t **xdata_out);  int syncop_setattr (xlator_t *subvol, loc_t *loc, struct iatt *iatt, int valid,                      /* out */ -                    struct iatt *preop, struct iatt *postop); +                    struct iatt *preop, struct iatt *postop, dict_t *xdata_in, +                    dict_t **xdata_out);  int syncop_fsetattr (xlator_t *subvol, fd_t *fd, struct iatt *iatt, int valid,                      /* out */ -                    struct iatt *preop, struct iatt *postop); +                    struct iatt *preop, struct iatt *postop, dict_t *xdata_in, +                    dict_t **xdata_out); -int syncop_statfs (xlator_t *subvol, loc_t *loc, dict_t *xattr_req, +int syncop_statfs (xlator_t *subvol, loc_t *loc,                     /* out */ -                   struct statvfs *buf, dict_t **xattr_rsp); +                   struct statvfs *buf, +                   dict_t *xdata_in, dict_t **xdata_out); + +int syncop_setxattr (xlator_t *subvol, loc_t *loc, dict_t *dict, int32_t flags, +		     dict_t *xdata_in, dict_t **xdata_out); + +int syncop_fsetxattr (xlator_t *subvol, fd_t *fd, dict_t *dict, int32_t flags, +		      dict_t *xdata_in, dict_t **xdata_out); + +int syncop_listxattr (xlator_t *subvol, loc_t *loc, dict_t **dict, +		      dict_t *xdata_in, dict_t **xdata_out); -int syncop_setxattr (xlator_t *subvol, loc_t *loc, dict_t *dict, int32_t flags); -int syncop_fsetxattr (xlator_t *subvol, fd_t *fd, dict_t *dict, int32_t flags); -int syncop_listxattr (xlator_t *subvol, loc_t *loc, dict_t **dict);  int syncop_getxattr (xlator_t *xl, loc_t *loc, dict_t **dict, const char *key, -                     dict_t *xdata); +                     dict_t *xdata_in, dict_t **xdata_out); +  int syncop_fgetxattr (xlator_t *xl, fd_t *fd, dict_t **dict, const char *key, -                      dict_t *xdata); +                      dict_t *xdata_in, dict_t **xdata_out); +  int syncop_removexattr (xlator_t *subvol, loc_t *loc, const char *name, -			dict_t *xdata); +			dict_t *xdata_in, dict_t **xdata_out); +  int syncop_fremovexattr (xlator_t *subvol, fd_t *fd, const char *name, -			 dict_t *xdata); +			 dict_t *xdata_in, dict_t **xdata_out);  int syncop_create (xlator_t *subvol, loc_t *loc, int32_t flags, mode_t mode, -                   fd_t *fd, dict_t *dict, struct iatt *iatt); -int syncop_open (xlator_t *subvol, loc_t *loc, int32_t flags, fd_t *fd); +                   fd_t *fd, struct iatt *iatt, +                   dict_t *xdata_in, dict_t **xdata_out); + +int syncop_open (xlator_t *subvol, loc_t *loc, int32_t flags, fd_t *fd, +		 dict_t *xdata_in, dict_t **xdata_out); +  int syncop_close (fd_t *fd);  int syncop_write (xlator_t *subvol, fd_t *fd, const char *buf, int size, -                  off_t offset, struct iobref *iobref, uint32_t flags); +                  off_t offset, struct iobref *iobref, uint32_t flags, +		  dict_t *xdata_in, dict_t **xdata_out); +  int syncop_writev (xlator_t *subvol, fd_t *fd, const struct iovec *vector,                     int32_t count, off_t offset, struct iobref *iobref, -                   uint32_t flags); +                   uint32_t flags, dict_t *xdata_in, dict_t **xdata_out); +  int syncop_readv (xlator_t *subvol, fd_t *fd, size_t size, off_t off,                    uint32_t flags,                    /* out */ -                  struct iovec **vector, int *count, struct iobref **iobref); +                  struct iovec **vector, int *count, struct iobref **iobref, +		  dict_t *xdata_in, dict_t **xdata_out); + +int syncop_ftruncate (xlator_t *subvol, fd_t *fd, off_t offset, +                      dict_t *xdata_in, dict_t **xdata_out); + +int syncop_truncate (xlator_t *subvol, loc_t *loc, off_t offset, +                     dict_t *xdata_in, dict_t **xdata_out); -int syncop_ftruncate (xlator_t *subvol, fd_t *fd, off_t offset); -int syncop_truncate (xlator_t *subvol, loc_t *loc, off_t offset); +int syncop_unlink (xlator_t *subvol, loc_t *loc, dict_t *xdata_in, +                   dict_t **xdata_out); -int syncop_unlink (xlator_t *subvol, loc_t *loc); -int syncop_rmdir (xlator_t *subvol, loc_t *loc, int flags); +int syncop_rmdir (xlator_t *subvol, loc_t *loc, int flags, dict_t *xdata_in, +                  dict_t **xdata_out); -int syncop_fsync (xlator_t *subvol, fd_t *fd, int dataonly); -int syncop_flush (xlator_t *subvol, fd_t *fd); -int syncop_fstat (xlator_t *subvol, fd_t *fd, struct iatt *stbuf); -int syncop_stat (xlator_t *subvol, loc_t *loc, struct iatt *stbuf); +int syncop_fsync (xlator_t *subvol, fd_t *fd, int dataonly, dict_t *xdata_in, +                  dict_t **xdata_out); + +int syncop_flush (xlator_t *subvol, fd_t *fd, dict_t *xdata_in, +                  dict_t **xdata_out); + +int syncop_fstat (xlator_t *subvol, fd_t *fd, struct iatt *stbuf, +		  dict_t *xdata_in, dict_t **xdata_out); + +int syncop_stat (xlator_t *subvol, loc_t *loc, struct iatt *stbuf, +		 dict_t *xdata_in, dict_t **xdata_out);  int syncop_symlink (xlator_t *subvol, loc_t *loc, const char *newpath, -                    dict_t *dict, struct iatt *iatt); -int syncop_readlink (xlator_t *subvol, loc_t *loc, char **buffer, size_t size); +                    struct iatt *iatt, +                    dict_t *xdata_in, dict_t **xdata_out); + +int syncop_readlink (xlator_t *subvol, loc_t *loc, char **buffer, size_t size, +		     dict_t *xdata_in, dict_t **xdata_out); +  int syncop_mknod (xlator_t *subvol, loc_t *loc, mode_t mode, dev_t rdev, -                  dict_t *dict, struct iatt *iatt); -int syncop_mkdir (xlator_t *subvol, loc_t *loc, mode_t mode, dict_t *dict, -		  struct iatt *iatt); -int syncop_link (xlator_t *subvol, loc_t *oldloc, loc_t *newloc); -int syncop_fsyncdir (xlator_t *subvol, fd_t *fd, int datasync); -int syncop_access (xlator_t *subvol, loc_t *loc, int32_t mask); -int syncop_fallocate(xlator_t *subvol, fd_t *fd, int32_t keep_size, off_t offset, -		     size_t len); -int syncop_discard(xlator_t *subvol, fd_t *fd, off_t offset, size_t len); +                  struct iatt *iatt, dict_t *xdata_in, dict_t **xdata_out); + +int syncop_mkdir (xlator_t *subvol, loc_t *loc, mode_t mode, struct iatt *iatt, +                  dict_t *xdata_in, dict_t **xdata_out); + +int syncop_link (xlator_t *subvol, loc_t *oldloc, loc_t *newloc, +                 dict_t *xdata_in, dict_t **xdata_out); + +int syncop_fsyncdir (xlator_t *subvol, fd_t *fd, int datasync, +                     dict_t *xdata_in, dict_t **xdata_out); + +int syncop_access (xlator_t *subvol, loc_t *loc, int32_t mask, +                   dict_t *xdata_in, dict_t **xdata_out); + +int syncop_fallocate(xlator_t *subvol, fd_t *fd, int32_t keep_size, +		     off_t offset, size_t len, dict_t *xdata_in, +                     dict_t **xdata_out); + +int syncop_discard(xlator_t *subvol, fd_t *fd, off_t offset, size_t len, +		   dict_t *xdata_in, dict_t **xdata_out); -int syncop_zerofill(xlator_t *subvol, fd_t *fd, off_t offset, off_t len); +int syncop_zerofill(xlator_t *subvol, fd_t *fd, off_t offset, off_t len, +		    dict_t *xdata_in, dict_t **xdata_out); -int syncop_rename (xlator_t *subvol, loc_t *oldloc, loc_t *newloc); +int syncop_rename (xlator_t *subvol, loc_t *oldloc, loc_t *newloc, +		   dict_t *xdata_in, dict_t **xdata_out); -int syncop_lk (xlator_t *subvol, fd_t *fd, int cmd, struct gf_flock *flock); +int syncop_lk (xlator_t *subvol, fd_t *fd, int cmd, struct gf_flock *flock, +	       dict_t *xdata_in, dict_t **xdata_out); -int -syncop_inodelk (xlator_t *subvol, const char *volume, loc_t *loc, int32_t cmd, -                struct gf_flock *lock, dict_t *xdata_req, dict_t **xdata_rsp); +int syncop_inodelk (xlator_t *subvol, const char *volume, loc_t *loc, +                    int32_t cmd, struct gf_flock *lock, dict_t *xdata_in, +                    dict_t **xdata_out); -int -syncop_ipc (xlator_t *subvol, int op, dict_t *xdata_in, dict_t **xdata_out); +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); +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);  #endif /* _SYNCOP_H */ diff --git a/xlators/cluster/afr/src/afr-self-heal-data.c b/xlators/cluster/afr/src/afr-self-heal-data.c index d20b6945a7e..a8a7326e4ec 100644 --- a/xlators/cluster/afr/src/afr-self-heal-data.c +++ b/xlators/cluster/afr/src/afr-self-heal-data.c @@ -125,7 +125,7 @@ __afr_is_sink_zero_filled (xlator_t *this, fd_t *fd, size_t size,          priv = this->private;          ret = syncop_readv (priv->children[sink], fd, size, offset, 0, &iovec, -                            &count, &iobref); +                            &count, &iobref, NULL, NULL);          if (ret < 0)                  goto out;          ret = iov_0filled (iovec, count); @@ -155,7 +155,7 @@ __afr_selfheal_data_read_write (call_frame_t *frame, xlator_t *this, fd_t *fd,  	priv = this->private;  	ret = syncop_readv (priv->children[source], fd, size, offset, 0, -			    &iovec, &count, &iobref); +			    &iovec, &count, &iobref, NULL, NULL);  	if (ret <= 0)  		return ret; @@ -204,7 +204,7 @@ __afr_selfheal_data_read_write (call_frame_t *frame, xlator_t *this, fd_t *fd,                  }  		ret = syncop_writev (priv->children[i], fd, iovec, count, -				     offset, iobref, 0); +				     offset, iobref, 0, NULL, NULL);  		if (ret != iov_length (iovec, count)) {  			/* write() failed on this sink. unset the corresponding  			   member in sinks[] (which is healed_sinks[] in the @@ -750,7 +750,7 @@ afr_selfheal_data_open (xlator_t *this, inode_t *inode)  	loc.inode = inode_ref (inode);  	gf_uuid_copy (loc.gfid, inode->gfid); -	ret = syncop_open (this, &loc, O_RDWR|O_LARGEFILE, fd); +	ret = syncop_open (this, &loc, O_RDWR|O_LARGEFILE, fd, NULL, NULL);  	if (ret) {  		fd_unref (fd);  		fd = NULL; diff --git a/xlators/cluster/afr/src/afr-self-heal-entry.c b/xlators/cluster/afr/src/afr-self-heal-entry.c index 1f3ea38ffd9..ab0d98bd014 100644 --- a/xlators/cluster/afr/src/afr-self-heal-entry.c +++ b/xlators/cluster/afr/src/afr-self-heal-entry.c @@ -56,7 +56,7 @@ afr_selfheal_entry_delete (xlator_t *this, inode_t *dir, const char *name,  				uuid_utoa (dir->gfid), name,  				uuid_utoa_r (replies[child].poststat.ia_gfid, g),  				subvol->name); -			ret = syncop_rmdir (subvol, &loc, 1); +			ret = syncop_rmdir (subvol, &loc, 1, NULL, NULL);  			break;  		default:  			gf_log (this->name, GF_LOG_WARNING, @@ -64,7 +64,7 @@ afr_selfheal_entry_delete (xlator_t *this, inode_t *dir, const char *name,  				uuid_utoa (dir->gfid), name,  				uuid_utoa_r (replies[child].poststat.ia_gfid, g),  				subvol->name); -			ret = syncop_unlink (subvol, &loc); +			ret = syncop_unlink (subvol, &loc, NULL, NULL);  			break;  		}  	} @@ -119,21 +119,23 @@ afr_selfheal_recreate_entry (xlator_t *this, int dst, int source, inode_t *dir,  	switch (iatt->ia_type) {  	case IA_IFDIR: -		ret = syncop_mkdir (priv->children[dst], &loc, mode, xdata, 0); +		ret = syncop_mkdir (priv->children[dst], &loc, mode, 0, +                                    xdata, NULL);                  if (ret == 0)                          newentry[dst] = 1;  		break;  	case IA_IFLNK:  		ret = syncop_lookup (priv->children[dst], &srcloc, 0, 0, 0, 0);  		if (ret == 0) { -			ret = syncop_link (priv->children[dst], &srcloc, &loc); +			ret = syncop_link (priv->children[dst], &srcloc, &loc, +					   NULL, NULL);  		} else {  			ret = syncop_readlink (priv->children[source], &srcloc, -					       &linkname, 4096); +					       &linkname, 4096, NULL, NULL);  			if (ret <= 0)  				goto out; -			ret = syncop_symlink (priv->children[dst], &loc, linkname, -					      xdata, NULL); +			ret = syncop_symlink (priv->children[dst], &loc, +                                              linkname, NULL, xdata, NULL);                          if (ret == 0)                                  newentry[dst] = 1;                  } @@ -143,7 +145,7 @@ afr_selfheal_recreate_entry (xlator_t *this, int dst, int source, inode_t *dir,  		if (ret)  			goto out;  		ret = syncop_mknod (priv->children[dst], &loc, mode, -				    iatt->ia_rdev, xdata, &newent); +				    iatt->ia_rdev, &newent, xdata, NULL);  		if (ret == 0 && newent.ia_nlink == 1) {  			/* New entry created. Mark @dst pending on all sources */                          newentry[dst] = 1; @@ -508,7 +510,8 @@ afr_selfheal_entry_do_subvol (call_frame_t *frame, xlator_t *this,  	if (!iter_frame)  		return -ENOMEM; -	while ((ret = syncop_readdir (subvol, fd, 131072, offset, &entries))) { +	while ((ret = syncop_readdir (subvol, fd, 131072, offset, &entries, +                                      NULL, NULL))) {  		if (ret > 0)  			ret = 0;  		list_for_each_entry (entry, &entries.list, list) { @@ -682,7 +685,7 @@ afr_selfheal_data_opendir (xlator_t *this, inode_t *inode)  	loc.inode = inode_ref (inode);  	gf_uuid_copy (loc.gfid, inode->gfid); -	ret = syncop_opendir (this, &loc, fd); +	ret = syncop_opendir (this, &loc, fd, NULL, NULL);  	if (ret) {  		fd_unref (fd);  		fd = NULL; diff --git a/xlators/cluster/afr/src/afr-self-heal-metadata.c b/xlators/cluster/afr/src/afr-self-heal-metadata.c index 3d76647e974..11c0c9c8cd9 100644 --- a/xlators/cluster/afr/src/afr-self-heal-metadata.c +++ b/xlators/cluster/afr/src/afr-self-heal-metadata.c @@ -55,7 +55,7 @@ __afr_selfheal_metadata_do (call_frame_t *frame, xlator_t *this, inode_t *inode,  		uuid_utoa (inode->gfid));  	ret = syncop_getxattr (priv->children[source], &loc, &xattr, NULL, -                               NULL); +                               NULL, NULL);  	if (ret < 0) {  		ret = -EIO;                  goto out; @@ -74,19 +74,20 @@ __afr_selfheal_metadata_do (call_frame_t *frame, xlator_t *this, inode_t *inode,  		ret = syncop_setattr (priv->children[i], &loc,  				      &locked_replies[source].poststat, -				      AFR_HEAL_ATTR, NULL, NULL); +				      AFR_HEAL_ATTR, NULL, NULL, NULL, NULL);  		if (ret)  			healed_sinks[i] = 0;  		ret = syncop_getxattr (priv->children[i], &loc, &old_xattr, 0, -                                       NULL); +                                       NULL, NULL);  		if (old_xattr) {  			afr_delete_ignorable_xattrs (old_xattr);  			ret = syncop_removexattr (priv->children[i], &loc, "", -						  old_xattr); +						  old_xattr, NULL);  		} -		ret = syncop_setxattr (priv->children[i], &loc, xattr, 0); +		ret = syncop_setxattr (priv->children[i], &loc, xattr, 0, NULL, +                                       NULL);  		if (ret)  			healed_sinks[i] = 0;  	} diff --git a/xlators/cluster/afr/src/afr-self-heal-name.c b/xlators/cluster/afr/src/afr-self-heal-name.c index 12163298f7e..ba9c3eeb6ea 100644 --- a/xlators/cluster/afr/src/afr-self-heal-name.c +++ b/xlators/cluster/afr/src/afr-self-heal-name.c @@ -177,7 +177,8 @@ __afr_selfheal_name_expunge (xlator_t *this, inode_t *parent, uuid_t pargfid,  				uuid_utoa (pargfid), bname,  				uuid_utoa_r (replies[i].poststat.ia_gfid, g),  				priv->children[i]->name); -			ret |= syncop_rmdir (priv->children[i], &loc, 1); +			ret |= syncop_rmdir (priv->children[i], &loc, 1, NULL, +                                             NULL);  			break;  		default:  			gf_log (this->name, GF_LOG_WARNING, @@ -185,7 +186,8 @@ __afr_selfheal_name_expunge (xlator_t *this, inode_t *parent, uuid_t pargfid,  				uuid_utoa (pargfid), bname,  				uuid_utoa_r (replies[i].poststat.ia_gfid, g),  				priv->children[i]->name); -			ret |= syncop_unlink (priv->children[i], &loc); +			ret |= syncop_unlink (priv->children[i], &loc, NULL, +                                              NULL);  			break;  		}  	} diff --git a/xlators/cluster/afr/src/afr-self-heald.c b/xlators/cluster/afr/src/afr-self-heald.c index 0d8d5294f49..fe9367597a2 100644 --- a/xlators/cluster/afr/src/afr-self-heald.c +++ b/xlators/cluster/afr/src/afr-self-heald.c @@ -173,7 +173,7 @@ afr_shd_inode_find (xlator_t *this, xlator_t *subvol, uuid_t gfid)  		goto out;  	gf_uuid_copy (loc.gfid, gfid); -	ret = syncop_lookup (subvol, &loc, NULL, &iatt, NULL, NULL); +	ret = syncop_lookup (subvol, &loc, &iatt, NULL, NULL, NULL);  	if (ret < 0)  		goto out; @@ -199,7 +199,7 @@ afr_shd_index_inode (xlator_t *this, xlator_t *subvol)  	gf_uuid_copy (rootloc.gfid, rootloc.inode->gfid);  	ret = syncop_getxattr (subvol, &rootloc, &xattr, -			       GF_XATTROP_INDEX_GFID, NULL); +			       GF_XATTROP_INDEX_GFID, NULL, NULL);  	if (ret || !xattr) {  		errno = -ret;  		goto out; @@ -232,7 +232,7 @@ afr_shd_index_purge (xlator_t *subvol, inode_t *inode, char *name)  	loc.parent = inode_ref (inode);  	loc.name = name; -	ret = syncop_unlink (subvol, &loc); +	ret = syncop_unlink (subvol, &loc, NULL, NULL);  	loc_wipe (&loc);  	return ret; @@ -1038,7 +1038,7 @@ afr_shd_get_index_count (xlator_t *this, int i, uint64_t *count)  	gf_uuid_copy (rootloc.gfid, rootloc.inode->gfid);  	ret = syncop_getxattr (subvol, &rootloc, &xattr, -			       GF_XATTROP_INDEX_COUNT, NULL); +			       GF_XATTROP_INDEX_COUNT, NULL, NULL);  	if (ret < 0)  		goto out; diff --git a/xlators/cluster/afr/src/pump.c b/xlators/cluster/afr/src/pump.c index 139c9b6c447..ff8f5866f10 100644 --- a/xlators/cluster/afr/src/pump.c +++ b/xlators/cluster/afr/src/pump.c @@ -287,7 +287,8 @@ pump_save_path (xlator_t *this, const char *path)                  gf_log (this->name, GF_LOG_WARNING,                          "%s: failed to set the key %s", path, PUMP_PATH); -        ret = syncop_setxattr (PUMP_SOURCE_CHILD (this), &loc, dict, 0); +        ret = syncop_setxattr (PUMP_SOURCE_CHILD (this), &loc, dict, 0, NULL, +                               NULL);          if (ret < 0) {                  gf_log (this->name, GF_LOG_INFO, @@ -464,7 +465,7 @@ gf_pump_traverse_directory (loc_t *loc)                  goto out;          } -        ret = syncop_opendir (this, loc, fd); +        ret = syncop_opendir (this, loc, fd, NULL, NULL);          if (ret < 0) {                  gf_log (this->name, GF_LOG_DEBUG,                          "opendir failed on %s", loc->path); @@ -475,7 +476,8 @@ gf_pump_traverse_directory (loc_t *loc)                  "pump opendir on %s returned=%d",                  loc->path, ret); -        while (syncop_readdirp (this, fd, 131072, offset, NULL, &entries)) { +        while (syncop_readdirp (this, fd, 131072, offset, &entries, NULL, +                                NULL)) {                  free_entries = _gf_true;                  if (list_empty (&entries.list)) { @@ -511,8 +513,8 @@ gf_pump_traverse_directory (loc_t *loc)  				entry_loc.path,  				iatt.ia_ino); -			ret = syncop_lookup (this, &entry_loc, NULL, &iatt, -					     &xattr_rsp, &parent); +			ret = syncop_lookup (this, &entry_loc, &iatt, &parent, +					     NULL, &xattr_rsp);  			if (ret) {  				gf_log (this->name, GF_LOG_ERROR, @@ -625,14 +627,14 @@ pump_xattr_cleaner (call_frame_t *frame, void *cookie, xlator_t *this,          afr_build_root_loc (this, &loc);          ret = syncop_removexattr (priv->children[source], &loc, -				  PUMP_PATH, 0); +				  PUMP_PATH, 0, NULL);          ret = syncop_removexattr (priv->children[sink], &loc, -                                  PUMP_SINK_COMPLETE, 0); +                                  PUMP_SINK_COMPLETE, 0, NULL);          for (i = 0; i < priv->child_count; i++) {                  ret = syncop_removexattr (priv->children[i], &loc, -                                          PUMP_SOURCE_COMPLETE, 0); +                                          PUMP_SOURCE_COMPLETE, 0, NULL);                  if (ret) {                          gf_log (this->name, GF_LOG_DEBUG, "removexattr "                                  "failed with %s", strerror (-ret)); @@ -676,7 +678,8 @@ pump_complete_migration (xlator_t *this)                                  "%s: failed to set the key %s",                                  loc.path, PUMP_SOURCE_COMPLETE); -                ret = syncop_setxattr (PUMP_SOURCE_CHILD (this), &loc, dict, 0); +                ret = syncop_setxattr (PUMP_SOURCE_CHILD (this), &loc, dict, 0, +                                       NULL, NULL);                  if (ret < 0) {                          gf_log (this->name, GF_LOG_DEBUG,                                  "setxattr failed - while  notifying source complete"); @@ -687,7 +690,8 @@ pump_complete_migration (xlator_t *this)                                  "%s: failed to set the key %s",                                  loc.path, PUMP_SINK_COMPLETE); -                ret = syncop_setxattr (PUMP_SINK_CHILD (this), &loc, dict, 0); +                ret = syncop_setxattr (PUMP_SINK_CHILD (this), &loc, dict, 0, +                                       NULL, NULL);                  if (ret < 0) {                          gf_log (this->name, GF_LOG_DEBUG,                                  "setxattr failed - while notifying sink complete"); @@ -722,8 +726,8 @@ pump_lookup_sink (loc_t *loc)          if (ret)                  goto out; -        ret = syncop_lookup (PUMP_SINK_CHILD (this), loc, -                             xattr_req, &iatt, &xattr_rsp, &parent); +        ret = syncop_lookup (PUMP_SINK_CHILD (this), loc, &iatt, &parent, +                             xattr_req, &xattr_rsp);          if (ret) {                  gf_log (this->name, GF_LOG_DEBUG, @@ -768,8 +772,8 @@ pump_task (void *data)          }          afr_set_root_gfid (xattr_req); -        ret = syncop_lookup (this, &loc, xattr_req, -                             &iatt, &xattr_rsp, &parent); +        ret = syncop_lookup (this, &loc, &iatt, &parent, +                             xattr_req, &xattr_rsp);          gf_log (this->name, GF_LOG_TRACE,                  "lookup: path=%s gfid=%s", diff --git a/xlators/cluster/dht/src/dht-helper.c b/xlators/cluster/dht/src/dht-helper.c index 35d3d0f9dba..cab66017b84 100644 --- a/xlators/cluster/dht/src/dht-helper.c +++ b/xlators/cluster/dht/src/dht-helper.c @@ -846,11 +846,11 @@ dht_migration_complete_check_task (void *data)          if (!local->loc.inode) {                  ret = syncop_fgetxattr (src_node, local->fd, &dict, -                                        conf->link_xattr_name, NULL); +                                        conf->link_xattr_name, NULL, NULL);          } else {                  SYNCTASK_SETID (0, 0);                  ret = syncop_getxattr (src_node, &local->loc, &dict, -                                       conf->link_xattr_name, NULL); +                                       conf->link_xattr_name, NULL, NULL);                  SYNCTASK_SETID (frame->root->uid, frame->root->gid);          } @@ -880,8 +880,8 @@ dht_migration_complete_check_task (void *data)                  }                  /* Need to do lookup on hashed subvol, then get the file */ -                ret = syncop_lookup (this, &local->loc, NULL, &stbuf, NULL, -                                     NULL); +                ret = syncop_lookup (this, &local->loc, &stbuf, NULL, +                                     NULL, NULL);                  if (ret) {                          local->op_errno = -ret;                          ret = -1; @@ -902,8 +902,8 @@ dht_migration_complete_check_task (void *data)          /* lookup on dst */          if (local->loc.inode) { -                ret = syncop_lookup (dst_node, &local->loc, NULL, &stbuf, NULL, -                                     NULL); +                ret = syncop_lookup (dst_node, &local->loc, &stbuf, NULL, +                                     NULL, NULL);                  if (ret) {                          gf_log (this->name, GF_LOG_ERROR, @@ -990,7 +990,8 @@ dht_migration_complete_check_task (void *data)                   * truncate the file again as rebalance is moving the data */                  ret = syncop_open (dst_node, &tmp_loc,                                     (iter_fd->flags & -                                   ~(O_CREAT | O_EXCL | O_TRUNC)), iter_fd); +                                   ~(O_CREAT | O_EXCL | O_TRUNC)), iter_fd, +                                   NULL, NULL);                  if (ret < 0) {                          gf_log (this->name, GF_LOG_ERROR, "failed to open "                                  "the fd (%p, flags=0%o) on file %s @ %s", @@ -1073,11 +1074,11 @@ dht_rebalance_inprogress_task (void *data)          if (local->loc.inode) {                  SYNCTASK_SETID (0, 0);                  ret = syncop_getxattr (src_node, &local->loc, &dict, -                                       conf->link_xattr_name, NULL); +                                       conf->link_xattr_name, NULL, NULL);                  SYNCTASK_SETID (frame->root->uid, frame->root->gid);          } else {                  ret = syncop_fgetxattr (src_node, local->fd, &dict, -                                        conf->link_xattr_name, NULL); +                                        conf->link_xattr_name, NULL, NULL);          }          if (ret < 0) { @@ -1101,8 +1102,8 @@ dht_rebalance_inprogress_task (void *data)          if (local->loc.inode) {                  /* lookup on dst */ -                ret = syncop_lookup (dst_node, &local->loc, NULL, -                                     &stbuf, NULL, NULL); +                ret = syncop_lookup (dst_node, &local->loc, &stbuf, NULL, +                                     NULL, NULL);                  if (ret) {                          gf_log (this->name, GF_LOG_ERROR,                                  "%s: failed to lookup the file on %s", @@ -1145,7 +1146,8 @@ dht_rebalance_inprogress_task (void *data)                   * truncate the file again as rebalance is moving the data */                  ret = syncop_open (dst_node, &tmp_loc,                                     (iter_fd->flags & -                                   ~(O_CREAT | O_EXCL | O_TRUNC)), iter_fd); +                                   ~(O_CREAT | O_EXCL | O_TRUNC)), iter_fd, +                                   NULL, NULL);                  if (ret < 0) {                          gf_log (this->name, GF_LOG_ERROR, "failed to send open "                                  "the fd (%p, flags=0%o) on file %s @ %s", diff --git a/xlators/cluster/dht/src/dht-rebalance.c b/xlators/cluster/dht/src/dht-rebalance.c index 1aa68fb9f62..9f389c12213 100644 --- a/xlators/cluster/dht/src/dht-rebalance.c +++ b/xlators/cluster/dht/src/dht-rebalance.c @@ -54,7 +54,7 @@ dht_write_with_holes (xlator_t *to, fd_t *fd, struct iovec *vec, int count,                                  ret = syncop_write (to, fd, (buf + tmp_offset),                                                      (start_idx - tmp_offset),                                                      (offset + tmp_offset), -                                                    iobref, 0); +                                                    iobref, 0, NULL, NULL);                                  /* 'path' will be logged in calling function */                                  if (ret < 0) {                                          gf_log (THIS->name, GF_LOG_WARNING, @@ -73,7 +73,8 @@ dht_write_with_holes (xlator_t *to, fd_t *fd, struct iovec *vec, int count,                          /* This means, last chunk is not yet written.. write it */                          ret = syncop_write (to, fd, (buf + tmp_offset),                                              (buf_len - tmp_offset), -                                            (offset + tmp_offset), iobref, 0); +                                            (offset + tmp_offset), iobref, 0, +                                            NULL, NULL);                          if (ret < 0) {                                  /* 'path' will be logged in calling function */                                  gf_log (THIS->name, GF_LOG_WARNING, @@ -215,7 +216,8 @@ gf_defrag_handle_hardlink (xlator_t *this, loc_t *loc, dict_t  *xattrs,                          goto out;                  } -                ret = syncop_setxattr (cached_subvol, loc, link_xattr, 0); +                ret = syncop_setxattr (cached_subvol, loc, link_xattr, 0, NULL, +                                       NULL);                  if (ret) {                          gf_msg (this->name, GF_LOG_ERROR, 0,                                  DHT_MSG_MIGRATE_FILE_FAILED, @@ -237,7 +239,7 @@ gf_defrag_handle_hardlink (xlator_t *this, loc_t *loc, dict_t  *xattrs,                          hashed_subvol = linkto_subvol;                  } -                ret = syncop_link (hashed_subvol, loc, loc); +                ret = syncop_link (hashed_subvol, loc, loc, NULL, NULL);                  if  (ret) {                          op_errno = -ret;                          ret = -1; @@ -252,7 +254,7 @@ gf_defrag_handle_hardlink (xlator_t *this, loc_t *loc, dict_t  *xattrs,                                  goto out;                  }          } -        ret = syncop_lookup (hashed_subvol, loc, NULL, &iatt, NULL, NULL); +        ret = syncop_lookup (hashed_subvol, loc, &iatt, NULL, NULL, NULL);          if (ret) {                  gf_msg (this->name, GF_LOG_ERROR, -ret,                          DHT_MSG_MIGRATE_FILE_FAILED, @@ -378,7 +380,7 @@ __dht_rebalance_create_dst_file (xlator_t *to, xlator_t *from, loc_t *loc, struc                  goto out;          } -        ret = syncop_lookup (to, loc, NULL, &new_stbuf, NULL, NULL); +        ret = syncop_lookup (to, loc, &new_stbuf, NULL, NULL, NULL);          if (!ret) {                  /* File exits in the destination, check if gfid matches */                  if (gf_uuid_compare (stbuf->ia_gfid, new_stbuf.ia_gfid) != 0) { @@ -403,7 +405,7 @@ __dht_rebalance_create_dst_file (xlator_t *to, xlator_t *from, loc_t *loc, struc          /* Create the destination with LINKFILE mode, and linkto xattr,             if the linkfile already exists, it will just open the file */          ret = syncop_create (to, loc, O_RDWR, DHT_LINKFILE_MODE, fd, -                             dict, &new_stbuf); +                             &new_stbuf, dict, NULL);          if (ret < 0) {                  gf_msg (this->name, GF_LOG_ERROR, 0,                          DHT_MSG_MIGRATE_FILE_FAILED, @@ -425,7 +427,7 @@ __dht_rebalance_create_dst_file (xlator_t *to, xlator_t *from, loc_t *loc, struc           */ -        ret = syncop_lookup (to, loc, NULL, &check_stbuf, NULL, NULL); +        ret = syncop_lookup (to, loc, &check_stbuf, NULL, NULL, NULL);          if (!ret) {                  if (gf_uuid_compare (stbuf->ia_gfid, check_stbuf.ia_gfid) != 0) { @@ -450,14 +452,14 @@ __dht_rebalance_create_dst_file (xlator_t *to, xlator_t *from, loc_t *loc, struc                  goto out;          } -        ret = syncop_fsetxattr (to, fd, xattr, 0); +        ret = syncop_fsetxattr (to, fd, xattr, 0, NULL, NULL);          if (ret < 0)                  gf_msg (this->name, GF_LOG_WARNING, 0,                          DHT_MSG_MIGRATE_FILE_FAILED,                          "%s: failed to set xattr on %s (%s)",                          loc->path, to->name, strerror (-ret)); -        ret = syncop_ftruncate (to, fd, stbuf->ia_size); +        ret = syncop_ftruncate (to, fd, stbuf->ia_size, NULL, NULL);          if (ret < 0)                  gf_msg (this->name, GF_LOG_ERROR, 0,                          DHT_MSG_MIGRATE_FILE_FAILED, @@ -466,7 +468,7 @@ __dht_rebalance_create_dst_file (xlator_t *to, xlator_t *from, loc_t *loc, struc          ret = syncop_fsetattr (to, fd, stbuf,                                 (GF_SET_ATTR_UID | GF_SET_ATTR_GID), -                                NULL, NULL); +                                NULL, NULL, NULL, NULL);          if (ret < 0)                  gf_msg (this->name, GF_LOG_ERROR, 0,                          DHT_MSG_MIGRATE_FILE_FAILED, @@ -515,7 +517,7 @@ __dht_check_free_space (xlator_t *to, xlator_t *from, loc_t *loc,                  goto out;          } -        ret = syncop_statfs (from, loc, xdata, &src_statfs, NULL); +        ret = syncop_statfs (from, loc, &src_statfs, xdata, NULL);          if (ret) {                  gf_msg (this->name, GF_LOG_ERROR, 0,                          DHT_MSG_MIGRATE_FILE_FAILED, @@ -525,7 +527,7 @@ __dht_check_free_space (xlator_t *to, xlator_t *from, loc_t *loc,                  goto out;          } -        ret = syncop_statfs (to, loc, xdata, &dst_statfs, NULL); +        ret = syncop_statfs (to, loc, &dst_statfs, xdata, NULL);          if (ret) {                  gf_msg (this->name, GF_LOG_ERROR, 0,                          DHT_MSG_MIGRATE_FILE_FAILED, @@ -609,7 +611,8 @@ __dht_rebalance_migrate_data (xlator_t *from, xlator_t *to, fd_t *src, fd_t *dst                  read_size = (((ia_size - total) > DHT_REBALANCE_BLKSIZE) ?                               DHT_REBALANCE_BLKSIZE : (ia_size - total));                  ret = syncop_readv (from, src, read_size, -                                    offset, 0, &vector, &count, &iobref); +                                    offset, 0, &vector, &count, &iobref, NULL, +                                    NULL);                  if (!ret || (ret < 0)) {                          break;                  } @@ -619,7 +622,7 @@ __dht_rebalance_migrate_data (xlator_t *from, xlator_t *to, fd_t *src, fd_t *dst                                                      ret, offset, iobref);                  else                          ret = syncop_writev (to, dst, vector, count, -                                             offset, iobref, 0); +                                             offset, iobref, 0, NULL, NULL);                  if (ret < 0) {                          break;                  } @@ -668,7 +671,7 @@ __dht_rebalance_open_src_file (xlator_t *from, xlator_t *to, loc_t *loc,                  goto out;          } -        ret = syncop_open (from, loc, O_RDWR, fd); +        ret = syncop_open (from, loc, O_RDWR, fd, NULL, NULL);          if (ret < 0) {                  gf_msg (this->name, GF_LOG_ERROR, 0,                          DHT_MSG_MIGRATE_FILE_FAILED, @@ -693,7 +696,7 @@ __dht_rebalance_open_src_file (xlator_t *from, xlator_t *to, loc_t *loc,          /* Once the migration starts, the source should have 'linkto' key set             to show which is the target, so other clients can work around it */ -        ret = syncop_setxattr (from, loc, dict, 0); +        ret = syncop_setxattr (from, loc, dict, 0, NULL, NULL);          if (ret) {                  gf_msg (this->name, GF_LOG_ERROR, 0,                          DHT_MSG_MIGRATE_FILE_FAILED, @@ -709,7 +712,8 @@ __dht_rebalance_open_src_file (xlator_t *from, xlator_t *to, loc_t *loc,          iatt.ia_prot.sticky = 1;          iatt.ia_prot.sgid = 1; -        ret = syncop_setattr (from, loc, &iatt, GF_SET_ATTR_MODE, NULL, NULL); +        ret = syncop_setattr (from, loc, &iatt, GF_SET_ATTR_MODE, NULL, NULL, +                              NULL, NULL);          if (ret) {                  gf_msg (this->name, GF_LOG_ERROR, 0,                          DHT_MSG_MIGRATE_FILE_FAILED, @@ -754,7 +758,7 @@ migrate_special_files (xlator_t *this, xlator_t *from, xlator_t *to, loc_t *loc,          }          /* check in the destination if the file is link file */ -        ret = syncop_lookup (to, loc, dict, &stbuf, &rsp_dict, NULL); +        ret = syncop_lookup (to, loc, &stbuf, NULL, dict, &rsp_dict);          if ((ret < 0) && (-ret != ENOENT)) {                  gf_msg (this->name, GF_LOG_WARNING, 0,                          DHT_MSG_MIGRATE_FILE_FAILED, @@ -780,7 +784,7 @@ migrate_special_files (xlator_t *this, xlator_t *from, xlator_t *to, loc_t *loc,                  }                  /* as file is linkfile, delete it */ -                ret = syncop_unlink (to, loc); +                ret = syncop_unlink (to, loc, NULL, NULL);                  if (ret) {                          gf_msg (this->name, GF_LOG_WARNING, 0,                                  DHT_MSG_MIGRATE_FILE_FAILED, @@ -802,7 +806,8 @@ migrate_special_files (xlator_t *this, xlator_t *from, xlator_t *to, loc_t *loc,          /* Create the file in target */          if (IA_ISLNK (buf->ia_type)) {                  /* Handle symlinks separately */ -                ret = syncop_readlink (from, loc, &link, buf->ia_size); +                ret = syncop_readlink (from, loc, &link, buf->ia_size, NULL, +                                       NULL);                  if (ret < 0) {                          gf_msg (this->name, GF_LOG_WARNING, 0,                                  DHT_MSG_MIGRATE_FILE_FAILED, @@ -812,7 +817,7 @@ migrate_special_files (xlator_t *this, xlator_t *from, xlator_t *to, loc_t *loc,                          goto out;                  } -                ret = syncop_symlink (to, loc, link, dict, 0); +                ret = syncop_symlink (to, loc, link, 0, dict, NULL);                  if (ret) {                          gf_msg (this->name, GF_LOG_WARNING, 0,                                  DHT_MSG_MIGRATE_FILE_FAILED, @@ -828,7 +833,7 @@ migrate_special_files (xlator_t *this, xlator_t *from, xlator_t *to, loc_t *loc,          ret = syncop_mknod (to, loc, st_mode_from_ia (buf->ia_prot,                                                        buf->ia_type),                              makedev (ia_major (buf->ia_rdev), -                                     ia_minor (buf->ia_rdev)), dict, 0); +                                     ia_minor (buf->ia_rdev)), 0, dict, NULL);          if (ret) {                  gf_msg (this->name, GF_LOG_WARNING, 0,                          DHT_MSG_MIGRATE_FILE_FAILED, @@ -842,7 +847,7 @@ done:          ret = syncop_setattr (to, loc, buf,                                (GF_SET_ATTR_MTIME |                                 GF_SET_ATTR_UID | GF_SET_ATTR_GID | -                               GF_SET_ATTR_MODE), NULL, NULL); +                               GF_SET_ATTR_MODE), NULL, NULL, NULL, NULL);          if (ret) {                  gf_msg (this->name, GF_LOG_WARNING, 0,                          DHT_MSG_MIGRATE_FILE_FAILED, @@ -851,7 +856,7 @@ done:                  ret = -1;          } -        ret = syncop_unlink (from, loc); +        ret = syncop_unlink (from, loc, NULL, NULL);          if (ret) {                  gf_msg (this->name, GF_LOG_WARNING, 0,                          DHT_MSG_MIGRATE_FILE_FAILED, @@ -936,7 +941,7 @@ dht_migrate_file (xlator_t *this, loc_t *loc, xlator_t *from, xlator_t *to,          locked = _gf_true;          /* Phase 1 - Data migration is in progress from now on */ -        ret = syncop_lookup (from, loc, dict, &stbuf, &xattr_rsp, NULL); +        ret = syncop_lookup (from, loc, &stbuf, NULL, dict, &xattr_rsp);          if (ret) {                  gf_msg (this->name, GF_LOG_ERROR, 0,                          DHT_MSG_MIGRATE_FILE_FAILED, @@ -968,7 +973,7 @@ dht_migrate_file (xlator_t *this, loc_t *loc, xlator_t *from, xlator_t *to,          }          /* TODO: move all xattr related operations to fd based operations */ -        ret = syncop_listxattr (from, loc, &xattr); +        ret = syncop_listxattr (from, loc, &xattr, NULL, NULL);          if (ret < 0) {                  gf_msg (this->name, GF_LOG_WARNING, 0,                          DHT_MSG_MIGRATE_FILE_FAILED, @@ -1001,7 +1006,7 @@ dht_migrate_file (xlator_t *this, loc_t *loc, xlator_t *from, xlator_t *to,          } -        ret = syncop_fstat (from, src_fd, &stbuf); +        ret = syncop_fstat (from, src_fd, &stbuf, NULL, NULL);          if (ret) {                  gf_msg (this->name, GF_LOG_ERROR, -ret,                          DHT_MSG_MIGRATE_FILE_FAILED, @@ -1024,7 +1029,7 @@ dht_migrate_file (xlator_t *this, loc_t *loc, xlator_t *from, xlator_t *to,                          "Migrate file failed: %s: failed to migrate data",                          loc->path);                  /* reset the destination back to 0 */ -                ret = syncop_ftruncate (to, dst_fd, 0); +                ret = syncop_ftruncate (to, dst_fd, 0, NULL, NULL);                  if (ret) {                          gf_msg (this->name, GF_LOG_ERROR, 0,                                  DHT_MSG_MIGRATE_FILE_FAILED, @@ -1039,7 +1044,7 @@ dht_migrate_file (xlator_t *this, loc_t *loc, xlator_t *from, xlator_t *to,          /* TODO: Sync the locks */ -        ret = syncop_fsync (to, dst_fd, 0); +        ret = syncop_fsync (to, dst_fd, 0, NULL, NULL);          if (ret) {                  gf_log (this->name, GF_LOG_WARNING,                          "%s: failed to fsync on %s (%s)", @@ -1050,7 +1055,7 @@ dht_migrate_file (xlator_t *this, loc_t *loc, xlator_t *from, xlator_t *to,          /* Phase 2 - Data-Migration Complete, Housekeeping updates pending */ -        ret = syncop_fstat (from, src_fd, &new_stbuf); +        ret = syncop_fstat (from, src_fd, &new_stbuf, NULL, NULL);          if (ret < 0) {                  /* Failed to get the stat info */                  gf_msg ( this->name, GF_LOG_ERROR, -ret, @@ -1075,7 +1080,7 @@ dht_migrate_file (xlator_t *this, loc_t *loc, xlator_t *from, xlator_t *to,          ret = syncop_fsetattr (to, dst_fd, &new_stbuf,                                 (GF_SET_ATTR_UID | GF_SET_ATTR_GID | -                                GF_SET_ATTR_MODE), NULL, NULL); +                                GF_SET_ATTR_MODE), NULL, NULL, NULL, NULL);          if (ret) {                  gf_msg (this->name, GF_LOG_WARNING, -ret,                          DHT_MSG_MIGRATE_FILE_FAILED, @@ -1089,7 +1094,7 @@ dht_migrate_file (xlator_t *this, loc_t *loc, xlator_t *from, xlator_t *to,          /* Because 'futimes' is not portable */          ret = syncop_setattr (to, loc, &new_stbuf,                                (GF_SET_ATTR_MTIME | GF_SET_ATTR_ATIME), -                              NULL, NULL); +                              NULL, NULL, NULL, NULL);          if (ret) {                  gf_log (this->name, GF_LOG_WARNING,                          "%s: failed to perform setattr on %s ", @@ -1100,7 +1105,7 @@ dht_migrate_file (xlator_t *this, loc_t *loc, xlator_t *from, xlator_t *to,          /* Make the source as a linkfile first before deleting it */          empty_iatt.ia_prot.sticky = 1;          ret = syncop_fsetattr (from, src_fd, &empty_iatt, -                               GF_SET_ATTR_MODE, NULL, NULL); +                               GF_SET_ATTR_MODE, NULL, NULL, NULL, NULL);          if (ret) {                  gf_msg (this->name, GF_LOG_WARNING, -ret,                          DHT_MSG_MIGRATE_FILE_FAILED, @@ -1113,7 +1118,7 @@ dht_migrate_file (xlator_t *this, loc_t *loc, xlator_t *from, xlator_t *to,         /* Free up the data blocks on the source node, as the whole             file is migrated */ -        ret = syncop_ftruncate (from, src_fd, 0); +        ret = syncop_ftruncate (from, src_fd, 0, NULL, NULL);          if (ret) {                  gf_log (this->name, GF_LOG_WARNING,                          "%s: failed to perform truncate on %s (%s)", @@ -1122,7 +1127,7 @@ dht_migrate_file (xlator_t *this, loc_t *loc, xlator_t *from, xlator_t *to,          }          /* remove the 'linkto' xattr from the destination */ -        ret = syncop_fremovexattr (to, dst_fd, conf->link_xattr_name, 0); +        ret = syncop_fremovexattr (to, dst_fd, conf->link_xattr_name, 0, NULL);          if (ret) {                  gf_log (this->name, GF_LOG_WARNING,                          "%s: failed to perform removexattr on %s (%s)", @@ -1140,7 +1145,7 @@ dht_migrate_file (xlator_t *this, loc_t *loc, xlator_t *from, xlator_t *to,           * failure because of ENOENT should  not be treated as error           */ -        ret = syncop_stat (from, loc, &empty_iatt); +        ret = syncop_stat (from, loc, &empty_iatt, NULL, NULL);          if (ret) {                  gf_msg (this->name, GF_LOG_WARNING, 0,                          DHT_MSG_MIGRATE_FILE_FAILED, @@ -1158,7 +1163,7 @@ dht_migrate_file (xlator_t *this, loc_t *loc, xlator_t *from, xlator_t *to,          if ((gf_uuid_compare (empty_iatt.ia_gfid, loc->gfid) == 0 ) &&              (!rcvd_enoent_from_src)) {                  /* take out the source from namespace */ -                ret = syncop_unlink (from, loc); +                ret = syncop_unlink (from, loc, NULL, NULL);                  if (ret) {                          gf_msg (this->name, GF_LOG_WARNING, 0,                                  DHT_MSG_MIGRATE_FILE_FAILED, @@ -1438,7 +1443,7 @@ gf_defrag_migrate_data (xlator_t *this, gf_defrag_info_t *defrag, loc_t *loc,                  goto out;          } -        ret = syncop_opendir (this, loc, fd); +        ret = syncop_opendir (this, loc, fd, NULL, NULL);          if (ret) {                  gf_msg (this->name, GF_LOG_ERROR, 0,                          DHT_MSG_MIGRATE_DATA_FAILED, @@ -1450,8 +1455,8 @@ gf_defrag_migrate_data (xlator_t *this, gf_defrag_info_t *defrag, loc_t *loc,          INIT_LIST_HEAD (&entries.list); -        while ((ret = syncop_readdirp (this, fd, 131072, offset, NULL, -                                       &entries)) != 0) { +        while ((ret = syncop_readdirp (this, fd, 131072, offset, &entries, +                                       NULL, NULL)) != 0) {                  if (ret < 0) { @@ -1533,7 +1538,7 @@ gf_defrag_migrate_data (xlator_t *this, gf_defrag_info_t *defrag, loc_t *loc,                          entry_loc.inode->ia_type = entry->d_stat.ia_type; -                        ret = syncop_lookup (this, &entry_loc, NULL, &iatt, +                        ret = syncop_lookup (this, &entry_loc, &iatt, NULL,                                               NULL, NULL);                          if (ret) {                                  gf_msg (this->name, GF_LOG_ERROR, 0, @@ -1545,7 +1550,8 @@ gf_defrag_migrate_data (xlator_t *this, gf_defrag_info_t *defrag, loc_t *loc,                          }                          ret = syncop_getxattr (this, &entry_loc, &dict, -                                               GF_XATTR_NODE_UUID_KEY, NULL); +                                               GF_XATTR_NODE_UUID_KEY, NULL, +                                               NULL);                          if(ret < 0) {                                  gf_msg (this->name, GF_LOG_ERROR, 0,                                          DHT_MSG_MIGRATE_FILE_FAILED, @@ -1592,7 +1598,8 @@ gf_defrag_migrate_data (xlator_t *this, gf_defrag_info_t *defrag, loc_t *loc,                           * migrated */                          ret = syncop_getxattr (this, &entry_loc, NULL, -                                               GF_XATTR_LINKINFO_KEY, NULL); +                                               GF_XATTR_LINKINFO_KEY, NULL, +                                               NULL);                          if (ret < 0) {                                  if (-ret != ENODATA) {                                          loglevel = GF_LOG_ERROR; @@ -1608,7 +1615,7 @@ gf_defrag_migrate_data (xlator_t *this, gf_defrag_info_t *defrag, loc_t *loc,                          }                          ret = syncop_setxattr (this, &entry_loc, migrate_data, -                                               0); +                                               0, NULL, NULL);                          if (ret < 0) {                                  op_errno = -ret;                                  /* errno is overloaded. See @@ -1707,7 +1714,7 @@ gf_defrag_fix_layout (xlator_t *this, gf_defrag_info_t *defrag, loc_t *loc,          struct iatt              iatt           = {0,};          inode_t                 *linked_inode   = NULL, *inode = NULL; -        ret = syncop_lookup (this, loc, NULL, &iatt, NULL, NULL); +        ret = syncop_lookup (this, loc, &iatt, NULL, NULL, NULL);          if (ret) {                  gf_log (this->name, GF_LOG_ERROR, "Lookup failed on %s",                          loc->path); @@ -1731,7 +1738,7 @@ gf_defrag_fix_layout (xlator_t *this, gf_defrag_info_t *defrag, loc_t *loc,                  goto out;          } -        ret = syncop_opendir (this, loc, fd); +        ret = syncop_opendir (this, loc, fd, NULL, NULL);          if (ret) {                  gf_log (this->name, GF_LOG_ERROR, "Failed to open dir %s",                          loc->path); @@ -1740,8 +1747,8 @@ gf_defrag_fix_layout (xlator_t *this, gf_defrag_info_t *defrag, loc_t *loc,          }          INIT_LIST_HEAD (&entries.list); -        while ((ret = syncop_readdirp (this, fd, 131072, offset, NULL, -                &entries)) != 0) +        while ((ret = syncop_readdirp (this, fd, 131072, offset, &entries, +                                       NULL, NULL)) != 0)          {                  if (ret < 0) { @@ -1814,7 +1821,7 @@ gf_defrag_fix_layout (xlator_t *this, gf_defrag_info_t *defrag, loc_t *loc,                          gf_uuid_copy (entry_loc.pargfid, loc->gfid); -                        ret = syncop_lookup (this, &entry_loc, NULL, &iatt, +                        ret = syncop_lookup (this, &entry_loc, &iatt, NULL,                                               NULL, NULL);                          if (ret) {                                  gf_log (this->name, GF_LOG_ERROR, "%s" @@ -1824,7 +1831,7 @@ gf_defrag_fix_layout (xlator_t *this, gf_defrag_info_t *defrag, loc_t *loc,                          }                          ret = syncop_setxattr (this, &entry_loc, fix_layout, -                                               0); +                                               0, NULL, NULL);                          if (ret) {                                  gf_log (this->name, GF_LOG_ERROR, "Setxattr "                                          "failed for %s", entry_loc.path); @@ -1907,7 +1914,7 @@ gf_defrag_start_crawl (void *data)          /* fix-layout on '/' first */ -        ret = syncop_lookup (this, &loc, NULL, &iatt, NULL, &parent); +        ret = syncop_lookup (this, &loc, &iatt, &parent, NULL, NULL);          if (ret) {                  gf_msg (this->name, GF_LOG_ERROR, 0, @@ -1934,7 +1941,7 @@ gf_defrag_start_crawl (void *data)                  goto out;          } -        ret = syncop_setxattr (this, &loc, fix_layout, 0); +        ret = syncop_setxattr (this, &loc, fix_layout, 0, NULL, NULL);          if (ret) {                  gf_msg (this->name, GF_LOG_ERROR, 0,                          DHT_MSG_REBALANCE_FAILED, diff --git a/xlators/cluster/dht/src/dht-selfheal.c b/xlators/cluster/dht/src/dht-selfheal.c index f0f44ebf77a..260c50083df 100644 --- a/xlators/cluster/dht/src/dht-selfheal.c +++ b/xlators/cluster/dht/src/dht-selfheal.c @@ -1913,7 +1913,7 @@ dht_dir_attr_heal (void *data)                          continue;                  ret = syncop_setattr (subvol, &local->loc, &local->stbuf,                                        (GF_SET_ATTR_UID | GF_SET_ATTR_GID), -                                      NULL, NULL); +                                      NULL, NULL, NULL, NULL);                  if (ret) {                          gf_uuid_unparse(local->loc.gfid, gfid); diff --git a/xlators/cluster/dht/src/tier.c b/xlators/cluster/dht/src/tier.c index fe18d7b91a9..cf481c5e7f2 100644 --- a/xlators/cluster/dht/src/tier.c +++ b/xlators/cluster/dht/src/tier.c @@ -84,7 +84,8 @@ tier_check_same_node (xlator_t *this, loc_t *loc, gf_defrag_info_t *defrag)          GF_VALIDATE_OR_GOTO (this->name, loc, out);          GF_VALIDATE_OR_GOTO (this->name, defrag, out); -        if (syncop_getxattr (this, loc, &dict, GF_XATTR_NODE_UUID_KEY, NULL)) { +        if (syncop_getxattr (this, loc, &dict, GF_XATTR_NODE_UUID_KEY, +                             NULL, NULL)) {                  gf_msg (this->name, GF_LOG_ERROR, 0, DHT_MSG_LOG_TIER_ERROR,                          "Unable to get NODE_UUID_KEY %s %s\n",                          loc->name, loc->path); @@ -252,7 +253,7 @@ tier_migrate_using_query_file (void *_args)                                  goto error;                          } -                        ret = syncop_lookup (this, &p_loc, NULL, &par_stbuf, +                        ret = syncop_lookup (this, &p_loc, &par_stbuf, NULL,                                               NULL, NULL);                          if (ret) {                                  gf_msg (this->name, GF_LOG_ERROR, 0, @@ -291,7 +292,7 @@ tier_migrate_using_query_file (void *_args)                          gf_uuid_copy (loc.parent->gfid, link_info->pargfid); -                        ret = syncop_lookup (this, &loc, NULL, ¤t, +                        ret = syncop_lookup (this, &loc, ¤t, NULL,                                               NULL, NULL);                          if (ret) {                                  gf_msg (this->name, GF_LOG_ERROR, 0, @@ -335,7 +336,8 @@ tier_migrate_using_query_file (void *_args)                                  goto error;                          } -                        ret = syncop_setxattr (this, &loc, migrate_data, 0); +                        ret = syncop_setxattr (this, &loc, migrate_data, 0, +                                               NULL, NULL);                          if (ret) {                                  gf_msg (this->name, GF_LOG_ERROR, 0,                                          DHT_MSG_LOG_TIER_ERROR, "ERROR %d in " diff --git a/xlators/cluster/ec/src/ec-heald.c b/xlators/cluster/ec/src/ec-heald.c index c4b896a5fb3..53b3996590c 100644 --- a/xlators/cluster/ec/src/ec-heald.c +++ b/xlators/cluster/ec/src/ec-heald.c @@ -146,7 +146,7 @@ ec_shd_inode_find (xlator_t *this, xlator_t *subvol, uuid_t gfid)                  goto out;          gf_uuid_copy (loc.gfid, gfid); -        ret = syncop_lookup (subvol, &loc, NULL, &iatt, NULL, NULL); +        ret = syncop_lookup (subvol, &loc, &iatt, NULL, NULL, NULL);          if (ret < 0)                  goto out; @@ -172,7 +172,7 @@ ec_shd_index_inode (xlator_t *this, xlator_t *subvol)          gf_uuid_copy (rootloc.gfid, rootloc.inode->gfid);          ret = syncop_getxattr (subvol, &rootloc, &xattr, -                               GF_XATTROP_INDEX_GFID, NULL); +                               GF_XATTROP_INDEX_GFID, NULL, NULL);          if (ret || !xattr) {                  errno = -ret;                  goto out; @@ -205,7 +205,7 @@ ec_shd_index_purge (xlator_t *subvol, inode_t *inode, char *name)          loc.parent = inode_ref (inode);          loc.name = name; -        ret = syncop_unlink (subvol, &loc); +        ret = syncop_unlink (subvol, &loc, NULL, NULL);          loc_wipe (&loc);          return ret; @@ -214,7 +214,8 @@ ec_shd_index_purge (xlator_t *subvol, inode_t *inode, char *name)  int  ec_shd_selfheal (struct subvol_healer *healer, int child, loc_t *loc)  { -        return syncop_getxattr (healer->this, loc, NULL, EC_XATTR_HEAL, NULL); +        return syncop_getxattr (healer->this, loc, NULL, EC_XATTR_HEAL, NULL, +                                NULL);  } diff --git a/xlators/features/bit-rot/src/bitd/bit-rot-scrub.c b/xlators/features/bit-rot/src/bitd/bit-rot-scrub.c index d2b179027a2..1e9c2035c81 100644 --- a/xlators/features/bit-rot/src/bitd/bit-rot-scrub.c +++ b/xlators/features/bit-rot/src/bitd/bit-rot-scrub.c @@ -36,7 +36,7 @@ bitd_fetch_signature (xlator_t *this, br_child_t *child,         int32_t ret = -1;          ret = syncop_fgetxattr (child->xl, fd, xattr, -                               GLUSTERFS_GET_OBJECT_SIGNATURE, NULL); +                               GLUSTERFS_GET_OBJECT_SIGNATURE, NULL, NULL);          if (ret < 0) {                  br_log_object (this, "fgetxattr", fd->inode->gfid, -ret);                  goto out; @@ -224,7 +224,7 @@ bitd_compare_ckum (xlator_t *this,          gf_log (this->name, GF_LOG_INFO, "Marking %s [GFID: %s] as corrupted..",                  entry->d_name, uuid_utoa (linked_inode->gfid)); -        ret = syncop_fsetxattr (child->xl, fd, xattr, 0); +        ret = syncop_fsetxattr (child->xl, fd, xattr, 0, NULL, NULL);          if (ret)                  gf_log (this->name, GF_LOG_ERROR,                          "Error marking object %s [GFID: %s] as corrupted", @@ -274,7 +274,7 @@ bitd_start_scrub (xlator_t *subvol,          syncopctx_setfspid (&pid); -        ret = syncop_lookup (child->xl, &loc, NULL, &iatt, NULL, &parent_buf); +        ret = syncop_lookup (child->xl, &loc, &iatt, &parent_buf, NULL, NULL);          if (ret) {                  br_log_object_path (this, "lookup", loc.path, -ret);                  goto out; @@ -304,7 +304,7 @@ bitd_start_scrub (xlator_t *subvol,                  goto unref_inode;          } -        ret = syncop_open (child->xl, &loc, O_RDWR, fd); +        ret = syncop_open (child->xl, &loc, O_RDWR, fd, NULL, NULL);          if (ret) {                  br_log_object (this, "open", linked_inode->gfid, -ret);                  ret = -1; diff --git a/xlators/features/bit-rot/src/bitd/bit-rot.c b/xlators/features/bit-rot/src/bitd/bit-rot.c index 6a4de70bfbb..1202ca260eb 100644 --- a/xlators/features/bit-rot/src/bitd/bit-rot.c +++ b/xlators/features/bit-rot/src/bitd/bit-rot.c @@ -167,10 +167,12 @@ bitd_is_bad_file (xlator_t *this, br_child_t *child, loc_t *loc, fd_t *fd)          if (fd)                  ret = syncop_fgetxattr (child->xl, fd, &xattr, -                                        "trusted.glusterfs.bad-file", NULL); +                                        "trusted.glusterfs.bad-file", NULL, +                                        NULL);          else if (loc)                  ret = syncop_getxattr (child->xl, loc, &xattr, -                                       "trusted.glusterfs.bad-file", NULL); +                                       "trusted.glusterfs.bad-file", NULL, +                                       NULL);          if (!ret) {                  gf_log (this->name, GF_LOG_DEBUG, "[GFID: %s] is marked " @@ -213,7 +215,7 @@ br_object_lookup (xlator_t *this, br_object_t *object,  	gf_uuid_copy (loc.gfid, object->gfid); -	ret = syncop_lookup (object->child->xl, &loc, NULL, iatt, NULL, NULL); +	ret = syncop_lookup (object->child->xl, &loc, iatt, NULL, NULL, NULL);  	if (ret < 0)  		goto out; @@ -259,7 +261,7 @@ br_object_open (xlator_t *this,          loc.inode = inode_ref (inode);  	gf_uuid_copy (loc.gfid, inode->gfid); -        ret = syncop_open (object->child->xl, &loc, O_RDONLY, fd); +        ret = syncop_open (object->child->xl, &loc, O_RDONLY, fd, NULL, NULL);  	if (ret) {                  br_log_object (this, "open", inode->gfid, -ret);  		fd_unref (fd); @@ -295,7 +297,8 @@ br_object_read_block_and_sign (xlator_t *this, fd_t *fd, br_child_t *child,          GF_VALIDATE_OR_GOTO (this->name, child, out);          ret = syncop_readv (child->xl, fd, -                            size, offset, 0, &iovec, &count, &iobref); +                            size, offset, 0, &iovec, &count, &iobref, NULL, +                            NULL);          if (ret < 0) {                  gf_log (this->name, GF_LOG_ERROR, "readv on %s failed (%s)", @@ -422,7 +425,7 @@ br_object_read_sign (inode_t *linked_inode, fd_t *fd, br_object_t *object,                  goto free_isign;          } -        ret = syncop_fsetxattr (object->child->xl, fd, xattr, 0); +        ret = syncop_fsetxattr (object->child->xl, fd, xattr, 0, NULL, NULL);          if (ret) {                  gf_log (this->name, GF_LOG_ERROR, "fsetxattr of signature to "                          "the object %s failed", uuid_utoa (fd->inode->gfid)); @@ -799,7 +802,7 @@ br_trigger_sign (xlator_t *this, br_child_t *child, inode_t *linked_inode,                  goto out;          } -        ret = syncop_open (child->xl, loc, O_RDWR, fd); +        ret = syncop_open (child->xl, loc, O_RDWR, fd, NULL, NULL);  	if (ret) {                  br_log_object (this, "open", linked_inode->gfid, -ret);  		fd_unref (fd); @@ -891,7 +894,7 @@ bitd_oneshot_crawl (xlator_t *subvol,          if (!ret)                  goto out; -        ret = syncop_lookup (child->xl, &loc, NULL, &iatt, NULL, &parent_buf); +        ret = syncop_lookup (child->xl, &loc, &iatt, &parent_buf, NULL, NULL);          if (ret) {                  br_log_object_path (this, "lookup", loc.path, -ret);                  goto out; @@ -931,7 +934,7 @@ bitd_oneshot_crawl (xlator_t *subvol,          }          ret = syncop_getxattr (child->xl, &loc, &xattr, -                               GLUSTERFS_GET_OBJECT_SIGNATURE, NULL); +                               GLUSTERFS_GET_OBJECT_SIGNATURE, NULL, NULL);          if (ret < 0) {                  op_errno = -ret;                  br_log_object (this, "getxattr", linked_inode->gfid, op_errno); @@ -1088,7 +1091,7 @@ br_brick_connect (xlator_t *this, br_child_t *child)          gf_uuid_copy (loc.gfid, loc.inode->gfid);          loc.path = gf_strdup ("/"); -        ret = syncop_lookup (child->xl, &loc, NULL, &buf, NULL, &parent); +        ret = syncop_lookup (child->xl, &loc, &buf, &parent, NULL, NULL);          if (ret) {                  op_errno = -ret;                  ret = -1; @@ -1098,7 +1101,7 @@ br_brick_connect (xlator_t *this, br_child_t *child)          }          ret = syncop_getxattr (child->xl, &loc, &xattr, -                               GLUSTERFS_GET_BR_STUB_INIT_TIME, NULL); +                               GLUSTERFS_GET_BR_STUB_INIT_TIME, NULL, NULL);          if (ret) {                  op_errno = -ret;                  ret = -1; diff --git a/xlators/features/locks/src/posix.c b/xlators/features/locks/src/posix.c index ae513f3a28e..d17d0bbe108 100644 --- a/xlators/features/locks/src/posix.c +++ b/xlators/features/locks/src/posix.c @@ -550,7 +550,7 @@ fetch_pathinfo (xlator_t *this, inode_t *inode, int32_t *op_errno,          loc.inode = inode_ref (inode);          ret = syncop_getxattr (FIRST_CHILD(this), &loc, &dict, -                               GF_XATTR_PATHINFO_KEY, NULL); +                               GF_XATTR_PATHINFO_KEY, NULL, NULL);          if (ret < 0) {                  *op_errno = -ret;                  ret = -1; diff --git a/xlators/features/marker/src/marker-quota.c b/xlators/features/marker/src/marker-quota.c index 2975e564fa6..c6cf470e5a4 100644 --- a/xlators/features/marker/src/marker-quota.c +++ b/xlators/features/marker/src/marker-quota.c @@ -2100,8 +2100,8 @@ mq_are_xattrs_set (xlator_t *this, loc_t *loc, gf_boolean_t *result,          if (ret < 0)                  goto out; -        ret = syncop_lookup (FIRST_CHILD(this), loc, dict, &stbuf, &rsp_dict, -                             NULL); +        ret = syncop_lookup (FIRST_CHILD(this), loc, &stbuf, NULL, +                             dict, &rsp_dict);          if (ret < 0) {                  gf_log (this->name, (-ret == ENOENT || -ret == ESTALE)                          ? GF_LOG_DEBUG:GF_LOG_ERROR, "lookup failed " @@ -2198,7 +2198,7 @@ mq_create_xattrs (xlator_t *this, loc_t *loc, gf_boolean_t objects)          }          ret = syncop_xattrop(FIRST_CHILD(this), loc, GF_XATTROP_ADD_ARRAY64, -                             dict, NULL); +                             dict, NULL, NULL);          if (ret < 0) {                  gf_log (this->name, (-ret == ENOENT || -ret == ESTALE) @@ -2264,8 +2264,8 @@ mq_get_dirty (xlator_t *this, loc_t *loc, int32_t *dirty)                  goto out;          } -        ret = syncop_lookup (FIRST_CHILD(this), loc, dict, &stbuf, &rsp_dict, -                             NULL); +        ret = syncop_lookup (FIRST_CHILD(this), loc, &stbuf, NULL, +                             dict, &rsp_dict);          if (ret < 0) {                  gf_log (this->name, (-ret == ENOENT || -ret == ESTALE)                          ? GF_LOG_DEBUG:GF_LOG_ERROR, "lookup failed " @@ -2311,7 +2311,7 @@ mq_mark_dirty (xlator_t *this, loc_t *loc, int32_t dirty)                  goto out;          } -        ret = syncop_setxattr (FIRST_CHILD(this), loc, dict, 0); +        ret = syncop_setxattr (FIRST_CHILD(this), loc, dict, 0, NULL, NULL);          if (ret < 0) {                  gf_log (this->name, (-ret == ENOENT || -ret == ESTALE)                          ? GF_LOG_DEBUG:GF_LOG_ERROR, "setxattr dirty = %d " @@ -2377,8 +2377,8 @@ _mq_get_metadata (xlator_t *this, loc_t *loc, quota_meta_t *contri,                          goto out;          } -        ret = syncop_lookup (FIRST_CHILD(this), loc, dict, &stbuf, &rsp_dict, -                             NULL); +        ret = syncop_lookup (FIRST_CHILD(this), loc, &stbuf, NULL, +                             dict, &rsp_dict);          if (ret < 0) {                  gf_log (this->name, (-ret == ENOENT || -ret == ESTALE)                          ? GF_LOG_DEBUG:GF_LOG_ERROR, "lookup failed " @@ -2548,7 +2548,7 @@ mq_remove_contri (xlator_t *this, loc_t *loc, inode_contribution_t *contri)                  goto out;          } -        ret = syncop_removexattr (FIRST_CHILD(this), loc, contri_key, 0); +        ret = syncop_removexattr (FIRST_CHILD(this), loc, contri_key, 0, NULL);          if (ret < 0) {                  if (-ret == ENOENT || -ret == ESTALE) {                          /* Remove contri in done when unlink operation is @@ -2615,7 +2615,7 @@ mq_update_contri (xlator_t *this, loc_t *loc, inode_contribution_t *contri,                  goto out;          ret = syncop_xattrop(FIRST_CHILD(this), loc, GF_XATTROP_ADD_ARRAY64, -                             dict, NULL); +                             dict, NULL, NULL);          if (ret < 0) {                  gf_log (this->name, (-ret == ENOENT || -ret == ESTALE)                          ? GF_LOG_DEBUG:GF_LOG_ERROR, "xattrop failed " @@ -2674,7 +2674,7 @@ mq_update_size (xlator_t *this, loc_t *loc, quota_meta_t *delta)                  goto out;          ret = syncop_xattrop(FIRST_CHILD(this), loc, GF_XATTROP_ADD_ARRAY64, -                             dict, NULL); +                             dict, NULL, NULL);          if (ret < 0) {                  gf_log (this->name, (-ret == ENOENT || -ret == ESTALE)                          ? GF_LOG_DEBUG:GF_LOG_ERROR, "xattrop failed " @@ -3256,7 +3256,7 @@ mq_update_dirty_inode_v2 (xlator_t *this, loc_t *loc, quota_inode_ctx_t *ctx,                  goto out;          } -        ret = syncop_opendir (this, loc, fd); +        ret = syncop_opendir (this, loc, fd, NULL, NULL);          if (ret < 0) {                  gf_log (this->name, (-ret == ENOENT || -ret == ESTALE)                          ? GF_LOG_DEBUG:GF_LOG_ERROR, "opendir failed " @@ -3265,8 +3265,8 @@ mq_update_dirty_inode_v2 (xlator_t *this, loc_t *loc, quota_inode_ctx_t *ctx,          }          INIT_LIST_HEAD (&entries.list); -        while ((ret = syncop_readdirp (this, fd, 131072, offset, NULL, -                                       &entries)) != 0) { +        while ((ret = syncop_readdirp (this, fd, 131072, offset, &entries, +                                       NULL, NULL)) != 0) {                  if (ret < 0) {                          gf_log (this->name, (-ret == ENOENT || -ret == ESTALE)                                  ? GF_LOG_DEBUG:GF_LOG_ERROR, "readdirp failed " diff --git a/xlators/features/marker/src/marker.c b/xlators/features/marker/src/marker.c index b1eb252c5c2..fe7c634e344 100644 --- a/xlators/features/marker/src/marker.c +++ b/xlators/features/marker/src/marker.c @@ -2197,7 +2197,7 @@ remove_quota_keys (dict_t *dict, char *k, data_t *v, void *data)  	xlator_t 	*this = frame->this;  	int 		ret = -1; -	ret = syncop_removexattr (FIRST_CHILD (this), &local->loc, k, 0); +	ret = syncop_removexattr (FIRST_CHILD (this), &local->loc, k, 0, NULL);  	if (ret) {  		gf_log (this->name, GF_LOG_ERROR, "%s: Failed to remove "  			"extended attribute: %s", local->loc.path, k); @@ -2243,7 +2243,8 @@ quota_xattr_cleaner (void *args)          this  = frame->this;          local = frame->local; -        ret = syncop_listxattr (FIRST_CHILD(this), &local->loc, &xdata); +        ret = syncop_listxattr (FIRST_CHILD(this), &local->loc, &xdata, NULL, +                                NULL);          if (ret == -1) {                  ret = -errno;                  goto out; diff --git a/xlators/features/qemu-block/src/bdrv-xlator.c b/xlators/features/qemu-block/src/bdrv-xlator.c index 5a14f89e5af..5dbe292d6d7 100644 --- a/xlators/features/qemu-block/src/bdrv-xlator.c +++ b/xlators/features/qemu-block/src/bdrv-xlator.c @@ -105,8 +105,8 @@ qemu_gluster_open (BlockDriverState *bs, QDict *options, int bdrv_flags)  		}  		gf_uuid_copy(loc.gfid, loc.inode->gfid); -		ret = syncop_lookup(FIRST_CHILD(THIS), &loc, NULL, &buf, NULL, -				    NULL); +		ret = syncop_lookup(FIRST_CHILD(THIS), &loc, &buf, NULL, +                                    NULL, NULL);  		if (ret) {  			loc_wipe(&loc);  			return ret; @@ -150,7 +150,7 @@ qemu_gluster_create (const char *filename, QEMUOptionParameter *options)  	if (!fd)  		return -ENOMEM; -	ret = syncop_fstat (FIRST_CHILD(THIS), fd, &stat); +	ret = syncop_fstat (FIRST_CHILD(THIS), fd, &stat, NULL, NULL);  	if (ret) {  		fd_unref (fd);  		return ret; @@ -163,7 +163,8 @@ qemu_gluster_create (const char *filename, QEMUOptionParameter *options)  	}  	if (total_size) { -		ret = syncop_ftruncate (FIRST_CHILD(THIS), fd, total_size); +		ret = syncop_ftruncate (FIRST_CHILD(THIS), fd, total_size, +                                        NULL, NULL);  		if (ret) {  			fd_unref (fd);  			return ret; @@ -195,7 +196,7 @@ qemu_gluster_co_readv (BlockDriverState *bs, int64_t sector_num, int nb_sectors,  	size = nb_sectors * BDRV_SECTOR_SIZE;  	ret = syncop_readv (FIRST_CHILD(THIS), fd, size, offset, 0, -			    &iov, &count, &iobref); +			    &iov, &count, &iobref, NULL, NULL);  	if (ret < 0)  		goto out; @@ -245,7 +246,8 @@ qemu_gluster_co_writev (BlockDriverState *bs, int64_t sector_num, int nb_sectors  	iov.iov_base = iobuf_ptr (iobuf);  	iov.iov_len = size; -	ret = syncop_writev (FIRST_CHILD(THIS), fd, &iov, 1, offset, iobref, 0); +	ret = syncop_writev (FIRST_CHILD(THIS), fd, &iov, 1, offset, iobref, 0, +                             NULL, NULL);  out:  	if (iobuf) @@ -265,7 +267,7 @@ qemu_gluster_co_flush (BlockDriverState *bs)  	fd = fd_from_bs (bs); -	ret = syncop_flush (FIRST_CHILD(THIS), fd); +	ret = syncop_flush (FIRST_CHILD(THIS), fd, NULL, NULL);  	fd_unref (fd); @@ -281,7 +283,7 @@ qemu_gluster_co_fsync (BlockDriverState *bs)  	fd = fd_from_bs (bs); -	ret = syncop_fsync (FIRST_CHILD(THIS), fd, 0); +	ret = syncop_fsync (FIRST_CHILD(THIS), fd, 0, NULL, NULL);  	fd_unref (fd); @@ -297,7 +299,7 @@ qemu_gluster_truncate (BlockDriverState *bs, int64_t offset)  	fd = fd_from_bs (bs); -	ret = syncop_ftruncate (FIRST_CHILD(THIS), fd, offset); +	ret = syncop_ftruncate (FIRST_CHILD(THIS), fd, offset, NULL, NULL);  	fd_unref (fd); @@ -314,7 +316,7 @@ qemu_gluster_getlength (BlockDriverState *bs)  	fd = fd_from_bs (bs); -	ret = syncop_fstat (FIRST_CHILD(THIS), fd, &iatt); +	ret = syncop_fstat (FIRST_CHILD(THIS), fd, &iatt, NULL, NULL);  	if (ret < 0)  		return -1; @@ -331,7 +333,7 @@ qemu_gluster_allocated_file_size (BlockDriverState *bs)  	fd = fd_from_bs (bs); -	ret = syncop_fstat (FIRST_CHILD(THIS), fd, &iatt); +	ret = syncop_fstat (FIRST_CHILD(THIS), fd, &iatt, NULL, NULL);  	if (ret < 0)  		return -1; diff --git a/xlators/features/qemu-block/src/qb-coroutines.c b/xlators/features/qemu-block/src/qb-coroutines.c index 7dee80d1d00..4457576314e 100644 --- a/xlators/features/qemu-block/src/qb-coroutines.c +++ b/xlators/features/qemu-block/src/qb-coroutines.c @@ -81,8 +81,8 @@ qb_format_and_resume (void *opaque)  		 * Lookup the backing image. Verify existence and/or get the  		 * gfid if we don't already have it.  		 */ -		ret = syncop_lookup(FIRST_CHILD(frame->this), &loc, NULL, &buf, -				    NULL, NULL); +		ret = syncop_lookup(FIRST_CHILD(frame->this), &loc, &buf, NULL, +                                    NULL, NULL);  		GF_FREE(qb_inode->backing_fname);  		if (ret) {  			loc_wipe(&loc); @@ -148,7 +148,7 @@ qb_format_and_resume (void *opaque)  		return 0;  	} -	ret = syncop_fsetxattr (FIRST_CHILD(THIS), fd, xattr, 0); +	ret = syncop_fsetxattr (FIRST_CHILD(THIS), fd, xattr, 0, NULL, NULL);  	if (ret) {  		gf_log (frame->this->name, GF_LOG_ERROR,  			"failed to setxattr for %s", @@ -437,7 +437,7 @@ qb_update_size_xattr (xlator_t *this, fd_t *fd, const char *fmt, off_t offset)  		return;  	} -	syncop_fsetxattr (FIRST_CHILD(this), fd, xattr, 0); +	syncop_fsetxattr (FIRST_CHILD(this), fd, xattr, 0, NULL, NULL);  	dict_unref (xattr);  } @@ -476,7 +476,7 @@ qb_co_truncate (void *opaque)  	}  	ret = syncop_fstat (FIRST_CHILD(this), local->fd, -                            &stub->args_cbk.prestat); +                            &stub->args_cbk.prestat, NULL, NULL);          if (ret < 0)                  goto out;  	stub->args_cbk.prestat.ia_size = qb_inode->size; @@ -490,7 +490,7 @@ qb_co_truncate (void *opaque)  	qb_inode->size = offset;  	ret = syncop_fstat (FIRST_CHILD(this), local->fd, -                            &stub->args_cbk.poststat); +                            &stub->args_cbk.poststat, NULL, NULL);          if (ret < 0)                  goto out;  	stub->args_cbk.poststat.ia_size = qb_inode->size; diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c index ece089976f3..d8e7012bb6c 100644 --- a/xlators/mount/fuse/src/fuse-bridge.c +++ b/xlators/mount/fuse/src/fuse-bridge.c @@ -4163,7 +4163,7 @@ fuse_nameless_lookup (xlator_t *xl, uuid_t gfid, loc_t *loc)                  goto out;          } -        ret = syncop_lookup (xl, loc, xattr_req, &iatt, NULL, NULL); +        ret = syncop_lookup (xl, loc, &iatt, NULL, xattr_req, NULL);          if (ret < 0)                  goto out; @@ -4249,10 +4249,10 @@ fuse_migrate_fd_open (xlator_t *this, fd_t *basefd, fd_t *oldfd,          GF_VALIDATE_OR_GOTO ("glusterfs-fuse", newfd_ctx, out);          if (IA_ISDIR (basefd->inode->ia_type)) { -                ret = syncop_opendir (new_subvol, &loc, newfd); +                ret = syncop_opendir (new_subvol, &loc, newfd, NULL, NULL);          } else {                  flags = basefd->flags & ~(O_CREAT | O_EXCL | O_TRUNC); -                ret = syncop_open (new_subvol, &loc, flags, newfd); +                ret = syncop_open (new_subvol, &loc, flags, newfd, NULL, NULL);          }          if (ret < 0) { @@ -4321,7 +4321,7 @@ fuse_migrate_locks (xlator_t *this, fd_t *basefd, fd_t *oldfd,          UNLOCK (&basefd->lock);          ret = syncop_fgetxattr (old_subvol, oldfd, &lockinfo, -                                GF_XATTR_LOCKINFO_KEY, NULL); +                                GF_XATTR_LOCKINFO_KEY, NULL, NULL);          if (ret < 0) {                  gf_log (this->name, GF_LOG_WARNING,  			"getting lockinfo failed while migrating locks" @@ -4348,7 +4348,7 @@ fuse_migrate_locks (xlator_t *this, fd_t *basefd, fd_t *oldfd,                  goto out;          } -        ret = syncop_fsetxattr (new_subvol, newfd, lockinfo, 0); +        ret = syncop_fsetxattr (new_subvol, newfd, lockinfo, 0, NULL, NULL);          if (ret < 0) {                  gf_log (this->name, GF_LOG_WARNING,  			"migrating locks failed (oldfd:%p newfd:%p " @@ -4418,7 +4418,7 @@ fuse_migrate_fd (xlator_t *this, fd_t *basefd, xlator_t *old_subvol,          }          if (oldfd->inode->table->xl == old_subvol) { -                ret = syncop_fsync (old_subvol, oldfd, 0); +                ret = syncop_fsync (old_subvol, oldfd, 0, NULL, NULL);                  if (ret < 0) {                          gf_log ("glusterfs-fuse", GF_LOG_WARNING,                                  "syncop_fsync failed (%s) on fd (%p)"  | 
