core: add @xdata parameter to syncop_[f]removexattr()

To be used in afr metadata self-heal

Change-Id: I8dac4b19d61e331702427eeb5b606aab3d20b328
BUG: 1021686
Signed-off-by: Anand Avati <avati@redhat.com>
Reviewed-on: http://review.gluster.org/6941
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
This commit is contained in:
Anand Avati 2014-02-07 14:29:34 -08:00
parent 13f1d250cc
commit 0cab34b3a5
6 changed files with 15 additions and 13 deletions

View File

@ -2832,7 +2832,7 @@ retry:
if (ret)
goto out;
ret = syncop_removexattr (subvol, &loc, name);
ret = syncop_removexattr (subvol, &loc, name, 0);
DECODE_SYNCOP_ERR (ret);
ESTALE_RETRY (ret, errno, reval, &loc, retry);
@ -2883,7 +2883,7 @@ glfs_fremovexattr (struct glfs_fd *glfd, const char *name)
goto out;
}
ret = syncop_fremovexattr (subvol, fd, name);
ret = syncop_fremovexattr (subvol, fd, name, 0);
DECODE_SYNCOP_ERR (ret);
out:
if (fd)

View File

@ -1208,12 +1208,12 @@ syncop_removexattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
}
int
syncop_removexattr (xlator_t *subvol, loc_t *loc, const char *name)
syncop_removexattr (xlator_t *subvol, loc_t *loc, const char *name, dict_t *xdata)
{
struct syncargs args = {0, };
SYNCOP (subvol, (&args), syncop_removexattr_cbk, subvol->fops->removexattr,
loc, name, NULL);
loc, name, xdata);
if (args.op_ret < 0)
return -args.op_errno;
@ -1237,12 +1237,12 @@ syncop_fremovexattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
}
int
syncop_fremovexattr (xlator_t *subvol, fd_t *fd, const char *name)
syncop_fremovexattr (xlator_t *subvol, fd_t *fd, const char *name, dict_t *xdata)
{
struct syncargs args = {0, };
SYNCOP (subvol, (&args), syncop_fremovexattr_cbk,
subvol->fops->fremovexattr, fd, name, NULL);
subvol->fops->fremovexattr, fd, name, xdata);
if (args.op_ret < 0)
return -args.op_errno;

View File

@ -360,8 +360,10 @@ 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_removexattr (xlator_t *subvol, loc_t *loc, const char *name);
int syncop_fremovexattr (xlator_t *subvol, fd_t *fd, const char *name);
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,
dict_t *xdata);
int syncop_create (xlator_t *subvol, loc_t *loc, int32_t flags, mode_t mode,
fd_t *fd, dict_t *dict, struct iatt *iatt);

View File

@ -496,14 +496,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);
PUMP_PATH, 0);
ret = syncop_removexattr (priv->children[sink], &loc,
PUMP_SINK_COMPLETE);
PUMP_SINK_COMPLETE, 0);
for (i = 0; i < priv->child_count; i++) {
ret = syncop_removexattr (priv->children[i], &loc,
PUMP_SOURCE_COMPLETE);
PUMP_SOURCE_COMPLETE, 0);
if (ret) {
gf_log (this->name, GF_LOG_DEBUG, "removexattr "
"failed with %s", strerror (-ret));

View File

@ -892,7 +892,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);
ret = syncop_fremovexattr (to, dst_fd, conf->link_xattr_name, 0);
if (ret) {
gf_log (this->name, GF_LOG_WARNING,
"%s: failed to perform removexattr on %s (%s)",

View File

@ -2167,7 +2167,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);
ret = syncop_removexattr (FIRST_CHILD (this), &local->loc, k, 0);
if (ret) {
gf_log (this->name, GF_LOG_ERROR, "%s: Failed to remove "
"extended attribute: %s", local->loc.path, k);