summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src/dht-common.c
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2012-02-03 16:03:16 +0530
committerAnand Avati <avati@redhat.com>2012-05-31 17:48:12 -0700
commit833a2225449d1f4873647a61c8ba481e4db1ec4b (patch)
tree68cf9c488a2ff6ce17fea000541f67ace49c73b7 /xlators/cluster/dht/src/dht-common.c
parentddc044bfa2840981de4003c3b9efcac84387dc2b (diff)
cluster/distribute: set the inode layout in readdirp_cbk() for files
with this, inode-linking it in readdirp_cbk will be neater. Change-Id: Ie2cd646438f851e1755e9b6a3fc9898059bee359 Signed-off-by: Amar Tumballi <amar@gluster.com> BUG: 816140 Reviewed-on: http://review.gluster.com/2717 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators/cluster/dht/src/dht-common.c')
-rw-r--r--xlators/cluster/dht/src/dht-common.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c
index 7ac08c65930..eaafc2bfb3e 100644
--- a/xlators/cluster/dht/src/dht-common.c
+++ b/xlators/cluster/dht/src/dht-common.c
@@ -2766,6 +2766,7 @@ dht_readdirp_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int op_ret,
dht_layout_t *layout = 0;
dht_conf_t *conf = NULL;
xlator_t *subvol = 0;
+ int ret = 0;
INIT_LIST_HEAD (&entries.list);
prev = cookie;
@@ -2814,6 +2815,21 @@ dht_readdirp_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int op_ret,
entry->d_type = orig_entry->d_type;
entry->d_len = orig_entry->d_len;
+ if (orig_entry->dict)
+ entry->dict = dict_ref (orig_entry->dict);
+
+ /* making sure we set the inode ctx right with layout,
+ currently possible only for non-directories, so for
+ directories don't set entry inodes */
+ if (!IA_ISDIR(entry->d_stat.ia_type)) {
+ ret = dht_layout_preset (this, prev->this,
+ orig_entry->inode);
+ if (ret)
+ gf_log (this->name, GF_LOG_WARNING,
+ "failed to link the layout in inode");
+ entry->inode = inode_ref (orig_entry->inode);
+ }
+
list_add_tail (&entry->list, &entries.list);
count++;
}