[Gluster-devel] struct dirent in snapview-server.c

Emmanuel Dreyfus manu at netbsd.org
Mon Jun 2 00:58:19 UTC 2014


Harshavardhana <harsha at harshavardhana.net> wrote:

> On the other hand NetBSD has 'sys/compat/linux/*' - can we not
> leverage it? is it some dependency which is not warranted?

It is always possible to translate structures, the question is whether
it is useful of not. d_off is the offset of this struct dirent within
the buffer for the whole directory returned by getdents(2) system call.

Since we glusterfs does not use getdents(2) but upper level
opendir(3)/readdir(3), which use getdents(2) themselves, it never has
the whole buffer, and therefore I am not sure it can make any use of
d_off.

A look at the sources suggests it fills d_off in other places, but never
use it.

-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
manu at netbsd.org


More information about the Gluster-devel mailing list