summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSoumya Koduri <skoduri@redhat.com>2015-07-10 11:23:07 +0530
committerKaleb KEITHLEY <kkeithle@redhat.com>2015-07-10 10:42:26 -0700
commit2992c18c1370ada476223b496e4e970d70cdd359 (patch)
tree7df2ec2afc8811edc7c77089946afbec4f06b214
parent11ac70c8b6aefe3e82b7f1bd3f661206465c3ef8 (diff)
syncop: Include iatt to 'syncop_link' args
Include iatt to 'syncop_link' args to fetch proper attributes of the newly linked inode. Signed-off-by: Soumya Koduri <skoduri@redhat.com> Change-Id: If6b92961bd7a89add3791ed3a9b494087348b492 BUG: 1241788 Reviewed-on: http://review.gluster.org/11611 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
-rw-r--r--api/src/glfs-fops.c4
-rw-r--r--api/src/glfs-handleops.c6
-rw-r--r--libglusterfs/src/syncop.c10
-rw-r--r--libglusterfs/src/syncop.h2
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-entry.c2
-rw-r--r--xlators/cluster/dht/src/dht-rebalance.c2
6 files changed, 16 insertions, 10 deletions
diff --git a/api/src/glfs-fops.c b/api/src/glfs-fops.c
index 815e96a09e3..ce52ba5554c 100644
--- a/api/src/glfs-fops.c
+++ b/api/src/glfs-fops.c
@@ -1996,7 +1996,7 @@ retrynew:
}
newloc.inode = inode_ref (oldloc.inode);
- ret = syncop_link (subvol, &oldloc, &newloc, NULL, NULL);
+ ret = syncop_link (subvol, &oldloc, &newloc, &newiatt, NULL, NULL);
DECODE_SYNCOP_ERR (ret);
if (ret == -1 && errno == ESTALE) {
@@ -2007,7 +2007,7 @@ retrynew:
}
if (ret == 0)
- ret = glfs_loc_link (&newloc, &oldiatt);
+ ret = glfs_loc_link (&newloc, &newiatt);
out:
loc_wipe (&oldloc);
loc_wipe (&newloc);
diff --git a/api/src/glfs-handleops.c b/api/src/glfs-handleops.c
index 9a85f194451..2e552b763dc 100644
--- a/api/src/glfs-handleops.c
+++ b/api/src/glfs-handleops.c
@@ -1572,6 +1572,7 @@ pub_glfs_h_link (struct glfs *fs, struct glfs_object *linksrc,
inode_t *pinode = NULL;
loc_t oldloc = {0, };
loc_t newloc = {0, };
+ struct iatt iatt = {0, };
DECLARE_OLD_THIS;
@@ -1629,12 +1630,11 @@ pub_glfs_h_link (struct glfs *fs, struct glfs_object *linksrc,
newloc.inode = inode_ref (inode);
/* fop/op */
- ret = syncop_link (subvol, &oldloc, &newloc, NULL, NULL);
+ ret = syncop_link (subvol, &oldloc, &newloc, &iatt, NULL, NULL);
DECODE_SYNCOP_ERR (ret);
if (ret == 0)
- /* TODO: No iatt to pass as there has been no lookup */
- ret = glfs_loc_link (&newloc, NULL);
+ ret = glfs_loc_link (&newloc, &iatt);
out:
loc_wipe (&oldloc);
loc_wipe (&newloc);
diff --git a/libglusterfs/src/syncop.c b/libglusterfs/src/syncop.c
index 9b0d7aa745a..7c0ec7799e7 100644
--- a/libglusterfs/src/syncop.c
+++ b/libglusterfs/src/syncop.c
@@ -2157,6 +2157,9 @@ syncop_link_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
if (xdata)
args->xdata = dict_ref (xdata);
+ if (buf)
+ args->iatt1 = *buf;
+
__wake (args);
return 0;
@@ -2164,14 +2167,17 @@ syncop_link_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int
-syncop_link (xlator_t *subvol, loc_t *oldloc, loc_t *newloc, dict_t *xdata_in,
- dict_t **xdata_out)
+syncop_link (xlator_t *subvol, loc_t *oldloc, loc_t *newloc, struct iatt *iatt,
+ dict_t *xdata_in, dict_t **xdata_out)
{
struct syncargs args = {0, };
SYNCOP (subvol, (&args), syncop_link_cbk, subvol->fops->link,
oldloc, newloc, xdata_in);
+ if (iatt)
+ *iatt = args.iatt1;
+
if (xdata_out)
*xdata_out = args.xdata;
else if (args.xdata)
diff --git a/libglusterfs/src/syncop.h b/libglusterfs/src/syncop.h
index 2cdedc0fc11..8afc68e7f21 100644
--- a/libglusterfs/src/syncop.h
+++ b/libglusterfs/src/syncop.h
@@ -475,7 +475,7 @@ 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);
+ struct iatt *iatt, 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);
diff --git a/xlators/cluster/afr/src/afr-self-heal-entry.c b/xlators/cluster/afr/src/afr-self-heal-entry.c
index e2733063643..f3ddc0149da 100644
--- a/xlators/cluster/afr/src/afr-self-heal-entry.c
+++ b/xlators/cluster/afr/src/afr-self-heal-entry.c
@@ -126,7 +126,7 @@ afr_selfheal_recreate_entry (xlator_t *this, int dst, int source, inode_t *dir,
ret = syncop_lookup (priv->children[dst], &srcloc, 0, 0, 0, 0);
if (ret == 0) {
ret = syncop_link (priv->children[dst], &srcloc, &loc,
- NULL, NULL);
+ &newent, NULL, NULL);
} else {
ret = syncop_readlink (priv->children[source], &srcloc,
&linkname, 4096, NULL, NULL);
diff --git a/xlators/cluster/dht/src/dht-rebalance.c b/xlators/cluster/dht/src/dht-rebalance.c
index 9aefdabf153..6978d788303 100644
--- a/xlators/cluster/dht/src/dht-rebalance.c
+++ b/xlators/cluster/dht/src/dht-rebalance.c
@@ -316,7 +316,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, NULL, NULL);
+ ret = syncop_link (hashed_subvol, loc, loc, &iatt, NULL, NULL);
if (ret) {
op_errno = -ret;
ret = -1;