diff options
author | Anand V. Avati <avati@amp.gluster.com> | 2009-06-24 18:31:10 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2009-06-26 11:09:21 -0700 |
commit | dc321571317b911faa31eed8b3bd4ce396963179 (patch) | |
tree | 50ec6f843ec7eaa5b691b6280fd02c82090b4e5d /xlators | |
parent | 622636c6e18a1013261bf924084d7a78a7cc86b1 (diff) |
dht_readdir_cbk: use stat attributes in the READDIRPLUS dirents to
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/cluster/dht/src/dht-common.c | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c index d367d26a293..62f3822a5e1 100644 --- a/xlators/cluster/dht/src/dht-common.c +++ b/xlators/cluster/dht/src/dht-common.c @@ -2110,10 +2110,8 @@ dht_readdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this, gf_dirent_t *orig_entry = NULL; gf_dirent_t *entry = NULL; call_frame_t *prev = NULL; - xlator_t *subvol = NULL; xlator_t *next_subvol = NULL; off_t next_offset = 0; - dht_layout_t *layout = NULL; int count = 0; @@ -2124,31 +2122,32 @@ dht_readdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this, if (op_ret < 0) goto done; - layout = dht_layout_get (this, local->fd->inode); + list_for_each_entry (orig_entry, (&orig_entries->list), list) { + next_offset = orig_entry->d_off; - list_for_each_entry (orig_entry, &orig_entries->list, list) { - subvol = dht_layout_search (this, layout, orig_entry->d_name); + if (check_is_linkfile (NULL, (&orig_entry->d_stat), NULL) + || (check_is_dir (NULL, (&orig_entry->d_stat), NULL) + && (prev->this != dht_first_up_subvol (this)))) { + continue; + } - if (!subvol || subvol == prev->this) { - entry = gf_dirent_for_name (orig_entry->d_name); - if (!entry) { - gf_log (this->name, GF_LOG_ERROR, - "Out of memory"); - goto unwind; - } + entry = gf_dirent_for_name (orig_entry->d_name); + if (!entry) { + gf_log (this->name, GF_LOG_ERROR, + "Out of memory"); + goto unwind; + } - dht_itransform (this, prev->this, orig_entry->d_ino, - &entry->d_ino); - dht_itransform (this, prev->this, orig_entry->d_off, - &entry->d_off); + dht_itransform (this, prev->this, orig_entry->d_ino, + &entry->d_ino); + dht_itransform (this, prev->this, orig_entry->d_off, + &entry->d_off); - entry->d_type = orig_entry->d_type; - entry->d_len = orig_entry->d_len; + entry->d_type = orig_entry->d_type; + entry->d_len = orig_entry->d_len; - list_add_tail (&entry->list, &entries.list); - count++; - } - next_offset = orig_entry->d_off; + list_add_tail (&entry->list, &entries.list); + count++; } op_ret = count; |