summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2011-05-02 03:11:54 +0000
committerAnand Avati <avati@gluster.com>2011-05-03 10:17:04 -0700
commitcadd9a1b75fb1f78d2fb7c578212ee0225cfeb83 (patch)
tree436e49d89934a1a6fcdb7996f31d3356d1e46907 /xlators/cluster/dht
parentfd7e3b6052881319d4671771aae44933bbf858d4 (diff)
loc_t: add 'gfid' and 'pargfid' fields
these fields are used mainly in case of selfheal path, where 'inode->gfid'||'parent->gfid' is not yet set. These fields in 'loc' will have lower precedence than 'inode->gfid' in client protocol. Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 2346 (Log message enhancements in GlusterFS - phase 1) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2346
Diffstat (limited to 'xlators/cluster/dht')
-rw-r--r--xlators/cluster/dht/src/dht-common.c4
-rw-r--r--xlators/cluster/dht/src/dht-linkfile.c3
2 files changed, 5 insertions, 2 deletions
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c
index 35bf180f535..4a8e035c21c 100644
--- a/xlators/cluster/dht/src/dht-common.c
+++ b/xlators/cluster/dht/src/dht-common.c
@@ -4022,8 +4022,8 @@ dht_mkdir_hashed_cbk (call_frame_t *frame, void *cookie,
conf = this->private;
hashed_subvol = local->hashed_subvol;
- if (uuid_is_null (local->loc.inode->gfid) && !op_ret)
- memcpy (local->loc.inode->gfid, stbuf->ia_gfid, 16);
+ if (uuid_is_null (local->loc.gfid) && !op_ret)
+ uuid_copy (local->loc.gfid, stbuf->ia_gfid);
if (dht_is_subvol_filled (this, hashed_subvol))
ret = dht_layout_merge (this, layout, prev->this,
diff --git a/xlators/cluster/dht/src/dht-linkfile.c b/xlators/cluster/dht/src/dht-linkfile.c
index 9dd487bc87b..7acebd290e3 100644
--- a/xlators/cluster/dht/src/dht-linkfile.c
+++ b/xlators/cluster/dht/src/dht-linkfile.c
@@ -92,6 +92,9 @@ dht_linkfile_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
local->linkfile.stbuf = *stbuf;
+ if (uuid_is_null (local->linkfile.loc.inode->gfid))
+ uuid_copy (local->linkfile.loc.gfid, stbuf->ia_gfid);
+
STACK_WIND (frame, dht_linkfile_xattr_cbk,
prev->this, prev->this->fops->setxattr,
&local->linkfile.loc, local->linkfile.xattr, 0);