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

Emmanuel Dreyfus manu at netbsd.org
Sun Jun 1 17:31:50 UTC 2014


Emmanuel Dreyfus <manu at netbsd.org> wrote:

> Linux and NetBSD struct dirent do not have the same layout, and in fact
> the whole buffer returned by readdir() has a different layout and is not
> straightforward to convert. 

After reading further, there are struct dirent used in many other places
without a hitch. The build breaks here because the d_off field is
copied, and this field does not exist in NetBSD struct dirent. 

Is d_off used anywhere else? If not then I can fix the build with this:

--- a/xlators/features/snapview-server/src/snapview-server.c
+++ b/xlators/features/snapview-server/src/snapview-server.c
@@ -1600,7 +1600,9 @@ svs_glfs_readdir (xlator_t *this, glfs_fd_t *glfd,
                                         strerror (errno));
                                 break;
                         }
+#ifdef linux
                         entry->d_off = de.d_off;
+#endif
                         entry->d_ino = de.d_ino;
                         entry->d_type = de.d_type;
                         iatt_from_stat (buf, &statbuf);

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


More information about the Gluster-devel mailing list