summaryrefslogtreecommitdiffstats
path: root/xlators/storage/posix
diff options
context:
space:
mode:
authorNiels de Vos <ndevos@redhat.com>2012-05-01 11:40:17 +0200
committerAnand Avati <avati@redhat.com>2012-05-18 20:33:01 -0700
commitbde1f0b8b645e3d8a4acfc859bb530af3d7dab5b (patch)
treefa05508b113bb42b138738ef31124ef4db8402b5 /xlators/storage/posix
parentfa90243e20eeef91eda5a5bb249bed05066852e3 (diff)
storage/posix,fuse-bridge: fill the d_type attribute in READDIRP replies
d_type should contain the type of the the dir-entry (man 3 readdir). Currently the d_type is always set to DT_UNKNOWN (0). The POSIX standard readdir() returns a 'struct dirent' on both Linux and NetBSD with the d_type attribute. Commit bb315cb180c3547218b5ed581d38e76aec74cf94 removed setting d_type in xlators/mount/fuse/src/fuse-bridge.c. This was using d_type_from_stat(). The stat() seems to have been removed for performance reasons. Instead of removing d_type completely, dirent->d_type could have been used. Therefore the fuse-brige can now add "fde->type = entry->d_type" back into fuse_readdir_cbk() without causing the previous performance impact. Change-Id: I4514bbc0acceb33d09c3cf50bda51e34d953efca BUG: 817785 Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.com/3256 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators/storage/posix')
-rw-r--r--xlators/storage/posix/src/posix.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c
index f9805628689..0b469ec669f 100644
--- a/xlators/storage/posix/src/posix.c
+++ b/xlators/storage/posix/src/posix.c
@@ -3578,6 +3578,7 @@ posix_fill_readdir (fd_t *fd, DIR *dir, off_t off, size_t size,
}
this_entry->d_off = telldir (dir);
this_entry->d_ino = entry->d_ino;
+ this_entry->d_type = entry->d_type;
list_add_tail (&this_entry->list, &entries->list);