summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRavishankar N <ravishankar@redhat.com>2015-01-01 15:16:41 +0000
committerVijay Bellur <vbellur@redhat.com>2015-01-05 22:00:09 -0800
commitc4ab37c02e9edc23d0637e23d6f2b42d0827dad2 (patch)
tree0dc06a6b8288ff8f33b47ad7d98ee4daffe74af4
parentb8e3b91b8180dcc5e9f8bb62734832ace69ad143 (diff)
libglusterfs: change signature of syncop_(f)getxattr
Pass xdata dict to syncop_(f)getxattr calls. This patch [1/3] is required as a part of afr automated split-brain resolution implementation. Change-Id: I3970b3dd6daf64681a031e37f8e9afb14fb3d668 BUG: 1136769 Signed-off-by: Ravishankar N <ravishankar@redhat.com> Reviewed-on: http://review.gluster.org/9375 Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Reviewed-by: Niels de Vos <ndevos@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
-rw-r--r--api/src/glfs-fops.c8
-rw-r--r--api/src/glfs-handleops.c2
-rw-r--r--api/src/glfs-resolve.c2
-rw-r--r--heal/src/glfs-heal.c11
-rw-r--r--libglusterfs/src/syncop.c10
-rw-r--r--libglusterfs/src/syncop.h6
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-metadata.c6
-rw-r--r--xlators/cluster/afr/src/afr-self-heald.c8
-rw-r--r--xlators/cluster/dht/src/dht-helper.c8
-rw-r--r--xlators/cluster/dht/src/dht-rebalance.c4
-rw-r--r--xlators/features/locks/src/posix.c2
-rw-r--r--xlators/mount/fuse/src/fuse-bridge.c2
12 files changed, 39 insertions, 30 deletions
diff --git a/api/src/glfs-fops.c b/api/src/glfs-fops.c
index b93a077fcdf..a0315e305b1 100644
--- a/api/src/glfs-fops.c
+++ b/api/src/glfs-fops.c
@@ -2621,7 +2621,7 @@ retry:
if (ret)
goto out;
- ret = syncop_getxattr (subvol, &loc, &xattr, name);
+ ret = syncop_getxattr (subvol, &loc, &xattr, name, NULL);
DECODE_SYNCOP_ERR (ret);
ESTALE_RETRY (ret, errno, reval, &loc, retry);
@@ -2684,7 +2684,7 @@ pub_glfs_fgetxattr (struct glfs_fd *glfd, const char *name, void *value,
goto out;
}
- ret = syncop_fgetxattr (subvol, fd, &xattr, name);
+ ret = syncop_fgetxattr (subvol, fd, &xattr, name, NULL);
DECODE_SYNCOP_ERR (ret);
if (ret)
goto out;
@@ -2761,7 +2761,7 @@ retry:
if (ret)
goto out;
- ret = syncop_getxattr (subvol, &loc, &xattr, NULL);
+ ret = syncop_getxattr (subvol, &loc, &xattr, NULL, NULL);
DECODE_SYNCOP_ERR (ret);
ESTALE_RETRY (ret, errno, reval, &loc, retry);
@@ -2821,7 +2821,7 @@ pub_glfs_flistxattr (struct glfs_fd *glfd, void *value, size_t size)
goto out;
}
- ret = syncop_fgetxattr (subvol, fd, &xattr, NULL);
+ ret = syncop_fgetxattr (subvol, fd, &xattr, NULL, NULL);
DECODE_SYNCOP_ERR (ret);
if (ret)
goto out;
diff --git a/api/src/glfs-handleops.c b/api/src/glfs-handleops.c
index a82cab52dec..706c00f98eb 100644
--- a/api/src/glfs-handleops.c
+++ b/api/src/glfs-handleops.c
@@ -266,7 +266,7 @@ pub_glfs_h_getxattrs (struct glfs *fs, struct glfs_object *object,
/* populate loc */
GLFS_LOC_FILL_INODE (inode, loc, out);
- ret = syncop_getxattr (subvol, &loc, &xattr, name);
+ ret = syncop_getxattr (subvol, &loc, &xattr, name, NULL);
DECODE_SYNCOP_ERR (ret);
if (ret)
diff --git a/api/src/glfs-resolve.c b/api/src/glfs-resolve.c
index 7aa5cc6158e..3b76487cd25 100644
--- a/api/src/glfs-resolve.c
+++ b/api/src/glfs-resolve.c
@@ -557,7 +557,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);
+ GF_XATTR_LOCKINFO_KEY, NULL);
DECODE_SYNCOP_ERR (ret);
if (ret < 0) {
gf_log (fs->volname, GF_LOG_WARNING,
diff --git a/heal/src/glfs-heal.c b/heal/src/glfs-heal.c
index c52a46bd709..10607ea9155 100644
--- a/heal/src/glfs-heal.c
+++ b/heal/src/glfs-heal.c
@@ -51,7 +51,8 @@ glfsh_get_index_dir_loc (loc_t *rootloc, xlator_t *xl, loc_t *dirloc,
struct iatt iattr = {0};
struct iatt parent = {0};
- ret = syncop_getxattr (xl, rootloc, &xattr, GF_XATTROP_INDEX_GFID);
+ ret = syncop_getxattr (xl, rootloc, &xattr, GF_XATTROP_INDEX_GFID,
+ NULL);
if (ret < 0) {
*op_errno = -ret;
goto out;
@@ -128,7 +129,7 @@ glfsh_gfid_to_path (xlator_t *this, xlator_t *subvol, uuid_t gfid, char **path_p
uuid_copy (loc.gfid, gfid);
loc.inode = inode_new (this->itable);
- ret = syncop_getxattr (subvol, &loc, &xattr, GFID_TO_PATH_KEY);
+ ret = syncop_getxattr (subvol, &loc, &xattr, GFID_TO_PATH_KEY, NULL);
if (ret)
goto out;
@@ -216,7 +217,8 @@ glfsh_process_entries (xlator_t *xl, fd_t *fd, gf_dirent_t *entries,
uuid_parse (entry->d_name, gfid);
uuid_copy (loc.gfid, gfid);
- ret = syncop_getxattr (this, &loc, &dict, GF_AFR_HEAL_INFO);
+ ret = syncop_getxattr (this, &loc, &dict, GF_AFR_HEAL_INFO,
+ NULL);
if (ret)
continue;
@@ -292,7 +294,8 @@ glfsh_print_brick (xlator_t *xl, loc_t *rootloc)
char *brick_start = NULL;
char *brick_end = NULL;
- ret = syncop_getxattr (xl, rootloc, &xattr, GF_XATTR_PATHINFO_KEY);
+ ret = syncop_getxattr (xl, rootloc, &xattr, GF_XATTR_PATHINFO_KEY,
+ NULL);
if (ret < 0)
goto out;
diff --git a/libglusterfs/src/syncop.c b/libglusterfs/src/syncop.c
index e830d830229..c2794732522 100644
--- a/libglusterfs/src/syncop.c
+++ b/libglusterfs/src/syncop.c
@@ -1388,12 +1388,13 @@ 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)
+syncop_getxattr (xlator_t *subvol, loc_t *loc, dict_t **dict, const char *key,
+ dict_t *xdata)
{
struct syncargs args = {0, };
SYNCOP (subvol, (&args), syncop_getxattr_cbk, subvol->fops->getxattr,
- loc, key, NULL);
+ loc, key, xdata);
if (dict)
*dict = args.xattr;
@@ -1406,12 +1407,13 @@ 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)
+syncop_fgetxattr (xlator_t *subvol, fd_t *fd, dict_t **dict, const char *key,
+ dict_t *xdata)
{
struct syncargs args = {0, };
SYNCOP (subvol, (&args), syncop_getxattr_cbk, subvol->fops->fgetxattr,
- fd, key, NULL);
+ fd, key, xdata);
if (dict)
*dict = args.xattr;
diff --git a/libglusterfs/src/syncop.h b/libglusterfs/src/syncop.h
index 249abb3d331..e95dd6fc33d 100644
--- a/libglusterfs/src/syncop.h
+++ b/libglusterfs/src/syncop.h
@@ -368,8 +368,10 @@ int syncop_statfs (xlator_t *subvol, loc_t *loc, dict_t *xattr_req,
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);
-int syncop_fgetxattr (xlator_t *xl, fd_t *fd, dict_t **dict, const char *key);
+int syncop_getxattr (xlator_t *xl, loc_t *loc, dict_t **dict, const char *key,
+ dict_t *xdata);
+int syncop_fgetxattr (xlator_t *xl, fd_t *fd, dict_t **dict, const char *key,
+ dict_t *xdata);
int syncop_removexattr (xlator_t *subvol, loc_t *loc, const char *name,
dict_t *xdata);
int syncop_fremovexattr (xlator_t *subvol, fd_t *fd, const char *name,
diff --git a/xlators/cluster/afr/src/afr-self-heal-metadata.c b/xlators/cluster/afr/src/afr-self-heal-metadata.c
index 7c0d5cb08c6..0518c1821e3 100644
--- a/xlators/cluster/afr/src/afr-self-heal-metadata.c
+++ b/xlators/cluster/afr/src/afr-self-heal-metadata.c
@@ -53,7 +53,8 @@ __afr_selfheal_metadata_do (call_frame_t *frame, xlator_t *this, inode_t *inode,
gf_log (this->name, GF_LOG_INFO, "performing metadata selfheal on %s",
uuid_utoa (inode->gfid));
- ret = syncop_getxattr (priv->children[source], &loc, &xattr, NULL);
+ ret = syncop_getxattr (priv->children[source], &loc, &xattr, NULL,
+ NULL);
if (ret < 0) {
ret = -EIO;
goto out;
@@ -76,7 +77,8 @@ __afr_selfheal_metadata_do (call_frame_t *frame, xlator_t *this, inode_t *inode,
if (ret)
healed_sinks[i] = 0;
- ret = syncop_getxattr (priv->children[i], &loc, &old_xattr, 0);
+ ret = syncop_getxattr (priv->children[i], &loc, &old_xattr, 0,
+ NULL);
if (old_xattr) {
afr_delete_ignorable_xattrs (old_xattr);
ret = syncop_removexattr (priv->children[i], &loc, "",
diff --git a/xlators/cluster/afr/src/afr-self-heald.c b/xlators/cluster/afr/src/afr-self-heald.c
index 29f34107481..7426e9290a9 100644
--- a/xlators/cluster/afr/src/afr-self-heald.c
+++ b/xlators/cluster/afr/src/afr-self-heald.c
@@ -89,7 +89,7 @@ afr_shd_is_subvol_local (xlator_t *this, int subvol)
uuid_copy (loc.gfid, loc.inode->gfid);
ret = syncop_getxattr (priv->children[subvol], &loc, &xattr,
- GF_XATTR_PATHINFO_KEY);
+ GF_XATTR_PATHINFO_KEY, NULL);
if (ret) {
is_local = _gf_false;
goto out;
@@ -236,7 +236,7 @@ afr_shd_index_opendir (xlator_t *this, int child)
uuid_copy (rootloc.gfid, rootloc.inode->gfid);
ret = syncop_getxattr (subvol, &rootloc, &xattr,
- GF_XATTROP_INDEX_GFID);
+ GF_XATTROP_INDEX_GFID, NULL);
if (ret || !xattr) {
errno = -ret;
goto out;
@@ -948,7 +948,7 @@ afr_shd_gfid_to_path (xlator_t *this, xlator_t *subvol, uuid_t gfid, char **path
uuid_copy (loc.gfid, gfid);
loc.inode = inode_new (this->itable);
- ret = syncop_getxattr (subvol, &loc, &xattr, GFID_TO_PATH_KEY);
+ ret = syncop_getxattr (subvol, &loc, &xattr, GFID_TO_PATH_KEY, NULL);
if (ret)
goto out;
@@ -1192,7 +1192,7 @@ afr_shd_get_index_count (xlator_t *this, int i, uint64_t *count)
uuid_copy (rootloc.gfid, rootloc.inode->gfid);
ret = syncop_getxattr (subvol, &rootloc, &xattr,
- GF_XATTROP_INDEX_COUNT);
+ GF_XATTROP_INDEX_COUNT, NULL);
if (ret < 0)
goto out;
diff --git a/xlators/cluster/dht/src/dht-helper.c b/xlators/cluster/dht/src/dht-helper.c
index e7ae5c2b002..c25646c3c5d 100644
--- a/xlators/cluster/dht/src/dht-helper.c
+++ b/xlators/cluster/dht/src/dht-helper.c
@@ -921,11 +921,11 @@ dht_migration_complete_check_task (void *data)
if (!local->loc.inode) {
ret = syncop_fgetxattr (src_node, local->fd, &dict,
- conf->link_xattr_name);
+ conf->link_xattr_name, NULL);
} else {
SYNCTASK_SETID (0, 0);
ret = syncop_getxattr (src_node, &local->loc, &dict,
- conf->link_xattr_name);
+ conf->link_xattr_name, NULL);
SYNCTASK_SETID (frame->root->uid, frame->root->gid);
}
@@ -1136,11 +1136,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);
+ conf->link_xattr_name, NULL);
SYNCTASK_SETID (frame->root->uid, frame->root->gid);
} else {
ret = syncop_fgetxattr (src_node, local->fd, &dict,
- conf->link_xattr_name);
+ conf->link_xattr_name, NULL);
}
if (ret < 0) {
diff --git a/xlators/cluster/dht/src/dht-rebalance.c b/xlators/cluster/dht/src/dht-rebalance.c
index 2ca636c4564..66b84ba96e9 100644
--- a/xlators/cluster/dht/src/dht-rebalance.c
+++ b/xlators/cluster/dht/src/dht-rebalance.c
@@ -1541,7 +1541,7 @@ 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);
+ GF_XATTR_NODE_UUID_KEY, NULL);
if(ret < 0) {
gf_msg (this->name, GF_LOG_ERROR, 0,
DHT_MSG_MIGRATE_FILE_FAILED,
@@ -1588,7 +1588,7 @@ 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);
+ GF_XATTR_LINKINFO_KEY, NULL);
if (ret < 0) {
if (-ret != ENODATA) {
loglevel = GF_LOG_ERROR;
diff --git a/xlators/features/locks/src/posix.c b/xlators/features/locks/src/posix.c
index 603bc585b4d..610297abec7 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);
+ GF_XATTR_PATHINFO_KEY, NULL);
if (ret < 0) {
*op_errno = -ret;
ret = -1;
diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c
index e61671829e1..cb345ad11f2 100644
--- a/xlators/mount/fuse/src/fuse-bridge.c
+++ b/xlators/mount/fuse/src/fuse-bridge.c
@@ -4319,7 +4319,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);
+ GF_XATTR_LOCKINFO_KEY, NULL);
if (ret < 0) {
gf_log (this->name, GF_LOG_WARNING,
"getting lockinfo failed while migrating locks"