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 /xlators/cluster | |
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>
Diffstat (limited to 'xlators/cluster')
-rw-r--r-- | xlators/cluster/afr/src/afr-self-heal-data.c | 8 | ||||
-rw-r--r-- | xlators/cluster/afr/src/afr-self-heal-entry.c | 23 | ||||
-rw-r--r-- | xlators/cluster/afr/src/afr-self-heal-metadata.c | 11 | ||||
-rw-r--r-- | xlators/cluster/afr/src/afr-self-heal-name.c | 6 | ||||
-rw-r--r-- | xlators/cluster/afr/src/afr-self-heald.c | 8 | ||||
-rw-r--r-- | xlators/cluster/afr/src/pump.c | 32 | ||||
-rw-r--r-- | xlators/cluster/dht/src/dht-helper.c | 26 | ||||
-rw-r--r-- | xlators/cluster/dht/src/dht-rebalance.c | 113 | ||||
-rw-r--r-- | xlators/cluster/dht/src/dht-selfheal.c | 2 | ||||
-rw-r--r-- | xlators/cluster/dht/src/tier.c | 10 | ||||
-rw-r--r-- | xlators/cluster/ec/src/ec-heald.c | 9 |
11 files changed, 135 insertions, 113 deletions
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); } |