From 64443fa783c9c43a597440164b35fd8131b7f4d3 Mon Sep 17 00:00:00 2001 From: Anand Avati Date: Fri, 3 Sep 2010 14:01:08 +0000 Subject: gfid: changes in distribute to handle uuids in iatt structure Signed-off-by: Anand V. Avati Signed-off-by: Anand V. Avati Signed-off-by: Amar Tumballi Signed-off-by: Vijay Bellur BUG: 971 (dynamic volume management) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=971 --- xlators/cluster/dht/src/dht-helper.c | 2 ++ xlators/cluster/dht/src/dht-linkfile.c | 20 ++++++++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) (limited to 'xlators') diff --git a/xlators/cluster/dht/src/dht-helper.c b/xlators/cluster/dht/src/dht-helper.c index 09c326289b8..804685b65ba 100644 --- a/xlators/cluster/dht/src/dht-helper.c +++ b/xlators/cluster/dht/src/dht-helper.c @@ -417,6 +417,8 @@ dht_iatt_merge (xlator_t *this, struct iatt *to, to->ia_dev = from->ia_dev; + uuid_copy (to->ia_gfid, from->ia_gfid); + dht_itransform (this, subvol, from->ia_ino, &to->ia_ino); to->ia_gen = from->ia_gen; diff --git a/xlators/cluster/dht/src/dht-linkfile.c b/xlators/cluster/dht/src/dht-linkfile.c index 950318b7e5c..1ecae5dfd35 100644 --- a/xlators/cluster/dht/src/dht-linkfile.c +++ b/xlators/cluster/dht/src/dht-linkfile.c @@ -115,17 +115,33 @@ dht_linkfile_create (call_frame_t *frame, fop_mknod_cbk_t linkfile_cbk, xlator_t *tovol, xlator_t *fromvol, loc_t *loc) { dht_local_t *local = NULL; - + dict_t *dict = NULL; + int ret = 0; local = frame->local; local->linkfile.linkfile_cbk = linkfile_cbk; local->linkfile.srcvol = tovol; loc_copy (&local->linkfile.loc, loc); + dict = dict_new (); + if (!dict) + goto out; + + ret = dict_set_static_bin (dict, "gfid-req", loc->inode->gfid, 16); + if (ret) + gf_log ("dht-linkfile", GF_LOG_DEBUG, "gfid set failed"); + STACK_WIND (frame, dht_linkfile_create_cbk, fromvol, fromvol->fops->mknod, loc, - S_IFREG | DHT_LINKFILE_MODE, 0, NULL); + S_IFREG | DHT_LINKFILE_MODE, 0, dict); + if (dict) + dict_unref (dict); + + return 0; +out: + local->linkfile.linkfile_cbk (frame, NULL, frame->this, -1, ENOMEM, + loc->inode, NULL, NULL, NULL); return 0; } -- cgit