[Pvfs2-developers] Re: kern mod buffer mapping
Murali Vilayannur
murali.vilayannur at gmail.com
Fri Jan 11 13:50:20 EST 2008
Hi Pete,
> > diff -Naur /tmp/pvfs2-cvs/maint/config/kernel.m4 pvfs2-CVS/maint/config/kernel.m4
> > --- /tmp/pvfs2-cvs/maint/config/kernel.m4 2007-12-07 15:05:56.000000000 -0800
> > +++ pvfs2-CVS/maint/config/kernel.m4 2008-01-10 14:38:12.864703000 -0800
> > @@ -112,17 +112,23 @@
> > AC_MSG_RESULT(no)
> > )
> >
> > + tmp_cflags=$CFLAGS
> > + dnl if this test passes, the signature of aio_read has changed to the new one
> > + CFLAGS="$CFLAGS -Werror"
> > dnl 2.6.20 deprecated kmem_cache_t
> > AC_MSG_CHECKING(for struct kmem_cache in kernel)
> > AC_TRY_COMPILE([
> > #define __KERNEL__
> > #include <linux/slab.h>
> > - static struct kmem_cache;
> > + static struct kmem_cache a;
> > ], [],
> > AC_MSG_RESULT(yes)
> > - AC_DEFINE(HAVE_STRUCT_KMEM_CACHE, 1, Define if struct kmem_cache is defined in kernel),
> > + AC_DEFINE(HAVE_STRUCT_KMEM_CACHE, 1, Define if struct kmem_cache is defined in kernel)
> > + have_kmem_cache=yes,
> > AC_MSG_RESULT(no)
> > + have_kmem_cache=no
> > )
> > + CFLAGS=$tmp_cflags
> >
> > dnl 2.6.20 removed SLAB_KERNEL. Need to use GFP_KERNEL instead
> > AC_MSG_CHECKING(for SLAB_KERNEL flag in kernel)
>
> I see what you were trying to fix, but it doesn't work on
> 2.6.24-rc6. The actual contents of kmem_cache is not known by
> anything except the internals of slab.c or slub.c. The rest of the
> world can only declare pointers to one. And what was there before
> your fix will always happily work---you can forward declare whatever
> struct you want, as long as you don't try to dereference it.
Well, the previous thing was broken on my setup. thats why I attempted
to fix that.
The problem is that RHEL3 kmem_cache is not declared and hence configure checks
succeeds incorrectly. :(
I think if you change that to be static struct kmem_cache *a things
should work, no?
> Should we be instead looking for a kmem_cache_t? That's gone in
> this recent kernel. Were there really old kernels that had
> kmem_cache_t but _not_ struct kmem_cache?
yep; RHEL3 kernels have this struct kmem_cache_s.. it is all a big mess sadly :)
> I haven't gotten to the ctor changes yet due to getting hung up on
> this issue.
I think making "a" a pointer should do the trick or I hope it does :)
thanks again for trying it out!
Murali
> -- Pete
>
More information about the Pvfs2-developers
mailing list