[ewg] /usr/src/ofa_kernel/include/linux/exportfs.h:145: error: redefinition of 'struct export_operations' on RHEL5

Brian J. Murrell brian at sun.com
Wed Feb 11 10:48:01 PST 2009


Hi,

I'm trying to build a third party module with the OFED 1.4.0
kernel-ib-devel /usr/src/ofa_kernel tree (as it uses the OFED stack).
In my compiler flags I include:

-I/usr/src/ofa_kernel/include
-I/usr/src/ofa_kernel/kernel_addons/backport/2.6.18-EL5.2/include/linux/

prior to any of the regular kernel module build includes.  The result is
not good though:

In file included from /cache/build/BUILD/lustre-1.8.0/lustre/llite/llite_nfs.c:45:
/cache/build/BUILD/lustre-kernel-2.6.18/lustre/kernel-ib-devel/usr/src/ofa_kernel/include/linux/exportfs.h:145: error: redefinition of 'struct export_operations'
/cache/build/BUILD/lustre-1.8.0/lustre/llite/llite_nfs.c:243: error: unknown field 'get_dentry' specified in initializer
/cache/build/BUILD/lustre-1.8.0/lustre/llite/llite_nfs.c:243: warning: excess elements in struct initializer
/cache/build/BUILD/lustre-1.8.0/lustre/llite/llite_nfs.c:243: warning: (near initialization for 'lustre_export_operations')

The problem comes from the fact that llite_nfs.c does a:

#ifdef HAVE_LINUX_EXPORTFS_H
#include <linux/exportfs.h>
#endif

because it needs "struct export_operations" which in later kernels, as
you know, got moved to that header -- and had it's members changed.
There is no get_dentry member in the exportfs.h version of it.

The problem arises from the inclusion of both
<kernel_source>/include/linux/fs.h
and /usr/src/ofa_kernel/include/linux/exportfs.h

which both define struct export_operations;

How can I resolve this conflict?  Am I specifying the various includes
(ofed generic, ofed backport, kernel regular) in the wrong order?  I
would have thought surely, you would want /usr/src/ofa_kernel/include/
to be preferred so that it's rdma/ and scsi/ paths override what's in
the kernel, but of course, that brings with it everything added to the
include/ subdir.

How can I resolve this conflict?

Thanx,
b.





More information about the ewg mailing list