<feed xmlns='http://www.w3.org/2005/Atom'>
<title>glusterfs.git/tests/bugs/posix/bug-1175711.c, branch v3.12dev</title>
<subtitle></subtitle>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/'/>
<entry>
<title>posix: Set correct d_type for readdirp() calls</title>
<updated>2016-05-02T11:48:45+00:00</updated>
<author>
<name>Prashanth Pai</name>
<email>ppai@redhat.com</email>
</author>
<published>2016-04-27T08:07:07+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=77def44d497d090ef3f393b6d9403c1a29dcf993'/>
<id>77def44d497d090ef3f393b6d9403c1a29dcf993</id>
<content type='text'>
dirent.d_type can contain the type of the directory entry. The 'd_type'
struct member in dirent is present in Linux and many BSD flavours.
However, filling d_type with correct value requires support from the
underlying filesystem. If not, d_type is set to DT_UNKNOWN. XFS added
support for d_type as part of their newer version 5 on-disk format.
However, this requires Linux &gt;= 3.15, xfsprogs &gt;= 3.2.0 and the bricks
to be formatted using the new format.

This patch enables posix xlator to set d_type to the right value even
when the underlying filesystem does not support it. d_type can be set
using information previously fetched by stat() on the dir entry.
This will aid FUSE applications to leverage d_type to avoid the expense
of calling lstat() if further actions depend on the type of the file.

Refer `man 3 readdir` and `man 2 getdents`

BUG: 1175711
Change-Id: Ic5a262fe4c64122726b4fae2d1bea375c559ca04
Signed-off-by: Prashanth Pai &lt;ppai@redhat.com&gt;
Reviewed-on: http://review.gluster.org/14095
Smoke: Gluster Build System &lt;jenkins@build.gluster.com&gt;
NetBSD-regression: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
CentOS-regression: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Jeff Darcy &lt;jdarcy@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
dirent.d_type can contain the type of the directory entry. The 'd_type'
struct member in dirent is present in Linux and many BSD flavours.
However, filling d_type with correct value requires support from the
underlying filesystem. If not, d_type is set to DT_UNKNOWN. XFS added
support for d_type as part of their newer version 5 on-disk format.
However, this requires Linux &gt;= 3.15, xfsprogs &gt;= 3.2.0 and the bricks
to be formatted using the new format.

This patch enables posix xlator to set d_type to the right value even
when the underlying filesystem does not support it. d_type can be set
using information previously fetched by stat() on the dir entry.
This will aid FUSE applications to leverage d_type to avoid the expense
of calling lstat() if further actions depend on the type of the file.

Refer `man 3 readdir` and `man 2 getdents`

BUG: 1175711
Change-Id: Ic5a262fe4c64122726b4fae2d1bea375c559ca04
Signed-off-by: Prashanth Pai &lt;ppai@redhat.com&gt;
Reviewed-on: http://review.gluster.org/14095
Smoke: Gluster Build System &lt;jenkins@build.gluster.com&gt;
NetBSD-regression: NetBSD Build System &lt;jenkins@build.gluster.org&gt;
CentOS-regression: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Jeff Darcy &lt;jdarcy@redhat.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
