[Pvfs2-developers] Re: kern mod buffer mapping
pw at osc.edu
Fri Jan 11 13:40:03 EST 2008
murali.vilayannur at gmail.com wrote on Thu, 10 Jan 2008 17:25 -0800:
> > This approach with CTL_UNNUMBERED. Does that work with old kernels
> > too, do you know?
> Sorry about that. I just assumed it would work on older kernels.
> It apparently breaks the build or the pvfs2 proc entry nodes dont show up.
> > And why did you do HAVE_KMEM_CACHE_CREATE_OLD_CTOR and
> > HAVE_KMEM_CACHE_CREATE_NEW_CTOR tests separately? Are you just
> > trying to future-proof against yet another change on the ctor
> > function signature?
> yeah.. that was the intention :)
> > Why #error in the C file---you can just bail in
> > configure?
> hehe.. It did not cross my mind :)
> Good point.Updated diffs here.
> There are a few bonus cleanups and fixes for the build and configure
> time checks.
Thanks for the fixes. I checked some of it in, but can't seem to
get the kmem_cache detection part to work.
> 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 @@
> + 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)
> #define __KERNEL__
> #include <linux/slab.h>
> - static struct kmem_cache;
> + static struct kmem_cache a;
> ], ,
> - 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,
> + 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.
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?
I haven't gotten to the ctor changes yet due to getting hung up on
More information about the Pvfs2-developers