lkml.org 
[lkml]   [2004]   [Jun]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: RFC: Testing for kernel features in external modules
On Jun 24, 2004  22:30 +0200, Sam Ravnborg wrote:
> +if [ -f remap4.o ]; then
> + echo "#define REMAP4 1" > $2
> +elif [ -f remap5.o ]; then
> + echo "#define REMAP5 1" > $2
> +fi

I would prefer that these be called something like HAVE_REMAP5, or
better yet something descriptive like HAVE_REMAP_PAGE_RANGE_VMA.

This obviously needs to be smarter also, to handle adding multiple
#defines to a single .h file.

Ideally, when people make an incompatible kernel API change like this
they would just #define HAVE_REMAP_PAGE_RANGE_VMA in the header that
declares remap_page_range() directly (e.g. KERNEL_AS_O_DIRECT was added
for this reason) instead of external builds having to figure this out
themselves. Adding the check script is no less work than just adding
the #define to the appropriate header directly.

Having something like "features.h" is only useful as far as it checks
for features that applications care about. If it doesn't have checks
for features, then the apps need to implement those checks anyways
and different apps will name the script/#define differently so until
they make it into the stock kernel it isn't terribly useful.

Cheers, Andreas
--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://members.shaw.ca/adilger/ http://members.shaw.ca/golinux/

[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2005-03-22 14:04    [W:0.083 / U:1.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site