From: oracle

I've taken the master branch of oracleasm.git, reset the version
to 2.0.5, and created a source tarball for you.  It is attached.  Drop
it into the SLES11 SRPM and it should build just fine against your
kernel.  If it doesn't, let me know.

diff -ruN oracleasm-2.0.5/Config.make.in oracleasm-2.0.5-fix/Config.make.in
--- oracleasm-2.0.5/Config.make.in	2008-09-10 19:32:11.000000000 +0200
+++ oracleasm-2.0.5-fix/Config.make.in	2009-06-18 22:54:12.000000000 +0200
@@ -48,12 +48,14 @@
 KERNELDIR = @KERNELDIR@
 KERNELINC = $(KERNELDIR)/include
 KERNELVER = @KERNELVER@
+KERNELARCH = @KERNELARCH@
 BUILD_DRIVER = @BUILD_DRIVER@
 
 else
 
 BACKING_DEV_CAPABILITIES = @BACKING_DEV_CAPABILITIES@
 GET_SB_HAS_VFSMOUNT = @GET_SB_HAS_VFSMOUNT@
-EXTRA_CFLAGS += @KAPI_COMPAT_CFLAGS@
+KAPI_COMPAT_CFLAGS = @KAPI_COMPAT_CFLAGS@
+TRANS_COMPAT_CFLAGS = @TRANS_COMPAT_CFLAGS@
 
 endif
diff -ruN oracleasm-2.0.5/Makefile oracleasm-2.0.5-fix/Makefile
--- oracleasm-2.0.5/Makefile	2008-09-10 19:32:11.000000000 +0200
+++ oracleasm-2.0.5-fix/Makefile	2009-06-18 22:54:12.000000000 +0200
@@ -18,10 +18,15 @@
 
 KAPI_COMPAT_FILES =					\
 	kapi-compat/include/bio_end_io.h		\
+	kapi-compat/include/bio_map_user.h		\
+	kapi-compat/include/blkdev_get.h		\
+	kapi-compat/include/blkdev_put.h		\
+	kapi-compat/include/current_creds.h		\
 	kapi-compat/include/i_blksize.h			\
 	kapi-compat/include/i_mutex.h			\
 	kapi-compat/include/i_private.h			\
 	kapi-compat/include/kmem_cache_create.h		\
+	kapi-compat/include/kmem_cache_s.h		\
 	kapi-compat/include/slab_ctor_three_arg.h	\
 	kapi-compat/include/slab_ctor_two_arg.h		\
 	kapi-compat/include/slab_ctor_verify.h
diff -ruN oracleasm-2.0.5/configure oracleasm-2.0.5-fix/configure
--- oracleasm-2.0.5/configure	2008-09-10 19:32:11.000000000 +0200
+++ oracleasm-2.0.5-fix/configure	2009-11-13 04:34:08.000000000 +0100
@@ -1,60 +1,81 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61.
+# Generated by GNU Autoconf 2.64.
 #
 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software
+# Foundation, Inc.
+#
 # This configure script is free software; the Free Software Foundation
 # gives unlimited permission to copy, distribute and modify it.
-## --------------------- ##
-## M4sh Initialization.  ##
-## --------------------- ##
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
 
 # Be more Bourne compatible
 DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
   emulate sh
   NULLCMD=:
-  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
   # is contrary to our usage.  Disable this feature.
   alias -g '${1+"$@"}'='"$@"'
   setopt NO_GLOB_SUBST
 else
-  case `(set -o) 2>/dev/null` in
-  *posix*) set -o posix ;;
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
 esac
-
 fi
 
 
-
-
-# PATH needs CR
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conf$$.sh
-  echo  "exit 0"   >>conf$$.sh
-  chmod +x conf$$.sh
-  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-    PATH_SEPARATOR=';'
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
   else
-    PATH_SEPARATOR=:
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+	expr "X$arg" : "X\\(.*\\)$as_nl";
+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
   fi
-  rm -f conf$$.sh
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
 fi
 
-# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
-  as_unset=unset
-else
-  as_unset=false
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
 fi
 
 
@@ -63,20 +84,18 @@
 # there to prevent editors from complaining about space-tab.
 # (If _AS_PATH_WALK were called with IFS unset, it would disable word
 # splitting by setting IFS to empty value.)
-as_nl='
-'
 IFS=" ""	$as_nl"
 
 # Find who we are.  Look in the path if we contain no directory separator.
-case $0 in
+case $0 in #((
   *[\\/]* ) as_myself=$0 ;;
   *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
+    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+  done
 IFS=$as_save_IFS
 
      ;;
@@ -87,354 +106,321 @@
   as_myself=$0
 fi
 if test ! -f "$as_myself"; then
-  echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
-  { (exit 1); exit 1; }
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
 fi
 
-# Work around bugs in pre-3.0 UWIN ksh.
-for as_var in ENV MAIL MAILPATH
-do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
 done
 PS1='$ '
 PS2='> '
 PS4='+ '
 
 # NLS nuisances.
-for as_var in \
-  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
-  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
-  LC_TELEPHONE LC_TIME
-do
-  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
-    eval $as_var=C; export $as_var
-  else
-    ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
-  fi
-done
-
-# Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1 &&
-   test "X`expr 00001 : '.*\(...\)'`" = X001; then
-  as_expr=expr
-else
-  as_expr=false
-fi
-
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
-  as_basename=basename
-else
-  as_basename=false
-fi
-
-
-# Name of the executable.
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
-	 X"$0" : 'X\(//\)$' \| \
-	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-echo X/"$0" |
-    sed '/^.*\/\([^/][^/]*\)\/*$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\/\(\/\/\)$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\/\(\/\).*/{
-	    s//\1/
-	    q
-	  }
-	  s/.*/./; q'`
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
 
 # CDPATH.
-$as_unset CDPATH
-
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
 if test "x$CONFIG_SHELL" = x; then
-  if (eval ":") 2>/dev/null; then
-  as_have_required=yes
+  as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '\${1+\"\$@\"}'='\"\$@\"'
+  setopt NO_GLOB_SUBST
 else
-  as_have_required=no
+  case \`(set -o) 2>/dev/null\` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
 fi
-
-  if test $as_have_required = yes && 	 (eval ":
-(as_func_return () {
-  (exit \$1)
-}
-as_func_success () {
-  as_func_return 0
-}
-as_func_failure () {
-  as_func_return 1
-}
-as_func_ret_success () {
-  return 0
-}
-as_func_ret_failure () {
-  return 1
-}
+"
+  as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
 
 exitcode=0
-if as_func_success; then
-  :
-else
-  exitcode=1
-  echo as_func_success failed.
-fi
-
-if as_func_failure; then
-  exitcode=1
-  echo as_func_failure succeeded.
-fi
-
-if as_func_ret_success; then
-  :
-else
-  exitcode=1
-  echo as_func_ret_success failed.
-fi
-
-if as_func_ret_failure; then
-  exitcode=1
-  echo as_func_ret_failure succeeded.
-fi
-
-if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
-  :
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+  exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1"
+  as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+  as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+  eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+  test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
+test \$(( 1 + 1 )) = 2 || exit 1"
+  if (eval "$as_required") 2>/dev/null; then :
+  as_have_required=yes
 else
-  exitcode=1
-  echo positional parameters were not saved.
+  as_have_required=no
 fi
+  if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
 
-test \$exitcode = 0) || { (exit 1); exit 1; }
-
-(
-  as_lineno_1=\$LINENO
-  as_lineno_2=\$LINENO
-  test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
-  test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
-") 2> /dev/null; then
-  :
 else
-  as_candidate_shells=
-    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
 for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  case $as_dir in
+  as_found=:
+  case $as_dir in #(
 	 /*)
 	   for as_base in sh bash ksh sh5; do
-	     as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
+	     # Try only shells that exist, to save several forks.
+	     as_shell=$as_dir/$as_base
+	     if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+		    { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  CONFIG_SHELL=$as_shell as_have_required=yes
+		   if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  break 2
+fi
+fi
 	   done;;
        esac
+  as_found=false
 done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+	      { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+  CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
 IFS=$as_save_IFS
 
 
-      for as_shell in $as_candidate_shells $SHELL; do
-	 # Try only shells that exist, to save several forks.
-	 if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
-		{ ("$as_shell") 2> /dev/null <<\_ASEOF
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
-  emulate sh
-  NULLCMD=:
-  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
-  # is contrary to our usage.  Disable this feature.
-  alias -g '${1+"$@"}'='"$@"'
-  setopt NO_GLOB_SUBST
-else
-  case `(set -o) 2>/dev/null` in
-  *posix*) set -o posix ;;
-esac
-
+      if test "x$CONFIG_SHELL" != x; then :
+  # We cannot yet assume a decent shell, so we have to provide a
+	# neutralization value for shells without unset; and this also
+	# works around shells that cannot unset nonexistent variables.
+	BASH_ENV=/dev/null
+	ENV=/dev/null
+	(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+	export CONFIG_SHELL
+	exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+    if test x$as_have_required = xno; then :
+  $as_echo "$0: This script requires a shell more modern than all"
+  $as_echo "$0: the shells that I found on your system."
+  if test x${ZSH_VERSION+set} = xset ; then
+    $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+    $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+  else
+    $as_echo "$0: Please tell bug-autoconf@gnu.org about your system,
+$0: including any error possibly output before this
+$0: message. Then install a modern shell, or manually run
+$0: the script under such a shell if you do have one."
+  fi
+  exit 1
 fi
-
-
-:
-_ASEOF
-}; then
-  CONFIG_SHELL=$as_shell
-	       as_have_required=yes
-	       if { "$as_shell" 2> /dev/null <<\_ASEOF
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
-  emulate sh
-  NULLCMD=:
-  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
-  # is contrary to our usage.  Disable this feature.
-  alias -g '${1+"$@"}'='"$@"'
-  setopt NO_GLOB_SUBST
-else
-  case `(set -o) 2>/dev/null` in
-  *posix*) set -o posix ;;
-esac
-
 fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
 
-
-:
-(as_func_return () {
-  (exit $1)
-}
-as_func_success () {
-  as_func_return 0
-}
-as_func_failure () {
-  as_func_return 1
-}
-as_func_ret_success () {
-  return 0
-}
-as_func_ret_failure () {
-  return 1
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
 }
+as_unset=as_fn_unset
 
-exitcode=0
-if as_func_success; then
-  :
-else
-  exitcode=1
-  echo as_func_success failed.
-fi
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
 
-if as_func_failure; then
-  exitcode=1
-  echo as_func_failure succeeded.
-fi
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
 
-if as_func_ret_success; then
-  :
-else
-  exitcode=1
-  echo as_func_ret_success failed.
-fi
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir"
 
-if as_func_ret_failure; then
-  exitcode=1
-  echo as_func_ret_failure succeeded.
-fi
 
-if ( set x; as_func_ret_success y && test x = "$1" ); then
-  :
+} # as_fn_mkdir_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
 else
-  exitcode=1
-  echo positional parameters were not saved.
-fi
-
-test $exitcode = 0) || { (exit 1); exit 1; }
-
-(
-  as_lineno_1=$LINENO
-  as_lineno_2=$LINENO
-  test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
-
-_ASEOF
-}; then
-  break
-fi
-
-fi
-
-      done
-
-      if test "x$CONFIG_SHELL" != x; then
-  for as_var in BASH_ENV ENV
-        do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
-        done
-        export CONFIG_SHELL
-        exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
-fi
-
-
-    if test $as_have_required = no; then
-  echo This script requires a shell more modern than all the
-      echo shells that I found on your system.  Please install a
-      echo modern shell, or manually run the script under such a
-      echo shell if you do have one.
-      { (exit 1); exit 1; }
-fi
-
-
-fi
-
-fi
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
 
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
 
 
-(eval "as_func_return () {
-  (exit \$1)
-}
-as_func_success () {
-  as_func_return 0
-}
-as_func_failure () {
-  as_func_return 1
-}
-as_func_ret_success () {
-  return 0
-}
-as_func_ret_failure () {
-  return 1
-}
+# as_fn_error ERROR [LINENO LOG_FD]
+# ---------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with status $?, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$?; test $as_status -eq 0 && as_status=1
+  if test "$3"; then
+    as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3
+  fi
+  $as_echo "$as_me: error: $1" >&2
+  as_fn_exit $as_status
+} # as_fn_error
 
-exitcode=0
-if as_func_success; then
-  :
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
 else
-  exitcode=1
-  echo as_func_success failed.
-fi
-
-if as_func_failure; then
-  exitcode=1
-  echo as_func_failure succeeded.
+  as_expr=false
 fi
 
-if as_func_ret_success; then
-  :
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
 else
-  exitcode=1
-  echo as_func_ret_success failed.
-fi
-
-if as_func_ret_failure; then
-  exitcode=1
-  echo as_func_ret_failure succeeded.
+  as_basename=false
 fi
 
-if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
-  :
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
 else
-  exitcode=1
-  echo positional parameters were not saved.
+  as_dirname=false
 fi
 
-test \$exitcode = 0") || {
-  echo No shell found that supports shell functions.
-  echo Please tell autoconf@gnu.org about your system,
-  echo including any error possibly output before this
-  echo message
-}
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
 
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
 
 
-  as_lineno_1=$LINENO
-  as_lineno_2=$LINENO
-  test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
-
-  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
-  # uniformly replaced by the line number.  The first 'sed' inserts a
-  # line-number line after each line using $LINENO; the second 'sed'
-  # does the real work.  The second script uses 'N' to pair each
-  # line-number line with the line containing $LINENO, and appends
-  # trailing '-' during substitution so that $LINENO is not a special
-  # case at line end.
-  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
-  # scripts with optimization help from Paolo Bonzini.  Blame Lee
-  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  as_lineno_1=$LINENO as_lineno_1a=$LINENO
+  as_lineno_2=$LINENO as_lineno_2a=$LINENO
+  eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+  test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
   sed -n '
     p
     /[$]LINENO/=
@@ -451,8 +437,7 @@
       s/-\n.*//
     ' >$as_me.lineno &&
   chmod +x "$as_me.lineno" ||
-    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
-   { (exit 1); exit 1; }; }
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
 
   # Don't try to exec as it changes $[0], causing all sort of problems
   # (the dirname of $[0] is not the place where we might find the
@@ -462,49 +447,40 @@
   exit
 }
 
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
-  as_dirname=dirname
-else
-  as_dirname=false
-fi
-
 ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in
+case `echo -n x` in #(((((
 -n*)
-  case `echo 'x\c'` in
+  case `echo 'xy\c'` in
   *c*) ECHO_T='	';;	# ECHO_T is single tab character.
-  *)   ECHO_C='\c';;
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='	';;
   esac;;
 *)
   ECHO_N='-n';;
 esac
 
-if expr a : '\(a\)' >/dev/null 2>&1 &&
-   test "X`expr 00001 : '.*\(...\)'`" = X001; then
-  as_expr=expr
-else
-  as_expr=false
-fi
-
 rm -f conf$$ conf$$.exe conf$$.file
 if test -d conf$$.dir; then
   rm -f conf$$.dir/conf$$.file
 else
   rm -f conf$$.dir
-  mkdir conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
 fi
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
-  as_ln_s='ln -s'
-  # ... but there are two gotchas:
-  # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
-  # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-  # In both cases, we have to default to `cp -p'.
-  ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
     as_ln_s='cp -p'
-elif ln conf$$.file conf$$ 2>/dev/null; then
-  as_ln_s=ln
+  fi
 else
   as_ln_s='cp -p'
 fi
@@ -512,7 +488,7 @@
 rmdir conf$$.dir 2>/dev/null
 
 if mkdir -p . 2>/dev/null; then
-  as_mkdir_p=:
+  as_mkdir_p='mkdir -p "$as_dir"'
 else
   test -d ./-p && rmdir ./-p
   as_mkdir_p=false
@@ -529,12 +505,12 @@
   as_test_x='
     eval sh -c '\''
       if test -d "$1"; then
-        test -d "$1/.";
+	test -d "$1/.";
       else
-	case $1 in
-        -*)set "./$1";;
+	case $1 in #(
+	-*)set "./$1";;
 	esac;
-	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
 	???[sx]*):;;*)false;;esac;fi
     '\'' sh
   '
@@ -548,7 +524,6 @@
 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
 
 
-
 exec 7<&0 </dev/null 6>&1
 
 # Name of the host.
@@ -567,7 +542,6 @@
 subdirs=
 MFLAGS=
 MAKEFLAGS=
-SHELL=${CONFIG_SHELL-/bin/sh}
 
 # Identity of this package.
 PACKAGE_NAME=
@@ -575,6 +549,7 @@
 PACKAGE_VERSION=
 PACKAGE_STRING=
 PACKAGE_BUGREPORT=
+PACKAGE_URL=
 
 ac_unique_file="Makefile"
 # Factoring default headers for most tests.
@@ -613,85 +588,95 @@
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='SHELL
-PATH_SEPARATOR
-PACKAGE_NAME
-PACKAGE_TARNAME
-PACKAGE_VERSION
-PACKAGE_STRING
-PACKAGE_BUGREPORT
-exec_prefix
-prefix
-program_transform_name
-bindir
-sbindir
-libexecdir
-datarootdir
-datadir
-sysconfdir
-sharedstatedir
-localstatedir
-includedir
-oldincludedir
-docdir
-infodir
-htmldir
-dvidir
-pdfdir
-psdir
-libdir
-localedir
-mandir
-DEFS
-ECHO_C
-ECHO_N
-ECHO_T
-LIBS
-build_alias
-host_alias
-target_alias
-PACKAGE
-MAJOR_VERSION
-MINOR_VERSION
-MICRO_VERSION
-INTERFACE_AGE
-BINARY_AGE
-VERSION
-DIST_VERSION
-build
-build_cpu
-build_vendor
-build_os
-host
-host_cpu
-host_vendor
-host_os
-CC
-CFLAGS
-LDFLAGS
-CPPFLAGS
-ac_ct_CC
-EXEEXT
-OBJEXT
-CPP
-INSTALL_PROGRAM
-INSTALL_SCRIPT
-INSTALL_DATA
-LN_S
-RANLIB
-AR
-GREP
-EGREP
-vendordir
-KERNELDIR
-BUILD_DRIVER
-KERNELVER
-KAPI_COMPAT_CFLAGS
-BACKING_DEV_CAPABILITIES
-GET_SB_HAS_VFSMOUNT
+ac_subst_vars='LTLIBOBJS
 LIBOBJS
-LTLIBOBJS'
+GET_SB_HAS_VFSMOUNT
+BACKING_DEV_CAPABILITIES
+TRANS_COMPAT_CFLAGS
+KAPI_COMPAT_CFLAGS
+KERNELARCH
+KERNELVER
+BUILD_DRIVER
+KERNELDIR
+vendordir
+EGREP
+GREP
+AR
+RANLIB
+LN_S
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+CPP
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+DIST_VERSION
+VERSION
+BINARY_AGE
+INTERFACE_AGE
+MICRO_VERSION
+MINOR_VERSION
+MAJOR_VERSION
+PACKAGE
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
 ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+with_vendor
+with_vendorkernel
+with_kernel
+with_kernel_source
+'
       ac_precious_vars='build_alias
 host_alias
 target_alias
@@ -706,6 +691,8 @@
 # Initialize some variables set by options.
 ac_init_help=
 ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
 # The variables have the same names as the options, with
 # dashes changed to underlines.
 cache_file=/dev/null
@@ -804,13 +791,20 @@
     datarootdir=$ac_optarg ;;
 
   -disable-* | --disable-*)
-    ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
-   { (exit 1); exit 1; }; }
-    ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
-    eval enable_$ac_feature=no ;;
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=no ;;
 
   -docdir | --docdir | --docdi | --doc | --do)
     ac_prev=docdir ;;
@@ -823,13 +817,20 @@
     dvidir=$ac_optarg ;;
 
   -enable-* | --enable-*)
-    ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
-   { (exit 1); exit 1; }; }
-    ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
-    eval enable_$ac_feature=\$ac_optarg ;;
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=\$ac_optarg ;;
 
   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
@@ -1020,22 +1021,36 @@
     ac_init_version=: ;;
 
   -with-* | --with-*)
-    ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid package name: $ac_package" >&2
-   { (exit 1); exit 1; }; }
-    ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
-    eval with_$ac_package=\$ac_optarg ;;
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=\$ac_optarg ;;
 
   -without-* | --without-*)
-    ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid package name: $ac_package" >&2
-   { (exit 1); exit 1; }; }
-    ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
-    eval with_$ac_package=no ;;
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=no ;;
 
   --x)
     # Obsolete; use --with-x.
@@ -1055,25 +1070,25 @@
   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
     x_libraries=$ac_optarg ;;
 
-  -*) { echo "$as_me: error: unrecognized option: $ac_option
-Try \`$0 --help' for more information." >&2
-   { (exit 1); exit 1; }; }
+  -*) as_fn_error "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information."
     ;;
 
   *=*)
     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
-   { (exit 1); exit 1; }; }
+    case $ac_envvar in #(
+      '' | [0-9]* | *[!_$as_cr_alnum]* )
+      as_fn_error "invalid variable name: \`$ac_envvar'" ;;
+    esac
     eval $ac_envvar=\$ac_optarg
     export $ac_envvar ;;
 
   *)
     # FIXME: should be removed in autoconf 3.0.
-    echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
-      echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+      $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
     : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
     ;;
 
@@ -1082,23 +1097,36 @@
 
 if test -n "$ac_prev"; then
   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
-  { echo "$as_me: error: missing argument to $ac_option" >&2
-   { (exit 1); exit 1; }; }
+  as_fn_error "missing argument to $ac_option"
 fi
 
-# Be sure to have absolute directory names.
+if test -n "$ac_unrecognized_opts"; then
+  case $enable_option_checking in
+    no) ;;
+    fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;;
+    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+  esac
+fi
+
+# Check all directory arguments for consistency.
 for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
 		datadir sysconfdir sharedstatedir localstatedir includedir \
 		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
 		libdir localedir mandir
 do
   eval ac_val=\$$ac_var
+  # Remove trailing slashes.
+  case $ac_val in
+    */ )
+      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+      eval $ac_var=\$ac_val;;
+  esac
+  # Be sure to have absolute directory names.
   case $ac_val in
     [\\/$]* | ?:[\\/]* )  continue;;
     NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
   esac
-  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
-   { (exit 1); exit 1; }; }
+  as_fn_error "expected an absolute directory name for --$ac_var: $ac_val"
 done
 
 # There might be people who depend on the old broken behavior: `$host'
@@ -1112,7 +1140,7 @@
 if test "x$host_alias" != x; then
   if test "x$build_alias" = x; then
     cross_compiling=maybe
-    echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+    $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
     If a cross compiler is detected then cross compile mode will be used." >&2
   elif test "x$build_alias" != "x$host_alias"; then
     cross_compiling=yes
@@ -1128,23 +1156,21 @@
 ac_pwd=`pwd` && test -n "$ac_pwd" &&
 ac_ls_di=`ls -di .` &&
 ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
-  { echo "$as_me: error: Working directory cannot be determined" >&2
-   { (exit 1); exit 1; }; }
+  as_fn_error "working directory cannot be determined"
 test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
-  { echo "$as_me: error: pwd does not report name of working directory" >&2
-   { (exit 1); exit 1; }; }
+  as_fn_error "pwd does not report name of working directory"
 
 
 # Find the source files, if location was not specified.
 if test -z "$srcdir"; then
   ac_srcdir_defaulted=yes
   # Try the directory containing this script, then the parent directory.
-  ac_confdir=`$as_dirname -- "$0" ||
-$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$0" : 'X\(//\)[^/]' \| \
-	 X"$0" : 'X\(//\)$' \| \
-	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$0" |
+  ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_myself" : 'X\(//\)[^/]' \| \
+	 X"$as_myself" : 'X\(//\)$' \| \
+	 X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
 	    s//\1/
 	    q
@@ -1171,13 +1197,11 @@
 fi
 if test ! -r "$srcdir/$ac_unique_file"; then
   test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
-  { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
-   { (exit 1); exit 1; }; }
+  as_fn_error "cannot find sources ($ac_unique_file) in $srcdir"
 fi
 ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
 ac_abs_confdir=`(
-	cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2
-   { (exit 1); exit 1; }; }
+	cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg"
 	pwd)`
 # When building in place, set srcdir=.
 if test "$ac_abs_confdir" = "$ac_pwd"; then
@@ -1225,9 +1249,9 @@
 
 Installation directories:
   --prefix=PREFIX         install architecture-independent files in PREFIX
-			  [$ac_default_prefix]
+                          [$ac_default_prefix]
   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
-			  [PREFIX]
+                          [PREFIX]
 
 By default, \`make install' will install all the files in
 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
@@ -1237,25 +1261,25 @@
 For better control, use the options below.
 
 Fine tuning of the installation directories:
-  --bindir=DIR           user executables [EPREFIX/bin]
-  --sbindir=DIR          system admin executables [EPREFIX/sbin]
-  --libexecdir=DIR       program executables [EPREFIX/libexec]
-  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
-  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
-  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
-  --libdir=DIR           object code libraries [EPREFIX/lib]
-  --includedir=DIR       C header files [PREFIX/include]
-  --oldincludedir=DIR    C header files for non-gcc [/usr/include]
-  --datarootdir=DIR      read-only arch.-independent data root [PREFIX/share]
-  --datadir=DIR          read-only architecture-independent data [DATAROOTDIR]
-  --infodir=DIR          info documentation [DATAROOTDIR/info]
-  --localedir=DIR        locale-dependent data [DATAROOTDIR/locale]
-  --mandir=DIR           man documentation [DATAROOTDIR/man]
-  --docdir=DIR           documentation root [DATAROOTDIR/doc/PACKAGE]
-  --htmldir=DIR          html documentation [DOCDIR]
-  --dvidir=DIR           dvi documentation [DOCDIR]
-  --pdfdir=DIR           pdf documentation [DOCDIR]
-  --psdir=DIR            ps documentation [DOCDIR]
+  --bindir=DIR            user executables [EPREFIX/bin]
+  --sbindir=DIR           system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR        program executables [EPREFIX/libexec]
+  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --libdir=DIR            object code libraries [EPREFIX/lib]
+  --includedir=DIR        C header files [PREFIX/include]
+  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
+  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR           info documentation [DATAROOTDIR/info]
+  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR            man documentation [DATAROOTDIR/man]
+  --docdir=DIR            documentation root [DATAROOTDIR/doc/PACKAGE]
+  --htmldir=DIR           html documentation [DOCDIR]
+  --dvidir=DIR            dvi documentation [DOCDIR]
+  --pdfdir=DIR            pdf documentation [DOCDIR]
+  --psdir=DIR             ps documentation [DOCDIR]
 _ACEOF
 
   cat <<\_ACEOF
@@ -1291,6 +1315,7 @@
 Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
 
+Report bugs to the package provider.
 _ACEOF
 ac_status=$?
 fi
@@ -1298,15 +1323,17 @@
 if test "$ac_init_help" = "recursive"; then
   # If there are subdirs, report their specific --help.
   for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
-    test -d "$ac_dir" || continue
+    test -d "$ac_dir" ||
+      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+      continue
     ac_builddir=.
 
 case "$ac_dir" in
 .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
 *)
-  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
   # A ".." for each directory in $ac_dir_suffix.
-  ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
   case $ac_top_builddir_sub in
   "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
   *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
@@ -1333,40 +1360,369 @@
 esac
 ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
 
-    cd "$ac_dir" || { ac_status=$?; continue; }
-    # Check for guested configure.
-    if test -f "$ac_srcdir/configure.gnu"; then
-      echo &&
-      $SHELL "$ac_srcdir/configure.gnu" --help=recursive
-    elif test -f "$ac_srcdir/configure"; then
-      echo &&
-      $SHELL "$ac_srcdir/configure" --help=recursive
-    else
-      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
-    fi || ac_status=$?
-    cd "$ac_pwd" || { ac_status=$?; break; }
-  done
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested configure.
+    if test -f "$ac_srcdir/configure.gnu"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+    elif test -f "$ac_srcdir/configure"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure" --help=recursive
+    else
+      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
+  done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+  cat <<\_ACEOF
+configure
+generated by GNU Autoconf 2.64
+
+Copyright (C) 2009 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+  exit
+fi
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext
+  if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_retval=1
+fi
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  return $ac_retval
+
+} # ac_fn_c_try_compile
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+    ac_retval=1
+fi
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  return $ac_retval
+
+} # ac_fn_c_try_cpp
+
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+       $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=$ac_status
+fi
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  return $ac_retval
+
+} # ac_fn_c_try_run
+
+# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES
+# --------------------------------------------
+# Tries to find the compile-time value of EXPR in a program that includes
+# INCLUDES, setting VAR accordingly. Returns whether the value could be
+# computed
+ac_fn_c_compute_int ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if test "$cross_compiling" = yes; then
+    # Depending upon the size, compute the lo and hi bounds.
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) >= 0)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_lo=0 ac_mid=0
+  while :; do
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) <= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_hi=$ac_mid; break
+else
+  as_fn_arith $ac_mid + 1 && ac_lo=$as_val
+			if test $ac_lo -le $ac_mid; then
+			  ac_lo= ac_hi=
+			  break
+			fi
+			as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) < 0)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_hi=-1 ac_mid=-1
+  while :; do
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) >= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_lo=$ac_mid; break
+else
+  as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val
+			if test $ac_mid -le $ac_hi; then
+			  ac_lo= ac_hi=
+			  break
+			fi
+			as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  ac_lo= ac_hi=
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+  as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) <= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_hi=$ac_mid
+else
+  as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in #((
+?*) eval "$3=\$ac_lo"; ac_retval=0 ;;
+'') ac_retval=1 ;;
+esac
+  else
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+static long int longval () { return $2; }
+static unsigned long int ulongval () { return $2; }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+  FILE *f = fopen ("conftest.val", "w");
+  if (! f)
+    return 1;
+  if (($2) < 0)
+    {
+      long int i = longval ();
+      if (i != ($2))
+	return 1;
+      fprintf (f, "%ld", i);
+    }
+  else
+    {
+      unsigned long int i = ulongval ();
+      if (i != ($2))
+	return 1;
+      fprintf (f, "%lu", i);
+    }
+  /* Do not output a trailing newline, as this causes \r\n confusion
+     on some platforms.  */
+  return ferror (f) || fclose (f) != 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  echo >>conftest.val; read $3 <conftest.val; ac_retval=0
+else
+  ac_retval=1
 fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f conftest.val
 
-test -n "$ac_init_help" && exit $ac_status
-if $ac_init_version; then
-  cat <<\_ACEOF
-configure
-generated by GNU Autoconf 2.61
+  fi
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  return $ac_retval
 
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
-This configure script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it.
+} # ac_fn_c_compute_int
+
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#include <$2>
 _ACEOF
-  exit
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
 fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_header_compile
 cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
 It was created by $as_me, which was
-generated by GNU Autoconf 2.61.  Invocation command line was
+generated by GNU Autoconf 2.64.  Invocation command line was
 
   $ $0 $@
 
@@ -1402,8 +1758,8 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  echo "PATH: $as_dir"
-done
+    $as_echo "PATH: $as_dir"
+  done
 IFS=$as_save_IFS
 
 } >&5
@@ -1437,12 +1793,12 @@
     | -silent | --silent | --silen | --sile | --sil)
       continue ;;
     *\'*)
-      ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+      ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
     esac
     case $ac_pass in
-    1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+    1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
     2)
-      ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+      as_fn_append ac_configure_args1 " '$ac_arg'"
       if test $ac_must_keep_next = true; then
 	ac_must_keep_next=false # Got value, back to normal.
       else
@@ -1458,13 +1814,13 @@
 	  -* ) ac_must_keep_next=true ;;
 	esac
       fi
-      ac_configure_args="$ac_configure_args '$ac_arg'"
+      as_fn_append ac_configure_args " '$ac_arg'"
       ;;
     esac
   done
 done
-$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
-$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset ac_configure_args1;}
 
 # When interrupted or exit'd, cleanup temporary files, and complete
 # config.log.  We remove comments because anyway the quotes in there
@@ -1489,12 +1845,13 @@
     case $ac_val in #(
     *${as_nl}*)
       case $ac_var in #(
-      *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
-echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
       esac
       case $ac_var in #(
       _ | IFS | as_nl) ;; #(
-      *) $as_unset $ac_var ;;
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
       esac ;;
     esac
   done
@@ -1523,9 +1880,9 @@
     do
       eval ac_val=\$$ac_var
       case $ac_val in
-      *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
       esac
-      echo "$ac_var='\''$ac_val'\''"
+      $as_echo "$ac_var='\''$ac_val'\''"
     done | sort
     echo
 
@@ -1540,9 +1897,9 @@
       do
 	eval ac_val=\$$ac_var
 	case $ac_val in
-	*\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+	*\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
 	esac
-	echo "$ac_var='\''$ac_val'\''"
+	$as_echo "$ac_var='\''$ac_val'\''"
       done | sort
       echo
     fi
@@ -1558,64 +1915,69 @@
       echo
     fi
     test "$ac_signal" != 0 &&
-      echo "$as_me: caught signal $ac_signal"
-    echo "$as_me: exit $exit_status"
+      $as_echo "$as_me: caught signal $ac_signal"
+    $as_echo "$as_me: exit $exit_status"
   } >&5
   rm -f core *.core core.conftest.* &&
     rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
     exit $exit_status
 ' 0
 for ac_signal in 1 2 13 15; do
-  trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+  trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
 done
 ac_signal=0
 
 # confdefs.h avoids OS command line length limits that DEFS can exceed.
 rm -f -r conftest* confdefs.h
 
+$as_echo "/* confdefs.h */" > confdefs.h
+
 # Predefined preprocessor variables.
 
 cat >>confdefs.h <<_ACEOF
 #define PACKAGE_NAME "$PACKAGE_NAME"
 _ACEOF
 
-
 cat >>confdefs.h <<_ACEOF
 #define PACKAGE_TARNAME "$PACKAGE_TARNAME"
 _ACEOF
 
-
 cat >>confdefs.h <<_ACEOF
 #define PACKAGE_VERSION "$PACKAGE_VERSION"
 _ACEOF
 
-
 cat >>confdefs.h <<_ACEOF
 #define PACKAGE_STRING "$PACKAGE_STRING"
 _ACEOF
 
-
 cat >>confdefs.h <<_ACEOF
 #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
 _ACEOF
 
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
 
 # Let the site file select an alternate cache file if it wants to.
-# Prefer explicitly selected file to automatically selected ones.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
 if test -n "$CONFIG_SITE"; then
-  set x "$CONFIG_SITE"
+  ac_site_file1=$CONFIG_SITE
 elif test "x$prefix" != xNONE; then
-  set x "$prefix/share/config.site" "$prefix/etc/config.site"
+  ac_site_file1=$prefix/share/config.site
+  ac_site_file2=$prefix/etc/config.site
 else
-  set x "$ac_default_prefix/share/config.site" \
-	"$ac_default_prefix/etc/config.site"
+  ac_site_file1=$ac_default_prefix/share/config.site
+  ac_site_file2=$ac_default_prefix/etc/config.site
 fi
-shift
-for ac_site_file
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
 do
+  test "x$ac_site_file" = xNONE && continue
   if test -r "$ac_site_file"; then
-    { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
-echo "$as_me: loading site script $ac_site_file" >&6;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
     sed 's/^/| /' "$ac_site_file" >&5
     . "$ac_site_file"
   fi
@@ -1625,16 +1987,16 @@
   # Some versions of bash will fail to source /dev/null (special
   # files actually), so we avoid doing that.
   if test -f "$cache_file"; then
-    { echo "$as_me:$LINENO: loading cache $cache_file" >&5
-echo "$as_me: loading cache $cache_file" >&6;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
     case $cache_file in
       [\\/]* | ?:[\\/]* ) . "$cache_file";;
       *)                      . "./$cache_file";;
     esac
   fi
 else
-  { echo "$as_me:$LINENO: creating cache $cache_file" >&5
-echo "$as_me: creating cache $cache_file" >&6;}
+  { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
   >$cache_file
 fi
 
@@ -1648,60 +2010,56 @@
   eval ac_new_val=\$ac_env_${ac_var}_value
   case $ac_old_set,$ac_new_set in
     set,)
-      { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
       ac_cache_corrupted=: ;;
     ,set)
-      { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
       ac_cache_corrupted=: ;;
     ,);;
     *)
       if test "x$ac_old_val" != "x$ac_new_val"; then
-	{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
-echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
-	{ echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
-echo "$as_me:   former value:  $ac_old_val" >&2;}
-	{ echo "$as_me:$LINENO:   current value: $ac_new_val" >&5
-echo "$as_me:   current value: $ac_new_val" >&2;}
-	ac_cache_corrupted=:
+	# differences in whitespace do not lead to failure.
+	ac_old_val_w=`echo x $ac_old_val`
+	ac_new_val_w=`echo x $ac_new_val`
+	if test "$ac_old_val_w" != "$ac_new_val_w"; then
+	  { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+	  ac_cache_corrupted=:
+	else
+	  { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+	  eval $ac_var=\$ac_old_val
+	fi
+	{ $as_echo "$as_me:${as_lineno-$LINENO}:   former value:  \`$ac_old_val'" >&5
+$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
+	{ $as_echo "$as_me:${as_lineno-$LINENO}:   current value: \`$ac_new_val'" >&5
+$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
       fi;;
   esac
   # Pass precious variables to config.status.
   if test "$ac_new_set" = set; then
     case $ac_new_val in
-    *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
     *) ac_arg=$ac_var=$ac_new_val ;;
     esac
     case " $ac_configure_args " in
       *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
-      *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+      *) as_fn_append ac_configure_args " '$ac_arg'" ;;
     esac
   fi
 done
 if $ac_cache_corrupted; then
-  { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
-echo "$as_me: error: changes in the environment can compromise the build" >&2;}
-  { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
-echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
-   { (exit 1); exit 1; }; }
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
 
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
@@ -1744,24 +2102,16 @@
 
 ac_aux_dir=
 for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
-  if test -f "$ac_dir/install-sh"; then
-    ac_aux_dir=$ac_dir
-    ac_install_sh="$ac_aux_dir/install-sh -c"
-    break
-  elif test -f "$ac_dir/install.sh"; then
-    ac_aux_dir=$ac_dir
-    ac_install_sh="$ac_aux_dir/install.sh -c"
-    break
-  elif test -f "$ac_dir/shtool"; then
-    ac_aux_dir=$ac_dir
-    ac_install_sh="$ac_aux_dir/shtool install -c"
-    break
-  fi
+  for ac_t in install-sh install.sh shtool; do
+    if test -f "$ac_dir/$ac_t"; then
+      ac_aux_dir=$ac_dir
+      ac_install_sh="$ac_aux_dir/$ac_t -c"
+      break 2
+    fi
+  done
 done
 if test -z "$ac_aux_dir"; then
-  { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5
-echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;}
-   { (exit 1); exit 1; }; }
+  as_fn_error "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
 fi
 
 # These three variables are undocumented and unsupported,
@@ -1775,35 +2125,27 @@
 
 # Make sure we can run config.sub.
 $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
-  { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
-echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
-   { (exit 1); exit 1; }; }
-
-{ echo "$as_me:$LINENO: checking build system type" >&5
-echo $ECHO_N "checking build system type... $ECHO_C" >&6; }
-if test "${ac_cv_build+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  as_fn_error "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if test "${ac_cv_build+set}" = set; then :
+  $as_echo_n "(cached) " >&6
 else
   ac_build_alias=$build_alias
 test "x$ac_build_alias" = x &&
   ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
 test "x$ac_build_alias" = x &&
-  { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
-echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
-   { (exit 1); exit 1; }; }
+  as_fn_error "cannot guess build type; you must specify one" "$LINENO" 5
 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
-  { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
-echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
-   { (exit 1); exit 1; }; }
+  as_fn_error "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
 
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5
-echo "${ECHO_T}$ac_cv_build" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
 case $ac_cv_build in
 *-*-*) ;;
-*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
-echo "$as_me: error: invalid value of canonical build" >&2;}
-   { (exit 1); exit 1; }; };;
+*) as_fn_error "invalid value of canonical build" "$LINENO" 5;;
 esac
 build=$ac_cv_build
 ac_save_IFS=$IFS; IFS='-'
@@ -1819,28 +2161,24 @@
 case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
 
 
-{ echo "$as_me:$LINENO: checking host system type" >&5
-echo $ECHO_N "checking host system type... $ECHO_C" >&6; }
-if test "${ac_cv_host+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if test "${ac_cv_host+set}" = set; then :
+  $as_echo_n "(cached) " >&6
 else
   if test "x$host_alias" = x; then
   ac_cv_host=$ac_cv_build
 else
   ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
-    { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
-echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
-   { (exit 1); exit 1; }; }
+    as_fn_error "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
 fi
 
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5
-echo "${ECHO_T}$ac_cv_host" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
 case $ac_cv_host in
 *-*-*) ;;
-*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
-echo "$as_me: error: invalid value of canonical host" >&2;}
-   { (exit 1); exit 1; }; };;
+*) as_fn_error "invalid value of canonical host" "$LINENO" 5;;
 esac
 host=$ac_cv_host
 ac_save_IFS=$IFS; IFS='-'
@@ -1865,10 +2203,10 @@
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
 set dummy ${ac_tool_prefix}gcc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -1878,25 +2216,25 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CC="${ac_tool_prefix}gcc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
 fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
@@ -1905,10 +2243,10 @@
   ac_ct_CC=$CC
   # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
@@ -1918,25 +2256,25 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_CC="gcc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_CC=$ac_cv_prog_ac_ct_CC
 if test -n "$ac_ct_CC"; then
-  { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
   if test "x$ac_ct_CC" = x; then
@@ -1944,12 +2282,8 @@
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
     CC=$ac_ct_CC
@@ -1962,10 +2296,10 @@
           if test -n "$ac_tool_prefix"; then
     # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
 set dummy ${ac_tool_prefix}cc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -1975,25 +2309,25 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CC="${ac_tool_prefix}cc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
 fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
@@ -2002,10 +2336,10 @@
 if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -2016,18 +2350,18 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
        ac_prog_rejected=yes
        continue
      fi
     ac_cv_prog_CC="cc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
 if test $ac_prog_rejected = yes; then
@@ -2046,11 +2380,11 @@
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
@@ -2061,10 +2395,10 @@
   do
     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -2074,25 +2408,25 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
 fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
@@ -2105,10 +2439,10 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
@@ -2118,25 +2452,25 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_CC="$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_CC=$ac_cv_prog_ac_ct_CC
 if test -n "$ac_ct_CC"; then
-  { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
@@ -2148,12 +2482,8 @@
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
     CC=$ac_ct_CC
@@ -2163,98 +2493,82 @@
 fi
 
 
-test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&5
-echo "$as_me: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "no acceptable C compiler found in \$PATH
+See \`config.log' for more details." "$LINENO" 5; }
 
 # Provide some information about the compiler.
-echo "$as_me:$LINENO: checking for C compiler version" >&5
-ac_compiler=`set X $ac_compile; echo $2`
-{ (ac_try="$ac_compiler --version >&5"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compiler --version >&5") 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-{ (ac_try="$ac_compiler -v >&5"
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&5"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compiler -v >&5") 2>&5
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-{ (ac_try="$ac_compiler -V >&5"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compiler -V >&5") 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    rm -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+done
 
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-
+#include <stdio.h>
 int
 main ()
 {
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
 
   ;
   return 0;
 }
 _ACEOF
 ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files a.out a.exe b.out"
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out conftest.out"
 # Try to create an executable without -o first, disregard a.out.
 # It will help us diagnose broken compilers, and finding out an intuition
 # of exeext.
-{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
-echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; }
-ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-#
-# List of possible output files, starting from the most likely.
-# The algorithm is not robust to junk in `.', hence go to wildcards (a.*)
-# only as a last resort.  b.out is created by i960 compilers.
-ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out'
-#
-# The IRIX 6 linker writes into existing files which may not be
-# executable, retaining their permissions.  Remove them first so a
-# subsequent execution test works.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
 ac_rmfiles=
 for ac_file in $ac_files
 do
   case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
     * ) ac_rmfiles="$ac_rmfiles $ac_file";;
   esac
 done
 rm -f $ac_rmfiles
 
-if { (ac_try="$ac_link_default"
+if { { ac_try="$ac_link_default"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
   (eval "$ac_link_default") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
   # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
 # So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
 # in a Makefile.  We should not override ac_cv_exeext if it was cached,
@@ -2264,14 +2578,14 @@
 do
   test -f "$ac_file" || continue
   case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj )
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
 	;;
     [ab].out )
 	# We found the default executable, but exeext='' is most
 	# certainly right.
 	break;;
     *.* )
-        if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+	if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
 	then :; else
 	   ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
 	fi
@@ -2290,78 +2604,75 @@
 else
   ac_file=''
 fi
-
-{ echo "$as_me:$LINENO: result: $ac_file" >&5
-echo "${ECHO_T}$ac_file" >&6; }
-if test -z "$ac_file"; then
-  echo "$as_me: failed program was:" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+if test -z "$ac_file"; then :
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
-See \`config.log' for more details." >&5
-echo "$as_me: error: C compiler cannot create executables
-See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ as_fn_set_status 77
+as_fn_error "C compiler cannot create executables
+See \`config.log' for more details." "$LINENO" 5; }; }
 fi
-
 ac_exeext=$ac_cv_exeext
 
 # Check that the compiler produces executables we can run.  If not, either
 # the compiler is broken, or we cross compile.
-{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5
-echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; }
-# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
 # If not cross compiling, check that we can run a simple program.
 if test "$cross_compiling" != yes; then
   if { ac_try='./$ac_file'
-  { (case "(($ac_try" in
+  { { case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
   (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then
     cross_compiling=no
   else
     if test "$cross_compiling" = maybe; then
 	cross_compiling=yes
     else
-	{ { echo "$as_me:$LINENO: error: cannot run C compiled programs.
+	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "cannot run C compiled programs.
 If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+See \`config.log' for more details." "$LINENO" 5; }
     fi
   fi
 fi
-{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
 
-rm -f a.out a.exe conftest$ac_cv_exeext b.out
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out conftest.out
 ac_clean_files=$ac_clean_files_save
 # Check that the compiler produces executables we can run.  If not, either
 # the compiler is broken, or we cross compile.
-{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
-echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; }
-{ echo "$as_me:$LINENO: result: $cross_compiling" >&5
-echo "${ECHO_T}$cross_compiling" >&6; }
-
-{ echo "$as_me:$LINENO: checking for suffix of executables" >&5
-echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; }
-if { (ac_try="$ac_link"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
   # If both `conftest.exe' and `conftest' are `present' (well, observable)
 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
 # work properly (i.e., refer to `conftest.exe'), while it won't with
@@ -2369,37 +2680,31 @@
 for ac_file in conftest.exe conftest conftest.*; do
   test -f "$ac_file" || continue
   case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
 	  break;;
     * ) break;;
   esac
 done
 else
-  { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." "$LINENO" 5; }
 fi
-
 rm -f conftest$ac_cv_exeext
-{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
-echo "${ECHO_T}$ac_cv_exeext" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
 
 rm -f conftest.$ac_ext
 EXEEXT=$ac_cv_exeext
 ac_exeext=$EXEEXT
-{ echo "$as_me:$LINENO: checking for suffix of object files" >&5
-echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; }
-if test "${ac_cv_objext+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if test "${ac_cv_objext+set}" = set; then :
+  $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -2411,51 +2716,46 @@
 }
 _ACEOF
 rm -f conftest.o conftest.obj
-if { (ac_try="$ac_compile"
+if { { ac_try="$ac_compile"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
   (eval "$ac_compile") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
   for ac_file in conftest.o conftest.obj conftest.*; do
   test -f "$ac_file" || continue;
   case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;;
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
        break;;
   esac
 done
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." "$LINENO" 5; }
 fi
-
 rm -f conftest.$ac_cv_objext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
-echo "${ECHO_T}$ac_cv_objext" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
 OBJEXT=$ac_cv_objext
 ac_objext=$OBJEXT
-{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; }
-if test "${ac_cv_c_compiler_gnu+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if test "${ac_cv_c_compiler_gnu+set}" = set; then :
+  $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -2469,54 +2769,34 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_compiler_gnu=yes
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_compiler_gnu=no
+  ac_compiler_gnu=no
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 ac_cv_c_compiler_gnu=$ac_compiler_gnu
 
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; }
-GCC=`test $ac_compiler_gnu = yes && echo yes`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
+fi
 ac_test_CFLAGS=${CFLAGS+set}
 ac_save_CFLAGS=$CFLAGS
-{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
-echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; }
-if test "${ac_cv_prog_cc_g+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if test "${ac_cv_prog_cc_g+set}" = set; then :
+  $as_echo_n "(cached) " >&6
 else
   ac_save_c_werror_flag=$ac_c_werror_flag
    ac_c_werror_flag=yes
    ac_cv_prog_cc_g=no
    CFLAGS="-g"
-   cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -2527,34 +2807,11 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_prog_cc_g=yes
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	CFLAGS=""
-      cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  CFLAGS=""
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -2565,35 +2822,12 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  :
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+if ac_fn_c_try_compile "$LINENO"; then :
 
-	ac_c_werror_flag=$ac_save_c_werror_flag
+else
+  ac_c_werror_flag=$ac_save_c_werror_flag
 	 CFLAGS="-g"
-	 cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -2604,42 +2838,18 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_prog_cc_g=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
    ac_c_werror_flag=$ac_save_c_werror_flag
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
 if test "$ac_test_CFLAGS" = set; then
   CFLAGS=$ac_save_CFLAGS
 elif test $ac_cv_prog_cc_g = yes; then
@@ -2655,18 +2865,14 @@
     CFLAGS=
   fi
 fi
-{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
-echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; }
-if test "${ac_cv_prog_cc_c89+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then :
+  $as_echo_n "(cached) " >&6
 else
   ac_cv_prog_cc_c89=no
 ac_save_CC=$CC
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdarg.h>
 #include <stdio.h>
@@ -2723,31 +2929,9 @@
 	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
 do
   CC="$ac_save_CC $ac_arg"
-  rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+  if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_prog_cc_c89=$ac_arg
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
 fi
-
 rm -f core conftest.err conftest.$ac_objext
   test "x$ac_cv_prog_cc_c89" != "xno" && break
 done
@@ -2758,17 +2942,19 @@
 # AC_CACHE_VAL
 case "x$ac_cv_prog_cc_c89" in
   x)
-    { echo "$as_me:$LINENO: result: none needed" >&5
-echo "${ECHO_T}none needed" >&6; } ;;
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
   xno)
-    { echo "$as_me:$LINENO: result: unsupported" >&5
-echo "${ECHO_T}unsupported" >&6; } ;;
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
   *)
     CC="$CC $ac_cv_prog_cc_c89"
-    { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;;
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
 esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
 
+fi
 
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
@@ -2781,15 +2967,15 @@
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
-echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
 fi
 if test -z "$CPP"; then
-  if test "${ac_cv_prog_CPP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  if test "${ac_cv_prog_CPP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
 else
       # Double quotes because CPP needs to be expanded
     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
@@ -2803,11 +2989,7 @@
   # <limits.h> exists even on freestanding compilers.
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp. "Syntax error" is here to catch this case.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #ifdef __STDC__
 # include <limits.h>
@@ -2816,76 +2998,34 @@
 #endif
 		     Syntax error
 _ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  :
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+if ac_fn_c_try_cpp "$LINENO"; then :
 
+else
   # Broken: fails on valid input.
 continue
 fi
-
 rm -f conftest.err conftest.$ac_ext
 
   # OK, works on sane cases.  Now check whether nonexistent headers
   # can be detected and how.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <ac_nonexistent.h>
 _ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
+if ac_fn_c_try_cpp "$LINENO"; then :
   # Broken: success on invalid input.
 continue
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
   # Passes both tests.
 ac_preproc_ok=:
 break
 fi
-
 rm -f conftest.err conftest.$ac_ext
 
 done
 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
 rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
+if $ac_preproc_ok; then :
   break
 fi
 
@@ -2897,8 +3037,8 @@
 else
   ac_cv_prog_CPP=$CPP
 fi
-{ echo "$as_me:$LINENO: result: $CPP" >&5
-echo "${ECHO_T}$CPP" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
 ac_preproc_ok=false
 for ac_c_preproc_warn_flag in '' yes
 do
@@ -2908,11 +3048,7 @@
   # <limits.h> exists even on freestanding compilers.
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp. "Syntax error" is here to catch this case.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #ifdef __STDC__
 # include <limits.h>
@@ -2921,83 +3057,40 @@
 #endif
 		     Syntax error
 _ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  :
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+if ac_fn_c_try_cpp "$LINENO"; then :
 
+else
   # Broken: fails on valid input.
 continue
 fi
-
 rm -f conftest.err conftest.$ac_ext
 
   # OK, works on sane cases.  Now check whether nonexistent headers
   # can be detected and how.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <ac_nonexistent.h>
 _ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
+if ac_fn_c_try_cpp "$LINENO"; then :
   # Broken: success on invalid input.
 continue
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
   # Passes both tests.
 ac_preproc_ok=:
 break
 fi
-
 rm -f conftest.err conftest.$ac_ext
 
 done
 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
 rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
-  :
+if $ac_preproc_ok; then :
+
 else
-  { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&5
-echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." "$LINENO" 5; }
 fi
 
 ac_ext=c
@@ -3020,22 +3113,23 @@
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # OS/2's system install, which has a completely different semantic
 # ./install, which can be erroneously created by make from ./install.sh.
-{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
-echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; }
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
 if test -z "$INSTALL"; then
-if test "${ac_cv_path_install+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+if test "${ac_cv_path_install+set}" = set; then :
+  $as_echo_n "(cached) " >&6
 else
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  # Account for people who put trailing slashes in PATH elements.
-case $as_dir/ in
-  ./ | .// | /cC/* | \
+    # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in #((
+  ./ | .// | /[cC]/* | \
   /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
-  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+  ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
   /usr/ucb/* ) ;;
   *)
     # OSF1 and SCO ODT 3.0 have their own names for install.
@@ -3053,17 +3147,29 @@
 	    # program-specific install script used by HP pwplus--don't use.
 	    :
 	  else
-	    ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
-	    break 3
+	    rm -rf conftest.one conftest.two conftest.dir
+	    echo one > conftest.one
+	    echo two > conftest.two
+	    mkdir conftest.dir
+	    if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+	      test -s conftest.one && test -s conftest.two &&
+	      test -s conftest.dir/conftest.one &&
+	      test -s conftest.dir/conftest.two
+	    then
+	      ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+	      break 3
+	    fi
 	  fi
 	fi
       done
     done
     ;;
 esac
-done
+
+  done
 IFS=$as_save_IFS
 
+rm -rf conftest.one conftest.two conftest.dir
 
 fi
   if test "${ac_cv_path_install+set}" = set; then
@@ -3076,8 +3182,8 @@
     INSTALL=$ac_install_sh
   fi
 fi
-{ echo "$as_me:$LINENO: result: $INSTALL" >&5
-echo "${ECHO_T}$INSTALL" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
 
 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
 # It thinks the first close brace ends the variable substitution.
@@ -3087,24 +3193,24 @@
 
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
-{ echo "$as_me:$LINENO: checking whether ln -s works" >&5
-echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
+$as_echo_n "checking whether ln -s works... " >&6; }
 LN_S=$as_ln_s
 if test "$LN_S" = "ln -s"; then
-  { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no, using $LN_S" >&5
-echo "${ECHO_T}no, using $LN_S" >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
+$as_echo "no, using $LN_S" >&6; }
 fi
 
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_RANLIB+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_RANLIB+set}" = set; then :
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$RANLIB"; then
   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
@@ -3114,25 +3220,25 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
 fi
 fi
 RANLIB=$ac_cv_prog_RANLIB
 if test -n "$RANLIB"; then
-  { echo "$as_me:$LINENO: result: $RANLIB" >&5
-echo "${ECHO_T}$RANLIB" >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
@@ -3141,10 +3247,10 @@
   ac_ct_RANLIB=$RANLIB
   # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then :
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_RANLIB"; then
   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
@@ -3154,25 +3260,25 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_RANLIB="ranlib"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
 if test -n "$ac_ct_RANLIB"; then
-  { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
-echo "${ECHO_T}$ac_ct_RANLIB" >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
   if test "x$ac_ct_RANLIB" = x; then
@@ -3180,12 +3286,8 @@
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
     RANLIB=$ac_ct_RANLIB
@@ -3197,10 +3299,10 @@
 
 # Extract the first word of "ar", so it can be a program name with args.
 set dummy ar; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_AR+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_AR+set}" = set; then :
+  $as_echo_n "(cached) " >&6
 else
   case $AR in
   [\\/]* | ?:[\\/]*)
@@ -3212,14 +3314,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_AR="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
   ;;
@@ -3227,11 +3329,11 @@
 fi
 AR=$ac_cv_path_AR
 if test -n "$AR"; then
-  { echo "$as_me:$LINENO: result: $AR" >&5
-echo "${ECHO_T}$AR" >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
+$as_echo "$AR" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
@@ -3239,45 +3341,40 @@
 
 
 
-{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
-echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; }
-if test "${ac_cv_path_GREP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  # Extract the first word of "grep ggrep" to use in msg output
-if test -z "$GREP"; then
-set dummy grep ggrep; ac_prog_name=$2
-if test "${ac_cv_path_GREP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if test "${ac_cv_path_GREP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
 else
+  if test -z "$GREP"; then
   ac_path_GREP_found=false
-# Loop through the user's path and test for each of PROGNAME-LIST
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_prog in grep ggrep; do
-  for ac_exec_ext in '' $ac_executable_extensions; do
-    ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
-    { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
-    # Check for GNU ac_path_GREP and select it if it is found.
+    for ac_prog in grep ggrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+# Check for GNU ac_path_GREP and select it if it is found.
   # Check for GNU $ac_path_GREP
 case `"$ac_path_GREP" --version 2>&1` in
 *GNU*)
   ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
 *)
   ac_count=0
-  echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
+  $as_echo_n 0123456789 >"conftest.in"
   while :
   do
     cat "conftest.in" "conftest.in" >"conftest.tmp"
     mv "conftest.tmp" "conftest.in"
     cp "conftest.in" "conftest.nl"
-    echo 'GREP' >> "conftest.nl"
+    $as_echo 'GREP' >> "conftest.nl"
     "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
     diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
-    ac_count=`expr $ac_count + 1`
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
     if test $ac_count -gt ${ac_path_GREP_max-0}; then
       # Best one so far, save it but keep looking for a better one
       ac_cv_path_GREP="$ac_path_GREP"
@@ -3289,77 +3386,61 @@
   rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
 esac
 
-
-    $ac_path_GREP_found && break 3
+      $ac_path_GREP_found && break 3
+    done
+  done
   done
-done
-
-done
 IFS=$as_save_IFS
-
-
-fi
-
-GREP="$ac_cv_path_GREP"
-if test -z "$GREP"; then
-  { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
-echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
-   { (exit 1); exit 1; }; }
-fi
-
+  if test -z "$ac_cv_path_GREP"; then
+    as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
 else
   ac_cv_path_GREP=$GREP
 fi
 
-
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
-echo "${ECHO_T}$ac_cv_path_GREP" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
  GREP="$ac_cv_path_GREP"
 
 
-{ echo "$as_me:$LINENO: checking for egrep" >&5
-echo $ECHO_N "checking for egrep... $ECHO_C" >&6; }
-if test "${ac_cv_path_EGREP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if test "${ac_cv_path_EGREP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
 else
   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
    then ac_cv_path_EGREP="$GREP -E"
    else
-     # Extract the first word of "egrep" to use in msg output
-if test -z "$EGREP"; then
-set dummy egrep; ac_prog_name=$2
-if test "${ac_cv_path_EGREP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
+     if test -z "$EGREP"; then
   ac_path_EGREP_found=false
-# Loop through the user's path and test for each of PROGNAME-LIST
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_prog in egrep; do
-  for ac_exec_ext in '' $ac_executable_extensions; do
-    ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
-    { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
-    # Check for GNU ac_path_EGREP and select it if it is found.
+    for ac_prog in egrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
   # Check for GNU $ac_path_EGREP
 case `"$ac_path_EGREP" --version 2>&1` in
 *GNU*)
   ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
 *)
   ac_count=0
-  echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
+  $as_echo_n 0123456789 >"conftest.in"
   while :
   do
     cat "conftest.in" "conftest.in" >"conftest.tmp"
     mv "conftest.tmp" "conftest.in"
     cp "conftest.in" "conftest.nl"
-    echo 'EGREP' >> "conftest.nl"
+    $as_echo 'EGREP' >> "conftest.nl"
     "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
     diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
-    ac_count=`expr $ac_count + 1`
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
     if test $ac_count -gt ${ac_path_EGREP_max-0}; then
       # Best one so far, save it but keep looking for a better one
       ac_cv_path_EGREP="$ac_path_EGREP"
@@ -3371,46 +3452,31 @@
   rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
 esac
 
-
-    $ac_path_EGREP_found && break 3
-  done
-done
-
-done
+      $ac_path_EGREP_found && break 3
+    done
+  done
+  done
 IFS=$as_save_IFS
-
-
-fi
-
-EGREP="$ac_cv_path_EGREP"
-if test -z "$EGREP"; then
-  { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
-echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
-   { (exit 1); exit 1; }; }
-fi
-
+  if test -z "$ac_cv_path_EGREP"; then
+    as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
 else
   ac_cv_path_EGREP=$EGREP
 fi
 
-
    fi
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
-echo "${ECHO_T}$ac_cv_path_EGREP" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
  EGREP="$ac_cv_path_EGREP"
 
 
-{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5
-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }
-if test "${ac_cv_header_stdc+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if test "${ac_cv_header_stdc+set}" = set; then :
+  $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdlib.h>
 #include <stdarg.h>
@@ -3425,47 +3491,23 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_header_stdc=yes
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_header_stdc=no
+  ac_cv_header_stdc=no
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <string.h>
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "memchr" >/dev/null 2>&1; then
-  :
+  $EGREP "memchr" >/dev/null 2>&1; then :
+
 else
   ac_cv_header_stdc=no
 fi
@@ -3475,18 +3517,14 @@
 
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdlib.h>
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "free" >/dev/null 2>&1; then
-  :
+  $EGREP "free" >/dev/null 2>&1; then :
+
 else
   ac_cv_header_stdc=no
 fi
@@ -3496,14 +3534,10 @@
 
 if test $ac_cv_header_stdc = yes; then
   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-  if test "$cross_compiling" = yes; then
+  if test "$cross_compiling" = yes; then :
   :
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <ctype.h>
 #include <stdlib.h>
@@ -3530,61 +3564,31 @@
   return 0;
 }
 _ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  :
-else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+if ac_fn_c_try_run "$LINENO"; then :
 
-( exit $ac_status )
-ac_cv_header_stdc=no
+else
+  ac_cv_header_stdc=no
 fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
-
 fi
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
-echo "${ECHO_T}$ac_cv_header_stdc" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
 if test $ac_cv_header_stdc = yes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define STDC_HEADERS 1
-_ACEOF
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
 
 fi
 
-{ echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
-echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6; }
-if test "${ac_cv_c_const+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
+$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
+if test "${ac_cv_c_const+set}" = set; then :
+  $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -3613,541 +3617,97 @@
   pcpcc = (char const *const *) ppc;
   { /* SCO 3.2v4 cc rejects this.  */
     char *t;
-    char const *s = 0 ? (char *) 0 : (char const *) 0;
-
-    *t++ = 0;
-    if (s) return 0;
-  }
-  { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
-    int x[] = {25, 17};
-    const int *foo = &x[0];
-    ++foo;
-  }
-  { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
-    typedef const int *iptr;
-    iptr p = 0;
-    ++p;
-  }
-  { /* AIX XL C 1.02.0.0 rejects this saying
-       "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
-    struct s { int j; const int *ap[3]; };
-    struct s *b; b->j = 5;
-  }
-  { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
-    const int foo = 10;
-    if (!foo) return 0;
-  }
-  return !cs[0] && !zero.x;
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_c_const=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_c_const=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
-echo "${ECHO_T}$ac_cv_c_const" >&6; }
-if test $ac_cv_c_const = no; then
-
-cat >>confdefs.h <<\_ACEOF
-#define const
-_ACEOF
-
-fi
-
-
-# On IRIX 5.3, sys/types and inttypes.h are conflicting.
-
-
-
-
-
-
-
-
-
-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
-		  inttypes.h stdint.h unistd.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  eval "$as_ac_Header=yes"
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	eval "$as_ac_Header=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-{ echo "$as_me:$LINENO: checking for unsigned long" >&5
-echo $ECHO_N "checking for unsigned long... $ECHO_C" >&6; }
-if test "${ac_cv_type_unsigned_long+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-typedef unsigned long ac__type_new_;
-int
-main ()
-{
-if ((ac__type_new_ *) 0)
-  return 0;
-if (sizeof (ac__type_new_))
-  return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_type_unsigned_long=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_type_unsigned_long=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long" >&5
-echo "${ECHO_T}$ac_cv_type_unsigned_long" >&6; }
-
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ echo "$as_me:$LINENO: checking size of unsigned long" >&5
-echo $ECHO_N "checking size of unsigned long... $ECHO_C" >&6; }
-if test "${ac_cv_sizeof_unsigned_long+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test "$cross_compiling" = yes; then
-  # Depending upon the size, compute the lo and hi bounds.
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-   typedef unsigned long ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
-test_array [0] = 0
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_lo=0 ac_mid=0
-  while :; do
-    cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-   typedef unsigned long ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
-test_array [0] = 0
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_hi=$ac_mid; break
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_lo=`expr $ac_mid + 1`
-			if test $ac_lo -le $ac_mid; then
-			  ac_lo= ac_hi=
-			  break
-			fi
-			ac_mid=`expr 2 '*' $ac_mid + 1`
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-   typedef unsigned long ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
-test_array [0] = 0
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_hi=-1 ac_mid=-1
-  while :; do
-    cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-   typedef unsigned long ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
-test_array [0] = 0
+    char const *s = 0 ? (char *) 0 : (char const *) 0;
+
+    *t++ = 0;
+    if (s) return 0;
+  }
+  { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
+    int x[] = {25, 17};
+    const int *foo = &x[0];
+    ++foo;
+  }
+  { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+    typedef const int *iptr;
+    iptr p = 0;
+    ++p;
+  }
+  { /* AIX XL C 1.02.0.0 rejects this saying
+       "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+    struct s { int j; const int *ap[3]; };
+    struct s *b; b->j = 5;
+  }
+  { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+    const int foo = 10;
+    if (!foo) return 0;
+  }
+  return !cs[0] && !zero.x;
+#endif
 
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_lo=$ac_mid; break
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_c_const=yes
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_hi=`expr '(' $ac_mid ')' - 1`
-			if test $ac_mid -le $ac_hi; then
-			  ac_lo= ac_hi=
-			  break
-			fi
-			ac_mid=`expr 2 '*' $ac_mid`
+  ac_cv_c_const=no
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_lo= ac_hi=
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5
+$as_echo "$ac_cv_c_const" >&6; }
+if test $ac_cv_c_const = no; then
+
+$as_echo "#define const /**/" >>confdefs.h
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
-  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-   typedef unsigned long ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
-test_array [0] = 0
 
-  ;
-  return 0;
-}
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+		  inttypes.h stdint.h unistd.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+eval as_val=\$$as_ac_Header
+   if test "x$as_val" = x""yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_hi=$ac_mid
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_lo=`expr '(' $ac_mid ')' + 1`
 fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 done
-case $ac_lo in
-?*) ac_cv_sizeof_unsigned_long=$ac_lo;;
-'') if test "$ac_cv_type_unsigned_long" = yes; then
-     { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned long)
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (unsigned long)
-See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
-   else
-     ac_cv_sizeof_unsigned_long=0
-   fi ;;
-esac
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-   typedef unsigned long ac__type_sizeof_;
-static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
-static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
-{
 
-  FILE *f = fopen ("conftest.val", "w");
-  if (! f)
-    return 1;
-  if (((long int) (sizeof (ac__type_sizeof_))) < 0)
-    {
-      long int i = longval ();
-      if (i != ((long int) (sizeof (ac__type_sizeof_))))
-	return 1;
-      fprintf (f, "%ld\n", i);
-    }
-  else
-    {
-      unsigned long int i = ulongval ();
-      if (i != ((long int) (sizeof (ac__type_sizeof_))))
-	return 1;
-      fprintf (f, "%lu\n", i);
-    }
-  return ferror (f) || fclose (f) != 0;
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_sizeof_unsigned_long=`cat conftest.val`
-else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of unsigned long" >&5
+$as_echo_n "checking size of unsigned long... " >&6; }
+if test "${ac_cv_sizeof_unsigned_long+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned long))" "ac_cv_sizeof_unsigned_long"        "$ac_includes_default"; then :
 
-( exit $ac_status )
-if test "$ac_cv_type_unsigned_long" = yes; then
-     { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned long)
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (unsigned long)
-See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+else
+  if test "$ac_cv_type_unsigned_long" = yes; then
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ as_fn_set_status 77
+as_fn_error "cannot compute sizeof (unsigned long)
+See \`config.log' for more details." "$LINENO" 5; }; }
    else
      ac_cv_sizeof_unsigned_long=0
    fi
 fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f conftest.val
+
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_unsigned_long" >&5
-echo "${ECHO_T}$ac_cv_sizeof_unsigned_long" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned_long" >&5
+$as_echo "$ac_cv_sizeof_unsigned_long" >&6; }
 
 
 
@@ -4157,79 +3717,69 @@
 
 
 
-{ echo "$as_me:$LINENO: checking for vendor" >&5
-echo $ECHO_N "checking for vendor... $ECHO_C" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for vendor" >&5
+$as_echo_n "checking for vendor... " >&6; }
 
 # Check whether --with-vendor was given.
-if test "${with_vendor+set}" = set; then
+if test "${with_vendor+set}" = set; then :
   withval=$with_vendor;
      mb_vendor="$withval"
      if test -x "vendor/${mb_vendor}/vendor.guess"; then
        if "vendor/${mb_vendor}/vendor.guess" >&5 2>&5; then
-         { echo "$as_me:$LINENO: result: $mb_vendor" >&5
-echo "${ECHO_T}$mb_vendor" >&6; }
+         { $as_echo "$as_me:${as_lineno-$LINENO}: result: $mb_vendor" >&5
+$as_echo "$mb_vendor" >&6; }
        else
-         { echo "$as_me:$LINENO: result: not found" >&5
-echo "${ECHO_T}not found" >&6; }
-         { { echo "$as_me:$LINENO: error: Vendor $mb_vendor not detected" >&5
-echo "$as_me: error: Vendor $mb_vendor not detected" >&2;}
-   { (exit 1); exit 1; }; }
+         { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+$as_echo "not found" >&6; }
+         as_fn_error "Vendor $mb_vendor not detected" "$LINENO" 5
        fi
      else
-       { echo "$as_me:$LINENO: result: not supported" >&5
-echo "${ECHO_T}not supported" >&6; }
-       { { echo "$as_me:$LINENO: error: Vendor $mb_vendor not supported" >&5
-echo "$as_me: error: Vendor $mb_vendor not supported" >&2;}
-   { (exit 1); exit 1; }; }
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5
+$as_echo "not supported" >&6; }
+       as_fn_error "Vendor $mb_vendor not supported" "$LINENO" 5
      fi
 
 else
 
     mb_vendor=`./vendor.guess 2>&5`
     if test -z "$mb_vendor"; then
-       { echo "$as_me:$LINENO: result: not found" >&5
-echo "${ECHO_T}not found" >&6; }
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+$as_echo "not found" >&6; }
     else
-       { echo "$as_me:$LINENO: result: $mb_vendor" >&5
-echo "${ECHO_T}$mb_vendor" >&6; }
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $mb_vendor" >&5
+$as_echo "$mb_vendor" >&6; }
     fi
 
 fi
 
 
 
-{ echo "$as_me:$LINENO: checking for vendor kernel" >&5
-echo $ECHO_N "checking for vendor kernel... $ECHO_C" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for vendor kernel" >&5
+$as_echo_n "checking for vendor kernel... " >&6; }
 
 # Check whether --with-vendorkernel was given.
-if test "${with_vendorkernel+set}" = set; then
+if test "${with_vendorkernel+set}" = set; then :
   withval=$with_vendorkernel;
      mb_vendorkernel="$withval"
      if test -z "$mb_vendor"; then
-       { echo "$as_me:$LINENO: result: no vendor" >&5
-echo "${ECHO_T}no vendor" >&6; }
-       { { echo "$as_me:$LINENO: error: No vendor specified or discovered" >&5
-echo "$as_me: error: No vendor specified or discovered" >&2;}
-   { (exit 1); exit 1; }; }
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no vendor" >&5
+$as_echo "no vendor" >&6; }
+       as_fn_error "No vendor specified or discovered" "$LINENO" 5
      fi
      if test -x "vendor/${mb_vendor}/kernel.guess"; then
        mb_vkinclude="`vendor/${mb_vendor}/kernel.guess build ${mb_vendorkernel} 2>&5`"
        if test -z "$mb_vkinclude"; then
-         { echo "$as_me:$LINENO: result: not found" >&5
-echo "${ECHO_T}not found" >&6; }
-         { { echo "$as_me:$LINENO: error: Vendor kernel $mb_vendorkernel not detected" >&5
-echo "$as_me: error: Vendor kernel $mb_vendorkernel not detected" >&2;}
-   { (exit 1); exit 1; }; }
+         { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+$as_echo "not found" >&6; }
+         as_fn_error "Vendor kernel $mb_vendorkernel not detected" "$LINENO" 5
        else
-         { echo "$as_me:$LINENO: result: $mb_vkinclude" >&5
-echo "${ECHO_T}$mb_vkinclude" >&6; }
+         { $as_echo "$as_me:${as_lineno-$LINENO}: result: $mb_vkinclude" >&5
+$as_echo "$mb_vkinclude" >&6; }
        fi
      else
-       { echo "$as_me:$LINENO: result: not supported" >&5
-echo "${ECHO_T}not supported" >&6; }
-       { { echo "$as_me:$LINENO: error: Vendor $mb_vendor does not support kernel detection" >&5
-echo "$as_me: error: Vendor $mb_vendor does not support kernel detection" >&2;}
-   { (exit 1); exit 1; }; }
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5
+$as_echo "not supported" >&6; }
+       as_fn_error "Vendor $mb_vendor does not support kernel detection" "$LINENO" 5
      fi
 
 else
@@ -4237,16 +3787,16 @@
      if test -x "vendor/${mb_vendor}/kernel.guess"; then
        mb_vkinclude="`vendor/${mb_vendor}/kernel.guess build 2>&5`"
        if test -z "$mb_vkinclude"; then
-         { echo "$as_me:$LINENO: result: not found" >&5
-echo "${ECHO_T}not found" >&6; }
+         { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+$as_echo "not found" >&6; }
        else
-         { echo "$as_me:$LINENO: result: $mb_vkinclude" >&5
-echo "${ECHO_T}$mb_vkinclude" >&6; }
+         { $as_echo "$as_me:${as_lineno-$LINENO}: result: $mb_vkinclude" >&5
+$as_echo "$mb_vkinclude" >&6; }
        fi
      else
        mb_vkinclude=
-       { echo "$as_me:$LINENO: result: not supported" >&5
-echo "${ECHO_T}not supported" >&6; }
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5
+$as_echo "not supported" >&6; }
      fi
 
 fi
@@ -4258,16 +3808,14 @@
 
 
 if test "x$GCC" != "xyes"; then
-  { { echo "$as_me:$LINENO: error: GCC is required" >&5
-echo "$as_me: error: GCC is required" >&2;}
-   { (exit 1); exit 1; }; }
+  as_fn_error "GCC is required" "$LINENO" 5
 fi
 
-{ echo "$as_me:$LINENO: checking for directory with kernel build tree" >&5
-echo $ECHO_N "checking for directory with kernel build tree... $ECHO_C" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for directory with kernel build tree" >&5
+$as_echo_n "checking for directory with kernel build tree... " >&6; }
 
 # Check whether --with-kernel was given.
-if test "${with_kernel+set}" = set; then
+if test "${with_kernel+set}" = set; then :
   withval=$with_kernel; kerneldir="$withval"
 else
 
@@ -4283,12 +3831,12 @@
 
 
 if test ! -f "${kerneldir}/include/linux/autoconf.h"; then
-  { echo "$as_me:$LINENO: result: not found" >&5
-echo "${ECHO_T}not found" >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+$as_echo "not found" >&6; }
   KERNELDIR=
 else
-  { echo "$as_me:$LINENO: result: $kerneldir" >&5
-echo "${ECHO_T}$kerneldir" >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $kerneldir" >&5
+$as_echo "$kerneldir" >&6; }
   KERNELDIR="$kerneldir"
 
 fi
@@ -4310,14 +3858,10 @@
    check_kver_saved_CPPFLAGS="$CPPFLAGS"
    CPPFLAGS="-I$KBUILDINC $CPPFLAGS -nostdinc"
 
-   { echo "$as_me:$LINENO: checking for kernel$check_kver_DESC version" >&5
-echo $ECHO_N "checking for kernel$check_kver_DESC version... $ECHO_C" >&6; }
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for kernel$check_kver_DESC version" >&5
+$as_echo_n "checking for kernel$check_kver_DESC version... " >&6; }
 
-   cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <linux/${UTS_HEADER}>
@@ -4337,8 +3881,8 @@
      check_kver_RESULT='none'
    fi
 
-   { echo "$as_me:$LINENO: result: $check_kver_RESULT" >&5
-echo "${ECHO_T}$check_kver_RESULT" >&6; }
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_kver_RESULT" >&5
+$as_echo "$check_kver_RESULT" >&6; }
    rm -f conftest*
 
    CPPFLAGS="$check_kver_saved_CPPFLAGS"
@@ -4351,12 +3895,60 @@
    fi
 
 
+   check_karch_DESC=""
+
+   if test -n "$check_karch_DESC"; then
+     check_karch_DESC=" $check_karch_DESC"
+   fi
+
+   UTS_HEADER=compile.h
+
+   check_karch_saved_CPPFLAGS="$CPPFLAGS"
+   CPPFLAGS="-I$KBUILDINC $CPPFLAGS -nostdinc"
+
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for kernel$check_karch_DESC version" >&5
+$as_echo_n "checking for kernel$check_karch_DESC version... " >&6; }
+
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <linux/${UTS_HEADER}>
+
+#ifdef UTS_MACHINE
+check_karch_RESULT=UTS_MACHINE
+#else
+check_karch_RESULT=none
+#endif
+
+_ACEOF
+
+   if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+     $EGREP "^check_karch_RESULT=" > conftest.karch 2>&1; then
+     . ./conftest.karch
+   else
+     check_karch_RESULT='none'
+   fi
+
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_karch_RESULT" >&5
+$as_echo "$check_karch_RESULT" >&6; }
+   rm -f conftest*
+
+   CPPFLAGS="$check_karch_saved_CPPFLAGS"
+
+   if test "x$check_karch_RESULT" != "xnone"; then
+     kbuildarch=$check_karch_RESULT
+     :
+   else
+     :
+   fi
+
+
 kernelsourcedir=
-{ echo "$as_me:$LINENO: checking for directory with kernel sources" >&5
-echo $ECHO_N "checking for directory with kernel sources... $ECHO_C" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for directory with kernel sources" >&5
+$as_echo_n "checking for directory with kernel sources... " >&6; }
 
 # Check whether --with-kernel-source was given.
-if test "${with_kernel_source+set}" = set; then
+if test "${with_kernel_source+set}" = set; then :
   withval=$with_kernel_source; kernelsourcedir="$withval"
 else
 
@@ -4375,11 +3967,11 @@
 
 
 if test -n "$kernelsourcedir"; then
-  { echo "$as_me:$LINENO: result: $kernelsourcedir" >&5
-echo "${ECHO_T}$kernelsourcedir" >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $kernelsourcedir" >&5
+$as_echo "$kernelsourcedir" >&6; }
 else
-  { echo "$as_me:$LINENO: result: not found" >&5
-echo "${ECHO_T}not found" >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+$as_echo "not found" >&6; }
 fi
 
 KERNELSRC="$kernelsourcedir"
@@ -4387,8 +3979,8 @@
 KERNELINC="$KERNELSRC/include"
 
 if test ! -f "$KERNELBUILD/include/linux/autoconf.h"; then
-  { echo "$as_me:$LINENO: WARNING: No configured kernel include tree found" >&5
-echo "$as_me: WARNING: No configured kernel include tree found" >&2;}
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: No configured kernel include tree found" >&5
+$as_echo "$as_me: WARNING: No configured kernel include tree found" >&2;}
 fi
 
 if test "x$kernelsourcedir" = "x"; then
@@ -4410,14 +4002,10 @@
    check_kver_saved_CPPFLAGS="$CPPFLAGS"
    CPPFLAGS="-I"$KERNELBUILD/include" $CPPFLAGS -nostdinc"
 
-   { echo "$as_me:$LINENO: checking for kernel$check_kver_DESC version" >&5
-echo $ECHO_N "checking for kernel$check_kver_DESC version... $ECHO_C" >&6; }
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for kernel$check_kver_DESC version" >&5
+$as_echo_n "checking for kernel$check_kver_DESC version... " >&6; }
 
-   cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <linux/${UTS_HEADER}>
@@ -4437,8 +4025,8 @@
      check_kver_RESULT='none'
    fi
 
-   { echo "$as_me:$LINENO: result: $check_kver_RESULT" >&5
-echo "${ECHO_T}$check_kver_RESULT" >&6; }
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_kver_RESULT" >&5
+$as_echo "$check_kver_RESULT" >&6; }
    rm -f conftest*
 
    CPPFLAGS="$check_kver_saved_CPPFLAGS"
@@ -4447,9 +4035,7 @@
      ksourceversion=$check_kver_RESULT
      :
    else
-     { { echo "$as_me:$LINENO: error: Could not determine kernel$check_kver_DESC version." >&5
-echo "$as_me: error: Could not determine kernel$check_kver_DESC version." >&2;}
-   { (exit 1); exit 1; }; }
+     as_fn_error "Could not determine kernel$check_kver_DESC version." "$LINENO" 5
    fi
 
 fi
@@ -4460,11 +4046,7 @@
   saved_CPPFLAGS="$CPPFLAGS"
   CPPFLAGS="-I$KERNELINC $CPPFLAGS"
 
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <linux/autoconf.h>
 #ifdef CONFIG_SUSE_KERNEL
@@ -4473,7 +4055,7 @@
 }
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "kernel_is_SuSE" >/dev/null 2>&1; then
+  $EGREP "kernel_is_SuSE" >/dev/null 2>&1; then :
   susekernel=yes
 else
   susekernel=no
@@ -4495,9 +4077,9 @@
   fi
 
   if test "$vermatch" = "no"; then
-    { echo "$as_me:$LINENO: WARNING: Kernel tree versions do not match.
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Kernel tree versions do not match.
 Perhaps you need to use the --with-kernel-source option?" >&5
-echo "$as_me: WARNING: Kernel tree versions do not match.
+$as_echo "$as_me: WARNING: Kernel tree versions do not match.
 Perhaps you need to use the --with-kernel-source option?" >&2;}
   fi
 fi
@@ -4515,18 +4097,20 @@
     BUILD_DRIVER=yes
     ;;
   none)
-    { echo "$as_me:$LINENO: result: Could not determine kernel version, disabling driver build" >&5
-echo "${ECHO_T}Could not determine kernel version, disabling driver build" >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: Could not determine kernel version, disabling driver build" >&5
+$as_echo "Could not determine kernel version, disabling driver build" >&6; }
     ;;
   *)
-    { echo "$as_me:$LINENO: result: This module only supports kernel version 2.6.x, disabling driver build" >&5
-echo "${ECHO_T}This module only supports kernel version 2.6.x, disabling driver build" >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: This module only supports kernel version 2.6.x, disabling driver build" >&5
+$as_echo "This module only supports kernel version 2.6.x, disabling driver build" >&6; }
   ;;
 esac
 
 
 KERNELVER=$kversion
 
+KERNELARCH=$kbuildarch
+
 
 KAPI_COMPAT_CFLAGS=
 BACKING_DEV_CAPABILITIES=
@@ -4542,9 +4126,10 @@
   fi
 
   KAPI_COMPAT_HEADERS=
+  TRANS_COMPAT_HEADERS=
 
-  { echo "$as_me:$LINENO: checking for capabilities mask in backing_dev_info" >&5
-echo $ECHO_N "checking for capabilities mask in backing_dev_info... $ECHO_C" >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for capabilities mask in backing_dev_info" >&5
+$as_echo_n "checking for capabilities mask in backing_dev_info... " >&6; }
    kernel_check_regexp="\<BDI_CAP_NO_WRITEBACK\>"
 
    kernel_check_headers=
@@ -4559,17 +4144,17 @@
    if test x"$kernel_check_headers" != "x" && \
      grep "$kernel_check_regexp" $kernel_check_headers >/dev/null 2>&1 ; then
      BACKING_DEV_CAPABILITIES=yes
-     { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
    else
      :
-     { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
    fi
 
 
-  { echo "$as_me:$LINENO: checking for vfsmount in ->get_sb() helpers" >&5
-echo $ECHO_N "checking for vfsmount in ->get_sb() helpers... $ECHO_C" >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for vfsmount in ->get_sb() helpers" >&5
+$as_echo_n "checking for vfsmount in ->get_sb() helpers... " >&6; }
    kernel_check_regexp="^extern int get_sb_pseudo"
 
    kernel_check_headers=
@@ -4584,18 +4169,18 @@
    if test x"$kernel_check_headers" != "x" && \
      grep "$kernel_check_regexp" $kernel_check_headers >/dev/null 2>&1 ; then
      GET_SB_HAS_VFSMOUNT=yes
-     { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
    else
      :
-     { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
    fi
 
 
   mutex_compat_header=
-  { echo "$as_me:$LINENO: checking for for mutex API" >&5
-echo $ECHO_N "checking for for mutex API... $ECHO_C" >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for for mutex API" >&5
+$as_echo_n "checking for for mutex API... " >&6; }
    kernel_check_regexp="i_mutex"
 
    kernel_check_headers=
@@ -4610,19 +4195,20 @@
    if test x"$kernel_check_headers" != "x" && \
      grep "$kernel_check_regexp" $kernel_check_headers >/dev/null 2>&1 ; then
      :
-     { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
    else
      mutex_compat_header="i_mutex.h"
-     { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
    fi
 
   KAPI_COMPAT_HEADERS="$KAPI_COMPAT_HEADERS $mutex_compat_header"
+  TRANS_COMPAT_HEADERS="$TRANS_COMPAT_HEADERS $mutex_compat_header"
 
   private_compat_header=
-  { echo "$as_me:$LINENO: checking for for i_private" >&5
-echo $ECHO_N "checking for for i_private... $ECHO_C" >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for for i_private" >&5
+$as_echo_n "checking for for i_private... " >&6; }
    kernel_check_regexp="i_private"
 
    kernel_check_headers=
@@ -4637,20 +4223,157 @@
    if test x"$kernel_check_headers" != "x" && \
      grep "$kernel_check_regexp" $kernel_check_headers >/dev/null 2>&1 ; then
      :
-     { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
    else
      private_compat_header="i_private.h"
-     { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+   fi
+
+  KAPI_COMPAT_HEADERS="$KAPI_COMPAT_HEADERS $private_compat_header"
+  TRANS_COMPAT_HEADERS="$TRANS_COMPAT_HEADERS $private_compat_header"
+
+  blksize_compat_header=
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for for i_blksize" >&5
+$as_echo_n "checking for for i_blksize... " >&6; }
+   kernel_check_regexp="i_blksize"
+
+   kernel_check_headers=
+   for kinclude in $kernelincludes; do
+     for kfile in linux/fs.h; do
+       if test -e "$kinclude/$kfile"; then
+         kernel_check_headers="$kernel_check_headers $kinclude/$kfile"
+       fi
+     done
+   done
+
+   if test x"$kernel_check_headers" != "x" && \
+     grep "$kernel_check_regexp" $kernel_check_headers >/dev/null 2>&1 ; then
+     blksize_compat_header="i_blksize.h"
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+   else
+     :
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+   fi
+
+  KAPI_COMPAT_HEADERS="$KAPI_COMPAT_HEADERS $blksize_compat_header"
+  TRANS_COMPAT_HEADERS="$TRANS_COMPAT_HEADERS $blksize_compat_header"
+
+  bio_end_io_compat_header=
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for for three argument bio_end_io" >&5
+$as_echo_n "checking for for three argument bio_end_io... " >&6; }
+   kernel_check_regexp="void bio_endio(struct bio \*, unsigned int, int)"
+
+   kernel_check_headers=
+   for kinclude in $kernelincludes; do
+     for kfile in linux/bio.h; do
+       if test -e "$kinclude/$kfile"; then
+         kernel_check_headers="$kernel_check_headers $kinclude/$kfile"
+       fi
+     done
+   done
+
+   if test x"$kernel_check_headers" != "x" && \
+     grep "$kernel_check_regexp" $kernel_check_headers >/dev/null 2>&1 ; then
+     bio_end_io_compat_header="bio_end_io.h"
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+   else
+     :
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+   fi
+
+  KAPI_COMPAT_HEADERS="$KAPI_COMPAT_HEADERS $bio_end_io_compat_header"
+
+  bio_map_user_compat_header=
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for for gfp argument to bio_map_user" >&5
+$as_echo_n "checking for for gfp argument to bio_map_user... " >&6; }
+   kernel_check_regexp="^.*unsigned long, unsigned int, int, gfp_t)"
+
+   kernel_check_headers=
+   for kinclude in $kernelincludes; do
+     for kfile in linux/bio.h; do
+       if test -e "$kinclude/$kfile"; then
+         kernel_check_headers="$kernel_check_headers $kinclude/$kfile"
+       fi
+     done
+   done
+
+   if test x"$kernel_check_headers" != "x" && \
+     grep "$kernel_check_regexp" $kernel_check_headers >/dev/null 2>&1 ; then
+     :
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+   else
+     bio_map_user_compat_header="bio_map_user.h"
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+   fi
+
+  KAPI_COMPAT_HEADERS="$KAPI_COMPAT_HEADERS $bio_map_user_compat_header"
+
+  kmem_cache_s_header=
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct kmem_cache_s" >&5
+$as_echo_n "checking for struct kmem_cache_s... " >&6; }
+   kernel_check_regexp="struct kmem_cache_s"
+
+   kernel_check_headers=
+   for kinclude in $kernelincludes; do
+     for kfile in linux/slab.h; do
+       if test -e "$kinclude/$kfile"; then
+         kernel_check_headers="$kernel_check_headers $kinclude/$kfile"
+       fi
+     done
+   done
+
+   if test x"$kernel_check_headers" != "x" && \
+     grep "$kernel_check_regexp" $kernel_check_headers >/dev/null 2>&1 ; then
+     kmem_cache_s_header="kmem_cache_s.h"
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+   else
+     :
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+   fi
+
+  KAPI_COMPAT_HEADERS="$KAPI_COMPAT_HEADERS $kmem_cache_s_header"
+
+  kmem_cache_create_header=
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for kmem_cache_create() with dtor arg in slab.h" >&5
+$as_echo_n "checking for kmem_cache_create() with dtor arg in slab.h... " >&6; }
+   kernel_check_regexp="^.*void (\*)(void \*, .*kmem_cache.* \*, unsigned long),"
+
+   kernel_check_headers=
+   for kinclude in $kernelincludes; do
+     for kfile in linux/slab.h; do
+       if test -e "$kinclude/$kfile"; then
+         kernel_check_headers="$kernel_check_headers $kinclude/$kfile"
+       fi
+     done
+   done
+
+   if test x"$kernel_check_headers" != "x" && \
+     grep "$kernel_check_regexp" $kernel_check_headers >/dev/null 2>&1 ; then
+     kmem_cache_create_header="kmem_cache_create.h"
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+   else
+     :
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
    fi
 
-  KAPI_COMPAT_HEADERS="$KAPI_COMPAT_HEADERS $private_compat_header"
+  KAPI_COMPAT_HEADERS="$KAPI_COMPAT_HEADERS $kmem_cache_create_header"
 
-  blksize_compat_header=
-  { echo "$as_me:$LINENO: checking for for i_blksize" >&5
-echo $ECHO_N "checking for for i_blksize... $ECHO_C" >&6; }
-   kernel_check_regexp="i_blksize"
+  blkdev_get_compat_header=
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for for three argument blkdev_get" >&5
+$as_echo_n "checking for for three argument blkdev_get... " >&6; }
+   kernel_check_regexp="extern int blkdev_get(struct block_device \*, f\?mode_t, unsigned)"
 
    kernel_check_headers=
    for kinclude in $kernelincludes; do
@@ -4663,25 +4386,25 @@
 
    if test x"$kernel_check_headers" != "x" && \
      grep "$kernel_check_regexp" $kernel_check_headers >/dev/null 2>&1 ; then
-     blksize_compat_header="i_blksize.h"
-     { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+     blkdev_get_compat_header="blkdev_get.h"
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
    else
      :
-     { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
    fi
 
-  KAPI_COMPAT_HEADERS="$KAPI_COMPAT_HEADERS $blksize_compat_header"
+  KAPI_COMPAT_HEADERS="$KAPI_COMPAT_HEADERS $blkdev_get_compat_header"
 
-  bio_end_io_compat_header=
-  { echo "$as_me:$LINENO: checking for for three argument bio_end_io" >&5
-echo $ECHO_N "checking for for three argument bio_end_io... $ECHO_C" >&6; }
-   kernel_check_regexp="void bio_endio(struct bio \*, unsigned int, int)"
+  blkdev_put_compat_header=
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for for one argument blkdev_put" >&5
+$as_echo_n "checking for for one argument blkdev_put... " >&6; }
+   kernel_check_regexp="extern int blkdev_put(struct block_device \*)"
 
    kernel_check_headers=
    for kinclude in $kernelincludes; do
-     for kfile in linux/bio.h; do
+     for kfile in linux/fs.h; do
        if test -e "$kinclude/$kfile"; then
          kernel_check_headers="$kernel_check_headers $kinclude/$kfile"
        fi
@@ -4690,25 +4413,25 @@
 
    if test x"$kernel_check_headers" != "x" && \
      grep "$kernel_check_regexp" $kernel_check_headers >/dev/null 2>&1 ; then
-     bio_end_io_compat_header="bio_end_io.h"
-     { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+     blkdev_put_compat_header="blkdev_put.h"
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
    else
      :
-     { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
    fi
 
-  KAPI_COMPAT_HEADERS="$KAPI_COMPAT_HEADERS $bio_end_io_compat_header"
+  KAPI_COMPAT_HEADERS="$KAPI_COMPAT_HEADERS $blkdev_put_compat_header"
 
-  kmem_cache_create_header=
-  { echo "$as_me:$LINENO: checking for kmem_cache_create() with dtor arg in slab.h" >&5
-echo $ECHO_N "checking for kmem_cache_create() with dtor arg in slab.h... $ECHO_C" >&6; }
-   kernel_check_regexp="^.*void (\*)(void \*, .*kmem_cache.* \*, unsigned long),"
+  blk_limits_compat_header=
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for for old block limits" >&5
+$as_echo_n "checking for for old block limits... " >&6; }
+   kernel_check_regexp="extern void blk_queue_hardsect_size"
 
    kernel_check_headers=
    for kinclude in $kernelincludes; do
-     for kfile in linux/slab.h; do
+     for kfile in linux/blkdev.h; do
        if test -e "$kinclude/$kfile"; then
          kernel_check_headers="$kernel_check_headers $kinclude/$kfile"
        fi
@@ -4717,24 +4440,24 @@
 
    if test x"$kernel_check_headers" != "x" && \
      grep "$kernel_check_regexp" $kernel_check_headers >/dev/null 2>&1 ; then
-     kmem_cache_create_header="kmem_cache_create.h"
-     { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+     blk_limits_compat_header="blk_limits.h"
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
    else
      :
-     { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
    fi
 
-  KAPI_COMPAT_HEADERS="$KAPI_COMPAT_HEADERS $kmem_cache_create_header"
+  KAPI_COMPAT_HEADERS="$KAPI_COMPAT_HEADERS $blk_limits_compat_header"
 
   slab_ctor_header=
-  { echo "$as_me:$LINENO: checking for SLAB_CTOR_VERIFY in slab.h" >&5
-echo $ECHO_N "checking for SLAB_CTOR_VERIFY in slab.h... $ECHO_C" >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SLAB_CTOR_VERIFY in slab.h" >&5
+$as_echo_n "checking for SLAB_CTOR_VERIFY in slab.h... " >&6; }
    kernel_check_regexp="SLAB_CTOR_VERIFY"
 
    kernel_check_headers=
-   for kinclude in $kernel_includes; do
+   for kinclude in $kernelincludes; do
      for kfile in linux/slab.h; do
        if test -e "$kinclude/$kfile"; then
          kernel_check_headers="$kernel_check_headers $kinclude/$kfile"
@@ -4744,13 +4467,13 @@
 
    if test x"$kernel_check_headers" != "x" && \
      grep "$kernel_check_regexp" $kernel_check_headers >/dev/null 2>&1 ; then
-     slab_ctor_headre=slab_ctor_verify.h
-     { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+     slab_ctor_header=slab_ctor_verify.h
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
    else
      :
-     { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
    fi
 
 
@@ -4759,8 +4482,8 @@
     if test "x$kmem_cache_create_header" != "x"; then
       slab_ctor_header=slab_ctor_three_arg.h
     else
-      { echo "$as_me:$LINENO: checking for three argument ctor in slab.h" >&5
-echo $ECHO_N "checking for three argument ctor in slab.h... $ECHO_C" >&6; }
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for three argument ctor in slab.h" >&5
+$as_echo_n "checking for three argument ctor in slab.h... " >&6; }
    kernel_check_regexp="^.*void (\*)(void \*, .*kmem_cache.* \*, unsigned long))"
 
    kernel_check_headers=
@@ -4775,20 +4498,20 @@
    if test x"$kernel_check_headers" != "x" && \
      grep "$kernel_check_regexp" $kernel_check_headers >/dev/null 2>&1 ; then
      slab_ctor_header=slab_ctor_three_arg.h
-     { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
    else
      :
-     { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
    fi
 
     fi
   fi
 
   if test "x$slab_ctor_header" = "x"; then
-    { echo "$as_me:$LINENO: checking for two argument ctor in slab.h" >&5
-echo $ECHO_N "checking for two argument ctor in slab.h... $ECHO_C" >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for two argument ctor in slab.h" >&5
+$as_echo_n "checking for two argument ctor in slab.h... " >&6; }
    kernel_check_regexp="^.*void (\*)(.*kmem_cache.* \*, void \*))"
 
    kernel_check_headers=
@@ -4803,31 +4526,64 @@
    if test x"$kernel_check_headers" != "x" && \
      grep "$kernel_check_regexp" $kernel_check_headers >/dev/null 2>&1 ; then
      slab_ctor_header=slab_ctor_two_arg.h
-     { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
    else
      :
-     { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
    fi
 
   fi
 
   KAPI_COMPAT_HEADERS="$KAPI_COMPAT_HEADERS $slab_ctor_header"
 
+  current_creds_header=
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for current_fs?id() in cred.h" >&5
+$as_echo_n "checking for current_fs?id() in cred.h... " >&6; }
+   kernel_check_regexp="#define current_fsuid("
+
+   kernel_check_headers=
+   for kinclude in $kernelincludes; do
+     for kfile in linux/cred.h; do
+       if test -e "$kinclude/$kfile"; then
+         kernel_check_headers="$kernel_check_headers $kinclude/$kfile"
+       fi
+     done
+   done
+
+   if test x"$kernel_check_headers" != "x" && \
+     grep "$kernel_check_regexp" $kernel_check_headers >/dev/null 2>&1 ; then
+     :
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+   else
+     current_creds_header=current_creds.h
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+   fi
+
+  KAPI_COMPAT_HEADERS="$KAPI_COMPAT_HEADERS $current_creds_header"
+  TRANS_COMPAT_HEADERS="$TRANS_COMPAT_HEADERS $current_creds_header"
+
   # using -include has two advantages:
   #  the source doesn't need to know to include compat headers
   #  the compat header file names don't go through the search path
   for h in $KAPI_COMPAT_HEADERS; do
     KAPI_COMPAT_CFLAGS="$KAPI_COMPAT_CFLAGS -include \$(OUR_TOPDIR)/kapi-compat/include/$h"
   done
+
+  for h in $TRANS_COMPAT_HEADERS; do
+    TRANS_COMPAT_CFLAGS="$TRANS_COMPAT_CFLAGS -include \$(OUR_TOPDIR)/kapi-compat/include/$h"
+  done
 fi
 
 
 
 
 
-ac_config_files="$ac_config_files Config.make include/linux/oracleasm/module_version.h vendor/sles9/oracleasm.spec-generic vendor/rhel4/oracleasm.spec-generic vendor/fc6/oracleasm.spec-generic vendor/sles10/oracleasm.spec-generic vendor/rhel5/oracleasm.spec-generic vendor/common/oracleasm-headers.spec-generic"
+
+ac_config_files="$ac_config_files Config.make include/linux/oracleasm/module_version.h vendor/sles9/oracleasm.spec-generic vendor/rhel4/oracleasm.spec-generic vendor/fc6/oracleasm.spec-generic vendor/sles10/oracleasm.spec-generic vendor/rhel5/oracleasm.spec-generic vendor/sles11/oracleasm.spec-generic vendor/common/oracleasm-headers.spec-generic vendor/common/binrpm.spec-generic"
 
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
@@ -4856,12 +4612,13 @@
     case $ac_val in #(
     *${as_nl}*)
       case $ac_var in #(
-      *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
-echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
       esac
       case $ac_var in #(
       _ | IFS | as_nl) ;; #(
-      *) $as_unset $ac_var ;;
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
       esac ;;
     esac
   done
@@ -4869,8 +4626,8 @@
   (set) 2>&1 |
     case $as_nl`(ac_space=' '; set) 2>&1` in #(
     *${as_nl}ac_space=\ *)
-      # `set' does not quote correctly, so add quotes (double-quote
-      # substitution turns \\\\ into \\, and sed turns \\ into \).
+      # `set' does not quote correctly, so add quotes: double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \.
       sed -n \
 	"s/'/'\\\\''/g;
 	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
@@ -4893,12 +4650,12 @@
 if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
   if test -w "$cache_file"; then
     test "x$cache_file" != "x/dev/null" &&
-      { echo "$as_me:$LINENO: updating cache $cache_file" >&5
-echo "$as_me: updating cache $cache_file" >&6;}
+      { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
     cat confcache >$cache_file
   else
-    { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
-echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
   fi
 fi
 rm -f confcache
@@ -4915,6 +4672,12 @@
 # take arguments), then branch to the quote section.  Otherwise,
 # look for a macro that doesn't take arguments.
 ac_script='
+:mline
+/\\$/{
+ N
+ s,\\\n,,
+ b mline
+}
 t clear
 :clear
 s/^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 (][^	 (]*([^)]*)\)[	 ]*\(.*\)/-D\1=\2/g
@@ -4944,11 +4707,11 @@
 for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
   # 1. Remove the extension, and $U if already installed.
   ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
-  ac_i=`echo "$ac_i" | sed "$ac_script"`
+  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
   # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
   #    will be set to the directory where LIBOBJS objects are built.
-  ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
-  ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
+  as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
 done
 LIBOBJS=$ac_libobjs
 
@@ -4957,11 +4720,13 @@
 
 
 : ${CONFIG_STATUS=./config.status}
+ac_write_fail=0
 ac_clean_files_save=$ac_clean_files
 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
-echo "$as_me: creating $CONFIG_STATUS" >&6;}
-cat >$CONFIG_STATUS <<_ACEOF
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
 #! $SHELL
 # Generated by $as_me.
 # Run this file to recreate the current configuration.
@@ -4971,59 +4736,79 @@
 debug=false
 ac_cs_recheck=false
 ac_cs_silent=false
-SHELL=\${CONFIG_SHELL-$SHELL}
-_ACEOF
 
-cat >>$CONFIG_STATUS <<\_ACEOF
-## --------------------- ##
-## M4sh Initialization.  ##
-## --------------------- ##
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
 
 # Be more Bourne compatible
 DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
   emulate sh
   NULLCMD=:
-  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
   # is contrary to our usage.  Disable this feature.
   alias -g '${1+"$@"}'='"$@"'
   setopt NO_GLOB_SUBST
 else
-  case `(set -o) 2>/dev/null` in
-  *posix*) set -o posix ;;
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
 esac
-
 fi
 
 
-
-
-# PATH needs CR
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conf$$.sh
-  echo  "exit 0"   >>conf$$.sh
-  chmod +x conf$$.sh
-  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-    PATH_SEPARATOR=';'
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
   else
-    PATH_SEPARATOR=:
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+	expr "X$arg" : "X\\(.*\\)$as_nl";
+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
   fi
-  rm -f conf$$.sh
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
 fi
 
-# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
-  as_unset=unset
-else
-  as_unset=false
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
 fi
 
 
@@ -5032,20 +4817,18 @@
 # there to prevent editors from complaining about space-tab.
 # (If _AS_PATH_WALK were called with IFS unset, it would disable word
 # splitting by setting IFS to empty value.)
-as_nl='
-'
 IFS=" ""	$as_nl"
 
 # Find who we are.  Look in the path if we contain no directory separator.
-case $0 in
+case $0 in #((
   *[\\/]* ) as_myself=$0 ;;
   *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
+    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+  done
 IFS=$as_save_IFS
 
      ;;
@@ -5056,32 +4839,111 @@
   as_myself=$0
 fi
 if test ! -f "$as_myself"; then
-  echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
-  { (exit 1); exit 1; }
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
 fi
 
-# Work around bugs in pre-3.0 UWIN ksh.
-for as_var in ENV MAIL MAILPATH
-do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
 done
 PS1='$ '
 PS2='> '
 PS4='+ '
 
 # NLS nuisances.
-for as_var in \
-  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
-  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
-  LC_TELEPHONE LC_TIME
-do
-  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
-    eval $as_var=C; export $as_var
-  else
-    ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error ERROR [LINENO LOG_FD]
+# ---------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with status $?, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$?; test $as_status -eq 0 && as_status=1
+  if test "$3"; then
+    as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3
   fi
-done
+  $as_echo "$as_me: error: $1" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
 
-# Required to use basename.
 if expr a : '\(a\)' >/dev/null 2>&1 &&
    test "X`expr 00001 : '.*\(...\)'`" = X001; then
   as_expr=expr
@@ -5095,13 +4957,17 @@
   as_basename=false
 fi
 
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
 
-# Name of the executable.
 as_me=`$as_basename -- "$0" ||
 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
 	 X"$0" : 'X\(//\)$' \| \
 	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-echo X/"$0" |
+$as_echo X/"$0" |
     sed '/^.*\/\([^/][^/]*\)\/*$/{
 	    s//\1/
 	    q
@@ -5116,104 +4982,103 @@
 	  }
 	  s/.*/./; q'`
 
-# CDPATH.
-$as_unset CDPATH
-
-
-
-  as_lineno_1=$LINENO
-  as_lineno_2=$LINENO
-  test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
-
-  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
-  # uniformly replaced by the line number.  The first 'sed' inserts a
-  # line-number line after each line using $LINENO; the second 'sed'
-  # does the real work.  The second script uses 'N' to pair each
-  # line-number line with the line containing $LINENO, and appends
-  # trailing '-' during substitution so that $LINENO is not a special
-  # case at line end.
-  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
-  # scripts with optimization help from Paolo Bonzini.  Blame Lee
-  # E. McMahon (1931-1989) for sed's syntax.  :-)
-  sed -n '
-    p
-    /[$]LINENO/=
-  ' <$as_myself |
-    sed '
-      s/[$]LINENO.*/&-/
-      t lineno
-      b
-      :lineno
-      N
-      :loop
-      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
-      t loop
-      s/-\n.*//
-    ' >$as_me.lineno &&
-  chmod +x "$as_me.lineno" ||
-    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
-   { (exit 1); exit 1; }; }
-
-  # Don't try to exec as it changes $[0], causing all sort of problems
-  # (the dirname of $[0] is not the place where we might find the
-  # original and so on.  Autoconf is especially sensitive to this).
-  . "./$as_me.lineno"
-  # Exit status is that of the last command.
-  exit
-}
-
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
-  as_dirname=dirname
-else
-  as_dirname=false
-fi
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
 
 ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in
+case `echo -n x` in #(((((
 -n*)
-  case `echo 'x\c'` in
+  case `echo 'xy\c'` in
   *c*) ECHO_T='	';;	# ECHO_T is single tab character.
-  *)   ECHO_C='\c';;
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='	';;
   esac;;
 *)
   ECHO_N='-n';;
 esac
 
-if expr a : '\(a\)' >/dev/null 2>&1 &&
-   test "X`expr 00001 : '.*\(...\)'`" = X001; then
-  as_expr=expr
-else
-  as_expr=false
-fi
-
 rm -f conf$$ conf$$.exe conf$$.file
 if test -d conf$$.dir; then
   rm -f conf$$.dir/conf$$.file
 else
   rm -f conf$$.dir
-  mkdir conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
 fi
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
-  as_ln_s='ln -s'
-  # ... but there are two gotchas:
-  # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
-  # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-  # In both cases, we have to default to `cp -p'.
-  ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
     as_ln_s='cp -p'
-elif ln conf$$.file conf$$ 2>/dev/null; then
-  as_ln_s=ln
+  fi
 else
   as_ln_s='cp -p'
 fi
 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
 rmdir conf$$.dir 2>/dev/null
 
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
 if mkdir -p . 2>/dev/null; then
-  as_mkdir_p=:
+  as_mkdir_p='mkdir -p "$as_dir"'
 else
   test -d ./-p && rmdir ./-p
   as_mkdir_p=false
@@ -5230,12 +5095,12 @@
   as_test_x='
     eval sh -c '\''
       if test -d "$1"; then
-        test -d "$1/.";
+	test -d "$1/.";
       else
-	case $1 in
-        -*)set "./$1";;
+	case $1 in #(
+	-*)set "./$1";;
 	esac;
-	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
 	???[sx]*):;;*)false;;esac;fi
     '\'' sh
   '
@@ -5250,13 +5115,19 @@
 
 
 exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
 
-# Save the log message, to keep $[0] and so on meaningful, and to
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
 This file was extended by $as_me, which was
-generated by GNU Autoconf 2.61.  Invocation command line was
+generated by GNU Autoconf 2.64.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -5269,51 +5140,59 @@
 
 _ACEOF
 
-cat >>$CONFIG_STATUS <<_ACEOF
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 # Files that config.status was made for.
 config_files="$ac_config_files"
 
 _ACEOF
 
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 ac_cs_usage="\
-\`$as_me' instantiates files from templates according to the
-current configuration.
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration.  Unless the files
+and actions are specified as TAGs, all are instantiated by default.
 
-Usage: $0 [OPTIONS] [FILE]...
+Usage: $0 [OPTION]... [TAG]...
 
   -h, --help       print this help, then exit
   -V, --version    print version number and configuration settings, then exit
-  -q, --quiet      do not print progress messages
+  -q, --quiet, --silent
+                   do not print progress messages
   -d, --debug      don't remove temporary files
       --recheck    update $as_me by reconfiguring in the same conditions
-  --file=FILE[:TEMPLATE]
-		   instantiate the configuration file FILE
+      --file=FILE[:TEMPLATE]
+                   instantiate the configuration file FILE
 
 Configuration files:
 $config_files
 
-Report bugs to <bug-autoconf@gnu.org>."
+Report bugs to the package provider."
 
 _ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_version="\\
 config.status
-configured by $0, generated by GNU Autoconf 2.61,
-  with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+configured by $0, generated by GNU Autoconf 2.64,
+  with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
 
-Copyright (C) 2006 Free Software Foundation, Inc.
+Copyright (C) 2009 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it."
 
 ac_pwd='$ac_pwd'
 srcdir='$srcdir'
 INSTALL='$INSTALL'
+test -n "\$AWK" || AWK=awk
 _ACEOF
 
-cat >>$CONFIG_STATUS <<\_ACEOF
-# If no file are specified by the user, then we need to provide default
-# value.  By we need to know if files were specified by the user.
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
 ac_need_defaults=:
 while test $# != 0
 do
@@ -5335,25 +5214,27 @@
   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
     ac_cs_recheck=: ;;
   --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
-    echo "$ac_cs_version"; exit ;;
+    $as_echo "$ac_cs_version"; exit ;;
   --debug | --debu | --deb | --de | --d | -d )
     debug=: ;;
   --file | --fil | --fi | --f )
     $ac_shift
-    CONFIG_FILES="$CONFIG_FILES $ac_optarg"
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    as_fn_append CONFIG_FILES " '$ac_optarg'"
     ac_need_defaults=false;;
   --he | --h |  --help | --hel | -h )
-    echo "$ac_cs_usage"; exit ;;
+    $as_echo "$ac_cs_usage"; exit ;;
   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
   | -silent | --silent | --silen | --sile | --sil | --si | --s)
     ac_cs_silent=: ;;
 
   # This is an error.
-  -*) { echo "$as_me: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&2
-   { (exit 1); exit 1; }; } ;;
+  -*) as_fn_error "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
 
-  *) ac_config_targets="$ac_config_targets $1"
+  *) as_fn_append ac_config_targets " $1"
      ac_need_defaults=false ;;
 
   esac
@@ -5368,30 +5249,32 @@
 fi
 
 _ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 if \$ac_cs_recheck; then
-  echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
-  CONFIG_SHELL=$SHELL
+  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  shift
+  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+  CONFIG_SHELL='$SHELL'
   export CONFIG_SHELL
-  exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  exec "\$@"
 fi
 
 _ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 exec 5>>config.log
 {
   echo
   sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
 ## Running $as_me. ##
 _ASBOX
-  echo "$ac_log"
+  $as_echo "$ac_log"
 } >&5
 
 _ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 _ACEOF
 
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 
 # Handling of arguments.
 for ac_config_target in $ac_config_targets
@@ -5404,11 +5287,11 @@
     "vendor/fc6/oracleasm.spec-generic") CONFIG_FILES="$CONFIG_FILES vendor/fc6/oracleasm.spec-generic" ;;
     "vendor/sles10/oracleasm.spec-generic") CONFIG_FILES="$CONFIG_FILES vendor/sles10/oracleasm.spec-generic" ;;
     "vendor/rhel5/oracleasm.spec-generic") CONFIG_FILES="$CONFIG_FILES vendor/rhel5/oracleasm.spec-generic" ;;
+    "vendor/sles11/oracleasm.spec-generic") CONFIG_FILES="$CONFIG_FILES vendor/sles11/oracleasm.spec-generic" ;;
     "vendor/common/oracleasm-headers.spec-generic") CONFIG_FILES="$CONFIG_FILES vendor/common/oracleasm-headers.spec-generic" ;;
+    "vendor/common/binrpm.spec-generic") CONFIG_FILES="$CONFIG_FILES vendor/common/binrpm.spec-generic" ;;
 
-  *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
-echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
-   { (exit 1); exit 1; }; };;
+  *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
   esac
 done
 
@@ -5433,7 +5316,7 @@
   trap 'exit_status=$?
   { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
 ' 0
-  trap '{ (exit 1); exit 1; }' 1 2 13 15
+  trap 'as_fn_exit 1' 1 2 13 15
 }
 # Create a (secure) tmp directory for tmp files.
 
@@ -5444,144 +5327,139 @@
 {
   tmp=./conf$$-$RANDOM
   (umask 077 && mkdir "$tmp")
-} ||
-{
-   echo "$me: cannot create a temporary directory in ." >&2
-   { (exit 1); exit 1; }
-}
-
-#
-# Set up the sed scripts for CONFIG_FILES section.
-#
+} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5
 
-# No need to generate the scripts if there are no CONFIG_FILES.
-# This happens for instance when ./config.status config.h
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
 if test -n "$CONFIG_FILES"; then
 
-_ACEOF
 
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+  eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+  ac_cs_awk_cr='\r'
+else
+  ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$tmp/subs1.awk" &&
+_ACEOF
 
 
+{
+  echo "cat >conf$$subs.awk <<_ACEOF" &&
+  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+  echo "_ACEOF"
+} >conf$$subs.sh ||
+  as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
 ac_delim='%!_!# '
 for ac_last_try in false false false false false :; do
-  cat >conf$$subs.sed <<_ACEOF
-SHELL!$SHELL$ac_delim
-PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim
-PACKAGE_NAME!$PACKAGE_NAME$ac_delim
-PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim
-PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim
-PACKAGE_STRING!$PACKAGE_STRING$ac_delim
-PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim
-exec_prefix!$exec_prefix$ac_delim
-prefix!$prefix$ac_delim
-program_transform_name!$program_transform_name$ac_delim
-bindir!$bindir$ac_delim
-sbindir!$sbindir$ac_delim
-libexecdir!$libexecdir$ac_delim
-datarootdir!$datarootdir$ac_delim
-datadir!$datadir$ac_delim
-sysconfdir!$sysconfdir$ac_delim
-sharedstatedir!$sharedstatedir$ac_delim
-localstatedir!$localstatedir$ac_delim
-includedir!$includedir$ac_delim
-oldincludedir!$oldincludedir$ac_delim
-docdir!$docdir$ac_delim
-infodir!$infodir$ac_delim
-htmldir!$htmldir$ac_delim
-dvidir!$dvidir$ac_delim
-pdfdir!$pdfdir$ac_delim
-psdir!$psdir$ac_delim
-libdir!$libdir$ac_delim
-localedir!$localedir$ac_delim
-mandir!$mandir$ac_delim
-DEFS!$DEFS$ac_delim
-ECHO_C!$ECHO_C$ac_delim
-ECHO_N!$ECHO_N$ac_delim
-ECHO_T!$ECHO_T$ac_delim
-LIBS!$LIBS$ac_delim
-build_alias!$build_alias$ac_delim
-host_alias!$host_alias$ac_delim
-target_alias!$target_alias$ac_delim
-PACKAGE!$PACKAGE$ac_delim
-MAJOR_VERSION!$MAJOR_VERSION$ac_delim
-MINOR_VERSION!$MINOR_VERSION$ac_delim
-MICRO_VERSION!$MICRO_VERSION$ac_delim
-INTERFACE_AGE!$INTERFACE_AGE$ac_delim
-BINARY_AGE!$BINARY_AGE$ac_delim
-VERSION!$VERSION$ac_delim
-DIST_VERSION!$DIST_VERSION$ac_delim
-build!$build$ac_delim
-build_cpu!$build_cpu$ac_delim
-build_vendor!$build_vendor$ac_delim
-build_os!$build_os$ac_delim
-host!$host$ac_delim
-host_cpu!$host_cpu$ac_delim
-host_vendor!$host_vendor$ac_delim
-host_os!$host_os$ac_delim
-CC!$CC$ac_delim
-CFLAGS!$CFLAGS$ac_delim
-LDFLAGS!$LDFLAGS$ac_delim
-CPPFLAGS!$CPPFLAGS$ac_delim
-ac_ct_CC!$ac_ct_CC$ac_delim
-EXEEXT!$EXEEXT$ac_delim
-OBJEXT!$OBJEXT$ac_delim
-CPP!$CPP$ac_delim
-INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim
-INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim
-INSTALL_DATA!$INSTALL_DATA$ac_delim
-LN_S!$LN_S$ac_delim
-RANLIB!$RANLIB$ac_delim
-AR!$AR$ac_delim
-GREP!$GREP$ac_delim
-EGREP!$EGREP$ac_delim
-vendordir!$vendordir$ac_delim
-KERNELDIR!$KERNELDIR$ac_delim
-BUILD_DRIVER!$BUILD_DRIVER$ac_delim
-KERNELVER!$KERNELVER$ac_delim
-KAPI_COMPAT_CFLAGS!$KAPI_COMPAT_CFLAGS$ac_delim
-BACKING_DEV_CAPABILITIES!$BACKING_DEV_CAPABILITIES$ac_delim
-GET_SB_HAS_VFSMOUNT!$GET_SB_HAS_VFSMOUNT$ac_delim
-LIBOBJS!$LIBOBJS$ac_delim
-LTLIBOBJS!$LTLIBOBJS$ac_delim
-_ACEOF
+  . ./conf$$subs.sh ||
+    as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
 
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 78; then
+  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+  if test $ac_delim_n = $ac_delim_num; then
     break
   elif $ac_last_try; then
-    { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
-echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
-   { (exit 1); exit 1; }; }
+    as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
   else
     ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
   fi
 done
+rm -f conf$$subs.sh
 
-ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
-if test -n "$ac_eof"; then
-  ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
-  ac_eof=`expr $ac_eof + 1`
-fi
-
-cat >>$CONFIG_STATUS <<_ACEOF
-cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
-_ACEOF
-sed '
-s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
-s/^/s,@/; s/!/@,|#_!!_#|/
-:n
-t n
-s/'"$ac_delim"'$/,g/; t
-s/$/\\/; p
-N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
-' >>$CONFIG_STATUS <conf$$subs.sed
-rm -f conf$$subs.sed
-cat >>$CONFIG_STATUS <<_ACEOF
-:end
-s/|#_!!_#|//g
-CEOF$ac_eof
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
 _ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\).*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\).*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+  N
+  s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+  for (key in S) S_is_set[key] = 1
+  FS = ""
+
+}
+{
+  line = $ 0
+  nfields = split(line, field, "@")
+  substed = 0
+  len = length(field[1])
+  for (i = 2; i < nfields; i++) {
+    key = field[i]
+    keylen = length(key)
+    if (S_is_set[key]) {
+      value = S[key]
+      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+      len += length(value) + length(field[++i])
+      substed = 1
+    } else
+      len += 1 + keylen
+  }
+
+  print line
+}
 
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+  cat
+fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
+  || as_fn_error "could not setup config files machinery" "$LINENO" 5
+_ACEOF
 
 # VPATH may cause trouble with some makes, so we remove $(srcdir),
 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
@@ -5598,20 +5476,20 @@
 }'
 fi
 
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 fi # test -n "$CONFIG_FILES"
 
 
-for ac_tag in  :F $CONFIG_FILES
+eval set X "  :F $CONFIG_FILES      "
+shift
+for ac_tag
 do
   case $ac_tag in
   :[FHLC]) ac_mode=$ac_tag; continue;;
   esac
   case $ac_mode$ac_tag in
   :[FHL]*:*);;
-  :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5
-echo "$as_me: error: Invalid tag $ac_tag." >&2;}
-   { (exit 1); exit 1; }; };;
+  :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;;
   :[FH]-) ac_tag=-:-;;
   :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
   esac
@@ -5639,26 +5517,34 @@
 	   [\\/$]*) false;;
 	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
 	   esac ||
-	   { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
-echo "$as_me: error: cannot find input file: $ac_f" >&2;}
-   { (exit 1); exit 1; }; };;
+	   as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;;
       esac
-      ac_file_inputs="$ac_file_inputs $ac_f"
+      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+      as_fn_append ac_file_inputs " '$ac_f'"
     done
 
     # Let's still pretend it is `configure' which instantiates (i.e., don't
     # use $as_me), people would be surprised to read:
     #    /* config.h.  Generated by config.status.  */
-    configure_input="Generated from "`IFS=:
-	  echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure."
+    configure_input='Generated from '`
+	  $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+	`' by configure.'
     if test x"$ac_file" != x-; then
       configure_input="$ac_file.  $configure_input"
-      { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
+      { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
     fi
+    # Neutralize special characters interpreted by sed in replacement strings.
+    case $configure_input in #(
+    *\&* | *\|* | *\\* )
+       ac_sed_conf_input=`$as_echo "$configure_input" |
+       sed 's/[\\\\&|]/\\\\&/g'`;; #(
+    *) ac_sed_conf_input=$configure_input;;
+    esac
 
     case $ac_tag in
-    *:-:* | *:-) cat >"$tmp/stdin";;
+    *:-:* | *:-) cat >"$tmp/stdin" \
+      || as_fn_error "could not create $ac_file" "$LINENO" 5 ;;
     esac
     ;;
   esac
@@ -5668,42 +5554,7 @@
 	 X"$ac_file" : 'X\(//\)[^/]' \| \
 	 X"$ac_file" : 'X\(//\)$' \| \
 	 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$ac_file" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)[^/].*/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\).*/{
-	    s//\1/
-	    q
-	  }
-	  s/.*/./; q'`
-  { as_dir="$ac_dir"
-  case $as_dir in #(
-  -*) as_dir=./$as_dir;;
-  esac
-  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
-    as_dirs=
-    while :; do
-      case $as_dir in #(
-      *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
-      *) as_qdir=$as_dir;;
-      esac
-      as_dirs="'$as_qdir' $as_dirs"
-      as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$as_dir" : 'X\(//\)[^/]' \| \
-	 X"$as_dir" : 'X\(//\)$' \| \
-	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$as_dir" |
+$as_echo X"$ac_file" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
 	    s//\1/
 	    q
@@ -5721,20 +5572,15 @@
 	    q
 	  }
 	  s/.*/./; q'`
-      test -d "$as_dir" && break
-    done
-    test -z "$as_dirs" || eval "mkdir $as_dirs"
-  } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
-echo "$as_me: error: cannot create directory $as_dir" >&2;}
-   { (exit 1); exit 1; }; }; }
+  as_dir="$ac_dir"; as_fn_mkdir_p
   ac_builddir=.
 
 case "$ac_dir" in
 .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
 *)
-  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
   # A ".." for each directory in $ac_dir_suffix.
-  ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
   case $ac_top_builddir_sub in
   "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
   *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
@@ -5774,12 +5620,12 @@
   esac
 _ACEOF
 
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # If the template does not know about datarootdir, expand it.
 # FIXME: This hack should be removed a few years after 2.60.
 ac_datarootdir_hack=; ac_datarootdir_seen=
-
-case `sed -n '/datarootdir/ {
+ac_sed_dataroot='
+/datarootdir/ {
   p
   q
 }
@@ -5787,36 +5633,37 @@
 /@docdir@/p
 /@infodir@/p
 /@localedir@/p
-/@mandir@/p
-' $ac_file_inputs` in
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
 *datarootdir*) ac_datarootdir_seen=yes;;
 *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
-  { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
-echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
 _ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
   ac_datarootdir_hack='
   s&@datadir@&$datadir&g
   s&@docdir@&$docdir&g
   s&@infodir@&$infodir&g
   s&@localedir@&$localedir&g
   s&@mandir@&$mandir&g
-    s&\\\${datarootdir}&$datarootdir&g' ;;
+  s&\\\${datarootdir}&$datarootdir&g' ;;
 esac
 _ACEOF
 
 # Neutralize VPATH when `$srcdir' = `.'.
 # Shell code in configure.ac might set extrasub.
 # FIXME: do we really want to maintain this feature?
-cat >>$CONFIG_STATUS <<_ACEOF
-  sed "$ac_vpsub
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
 $extrasub
 _ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 :t
 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s&@configure_input@&$configure_input&;t t
+s|@configure_input@|$ac_sed_conf_input|;t t
 s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
 s&@srcdir@&$ac_srcdir&;t t
 s&@abs_srcdir@&$ac_abs_srcdir&;t t
 s&@top_srcdir@&$ac_top_srcdir&;t t
@@ -5826,21 +5673,24 @@
 s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
 s&@INSTALL@&$ac_INSTALL&;t t
 $ac_datarootdir_hack
-" $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
+  || as_fn_error "could not create $ac_file" "$LINENO" 5
 
 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
   { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
   { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
-  { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
 which seems to be undefined.  Please make sure it is defined." >&5
-echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
 which seems to be undefined.  Please make sure it is defined." >&2;}
 
   rm -f "$tmp/stdin"
   case $ac_file in
-  -) cat "$tmp/out"; rm -f "$tmp/out";;
-  *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;;
-  esac
+  -) cat "$tmp/out" && rm -f "$tmp/out";;
+  *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+  esac \
+  || as_fn_error "could not create $ac_file" "$LINENO" 5
  ;;
 
 
@@ -5850,11 +5700,13 @@
 done # for ac_tag
 
 
-{ (exit 0); exit 0; }
+as_fn_exit 0
 _ACEOF
-chmod +x $CONFIG_STATUS
 ac_clean_files=$ac_clean_files_save
 
+test $ac_write_fail = 0 ||
+  as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5
+
 
 # configure is writing to config.log, and then calls config.status.
 # config.status does its own redirection, appending to config.log.
@@ -5874,6 +5726,10 @@
   exec 5>>config.log
   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
   # would make configure fail if this is the last instruction.
-  $ac_cs_success || { (exit 1); exit 1; }
+  $ac_cs_success || as_fn_exit $?
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
 fi
 
diff -ruN oracleasm-2.0.5/configure.in oracleasm-2.0.5-fix/configure.in
--- oracleasm-2.0.5/configure.in	2008-09-10 19:32:11.000000000 +0200
+++ oracleasm-2.0.5-fix/configure.in	2009-11-13 04:33:39.000000000 +0100
@@ -77,6 +77,7 @@
 
 KBUILDINC="$KERNELDIR/include"
 OCFS2_CHECK_KVER($KBUILDINC, kbuildversion, , , :)
+OCFS2_CHECK_KARCH($KBUILDINC, kbuildarch, , , :)
 
 kernelsourcedir=
 AC_MSG_CHECKING(for directory with kernel sources)
@@ -168,6 +169,8 @@
 
 KERNELVER=$kversion
 AC_SUBST(KERNELVER)
+KERNELARCH=$kbuildarch
+AC_SUBST(KERNELARCH)
 
 KAPI_COMPAT_CFLAGS=
 BACKING_DEV_CAPABILITIES=
@@ -183,6 +186,7 @@
   fi
 
   KAPI_COMPAT_HEADERS=
+  TRANS_COMPAT_HEADERS=
 
   OCFS2_CHECK_KERNEL_INCLUDES([capabilities mask in backing_dev_info],
     linux/backing-dev.h, $kernelincludes,
@@ -196,16 +200,19 @@
   OCFS2_CHECK_KERNEL_INCLUDES([for mutex API], linux/fs.h,
     $kernelincludes, , mutex_compat_header="i_mutex.h", [i_mutex])
   KAPI_COMPAT_HEADERS="$KAPI_COMPAT_HEADERS $mutex_compat_header"
+  TRANS_COMPAT_HEADERS="$TRANS_COMPAT_HEADERS $mutex_compat_header"
 
   private_compat_header=
   OCFS2_CHECK_KERNEL_INCLUDES([for i_private], linux/fs.h,
     $kernelincludes, , private_compat_header="i_private.h", [i_private])
   KAPI_COMPAT_HEADERS="$KAPI_COMPAT_HEADERS $private_compat_header"
+  TRANS_COMPAT_HEADERS="$TRANS_COMPAT_HEADERS $private_compat_header"
 
   blksize_compat_header=
   OCFS2_CHECK_KERNEL_INCLUDES([for i_blksize], linux/fs.h,
     $kernelincludes, blksize_compat_header="i_blksize.h", , [i_blksize])
   KAPI_COMPAT_HEADERS="$KAPI_COMPAT_HEADERS $blksize_compat_header"
+  TRANS_COMPAT_HEADERS="$TRANS_COMPAT_HEADERS $blksize_compat_header"
 
   bio_end_io_compat_header=
   OCFS2_CHECK_KERNEL_INCLUDES([for three argument bio_end_io], linux/bio.h,
@@ -213,15 +220,45 @@
     [void bio_endio(struct bio \*, unsigned int, int)])
   KAPI_COMPAT_HEADERS="$KAPI_COMPAT_HEADERS $bio_end_io_compat_header"
 
+  bio_map_user_compat_header=
+  OCFS2_CHECK_KERNEL_INCLUDES([for gfp argument to bio_map_user], linux/bio.h,
+    $kernelincludes, , bio_map_user_compat_header="bio_map_user.h",
+    [^.*unsigned long, unsigned int, int, gfp_t)])
+  KAPI_COMPAT_HEADERS="$KAPI_COMPAT_HEADERS $bio_map_user_compat_header"
+
+  kmem_cache_s_header=
+  OCFS2_CHECK_KERNEL_INCLUDES([struct kmem_cache_s], linux/slab.h,
+    $kernelincludes, kmem_cache_s_header="kmem_cache_s.h", ,
+    [struct kmem_cache_s])
+  KAPI_COMPAT_HEADERS="$KAPI_COMPAT_HEADERS $kmem_cache_s_header"
+
   kmem_cache_create_header=
   OCFS2_CHECK_KERNEL_INCLUDES([kmem_cache_create() with dtor arg in slab.h],
     linux/slab.h, $kernelincludes, kmem_cache_create_header="kmem_cache_create.h", ,
     [^.*void (\*)(void \*, .*kmem_cache.* \*, unsigned long),])
   KAPI_COMPAT_HEADERS="$KAPI_COMPAT_HEADERS $kmem_cache_create_header"
 
+  blkdev_get_compat_header=
+  OCFS2_CHECK_KERNEL_INCLUDES([for three argument blkdev_get], linux/fs.h,
+    $kernelincludes, blkdev_get_compat_header="blkdev_get.h", ,
+    [extern int blkdev_get(struct block_device \*, f\?mode_t, unsigned)])
+  KAPI_COMPAT_HEADERS="$KAPI_COMPAT_HEADERS $blkdev_get_compat_header"
+ 
+  blkdev_put_compat_header=
+  OCFS2_CHECK_KERNEL_INCLUDES([for one argument blkdev_put], linux/fs.h,
+    $kernelincludes, blkdev_put_compat_header="blkdev_put.h", ,
+    [extern int blkdev_put(struct block_device \*)])
+  KAPI_COMPAT_HEADERS="$KAPI_COMPAT_HEADERS $blkdev_put_compat_header"
+
+  blk_limits_compat_header=
+  OCFS2_CHECK_KERNEL_INCLUDES([for old block limits], linux/blkdev.h,
+    $kernelincludes, blk_limits_compat_header="blk_limits.h", ,
+    [extern void blk_queue_hardsect_size])
+  KAPI_COMPAT_HEADERS="$KAPI_COMPAT_HEADERS $blk_limits_compat_header"
+
   slab_ctor_header=
   OCFS2_CHECK_KERNEL_INCLUDES([SLAB_CTOR_VERIFY in slab.h], linux/slab.h,
-    $kernel_includes, slab_ctor_headre=slab_ctor_verify.h, ,
+    $kernelincludes, slab_ctor_header=slab_ctor_verify.h, ,
     [SLAB_CTOR_VERIFY])
 
   if test "x$slab_ctor_header" = "x"; then
@@ -244,14 +281,26 @@
 
   KAPI_COMPAT_HEADERS="$KAPI_COMPAT_HEADERS $slab_ctor_header"
 
+  current_creds_header=
+  OCFS2_CHECK_KERNEL_INCLUDES([current_fs?id() in cred.h], linux/cred.h,
+    $kernelincludes, , current_creds_header=current_creds.h,
+    [#define current_fsuid(])
+  KAPI_COMPAT_HEADERS="$KAPI_COMPAT_HEADERS $current_creds_header"
+  TRANS_COMPAT_HEADERS="$TRANS_COMPAT_HEADERS $current_creds_header"
+
   # using -include has two advantages:
   #  the source doesn't need to know to include compat headers
   #  the compat header file names don't go through the search path
   for h in $KAPI_COMPAT_HEADERS; do
     KAPI_COMPAT_CFLAGS="$KAPI_COMPAT_CFLAGS -include \$(OUR_TOPDIR)/kapi-compat/include/$h"
   done
+
+  for h in $TRANS_COMPAT_HEADERS; do
+    TRANS_COMPAT_CFLAGS="$TRANS_COMPAT_CFLAGS -include \$(OUR_TOPDIR)/kapi-compat/include/$h"
+  done
 fi
 AC_SUBST(KAPI_COMPAT_CFLAGS)
+AC_SUBST(TRANS_COMPAT_CFLAGS)
 AC_SUBST(BACKING_DEV_CAPABILITIES)
 AC_SUBST(GET_SB_HAS_VFSMOUNT)
 
@@ -263,5 +312,7 @@
 vendor/fc6/oracleasm.spec-generic
 vendor/sles10/oracleasm.spec-generic
 vendor/rhel5/oracleasm.spec-generic
+vendor/sles11/oracleasm.spec-generic
 vendor/common/oracleasm-headers.spec-generic
+vendor/common/binrpm.spec-generic
 ])
diff -ruN oracleasm-2.0.5/include/linux/oracleasm/compat32.h oracleasm-2.0.5-fix/include/linux/oracleasm/compat32.h
--- oracleasm-2.0.5/include/linux/oracleasm/compat32.h	2008-09-10 19:32:45.000000000 +0200
+++ oracleasm-2.0.5-fix/include/linux/oracleasm/compat32.h	2009-06-18 22:54:12.000000000 +0200
@@ -70,6 +70,8 @@
 #ifndef _ORACLEASM_COMPAT32_H
 #define _ORACLEASM_COMPAT32_H
 
+#include <linux/version.h>
+
 /*
  * This is ugly.  SIZEOF_UNSIGNED_LONG comes from autoconf.
  * Do you have a better way?  I chose not to hand-cook an autoconf
@@ -93,7 +95,7 @@
 #define HIGH_UB4(_ub8)          ((unsigned long)(((_ub8) >> 32) & 0xFFFFFFFFULL))
 #define LOW_UB4(_ub8)           ((unsigned long)((_ub8) & 0xFFFFFFFFULL))
 
-#if defined(CONFIG_COMPAT)
+#if defined(CONFIG_COMPAT) && LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
 # include <linux/ioctl32.h>
 #endif
 
diff -ruN oracleasm-2.0.5/include/linux/oracleasm/disk.h oracleasm-2.0.5-fix/include/linux/oracleasm/disk.h
--- oracleasm-2.0.5/include/linux/oracleasm/disk.h	2008-09-10 19:32:11.000000000 +0200
+++ oracleasm-2.0.5-fix/include/linux/oracleasm/disk.h	2009-06-18 22:54:12.000000000 +0200
@@ -112,7 +112,8 @@
 		if (glob &&
 		    ((c == '*') || (c == '?') ||
 		     (c == '[') || (c == ']') ||
-		     (c == '\\') || (c == '-')))
+		     (c == '\\') || (c == '-') ||
+		     (c == '!')))
 			continue;
 		if (c < '0')
 			return c;
diff -ruN oracleasm-2.0.5/kapi-compat/include/bio_map_user.h oracleasm-2.0.5-fix/kapi-compat/include/bio_map_user.h
--- oracleasm-2.0.5/kapi-compat/include/bio_map_user.h	1970-01-01 01:00:00.000000000 +0100
+++ oracleasm-2.0.5-fix/kapi-compat/include/bio_map_user.h	2009-06-18 22:54:12.000000000 +0200
@@ -0,0 +1,6 @@
+#ifndef KAPI_BIO_MAP_USER_H
+#define KAPI_BIO_MAP_USER_H
+
+#define kapi_asm_bio_map_user(a, b, c, d, e, f)         bio_map_user(a, b, c, d, e)
+
+#endif
diff -ruN oracleasm-2.0.5/kapi-compat/include/blkdev_get.h oracleasm-2.0.5-fix/kapi-compat/include/blkdev_get.h
--- oracleasm-2.0.5/kapi-compat/include/blkdev_get.h	1970-01-01 01:00:00.000000000 +0100
+++ oracleasm-2.0.5-fix/kapi-compat/include/blkdev_get.h	2009-06-18 22:54:12.000000000 +0200
@@ -0,0 +1,6 @@
+#ifndef KAPI_BLKDEV_GET_H
+#define KAPI_BLKDEV_GET_H
+
+#define kapi_asm_blkdev_get(a, b)	blkdev_get(a, b, 0)
+
+#endif
diff -ruN oracleasm-2.0.5/kapi-compat/include/blkdev_put.h oracleasm-2.0.5-fix/kapi-compat/include/blkdev_put.h
--- oracleasm-2.0.5/kapi-compat/include/blkdev_put.h	1970-01-01 01:00:00.000000000 +0100
+++ oracleasm-2.0.5-fix/kapi-compat/include/blkdev_put.h	2009-06-18 22:54:12.000000000 +0200
@@ -0,0 +1,6 @@
+#ifndef KAPI_BLKDEV_PUT_H
+#define KAPI_BLKDEV_PUT_H
+
+#define kapi_asm_blkdev_put(a, b)	blkdev_put(a)
+
+#endif
diff -ruN oracleasm-2.0.5/kapi-compat/include/current_creds.h oracleasm-2.0.5-fix/kapi-compat/include/current_creds.h
--- oracleasm-2.0.5/kapi-compat/include/current_creds.h	1970-01-01 01:00:00.000000000 +0100
+++ oracleasm-2.0.5-fix/kapi-compat/include/current_creds.h	2009-06-18 22:54:12.000000000 +0200
@@ -0,0 +1,7 @@
+#ifndef KAPI_CURRENT_CREDS_H
+#define KAPI_CURRENT_CREDS_H
+
+#define current_fsuid()         (current->fsuid)
+#define current_fsgid()         (current->fsgid)
+
+#endif /* KAPI_CURRENT_CREDS_H */
diff -ruN oracleasm-2.0.5/kapi-compat/include/kmem_cache_s.h oracleasm-2.0.5-fix/kapi-compat/include/kmem_cache_s.h
--- oracleasm-2.0.5/kapi-compat/include/kmem_cache_s.h	1970-01-01 01:00:00.000000000 +0100
+++ oracleasm-2.0.5-fix/kapi-compat/include/kmem_cache_s.h	2009-06-18 22:54:12.000000000 +0200
@@ -0,0 +1,6 @@
+#ifndef KAPI_KMEM_CACHE_S_H
+#define KAPI_KMEM_CACHE_S_H
+
+#define kmem_cache kmem_cache_s
+
+#endif /* KAPI_KMEM_CACHE_S_H */
diff -ruN oracleasm-2.0.5/kernel/Makefile oracleasm-2.0.5-fix/kernel/Makefile
--- oracleasm-2.0.5/kernel/Makefile	2008-09-10 19:32:11.000000000 +0200
+++ oracleasm-2.0.5-fix/kernel/Makefile	2009-06-18 22:54:12.000000000 +0200
@@ -13,8 +13,8 @@
 endif
 
 
-UNINST_HEADERS = transaction_file.h proc.h masklog.h
-SOURCES = oracleasm.c transaction_file.c proc.c masklog.c
+UNINST_HEADERS = transaction_file.h proc.h masklog.h compat.h
+SOURCES = driver.c transaction_file.c proc.c masklog.c
 OBJECTS = $(subst .c,.o,$(SOURCES))
 
 ifeq ($(KERNELRELEASE),)
@@ -59,7 +59,10 @@
 EXTRA_CFLAGS += -DGET_SB_HAS_VFSMOUNT
 endif
 
-obj-m += oracleasm.o
-#oracleasm-objs := $(OBJECTS)
+CFLAGS_driver.o = $(KAPI_COMPAT_CFLAGS)
+CFLAGS_transaction_file.o = $(TRANS_COMPAT_CFLAGS)
+
+obj-m := oracleasm.o
+oracleasm-objs := $(OBJECTS)
 
 endif
diff -ruN oracleasm-2.0.5/kernel/compat.h oracleasm-2.0.5-fix/kernel/compat.h
--- oracleasm-2.0.5/kernel/compat.h	1970-01-01 01:00:00.000000000 +0100
+++ oracleasm-2.0.5-fix/kernel/compat.h	2009-06-18 22:54:13.000000000 +0200
@@ -0,0 +1,21 @@
+/* -*- mode: c; c-basic-offset: 8; -*-
+ * vim: noexpandtab sw=8 ts=8 sts=0:
+ *
+ * compat.h
+ *
+ * Copyright (c) 2004-2009 Oracle Corporation.  All rights reserved.
+ */
+
+
+#ifndef _COMPAT_H
+#define _COMPAT_H
+
+/*
+ * Modern kernels don't need this.  Older kernels will have it defined
+ * by the compat code.
+ */
+#ifndef set_i_blksize
+# define set_i_blksize(i, bs) do { /* Nothing */ } while (0)
+#endif
+
+#endif  /* _COMPAT_H */
diff -ruN oracleasm-2.0.5/kernel/driver.c oracleasm-2.0.5-fix/kernel/driver.c
--- oracleasm-2.0.5/kernel/driver.c	1970-01-01 01:00:00.000000000 +0100
+++ oracleasm-2.0.5-fix/kernel/driver.c	2009-11-10 11:53:07.000000000 +0100
@@ -0,0 +1,2982 @@
+/* -*- mode: c; c-basic-offset: 8; -*-
+ * vim: noexpandtab sw=8 ts=8 sts=0:
+ *
+ * NAME
+ *	oracleasm.c - ASM library kernel driver.
+ *
+ * AUTHOR
+ * 	Joel Becker <joel.becker@oracle.com>
+ *
+ * DESCRIPTION
+ *      This file contains the kernel driver of the Oracle Automatic
+ *      Storage Managment userspace library.  It provides the routines
+ *      required to support the userspace library.
+ *
+ * MODIFIED   (YYYY/MM/DD)
+ *      2004/01/02 - Joel Becker <joel.becker@oracle.com>
+ *		Initial GPL header.
+ *      2004/09/10 - Joel Becker <joel.becker@oracle.com>
+ *      	First port to 2.6.
+ *      2004/12/16 - Joel Becker <joel.becker@oracle.com>
+ *      	Change from ioctl to transaction files.
+ *
+ * Copyright (c) 2002-2004 Oracle Corporation.  All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License, version 2 as published by the Free Software Foundation.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ * 
+ * You should have recieved a copy of the GNU General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 021110-1307, USA.
+ */
+
+/*
+ * This driver's filesystem code is based on the ramfs filesystem.
+ * Copyright information for the original source appears below.
+ */
+
+/* Simple VFS hooks based on: */
+/*
+ * Resizable simple ram filesystem for Linux.
+ *
+ * Copyright (C) 2000 Linus Torvalds.
+ *		 2000 Transmeta Corp.
+ *
+ * Usage limits added by David Gibson, Linuxcare Australia.
+ * This file is released under the GPL.
+ */
+
+
+#include <linux/fs.h>
+#include <linux/file.h>
+#include <linux/module.h>
+#include <linux/pagemap.h>
+#include <linux/init.h>
+#include <linux/string.h>
+#include <linux/highmem.h>
+#include <linux/slab.h>
+#include <linux/blkdev.h>
+#include <linux/mount.h>
+#include <linux/smp_lock.h>
+#include <linux/parser.h>
+#include <linux/backing-dev.h>
+#include <linux/compat.h>
+
+#include <asm/uaccess.h>
+#include <linux/spinlock.h>
+
+#include "linux/oracleasm/compat32.h"
+#include "linux/oracleasm/kernel.h"
+#include "linux/oracleasm/abi.h"
+#include "linux/oracleasm/disk.h"
+#include "linux/oracleasm/manager.h"
+#include "linux/oracleasm/error.h"
+
+#include "linux/oracleasm/module_version.h"
+
+#include "compat.h"
+#include "masklog.h"
+#include "proc.h"
+#include "transaction_file.h"
+
+#if PAGE_CACHE_SIZE % 1024
+#error Oh no, PAGE_CACHE_SIZE is not divisible by 1k! I cannot cope.
+#endif  /* PAGE_CACHE_SIZE % 1024 */
+
+
+
+/*
+ * Compat32
+ */
+#define ASM_BPL_32		32
+#if BITS_PER_LONG == 32
+# define asm_submit_io_32	asm_submit_io_native
+# define asm_maybe_wait_io_32	asm_maybe_wait_io_native
+# define asm_complete_ios_32	asm_complete_ios_native
+#else
+# if BITS_PER_LONG == 64
+#  define ASM_BPL_64		64
+#  define asm_submit_io_32	asm_submit_io_thunk
+#  define asm_submit_io_64	asm_submit_io_native
+#  define asm_maybe_wait_io_32	asm_maybe_wait_io_thunk
+#  define asm_maybe_wait_io_64	asm_maybe_wait_io_native
+#  define asm_complete_ios_32	asm_complete_ios_thunk
+#  define asm_complete_ios_64	asm_complete_ios_native
+# endif  /* BITS_PER_LONG == 64 */
+#endif  /* BITS_PER_LONG == 32 */
+
+
+static struct super_operations asmfs_ops;
+static struct file_operations asmfs_dir_operations;
+static struct file_operations asmfs_file_operations;
+static struct inode_operations asmfs_file_inode_operations;
+static struct inode_operations asmfs_disk_dir_inode_operations;
+static struct inode_operations asmfs_iid_dir_inode_operations;
+
+static struct kmem_cache	*asm_request_cachep;
+static struct kmem_cache	*asmfs_inode_cachep;
+static struct kmem_cache	*asmdisk_cachep;
+#ifndef kapi_kmem_cache_create
+# define kapi_kmem_cache_create kmem_cache_create
+#endif
+
+/*
+ * asmfs super-block data in memory
+ */
+struct asmfs_sb_info {
+	struct super_block *asmfs_super;
+	/* Prevent races accessing the used block
+	 * counts. Conceptually, this could probably be a semaphore,
+	 * but the only thing we do while holding the lock is
+	 * arithmetic, so there's no point */
+	spinlock_t asmfs_lock;
+
+	/* It is important that at least the free counts below be
+	   signed.  free_XXX may become negative if a limit is changed
+	   downwards (by a remount) below the current usage. */	  
+
+	/* max number of inodes - controls # of instances */
+	long max_inodes;
+	/* free_inodes = max_inodes - total number of inodes currently in use */
+	long free_inodes;
+
+	unsigned long next_iid;
+};
+
+#define ASMFS_SB(sb) ((struct asmfs_sb_info *)((sb)->s_fs_info))
+
+
+struct asmfs_file_info {
+	struct file *f_file;
+	spinlock_t f_lock;		/* Lock on the structure */
+	wait_queue_head_t f_wait;	/* Folks waiting on I/O */
+	struct list_head f_ctx;		/* Hook into the i_threads list */
+	struct list_head f_ios;		/* Outstanding I/Os for this thread */
+	struct list_head f_complete;	/* Completed I/Os for this thread */
+	struct list_head f_disks;	/* List of disks opened */
+	struct bio *f_bio_free;		/* bios to free */
+};
+
+#define ASMFS_FILE(_f) ((struct asmfs_file_info *)((_f)->private_data))
+
+
+/*
+ * asmfs inode data in memory
+ *
+ * Note that 'thread' here can mean 'process' too :-)
+ */
+struct asmfs_inode_info {
+	spinlock_t i_lock;		/* lock on the asmfs_inode_info structure */
+	struct list_head i_disks;	/* List of disk handles */
+	struct list_head i_threads;	/* list of context structures for each calling thread */
+	struct inode vfs_inode;
+};
+
+static inline struct asmfs_inode_info *ASMFS_I(struct inode *inode)
+{
+	return container_of(inode, struct asmfs_inode_info, vfs_inode);
+}
+
+static inline struct inode *ASMFS_F2I(struct file *file)
+{
+	return file->f_dentry->d_inode;
+}
+
+/*
+ * asm disk info
+ */
+struct asm_disk_info {
+	struct asmfs_inode_info *d_inode;
+	struct block_device *d_bdev;	/* Block device we I/O to */
+	int d_max_sectors;		/* Maximum sectors per I/O */
+	int d_live;			/* Is the disk alive? */
+	atomic_t d_ios;			/* Count of in-flight I/Os */
+	struct list_head d_open;	/* List of assocated asm_disk_heads */
+	struct inode vfs_inode;
+};
+
+/* Argument to iget5_locked()/ilookup5() to map bdev to disk_inode */
+struct asmdisk_find_inode_args {
+	unsigned long fa_handle;
+	struct asmfs_inode_info *fa_inode;
+};
+
+static inline struct asm_disk_info *ASMDISK_I(struct inode *inode)
+{
+	return container_of(inode, struct asm_disk_info, vfs_inode);
+}
+
+
+/*
+ * asm disk info lists
+ *
+ * Each file_info struct has a list of disks it has opened.  As this
+ * is an M->N mapping, an intermediary structure is needed
+ */
+struct asm_disk_head {
+	struct asm_disk_info *h_disk;	/* Pointer to associated disk */
+	struct asmfs_file_info *h_file;	/* Pointer to owning file */
+	struct list_head h_flist;	/* Hook into file's list */
+	struct list_head h_dlist;	/* Hook into disk's list */
+};
+
+
+/* ASM I/O requests */
+struct asm_request {
+	struct list_head r_list;
+	struct asmfs_file_info *r_file;
+	struct asm_disk_info *r_disk;
+	asm_ioc *r_ioc;				/* User asm_ioc */
+	u16 r_status;				/* status_asm_ioc */
+	int r_error;
+	unsigned long r_elapsed;		/* Start time while in-flight, elapsted time once complete */
+	struct bio *r_bio;			/* The I/O */
+	size_t r_count;				/* Total bytes */
+	atomic_t r_bio_count;			/* Atomic count */
+};
+
+
+/*
+ * Transaction file contexts.
+ */
+static ssize_t asmfs_svc_query_version(struct file *file, char *buf, size_t size);
+static ssize_t asmfs_svc_get_iid(struct file *file, char *buf, size_t size);
+static ssize_t asmfs_svc_check_iid(struct file *file, char *buf, size_t size);
+static ssize_t asmfs_svc_query_disk(struct file *file, char *buf, size_t size);
+static ssize_t asmfs_svc_open_disk(struct file *file, char *buf, size_t size);
+static ssize_t asmfs_svc_close_disk(struct file *file, char *buf, size_t size);
+static ssize_t asmfs_svc_io32(struct file *file, char *buf, size_t size);
+#if BITS_PER_LONG == 64
+static ssize_t asmfs_svc_io64(struct file *file, char *buf, size_t size);
+#endif
+
+static struct transaction_context trans_contexts[] = {
+	[ASMOP_QUERY_VERSION]		= {asmfs_svc_query_version},
+	[ASMOP_GET_IID]			= {asmfs_svc_get_iid},
+	[ASMOP_CHECK_IID]		= {asmfs_svc_check_iid},
+	[ASMOP_QUERY_DISK]		= {asmfs_svc_query_disk},
+	[ASMOP_OPEN_DISK]		= {asmfs_svc_open_disk},
+	[ASMOP_CLOSE_DISK]		= {asmfs_svc_close_disk},
+	[ASMOP_IO32]			= {asmfs_svc_io32},
+#if BITS_PER_LONG == 64
+	[ASMOP_IO64]			= {asmfs_svc_io64},
+#endif
+};
+
+static struct backing_dev_info memory_backing_dev_info = {
+	.ra_pages	= 0,	/* No readahead */
+#ifdef BACKING_DEV_CAPABILITIES
+	.capabilities   = BDI_CAP_NO_ACCT_DIRTY | BDI_CAP_NO_WRITEBACK,
+#else
+	.memory_backed	= 1,	/* Does not contribute to dirty memory */
+#endif  /* OLD_BACKING_DEV */
+};
+
+
+static struct inode *asmdisk_alloc_inode(struct super_block *sb)
+{
+	struct asm_disk_info *d = kmem_cache_alloc(asmdisk_cachep, GFP_KERNEL);
+	if (!d)
+		return NULL;
+
+	mlog(ML_DISK, "Allocated disk 0x%p\n", d);
+	return &d->vfs_inode;
+}
+
+static void asmdisk_destroy_inode(struct inode *inode)
+{
+	struct asm_disk_info *d = ASMDISK_I(inode);
+
+	mlog_bug_on_msg(atomic_read(&d->d_ios),
+			"Disk 0x%p has outstanding I/Os\n", d);
+
+	mlog_bug_on_msg(!list_empty(&d->d_open),
+			"Disk 0x%p has openers\n", d);
+
+	mlog(ML_DISK, "Destroying disk 0x%p\n", d);
+
+	kmem_cache_free(asmdisk_cachep, d);
+}
+
+static void init_asmdisk_once(void *foo)
+{
+	struct asm_disk_info *d = foo;
+
+	memset(d, 0, sizeof(*d));
+	INIT_LIST_HEAD(&d->d_open);
+
+	inode_init_once(&d->vfs_inode);
+}
+#ifndef kapi_init_asmdisk_once
+# define kapi_init_asmdisk_once init_asmdisk_once
+#endif
+#ifndef kapi_asm_blkdev_get
+# define kapi_asm_blkdev_get blkdev_get
+#endif
+#ifndef kapi_asm_blkdev_put
+# define kapi_asm_blkdev_put blkdev_put
+#endif
+
+static void asmdisk_clear_inode(struct inode *inode)
+{
+	struct asm_disk_info *d = ASMDISK_I(inode);
+
+	mlog_entry("(0x%p)\n", inode);
+
+	mlog_bug_on_msg(atomic_read(&d->d_ios),
+			"Disk 0x%p has outstanding I/Os\n", d);
+
+	mlog_bug_on_msg(!list_empty(&d->d_open),
+			"Disk 0x%p has openers\n", d);
+
+	mlog_bug_on_msg(d->d_live,
+			"Disk 0x%p is live\n", d);
+
+	mlog(ML_DISK, "Clearing disk 0x%p\n", d);
+
+	if (d->d_bdev) {
+		mlog(ML_DISK,
+		     "Releasing disk 0x%p (bdev 0x%p, dev %X)\n",
+		     d, d->d_bdev, d->d_bdev->bd_dev);
+		bd_release(d->d_bdev);
+		kapi_asm_blkdev_put(d->d_bdev, FMODE_WRITE | FMODE_READ);
+		d->d_bdev = NULL;
+	}
+
+	mlog_exit_void();
+}
+
+
+static struct super_operations asmdisk_sops = {
+	.statfs			= simple_statfs,
+	.alloc_inode		= asmdisk_alloc_inode,
+	.destroy_inode		= asmdisk_destroy_inode,
+	.drop_inode		= generic_delete_inode,
+	.clear_inode		= asmdisk_clear_inode,
+};
+
+#ifdef GET_SB_HAS_VFSMOUNT
+static int asmdisk_get_sb(struct file_system_type *fs_type, int flags,
+			  const char *dev_name, void *data,
+			  struct vfsmount *mnt)
+{
+	return get_sb_pseudo(fs_type, "asmdisk:",
+			     &asmdisk_sops, 0x61736D64, mnt);
+}
+#else
+static struct super_block *asmdisk_get_sb(struct file_system_type *fs_type,
+					  int flags,
+					  const char *dev_name,
+					  void *data)
+{
+	return get_sb_pseudo(fs_type, "asmdisk:",
+			     &asmdisk_sops, 0x61736D64);
+}
+#endif
+
+static struct file_system_type asmdisk_type = {
+	.name		= "asmdisk",
+	.get_sb		= asmdisk_get_sb,
+	.kill_sb	= kill_anon_super,
+};
+
+static struct vfsmount *asmdisk_mnt;
+
+static int __init init_asmdiskcache(void)
+{
+	int err;
+	asmdisk_cachep =
+		kapi_kmem_cache_create("asmdisk_cache",
+				       sizeof(struct asm_disk_info),
+				       0, SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT,
+				       kapi_init_asmdisk_once);
+	if (!asmdisk_cachep)
+		return -ENOMEM;
+	err = register_filesystem(&asmdisk_type);
+	if (err) {
+		kmem_cache_destroy(asmdisk_cachep);
+		return err;
+	}
+	asmdisk_mnt = kern_mount(&asmdisk_type);
+	if (IS_ERR(asmdisk_mnt)) {
+		err = PTR_ERR(asmdisk_mnt);
+		unregister_filesystem(&asmdisk_type);
+		kmem_cache_destroy(asmdisk_cachep);
+		return err;
+	}
+
+	return 0;
+}
+
+static void destroy_asmdiskcache(void)
+{
+	unregister_filesystem(&asmdisk_type);
+	mntput(asmdisk_mnt);
+	kmem_cache_destroy(asmdisk_cachep);
+}
+
+static int asmdisk_test(struct inode *inode, void *data)
+{
+	struct asmdisk_find_inode_args *args = data;
+	struct asm_disk_info *d = ASMDISK_I(inode);
+	unsigned long handle = (unsigned long)(d->d_bdev);
+
+	return (d->d_inode == args->fa_inode) && (handle == args->fa_handle);
+}
+
+static int asmdisk_set(struct inode *inode, void *data)
+{
+	struct asmdisk_find_inode_args *args = data;
+	struct asm_disk_info *d = ASMDISK_I(inode);
+
+	d->d_bdev = (struct block_device *)(args->fa_handle);
+	d->d_inode = args->fa_inode;
+
+	return 0;
+}
+
+
+
+/*
+ * Resource limit helper functions
+ */
+
+
+/* Decrements the free inode count and returns true, or returns false
+ * if there are no free inodes */
+static struct inode *asmfs_alloc_inode(struct super_block *sb)
+{
+	struct asmfs_sb_info *asb = ASMFS_SB(sb);
+	struct asmfs_inode_info *aii;
+
+	aii = (struct asmfs_inode_info *)kmem_cache_alloc(asmfs_inode_cachep, GFP_KERNEL);
+
+	if (!aii)
+		return NULL;
+
+	spin_lock_irq(&asb->asmfs_lock);
+	if (!asb->max_inodes || asb->free_inodes > 0) {
+		asb->free_inodes--;
+		spin_unlock_irq(&asb->asmfs_lock);
+	} else {
+		spin_unlock_irq(&asb->asmfs_lock);
+		kmem_cache_free(asmfs_inode_cachep, aii);
+		return NULL;
+	}
+
+	return &aii->vfs_inode;
+}
+
+/* Increments the free inode count */
+static void asmfs_destroy_inode(struct inode *inode)
+{
+	spin_lock_irq(&ASMFS_SB(inode->i_sb)->asmfs_lock);
+	ASMFS_SB(inode->i_sb)->free_inodes++;
+	spin_unlock_irq(&ASMFS_SB(inode->i_sb)->asmfs_lock);
+
+	kmem_cache_free(asmfs_inode_cachep, ASMFS_I(inode));
+}
+
+static void instance_init_once(void *foo)
+{
+	struct asmfs_inode_info *aii = foo;
+
+	INIT_LIST_HEAD(&aii->i_disks);
+	INIT_LIST_HEAD(&aii->i_threads);
+	spin_lock_init(&aii->i_lock);
+
+	inode_init_once(&aii->vfs_inode);
+}
+#ifndef kapi_instance_init_once
+# define kapi_instance_init_once instance_init_once
+#endif
+
+static int init_inodecache(void)
+{
+	asmfs_inode_cachep =
+		kapi_kmem_cache_create("asmfs_inode_cache",
+				       sizeof(struct asmfs_inode_info),
+				       0, SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT,
+				       kapi_instance_init_once);
+
+	if (asmfs_inode_cachep == NULL)
+		return -ENOMEM;
+	return 0;
+}
+
+static void destroy_inodecache(void)
+{
+	kmem_cache_destroy(asmfs_inode_cachep);
+}
+
+static int init_requestcache(void)
+{
+	asm_request_cachep =
+		kapi_kmem_cache_create("asm_request",
+				       sizeof(struct asm_request),
+				       0, SLAB_HWCACHE_ALIGN, NULL);
+	if (asm_request_cachep == NULL)
+		return -ENOMEM;
+	return 0;
+}
+
+static void destroy_requestcache(void)
+{
+	kmem_cache_destroy(asm_request_cachep);
+}
+
+
+/*
+ * Disk file creation in the disks directory.
+ */
+static int asmfs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t dev)
+{
+	struct inode * inode;
+
+	if (!S_ISBLK(mode))
+		return -EINVAL;
+
+	inode = new_inode(dir->i_sb);
+	if (!inode)
+		return -ENOMEM;
+
+	inode->i_ino = (unsigned long)inode;
+	inode->i_mode = mode;
+	inode->i_uid = current_fsuid();
+	inode->i_gid = current_fsgid();
+	set_i_blksize(inode, PAGE_CACHE_SIZE);
+	inode->i_blocks = 0;
+	inode->i_rdev = 0;
+	inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
+	init_special_inode(inode, mode, dev);
+
+	d_instantiate(dentry, inode);
+
+	/* Extra count - pin the dentry in core */
+	dget(dentry);
+
+	return 0;
+}
+
+/*
+ * Instance file creation in the iid directory.
+ */
+static int asmfs_create(struct inode *dir, struct dentry *dentry, int mode, struct nameidata *nd)
+{
+	struct inode *inode;
+
+	if ((mode & S_IFMT) && !S_ISREG(mode))
+		return -EINVAL;
+
+	mode |= S_IFREG;
+
+	inode = new_inode(dir->i_sb);
+	if (!inode)
+		return -ENOMEM;
+
+	inode->i_ino = (unsigned long)inode;
+	inode->i_mode = mode;
+	inode->i_uid = current_fsuid();
+	inode->i_gid = current_fsgid();
+	set_i_blksize(inode, PAGE_CACHE_SIZE);
+	inode->i_blocks = 0;
+	inode->i_rdev = 0;
+	inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
+	inode->i_op = &asmfs_file_inode_operations;
+	inode->i_fop = &asmfs_file_operations;
+	inode->i_mapping->backing_dev_info = &memory_backing_dev_info;
+
+	d_instantiate(dentry, inode);
+
+	/* Extra count - pin the dentry in core */
+	dget(dentry);
+
+	return 0;
+}
+
+static void asmfs_put_super(struct super_block *sb)
+{
+	kfree(ASMFS_SB(sb));
+}
+
+enum {
+	OPT_MAX_INSTANCES,
+	OPT_ERR,
+};
+
+static match_table_t tokens = {
+	{OPT_MAX_INSTANCES, "maxinstances=%d"},
+	{OPT_ERR, NULL},
+};
+
+struct asmfs_params {
+	long inodes;
+};
+
+static int parse_options(char * options, struct asmfs_params *p)
+{
+	char *s;
+	substring_t args[MAX_OPT_ARGS];
+	int option;
+
+	p->inodes = -1;
+
+	while ((s = strsep(&options,",")) != NULL) {
+		int token;
+		if (!*s)
+			continue;
+		token = match_token(s, tokens, args);
+		switch (token) {
+			case OPT_MAX_INSTANCES:
+				if (match_int(&args[0], &option))
+					return -EINVAL;
+				p->inodes = option;
+				break;
+
+			default:
+				return -EINVAL;
+		}
+	}
+
+	return 0;
+}
+
+static void init_limits(struct asmfs_sb_info *asb, struct asmfs_params *p)
+{
+	struct sysinfo si;
+
+	si_meminfo(&si);
+
+	asb->max_inodes = 0;
+	if (p->inodes >= 0)
+		asb->max_inodes = p->inodes;
+
+	asb->free_inodes = asb->max_inodes;
+
+	return;
+}
+
+/* reset_limits is called during a remount to change the usage limits.
+
+   This will suceed, even if the new limits are lower than current
+   usage. This is the intended behaviour - new allocations will fail
+   until usage falls below the new limit */
+static void reset_limits(struct asmfs_sb_info *asb, struct asmfs_params *p)
+{
+	spin_lock_irq(&asb->asmfs_lock);
+
+	if (p->inodes >= 0) {
+		int used_inodes = asb->max_inodes - asb->free_inodes;
+
+		asb->max_inodes = p->inodes;
+		asb->free_inodes = asb->max_inodes - used_inodes;
+	}
+
+	spin_unlock_irq(&asb->asmfs_lock);
+}
+
+static int asmfs_remount(struct super_block * sb, int * flags, char * data)
+{
+	struct asmfs_params params;
+	struct asmfs_sb_info * asb = ASMFS_SB(sb);
+
+	if (parse_options((char *)data, &params) != 0)
+		return -EINVAL;
+
+	reset_limits(asb, &params);
+
+	printk(KERN_DEBUG
+ 	       "ASM: oracleasmfs remounted with options: %s\n", 
+	       data ? (char *)data : "<defaults>" );
+	printk(KERN_DEBUG "ASM:	maxinstances=%ld\n",
+	       asb->max_inodes);
+
+	return 0;
+}
+
+/*
+ * Compute the maximum number of sectors the bdev can handle in one bio,
+ * as a power of two.
+ */
+static int compute_max_sectors(struct block_device *bdev)
+{
+	int max_pages, max_sectors, pow_two_sectors;
+	char b[BDEVNAME_SIZE];
+
+	struct request_queue *q;
+
+	q = bdev_get_queue(bdev);
+	mlog(ML_DISK, "Computing limits for block device \%s\":\n",
+	     bdevname(bdev, b));
+	mlog(ML_DISK,
+	     "\tq->max_sectors = %u, q->max_phys_segments = %u, "
+	     "q->max_hw_segments = %u\n",
+	     queue_max_sectors(q), queue_max_phys_segments(q),
+	     queue_max_hw_segments(q));
+	max_pages = queue_max_sectors(q) >> (PAGE_SHIFT - 9);
+	mlog(ML_DISK, "\tmax_pages = %d, BIO_MAX_PAGES = %d\n",
+	     max_pages, BIO_MAX_PAGES);
+	if (max_pages > BIO_MAX_PAGES)
+		max_pages = BIO_MAX_PAGES;
+	if (max_pages > queue_max_phys_segments(q))
+		max_pages = queue_max_phys_segments(q);
+	if (max_pages > queue_max_hw_segments(q))
+		max_pages = queue_max_hw_segments(q);
+	max_pages--; /* Handle I/Os that straddle a page */
+	max_sectors = max_pages << (PAGE_SHIFT - 9);
+
+	/* Why is fls() 1-based???? */
+	pow_two_sectors = 1 << (fls(max_sectors) - 1);
+	mlog(ML_DISK,
+	     "\tresulting max_pages = %d, max_sectors = %d, "
+	     "pow_two_sectors = %d\n",
+	     max_pages, max_sectors, pow_two_sectors);
+
+	return pow_two_sectors;
+}
+
+static int asm_open_disk(struct file *file, struct block_device *bdev)
+{
+	int ret;
+	struct asm_disk_info *d;
+	struct asm_disk_head *h;
+	struct inode *inode = ASMFS_F2I(file);
+	struct inode *disk_inode;
+	struct asmdisk_find_inode_args args;
+
+	mlog_entry("(0x%p, 0x%p)\n", file, bdev);
+
+	ret = kapi_asm_blkdev_get(bdev, FMODE_WRITE | FMODE_READ);
+	if (ret)
+		goto out;
+
+	ret = bd_claim(bdev, inode->i_sb);
+	if (ret)
+		goto out_get;
+
+	ret = set_blocksize(bdev, bdev_physical_block_size(bdev));
+	if (ret)
+		goto out_claim;
+
+	ret = -ENOMEM;
+	h = kmalloc(sizeof(struct asm_disk_head), GFP_KERNEL);
+	if (!h)
+		goto out_claim;
+
+	mlog(ML_DISK, "Looking up disk for bdev %p (dev %X)\n", bdev,
+	     bdev->bd_dev);
+
+	args.fa_handle = (unsigned long)bdev;
+	args.fa_inode = ASMFS_I(inode);
+	disk_inode = iget5_locked(asmdisk_mnt->mnt_sb,
+				  (unsigned long)bdev, asmdisk_test,
+				  asmdisk_set, &args);
+	if (!disk_inode)
+		goto out_head;
+
+	d = ASMDISK_I(disk_inode);
+
+	if (disk_inode->i_state & I_NEW) {
+		mlog_bug_on_msg(atomic_read(&d->d_ios) != 0,
+				"Supposedly new disk 0x%p (dev %X) has outstanding I/O\n",
+				d, bdev->bd_dev);
+		mlog_bug_on_msg(d->d_live,
+				"Supposedly new disk 0x%p (dev %X) is live\n",
+				d, bdev->bd_dev);
+
+		mlog_bug_on_msg(d->d_bdev != bdev,
+				"New disk 0x%p has set bdev 0x%p but we were opening 0x%p\n",
+				d, d->d_bdev, bdev);
+
+		disk_inode->i_mapping->backing_dev_info =
+			&memory_backing_dev_info;
+		d->d_max_sectors = compute_max_sectors(bdev);
+		d->d_live = 1;
+
+		mlog(ML_DISK,
+		     "First open of disk 0x%p (bdev 0x%p, dev %X)\n",
+		     d, d->d_bdev, d->d_bdev->bd_dev);
+		unlock_new_inode(disk_inode);
+	} else {
+		/* Already claimed on first open */
+		mlog(ML_DISK,
+		     "Open of disk 0x%p (bdev 0x%p, dev %X)\n",
+		     d, d->d_bdev, d->d_bdev->bd_dev);
+		bd_release(bdev);
+		kapi_asm_blkdev_put(bdev, FMODE_WRITE | FMODE_READ);
+	}
+
+	h->h_disk = d;
+	h->h_file = ASMFS_FILE(file);
+
+	spin_lock_irq(&ASMFS_FILE(file)->f_lock);
+	list_add(&h->h_flist, &ASMFS_FILE(file)->f_disks);
+	spin_unlock_irq(&ASMFS_FILE(file)->f_lock);
+
+	spin_lock_irq(&ASMFS_I(inode)->i_lock);
+	list_add(&h->h_dlist, &d->d_open);
+	spin_unlock_irq(&ASMFS_I(inode)->i_lock);
+
+	mlog_exit(0);
+	return 0;
+
+out_head:
+	kfree(h);
+
+out_claim:
+	bd_release(bdev);
+
+out_get:
+	kapi_asm_blkdev_put(bdev, FMODE_WRITE | FMODE_READ);
+
+out:
+	mlog_exit(ret);
+	return ret;
+}
+
+static int asm_close_disk(struct file *file, unsigned long handle)
+{
+	struct inode *inode = ASMFS_F2I(file);
+	struct asmdisk_find_inode_args args;
+	struct asm_disk_info *d;
+	struct block_device *bdev;
+	struct inode *disk_inode;
+	struct list_head *p;
+	struct asm_disk_head *h;
+	struct task_struct *tsk = current;
+	DECLARE_WAITQUEUE(wait, tsk);
+
+	mlog_entry("(0x%p, %lu)\n", file, handle);
+
+	mlog_bug_on_msg(!ASMFS_FILE(file) || !ASMFS_I(inode),
+			"Garbage arguments\n");
+
+	args.fa_handle = handle;
+	args.fa_inode = ASMFS_I(inode);
+	disk_inode = ilookup5(asmdisk_mnt->mnt_sb, handle,
+			      asmdisk_test, &args);
+	if (!disk_inode) {
+		mlog_exit(-EINVAL);
+		return -EINVAL;
+	}
+
+	d = ASMDISK_I(disk_inode);
+	bdev = d->d_bdev;
+
+	mlog(ML_DISK, "Closing disk 0x%p (bdev 0x%p, dev %X)\n",
+	     d, d->d_bdev, d->d_bdev->bd_dev);
+
+	/*
+	 * If an additional thread raced us to close the disk, it
+	 * will have removed the disk from the list already.
+	 */
+	
+	spin_lock_irq(&ASMFS_FILE(file)->f_lock);
+	h = NULL;
+	list_for_each(p, &ASMFS_FILE(file)->f_disks) {
+		h = list_entry(p, struct asm_disk_head, h_flist);
+		if (h->h_disk == d)
+			break;
+		h = NULL;
+	}
+	if (!h) {
+		spin_unlock_irq(&ASMFS_FILE(file)->f_lock);
+		iput(disk_inode);
+		mlog_exit(-EINVAL);
+		return -EINVAL;
+	}
+	list_del(&h->h_flist);
+	spin_unlock_irq(&ASMFS_FILE(file)->f_lock);
+
+	spin_lock_irq(&ASMFS_I(inode)->i_lock);
+	list_del(&h->h_dlist);
+
+	/* Last close */
+	if (list_empty(&d->d_open)) {
+		mlog(ML_DISK,
+		     "Last close of disk 0x%p (bdev 0x%p, dev %X)\n",
+		     d, d->d_bdev, d->d_bdev->bd_dev);
+
+		/* I/O path can't look up this disk anymore */
+		mlog_bug_on_msg(!d->d_live,
+				"Disk 0x%p (bdev 0x%p, dev %X) isn't live at last close\n",
+				d, d->d_bdev, d->d_bdev->bd_dev);
+		d->d_live = 0;
+		spin_unlock_irq(&ASMFS_I(inode)->i_lock);
+
+		/* No need for a fast path */
+		add_wait_queue(&ASMFS_FILE(file)->f_wait, &wait);
+		do {
+			set_task_state(tsk, TASK_UNINTERRUPTIBLE);
+
+			if (!atomic_read(&d->d_ios))
+				break;
+
+			blk_run_address_space(bdev->bd_inode->i_mapping);
+			/*
+			 * Timeout of one second.  This is slightly
+			 * subtle.  In this wait, and *only* this wait,
+			 * we are waiting on I/Os that might have been
+			 * initiated by another process.  In that case,
+			 * the other process's afi will be signaled,
+			 * not ours, so the wake_up() never happens
+			 * here and we need the timeout.
+			 */
+#if 0  /* Damn you, kernel */
+			io_schedule_timeout(HZ);
+#else
+			schedule_timeout(HZ);
+#endif
+		} while (1);
+		set_task_state(tsk, TASK_RUNNING);
+		remove_wait_queue(&ASMFS_FILE(file)->f_wait, &wait);
+	}
+	else
+		spin_unlock_irq(&ASMFS_I(inode)->i_lock);
+
+	kfree(h);
+
+	/* Drop the ref from ilookup5() */
+	iput(disk_inode);
+
+	/* Real put */
+	iput(disk_inode);
+
+	mlog_exit(0);
+	return 0;
+}  /* asm_close_disk() */
+
+
+/* Timeout stuff ripped from aio.c - thanks Ben */
+struct timeout {
+	struct timer_list	timer;
+	int			timed_out;
+	wait_queue_head_t	wait;
+};
+
+static void timeout_func(unsigned long data)
+{
+	struct timeout *to = (struct timeout *)data;
+
+	to->timed_out = 1;
+	wake_up(&to->wait);
+}
+
+static inline void init_timeout(struct timeout *to)
+{
+	init_timer(&to->timer);
+	to->timer.data = (unsigned long)to;
+	to->timer.function = timeout_func;
+	to->timed_out = 0;
+	init_waitqueue_head(&to->wait);
+}
+
+static inline void set_timeout(struct timeout *to, const struct timespec *ts)
+{
+	unsigned long how_long;
+
+	if (!ts->tv_sec && !ts->tv_nsec) {
+		to->timed_out = 1;
+		return;
+	}
+
+	how_long = ts->tv_sec * HZ;
+#define HZ_NS (1000000000 / HZ)
+	how_long += (ts->tv_nsec + HZ_NS - 1) / HZ_NS;
+	
+	to->timer.expires = jiffies + how_long;
+	add_timer(&to->timer);
+}
+
+static inline void clear_timeout(struct timeout *to)
+{
+	del_timer_sync(&to->timer);
+}
+
+/* Must be called with asm_file_info->f_lock held */
+static struct block_device *find_io_bdev(struct file *file)
+{
+	struct asmfs_file_info *afi = ASMFS_FILE(file);
+	struct asm_request *r;
+	struct asm_disk_info *d;
+	struct block_device *bdev = NULL;
+
+	list_for_each_entry(r, &afi->f_ios, r_list) {
+		d = r->r_disk;
+		if (d && d->d_bdev) {
+			bdev = d->d_bdev;
+			break;
+		}
+	}
+
+	return bdev;
+}
+
+static int asm_update_user_ioc(struct file *file, struct asm_request *r)
+{
+	int ret = 0;
+	struct asm_request copy;
+	asm_ioc __user *ioc;
+	u16 tmp_status;
+	unsigned long flags;
+
+	mlog_entry("(0x%p)\n", r);
+
+	ioc = r->r_ioc;
+	mlog(ML_IOC, "User IOC is 0x%p\n", ioc);
+
+	/* Need to get the current userspace bits because ASM_CANCELLED is currently set there */
+	mlog(ML_IOC, "Getting tmp_status\n");
+	if (get_user(tmp_status, &(ioc->status_asm_ioc))) {
+		ret = -EFAULT;
+		goto out;
+	}
+
+	/*
+	 * We're going to store off a copy of the request so we can
+	 * provide a consistent view to userspace.
+	 *
+	 * And so we can get/put_user() without locking :-)
+	 */
+	spin_lock_irqsave(&ASMFS_FILE(file)->f_lock, flags);
+	r->r_status |= tmp_status;
+	copy = *r;
+	spin_unlock_irqrestore(&ASMFS_FILE(file)->f_lock, flags);
+
+	/* From here on, ONLY TRUST copy */
+
+	mlog(ML_IOC, "Putting r_status (0x%08X)\n", copy.r_status);
+	if (put_user(copy.r_status, &(ioc->status_asm_ioc))) {
+		ret = -EFAULT;
+		goto out;
+	}
+	if (copy.r_status & ASM_ERROR) {
+		mlog(ML_IOC, "Putting r_error (0x%08X)\n", copy.r_error);
+		if (put_user(copy.r_error, &(ioc->error_asm_ioc))) {
+			ret = -EFAULT;
+			goto out;
+		}
+	}
+	if (copy.r_status & ASM_COMPLETED) {
+		if (put_user(copy.r_elapsed, &(ioc->elaptime_asm_ioc))) {
+			ret = -EFAULT;
+			goto out;
+		}
+	}
+	mlog(ML_IOC,
+	     "r_status:0x%08X, bitmask:0x%08X, combined:0x%08X\n",
+	     copy.r_status,
+	     (ASM_SUBMITTED | ASM_COMPLETED | ASM_ERROR),
+	     (copy.r_status & (ASM_SUBMITTED | ASM_COMPLETED | ASM_ERROR)));
+	if (copy.r_status & ASM_FREE) {
+		u64 z = 0ULL;
+		if (copy_to_user(&(ioc->reserved_asm_ioc),
+				 &z, sizeof(ioc->reserved_asm_ioc))) {
+			ret = -EFAULT;
+			goto out;
+		}
+	} else if (copy.r_status &
+		   (ASM_SUBMITTED | ASM_ERROR)) {
+		u64 key = (u64)(unsigned long)r;
+		mlog(ML_IOC, "Putting key 0x%p on asm_ioc 0x%p\n",
+		     r, ioc);
+		/* Only on first submit */
+		if (copy_to_user(&(ioc->reserved_asm_ioc),
+				 &key, sizeof(ioc->reserved_asm_ioc))) {
+			ret = -EFAULT;
+			goto out;
+		}
+	}
+
+out:
+	mlog_exit(ret);
+	return ret;
+}  /* asm_update_user_ioc() */
+
+
+static struct asm_request *asm_request_alloc(void)
+{
+	struct asm_request *r;
+
+	r = kmem_cache_alloc(asm_request_cachep, GFP_KERNEL);
+	
+	if (r) {
+		r->r_status = ASM_SUBMITTED;
+		r->r_error = 0;
+		r->r_bio = NULL;
+		r->r_elapsed = 0;
+		r->r_disk = NULL;
+	}
+
+	return r;
+}  /* asm_request_alloc() */
+
+
+static void asm_request_free(struct asm_request *r)
+{
+	/* FIXME: Clean up bh and buffer stuff */
+
+	kmem_cache_free(asm_request_cachep, r);
+}  /* asm_request_free() */
+
+
+static void asm_finish_io(struct asm_request *r)
+{
+	struct asm_disk_info *d;
+	struct asmfs_file_info *afi = r->r_file;
+	unsigned long flags;
+
+	mlog_bug_on_msg(!afi, "Request 0x%p has no file pointer\n", r);
+
+	mlog_entry("(0x%p)\n", r);
+
+	spin_lock_irqsave(&afi->f_lock, flags);
+
+	if (r->r_bio) {
+		mlog(ML_REQUEST|ML_BIO,
+		     "Moving bio 0x%p from request 0x%p to the free list\n",
+		     r->r_bio, r);
+		r->r_bio->bi_private = afi->f_bio_free;
+		afi->f_bio_free = r->r_bio;
+		r->r_bio = NULL;
+	}
+
+ 	d = r->r_disk;
+	r->r_disk = NULL;
+
+	list_del(&r->r_list);
+	list_add(&r->r_list, &afi->f_complete);
+	if (r->r_error)
+		r->r_status |= ASM_ERROR;
+	r->r_status |= ASM_COMPLETED;
+
+	spin_unlock_irqrestore(&afi->f_lock, flags);
+
+	if (d) {
+		atomic_dec(&d->d_ios);
+		if (atomic_read(&d->d_ios) < 0) {
+			mlog(ML_ERROR,
+			     "d_ios underflow on disk 0x%p (dev %X)\n",
+			     d, d->d_bdev->bd_dev);
+			atomic_set(&d->d_ios, 0);
+		}
+	}
+
+	r->r_elapsed = ((jiffies - r->r_elapsed) * 1000000) / HZ;
+
+	mlog(ML_REQUEST, "Finished request 0x%p\n", r);
+
+	wake_up(&afi->f_wait);
+
+	mlog_exit_void();
+}  /* asm_finish_io() */
+
+
+static void asm_end_ioc(struct asm_request *r, unsigned int bytes_done,
+			int error)
+{
+	mlog_entry("(0x%p, %u, %d)\n", r, bytes_done, error);
+
+	mlog_bug_on_msg(!r, "No request\n");
+
+	mlog_bug_on_msg(!(r->r_status & ASM_SUBMITTED),
+			"Request 0x%p wasn't submitted\n", r);
+
+	mlog(ML_REQUEST,
+	     "Ending request 0x%p, bytes_done = %u, error = %d\n",
+	     r, bytes_done, error);
+	mlog(ML_REQUEST|ML_BIO,
+	     "Ending request 0x%p, bio 0x%p, len = %u\n",
+	     r, r->r_bio,
+	     bytes_done + (r->r_bio ? r->r_bio->bi_size : 0));
+
+	switch (error) {
+		default:
+			mlog(ML_REQUEST|ML_ERROR,
+			     "Invalid error of %d on request 0x%p!\n",
+			     error, r);
+			r->r_error = ASM_ERR_INVAL;
+			r->r_status |= ASM_LOCAL_ERROR;
+			break;
+
+		case 0:
+			break;
+
+		case -EFAULT:
+			r->r_error = ASM_ERR_FAULT;
+			r->r_status |= ASM_LOCAL_ERROR;
+			break;
+
+		case -EIO:
+			r->r_error = ASM_ERR_IO;
+			break;
+
+		case -ENODEV:
+			r->r_error = ASM_ERR_NODEV;
+			r->r_status |= ASM_LOCAL_ERROR;
+			break;
+
+		case -ENOMEM:
+			r->r_error = ASM_ERR_NOMEM;
+			r->r_status |= ASM_LOCAL_ERROR;
+			break;
+
+		case -EINVAL:
+			r->r_error = ASM_ERR_INVAL;
+			r->r_status |= ASM_LOCAL_ERROR;
+			break;
+	}
+
+	asm_finish_io(r);
+
+	mlog_exit_void();
+}  /* asm_end_ioc() */
+
+
+static void asm_end_bio_io(struct bio *bio, int error)
+{
+	struct asm_request *r;
+
+	mlog_entry("(0x%p, %d)\n", bio, error);
+
+	mlog(ML_BIO, "bio 0x%p, bi_size is %u\n", bio, bio->bi_size);
+
+	r = bio->bi_private;
+
+	mlog(ML_REQUEST|ML_BIO,
+	     "Completed bio 0x%p for request 0x%p\n", bio, r);
+	if (atomic_dec_and_test(&r->r_bio_count)) {
+		asm_end_ioc(r, r->r_count - (r->r_bio ?
+					     r->r_bio->bi_size : 0),
+			    error);
+	}
+
+	mlog_exit_void();
+}  /* asm_end_bio_io() */
+#ifndef kapi_asm_end_bio_io
+# define kapi_asm_end_bio_io asm_end_bio_io
+#endif
+
+#ifndef kapi_asm_bio_map_user
+# define kapi_asm_bio_map_user bio_map_user
+#endif
+
+static int asm_submit_io(struct file *file,
+			 asm_ioc __user *user_iocp,
+			 asm_ioc *ioc)
+{
+	int ret, rw = READ;
+	struct inode *inode = ASMFS_F2I(file);
+	struct asmdisk_find_inode_args args;
+	struct asm_request *r;
+	struct asm_disk_info *d;
+	struct inode *disk_inode;
+	struct block_device *bdev;
+
+	mlog_entry("(0x%p, 0x%p, 0x%p)\n", file, user_iocp, ioc);
+
+	if (!ioc) {
+		mlog_exit(-EINVAL);
+		return -EINVAL;
+	}
+
+	if (ioc->status_asm_ioc) {
+		mlog_exit(-EINVAL);
+		return -EINVAL;
+	}
+
+	r = asm_request_alloc();
+	if (!r) {
+		u16 status = ASM_FREE | ASM_ERROR | ASM_LOCAL_ERROR |
+			ASM_BUSY;
+		if (put_user(status, &(user_iocp->status_asm_ioc))) {
+			mlog_exit(-EFAULT);
+			return -EFAULT;
+		}
+		if (put_user(ASM_ERR_NOMEM, &(user_iocp->error_asm_ioc))) {
+			mlog_exit(-EFAULT);
+			return -EFAULT;
+		}
+
+		mlog_exit(0);
+		return 0;
+	}
+
+	mlog(ML_REQUEST,
+	     "New request at 0x%p alloc()ed for user ioc at 0x%p\n",
+	     r, user_iocp);
+
+	r->r_file = ASMFS_FILE(file);
+	r->r_ioc = user_iocp;  /* Userspace asm_ioc */
+
+	spin_lock_irq(&ASMFS_FILE(file)->f_lock);
+	list_add(&r->r_list, &ASMFS_FILE(file)->f_ios);
+	spin_unlock_irq(&ASMFS_FILE(file)->f_lock);
+
+	ret = -ENODEV;
+	args.fa_handle = (unsigned long)ioc->disk_asm_ioc;
+	args.fa_inode = ASMFS_I(inode);
+	disk_inode = ilookup5(asmdisk_mnt->mnt_sb,
+			      (unsigned long)ioc->disk_asm_ioc,
+			      asmdisk_test, &args);
+	if (!disk_inode)
+		goto out_error;
+
+	spin_lock_irq(&ASMFS_I(inode)->i_lock);
+
+	d = ASMDISK_I(disk_inode);
+	if (!d->d_live) {
+		/* It's in the middle of closing */
+		spin_unlock_irq(&ASMFS_I(inode)->i_lock);
+		iput(disk_inode);
+		goto out_error;
+	}
+
+	atomic_inc(&d->d_ios);
+	r->r_disk = d;
+
+	spin_unlock_irq(&ASMFS_I(inode)->i_lock);
+	iput(disk_inode);
+
+	bdev = d->d_bdev;
+
+	r->r_count = ioc->rcount_asm_ioc * bdev_physical_block_size(bdev);
+
+	/* linux only supports unsigned long size sector numbers */
+	mlog(ML_IOC,
+	     "user_iocp 0x%p: first = 0x%llX, masked = 0x%08lX status = %u, buffer_asm_ioc = 0x%08lX, count = %lu\n",
+	     user_iocp,
+	     (unsigned long long)ioc->first_asm_ioc,
+	     (unsigned long)ioc->first_asm_ioc,
+	     ioc->status_asm_ioc,
+	     (unsigned long)ioc->buffer_asm_ioc,
+	     (unsigned long)r->r_count);
+	/* Note that priority is ignored for now */
+	ret = -EINVAL;
+	if (!ioc->buffer_asm_ioc ||
+	    (ioc->buffer_asm_ioc != (unsigned long)ioc->buffer_asm_ioc) ||
+	    (ioc->first_asm_ioc != (unsigned long)ioc->first_asm_ioc) ||
+	    (ioc->rcount_asm_ioc != (unsigned long)ioc->rcount_asm_ioc) ||
+	    (ioc->priority_asm_ioc > 7) ||
+	    (r->r_count > (queue_max_sectors(bdev_get_queue(bdev)) << 9)) ||
+	    (r->r_count < 0))
+		goto out_error;
+
+	/* Test device size, when known. (massaged from ll_rw_blk.c) */
+	if (bdev->bd_inode->i_size >> 9) {
+		sector_t maxsector = bdev->bd_inode->i_size >> 9;
+		sector_t sector = (sector_t)ioc->first_asm_ioc;
+		sector_t blks = (sector_t)ioc->rcount_asm_ioc;
+
+		if (maxsector < blks || maxsector - blks < sector) {
+			char b[BDEVNAME_SIZE];
+			mlog(ML_NOTICE|ML_IOC,
+			     "Attempt to access beyond end of device\n");
+			mlog(ML_NOTICE|ML_IOC,
+			     "dev %s: want=%llu, limit=%llu\n",
+			     bdevname(bdev, b),
+			     (unsigned long long)(sector + blks),
+			     (unsigned long long)maxsector);
+			goto out_error;
+		}
+	}
+
+
+	mlog(ML_REQUEST|ML_IOC,
+	     "Request 0x%p (user_ioc 0x%p) passed validation checks\n",
+	     r, user_iocp);
+
+	switch (ioc->operation_asm_ioc) {
+		default:
+			goto out_error;
+			break;
+
+		case ASM_READ:
+			rw = READ;
+			break;
+
+		case ASM_WRITE:
+			rw = WRITE;
+			break;
+
+		case ASM_NOOP:
+			/* Trigger an errorless completion */
+			r->r_count = 0;
+			break;
+	}
+	
+	/* Not really an error, but hey, it's an end_io call */
+	ret = 0;
+	if (r->r_count == 0)
+		goto out_error;
+
+	ret = -ENOMEM;
+	r->r_bio = kapi_asm_bio_map_user(bdev_get_queue(bdev), bdev,
+					 (unsigned long)ioc->buffer_asm_ioc,
+					 r->r_count, rw == READ, GFP_KERNEL);
+	if (IS_ERR(r->r_bio)) {
+		ret = PTR_ERR(r->r_bio);
+		r->r_bio = NULL;
+		goto out_error;
+	}
+	mlog(ML_BIO, "Mapped bio 0x%p to request 0x%p\n", r->r_bio, r);
+
+	/* Block layer always uses 512-byte sector addressing,
+	 * regardless of logical and physical block size.
+	 */
+	r->r_bio->bi_sector = ioc->first_asm_ioc *
+		(bdev_physical_block_size(bdev) >> 9);
+
+	/*
+	 * If the bio is a bounced bio, we have to put the
+	 * end_io on the child "real" bio
+	 */
+	r->r_bio->bi_end_io = kapi_asm_end_bio_io;
+	r->r_bio->bi_private = r;
+
+	r->r_elapsed = jiffies;  /* Set start time */
+
+	atomic_set(&r->r_bio_count, 1);
+
+	mlog(ML_REQUEST|ML_BIO,
+	     "Submitting bio 0x%p for request 0x%p\n", r->r_bio, r);
+	submit_bio(rw, r->r_bio);
+
+out:
+	ret = asm_update_user_ioc(file, r);
+
+	mlog_exit(ret);
+	return ret;
+
+out_error:
+	mlog(ML_REQUEST, "Submit-side error %d for request 0x%p\n",
+	     ret,  r);
+	asm_end_ioc(r, 0, ret);
+	goto out;
+}  /* asm_submit_io() */
+
+
+static int asm_maybe_wait_io(struct file *file,
+			     asm_ioc *iocp,
+			     struct timeout *to)
+{
+	long ret;
+	u64 p;
+	struct asmfs_file_info *afi = ASMFS_FILE(file);
+	struct asmdisk_find_inode_args args;
+	struct asm_request *r;
+	struct task_struct *tsk = current;
+	DECLARE_WAITQUEUE(wait, tsk);
+	DECLARE_WAITQUEUE(to_wait, tsk);
+
+	mlog_entry("(0x%p, 0x%p, 0x%p)\n", file, iocp, to);
+	
+	if (copy_from_user(&p, &(iocp->reserved_asm_ioc),
+			   sizeof(p))) {
+		ret = -EFAULT;
+		goto out;
+	}
+
+	mlog(ML_REQUEST|ML_IOC, "User asm_ioc 0x%p has key 0x%p\n",
+	     iocp, (struct asm_request *)(unsigned long)p);
+	r = (struct asm_request *)(unsigned long)p;
+	if (!r) {
+		ret = -EINVAL;
+		goto out;
+	}
+
+	spin_lock_irq(&afi->f_lock);
+	/* Is it valid? It's surely ugly */
+	if (!r->r_file || (r->r_file != afi) ||
+	    list_empty(&r->r_list) || !(r->r_status & ASM_SUBMITTED)) {
+		spin_unlock_irq(&afi->f_lock);
+		ret = -EINVAL;
+		goto out;
+	}
+
+	mlog(ML_REQUEST|ML_IOC,
+	     "asm_request 0x%p is valid...we think\n", r);
+	if (!(r->r_status & (ASM_COMPLETED |
+			     ASM_BUSY | ASM_ERROR))) {
+		spin_unlock_irq(&afi->f_lock);
+		add_wait_queue(&afi->f_wait, &wait);
+		add_wait_queue(&to->wait, &to_wait);
+		do {
+			struct asm_disk_info *d;
+			struct block_device *bdev = NULL;
+			struct inode *disk_inode;
+
+			ret = 0;
+			set_task_state(tsk, TASK_INTERRUPTIBLE);
+
+			spin_lock_irq(&afi->f_lock);
+			if (r->r_status & (ASM_COMPLETED |
+					   ASM_BUSY | ASM_ERROR))
+				break;
+			d = r->r_disk;
+			if (d && d->d_bdev)
+				bdev = d->d_bdev;
+			spin_unlock_irq(&afi->f_lock);
+
+			args.fa_handle = (unsigned long)bdev;
+			args.fa_inode = ASMFS_I(ASMFS_F2I(file));
+			disk_inode = ilookup5(asmdisk_mnt->mnt_sb,
+					      (unsigned long)bdev,
+					      asmdisk_test, &args);
+			if (disk_inode) {
+				d = ASMDISK_I(disk_inode);
+				if (d->d_bdev)
+					blk_run_address_space(d->d_bdev->bd_inode->i_mapping);
+				iput(&d->vfs_inode);
+			}
+
+			ret = -ETIMEDOUT;
+			if (to->timed_out)
+				break;
+			io_schedule();
+			if (signal_pending(tsk)) {
+				mlog(ML_REQUEST,
+				     "Signal pending waiting for request 0x%p\n",
+				     r);
+				ret = -EINTR;
+				break;
+			}
+		} while (1);
+		set_task_state(tsk, TASK_RUNNING);
+		remove_wait_queue(&afi->f_wait, &wait);
+		remove_wait_queue(&to->wait, &to_wait);
+		
+		if (ret)
+			goto out;
+	}
+
+	ret = 0;
+
+	/* Somebody got here first */
+	/*
+	 * FIXME: This race means that we cannot be shared by two
+	 * threads/processes (this struct file).  If everyone does
+	 * their own open and gets their own struct file, this never
+	 * happens and we're safe.
+	 */
+	if (r->r_status & ASM_FREE)
+		goto out;  /* FIXME: Eek, holding lock */
+	mlog_bug_on_msg(list_empty(&afi->f_complete),
+			"Completion list is empty\n");
+
+	mlog(ML_REQUEST|ML_IOC,
+	     "Removing request 0x%p for asm_ioc 0x%p\n", r, iocp);
+	list_del_init(&r->r_list);
+	r->r_file = NULL;
+	r->r_status |= ASM_FREE;
+
+	spin_unlock_irq(&afi->f_lock);
+
+	ret = asm_update_user_ioc(file, r);
+
+	mlog(ML_REQUEST, "Freeing request 0x%p\n", r);
+	asm_request_free(r);
+
+out:
+	mlog_exit(ret);
+	return ret;
+}  /* asm_maybe_wait_io() */
+
+
+static int asm_complete_io(struct file *file,
+			   asm_ioc **ioc)
+{
+	int ret = 0;
+	struct list_head *l;
+	struct asm_request *r;
+	struct asmfs_file_info *afi = ASMFS_FILE(file);
+
+	mlog_entry("(0x%p, 0x%p)\n", file, ioc);
+
+	spin_lock_irq(&afi->f_lock);
+
+	if (list_empty(&afi->f_complete)) {
+		spin_unlock_irq(&afi->f_lock);
+		*ioc = NULL;
+		mlog_exit(0);
+		return 0;
+	}
+
+	l = afi->f_complete.prev;
+	r = list_entry(l, struct asm_request, r_list);
+	list_del_init(&r->r_list);
+	r->r_file = NULL;
+	r->r_status |= ASM_FREE;
+
+	spin_unlock_irq(&afi->f_lock);
+
+	*ioc = r->r_ioc;
+	
+	ret = asm_update_user_ioc(file, r);
+
+	asm_request_free(r);
+
+	mlog_exit(ret);
+	return ret;
+}  /* asm_complete_io() */
+
+
+static int asm_wait_completion(struct file *file,
+			       struct oracleasm_io_v2 *io,
+			       struct timeout *to,
+			       u32 *status)
+{
+	int ret;
+	struct asmfs_file_info *afi = ASMFS_FILE(file);
+	struct task_struct *tsk = current;
+	DECLARE_WAITQUEUE(wait, tsk);
+	DECLARE_WAITQUEUE(to_wait, tsk);
+
+	mlog_entry("(0x%p, 0x%p, 0x%p, 0x%p)\n", file, io, to, status);
+
+	/* Early check - expensive stuff follows */
+	ret = -ETIMEDOUT;
+	if (to->timed_out)
+		goto out;
+
+	spin_lock_irq(&afi->f_lock);
+	if (list_empty(&afi->f_ios) &&
+	    list_empty(&afi->f_complete)) {
+		/* No I/Os left */
+		spin_unlock_irq(&afi->f_lock);
+		ret = 0;
+		*status |= ASM_IO_IDLE;
+		goto out;
+	}
+	spin_unlock_irq(&afi->f_lock);
+
+	add_wait_queue(&afi->f_wait, &wait);
+	add_wait_queue(&to->wait, &to_wait);
+	do {
+		struct block_device *bdev;
+		struct asm_disk_info *d;
+		struct inode *disk_inode;
+		struct asmdisk_find_inode_args args;
+
+		ret = 0;
+		set_task_state(tsk, TASK_INTERRUPTIBLE);
+
+		spin_lock_irq(&afi->f_lock);
+		if (!list_empty(&afi->f_complete)) {
+			spin_unlock_irq(&afi->f_lock);
+			break;
+		}
+
+		bdev = find_io_bdev(file);
+		spin_unlock_irq(&afi->f_lock);
+
+		args.fa_handle = (unsigned long)bdev;
+		args.fa_inode = ASMFS_I(ASMFS_F2I(file));
+		disk_inode = ilookup5(asmdisk_mnt->mnt_sb,
+				      (unsigned long)bdev,
+				      asmdisk_test, &args);
+		if (disk_inode) {
+			d = ASMDISK_I(disk_inode);
+			if (d->d_bdev)
+				blk_run_address_space(d->d_bdev->bd_inode->i_mapping);
+			iput(&d->vfs_inode);
+		}
+
+		ret = -ETIMEDOUT;
+		if (to->timed_out)
+			break;
+		io_schedule();
+		if (signal_pending(tsk)) {
+			ret = -EINTR;
+			break;
+		}
+	} while (1);
+	set_task_state(tsk, TASK_RUNNING);
+	remove_wait_queue(&afi->f_wait, &wait);
+	remove_wait_queue(&to->wait, &to_wait);
+
+out:
+	mlog_exit(ret);
+	return ret;
+}  /* asm_wait_completion() */
+
+
+static inline int asm_submit_io_native(struct file *file,
+       				       struct oracleasm_io_v2 *io)
+{
+	int ret = 0;
+	u32 i;
+	asm_ioc *iocp;
+	asm_ioc tmp;
+
+	mlog_entry("(0x%p, 0x%p)\n", file, io);
+	
+	for (i = 0; i < io->io_reqlen; i++) {
+		ret = -EFAULT;
+		if (get_user(iocp,
+			     ((asm_ioc **)((unsigned long)(io->io_requests))) + i))
+			break;
+
+		if (copy_from_user(&tmp, iocp, sizeof(tmp)))
+			break;
+
+		mlog(ML_IOC, "Submitting user asm_ioc 0x%p\n", iocp);
+		ret = asm_submit_io(file, iocp, &tmp);
+		if (ret)
+			break;
+	}
+
+	mlog_exit(ret);
+	return ret;
+}  /* asm_submit_io_native() */
+
+
+static inline int asm_maybe_wait_io_native(struct file *file,
+					   struct oracleasm_io_v2 *io,
+					   struct timeout *to)
+{
+	int ret = 0;
+	u32 i;
+	asm_ioc *iocp;
+
+	mlog_entry("(0x%p, 0x%p, 0x%p)\n", file, io, to);
+	
+	for (i = 0; i < io->io_waitlen; i++) {
+		if (get_user(iocp,
+			     ((asm_ioc **)((unsigned long)(io->io_waitreqs))) + i)) {
+			ret = -EFAULT;
+			break;
+		}
+
+		ret = asm_maybe_wait_io(file, iocp, to);
+		if (ret)
+			break;
+	}
+
+	mlog_exit(ret);
+	return ret;
+}  /* asm_maybe_wait_io_native() */
+
+
+static inline int asm_complete_ios_native(struct file *file,
+					  struct oracleasm_io_v2 *io,
+					  struct timeout *to,
+					  u32 *status)
+{
+	int ret = 0;
+	u32 i;
+	asm_ioc *iocp;
+
+	mlog_entry("(0x%p, 0x%p, 0x%p, 0x%p)\n", file, io, to, status);
+
+	for (i = 0; i < io->io_complen; i++) {
+		ret = asm_complete_io(file, &iocp);
+		if (ret)
+			break;
+		if (iocp) {
+			ret = put_user(iocp,
+				       ((asm_ioc **)((unsigned long)(io->io_completions))) + i);
+			       if (ret)
+				   break;
+			continue;
+		}
+
+		/* We had waiters that are full */
+		if (*status & ASM_IO_WAITED)
+			break;
+
+		ret = asm_wait_completion(file, io, to, status);
+		if (ret)
+			break;
+		if (*status & ASM_IO_IDLE)
+			break;
+
+		i--; /* Reset this completion */
+
+	}
+
+	mlog_exit(ret ? ret : i);
+	return (ret ? ret : i);
+}  /* asm_complete_ios_native() */
+
+
+#if BITS_PER_LONG == 64
+static inline void asm_promote_64(asm_ioc64 *ioc)
+{
+	asm_ioc32 *ioc_32 = (asm_ioc32 *)ioc;
+
+	mlog_entry("(0x%p)\n", ioc);
+
+	/*
+	 * Promote the 32bit pointers at the end of the asm_ioc32
+	 * into the asm_ioc64.
+	 *
+	 * Promotion must be done from the tail backwards.
+	 */
+	mlog(ML_IOC, "Promoting (0x%X, 0x%X)\n",
+	     ioc_32->check_asm_ioc,
+	     ioc_32->buffer_asm_ioc);
+	ioc->check_asm_ioc = (u64)ioc_32->check_asm_ioc;
+	ioc->buffer_asm_ioc = (u64)ioc_32->buffer_asm_ioc;
+	mlog(ML_IOC, "Promoted to (0x%"MLFu64", 0x%"MLFu64")\n",
+	     ioc->check_asm_ioc,
+	     ioc->buffer_asm_ioc);
+
+	mlog_exit_void();
+}  /* asm_promote_64() */
+
+
+static inline int asm_submit_io_thunk(struct file *file,
+	       			      struct oracleasm_io_v2 *io)
+{
+	int ret = 0;
+	u32 i;
+	u32 iocp_32;
+	asm_ioc32 *iocp;
+	asm_ioc tmp;
+
+	mlog_entry("(0x%p, 0x%p)\n", file, io);
+
+	for (i = 0; i < io->io_reqlen; i++) {
+		ret = -EFAULT;
+		/*
+		 * io->io_requests is an asm_ioc32**, but the pointers
+		 * are 32bit pointers.
+		 */
+		if (get_user(iocp_32,
+			     ((u32 *)((unsigned long)(io->io_requests))) + i))
+			break;
+
+		iocp = (asm_ioc32 *)(unsigned long)iocp_32;
+
+		if (copy_from_user(&tmp, iocp, sizeof(*iocp)))
+			break;
+
+		asm_promote_64(&tmp);
+
+		mlog(ML_IOC, "Submitting user asm_ioc 0x%p\n", iocp);
+		ret = asm_submit_io(file, (asm_ioc *)iocp, &tmp);
+		if (ret)
+			break;
+	}
+
+	mlog_exit(ret);
+	return ret;
+}  /* asm_submit_io_thunk() */
+
+
+static inline int asm_maybe_wait_io_thunk(struct file *file,
+					  struct oracleasm_io_v2 *io,
+					  struct timeout *to)
+{
+	int ret = 0;
+	u32 i;
+	u32 iocp_32;
+	asm_ioc *iocp;
+
+	mlog_entry("(0x%p, 0x%p, 0x%p)\n", file, io, to);
+
+	for (i = 0; i < io->io_waitlen; i++) {
+		/*
+		 * io->io_waitreqs is an asm_ioc32**, but the pointers
+		 * are 32bit pointers.
+		 */
+		if (get_user(iocp_32,
+			     ((u32 *)((unsigned long)(io->io_waitreqs))) + i)) {
+			ret = -EFAULT;
+			break;
+		}
+
+		/* Remember, the this is pointing to 32bit userspace */
+		iocp = (asm_ioc *)(unsigned long)iocp_32;
+
+		ret = asm_maybe_wait_io(file, iocp, to);
+		if (ret)
+			break;
+	}
+
+	mlog_exit(ret);
+	return ret;
+}  /* asm_maybe_wait_io_thunk() */
+
+
+static inline int asm_complete_ios_thunk(struct file *file,
+					 struct oracleasm_io_v2 *io,
+					 struct timeout *to,
+					 u32 *status)
+{
+	int ret = 0;
+	u32 i;
+	u32 iocp_32;
+	asm_ioc *iocp;
+
+	mlog_entry("(0x%p, 0x%p, 0x%p, 0x%p)\n", file, io, to, status);
+
+	for (i = 0; i < io->io_complen; i++) {
+		ret = asm_complete_io(file, &iocp);
+		if (ret)
+			break;
+		if (iocp) {
+			iocp_32 = (u32)(unsigned long)iocp;
+
+			ret = put_user(iocp_32,
+				       ((u32 *)((unsigned long)(io->io_completions))) + i);
+			       if (ret)
+				   break;
+			continue;
+		}
+
+		/* We had waiters that are full */
+		if (*status & ASM_IO_WAITED)
+			break;
+
+		ret = asm_wait_completion(file, io, to, status);
+		if (ret)
+			break;
+		if (*status & ASM_IO_IDLE)
+			break;
+
+		i--; /* Reset this completion */
+	}
+
+	mlog_exit(ret ? ret : i);
+	return (ret ? ret : i);
+}  /* asm_complete_ios_thunk() */
+
+#endif  /* BITS_PER_LONG == 64 */
+
+
+static int asm_fill_timeout(struct timespec *ts, unsigned long timeout,
+			    int bpl) 
+{
+	struct timespec __user *ut = (struct timespec __user *)timeout;
+
+#if BITS_PER_LONG == 64
+	struct compat_timespec __user *cut =
+		(struct compat_timespec __user *)timeout;
+
+	/* We open-code get_compat_timespec() because it's not exported */
+	if (bpl == ASM_BPL_32)
+	        return (!access_ok(VERIFY_READ, cut,
+				   sizeof(*cut)) ||
+			__get_user(ts->tv_sec, &cut->tv_sec) ||
+			__get_user(ts->tv_nsec, &cut->tv_nsec)) ? -EFAULT : 0; 
+
+#endif  /* BITS_PER_LONG == 64 */
+
+	return copy_from_user(&ts, ut, sizeof(ts));
+}
+
+static int asm_do_io(struct file *file, struct oracleasm_io_v2 *io,
+		     int bpl)
+{
+	int ret = 0;
+	u32 status = 0;
+	struct timeout to;
+
+	mlog_entry("(0x%p, 0x%p, %d)\n", file, io, bpl);
+
+	init_timeout(&to);
+
+	if (io->io_timeout) {
+		struct timespec ts;
+
+		mlog(ML_ABI, "Passed timeout 0x%"MLFu64"\n",
+		     io->io_timeout);
+		ret = -EFAULT;
+		if (asm_fill_timeout(&ts, (unsigned long)(io->io_timeout),
+				     bpl))
+			goto out;
+
+		set_timeout(&to, &ts);
+		if (to.timed_out) {
+			io->io_timeout = (u64)0;
+			clear_timeout(&to);
+		}
+	}
+
+	ret = 0;
+	if (io->io_requests) {
+		mlog(ML_ABI,
+		     "oracleasm_io_v2 has requests; reqlen %d\n",
+		     io->io_reqlen);
+		ret = -EINVAL;
+		if (bpl == ASM_BPL_32)
+			ret = asm_submit_io_32(file, io);
+#if BITS_PER_LONG == 64
+		else if (bpl == ASM_BPL_64)
+			ret = asm_submit_io_64(file, io);
+#endif  /* BITS_PER_LONG == 64 */
+
+		if (ret)
+			goto out_to;
+	}
+
+	if (io->io_waitreqs) {
+		mlog(ML_ABI, "oracleasm_io_v2 has waits; waitlen %d\n",
+		     io->io_waitlen);
+		ret = -EINVAL;
+		if (bpl == ASM_BPL_32)
+			ret = asm_maybe_wait_io_32(file, io, &to);
+#if BITS_PER_LONG == 64
+		else if (bpl == ASM_BPL_64)
+			ret = asm_maybe_wait_io_64(file, io, &to);
+#endif  /* BITS_PER_LONG == 64 */
+
+		if (ret)
+			goto out_to;
+
+		status |= ASM_IO_WAITED;
+	}
+
+	if (io->io_completions) {
+		mlog(ML_ABI,
+		     "oracleasm_io_v2 has completes; complen %d\n",
+		     io->io_complen);
+		ret = -EINVAL;
+		if (bpl == ASM_BPL_32)
+			ret = asm_complete_ios_32(file, io, &to,
+						  &status);
+#if BITS_PER_LONG == 64
+		else if (bpl == ASM_BPL_64)
+			ret = asm_complete_ios_64(file, io, &to,
+						  &status);
+#endif  /* BITS_PER_LONG == 64 */
+
+		if (ret < 0)
+			goto out_to;
+		if (ret >= io->io_complen)
+			status |= ASM_IO_FULL;
+		ret = 0;
+	}
+
+out_to:
+	if (io->io_timeout)
+		clear_timeout(&to);
+
+out:
+	if (put_user(status, (u32 *)(unsigned long)(io->io_statusp)))
+		ret = -EFAULT;
+	mlog_exit(ret);
+	return ret;
+}  /* asm_do_io() */
+
+static void asm_cleanup_bios(struct file *file)
+{
+	struct asmfs_file_info *afi = ASMFS_FILE(file);
+	struct bio *bio;
+
+	mlog_entry("(0x%p)\n", file);
+
+	spin_lock_irq(&afi->f_lock);
+	while (afi->f_bio_free) {
+		bio = afi->f_bio_free;
+		afi->f_bio_free = bio->bi_private;
+
+		spin_unlock_irq(&afi->f_lock);
+		mlog(ML_BIO, "Unmapping bio 0x%p\n", bio);
+		bio_unmap_user(bio);
+		spin_lock_irq(&afi->f_lock);
+	}
+	spin_unlock_irq(&afi->f_lock);
+
+	mlog_exit_void();
+}
+
+static int asmfs_file_open(struct inode * inode, struct file * file)
+{
+	struct asmfs_inode_info * aii;
+	struct asmfs_file_info * afi;
+
+	mlog_entry("(0x%p, 0x%p)\n", inode, file);
+
+	mlog_bug_on_msg(ASMFS_FILE(file),
+			"Trying to reopen filp 0x%p\n", file);
+
+	mlog(ML_ABI, "Opening filp 0x%p\n", file);
+	afi = (struct asmfs_file_info *)kmalloc(sizeof(*afi),
+						GFP_KERNEL);
+	if (!afi) {
+		mlog_exit(-ENOMEM);
+		return -ENOMEM;
+	}
+
+	afi->f_file = file;
+	afi->f_bio_free = NULL;
+	spin_lock_init(&afi->f_lock);
+	INIT_LIST_HEAD(&afi->f_ctx);
+	INIT_LIST_HEAD(&afi->f_disks);
+	INIT_LIST_HEAD(&afi->f_ios);
+	INIT_LIST_HEAD(&afi->f_complete);
+	init_waitqueue_head(&afi->f_wait);
+
+	aii = ASMFS_I(ASMFS_F2I(file));
+	spin_lock_irq(&aii->i_lock);
+	list_add(&afi->f_ctx, &aii->i_threads);
+	spin_unlock_irq(&aii->i_lock);
+
+	file->private_data = afi;
+
+	mlog(ML_ABI, "Filp 0x%p has afi 0x%p\n", file, afi);
+
+	mlog_exit(0);
+	return 0;
+}  /* asmfs_file_open() */
+
+
+static int asmfs_file_release(struct inode *inode, struct file *file)
+{
+	struct asmfs_inode_info *aii;
+	struct asmfs_file_info *afi;
+	struct asm_disk_head *h, *n;
+	struct list_head *p;
+	struct asm_disk_info *d;
+	struct asm_request *r;
+	struct task_struct *tsk = current;
+	DECLARE_WAITQUEUE(wait, tsk);
+
+	mlog_entry("(0x%p, 0x%p)\n", inode, file);
+
+	aii = ASMFS_I(ASMFS_F2I(file));
+	afi = ASMFS_FILE(file);
+
+	mlog(ML_ABI, "Release for filp 0x%p (afi = 0x%p)\n", file, afi);
+
+	/*
+	 * Shouldn't need the lock, no one else has a reference
+	 * asm_close_disk will need to take it when completing I/O
+	 */
+	list_for_each_entry_safe(h, n, &afi->f_disks, h_flist) {
+		d = h->h_disk;
+		asm_close_disk(file, (unsigned long)d->d_bdev);
+	}
+
+	/* FIXME: Clean up things that hang off of afi */
+
+	spin_lock_irq(&aii->i_lock);
+	list_del(&afi->f_ctx);
+	spin_unlock_irq(&aii->i_lock);
+
+	/* No need for a fastpath */
+	add_wait_queue(&afi->f_wait, &wait);
+	do {
+		struct block_device *bdev;
+		struct asm_disk_info *d;
+		struct inode *disk_inode;
+		struct asmdisk_find_inode_args args;
+
+		set_task_state(tsk, TASK_UNINTERRUPTIBLE);
+
+		spin_lock_irq(&afi->f_lock);
+		if (list_empty(&afi->f_ios))
+		    break;
+
+		bdev = find_io_bdev(file);
+		spin_unlock_irq(&afi->f_lock);
+
+		args.fa_handle = (unsigned long)bdev;
+		args.fa_inode = aii;
+		disk_inode = ilookup5(asmdisk_mnt->mnt_sb,
+				      (unsigned long)bdev,
+				      asmdisk_test, &args);
+		if (disk_inode) {
+			d = ASMDISK_I(disk_inode);
+			if (d->d_bdev)
+				blk_run_address_space(d->d_bdev->bd_inode->i_mapping);
+			iput(&d->vfs_inode);
+		}
+
+		mlog(ML_ABI|ML_REQUEST,
+		     "There are still I/Os hanging off of afi 0x%p\n",
+		     afi);
+		io_schedule();
+	} while (1);
+	set_task_state(tsk, TASK_RUNNING);
+	remove_wait_queue(&afi->f_wait, &wait);
+	
+	/* I don't *think* we need the lock here anymore, but... */
+
+	/* Clear unreaped I/Os */
+	while (!list_empty(&afi->f_complete)) {
+		p = afi->f_complete.prev;
+		r = list_entry(p, struct asm_request, r_list);
+		list_del(&r->r_list);
+		r->r_file = NULL;
+		asm_request_free(r);
+	}
+	spin_unlock_irq(&afi->f_lock);
+
+	/* And cleanup any pages from those I/Os */
+	asm_cleanup_bios(file);
+
+	mlog(ML_ABI, "Done with afi 0x%p from filp 0x%p\n", afi, file);
+	file->private_data = NULL;
+	kfree(afi);
+
+	mlog_exit(0);
+	return 0;
+}  /* asmfs_file_release() */
+
+/*
+ * Verify that the magic and ABI versions are valid.  Future
+ * drivers might support more than one ABI version, so ESRCH is returned
+ * for "valid ABI version not found"
+ */
+static int asmfs_verify_abi(struct oracleasm_abi_info *abi_info)
+{
+	if (abi_info->ai_magic != ASM_ABI_MAGIC)
+		return -EBADR;
+	if (abi_info->ai_version != ASM_ABI_VERSION)
+		return -ESRCH;
+
+	return 0;
+}
+
+static ssize_t asmfs_svc_query_version(struct file *file, char *buf, size_t size)
+{
+	struct oracleasm_abi_info *abi_info;
+	int ret;
+
+	mlog_entry("(0x%p, 0x%p, %u)\n", file, buf, (unsigned int)size);
+
+	if (size != sizeof(struct oracleasm_abi_info)) {
+		mlog_exit(-EINVAL);
+		return -EINVAL;
+	}
+
+       	abi_info = (struct oracleasm_abi_info *)buf;
+
+	ret = asmfs_verify_abi(abi_info);
+	if (ret) {
+	       	if (ret == -ESRCH) {
+			abi_info->ai_version = ASM_ABI_VERSION;
+			abi_info->ai_status = -ESRCH;
+		} else
+			goto out;
+	}
+
+	ret = -EBADR;
+	if (abi_info->ai_size != sizeof(struct oracleasm_abi_info))
+		goto out;
+	ret = -EBADRQC;
+	if (abi_info->ai_type != ASMOP_QUERY_VERSION)
+		goto out;
+
+	ret = 0;
+
+out:
+	if (!abi_info->ai_status)
+		abi_info->ai_status = ret;
+	
+	mlog_exit(size);
+	return size;
+}
+
+static ssize_t asmfs_svc_get_iid(struct file *file, char *buf, size_t size)
+{
+	struct oracleasm_get_iid_v2 *iid_info;
+	struct asmfs_sb_info *asb = ASMFS_SB(ASMFS_F2I(file)->i_sb);
+	int ret;
+
+	mlog_entry("(0x%p, 0x%p, %u)\n", file, buf, (unsigned int)size);
+
+	if (size != sizeof(struct oracleasm_get_iid_v2)) {
+		mlog_exit(-EINVAL);
+		return -EINVAL;
+	}
+
+	iid_info = (struct oracleasm_get_iid_v2 *)buf;
+
+	ret = asmfs_verify_abi(&iid_info->gi_abi);
+	if (ret)
+		goto out;
+	ret = -EBADR;
+	if (iid_info->gi_abi.ai_size !=
+	    sizeof(struct oracleasm_get_iid_v2))
+		goto out;
+	ret = -EBADRQC;
+	if (iid_info->gi_abi.ai_type != ASMOP_GET_IID)
+		goto out;
+
+	spin_lock_irq(&asb->asmfs_lock);
+	iid_info->gi_iid = (u64)asb->next_iid;
+	asb->next_iid++;
+	spin_unlock_irq(&asb->asmfs_lock);
+
+	ret = 0;
+
+out:
+	iid_info->gi_abi.ai_status = ret;
+
+	mlog_exit(size);
+	return size;
+}
+
+static ssize_t asmfs_svc_check_iid(struct file *file, char *buf, size_t size)
+{
+	struct oracleasm_get_iid_v2 *iid_info;
+	struct asmfs_sb_info *asb = ASMFS_SB(ASMFS_F2I(file)->i_sb);
+	int ret;
+
+	mlog_entry("(0x%p, 0x%p, %u)\n", file, buf, (unsigned int)size);
+
+	if (size != sizeof(struct oracleasm_get_iid_v2)) {
+		mlog_exit(-EINVAL);
+		return -EINVAL;
+	}
+
+	iid_info = (struct oracleasm_get_iid_v2 *)buf;
+
+	ret = asmfs_verify_abi(&iid_info->gi_abi);
+	if (ret)
+		goto out;
+
+	ret = -EBADR;
+	if (iid_info->gi_abi.ai_size !=
+	    sizeof(struct oracleasm_get_iid_v2))
+		goto out;
+	ret = -EBADRQC;
+	if (iid_info->gi_abi.ai_type != ASMOP_CHECK_IID)
+		goto out;
+
+	spin_lock_irq(&asb->asmfs_lock);
+	if (iid_info->gi_iid >= (u64)asb->next_iid)
+		iid_info->gi_iid = (u64)0;
+	spin_unlock_irq(&asb->asmfs_lock);
+
+	ret = 0;
+
+out:
+	iid_info->gi_abi.ai_status = ret;
+
+	mlog_exit(size);
+	return size;
+}
+
+static ssize_t asmfs_svc_query_disk(struct file *file, char *buf, size_t size)
+{
+	struct oracleasm_query_disk_v2 *qd_info;
+	struct file *filp;
+	struct block_device *bdev;
+	int ret;
+
+	mlog_entry("(0x%p, 0x%p, %u)\n", file, buf, (unsigned int)size);
+
+	if (size != sizeof(struct oracleasm_query_disk_v2)) {
+		mlog_exit(-EINVAL);
+		return -EINVAL;
+	}
+
+	qd_info = (struct oracleasm_query_disk_v2 *)buf;
+
+	ret = asmfs_verify_abi(&qd_info->qd_abi);
+	if (ret)
+		goto out;
+
+	ret = -EBADR;
+	if (qd_info->qd_abi.ai_size !=
+	    sizeof(struct oracleasm_query_disk_v2))
+		goto out;
+	ret = -EBADRQC;
+	if (qd_info->qd_abi.ai_type != ASMOP_QUERY_DISK)
+		goto out;
+
+	ret = -ENODEV;
+	filp = fget(qd_info->qd_fd);
+	if (!filp)
+		goto out;
+
+	ret = -ENOTBLK;
+	if (!S_ISBLK(filp->f_mapping->host->i_mode))
+		goto out_put;
+
+	bdev = I_BDEV(filp->f_mapping->host);
+
+	qd_info->qd_max_sectors = compute_max_sectors(bdev);
+	qd_info->qd_hardsect_size = bdev_physical_block_size(bdev);
+	mlog(ML_ABI|ML_DISK,
+	     "Querydisk returning qd_max_sectors = %u and "
+	     "qd_hardsect_size = %d\n",
+	     qd_info->qd_max_sectors, qd_info->qd_hardsect_size);
+
+	ret = 0;
+
+out_put:
+	fput(filp);
+
+out:
+	qd_info->qd_abi.ai_status = ret;
+
+	mlog_exit(size);
+	return size;
+}
+
+static ssize_t asmfs_svc_open_disk(struct file *file, char *buf, size_t size)
+{
+	struct oracleasm_open_disk_v2 od_info;
+	struct block_device *bdev = NULL;
+	struct file *filp;
+	int ret;
+
+	mlog_entry("(0x%p, 0x%p, %u)\n", file, buf, (unsigned int)size);
+
+	if (size != sizeof(struct oracleasm_open_disk_v2)) {
+		mlog_exit(-EINVAL);
+		return -EINVAL;
+	}
+
+	if (copy_from_user(&od_info,
+			   (struct oracleasm_open_disk_v2 __user *)buf,
+			   sizeof(struct oracleasm_open_disk_v2))) {
+		mlog_exit(-EFAULT);
+		return -EFAULT;
+	}
+
+	od_info.od_handle = 0; /* Unopened */
+
+	ret = asmfs_verify_abi(&od_info.od_abi);
+	if (ret)
+		goto out_error;
+
+	ret = -EBADR;
+	if (od_info.od_abi.ai_size !=
+	    sizeof(struct oracleasm_open_disk_v2))
+		goto out_error;
+	ret = -EBADRQC;
+	if (od_info.od_abi.ai_type != ASMOP_OPEN_DISK)
+		goto out_error;
+
+	ret = -ENODEV;
+	filp = fget(od_info.od_fd);
+	if (!filp)
+		goto out_error;
+
+	if (igrab(filp->f_mapping->host)) {
+		ret = -ENOTBLK;
+		if (S_ISBLK(filp->f_mapping->host->i_mode)) {
+			bdev = I_BDEV(filp->f_mapping->host);
+
+			ret = asm_open_disk(file, bdev);
+		}
+	}
+	fput(filp);
+	if (ret)
+		goto out_error;
+
+	od_info.od_handle = (u64)(unsigned long)bdev;
+out_error:
+	od_info.od_abi.ai_status = ret;
+	if (copy_to_user((struct oracleasm_open_disk_v2 __user *)buf,
+			 &od_info,
+			 sizeof(struct oracleasm_open_disk_v2))) {
+		if (od_info.od_handle)
+			asm_close_disk(file,
+				       (unsigned long)od_info.od_handle);
+		/* Ignore close errors, this is the real error */
+		mlog_exit(-EFAULT);
+		return -EFAULT;
+	}
+
+	mlog_exit(size);
+	return size;
+}
+
+static ssize_t asmfs_svc_close_disk(struct file *file, char *buf, size_t size)
+{
+	struct oracleasm_close_disk_v2 cd_info;
+	int ret;
+
+	mlog_entry("(0x%p, 0x%p, %u)\n", file, buf, (unsigned int)size);
+
+	if (size != sizeof(struct oracleasm_close_disk_v2)) {
+		mlog_exit(-EINVAL);
+		return -EINVAL;
+	}
+
+	if (copy_from_user(&cd_info,
+			   (struct oracleasm_close_disk_v2 __user *)buf,
+			   sizeof(struct oracleasm_close_disk_v2))) {
+		mlog_exit(-EFAULT);
+		return -EFAULT;
+	}
+
+	ret = asmfs_verify_abi(&cd_info.cd_abi);
+	if (ret)
+		goto out_error;
+
+	ret = -EBADR;
+	if (cd_info.cd_abi.ai_size !=
+	    sizeof(struct oracleasm_close_disk_v2))
+		goto out_error;
+	ret = -EBADRQC;
+	if (cd_info.cd_abi.ai_type != ASMOP_CLOSE_DISK)
+		goto out_error;
+
+	ret = asm_close_disk(file, (unsigned long)cd_info.cd_handle);
+
+out_error:
+	cd_info.cd_abi.ai_status = ret;
+	if (copy_to_user((struct oracleasm_close_disk_v2 __user *)buf,
+			 &cd_info,
+			 sizeof(struct oracleasm_close_disk_v2))) {
+		mlog_exit(-EFAULT);
+		return -EFAULT;
+	}
+
+	mlog_exit(size);
+	return size;
+}
+
+static ssize_t asmfs_svc_io32(struct file *file, char *buf, size_t size)
+{
+	struct oracleasm_abi_info __user *user_abi_info;
+	struct oracleasm_io_v2 io_info;
+	int ret;
+
+	mlog_entry("(0x%p, 0x%p, %u)\n", file, buf, (unsigned int)size);
+
+	if (size != sizeof(struct oracleasm_io_v2)) {
+		mlog_exit(-EINVAL);
+		return -EINVAL;
+	}
+
+	if (copy_from_user(&io_info,
+			   (struct oracleasm_io_v2 __user *)buf,
+			   sizeof(struct oracleasm_io_v2))) {
+		mlog_exit(-EFAULT);
+		return -EFAULT;
+	}
+
+	ret = asmfs_verify_abi(&io_info.io_abi);
+	if (ret)
+		goto out_error;
+
+	ret = -EBADR;
+	if (io_info.io_abi.ai_size !=
+	    sizeof(struct oracleasm_io_v2))
+		goto out_error;
+	ret = -EBADRQC;
+	if (io_info.io_abi.ai_type != ASMOP_IO32)
+		goto out_error;
+
+	ret = asm_do_io(file, &io_info, ASM_BPL_32);
+
+out_error:
+	user_abi_info = (struct oracleasm_abi_info __user *)buf;
+	if (put_user(ret, &(user_abi_info->ai_status))) {
+		mlog_exit(-EFAULT);
+		return -EFAULT;
+	}
+
+	mlog_exit(size);
+	return size;
+}
+
+#if BITS_PER_LONG == 64
+static ssize_t asmfs_svc_io64(struct file *file, char *buf, size_t size)
+{
+	struct oracleasm_abi_info __user *user_abi_info;
+	struct oracleasm_io_v2 io_info;
+	int ret;
+
+	mlog_entry("(0x%p, 0x%p, %u)\n", file, buf, (unsigned int)size);
+
+	if (size != sizeof(struct oracleasm_io_v2)) {
+		mlog_exit(-EINVAL);
+		return -EINVAL;
+	}
+
+	if (copy_from_user(&io_info,
+			   (struct oracleasm_io_v2 __user *)buf,
+			   sizeof(struct oracleasm_io_v2))) {
+		mlog_exit(-EFAULT);
+		return -EFAULT;
+	}
+
+	ret = asmfs_verify_abi(&io_info.io_abi);
+	if (ret)
+		goto out_error;
+
+	ret = -EBADR;
+	if (io_info.io_abi.ai_size !=
+	    sizeof(struct oracleasm_io_v2))
+		goto out_error;
+	ret = -EBADRQC;
+	if (io_info.io_abi.ai_type != ASMOP_IO64)
+		goto out_error;
+
+	ret = asm_do_io(file, &io_info, ASM_BPL_64);
+
+out_error:
+	user_abi_info = (struct oracleasm_abi_info __user *)buf;
+	if (put_user(ret, &(user_abi_info->ai_status))) {
+		mlog_exit(-EFAULT);
+		return -EFAULT;
+	}
+
+	mlog_exit(size);
+	return size;
+}
+#endif  /* BITS_PER_LONG == 64 */
+
+
+/*
+ * Because each of these operations need to access the filp->private,
+ * we must multiplex.
+ */
+static ssize_t asmfs_file_read(struct file *file, char *buf, size_t size, loff_t *pos)
+{
+	struct oracleasm_abi_info __user *user_abi_info;
+	ssize_t ret;
+	int op;
+
+	asm_cleanup_bios(file);
+
+	user_abi_info = (struct oracleasm_abi_info __user *)buf;
+	if (get_user(op, &((user_abi_info)->ai_type))) {
+		mlog_exit(-EFAULT);
+		return -EFAULT;
+	}
+
+	switch (op) {
+		default:
+			ret = -EBADRQC;
+			break;
+
+		case ASMOP_OPEN_DISK:
+			ret = asmfs_svc_open_disk(file, (char *)buf,
+						  size);
+			break;
+
+		case ASMOP_CLOSE_DISK:
+			ret = asmfs_svc_close_disk(file, (char *)buf,
+						   size);
+			break;
+
+		case ASMOP_IO32:
+			ret = asmfs_svc_io32(file, (char *)buf, size);
+			break;
+
+#if BITS_PER_LONG == 64
+		case ASMOP_IO64:
+			ret = asmfs_svc_io64(file, (char *)buf, size);
+			break;
+#endif  /* BITS_PER_LONG == 64 */
+	}
+
+	return ret;
+}
+
+static struct file_operations asmfs_file_operations = {
+	.open		= asmfs_file_open,
+	.release	= asmfs_file_release,
+	.read		= asmfs_file_read,
+};
+
+static struct inode_operations asmfs_file_inode_operations = {
+	.getattr	= simple_getattr,
+};
+
+/*  See init_asmfs_dir_operations() */
+static struct file_operations asmfs_dir_operations = {0, };
+
+static struct inode_operations asmfs_disk_dir_inode_operations = {
+	.lookup		= simple_lookup,
+	.unlink		= simple_unlink,
+	.mknod		= asmfs_mknod,
+};
+static struct inode_operations asmfs_iid_dir_inode_operations = {
+	.create		= asmfs_create,
+	.lookup		= simple_lookup,
+	.unlink		= simple_unlink,
+};
+
+static struct super_operations asmfs_ops = {
+	.statfs		= simple_statfs,
+	.alloc_inode	= asmfs_alloc_inode,
+	.destroy_inode	= asmfs_destroy_inode,
+	.drop_inode	= generic_delete_inode,
+	/* These last three only required for limited maxinstances */
+	.put_super	= asmfs_put_super,
+	.remount_fs     = asmfs_remount,
+};
+
+/*
+ * Initialisation
+ */
+
+static int asmfs_fill_super(struct super_block *sb,
+			    void *data, int silent)
+{
+	struct inode *inode, *parent;
+	struct dentry *root, *dentry;
+	struct asmfs_sb_info *asb;
+	struct asmfs_params params;
+	struct qstr name;
+
+	sb->s_blocksize = PAGE_CACHE_SIZE;
+	sb->s_blocksize_bits = PAGE_CACHE_SHIFT;
+	sb->s_magic = ASMFS_MAGIC;
+	sb->s_op = &asmfs_ops;
+	sb->s_maxbytes = MAX_NON_LFS;	/* Why? */
+
+	asb = kmalloc(sizeof(struct asmfs_sb_info), GFP_KERNEL);
+	if (!asb)
+		return -ENOMEM;
+	sb->s_fs_info = asb;
+
+	asb->asmfs_super = sb;
+	asb->next_iid = 1;
+	spin_lock_init(&asb->asmfs_lock);
+
+	if (parse_options((char *)data, &params) != 0)
+		goto out_free_asb;
+
+	init_limits(asb, &params);
+
+	inode = new_inode(sb);
+	if (!inode)
+		goto out_free_asb;
+
+	inode->i_ino = (unsigned long)inode;
+	inode->i_mode = S_IFDIR | 0755;
+	inode->i_uid = inode->i_gid = 0;
+	set_i_blksize(inode, PAGE_CACHE_SIZE);
+	inode->i_blocks = 0;
+	inode->i_rdev = 0;
+	inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
+	inode->i_op = &simple_dir_inode_operations;
+	inode->i_fop = &asmfs_dir_operations;
+	inode->i_mapping->backing_dev_info = &memory_backing_dev_info;
+	/* directory inodes start off with i_nlink == 2 (for "." entry) */
+	inode->i_nlink++;
+	parent = inode;
+
+	root = d_alloc_root(inode);
+	if (!root) {
+		iput(inode);
+		goto out_free_asb;
+	}
+
+	name.name = ASM_MANAGER_DISKS;
+	name.len = strlen(ASM_MANAGER_DISKS);
+	name.hash = full_name_hash(name.name, name.len);
+	dentry = d_alloc(root, &name);
+	if (!dentry)
+		goto out_genocide;
+	parent->i_nlink++;
+	inode = new_inode(sb);
+	if (!inode)
+		goto out_genocide;
+	inode->i_ino = (unsigned long)inode;
+	inode->i_mode = S_IFDIR | 0755;
+	inode->i_uid = inode->i_gid = 0;
+	inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
+	inode->i_op = &asmfs_disk_dir_inode_operations;
+	inode->i_fop = &asmfs_dir_operations;
+	inode->i_mapping->backing_dev_info = &memory_backing_dev_info;
+	d_add(dentry, inode);
+
+	name.name = ASM_MANAGER_INSTANCES;
+	name.len = strlen(ASM_MANAGER_INSTANCES);
+	name.hash = full_name_hash(name.name, name.len);
+	dentry = d_alloc(root, &name);
+	if (!dentry)
+		goto out_genocide;
+	parent->i_nlink++;
+	inode = new_inode(sb);
+	if (!inode)
+		goto out_genocide;
+	inode->i_ino = (unsigned long)inode;
+	inode->i_mode = S_IFDIR | 0770;
+	inode->i_uid = inode->i_gid = 0;
+	inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
+	inode->i_op = &asmfs_iid_dir_inode_operations;
+	inode->i_fop = &asmfs_dir_operations;
+	inode->i_mapping->backing_dev_info = &memory_backing_dev_info;
+	d_add(dentry, inode);
+
+	name.name = asm_operation_files[ASMOP_QUERY_VERSION];
+	name.len = strlen(asm_operation_files[ASMOP_QUERY_VERSION]);
+	name.hash = full_name_hash(name.name, name.len);
+	dentry = d_alloc(root, &name);
+	if (!dentry)
+		goto out_genocide;
+	inode = new_transaction_inode(sb, 0770,
+				      &trans_contexts[ASMOP_QUERY_VERSION]);
+	if (!inode)
+		goto out_genocide;
+	inode->i_mapping->backing_dev_info = &memory_backing_dev_info;
+	d_add(dentry, inode);
+
+	name.name = asm_operation_files[ASMOP_GET_IID];
+	name.len = strlen(asm_operation_files[ASMOP_GET_IID]);
+	name.hash = full_name_hash(name.name, name.len);
+	dentry = d_alloc(root, &name);
+	if (!dentry)
+		goto out_genocide;
+	inode = new_transaction_inode(sb, 0770,
+				      &trans_contexts[ASMOP_GET_IID]);
+	if (!inode)
+		goto out_genocide;
+	inode->i_mapping->backing_dev_info = &memory_backing_dev_info;
+	d_add(dentry, inode);
+
+	name.name = asm_operation_files[ASMOP_CHECK_IID];
+	name.len = strlen(asm_operation_files[ASMOP_CHECK_IID]);
+	name.hash = full_name_hash(name.name, name.len);
+	dentry = d_alloc(root, &name);
+	if (!dentry)
+		goto out_genocide;
+	inode = new_transaction_inode(sb, 0770,
+				      &trans_contexts[ASMOP_CHECK_IID]);
+	if (!inode)
+		goto out_genocide;
+	inode->i_mapping->backing_dev_info = &memory_backing_dev_info;
+	d_add(dentry, inode);
+
+	name.name = asm_operation_files[ASMOP_QUERY_DISK];
+	name.len = strlen(asm_operation_files[ASMOP_QUERY_DISK]);
+	name.hash = full_name_hash(name.name, name.len);
+	dentry = d_alloc(root, &name);
+	if (!dentry)
+		goto out_genocide;
+	inode = new_transaction_inode(sb, 0770,
+				      &trans_contexts[ASMOP_QUERY_DISK]);
+	if (!inode)
+		goto out_genocide;
+	inode->i_mapping->backing_dev_info = &memory_backing_dev_info;
+	d_add(dentry, inode);
+
+	sb->s_root = root;
+
+
+	printk(KERN_DEBUG "ASM: oracleasmfs mounted with options: %s\n", 
+	       data ? (char *)data : "<defaults>" );
+	printk(KERN_DEBUG "ASM:	maxinstances=%ld\n", asb->max_inodes);
+	return 0;
+
+out_genocide:
+	d_genocide(root);
+	dput(root);
+
+out_free_asb:
+	sb->s_fs_info = NULL;
+	kfree(asb);
+
+	return -EINVAL;
+}
+
+
+/*
+ * We want all the simple_dir_operations, but we cannot reference them
+ * directly -- they are not EXPORT_SYMBOL()d.  So, we just copy the
+ * exported simple_dir_operations before adding any specific functions
+ * of our own.
+ *
+ * This means that asmfs_dir_operations can't be const.  Oh, well.
+ */
+static void __init init_asmfs_dir_operations(void) {
+	asmfs_dir_operations		= simple_dir_operations;
+	asmfs_dir_operations.fsync	= simple_sync_file;
+};
+
+
+#ifdef GET_SB_HAS_VFSMOUNT
+static int asmfs_get_sb(struct file_system_type *fs_type, int flags,
+			const char *dev_name, void *data,
+			struct vfsmount *mnt)
+{
+	return get_sb_nodev(fs_type, flags, data, asmfs_fill_super, mnt);
+}
+#else
+static struct super_block *asmfs_get_sb(struct file_system_type *fs_type,
+					int flags, const char *dev_name,
+					void *data)
+{
+	return get_sb_nodev(fs_type, flags, data, asmfs_fill_super);
+}
+#endif  /* GET_SB_HAS_VFSMOUNT */
+
+static struct file_system_type asmfs_fs_type = {
+	.owner		= THIS_MODULE,
+	.name		= "oracleasmfs",
+	.get_sb		= asmfs_get_sb,
+	.kill_sb	= kill_litter_super,
+};
+
+static int __init init_asmfs_fs(void)
+{
+	int ret;
+
+	ret = init_inodecache();
+	if (ret) {
+		printk("oracleasmfs: Unable to create asmfs_inode_cache\n");
+		goto out_inodecache;
+	}
+
+	ret = init_requestcache();
+	if (ret) {
+		printk("oracleasmfs: Unable to create asm_request cache\n");
+		goto out_requestcache;
+	}
+
+	ret = init_asmdiskcache();
+	if (ret) {
+		printk("oracleasmfs: Unable to initialize the disk cache\n");
+		goto out_diskcache;
+	}
+
+	ret = init_oracleasm_proc();
+	if (ret) {
+		printk("oracleasmfs: Unable to register proc entries\n");
+		goto out_proc;
+	}
+
+	init_asmfs_dir_operations();
+	ret = register_filesystem(&asmfs_fs_type);
+	if (ret) {
+		printk("oracleasmfs: Unable to register filesystem\n");
+		goto out_register;
+	}
+
+	return 0;
+
+out_register:
+	exit_oracleasm_proc();
+
+out_proc:
+	destroy_asmdiskcache();
+
+out_diskcache:
+	destroy_requestcache();
+
+out_requestcache:
+	destroy_inodecache();
+
+out_inodecache:
+	return ret;
+}
+
+static void __exit exit_asmfs_fs(void)
+{
+	unregister_filesystem(&asmfs_fs_type);
+	exit_oracleasm_proc();
+	destroy_asmdiskcache();
+	destroy_requestcache();
+	destroy_inodecache();
+}
+
+module_init(init_asmfs_fs)
+module_exit(exit_asmfs_fs)
+MODULE_LICENSE("GPL");
+MODULE_VERSION(ASM_MODULE_VERSION);
+MODULE_AUTHOR("Joel Becker <joel.becker@oracle.com>");
+MODULE_DESCRIPTION("Kernel driver backing the Generic Linux ASM Library.");
diff -ruN oracleasm-2.0.5/kernel/oracleasm.c oracleasm-2.0.5-fix/kernel/oracleasm.c
--- oracleasm-2.0.5/kernel/oracleasm.c	2008-09-10 19:32:11.000000000 +0200
+++ oracleasm-2.0.5-fix/kernel/oracleasm.c	1970-01-01 01:00:00.000000000 +0100
@@ -1,2946 +0,0 @@
-/* -*- mode: c; c-basic-offset: 8; -*-
- * vim: noexpandtab sw=8 ts=8 sts=0:
- *
- * NAME
- *	oracleasm.c - ASM library kernel driver.
- *
- * AUTHOR
- * 	Joel Becker <joel.becker@oracle.com>
- *
- * DESCRIPTION
- *      This file contains the kernel driver of the Oracle Automatic
- *      Storage Managment userspace library.  It provides the routines
- *      required to support the userspace library.
- *
- * MODIFIED   (YYYY/MM/DD)
- *      2004/01/02 - Joel Becker <joel.becker@oracle.com>
- *		Initial GPL header.
- *      2004/09/10 - Joel Becker <joel.becker@oracle.com>
- *      	First port to 2.6.
- *      2004/12/16 - Joel Becker <joel.becker@oracle.com>
- *      	Change from ioctl to transaction files.
- *
- * Copyright (c) 2002-2004 Oracle Corporation.  All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License, version 2 as published by the Free Software Foundation.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have recieved a copy of the GNU General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 021110-1307, USA.
- */
-
-/*
- * This driver's filesystem code is based on the ramfs filesystem.
- * Copyright information for the original source appears below.
- */
-
-/* Simple VFS hooks based on: */
-/*
- * Resizable simple ram filesystem for Linux.
- *
- * Copyright (C) 2000 Linus Torvalds.
- *		 2000 Transmeta Corp.
- *
- * Usage limits added by David Gibson, Linuxcare Australia.
- * This file is released under the GPL.
- */
-
-
-#include <linux/fs.h>
-#include <linux/file.h>
-#include <linux/module.h>
-#include <linux/pagemap.h>
-#include <linux/init.h>
-#include <linux/string.h>
-#include <linux/highmem.h>
-#include <linux/slab.h>
-#include <linux/blkdev.h>
-#include <linux/mount.h>
-#include <linux/smp_lock.h>
-#include <linux/parser.h>
-#include <linux/backing-dev.h>
-
-#include <asm/uaccess.h>
-#include <linux/spinlock.h>
-
-#include "linux/oracleasm/compat32.h"
-#include "linux/oracleasm/kernel.h"
-#include "linux/oracleasm/abi.h"
-#include "linux/oracleasm/disk.h"
-#include "linux/oracleasm/manager.h"
-#include "linux/oracleasm/error.h"
-
-#include "linux/oracleasm/module_version.h"
-
-/*
- * Modern kernels don't need this.  Older kernels will have it defined
- * by the compat code.
- */
-#ifndef set_i_blksize
-# define set_i_blksize(i, bs) do { /* Nothing */ } while (0)
-#endif
-
-
-#include "masklog.h"
-#include "proc.h"
-#if 0
-#include "transaction_file.h"
-#else
-/* XXX ugly for now */
-#include "transaction_file.c"
-#include "proc.c"
-#endif 
-
-#if PAGE_CACHE_SIZE % 1024
-#error Oh no, PAGE_CACHE_SIZE is not divisible by 1k! I cannot cope.
-#endif  /* PAGE_CACHE_SIZE % 1024 */
-
-
-
-/*
- * Compat32
- */
-#define ASM_BPL_32		32
-#if BITS_PER_LONG == 32
-# define asm_submit_io_32	asm_submit_io_native
-# define asm_maybe_wait_io_32	asm_maybe_wait_io_native
-# define asm_complete_ios_32	asm_complete_ios_native
-#else
-# if BITS_PER_LONG == 64
-#  define ASM_BPL_64		64
-#  define asm_submit_io_32	asm_submit_io_thunk
-#  define asm_submit_io_64	asm_submit_io_native
-#  define asm_maybe_wait_io_32	asm_maybe_wait_io_thunk
-#  define asm_maybe_wait_io_64	asm_maybe_wait_io_native
-#  define asm_complete_ios_32	asm_complete_ios_thunk
-#  define asm_complete_ios_64	asm_complete_ios_native
-# endif  /* BITS_PER_LONG == 64 */
-#endif  /* BITS_PER_LONG == 32 */
-
-
-static struct super_operations asmfs_ops;
-static struct file_operations asmfs_dir_operations;
-static struct file_operations asmfs_file_operations;
-static struct inode_operations asmfs_file_inode_operations;
-static struct inode_operations asmfs_disk_dir_inode_operations;
-static struct inode_operations asmfs_iid_dir_inode_operations;
-
-static struct kmem_cache	*asm_request_cachep;
-static struct kmem_cache	*asmfs_inode_cachep;
-static struct kmem_cache	*asmdisk_cachep;
-#ifndef kapi_kmem_cache_create
-# define kapi_kmem_cache_create kmem_cache_create
-#endif
-
-/*
- * asmfs super-block data in memory
- */
-struct asmfs_sb_info {
-	struct super_block *asmfs_super;
-	/* Prevent races accessing the used block
-	 * counts. Conceptually, this could probably be a semaphore,
-	 * but the only thing we do while holding the lock is
-	 * arithmetic, so there's no point */
-	spinlock_t asmfs_lock;
-
-	/* It is important that at least the free counts below be
-	   signed.  free_XXX may become negative if a limit is changed
-	   downwards (by a remount) below the current usage. */	  
-
-	/* max number of inodes - controls # of instances */
-	long max_inodes;
-	/* free_inodes = max_inodes - total number of inodes currently in use */
-	long free_inodes;
-
-	unsigned long next_iid;
-};
-
-#define ASMFS_SB(sb) ((struct asmfs_sb_info *)((sb)->s_fs_info))
-
-
-struct asmfs_file_info {
-	struct file *f_file;
-	spinlock_t f_lock;		/* Lock on the structure */
-	wait_queue_head_t f_wait;	/* Folks waiting on I/O */
-	struct list_head f_ctx;		/* Hook into the i_threads list */
-	struct list_head f_ios;		/* Outstanding I/Os for this thread */
-	struct list_head f_complete;	/* Completed I/Os for this thread */
-	struct list_head f_disks;	/* List of disks opened */
-	struct bio *f_bio_free;		/* bios to free */
-};
-
-#define ASMFS_FILE(_f) ((struct asmfs_file_info *)((_f)->private_data))
-
-
-/*
- * asmfs inode data in memory
- *
- * Note that 'thread' here can mean 'process' too :-)
- */
-struct asmfs_inode_info {
-	spinlock_t i_lock;		/* lock on the asmfs_inode_info structure */
-	struct list_head i_disks;	/* List of disk handles */
-	struct list_head i_threads;	/* list of context structures for each calling thread */
-	struct inode vfs_inode;
-};
-
-static inline struct asmfs_inode_info *ASMFS_I(struct inode *inode)
-{
-	return container_of(inode, struct asmfs_inode_info, vfs_inode);
-}
-
-static inline struct inode *ASMFS_F2I(struct file *file)
-{
-	return file->f_dentry->d_inode;
-}
-
-/*
- * asm disk info
- */
-struct asm_disk_info {
-	struct asmfs_inode_info *d_inode;
-	struct block_device *d_bdev;	/* Block device we I/O to */
-	int d_max_sectors;		/* Maximum sectors per I/O */
-	int d_live;			/* Is the disk alive? */
-	atomic_t d_ios;			/* Count of in-flight I/Os */
-	struct list_head d_open;	/* List of assocated asm_disk_heads */
-	struct inode vfs_inode;
-};
-
-/* Argument to iget5_locked()/ilookup5() to map bdev to disk_inode */
-struct asmdisk_find_inode_args {
-	unsigned long fa_handle;
-	struct asmfs_inode_info *fa_inode;
-};
-
-static inline struct asm_disk_info *ASMDISK_I(struct inode *inode)
-{
-	return container_of(inode, struct asm_disk_info, vfs_inode);
-}
-
-
-/*
- * asm disk info lists
- *
- * Each file_info struct has a list of disks it has opened.  As this
- * is an M->N mapping, an intermediary structure is needed
- */
-struct asm_disk_head {
-	struct asm_disk_info *h_disk;	/* Pointer to associated disk */
-	struct asmfs_file_info *h_file;	/* Pointer to owning file */
-	struct list_head h_flist;	/* Hook into file's list */
-	struct list_head h_dlist;	/* Hook into disk's list */
-};
-
-
-/* ASM I/O requests */
-struct asm_request {
-	struct list_head r_list;
-	struct asmfs_file_info *r_file;
-	struct asm_disk_info *r_disk;
-	asm_ioc *r_ioc;				/* User asm_ioc */
-	u16 r_status;				/* status_asm_ioc */
-	int r_error;
-	unsigned long r_elapsed;		/* Start time while in-flight, elapsted time once complete */
-	struct bio *r_bio;			/* The I/O */
-	size_t r_count;				/* Total bytes */
-	atomic_t r_bio_count;			/* Atomic count */
-};
-
-
-/*
- * Transaction file contexts.
- */
-static ssize_t asmfs_svc_query_version(struct file *file, char *buf, size_t size);
-static ssize_t asmfs_svc_get_iid(struct file *file, char *buf, size_t size);
-static ssize_t asmfs_svc_check_iid(struct file *file, char *buf, size_t size);
-static ssize_t asmfs_svc_query_disk(struct file *file, char *buf, size_t size);
-static ssize_t asmfs_svc_open_disk(struct file *file, char *buf, size_t size);
-static ssize_t asmfs_svc_close_disk(struct file *file, char *buf, size_t size);
-static ssize_t asmfs_svc_io32(struct file *file, char *buf, size_t size);
-#if BITS_PER_LONG == 64
-static ssize_t asmfs_svc_io64(struct file *file, char *buf, size_t size);
-#endif
-
-static struct transaction_context trans_contexts[] = {
-	[ASMOP_QUERY_VERSION]		= {asmfs_svc_query_version},
-	[ASMOP_GET_IID]			= {asmfs_svc_get_iid},
-	[ASMOP_CHECK_IID]		= {asmfs_svc_check_iid},
-	[ASMOP_QUERY_DISK]		= {asmfs_svc_query_disk},
-	[ASMOP_OPEN_DISK]		= {asmfs_svc_open_disk},
-	[ASMOP_CLOSE_DISK]		= {asmfs_svc_close_disk},
-	[ASMOP_IO32]			= {asmfs_svc_io32},
-#if BITS_PER_LONG == 64
-	[ASMOP_IO64]			= {asmfs_svc_io64},
-#endif
-};
-
-static struct backing_dev_info memory_backing_dev_info = {
-	.ra_pages	= 0,	/* No readahead */
-#ifdef BACKING_DEV_CAPABILITIES
-	.capabilities   = BDI_CAP_NO_ACCT_DIRTY | BDI_CAP_NO_WRITEBACK,
-#else
-	.memory_backed	= 1,	/* Does not contribute to dirty memory */
-#endif  /* OLD_BACKING_DEV */
-};
-
-
-static struct inode *asmdisk_alloc_inode(struct super_block *sb)
-{
-	struct asm_disk_info *d = kmem_cache_alloc(asmdisk_cachep, GFP_KERNEL);
-	if (!d)
-		return NULL;
-
-	mlog(ML_DISK, "Allocated disk 0x%p\n", d);
-	return &d->vfs_inode;
-}
-
-static void asmdisk_destroy_inode(struct inode *inode)
-{
-	struct asm_disk_info *d = ASMDISK_I(inode);
-
-	mlog_bug_on_msg(atomic_read(&d->d_ios),
-			"Disk 0x%p has outstanding I/Os\n", d);
-
-	mlog_bug_on_msg(!list_empty(&d->d_open),
-			"Disk 0x%p has openers\n", d);
-
-	mlog(ML_DISK, "Destroying disk 0x%p\n", d);
-
-	kmem_cache_free(asmdisk_cachep, d);
-}
-
-static void init_asmdisk_once(void *foo)
-{
-	struct asm_disk_info *d = foo;
-
-	memset(d, 0, sizeof(*d));
-	INIT_LIST_HEAD(&d->d_open);
-
-	inode_init_once(&d->vfs_inode);
-}
-#ifndef kapi_init_asmdisk_once
-# define kapi_init_asmdisk_once init_asmdisk_once
-#endif
-
-static void asmdisk_clear_inode(struct inode *inode)
-{
-	struct asm_disk_info *d = ASMDISK_I(inode);
-
-	mlog_entry("(0x%p)\n", inode);
-
-	mlog_bug_on_msg(atomic_read(&d->d_ios),
-			"Disk 0x%p has outstanding I/Os\n", d);
-
-	mlog_bug_on_msg(!list_empty(&d->d_open),
-			"Disk 0x%p has openers\n", d);
-
-	mlog_bug_on_msg(d->d_live,
-			"Disk 0x%p is live\n", d);
-
-	mlog(ML_DISK, "Clearing disk 0x%p\n", d);
-
-	if (d->d_bdev) {
-		mlog(ML_DISK,
-		     "Releasing disk 0x%p (bdev 0x%p, dev %X)\n",
-		     d, d->d_bdev, d->d_bdev->bd_dev);
-		bd_release(d->d_bdev);
-		blkdev_put(d->d_bdev);
-		d->d_bdev = NULL;
-	}
-
-	mlog_exit_void();
-}
-
-
-static struct super_operations asmdisk_sops = {
-	.statfs			= simple_statfs,
-	.alloc_inode		= asmdisk_alloc_inode,
-	.destroy_inode		= asmdisk_destroy_inode,
-	.drop_inode		= generic_delete_inode,
-	.clear_inode		= asmdisk_clear_inode,
-};
-
-#ifdef GET_SB_HAS_VFSMOUNT
-static int asmdisk_get_sb(struct file_system_type *fs_type, int flags,
-			  const char *dev_name, void *data,
-			  struct vfsmount *mnt)
-{
-	return get_sb_pseudo(fs_type, "asmdisk:",
-			     &asmdisk_sops, 0x61736D64, mnt);
-}
-#else
-static struct super_block *asmdisk_get_sb(struct file_system_type *fs_type,
-					  int flags,
-					  const char *dev_name,
-					  void *data)
-{
-	return get_sb_pseudo(fs_type, "asmdisk:",
-			     &asmdisk_sops, 0x61736D64);
-}
-#endif
-
-static struct file_system_type asmdisk_type = {
-	.name		= "asmdisk",
-	.get_sb		= asmdisk_get_sb,
-	.kill_sb	= kill_anon_super,
-};
-
-static struct vfsmount *asmdisk_mnt;
-
-static int __init init_asmdiskcache(void)
-{
-	int err;
-	asmdisk_cachep =
-		kapi_kmem_cache_create("asmdisk_cache",
-				       sizeof(struct asm_disk_info),
-				       0, SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT,
-				       kapi_init_asmdisk_once);
-	if (!asmdisk_cachep)
-		return -ENOMEM;
-	err = register_filesystem(&asmdisk_type);
-	if (err) {
-		kmem_cache_destroy(asmdisk_cachep);
-		return err;
-	}
-	asmdisk_mnt = kern_mount(&asmdisk_type);
-	if (IS_ERR(asmdisk_mnt)) {
-		err = PTR_ERR(asmdisk_mnt);
-		unregister_filesystem(&asmdisk_type);
-		kmem_cache_destroy(asmdisk_cachep);
-		return err;
-	}
-
-	return 0;
-}
-
-static void destroy_asmdiskcache(void)
-{
-	unregister_filesystem(&asmdisk_type);
-	mntput(asmdisk_mnt);
-	kmem_cache_destroy(asmdisk_cachep);
-}
-
-static int asmdisk_test(struct inode *inode, void *data)
-{
-	struct asmdisk_find_inode_args *args = data;
-	struct asm_disk_info *d = ASMDISK_I(inode);
-	unsigned long handle = (unsigned long)(d->d_bdev);
-
-	return (d->d_inode == args->fa_inode) && (handle == args->fa_handle);
-}
-
-static int asmdisk_set(struct inode *inode, void *data)
-{
-	struct asmdisk_find_inode_args *args = data;
-	struct asm_disk_info *d = ASMDISK_I(inode);
-
-	d->d_bdev = (struct block_device *)(args->fa_handle);
-	d->d_inode = args->fa_inode;
-
-	return 0;
-}
-
-
-
-/*
- * Resource limit helper functions
- */
-
-
-/* Decrements the free inode count and returns true, or returns false
- * if there are no free inodes */
-static struct inode *asmfs_alloc_inode(struct super_block *sb)
-{
-	struct asmfs_sb_info *asb = ASMFS_SB(sb);
-	struct asmfs_inode_info *aii;
-
-	aii = (struct asmfs_inode_info *)kmem_cache_alloc(asmfs_inode_cachep, GFP_KERNEL);
-
-	if (!aii)
-		return NULL;
-
-	spin_lock_irq(&asb->asmfs_lock);
-	if (!asb->max_inodes || asb->free_inodes > 0) {
-		asb->free_inodes--;
-		spin_unlock_irq(&asb->asmfs_lock);
-	} else {
-		spin_unlock_irq(&asb->asmfs_lock);
-		kmem_cache_free(asmfs_inode_cachep, aii);
-		return NULL;
-	}
-
-	return &aii->vfs_inode;
-}
-
-/* Increments the free inode count */
-static void asmfs_destroy_inode(struct inode *inode)
-{
-	spin_lock_irq(&ASMFS_SB(inode->i_sb)->asmfs_lock);
-	ASMFS_SB(inode->i_sb)->free_inodes++;
-	spin_unlock_irq(&ASMFS_SB(inode->i_sb)->asmfs_lock);
-
-	kmem_cache_free(asmfs_inode_cachep, ASMFS_I(inode));
-}
-
-static void instance_init_once(void *foo)
-{
-	struct asmfs_inode_info *aii = foo;
-
-	INIT_LIST_HEAD(&aii->i_disks);
-	INIT_LIST_HEAD(&aii->i_threads);
-	spin_lock_init(&aii->i_lock);
-
-	inode_init_once(&aii->vfs_inode);
-}
-#ifndef kapi_instance_init_once
-# define kapi_instance_init_once instance_init_once
-#endif
-
-static int init_inodecache(void)
-{
-	asmfs_inode_cachep =
-		kapi_kmem_cache_create("asmfs_inode_cache",
-				       sizeof(struct asmfs_inode_info),
-				       0, SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT,
-				       kapi_instance_init_once);
-
-	if (asmfs_inode_cachep == NULL)
-		return -ENOMEM;
-	return 0;
-}
-
-static void destroy_inodecache(void)
-{
-	kmem_cache_destroy(asmfs_inode_cachep);
-}
-
-static int init_requestcache(void)
-{
-	asm_request_cachep =
-		kapi_kmem_cache_create("asm_request",
-				       sizeof(struct asm_request),
-				       0, SLAB_HWCACHE_ALIGN, NULL);
-	if (asm_request_cachep == NULL)
-		return -ENOMEM;
-	return 0;
-}
-
-static void destroy_requestcache(void)
-{
-	kmem_cache_destroy(asm_request_cachep);
-}
-
-
-/*
- * Disk file creation in the disks directory.
- */
-static int asmfs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t dev)
-{
-	struct inode * inode;
-
-	if (!S_ISBLK(mode))
-		return -EINVAL;
-
-	inode = new_inode(dir->i_sb);
-	if (!inode)
-		return -ENOMEM;
-
-	inode->i_ino = (unsigned long)inode;
-	inode->i_mode = mode;
-	inode->i_uid = current->fsuid;
-	inode->i_gid = current->fsgid;
-	set_i_blksize(inode, PAGE_CACHE_SIZE);
-	inode->i_blocks = 0;
-	inode->i_rdev = 0;
-	inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
-	init_special_inode(inode, mode, dev);
-
-	d_instantiate(dentry, inode);
-
-	/* Extra count - pin the dentry in core */
-	dget(dentry);
-
-	return 0;
-}
-
-/*
- * Instance file creation in the iid directory.
- */
-static int asmfs_create(struct inode *dir, struct dentry *dentry, int mode, struct nameidata *nd)
-{
-	struct inode *inode;
-
-	if ((mode & S_IFMT) && !S_ISREG(mode))
-		return -EINVAL;
-
-	mode |= S_IFREG;
-
-	inode = new_inode(dir->i_sb);
-	if (!inode)
-		return -ENOMEM;
-
-	inode->i_ino = (unsigned long)inode;
-	inode->i_mode = mode;
-	inode->i_uid = current->fsuid;
-	inode->i_gid = current->fsgid;
-	set_i_blksize(inode, PAGE_CACHE_SIZE);
-	inode->i_blocks = 0;
-	inode->i_rdev = 0;
-	inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
-	inode->i_op = &asmfs_file_inode_operations;
-	inode->i_fop = &asmfs_file_operations;
-	inode->i_mapping->backing_dev_info = &memory_backing_dev_info;
-
-	d_instantiate(dentry, inode);
-
-	/* Extra count - pin the dentry in core */
-	dget(dentry);
-
-	return 0;
-}
-
-static void asmfs_put_super(struct super_block *sb)
-{
-	kfree(ASMFS_SB(sb));
-}
-
-enum {
-	OPT_MAX_INSTANCES,
-	OPT_ERR,
-};
-
-static match_table_t tokens = {
-	{OPT_MAX_INSTANCES, "maxinstances=%d"},
-	{OPT_ERR, NULL},
-};
-
-struct asmfs_params {
-	long inodes;
-};
-
-static int parse_options(char * options, struct asmfs_params *p)
-{
-	char *s;
-	substring_t args[MAX_OPT_ARGS];
-	int option;
-
-	p->inodes = -1;
-
-	while ((s = strsep(&options,",")) != NULL) {
-		int token;
-		if (!*s)
-			continue;
-		token = match_token(s, tokens, args);
-		switch (token) {
-			case OPT_MAX_INSTANCES:
-				if (match_int(&args[0], &option))
-					return -EINVAL;
-				p->inodes = option;
-				break;
-
-			default:
-				return -EINVAL;
-		}
-	}
-
-	return 0;
-}
-
-static void init_limits(struct asmfs_sb_info *asb, struct asmfs_params *p)
-{
-	struct sysinfo si;
-
-	si_meminfo(&si);
-
-	asb->max_inodes = 0;
-	if (p->inodes >= 0)
-		asb->max_inodes = p->inodes;
-
-	asb->free_inodes = asb->max_inodes;
-
-	return;
-}
-
-/* reset_limits is called during a remount to change the usage limits.
-
-   This will suceed, even if the new limits are lower than current
-   usage. This is the intended behaviour - new allocations will fail
-   until usage falls below the new limit */
-static void reset_limits(struct asmfs_sb_info *asb, struct asmfs_params *p)
-{
-	spin_lock_irq(&asb->asmfs_lock);
-
-	if (p->inodes >= 0) {
-		int used_inodes = asb->max_inodes - asb->free_inodes;
-
-		asb->max_inodes = p->inodes;
-		asb->free_inodes = asb->max_inodes - used_inodes;
-	}
-
-	spin_unlock_irq(&asb->asmfs_lock);
-}
-
-static int asmfs_remount(struct super_block * sb, int * flags, char * data)
-{
-	struct asmfs_params params;
-	struct asmfs_sb_info * asb = ASMFS_SB(sb);
-
-	if (parse_options((char *)data, &params) != 0)
-		return -EINVAL;
-
-	reset_limits(asb, &params);
-
-	printk(KERN_DEBUG
- 	       "ASM: oracleasmfs remounted with options: %s\n", 
-	       data ? (char *)data : "<defaults>" );
-	printk(KERN_DEBUG "ASM:	maxinstances=%ld\n",
-	       asb->max_inodes);
-
-	return 0;
-}
-
-/*
- * Compute the maximum number of sectors the bdev can handle in one bio,
- * as a power of two.
- */
-static int compute_max_sectors(struct block_device *bdev)
-{
-	int max_pages, max_sectors, pow_two_sectors;
-
-	struct request_queue *q;
-
-	q = bdev_get_queue(bdev);
-	max_pages = q->max_sectors >> (PAGE_SHIFT - 9);
-	if (max_pages > BIO_MAX_PAGES)
-		max_pages = BIO_MAX_PAGES;
-	if (max_pages > q->max_phys_segments)
-		max_pages = q->max_phys_segments;
-	if (max_pages > q->max_hw_segments)
-		max_pages = q->max_hw_segments;
-	max_pages--; /* Handle I/Os that straddle a page */
-
-	max_sectors = max_pages << (PAGE_SHIFT - 9);
-
-	/* Why is fls() 1-based???? */
-	pow_two_sectors = 1 << (fls(max_sectors) - 1);
-
-	return pow_two_sectors;
-}
-
-static int asm_open_disk(struct file *file, struct block_device *bdev)
-{
-	int ret;
-	struct asm_disk_info *d;
-	struct asm_disk_head *h;
-	struct inode *inode = ASMFS_F2I(file);
-	struct inode *disk_inode;
-	struct asmdisk_find_inode_args args;
-
-	mlog_entry("(0x%p, 0x%p)\n", file, bdev);
-
-	ret = blkdev_get(bdev, FMODE_WRITE | FMODE_READ, 0);
-	if (ret)
-		goto out;
-
-	ret = bd_claim(bdev, inode->i_sb);
-	if (ret)
-		goto out_get;
-
-	ret = set_blocksize(bdev, bdev_hardsect_size(bdev));
-	if (ret)
-		goto out_claim;
-
-	ret = -ENOMEM;
-	h = kmalloc(sizeof(struct asm_disk_head), GFP_KERNEL);
-	if (!h)
-		goto out_claim;
-
-	mlog(ML_DISK, "Looking up disk for bdev %p (dev %X)\n", bdev,
-	     bdev->bd_dev);
-
-	args.fa_handle = (unsigned long)bdev;
-	args.fa_inode = ASMFS_I(inode);
-	disk_inode = iget5_locked(asmdisk_mnt->mnt_sb,
-				  (unsigned long)bdev, asmdisk_test,
-				  asmdisk_set, &args);
-	if (!disk_inode)
-		goto out_head;
-
-	d = ASMDISK_I(disk_inode);
-
-	if (disk_inode->i_state & I_NEW) {
-		mlog_bug_on_msg(atomic_read(&d->d_ios) != 0,
-				"Supposedly new disk 0x%p (dev %X) has outstanding I/O\n",
-				d, bdev->bd_dev);
-		mlog_bug_on_msg(d->d_live,
-				"Supposedly new disk 0x%p (dev %X) is live\n",
-				d, bdev->bd_dev);
-
-		mlog_bug_on_msg(d->d_bdev != bdev,
-				"New disk 0x%p has set bdev 0x%p but we were opening 0x%p\n",
-				d, d->d_bdev, bdev);
-
-		disk_inode->i_mapping->backing_dev_info =
-			&memory_backing_dev_info;
-		d->d_max_sectors = compute_max_sectors(bdev);
-		d->d_live = 1;
-
-		mlog(ML_DISK,
-		     "First open of disk 0x%p (bdev 0x%p, dev %X)\n",
-		     d, d->d_bdev, d->d_bdev->bd_dev);
-		unlock_new_inode(disk_inode);
-	} else {
-		/* Already claimed on first open */
-		mlog(ML_DISK,
-		     "Open of disk 0x%p (bdev 0x%p, dev %X)\n",
-		     d, d->d_bdev, d->d_bdev->bd_dev);
-		bd_release(bdev);
-		blkdev_put(bdev);
-	}
-
-	h->h_disk = d;
-	h->h_file = ASMFS_FILE(file);
-
-	spin_lock_irq(&ASMFS_FILE(file)->f_lock);
-	list_add(&h->h_flist, &ASMFS_FILE(file)->f_disks);
-	spin_unlock_irq(&ASMFS_FILE(file)->f_lock);
-
-	spin_lock_irq(&ASMFS_I(inode)->i_lock);
-	list_add(&h->h_dlist, &d->d_open);
-	spin_unlock_irq(&ASMFS_I(inode)->i_lock);
-
-	mlog_exit(0);
-	return 0;
-
-out_head:
-	kfree(h);
-
-out_claim:
-	bd_release(bdev);
-
-out_get:
-	blkdev_put(bdev);
-
-out:
-	mlog_exit(ret);
-	return ret;
-}
-
-static int asm_close_disk(struct file *file, unsigned long handle)
-{
-	struct inode *inode = ASMFS_F2I(file);
-	struct asmdisk_find_inode_args args;
-	struct asm_disk_info *d;
-	struct block_device *bdev;
-	struct inode *disk_inode;
-	struct list_head *p;
-	struct asm_disk_head *h;
-	struct task_struct *tsk = current;
-	DECLARE_WAITQUEUE(wait, tsk);
-
-	mlog_entry("(0x%p, %lu)\n", file, handle);
-
-	mlog_bug_on_msg(!ASMFS_FILE(file) || !ASMFS_I(inode),
-			"Garbage arguments\n");
-
-	args.fa_handle = handle;
-	args.fa_inode = ASMFS_I(inode);
-	disk_inode = ilookup5(asmdisk_mnt->mnt_sb, handle,
-			      asmdisk_test, &args);
-	if (!disk_inode) {
-		mlog_exit(-EINVAL);
-		return -EINVAL;
-	}
-
-	d = ASMDISK_I(disk_inode);
-	bdev = d->d_bdev;
-
-	mlog(ML_DISK, "Closing disk 0x%p (bdev 0x%p, dev %X)\n",
-	     d, d->d_bdev, d->d_bdev->bd_dev);
-
-	/*
-	 * If an additional thread raced us to close the disk, it
-	 * will have removed the disk from the list already.
-	 */
-	
-	spin_lock_irq(&ASMFS_FILE(file)->f_lock);
-	h = NULL;
-	list_for_each(p, &ASMFS_FILE(file)->f_disks) {
-		h = list_entry(p, struct asm_disk_head, h_flist);
-		if (h->h_disk == d)
-			break;
-		h = NULL;
-	}
-	if (!h) {
-		spin_unlock_irq(&ASMFS_FILE(file)->f_lock);
-		iput(disk_inode);
-		mlog_exit(-EINVAL);
-		return -EINVAL;
-	}
-	list_del(&h->h_flist);
-	spin_unlock_irq(&ASMFS_FILE(file)->f_lock);
-
-	spin_lock_irq(&ASMFS_I(inode)->i_lock);
-	list_del(&h->h_dlist);
-
-	/* Last close */
-	if (list_empty(&d->d_open)) {
-		mlog(ML_DISK,
-		     "Last close of disk 0x%p (bdev 0x%p, dev %X)\n",
-		     d, d->d_bdev, d->d_bdev->bd_dev);
-
-		/* I/O path can't look up this disk anymore */
-		mlog_bug_on_msg(!d->d_live,
-				"Disk 0x%p (bdev 0x%p, dev %X) isn't live at last close\n",
-				d, d->d_bdev, d->d_bdev->bd_dev);
-		d->d_live = 0;
-		spin_unlock_irq(&ASMFS_I(inode)->i_lock);
-
-		/* No need for a fast path */
-		add_wait_queue(&ASMFS_FILE(file)->f_wait, &wait);
-		do {
-			set_task_state(tsk, TASK_UNINTERRUPTIBLE);
-
-			if (!atomic_read(&d->d_ios))
-				break;
-
-			blk_run_address_space(bdev->bd_inode->i_mapping);
-			/*
-			 * Timeout of one second.  This is slightly
-			 * subtle.  In this wait, and *only* this wait,
-			 * we are waiting on I/Os that might have been
-			 * initiated by another process.  In that case,
-			 * the other process's afi will be signaled,
-			 * not ours, so the wake_up() never happens
-			 * here and we need the timeout.
-			 */
-#if 0  /* Damn you, kernel */
-			io_schedule_timeout(HZ);
-#else
-			schedule_timeout(HZ);
-#endif
-		} while (1);
-		set_task_state(tsk, TASK_RUNNING);
-		remove_wait_queue(&ASMFS_FILE(file)->f_wait, &wait);
-	}
-	else
-		spin_unlock_irq(&ASMFS_I(inode)->i_lock);
-
-	kfree(h);
-
-	/* Drop the ref from ilookup5() */
-	iput(disk_inode);
-
-	/* Real put */
-	iput(disk_inode);
-
-	mlog_exit(0);
-	return 0;
-}  /* asm_close_disk() */
-
-
-/* Timeout stuff ripped from aio.c - thanks Ben */
-struct timeout {
-	struct timer_list	timer;
-	int			timed_out;
-	wait_queue_head_t	wait;
-};
-
-static void timeout_func(unsigned long data)
-{
-	struct timeout *to = (struct timeout *)data;
-
-	to->timed_out = 1;
-	wake_up(&to->wait);
-}
-
-static inline void init_timeout(struct timeout *to)
-{
-	init_timer(&to->timer);
-	to->timer.data = (unsigned long)to;
-	to->timer.function = timeout_func;
-	to->timed_out = 0;
-	init_waitqueue_head(&to->wait);
-}
-
-static inline void set_timeout(struct timeout *to, const struct timespec *ts)
-{
-	unsigned long how_long;
-
-	if (!ts->tv_sec && !ts->tv_nsec) {
-		to->timed_out = 1;
-		return;
-	}
-
-	how_long = ts->tv_sec * HZ;
-#define HZ_NS (1000000000 / HZ)
-	how_long += (ts->tv_nsec + HZ_NS - 1) / HZ_NS;
-	
-	to->timer.expires = jiffies + how_long;
-	add_timer(&to->timer);
-}
-
-static inline void clear_timeout(struct timeout *to)
-{
-	del_timer_sync(&to->timer);
-}
-
-/* Must be called with asm_file_info->f_lock held */
-static struct block_device *find_io_bdev(struct file *file)
-{
-	struct asmfs_file_info *afi = ASMFS_FILE(file);
-	struct asm_request *r;
-	struct asm_disk_info *d;
-	struct block_device *bdev = NULL;
-
-	list_for_each_entry(r, &afi->f_ios, r_list) {
-		d = r->r_disk;
-		if (d && d->d_bdev) {
-			bdev = d->d_bdev;
-			break;
-		}
-	}
-
-	return bdev;
-}
-
-static int asm_update_user_ioc(struct file *file, struct asm_request *r)
-{
-	int ret = 0;
-	struct asm_request copy;
-	asm_ioc __user *ioc;
-	u16 tmp_status;
-	unsigned long flags;
-
-	mlog_entry("(0x%p)\n", r);
-
-	ioc = r->r_ioc;
-	mlog(ML_IOC, "User IOC is 0x%p\n", ioc);
-
-	/* Need to get the current userspace bits because ASM_CANCELLED is currently set there */
-	mlog(ML_IOC, "Getting tmp_status\n");
-	if (get_user(tmp_status, &(ioc->status_asm_ioc))) {
-		ret = -EFAULT;
-		goto out;
-	}
-
-	/*
-	 * We're going to store off a copy of the request so we can
-	 * provide a consistent view to userspace.
-	 *
-	 * And so we can get/put_user() without locking :-)
-	 */
-	spin_lock_irqsave(&ASMFS_FILE(file)->f_lock, flags);
-	r->r_status |= tmp_status;
-	copy = *r;
-	spin_unlock_irqrestore(&ASMFS_FILE(file)->f_lock, flags);
-
-	/* From here on, ONLY TRUST copy */
-
-	mlog(ML_IOC, "Putting r_status (0x%08X)\n", copy.r_status);
-	if (put_user(copy.r_status, &(ioc->status_asm_ioc))) {
-		ret = -EFAULT;
-		goto out;
-	}
-	if (copy.r_status & ASM_ERROR) {
-		mlog(ML_IOC, "Putting r_error (0x%08X)\n", copy.r_error);
-		if (put_user(copy.r_error, &(ioc->error_asm_ioc))) {
-			ret = -EFAULT;
-			goto out;
-		}
-	}
-	if (copy.r_status & ASM_COMPLETED) {
-		if (put_user(copy.r_elapsed, &(ioc->elaptime_asm_ioc))) {
-			ret = -EFAULT;
-			goto out;
-		}
-	}
-	mlog(ML_IOC,
-	     "r_status:0x%08X, bitmask:0x%08X, combined:0x%08X\n",
-	     copy.r_status,
-	     (ASM_SUBMITTED | ASM_COMPLETED | ASM_ERROR),
-	     (copy.r_status & (ASM_SUBMITTED | ASM_COMPLETED | ASM_ERROR)));
-	if (copy.r_status & ASM_FREE) {
-		u64 z = 0ULL;
-		if (copy_to_user(&(ioc->reserved_asm_ioc),
-				 &z, sizeof(ioc->reserved_asm_ioc))) {
-			ret = -EFAULT;
-			goto out;
-		}
-	} else if (copy.r_status &
-		   (ASM_SUBMITTED | ASM_ERROR)) {
-		u64 key = (u64)(unsigned long)r;
-		mlog(ML_IOC, "Putting key 0x%p on asm_ioc 0x%p\n",
-		     r, ioc);
-		/* Only on first submit */
-		if (copy_to_user(&(ioc->reserved_asm_ioc),
-				 &key, sizeof(ioc->reserved_asm_ioc))) {
-			ret = -EFAULT;
-			goto out;
-		}
-	}
-
-out:
-	mlog_exit(ret);
-	return ret;
-}  /* asm_update_user_ioc() */
-
-
-static struct asm_request *asm_request_alloc(void)
-{
-	struct asm_request *r;
-
-	r = kmem_cache_alloc(asm_request_cachep, GFP_KERNEL);
-	
-	if (r) {
-		r->r_status = ASM_SUBMITTED;
-		r->r_error = 0;
-		r->r_bio = NULL;
-		r->r_elapsed = 0;
-		r->r_disk = NULL;
-	}
-
-	return r;
-}  /* asm_request_alloc() */
-
-
-static void asm_request_free(struct asm_request *r)
-{
-	/* FIXME: Clean up bh and buffer stuff */
-
-	kmem_cache_free(asm_request_cachep, r);
-}  /* asm_request_free() */
-
-
-static void asm_finish_io(struct asm_request *r)
-{
-	struct asm_disk_info *d;
-	struct asmfs_file_info *afi = r->r_file;
-	unsigned long flags;
-
-	mlog_bug_on_msg(!afi, "Request 0x%p has no file pointer\n", r);
-
-	mlog_entry("(0x%p)\n", r);
-
-	spin_lock_irqsave(&afi->f_lock, flags);
-
-	if (r->r_bio) {
-		mlog(ML_REQUEST|ML_BIO,
-		     "Moving bio 0x%p from request 0x%p to the free list\n",
-		     r->r_bio, r);
-		r->r_bio->bi_private = afi->f_bio_free;
-		afi->f_bio_free = r->r_bio;
-		r->r_bio = NULL;
-	}
-
- 	d = r->r_disk;
-	r->r_disk = NULL;
-
-	list_del(&r->r_list);
-	list_add(&r->r_list, &afi->f_complete);
-	if (r->r_error)
-		r->r_status |= ASM_ERROR;
-	r->r_status |= ASM_COMPLETED;
-
-	spin_unlock_irqrestore(&afi->f_lock, flags);
-
-	if (d) {
-		atomic_dec(&d->d_ios);
-		if (atomic_read(&d->d_ios) < 0) {
-			mlog(ML_ERROR,
-			     "d_ios underflow on disk 0x%p (dev %X)\n",
-			     d, d->d_bdev->bd_dev);
-			atomic_set(&d->d_ios, 0);
-		}
-	}
-
-	r->r_elapsed = ((jiffies - r->r_elapsed) * 1000000) / HZ;
-
-	mlog(ML_REQUEST, "Finished request 0x%p\n", r);
-
-	wake_up(&afi->f_wait);
-
-	mlog_exit_void();
-}  /* asm_finish_io() */
-
-
-static void asm_end_ioc(struct asm_request *r, unsigned int bytes_done,
-			int error)
-{
-	mlog_entry("(0x%p, %u, %d)\n", r, bytes_done, error);
-
-	mlog_bug_on_msg(!r, "No request\n");
-
-	mlog_bug_on_msg(!(r->r_status & ASM_SUBMITTED),
-			"Request 0x%p wasn't submitted\n", r);
-
-	mlog(ML_REQUEST,
-	     "Ending request 0x%p, bytes_done = %u, error = %d\n",
-	     r, bytes_done, error);
-	mlog(ML_REQUEST|ML_BIO,
-	     "Ending request 0x%p, bio 0x%p, len = %u\n",
-	     r, r->r_bio,
-	     bytes_done + (r->r_bio ? r->r_bio->bi_size : 0));
-
-	switch (error) {
-		default:
-			mlog(ML_REQUEST|ML_ERROR,
-			     "Invalid error of %d on request 0x%p!\n",
-			     error, r);
-			r->r_error = ASM_ERR_INVAL;
-			r->r_status |= ASM_LOCAL_ERROR;
-			break;
-
-		case 0:
-			break;
-
-		case -EFAULT:
-			r->r_error = ASM_ERR_FAULT;
-			r->r_status |= ASM_LOCAL_ERROR;
-			break;
-
-		case -EIO:
-			r->r_error = ASM_ERR_IO;
-			break;
-
-		case -ENODEV:
-			r->r_error = ASM_ERR_NODEV;
-			r->r_status |= ASM_LOCAL_ERROR;
-			break;
-
-		case -ENOMEM:
-			r->r_error = ASM_ERR_NOMEM;
-			r->r_status |= ASM_LOCAL_ERROR;
-			break;
-
-		case -EINVAL:
-			r->r_error = ASM_ERR_INVAL;
-			r->r_status |= ASM_LOCAL_ERROR;
-			break;
-	}
-
-	asm_finish_io(r);
-
-	mlog_exit_void();
-}  /* asm_end_ioc() */
-
-
-static void asm_end_bio_io(struct bio *bio, int error)
-{
-	struct asm_request *r;
-
-	mlog_entry("(0x%p, %d)\n", bio, error);
-
-	mlog(ML_BIO, "bio 0x%p, bi_size is %u\n", bio, bio->bi_size);
-
-	r = bio->bi_private;
-
-	mlog(ML_REQUEST|ML_BIO,
-	     "Completed bio 0x%p for request 0x%p\n", bio, r);
-	if (atomic_dec_and_test(&r->r_bio_count)) {
-		asm_end_ioc(r, r->r_count - (r->r_bio ?
-					     r->r_bio->bi_size : 0),
-			    error);
-	}
-
-	mlog_exit_void();
-}  /* asm_end_bio_io() */
-#ifndef kapi_asm_end_bio_io
-# define kapi_asm_end_bio_io asm_end_bio_io
-#endif
-
-
-static int asm_submit_io(struct file *file,
-			 asm_ioc __user *user_iocp,
-			 asm_ioc *ioc)
-{
-	int ret, rw = READ;
-	struct inode *inode = ASMFS_F2I(file);
-	struct asmdisk_find_inode_args args;
-	struct asm_request *r;
-	struct asm_disk_info *d;
-	struct inode *disk_inode;
-	struct block_device *bdev;
-
-	mlog_entry("(0x%p, 0x%p, 0x%p)\n", file, user_iocp, ioc);
-
-	if (!ioc) {
-		mlog_exit(-EINVAL);
-		return -EINVAL;
-	}
-
-	if (ioc->status_asm_ioc) {
-		mlog_exit(-EINVAL);
-		return -EINVAL;
-	}
-
-	r = asm_request_alloc();
-	if (!r) {
-		u16 status = ASM_FREE | ASM_ERROR | ASM_LOCAL_ERROR |
-			ASM_BUSY;
-		if (put_user(status, &(user_iocp->status_asm_ioc))) {
-			mlog_exit(-EFAULT);
-			return -EFAULT;
-		}
-		if (put_user(ASM_ERR_NOMEM, &(user_iocp->error_asm_ioc))) {
-			mlog_exit(-EFAULT);
-			return -EFAULT;
-		}
-
-		mlog_exit(0);
-		return 0;
-	}
-
-	mlog(ML_REQUEST,
-	     "New request at 0x%p alloc()ed for user ioc at 0x%p\n",
-	     r, user_iocp);
-
-	r->r_file = ASMFS_FILE(file);
-	r->r_ioc = user_iocp;  /* Userspace asm_ioc */
-
-	spin_lock_irq(&ASMFS_FILE(file)->f_lock);
-	list_add(&r->r_list, &ASMFS_FILE(file)->f_ios);
-	spin_unlock_irq(&ASMFS_FILE(file)->f_lock);
-
-	ret = -ENODEV;
-	args.fa_handle = (unsigned long)ioc->disk_asm_ioc;
-	args.fa_inode = ASMFS_I(inode);
-	disk_inode = ilookup5(asmdisk_mnt->mnt_sb,
-			      (unsigned long)ioc->disk_asm_ioc,
-			      asmdisk_test, &args);
-	if (!disk_inode)
-		goto out_error;
-
-	spin_lock_irq(&ASMFS_I(inode)->i_lock);
-
-	d = ASMDISK_I(disk_inode);
-	if (!d->d_live) {
-		/* It's in the middle of closing */
-		spin_unlock_irq(&ASMFS_I(inode)->i_lock);
-		iput(disk_inode);
-		goto out_error;
-	}
-
-	atomic_inc(&d->d_ios);
-	r->r_disk = d;
-
-	spin_unlock_irq(&ASMFS_I(inode)->i_lock);
-	iput(disk_inode);
-
-	bdev = d->d_bdev;
-
-	r->r_count = ioc->rcount_asm_ioc * bdev_hardsect_size(bdev);
-
-	/* linux only supports unsigned long size sector numbers */
-	mlog(ML_IOC,
-	     "user_iocp 0x%p: first = 0x%llX, masked = 0x%08lX status = %u, buffer_asm_ioc = 0x%08lX, count = %lu\n",
-	     user_iocp,
-	     (unsigned long long)ioc->first_asm_ioc,
-	     (unsigned long)ioc->first_asm_ioc,
-	     ioc->status_asm_ioc,
-	     (unsigned long)ioc->buffer_asm_ioc,
-	     (unsigned long)r->r_count);
-	/* Note that priority is ignored for now */
-	ret = -EINVAL;
-	if (!ioc->buffer_asm_ioc ||
-	    (ioc->buffer_asm_ioc != (unsigned long)ioc->buffer_asm_ioc) ||
-	    (ioc->first_asm_ioc != (unsigned long)ioc->first_asm_ioc) ||
-	    (ioc->rcount_asm_ioc != (unsigned long)ioc->rcount_asm_ioc) ||
-	    (ioc->priority_asm_ioc > 7) ||
-	    (r->r_count > (bdev_get_queue(bdev)->max_sectors << 9)) ||
-	    (r->r_count < 0))
-		goto out_error;
-
-	/* Test device size, when known. (massaged from ll_rw_blk.c) */
-	if (bdev->bd_inode->i_size >> 9) {
-		sector_t maxsector = bdev->bd_inode->i_size >> 9;
-		sector_t sector = (sector_t)ioc->first_asm_ioc;
-		sector_t blks = (sector_t)ioc->rcount_asm_ioc;
-
-		if (maxsector < blks || maxsector - blks < sector) {
-			char b[BDEVNAME_SIZE];
-			mlog(ML_NOTICE|ML_IOC,
-			     "Attempt to access beyond end of device\n");
-			mlog(ML_NOTICE|ML_IOC,
-			     "dev %s: want=%llu, limit=%llu\n",
-			     bdevname(bdev, b),
-			     (unsigned long long)(sector + blks),
-			     (unsigned long long)maxsector);
-			goto out_error;
-		}
-	}
-
-
-	mlog(ML_REQUEST|ML_IOC,
-	     "Request 0x%p (user_ioc 0x%p) passed validation checks\n",
-	     r, user_iocp);
-
-	switch (ioc->operation_asm_ioc) {
-		default:
-			goto out_error;
-			break;
-
-		case ASM_READ:
-			rw = READ;
-			break;
-
-		case ASM_WRITE:
-			rw = WRITE;
-			break;
-
-		case ASM_NOOP:
-			/* Trigger an errorless completion */
-			r->r_count = 0;
-			break;
-	}
-	
-	/* Not really an error, but hey, it's an end_io call */
-	ret = 0;
-	if (r->r_count == 0)
-		goto out_error;
-
-	ret = -ENOMEM;
-	r->r_bio = bio_map_user(bdev_get_queue(bdev), bdev,
-				(unsigned long)ioc->buffer_asm_ioc,
-				r->r_count, rw == READ);
-	if (IS_ERR(r->r_bio)) {
-		ret = PTR_ERR(r->r_bio);
-		r->r_bio = NULL;
-		goto out_error;
-	}
-	mlog(ML_BIO, "Mapped bio 0x%p to request 0x%p\n", r->r_bio, r);
-
-	r->r_bio->bi_sector =
-		ioc->first_asm_ioc * (bdev_hardsect_size(bdev) >> 9);
-
-	/*
-	 * If the bio is a bounced bio, we have to put the
-	 * end_io on the child "real" bio
-	 */
-	r->r_bio->bi_end_io = kapi_asm_end_bio_io;
-	r->r_bio->bi_private = r;
-
-	r->r_elapsed = jiffies;  /* Set start time */
-
-	atomic_set(&r->r_bio_count, 1);
-
-	mlog(ML_REQUEST|ML_BIO,
-	     "Submitting bio 0x%p for request 0x%p\n", r->r_bio, r);
-	submit_bio(rw, r->r_bio);
-
-out:
-	ret = asm_update_user_ioc(file, r);
-
-	mlog_exit(ret);
-	return ret;
-
-out_error:
-	mlog(ML_REQUEST, "Submit-side error %d for request 0x%p\n",
-	     ret,  r);
-	asm_end_ioc(r, 0, ret);
-	goto out;
-}  /* asm_submit_io() */
-
-
-static int asm_maybe_wait_io(struct file *file,
-			     asm_ioc *iocp,
-			     struct timeout *to)
-{
-	long ret;
-	u64 p;
-	struct asmfs_file_info *afi = ASMFS_FILE(file);
-	struct asmdisk_find_inode_args args;
-	struct asm_request *r;
-	struct task_struct *tsk = current;
-	DECLARE_WAITQUEUE(wait, tsk);
-	DECLARE_WAITQUEUE(to_wait, tsk);
-
-	mlog_entry("(0x%p, 0x%p, 0x%p)\n", file, iocp, to);
-	
-	if (copy_from_user(&p, &(iocp->reserved_asm_ioc),
-			   sizeof(p))) {
-		ret = -EFAULT;
-		goto out;
-	}
-
-	mlog(ML_REQUEST|ML_IOC, "User asm_ioc 0x%p has key 0x%p\n",
-	     iocp, (struct asm_request *)(unsigned long)p);
-	r = (struct asm_request *)(unsigned long)p;
-	if (!r) {
-		ret = -EINVAL;
-		goto out;
-	}
-
-	spin_lock_irq(&afi->f_lock);
-	/* Is it valid? It's surely ugly */
-	if (!r->r_file || (r->r_file != afi) ||
-	    list_empty(&r->r_list) || !(r->r_status & ASM_SUBMITTED)) {
-		spin_unlock_irq(&afi->f_lock);
-		ret = -EINVAL;
-		goto out;
-	}
-
-	mlog(ML_REQUEST|ML_IOC,
-	     "asm_request 0x%p is valid...we think\n", r);
-	if (!(r->r_status & (ASM_COMPLETED |
-			     ASM_BUSY | ASM_ERROR))) {
-		spin_unlock_irq(&afi->f_lock);
-		add_wait_queue(&afi->f_wait, &wait);
-		add_wait_queue(&to->wait, &to_wait);
-		do {
-			struct asm_disk_info *d;
-			struct block_device *bdev = NULL;
-			struct inode *disk_inode;
-
-			ret = 0;
-			set_task_state(tsk, TASK_INTERRUPTIBLE);
-
-			spin_lock_irq(&afi->f_lock);
-			if (r->r_status & (ASM_COMPLETED |
-					   ASM_BUSY | ASM_ERROR))
-				break;
-			d = r->r_disk;
-			if (d && d->d_bdev)
-				bdev = d->d_bdev;
-			spin_unlock_irq(&afi->f_lock);
-
-			args.fa_handle = (unsigned long)bdev;
-			args.fa_inode = ASMFS_I(ASMFS_F2I(file));
-			disk_inode = ilookup5(asmdisk_mnt->mnt_sb,
-					      (unsigned long)bdev,
-					      asmdisk_test, &args);
-			if (disk_inode) {
-				d = ASMDISK_I(disk_inode);
-				if (d->d_bdev)
-					blk_run_address_space(d->d_bdev->bd_inode->i_mapping);
-				iput(&d->vfs_inode);
-			}
-
-			ret = -ETIMEDOUT;
-			if (to->timed_out)
-				break;
-			io_schedule();
-			if (signal_pending(tsk)) {
-				mlog(ML_REQUEST,
-				     "Signal pending waiting for request 0x%p\n",
-				     r);
-				ret = -EINTR;
-				break;
-			}
-		} while (1);
-		set_task_state(tsk, TASK_RUNNING);
-		remove_wait_queue(&afi->f_wait, &wait);
-		remove_wait_queue(&to->wait, &to_wait);
-		
-		if (ret)
-			goto out;
-	}
-
-	ret = 0;
-
-	/* Somebody got here first */
-	/*
-	 * FIXME: This race means that we cannot be shared by two
-	 * threads/processes (this struct file).  If everyone does
-	 * their own open and gets their own struct file, this never
-	 * happens and we're safe.
-	 */
-	if (r->r_status & ASM_FREE)
-		goto out;  /* FIXME: Eek, holding lock */
-	mlog_bug_on_msg(list_empty(&afi->f_complete),
-			"Completion list is empty\n");
-
-	mlog(ML_REQUEST|ML_IOC,
-	     "Removing request 0x%p for asm_ioc 0x%p\n", r, iocp);
-	list_del_init(&r->r_list);
-	r->r_file = NULL;
-	r->r_status |= ASM_FREE;
-
-	spin_unlock_irq(&afi->f_lock);
-
-	ret = asm_update_user_ioc(file, r);
-
-	mlog(ML_REQUEST, "Freeing request 0x%p\n", r);
-	asm_request_free(r);
-
-out:
-	mlog_exit(ret);
-	return ret;
-}  /* asm_maybe_wait_io() */
-
-
-static int asm_complete_io(struct file *file,
-			   asm_ioc **ioc)
-{
-	int ret = 0;
-	struct list_head *l;
-	struct asm_request *r;
-	struct asmfs_file_info *afi = ASMFS_FILE(file);
-
-	mlog_entry("(0x%p, 0x%p)\n", file, ioc);
-
-	spin_lock_irq(&afi->f_lock);
-
-	if (list_empty(&afi->f_complete)) {
-		spin_unlock_irq(&afi->f_lock);
-		*ioc = NULL;
-		mlog_exit(0);
-		return 0;
-	}
-
-	l = afi->f_complete.prev;
-	r = list_entry(l, struct asm_request, r_list);
-	list_del_init(&r->r_list);
-	r->r_file = NULL;
-	r->r_status |= ASM_FREE;
-
-	spin_unlock_irq(&afi->f_lock);
-
-	*ioc = r->r_ioc;
-	
-	ret = asm_update_user_ioc(file, r);
-
-	asm_request_free(r);
-
-	mlog_exit(ret);
-	return ret;
-}  /* asm_complete_io() */
-
-
-static int asm_wait_completion(struct file *file,
-			       struct oracleasm_io_v2 *io,
-			       struct timeout *to,
-			       u32 *status)
-{
-	int ret;
-	struct asmfs_file_info *afi = ASMFS_FILE(file);
-	struct task_struct *tsk = current;
-	DECLARE_WAITQUEUE(wait, tsk);
-	DECLARE_WAITQUEUE(to_wait, tsk);
-
-	mlog_entry("(0x%p, 0x%p, 0x%p, 0x%p)\n", file, io, to, status);
-
-	/* Early check - expensive stuff follows */
-	ret = -ETIMEDOUT;
-	if (to->timed_out)
-		goto out;
-
-	spin_lock_irq(&afi->f_lock);
-	if (list_empty(&afi->f_ios) &&
-	    list_empty(&afi->f_complete)) {
-		/* No I/Os left */
-		spin_unlock_irq(&afi->f_lock);
-		ret = 0;
-		*status |= ASM_IO_IDLE;
-		goto out;
-	}
-	spin_unlock_irq(&afi->f_lock);
-
-	add_wait_queue(&afi->f_wait, &wait);
-	add_wait_queue(&to->wait, &to_wait);
-	do {
-		struct block_device *bdev;
-		struct asm_disk_info *d;
-		struct inode *disk_inode;
-		struct asmdisk_find_inode_args args;
-
-		ret = 0;
-		set_task_state(tsk, TASK_INTERRUPTIBLE);
-
-		spin_lock_irq(&afi->f_lock);
-		if (!list_empty(&afi->f_complete)) {
-			spin_unlock_irq(&afi->f_lock);
-			break;
-		}
-
-		bdev = find_io_bdev(file);
-		spin_unlock_irq(&afi->f_lock);
-
-		args.fa_handle = (unsigned long)bdev;
-		args.fa_inode = ASMFS_I(ASMFS_F2I(file));
-		disk_inode = ilookup5(asmdisk_mnt->mnt_sb,
-				      (unsigned long)bdev,
-				      asmdisk_test, &args);
-		if (disk_inode) {
-			d = ASMDISK_I(disk_inode);
-			if (d->d_bdev)
-				blk_run_address_space(d->d_bdev->bd_inode->i_mapping);
-			iput(&d->vfs_inode);
-		}
-
-		ret = -ETIMEDOUT;
-		if (to->timed_out)
-			break;
-		io_schedule();
-		if (signal_pending(tsk)) {
-			ret = -EINTR;
-			break;
-		}
-	} while (1);
-	set_task_state(tsk, TASK_RUNNING);
-	remove_wait_queue(&afi->f_wait, &wait);
-	remove_wait_queue(&to->wait, &to_wait);
-
-out:
-	mlog_exit(ret);
-	return ret;
-}  /* asm_wait_completion() */
-
-
-static inline int asm_submit_io_native(struct file *file,
-       				       struct oracleasm_io_v2 *io)
-{
-	int ret = 0;
-	u32 i;
-	asm_ioc *iocp;
-	asm_ioc tmp;
-
-	mlog_entry("(0x%p, 0x%p)\n", file, io);
-	
-	for (i = 0; i < io->io_reqlen; i++) {
-		ret = -EFAULT;
-		if (get_user(iocp,
-			     ((asm_ioc **)((unsigned long)(io->io_requests))) + i))
-			break;
-
-		if (copy_from_user(&tmp, iocp, sizeof(tmp)))
-			break;
-
-		mlog(ML_IOC, "Submitting user asm_ioc 0x%p\n", iocp);
-		ret = asm_submit_io(file, iocp, &tmp);
-		if (ret)
-			break;
-	}
-
-	mlog_exit(ret);
-	return ret;
-}  /* asm_submit_io_native() */
-
-
-static inline int asm_maybe_wait_io_native(struct file *file,
-					   struct oracleasm_io_v2 *io,
-					   struct timeout *to)
-{
-	int ret = 0;
-	u32 i;
-	asm_ioc *iocp;
-
-	mlog_entry("(0x%p, 0x%p, 0x%p)\n", file, io, to);
-	
-	for (i = 0; i < io->io_waitlen; i++) {
-		if (get_user(iocp,
-			     ((asm_ioc **)((unsigned long)(io->io_waitreqs))) + i)) {
-			ret = -EFAULT;
-			break;
-		}
-
-		ret = asm_maybe_wait_io(file, iocp, to);
-		if (ret)
-			break;
-	}
-
-	mlog_exit(ret);
-	return ret;
-}  /* asm_maybe_wait_io_native() */
-
-
-static inline int asm_complete_ios_native(struct file *file,
-					  struct oracleasm_io_v2 *io,
-					  struct timeout *to,
-					  u32 *status)
-{
-	int ret = 0;
-	u32 i;
-	asm_ioc *iocp;
-
-	mlog_entry("(0x%p, 0x%p, 0x%p, 0x%p)\n", file, io, to, status);
-
-	for (i = 0; i < io->io_complen; i++) {
-		ret = asm_complete_io(file, &iocp);
-		if (ret)
-			break;
-		if (iocp) {
-			ret = put_user(iocp,
-				       ((asm_ioc **)((unsigned long)(io->io_completions))) + i);
-			       if (ret)
-				   break;
-			continue;
-		}
-
-		/* We had waiters that are full */
-		if (*status & ASM_IO_WAITED)
-			break;
-
-		ret = asm_wait_completion(file, io, to, status);
-		if (ret)
-			break;
-		if (*status & ASM_IO_IDLE)
-			break;
-
-		i--; /* Reset this completion */
-
-	}
-
-	mlog_exit(ret ? ret : i);
-	return (ret ? ret : i);
-}  /* asm_complete_ios_native() */
-
-
-#if BITS_PER_LONG == 64
-static inline void asm_promote_64(asm_ioc64 *ioc)
-{
-	asm_ioc32 *ioc_32 = (asm_ioc32 *)ioc;
-
-	mlog_entry("(0x%p)\n", ioc);
-
-	/*
-	 * Promote the 32bit pointers at the end of the asm_ioc32
-	 * into the asm_ioc64.
-	 *
-	 * Promotion must be done from the tail backwards.
-	 */
-	mlog(ML_IOC, "Promoting (0x%X, 0x%X)\n",
-	     ioc_32->check_asm_ioc,
-	     ioc_32->buffer_asm_ioc);
-	ioc->check_asm_ioc = (u64)ioc_32->check_asm_ioc;
-	ioc->buffer_asm_ioc = (u64)ioc_32->buffer_asm_ioc;
-	mlog(ML_IOC, "Promoted to (0x%"MLFu64", 0x%"MLFu64")\n",
-	     ioc->check_asm_ioc,
-	     ioc->buffer_asm_ioc);
-
-	mlog_exit_void();
-}  /* asm_promote_64() */
-
-
-static inline int asm_submit_io_thunk(struct file *file,
-	       			      struct oracleasm_io_v2 *io)
-{
-	int ret = 0;
-	u32 i;
-	u32 iocp_32;
-	asm_ioc32 *iocp;
-	asm_ioc tmp;
-
-	mlog_entry("(0x%p, 0x%p)\n", file, io);
-
-	for (i = 0; i < io->io_reqlen; i++) {
-		ret = -EFAULT;
-		/*
-		 * io->io_requests is an asm_ioc32**, but the pointers
-		 * are 32bit pointers.
-		 */
-		if (get_user(iocp_32,
-			     ((u32 *)((unsigned long)(io->io_requests))) + i))
-			break;
-
-		iocp = (asm_ioc32 *)(unsigned long)iocp_32;
-
-		if (copy_from_user(&tmp, iocp, sizeof(*iocp)))
-			break;
-
-		asm_promote_64(&tmp);
-
-		mlog(ML_IOC, "Submitting user asm_ioc 0x%p\n", iocp);
-		ret = asm_submit_io(file, (asm_ioc *)iocp, &tmp);
-		if (ret)
-			break;
-	}
-
-	mlog_exit(ret);
-	return ret;
-}  /* asm_submit_io_thunk() */
-
-
-static inline int asm_maybe_wait_io_thunk(struct file *file,
-					  struct oracleasm_io_v2 *io,
-					  struct timeout *to)
-{
-	int ret = 0;
-	u32 i;
-	u32 iocp_32;
-	asm_ioc *iocp;
-
-	mlog_entry("(0x%p, 0x%p, 0x%p)\n", file, io, to);
-
-	for (i = 0; i < io->io_waitlen; i++) {
-		/*
-		 * io->io_waitreqs is an asm_ioc32**, but the pointers
-		 * are 32bit pointers.
-		 */
-		if (get_user(iocp_32,
-			     ((u32 *)((unsigned long)(io->io_waitreqs))) + i)) {
-			ret = -EFAULT;
-			break;
-		}
-
-		/* Remember, the this is pointing to 32bit userspace */
-		iocp = (asm_ioc *)(unsigned long)iocp_32;
-
-		ret = asm_maybe_wait_io(file, iocp, to);
-		if (ret)
-			break;
-	}
-
-	mlog_exit(ret);
-	return ret;
-}  /* asm_maybe_wait_io_thunk() */
-
-
-static inline int asm_complete_ios_thunk(struct file *file,
-					 struct oracleasm_io_v2 *io,
-					 struct timeout *to,
-					 u32 *status)
-{
-	int ret = 0;
-	u32 i;
-	u32 iocp_32;
-	asm_ioc *iocp;
-
-	mlog_entry("(0x%p, 0x%p, 0x%p, 0x%p)\n", file, io, to, status);
-
-	for (i = 0; i < io->io_complen; i++) {
-		ret = asm_complete_io(file, &iocp);
-		if (ret)
-			break;
-		if (iocp) {
-			iocp_32 = (u32)(unsigned long)iocp;
-
-			ret = put_user(iocp_32,
-				       ((u32 *)((unsigned long)(io->io_completions))) + i);
-			       if (ret)
-				   break;
-			continue;
-		}
-
-		/* We had waiters that are full */
-		if (*status & ASM_IO_WAITED)
-			break;
-
-		ret = asm_wait_completion(file, io, to, status);
-		if (ret)
-			break;
-		if (*status & ASM_IO_IDLE)
-			break;
-
-		i--; /* Reset this completion */
-	}
-
-	mlog_exit(ret ? ret : i);
-	return (ret ? ret : i);
-}  /* asm_complete_ios_thunk() */
-
-#endif  /* BITS_PER_LONG == 64 */
-
-
-static int asm_do_io(struct file *file, struct oracleasm_io_v2 *io,
-		     int bpl)
-{
-	int ret = 0;
-	u32 status = 0;
-	struct timeout to;
-
-	mlog_entry("(0x%p, 0x%p, %d)\n", file, io, bpl);
-
-	init_timeout(&to);
-
-	if (io->io_timeout) {
-		struct timespec ts;
-
-		mlog(ML_ABI, "Passed timeout 0x%"MLFu64"\n",
-		     io->io_timeout);
-		ret = -EFAULT;
-		if (copy_from_user(&ts,
-				   (struct timespec *)(unsigned long)(io->io_timeout),
-				   sizeof(ts)))
-			goto out;
-
-		set_timeout(&to, &ts);
-		if (to.timed_out) {
-			io->io_timeout = (u64)0;
-			clear_timeout(&to);
-		}
-	}
-
-	ret = 0;
-	if (io->io_requests) {
-		mlog(ML_ABI,
-		     "oracleasm_io_v2 has requests; reqlen %d\n",
-		     io->io_reqlen);
-		ret = -EINVAL;
-		if (bpl == ASM_BPL_32)
-			ret = asm_submit_io_32(file, io);
-#if BITS_PER_LONG == 64
-		else if (bpl == ASM_BPL_64)
-			ret = asm_submit_io_64(file, io);
-#endif  /* BITS_PER_LONG == 64 */
-
-		if (ret)
-			goto out_to;
-	}
-
-	if (io->io_waitreqs) {
-		mlog(ML_ABI, "oracleasm_io_v2 has waits; waitlen %d\n",
-		     io->io_waitlen);
-		ret = -EINVAL;
-		if (bpl == ASM_BPL_32)
-			ret = asm_maybe_wait_io_32(file, io, &to);
-#if BITS_PER_LONG == 64
-		else if (bpl == ASM_BPL_64)
-			ret = asm_maybe_wait_io_64(file, io, &to);
-#endif  /* BITS_PER_LONG == 64 */
-
-		if (ret)
-			goto out_to;
-
-		status |= ASM_IO_WAITED;
-	}
-
-	if (io->io_completions) {
-		mlog(ML_ABI,
-		     "oracleasm_io_v2 has completes; complen %d\n",
-		     io->io_complen);
-		ret = -EINVAL;
-		if (bpl == ASM_BPL_32)
-			ret = asm_complete_ios_32(file, io, &to,
-						  &status);
-#if BITS_PER_LONG == 64
-		else if (bpl == ASM_BPL_64)
-			ret = asm_complete_ios_64(file, io, &to,
-						  &status);
-#endif  /* BITS_PER_LONG == 64 */
-
-		if (ret < 0)
-			goto out_to;
-		if (ret >= io->io_complen)
-			status |= ASM_IO_FULL;
-		ret = 0;
-	}
-
-out_to:
-	if (io->io_timeout)
-		clear_timeout(&to);
-
-out:
-	if (put_user(status, (u32 *)(unsigned long)(io->io_statusp)))
-		ret = -EFAULT;
-	mlog_exit(ret);
-	return ret;
-}  /* asm_do_io() */
-
-static void asm_cleanup_bios(struct file *file)
-{
-	struct asmfs_file_info *afi = ASMFS_FILE(file);
-	struct bio *bio;
-
-	mlog_entry("(0x%p)\n", file);
-
-	spin_lock_irq(&afi->f_lock);
-	while (afi->f_bio_free) {
-		bio = afi->f_bio_free;
-		afi->f_bio_free = bio->bi_private;
-
-		spin_unlock_irq(&afi->f_lock);
-		mlog(ML_BIO, "Unmapping bio 0x%p\n", bio);
-		bio_unmap_user(bio);
-		spin_lock_irq(&afi->f_lock);
-	}
-	spin_unlock_irq(&afi->f_lock);
-
-	mlog_exit_void();
-}
-
-static int asmfs_file_open(struct inode * inode, struct file * file)
-{
-	struct asmfs_inode_info * aii;
-	struct asmfs_file_info * afi;
-
-	mlog_entry("(0x%p, 0x%p)\n", inode, file);
-
-	mlog_bug_on_msg(ASMFS_FILE(file),
-			"Trying to reopen filp 0x%p\n", file);
-
-	mlog(ML_ABI, "Opening filp 0x%p\n", file);
-	afi = (struct asmfs_file_info *)kmalloc(sizeof(*afi),
-						GFP_KERNEL);
-	if (!afi) {
-		mlog_exit(-ENOMEM);
-		return -ENOMEM;
-	}
-
-	afi->f_file = file;
-	afi->f_bio_free = NULL;
-	spin_lock_init(&afi->f_lock);
-	INIT_LIST_HEAD(&afi->f_ctx);
-	INIT_LIST_HEAD(&afi->f_disks);
-	INIT_LIST_HEAD(&afi->f_ios);
-	INIT_LIST_HEAD(&afi->f_complete);
-	init_waitqueue_head(&afi->f_wait);
-
-	aii = ASMFS_I(ASMFS_F2I(file));
-	spin_lock_irq(&aii->i_lock);
-	list_add(&afi->f_ctx, &aii->i_threads);
-	spin_unlock_irq(&aii->i_lock);
-
-	file->private_data = afi;
-
-	mlog(ML_ABI, "Filp 0x%p has afi 0x%p\n", file, afi);
-
-	mlog_exit(0);
-	return 0;
-}  /* asmfs_file_open() */
-
-
-static int asmfs_file_release(struct inode *inode, struct file *file)
-{
-	struct asmfs_inode_info *aii;
-	struct asmfs_file_info *afi;
-	struct asm_disk_head *h, *n;
-	struct list_head *p;
-	struct asm_disk_info *d;
-	struct asm_request *r;
-	struct task_struct *tsk = current;
-	DECLARE_WAITQUEUE(wait, tsk);
-
-	mlog_entry("(0x%p, 0x%p)\n", inode, file);
-
-	aii = ASMFS_I(ASMFS_F2I(file));
-	afi = ASMFS_FILE(file);
-
-	mlog(ML_ABI, "Release for filp 0x%p (afi = 0x%p)\n", file, afi);
-
-	/*
-	 * Shouldn't need the lock, no one else has a reference
-	 * asm_close_disk will need to take it when completing I/O
-	 */
-	list_for_each_entry_safe(h, n, &afi->f_disks, h_flist) {
-		d = h->h_disk;
-		asm_close_disk(file, (unsigned long)d->d_bdev);
-	}
-
-	/* FIXME: Clean up things that hang off of afi */
-
-	spin_lock_irq(&aii->i_lock);
-	list_del(&afi->f_ctx);
-	spin_unlock_irq(&aii->i_lock);
-
-	/* No need for a fastpath */
-	add_wait_queue(&afi->f_wait, &wait);
-	do {
-		struct block_device *bdev;
-		struct asm_disk_info *d;
-		struct inode *disk_inode;
-		struct asmdisk_find_inode_args args;
-
-		set_task_state(tsk, TASK_UNINTERRUPTIBLE);
-
-		spin_lock_irq(&afi->f_lock);
-		if (list_empty(&afi->f_ios))
-		    break;
-
-		bdev = find_io_bdev(file);
-		spin_unlock_irq(&afi->f_lock);
-
-		args.fa_handle = (unsigned long)bdev;
-		args.fa_inode = aii;
-		disk_inode = ilookup5(asmdisk_mnt->mnt_sb,
-				      (unsigned long)bdev,
-				      asmdisk_test, &args);
-		if (disk_inode) {
-			d = ASMDISK_I(disk_inode);
-			if (d->d_bdev)
-				blk_run_address_space(d->d_bdev->bd_inode->i_mapping);
-			iput(&d->vfs_inode);
-		}
-
-		mlog(ML_ABI|ML_REQUEST,
-		     "There are still I/Os hanging off of afi 0x%p\n",
-		     afi);
-		io_schedule();
-	} while (1);
-	set_task_state(tsk, TASK_RUNNING);
-	remove_wait_queue(&afi->f_wait, &wait);
-	
-	/* I don't *think* we need the lock here anymore, but... */
-
-	/* Clear unreaped I/Os */
-	while (!list_empty(&afi->f_complete)) {
-		p = afi->f_complete.prev;
-		r = list_entry(p, struct asm_request, r_list);
-		list_del(&r->r_list);
-		r->r_file = NULL;
-		asm_request_free(r);
-	}
-	spin_unlock_irq(&afi->f_lock);
-
-	/* And cleanup any pages from those I/Os */
-	asm_cleanup_bios(file);
-
-	mlog(ML_ABI, "Done with afi 0x%p from filp 0x%p\n", afi, file);
-	file->private_data = NULL;
-	kfree(afi);
-
-	mlog_exit(0);
-	return 0;
-}  /* asmfs_file_release() */
-
-/*
- * Verify that the magic and ABI versions are valid.  Future
- * drivers might support more than one ABI version, so ESRCH is returned
- * for "valid ABI version not found"
- */
-static int asmfs_verify_abi(struct oracleasm_abi_info *abi_info)
-{
-	if (abi_info->ai_magic != ASM_ABI_MAGIC)
-		return -EBADR;
-	if (abi_info->ai_version != ASM_ABI_VERSION)
-		return -ESRCH;
-
-	return 0;
-}
-
-static ssize_t asmfs_svc_query_version(struct file *file, char *buf, size_t size)
-{
-	struct oracleasm_abi_info *abi_info;
-	int ret;
-
-	mlog_entry("(0x%p, 0x%p, %u)\n", file, buf, (unsigned int)size);
-
-	if (size != sizeof(struct oracleasm_abi_info)) {
-		mlog_exit(-EINVAL);
-		return -EINVAL;
-	}
-
-       	abi_info = (struct oracleasm_abi_info *)buf;
-
-	ret = asmfs_verify_abi(abi_info);
-	if (ret) {
-	       	if (ret == -ESRCH) {
-			abi_info->ai_version = ASM_ABI_VERSION;
-			abi_info->ai_status = -ESRCH;
-		} else
-			goto out;
-	}
-
-	ret = -EBADR;
-	if (abi_info->ai_size != sizeof(struct oracleasm_abi_info))
-		goto out;
-	ret = -EBADRQC;
-	if (abi_info->ai_type != ASMOP_QUERY_VERSION)
-		goto out;
-
-	ret = 0;
-
-out:
-	if (!abi_info->ai_status)
-		abi_info->ai_status = ret;
-	
-	mlog_exit(size);
-	return size;
-}
-
-static ssize_t asmfs_svc_get_iid(struct file *file, char *buf, size_t size)
-{
-	struct oracleasm_get_iid_v2 *iid_info;
-	struct asmfs_sb_info *asb = ASMFS_SB(ASMFS_F2I(file)->i_sb);
-	int ret;
-
-	mlog_entry("(0x%p, 0x%p, %u)\n", file, buf, (unsigned int)size);
-
-	if (size != sizeof(struct oracleasm_get_iid_v2)) {
-		mlog_exit(-EINVAL);
-		return -EINVAL;
-	}
-
-	iid_info = (struct oracleasm_get_iid_v2 *)buf;
-
-	ret = asmfs_verify_abi(&iid_info->gi_abi);
-	if (ret)
-		goto out;
-	ret = -EBADR;
-	if (iid_info->gi_abi.ai_size !=
-	    sizeof(struct oracleasm_get_iid_v2))
-		goto out;
-	ret = -EBADRQC;
-	if (iid_info->gi_abi.ai_type != ASMOP_GET_IID)
-		goto out;
-
-	spin_lock_irq(&asb->asmfs_lock);
-	iid_info->gi_iid = (u64)asb->next_iid;
-	asb->next_iid++;
-	spin_unlock_irq(&asb->asmfs_lock);
-
-	ret = 0;
-
-out:
-	iid_info->gi_abi.ai_status = ret;
-
-	mlog_exit(size);
-	return size;
-}
-
-static ssize_t asmfs_svc_check_iid(struct file *file, char *buf, size_t size)
-{
-	struct oracleasm_get_iid_v2 *iid_info;
-	struct asmfs_sb_info *asb = ASMFS_SB(ASMFS_F2I(file)->i_sb);
-	int ret;
-
-	mlog_entry("(0x%p, 0x%p, %u)\n", file, buf, (unsigned int)size);
-
-	if (size != sizeof(struct oracleasm_get_iid_v2)) {
-		mlog_exit(-EINVAL);
-		return -EINVAL;
-	}
-
-	iid_info = (struct oracleasm_get_iid_v2 *)buf;
-
-	ret = asmfs_verify_abi(&iid_info->gi_abi);
-	if (ret)
-		goto out;
-
-	ret = -EBADR;
-	if (iid_info->gi_abi.ai_size !=
-	    sizeof(struct oracleasm_get_iid_v2))
-		goto out;
-	ret = -EBADRQC;
-	if (iid_info->gi_abi.ai_type != ASMOP_CHECK_IID)
-		goto out;
-
-	spin_lock_irq(&asb->asmfs_lock);
-	if (iid_info->gi_iid >= (u64)asb->next_iid)
-		iid_info->gi_iid = (u64)0;
-	spin_unlock_irq(&asb->asmfs_lock);
-
-	ret = 0;
-
-out:
-	iid_info->gi_abi.ai_status = ret;
-
-	mlog_exit(size);
-	return size;
-}
-
-static ssize_t asmfs_svc_query_disk(struct file *file, char *buf, size_t size)
-{
-	struct oracleasm_query_disk_v2 *qd_info;
-	struct file *filp;
-	struct block_device *bdev;
-	int ret;
-
-	mlog_entry("(0x%p, 0x%p, %u)\n", file, buf, (unsigned int)size);
-
-	if (size != sizeof(struct oracleasm_query_disk_v2)) {
-		mlog_exit(-EINVAL);
-		return -EINVAL;
-	}
-
-	qd_info = (struct oracleasm_query_disk_v2 *)buf;
-
-	ret = asmfs_verify_abi(&qd_info->qd_abi);
-	if (ret)
-		goto out;
-
-	ret = -EBADR;
-	if (qd_info->qd_abi.ai_size !=
-	    sizeof(struct oracleasm_query_disk_v2))
-		goto out;
-	ret = -EBADRQC;
-	if (qd_info->qd_abi.ai_type != ASMOP_QUERY_DISK)
-		goto out;
-
-	ret = -ENODEV;
-	filp = fget(qd_info->qd_fd);
-	if (!filp)
-		goto out;
-
-	ret = -ENOTBLK;
-	if (!S_ISBLK(filp->f_mapping->host->i_mode))
-		goto out_put;
-
-	bdev = I_BDEV(filp->f_mapping->host);
-
-	qd_info->qd_max_sectors = compute_max_sectors(bdev);
-	qd_info->qd_hardsect_size = bdev_hardsect_size(bdev);
-
-	ret = 0;
-
-out_put:
-	fput(filp);
-
-out:
-	qd_info->qd_abi.ai_status = ret;
-
-	mlog_exit(size);
-	return size;
-}
-
-static ssize_t asmfs_svc_open_disk(struct file *file, char *buf, size_t size)
-{
-	struct oracleasm_open_disk_v2 od_info;
-	struct block_device *bdev = NULL;
-	struct file *filp;
-	int ret;
-
-	mlog_entry("(0x%p, 0x%p, %u)\n", file, buf, (unsigned int)size);
-
-	if (size != sizeof(struct oracleasm_open_disk_v2)) {
-		mlog_exit(-EINVAL);
-		return -EINVAL;
-	}
-
-	if (copy_from_user(&od_info,
-			   (struct oracleasm_open_disk_v2 __user *)buf,
-			   sizeof(struct oracleasm_open_disk_v2))) {
-		mlog_exit(-EFAULT);
-		return -EFAULT;
-	}
-
-	od_info.od_handle = 0; /* Unopened */
-
-	ret = asmfs_verify_abi(&od_info.od_abi);
-	if (ret)
-		goto out_error;
-
-	ret = -EBADR;
-	if (od_info.od_abi.ai_size !=
-	    sizeof(struct oracleasm_open_disk_v2))
-		goto out_error;
-	ret = -EBADRQC;
-	if (od_info.od_abi.ai_type != ASMOP_OPEN_DISK)
-		goto out_error;
-
-	ret = -ENODEV;
-	filp = fget(od_info.od_fd);
-	if (!filp)
-		goto out_error;
-
-	if (igrab(filp->f_mapping->host)) {
-		ret = -ENOTBLK;
-		if (S_ISBLK(filp->f_mapping->host->i_mode)) {
-			bdev = I_BDEV(filp->f_mapping->host);
-
-			ret = asm_open_disk(file, bdev);
-		}
-	}
-	fput(filp);
-	if (ret)
-		goto out_error;
-
-	od_info.od_handle = (u64)(unsigned long)bdev;
-out_error:
-	od_info.od_abi.ai_status = ret;
-	if (copy_to_user((struct oracleasm_open_disk_v2 __user *)buf,
-			 &od_info,
-			 sizeof(struct oracleasm_open_disk_v2))) {
-		if (od_info.od_handle)
-			asm_close_disk(file,
-				       (unsigned long)od_info.od_handle);
-		/* Ignore close errors, this is the real error */
-		mlog_exit(-EFAULT);
-		return -EFAULT;
-	}
-
-	mlog_exit(size);
-	return size;
-}
-
-static ssize_t asmfs_svc_close_disk(struct file *file, char *buf, size_t size)
-{
-	struct oracleasm_close_disk_v2 cd_info;
-	int ret;
-
-	mlog_entry("(0x%p, 0x%p, %u)\n", file, buf, (unsigned int)size);
-
-	if (size != sizeof(struct oracleasm_close_disk_v2)) {
-		mlog_exit(-EINVAL);
-		return -EINVAL;
-	}
-
-	if (copy_from_user(&cd_info,
-			   (struct oracleasm_close_disk_v2 __user *)buf,
-			   sizeof(struct oracleasm_close_disk_v2))) {
-		mlog_exit(-EFAULT);
-		return -EFAULT;
-	}
-
-	ret = asmfs_verify_abi(&cd_info.cd_abi);
-	if (ret)
-		goto out_error;
-
-	ret = -EBADR;
-	if (cd_info.cd_abi.ai_size !=
-	    sizeof(struct oracleasm_close_disk_v2))
-		goto out_error;
-	ret = -EBADRQC;
-	if (cd_info.cd_abi.ai_type != ASMOP_CLOSE_DISK)
-		goto out_error;
-
-	ret = asm_close_disk(file, (unsigned long)cd_info.cd_handle);
-
-out_error:
-	cd_info.cd_abi.ai_status = ret;
-	if (copy_to_user((struct oracleasm_close_disk_v2 __user *)buf,
-			 &cd_info,
-			 sizeof(struct oracleasm_close_disk_v2))) {
-		mlog_exit(-EFAULT);
-		return -EFAULT;
-	}
-
-	mlog_exit(size);
-	return size;
-}
-
-static ssize_t asmfs_svc_io32(struct file *file, char *buf, size_t size)
-{
-	struct oracleasm_abi_info __user *user_abi_info;
-	struct oracleasm_io_v2 io_info;
-	int ret;
-
-	mlog_entry("(0x%p, 0x%p, %u)\n", file, buf, (unsigned int)size);
-
-	if (size != sizeof(struct oracleasm_io_v2)) {
-		mlog_exit(-EINVAL);
-		return -EINVAL;
-	}
-
-	if (copy_from_user(&io_info,
-			   (struct oracleasm_io_v2 __user *)buf,
-			   sizeof(struct oracleasm_io_v2))) {
-		mlog_exit(-EFAULT);
-		return -EFAULT;
-	}
-
-	ret = asmfs_verify_abi(&io_info.io_abi);
-	if (ret)
-		goto out_error;
-
-	ret = -EBADR;
-	if (io_info.io_abi.ai_size !=
-	    sizeof(struct oracleasm_io_v2))
-		goto out_error;
-	ret = -EBADRQC;
-	if (io_info.io_abi.ai_type != ASMOP_IO32)
-		goto out_error;
-
-	ret = asm_do_io(file, &io_info, ASM_BPL_32);
-
-out_error:
-	user_abi_info = (struct oracleasm_abi_info __user *)buf;
-	if (put_user(ret, &(user_abi_info->ai_status))) {
-		mlog_exit(-EFAULT);
-		return -EFAULT;
-	}
-
-	mlog_exit(size);
-	return size;
-}
-
-#if BITS_PER_LONG == 64
-static ssize_t asmfs_svc_io64(struct file *file, char *buf, size_t size)
-{
-	struct oracleasm_abi_info __user *user_abi_info;
-	struct oracleasm_io_v2 io_info;
-	int ret;
-
-	mlog_entry("(0x%p, 0x%p, %u)\n", file, buf, (unsigned int)size);
-
-	if (size != sizeof(struct oracleasm_io_v2)) {
-		mlog_exit(-EINVAL);
-		return -EINVAL;
-	}
-
-	if (copy_from_user(&io_info,
-			   (struct oracleasm_io_v2 __user *)buf,
-			   sizeof(struct oracleasm_io_v2))) {
-		mlog_exit(-EFAULT);
-		return -EFAULT;
-	}
-
-	ret = asmfs_verify_abi(&io_info.io_abi);
-	if (ret)
-		goto out_error;
-
-	ret = -EBADR;
-	if (io_info.io_abi.ai_size !=
-	    sizeof(struct oracleasm_io_v2))
-		goto out_error;
-	ret = -EBADRQC;
-	if (io_info.io_abi.ai_type != ASMOP_IO64)
-		goto out_error;
-
-	ret = asm_do_io(file, &io_info, ASM_BPL_64);
-
-out_error:
-	user_abi_info = (struct oracleasm_abi_info __user *)buf;
-	if (put_user(ret, &(user_abi_info->ai_status))) {
-		mlog_exit(-EFAULT);
-		return -EFAULT;
-	}
-
-	mlog_exit(size);
-	return size;
-}
-#endif  /* BITS_PER_LONG == 64 */
-
-
-/*
- * Because each of these operations need to access the filp->private,
- * we must multiplex.
- */
-static ssize_t asmfs_file_read(struct file *file, char *buf, size_t size, loff_t *pos)
-{
-	struct oracleasm_abi_info __user *user_abi_info;
-	ssize_t ret;
-	int op;
-
-	asm_cleanup_bios(file);
-
-	user_abi_info = (struct oracleasm_abi_info __user *)buf;
-	if (get_user(op, &((user_abi_info)->ai_type))) {
-		mlog_exit(-EFAULT);
-		return -EFAULT;
-	}
-
-	switch (op) {
-		default:
-			ret = -EBADRQC;
-			break;
-
-		case ASMOP_OPEN_DISK:
-			ret = asmfs_svc_open_disk(file, (char *)buf,
-						  size);
-			break;
-
-		case ASMOP_CLOSE_DISK:
-			ret = asmfs_svc_close_disk(file, (char *)buf,
-						   size);
-			break;
-
-		case ASMOP_IO32:
-			ret = asmfs_svc_io32(file, (char *)buf, size);
-			break;
-
-#if BITS_PER_LONG == 64
-		case ASMOP_IO64:
-			ret = asmfs_svc_io64(file, (char *)buf, size);
-			break;
-#endif  /* BITS_PER_LONG == 64 */
-	}
-
-	return ret;
-}
-
-static struct file_operations asmfs_file_operations = {
-	.open		= asmfs_file_open,
-	.release	= asmfs_file_release,
-	.read		= asmfs_file_read,
-};
-
-static struct inode_operations asmfs_file_inode_operations = {
-	.getattr	= simple_getattr,
-};
-
-/*  See init_asmfs_dir_operations() */
-static struct file_operations asmfs_dir_operations = {0, };
-
-static struct inode_operations asmfs_disk_dir_inode_operations = {
-	.lookup		= simple_lookup,
-	.unlink		= simple_unlink,
-	.mknod		= asmfs_mknod,
-};
-static struct inode_operations asmfs_iid_dir_inode_operations = {
-	.create		= asmfs_create,
-	.lookup		= simple_lookup,
-	.unlink		= simple_unlink,
-};
-
-static struct super_operations asmfs_ops = {
-	.statfs		= simple_statfs,
-	.alloc_inode	= asmfs_alloc_inode,
-	.destroy_inode	= asmfs_destroy_inode,
-	.drop_inode	= generic_delete_inode,
-	/* These last three only required for limited maxinstances */
-	.put_super	= asmfs_put_super,
-	.remount_fs     = asmfs_remount,
-};
-
-/*
- * Initialisation
- */
-
-static int asmfs_fill_super(struct super_block *sb,
-			    void *data, int silent)
-{
-	struct inode *inode, *parent;
-	struct dentry *root, *dentry;
-	struct asmfs_sb_info *asb;
-	struct asmfs_params params;
-	struct qstr name;
-
-	sb->s_blocksize = PAGE_CACHE_SIZE;
-	sb->s_blocksize_bits = PAGE_CACHE_SHIFT;
-	sb->s_magic = ASMFS_MAGIC;
-	sb->s_op = &asmfs_ops;
-	sb->s_maxbytes = MAX_NON_LFS;	/* Why? */
-
-	asb = kmalloc(sizeof(struct asmfs_sb_info), GFP_KERNEL);
-	if (!asb)
-		return -ENOMEM;
-	sb->s_fs_info = asb;
-
-	asb->asmfs_super = sb;
-	asb->next_iid = 1;
-	spin_lock_init(&asb->asmfs_lock);
-
-	if (parse_options((char *)data, &params) != 0)
-		goto out_free_asb;
-
-	init_limits(asb, &params);
-
-	inode = new_inode(sb);
-	if (!inode)
-		goto out_free_asb;
-
-	inode->i_ino = (unsigned long)inode;
-	inode->i_mode = S_IFDIR | 0755;
-	inode->i_uid = inode->i_gid = 0;
-	set_i_blksize(inode, PAGE_CACHE_SIZE);
-	inode->i_blocks = 0;
-	inode->i_rdev = 0;
-	inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
-	inode->i_op = &simple_dir_inode_operations;
-	inode->i_fop = &asmfs_dir_operations;
-	inode->i_mapping->backing_dev_info = &memory_backing_dev_info;
-	/* directory inodes start off with i_nlink == 2 (for "." entry) */
-	inode->i_nlink++;
-	parent = inode;
-
-	root = d_alloc_root(inode);
-	if (!root) {
-		iput(inode);
-		goto out_free_asb;
-	}
-
-	name.name = ASM_MANAGER_DISKS;
-	name.len = strlen(ASM_MANAGER_DISKS);
-	name.hash = full_name_hash(name.name, name.len);
-	dentry = d_alloc(root, &name);
-	if (!dentry)
-		goto out_genocide;
-	parent->i_nlink++;
-	inode = new_inode(sb);
-	if (!inode)
-		goto out_genocide;
-	inode->i_ino = (unsigned long)inode;
-	inode->i_mode = S_IFDIR | 0755;
-	inode->i_uid = inode->i_gid = 0;
-	inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
-	inode->i_op = &asmfs_disk_dir_inode_operations;
-	inode->i_fop = &asmfs_dir_operations;
-	inode->i_mapping->backing_dev_info = &memory_backing_dev_info;
-	d_add(dentry, inode);
-
-	name.name = ASM_MANAGER_INSTANCES;
-	name.len = strlen(ASM_MANAGER_INSTANCES);
-	name.hash = full_name_hash(name.name, name.len);
-	dentry = d_alloc(root, &name);
-	if (!dentry)
-		goto out_genocide;
-	parent->i_nlink++;
-	inode = new_inode(sb);
-	if (!inode)
-		goto out_genocide;
-	inode->i_ino = (unsigned long)inode;
-	inode->i_mode = S_IFDIR | 0770;
-	inode->i_uid = inode->i_gid = 0;
-	inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
-	inode->i_op = &asmfs_iid_dir_inode_operations;
-	inode->i_fop = &asmfs_dir_operations;
-	inode->i_mapping->backing_dev_info = &memory_backing_dev_info;
-	d_add(dentry, inode);
-
-	name.name = asm_operation_files[ASMOP_QUERY_VERSION];
-	name.len = strlen(asm_operation_files[ASMOP_QUERY_VERSION]);
-	name.hash = full_name_hash(name.name, name.len);
-	dentry = d_alloc(root, &name);
-	if (!dentry)
-		goto out_genocide;
-	inode = new_transaction_inode(sb, 0770,
-				      &trans_contexts[ASMOP_QUERY_VERSION]);
-	if (!inode)
-		goto out_genocide;
-	inode->i_mapping->backing_dev_info = &memory_backing_dev_info;
-	d_add(dentry, inode);
-
-	name.name = asm_operation_files[ASMOP_GET_IID];
-	name.len = strlen(asm_operation_files[ASMOP_GET_IID]);
-	name.hash = full_name_hash(name.name, name.len);
-	dentry = d_alloc(root, &name);
-	if (!dentry)
-		goto out_genocide;
-	inode = new_transaction_inode(sb, 0770,
-				      &trans_contexts[ASMOP_GET_IID]);
-	if (!inode)
-		goto out_genocide;
-	inode->i_mapping->backing_dev_info = &memory_backing_dev_info;
-	d_add(dentry, inode);
-
-	name.name = asm_operation_files[ASMOP_CHECK_IID];
-	name.len = strlen(asm_operation_files[ASMOP_CHECK_IID]);
-	name.hash = full_name_hash(name.name, name.len);
-	dentry = d_alloc(root, &name);
-	if (!dentry)
-		goto out_genocide;
-	inode = new_transaction_inode(sb, 0770,
-				      &trans_contexts[ASMOP_CHECK_IID]);
-	if (!inode)
-		goto out_genocide;
-	inode->i_mapping->backing_dev_info = &memory_backing_dev_info;
-	d_add(dentry, inode);
-
-	name.name = asm_operation_files[ASMOP_QUERY_DISK];
-	name.len = strlen(asm_operation_files[ASMOP_QUERY_DISK]);
-	name.hash = full_name_hash(name.name, name.len);
-	dentry = d_alloc(root, &name);
-	if (!dentry)
-		goto out_genocide;
-	inode = new_transaction_inode(sb, 0770,
-				      &trans_contexts[ASMOP_QUERY_DISK]);
-	if (!inode)
-		goto out_genocide;
-	inode->i_mapping->backing_dev_info = &memory_backing_dev_info;
-	d_add(dentry, inode);
-
-	sb->s_root = root;
-
-
-	printk(KERN_DEBUG "ASM: oracleasmfs mounted with options: %s\n", 
-	       data ? (char *)data : "<defaults>" );
-	printk(KERN_DEBUG "ASM:	maxinstances=%ld\n", asb->max_inodes);
-	return 0;
-
-out_genocide:
-	d_genocide(root);
-	dput(root);
-
-out_free_asb:
-	sb->s_fs_info = NULL;
-	kfree(asb);
-
-	return -EINVAL;
-}
-
-
-/*
- * We want all the simple_dir_operations, but we cannot reference them
- * directly -- they are not EXPORT_SYMBOL()d.  So, we just copy the
- * exported simple_dir_operations before adding any specific functions
- * of our own.
- *
- * This means that asmfs_dir_operations can't be const.  Oh, well.
- */
-static void __init init_asmfs_dir_operations(void) {
-	asmfs_dir_operations		= simple_dir_operations;
-	asmfs_dir_operations.fsync	= simple_sync_file;
-};
-
-
-#ifdef GET_SB_HAS_VFSMOUNT
-static int asmfs_get_sb(struct file_system_type *fs_type, int flags,
-			const char *dev_name, void *data,
-			struct vfsmount *mnt)
-{
-	return get_sb_nodev(fs_type, flags, data, asmfs_fill_super, mnt);
-}
-#else
-static struct super_block *asmfs_get_sb(struct file_system_type *fs_type,
-					int flags, const char *dev_name,
-					void *data)
-{
-	return get_sb_nodev(fs_type, flags, data, asmfs_fill_super);
-}
-#endif  /* GET_SB_HAS_VFSMOUNT */
-
-static struct file_system_type asmfs_fs_type = {
-	.owner		= THIS_MODULE,
-	.name		= "oracleasmfs",
-	.get_sb		= asmfs_get_sb,
-	.kill_sb	= kill_litter_super,
-};
-
-static int __init init_asmfs_fs(void)
-{
-	int ret;
-
-	ret = init_inodecache();
-	if (ret) {
-		printk("oracleasmfs: Unable to create asmfs_inode_cache\n");
-		goto out_inodecache;
-	}
-
-	ret = init_requestcache();
-	if (ret) {
-		printk("oracleasmfs: Unable to create asm_request cache\n");
-		goto out_requestcache;
-	}
-
-	ret = init_asmdiskcache();
-	if (ret) {
-		printk("oracleasmfs: Unable to initialize the disk cache\n");
-		goto out_diskcache;
-	}
-
-	ret = init_oracleasm_proc();
-	if (ret) {
-		printk("oracleasmfs: Unable to register proc entries\n");
-		goto out_proc;
-	}
-
-	init_asmfs_dir_operations();
-	ret = register_filesystem(&asmfs_fs_type);
-	if (ret) {
-		printk("oracleasmfs: Unable to register filesystem\n");
-		goto out_register;
-	}
-
-	return 0;
-
-out_register:
-	exit_oracleasm_proc();
-
-out_proc:
-	destroy_asmdiskcache();
-
-out_diskcache:
-	destroy_requestcache();
-
-out_requestcache:
-	destroy_inodecache();
-
-out_inodecache:
-	return ret;
-}
-
-static void __exit exit_asmfs_fs(void)
-{
-	unregister_filesystem(&asmfs_fs_type);
-	exit_oracleasm_proc();
-	destroy_asmdiskcache();
-	destroy_requestcache();
-	destroy_inodecache();
-}
-
-module_init(init_asmfs_fs)
-module_exit(exit_asmfs_fs)
-MODULE_LICENSE("GPL");
-MODULE_VERSION(ASM_MODULE_VERSION);
-MODULE_AUTHOR("Joel Becker <joel.becker@oracle.com>");
-MODULE_DESCRIPTION("Kernel driver backing the Generic Linux ASM Library.");
diff -ruN oracleasm-2.0.5/kernel/proc.c oracleasm-2.0.5-fix/kernel/proc.c
--- oracleasm-2.0.5/kernel/proc.c	2008-09-10 19:32:11.000000000 +0200
+++ oracleasm-2.0.5-fix/kernel/proc.c	2009-06-18 22:54:13.000000000 +0200
@@ -24,9 +24,6 @@
 #include "proc.h"
 #include "masklog.h"
 
-/* Yuk, but whatever */
-#include "masklog.c"
-
 static struct proc_dir_entry *asm_proc;
 #define ASM_PROC_PATH "fs/oracleasm"
 
diff -ruN oracleasm-2.0.5/kernel/transaction_file.c oracleasm-2.0.5-fix/kernel/transaction_file.c
--- oracleasm-2.0.5/kernel/transaction_file.c	2008-09-10 19:32:11.000000000 +0200
+++ oracleasm-2.0.5-fix/kernel/transaction_file.c	2009-11-10 11:53:07.000000000 +0100
@@ -14,10 +14,12 @@
 #include <linux/fs.h>
 #include <linux/pagemap.h>
 #include <linux/slab.h>
+#include <linux/sched.h>
 
 #include <asm/uaccess.h>
 
 #include "transaction_file.h"
+#include "compat.h"
 
 #define TRANSACTION_CONTEXT(i) ((i)->i_private)
 
@@ -148,8 +150,8 @@
 	if (!inode)
 		return NULL;
 	inode->i_mode = S_IFREG | mode;
-	inode->i_uid = current->fsuid;
-	inode->i_gid = current->fsgid;
+	inode->i_uid = current_fsuid();
+	inode->i_gid = current_fsgid();
 	set_i_blksize(inode, PAGE_CACHE_SIZE);
 	inode->i_blocks = 0;
 	inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
diff -ruN oracleasm-2.0.5/vendor/Makefile oracleasm-2.0.5-fix/vendor/Makefile
--- oracleasm-2.0.5/vendor/Makefile	2008-09-10 19:32:11.000000000 +0200
+++ oracleasm-2.0.5-fix/vendor/Makefile	2009-06-18 22:54:13.000000000 +0200
@@ -11,7 +11,7 @@
 #
 # Add any directories to recurse into via the SUBDIRS variable.
 # 
-SUBDIRS = common rhel5 sles10 fc6 rhel4 sles9 rhel3 sles8 rhas21
+SUBDIRS = common rhel5 sles11 sles10 fc6 rhel4 sles9 rhel3 sles8 rhas21
 
 #
 # Include this at the very end of the Makefile
diff -ruN oracleasm-2.0.5/vendor/common/Makefile oracleasm-2.0.5-fix/vendor/common/Makefile
--- oracleasm-2.0.5/vendor/common/Makefile	2008-09-10 19:32:11.000000000 +0200
+++ oracleasm-2.0.5-fix/vendor/common/Makefile	2009-06-18 22:54:13.000000000 +0200
@@ -3,6 +3,7 @@
 include $(TOPDIR)/Preamble.make
 
 DIST_FILES =					\
+	binrpm.spec-generic.in			\
 	oracleasm-headers.spec-generic.in	\
 	Vendor.make
 
diff -ruN oracleasm-2.0.5/vendor/common/Vendor.make oracleasm-2.0.5-fix/vendor/common/Vendor.make
--- oracleasm-2.0.5/vendor/common/Vendor.make	2008-09-10 19:32:11.000000000 +0200
+++ oracleasm-2.0.5-fix/vendor/common/Vendor.make	2009-06-18 22:54:13.000000000 +0200
@@ -28,3 +28,13 @@
 headers_rpm: headers_srpm
 	$(RPMBUILD) --rebuild $(TOOLSARCH) "oracleasm-headers-$(DIST_VERSION)-$(PKG_VERSION).$(VENDOR_EXTENSION).src.rpm"
 
+#
+# Build a package out of the compiled source tree
+#
+
+$(TOPDIR)/vendor/common/binrpm.spec: $(TOPDIR)/vendor/common/binrpm.spec-generic
+		sed -e 's/@@PKG_VERSION@@/'$(PKG_VERSION)'/' < $< > $@
+
+
+binrpm-pkg: $(TOPDIR)/vendor/common/binrpm.spec
+	$(RPMBUILD) --define "_builddir $(TOPDIR)" --target $(KERNELARCH) -bb $<
diff -ruN oracleasm-2.0.5/vendor/common/binrpm.spec-generic.in oracleasm-2.0.5-fix/vendor/common/binrpm.spec-generic.in
--- oracleasm-2.0.5/vendor/common/binrpm.spec-generic.in	1970-01-01 01:00:00.000000000 +0100
+++ oracleasm-2.0.5-fix/vendor/common/binrpm.spec-generic.in	2009-06-18 22:54:13.000000000 +0200
@@ -0,0 +1,106 @@
+#
+# Spec file for a pre-built oracleasm
+#
+
+# Macros
+# This one is hardcoded because, well, it belongs there
+%define _prefix /usr
+# Because RPM is dumb
+%define _unpackaged_files_terminate_build 0
+
+# This must be changed to the minimum ABI compat kernel version expected
+%define kver		@KERNELVER@
+
+# The minimum -support package required for the kernel bits.
+%define support_ver     2.0.0
+# Minimum oracleasmlib version that supports positive ASM_ERR_NODEV.
+%define min_enodev	2.0.1
+
+Summary: The Oracle Automatic Storage Management library driver.
+Name: oracleasm-%{kver}
+Version: @DIST_VERSION@
+Release: @@PKG_VERSION@@.built
+License: GPL
+Group: System Environment/Kernel
+URL: http://oss.oracle.com/projects/oracleasm/
+Distribution: Oracle
+Vendor: Oracle Corporation
+Packager: Joel Becker <joel.becker@oracle.com>
+Provides: oracleasm = %{version}
+AutoReqProv: no
+Requires: kernel = %{kver}
+Requires: oracleasm-support >= %{support_ver}
+Conflicts: oracleasmlib < %{min_enodev}
+
+BuildRoot: %{_tmppath}/oracleasm-%{PACKAGE_VERSION}-%{PACKAGE_RELEASE}-root
+
+%description
+Kernel driver for the Oracle Automatic Storage Management library.
+This package is built out of a compiled source tree.
+
+
+%build
+%install
+make DESTDIR="$RPM_BUILD_ROOT" INSTALL_MOD_PATH='$(DESTDIR)' install 
+
+# 2.6 kbuild can't do this install nicely
+EXTRA_MODLIB="${RPM_BUILD_ROOT}/lib/modules/%{kver}/extra"
+INST_MODLIB="${RPM_BUILD_ROOT}/lib/modules/%{kver}/kernel/drivers/addon/oracleasm"
+mkdir -p "${INST_MODLIB}"
+mv "${EXTRA_MODLIB}"/oracleasm.ko "${INST_MODLIB}/"
+
+%clean
+#echo rm -rf "$RPM_BUILD_ROOT"
+
+
+%post
+depmod -ae %{kver}
+
+%files
+%defattr(-,root,root)
+/lib/modules/%{kver}/kernel/drivers/addon/oracleasm
+
+
+%changelog
+* Thu Jan 15 2009 Joel Becker <joel.becker@oracle.com>
+- Build a package out of a compiled tree.
+
+* Mon Nov 12 2007 Sunil Mushran <sunil.mushran@oracle.com>
+- Add support to build modules for kernel-debug for RHEL5
+
+* Wed Apr 18 2007 Joel Becker <joel.becker@oracle.com>
+- Add RHEL5
+
+* Fri Feb 09 2007 Joel Becker <joel.becker@oracle.com>
+- Strip down for Fedora Core 6
+
+* Thu May 25 2006 Joel Becker <joel.becker@oracle.com>
+- Add largesmp
+
+* Fri Feb 04 2005 Joel Becker <joel.becker@oracle.com>
+- Make RHEL4 specfile.
+
+* Tue Sep 21 2004 Joel Becker <joel.becker@oracle.com>
+- Make SLES9 specfile.
+
+* Tue Jan 13 2004 Joel Becker <joel.becker@oracle.com>
+- Make kernel-only.
+
+* Thu Nov 20 2003 Joel Becker <joel.becker@oracle.com>
+- Add x86 and ia64 targets.
+
+* Wed Nov 19 2003 Joel Becker <joel.becker@oracle.com>
+- Make the UL SP3 changes.
+
+* Wed Nov 12 2003 Joel Becker <joel.becker@oracle.com>
+- Start the ASM rename.
+
+* Thu Oct 30 2003 Joel Becker <joel.becker@oracle.com>
+- Created EL3 version
+
+* Mon Jun 23 2003 Joel Becker <joel.becker@oracle.com>
+- Added osm-lib bits
+
+* Fri Jun 20 2003 Joel Becker <joel.becker@oracle.com>
+- Initial RPM
+
diff -ruN oracleasm-2.0.5/vendor/common/oracleasm-headers.spec-generic.in oracleasm-2.0.5-fix/vendor/common/oracleasm-headers.spec-generic.in
--- oracleasm-2.0.5/vendor/common/oracleasm-headers.spec-generic.in	2008-09-10 19:32:11.000000000 +0200
+++ oracleasm-2.0.5-fix/vendor/common/oracleasm-headers.spec-generic.in	2009-06-18 22:54:13.000000000 +0200
@@ -59,11 +59,11 @@
 	--infodir=%{_infodir}			\
 	--sbindir=/usr/sbin
 
-make
+#make
 
 
 %install
-make DESTDIR="$RPM_BUILD_ROOT" INSTALL_MOD_PATH='$(DESTDIR)' install
+make DESTDIR="$RPM_BUILD_ROOT" INSTALL_MOD_PATH='$(DESTDIR)' -C include install
 
 
 %clean
diff -ruN oracleasm-2.0.5/vendor/sles10/Vendor.make oracleasm-2.0.5-fix/vendor/sles10/Vendor.make
--- oracleasm-2.0.5/vendor/sles10/Vendor.make	2008-09-10 19:32:11.000000000 +0200
+++ oracleasm-2.0.5-fix/vendor/sles10/Vendor.make	2009-06-18 22:54:13.000000000 +0200
@@ -20,6 +20,8 @@
 	rpmbuild --rebuild $(MODULEARCH) "oracleasm-$(patsubst sles10_%_rpm,%,$@)-$(DIST_VERSION)-$(PKG_VERSION).$(VENDOR_EXTENSION).src.rpm"
 
 
+# Package required for /usr/include/linux
+INCLUDE_REQUIRES = glibc-devel
 include $(TOPDIR)/vendor/common/Vendor.make
 
-packages: $(shell $(TOPDIR)/vendor/sles10/kernel.guess targets) support_rpm
+packages: $(shell $(TOPDIR)/vendor/sles10/kernel.guess targets) headers_rpm
diff -ruN oracleasm-2.0.5/vendor/sles10/kernel.guess oracleasm-2.0.5-fix/vendor/sles10/kernel.guess
--- oracleasm-2.0.5/vendor/sles10/kernel.guess	2008-09-10 19:32:11.000000000 +0200
+++ oracleasm-2.0.5-fix/vendor/sles10/kernel.guess	2009-06-18 22:54:13.000000000 +0200
@@ -16,7 +16,7 @@
     ppc64:pseries64,iseries64,pmac64
     ia64:default,64k-pagesize,sn2
     i386:default,smp,bigsmp
-    s390:s390x
+    s390:default
 "
     
 
diff -ruN oracleasm-2.0.5/vendor/sles10/oracleasm.spec-generic.in oracleasm-2.0.5-fix/vendor/sles10/oracleasm.spec-generic.in
--- oracleasm-2.0.5/vendor/sles10/oracleasm.spec-generic.in	2008-09-10 19:32:11.000000000 +0200
+++ oracleasm-2.0.5-fix/vendor/sles10/oracleasm.spec-generic.in	2009-06-18 22:54:13.000000000 +0200
@@ -17,8 +17,6 @@
 %define buildiseries64		0
 %define buildpmac64		0
 %define buildpseries64		0
-%define builds390		0
-%define builds390x		0
 
 %ifarch %{ix86}
 %define karch i386
@@ -53,19 +51,15 @@
 %ifarch s390
 %define karch s390
 
-%define builddefault		0
 %define buildsmp		0
 %define buildbigsmp		0
-%define builds390		1
 %endif
 
 %ifarch s390x
 %define karch s390
 
-%define builddefault		0
 %define buildsmp		0
 %define buildbigsmp		0
-%define builds390x		1
 %endif
 
 
@@ -238,41 +232,6 @@
 %endif
 
 
-%if %{builds390}
-%package s390
-Summary: The Oracle Automatic Storage Management library driver for IBM S/390 31-bit systems.
-Group: System Environment/Kernel
-Provides: oracleasm = %{version}
-AutoReqProv: no
-Requires: kernel-s390 = %{kver}
-Requires: oracleasm-support >= %{support_ver}
-Conflicts: oracleasmlib < %{min_enodev}
-BuildRequires: kernel-source = %{kver}, kernel-syms = %{kver}
-
-%description s390
-Kernel driver for the Oracle Automatic Storage Management library.
-This package is compiled for IBM S/390 31-bit systems.
-%endif
-
-
-%if %{builds390x}
-%package s390x
-Summary: The Oracle Automatic Storage Management library driver for IBM zSeries systems.
-Group: System Environment/Kernel
-Provides: oracleasm = %{version}
-AutoReqProv: no
-Requires: kernel-s390x = %{kver}
-Requires: oracleasm-support >= %{support_ver}
-Conflicts: oracleasmlib < %{min_enodev}
-BuildRequires: kernel-source = %{kver}, kernel-syms = %{kver}
-
-%description s390x
-Kernel driver for the Oracle Automatic Storage Management library.
-This package is compiled for IBM zSeries systems.
-%endif
-
-
-
 %prep
 %setup -n oracleasm-%{version}
 
@@ -411,35 +370,6 @@
 make clean
 %endif
 
-%if %{builds390}
-local_configure "%{kver}-s390"
-make QUIET=1
-make DESTDIR="$RPM_BUILD_ROOT" INSTALL_MOD_PATH='$(DESTDIR)' install 
-
-# 2.6 kbuild can't do this install nicely
-EXTRA_MODLIB="${RPM_BUILD_ROOT}/lib/modules/%{kver}-s390/extra"
-INST_MODLIB="${RPM_BUILD_ROOT}/lib/modules/%{kver}-s390/kernel/drivers/addon/oracleasm"
-mkdir -p "${INST_MODLIB}"
-mv "${EXTRA_MODLIB}"/oracleasm.ko "${INST_MODLIB}/"
-
-make clean
-%endif
-
-%if %{builds390x}
-local_configure "%{kver}-s390x"
-make QUIET=1
-make DESTDIR="$RPM_BUILD_ROOT" INSTALL_MOD_PATH='$(DESTDIR)' install 
-
-# 2.6 kbuild can't do this install nicely
-EXTRA_MODLIB="${RPM_BUILD_ROOT}/lib/modules/%{kver}-s390x/extra"
-INST_MODLIB="${RPM_BUILD_ROOT}/lib/modules/%{kver}-s390x/kernel/drivers/addon/oracleasm"
-mkdir -p "${INST_MODLIB}"
-mv "${EXTRA_MODLIB}"/oracleasm.ko "${INST_MODLIB}/"
-
-make clean
-%endif
-
-
 
 %install
 
@@ -530,28 +460,11 @@
 %endif
 
 
-%if %{builds390}
-%post s390
-depmod -ae %{kver}-s390
-
-%files s390
-%defattr(-,root,root)
-/lib/modules/%{kver}-s390/kernel/drivers/addon/oracleasm
-%endif
-
-
-%if %{builds390x}
-%post s390x
-depmod -ae %{kver}-s390x
-
-%files s390x
-%defattr(-,root,root)
-/lib/modules/%{kver}-s390x/kernel/drivers/addon/oracleasm
-%endif
-
-
 
 %changelog
+* Thu Oct 23 2008 Joel Becker <joel.becker@oracle.com>
+- Remove s390 sections, as it now uses -default.
+
 * Tue Sep 21 2004 Joel Becker <joel.becker@oracle.com>
 - Make SLES9 specfile.
 
diff -ruN oracleasm-2.0.5/vendor/sles11/Makefile oracleasm-2.0.5-fix/vendor/sles11/Makefile
--- oracleasm-2.0.5/vendor/sles11/Makefile	1970-01-01 01:00:00.000000000 +0100
+++ oracleasm-2.0.5-fix/vendor/sles11/Makefile	2009-06-18 22:54:13.000000000 +0200
@@ -0,0 +1,12 @@
+TOPDIR = ../..
+
+include $(TOPDIR)/Preamble.make
+
+DIST_FILES =				\
+	oracleasm.spec-generic.in	\
+	kernel.guess			\
+	rpmarch.guess			\
+	Vendor.make			\
+	vendor.guess
+
+include $(TOPDIR)/Postamble.make
diff -ruN oracleasm-2.0.5/vendor/sles11/Vendor.make oracleasm-2.0.5-fix/vendor/sles11/Vendor.make
--- oracleasm-2.0.5/vendor/sles11/Vendor.make	1970-01-01 01:00:00.000000000 +0100
+++ oracleasm-2.0.5-fix/vendor/sles11/Vendor.make	2009-06-18 22:54:13.000000000 +0200
@@ -0,0 +1,27 @@
+#
+# SLES 11
+#
+
+TOOLSARCH = $(shell $(TOPDIR)/vendor/sles11/rpmarch.guess tools $(TOPDIR))
+MODULEARCH = $(shell $(TOPDIR)/vendor/sles11/rpmarch.guess module $(TOPDIR))
+VENDOR_EXTENSION = SLE11
+
+
+$(TOPDIR)/vendor/sles11/oracleasm-%.spec: $(TOPDIR)/vendor/sles11/oracleasm.spec-generic
+	SPECVER="$@"; \
+		SPECVER="$${SPECVER#*oracleasm-}"; \
+		SPECVER="$${SPECVER%.spec}"; \
+		sed -e 's/@@KVER@@/'$${SPECVER}'/' -e 's/@@PKG_VERSION@@/'$(PKG_VERSION)'/' < $< > $@
+
+sles11_%_srpm: dist $(TOPDIR)/vendor/sles11/oracleasm-%.spec
+	rpmbuild -bs --define "_sourcedir $(TOPDIR)" --define "_srcrpmdir $(TOPDIR)" $(TOPDIR)/vendor/sles11/oracleasm-$(patsubst sles11_%_srpm,%,$@).spec
+
+sles11_%_rpm: sles11_%_srpm
+	rpmbuild --rebuild $(MODULEARCH) "oracleasm-$(patsubst sles11_%_rpm,%,$@)-$(DIST_VERSION)-$(PKG_VERSION).$(VENDOR_EXTENSION).src.rpm"
+
+
+# Package required for /usr/include/linux
+INCLUDE_REQUIRES = linux-kernel-headers
+include $(TOPDIR)/vendor/common/Vendor.make
+
+packages: $(shell $(TOPDIR)/vendor/sles11/kernel.guess targets) headers_rpm
diff -ruN oracleasm-2.0.5/vendor/sles11/kernel.guess oracleasm-2.0.5-fix/vendor/sles11/kernel.guess
--- oracleasm-2.0.5/vendor/sles11/kernel.guess	1970-01-01 01:00:00.000000000 +0100
+++ oracleasm-2.0.5-fix/vendor/sles11/kernel.guess	2009-06-18 22:54:13.000000000 +0200
@@ -0,0 +1,299 @@
+#!/bin/sh
+
+SLES11_KERNEL_BASE="/usr/src"
+
+#
+# SLES11 has wacky names for its kernel flavors.  So we'll just create
+# a list here of the mappings.  It's pretty simple.  One entry per
+# architecture, <arch>:<flavor1>[,<flavor> ...]
+#
+# Anyway, we can even reuse this when detecting kernels to build
+# packages for.  A kernel is only built if build trees for all flavors
+# are installed.
+#
+SLES11_KERNEL_TYPES="
+    x86_64:default,xen
+    ppc64:pseries64,iseries64,pmac64
+    ia64:default,64k-pagesize,sn2
+    i386:default,pae,vmi,xen
+    s390:default
+"
+    
+
+
+guess_sles11_arch()
+{
+    ARCH=$(uname -m)
+    case "$ARCH" in
+    i386|i586|i686)
+	echo "i386"
+        ;;
+    s390x)
+        echo "s390"
+        ;;
+    *)
+        # This appears to be correct on ppc64
+        echo "$ARCH"
+        ;;
+    esac
+}
+
+guess_sles11_type()
+{
+    KVER="$1"
+
+    ARCH="$(guess_sles11_arch)"
+    if [ -z "$ARCH" ]
+    then
+        return
+    fi
+
+    for typelist in $SLES11_KERNEL_TYPES
+    do
+        TARCH=$(echo $typelist | cut -f1 -d:)
+        if [ "$TARCH" = "$ARCH" ]
+        then
+            for type in $(echo $typelist | cut -f2 -d: | sed -e 's/,/ /g')
+            do
+                case "$KVER" in
+                *-${type})
+                    echo "$type"
+                    break
+                    ;;
+                *)
+                    ;;
+                esac
+            done
+            break
+        fi
+    done
+}
+
+guess_sles11_dir()
+{
+    KVER="$1"
+
+    DIRTYPE=$(guess_sles11_type "$KVER")
+    ARCH=$(guess_sles11_arch)
+
+    if [ -n "$DIRTYPE" ]
+    then
+        echo "linux-${1%-${DIRTYPE}}-obj/${ARCH}/${DIRTYPE}"
+    fi
+}
+
+verfromdir()
+{
+    TESTDIR="$1"
+    if [ -r "${TESTDIR}/include/linux/utsrelease.h" ]
+    then
+        awk '/UTS_RELEASE/{gsub(/"/,"",$3); print $3}' "${TESTDIR}/include/linux/utsrelease.h"
+    fi
+}
+
+validate_dir()
+{
+    KVER="$1"
+    DIR="$2"
+
+    if [ ! -d "${SLES11_KERNEL_BASE}/${DIR}" ]
+    then
+        return 1
+    elif [ ! -f "${SLES11_KERNEL_BASE}/${DIR}/include/linux/autoconf.h" ]
+    then
+        return 1
+    elif [ ! -f "${SLES11_KERNEL_BASE}/${DIR}/include/linux/version.h" ]
+    then
+        return 1
+    fi
+
+    if [ "$KVER" != "`verfromdir "${SLES11_KERNEL_BASE}/${DIR}"`" ]
+    then
+        return 1
+    fi
+
+    return 0
+}
+
+# Takes a `uname -r` and returns "ver type", where ver
+# is 2.6.9-NN.EL and type is "smp" or the like.
+validate_version()
+{
+    KVER="$1"
+
+    dir=`guess_sles11_dir "$KVER"`
+    if validate_dir "$KVER" "$dir"
+    then
+        echo "${SLES11_KERNEL_BASE}/${dir}"
+    fi
+}
+
+find_version()
+{
+    ARCH="$(guess_sles11_arch)"
+    if [ -z "$ARCH" ]
+    then
+        return
+    fi
+
+    types=
+    for typelist in $SLES11_KERNEL_TYPES
+    do
+        TARCH=$(echo $typelist | cut -f1 -d:)
+        if [ "$TARCH" = "$ARCH" ]
+        then
+            types=$(echo $typelist | cut -f2 -d: | sed -e 's/,/ /g')
+            break
+        fi
+    done
+
+    if [ -z "$types" ]
+    then
+        return
+    fi
+
+     # Find the most recent valid kernel
+    ls -1 -t "$SLES11_KERNEL_BASE" | while read kdir
+    do
+        if [ -L "${SLES11_KERNEL_BASE}/${kdir}" -o ! -d "${SLES11_KERNEL_BASE}/${kdir}" ]
+        then
+            continue
+        fi
+
+        case "$kdir" in
+        *-obj)
+            ;;
+        *)
+            continue
+            ;;
+        esac
+        KERNELDIR=
+        for type in $types
+        do
+            KVER="`verfromdir "${SLES11_KERNEL_BASE}/${kdir}/${ARCH}/${type}"`"
+            if validate_dir "$KVER" "$kdir/${ARCH}/${type}"
+            then
+                KERNELDIR="${SLES11_KERNEL_BASE}/${kdir}/${ARCH}/${type}"
+                break
+            fi
+        done
+        if [ -n "$KERNELDIR" ]
+        then
+            echo "$KERNELDIR"
+            break
+        fi
+    done
+}
+
+validate_target()
+{
+    DIR="$1"
+    ARCH="$2"
+    types="$3"
+    for type in $types
+    do
+        KVER="`verfromdir "${SLES11_KERNEL_BASE}/${kdir}/${ARCH}/${type}"`"
+        if ! validate_dir "$KVER" "$kdir/${ARCH}/${type}"
+        then
+            return 1
+        fi
+    done
+
+    return 0
+}
+
+find_targets()
+{
+    ARCH="$(guess_sles11_arch)"
+    if [ -z "$ARCH" ]
+    then
+        return
+    fi
+
+    types=
+    for typelist in $SLES11_KERNEL_TYPES
+    do
+        TARCH=$(echo $typelist | cut -f1 -d:)
+        if [ "$TARCH" = "$ARCH" ]
+        then
+            types=$(echo $typelist | cut -f2 -d: | sed -e 's/,/ /g')
+            break
+        fi
+    done
+
+    if [ -z "$types" ]
+    then
+        return
+    fi
+
+    ls -1 -t "$SLES11_KERNEL_BASE" | while read kdir
+    do
+        # Avoid the symlinks
+        if [ -L "${SLES11_KERNEL_BASE}/${kdir}" -o ! -d "${SLES11_KERNEL_BASE}/${kdir}" ]
+        then
+            continue
+        fi
+        case "$kdir" in
+        linux-*-obj)
+            if validate_target "$kdir" "$ARCH" "$types"
+            then
+                KVER="${kdir#linux-}"
+                KVER="${KVER%-obj}"
+		SYMS="$(rpm -qa 2>/dev/null | grep "^kernel-syms-${KVER}" 2>/dev/null)"
+                if [ -n "$SYMS" ]
+                then
+                    echo "sles11_${KVER}_rpm"
+                fi
+            fi
+            ;;
+        *)
+            ;;
+        esac
+    done
+}
+
+sles11_includes()
+{
+    DIR="$1"
+    kernelsrc=`awk '/^KERNELSRC/{print $3}' "${DIR}/Makefile" 2>/dev/null`
+
+    INCLUDES="$DIR/include"
+    [ -n "$kernelsrc" ] && INCLUDES="${INCLUDES} ${DIR}/${kernelsrc}/include"
+
+    echo "$INCLUDES"
+}
+
+case "$1" in
+include|build)
+    if [ -n "$2" ]
+    then
+        KPATH="`validate_version "$2"`"
+    else
+        KVER="`uname -r`"
+        KPATH="`validate_version "$KVER"`"
+        if [ -z "$KPATH" ]
+        then
+            KPATH="`find_version`"
+        fi
+    fi
+    if [ -n "$KPATH" ]
+    then
+        if [ "$1" = "include" ]
+        then
+            sles11_includes "${KPATH}"
+        else
+            echo "${KPATH}"
+        fi
+    fi
+    ;;
+targets)
+    find_targets
+    ;;
+"")
+    echo "Missing operation" >&2
+    ;;
+*)
+    echo "Invalid operation: $1" >&2
+    exit 1
+    ;;
+esac
diff -ruN oracleasm-2.0.5/vendor/sles11/oracleasm.spec-generic.in oracleasm-2.0.5-fix/vendor/sles11/oracleasm.spec-generic.in
--- oracleasm-2.0.5/vendor/sles11/oracleasm.spec-generic.in	1970-01-01 01:00:00.000000000 +0100
+++ oracleasm-2.0.5-fix/vendor/sles11/oracleasm.spec-generic.in	2009-06-18 22:54:13.000000000 +0200
@@ -0,0 +1,491 @@
+#
+# Spec file for oracleasm
+#
+
+# Macros
+# This one is hardcoded because, well, it belongs there
+%define _prefix /usr
+# Because RPM is dumb
+%define _unpackaged_files_terminate_build 0
+
+# Turn on's and off's
+%define builddefault		1
+%define buildsmp		1
+%define buildbigsmp		1
+%define build64kpagesize	0
+%define buildsn2		0
+%define buildiseries64		0
+%define buildpmac64		0
+%define buildpseries64		0
+
+%ifarch %{ix86}
+%define karch i386
+%endif
+
+%ifarch x86_64 ia32e
+%define karch x86_64
+
+%define buildbigsmp		0
+%endif
+
+%ifarch ia64
+%define karch ia64
+
+%define buildsmp		0
+%define buildbigsmp		0
+%define build64kpagesize	1
+%define buildsn2		1
+%endif
+
+%ifarch ppc64
+%define karch ppc64
+
+%define builddefault		0
+%define buildsmp		0
+%define buildbigsmp		0
+%define buildiseries64		1
+%define buildpmac64		1
+%define buildpseries64		1
+%endif
+
+%ifarch s390
+%define karch s390
+
+%define buildsmp		0
+%define buildbigsmp		0
+%endif
+
+%ifarch s390x
+%define karch s390
+
+%define buildsmp		0
+%define buildbigsmp		0
+%endif
+
+
+# This must be changed to the minimum ABI compat kernel version expected
+%define kver		@@KVER@@
+
+# The minimum -support package required for the kernel bits.
+%define support_ver     2.0.0
+# Minimum oracleasmlib version that supports positive ASM_ERR_NODEV.
+%define min_enodev	2.0.1
+
+Summary: The Oracle Automatic Storage Management library driver.
+Name: oracleasm-%{kver}
+Version: @DIST_VERSION@
+Release: @@PKG_VERSION@@.SLE10
+License: GPL
+Group: System Environment/Kernel
+Source: oracleasm-@DIST_VERSION@.tar.gz
+URL: http://oss.oracle.com/projects/oracleasm/
+Distribution: Oracle
+Vendor: Oracle Corporation
+Packager: Joel Becker <joel.becker@oracle.com>
+Provides: oracleasm = %{version}
+AutoReqProv: no
+Requires: kernel-default = %{kver}
+Requires: oracleasm-support >= %{support_ver}
+Conflicts: oracleasmlib < %{min_enodev}
+BuildRequires: kernel-source = %{kver}, kernel-syms = %{kver}
+
+
+BuildRoot: %{_tmppath}/oracleasm-%{PACKAGE_VERSION}-%{PACKAGE_RELEASE}-root
+
+
+%description
+Kernel driver for the Oracle Automatic Storage Management library.
+This package is compiled for the default kernel.
+
+%if %{builddefault}
+%package default
+Summary: The Oracle Automatic Storage Management library driver for UP systems.
+Group: System Environment/Kernel
+AutoReqProv: no
+Provides: oracleasm = %{version}
+Requires: kernel-default = %{kver}
+Requires: oracleasm-support >= %{support_ver}
+Conflicts: oracleasmlib < %{min_enodev}
+BuildRequires: kernel-source = %{kver}, kernel-syms = %{kver}
+
+%description default
+Kernel driver for the Oracle Automatic Storage Management library.
+This package is compiled for the default kernel.
+%endif
+
+
+%if %{buildsmp}
+%package smp
+Summary: The Oracle Automatic Storage Management library driver for SMP systems.
+Group: System Environment/Kernel
+AutoReqProv: no
+Provides: oracleasm = %{version}
+Requires: kernel-smp = %{kver}
+Requires: oracleasm-support >= %{support_ver}
+BuildRequires: kernel-source = %{kver}, kernel-syms = %{kver}
+
+%description smp
+Kernel driver for the Oracle Automatic Storage Management library.
+This package is compiled for symmetric multiprocessor kernels.
+%endif
+
+
+%if %{buildbigsmp}
+%package bigsmp
+Summary: The Oracle Automatic Storage Management library driver for NUMA systems.
+Group: System Environment/Kernel
+Provides: oracleasm = %{version}
+AutoReqProv: no
+Requires: kernel-bigsmp = %{kver}
+Requires: oracleasm-support >= %{support_ver}
+Conflicts: oracleasmlib < %{min_enodev}
+BuildRequires: kernel-source = %{kver}, kernel-syms = %{kver}
+
+%description bigsmp
+Kernel driver for the Oracle Automatic Storage Management library.
+This package is compiled for large memory SMP kernels.
+%endif
+
+
+%if %{build64kpagesize}
+%package 64k-pagesize
+Summary: The Oracle Automatic Storage Management library driver for Itanium kernels with a 64KB pagesize.
+Group: System Environment/Kernel
+Provides: oracleasm = %{version}
+AutoReqProv: no
+Requires: kernel-64k-pagesize = %{kver}
+Requires: oracleasm-support >= %{support_ver}
+Conflicts: oracleasmlib < %{min_enodev}
+BuildRequires: kernel-source = %{kver}, kernel-syms = %{kver}
+
+%description 64k-pagesize
+Kernel driver for the Oracle Automatic Storage Management library.
+This package is compiled for Itanium kernels with a 64KB pagesize.
+%endif
+
+
+%if %{buildsn2}
+%package sn2
+Summary: The Oracle Automatic Storage Management library driver for Altix systems.
+Group: System Environment/Kernel
+Provides: oracleasm = %{version}
+AutoReqProv: no
+Requires: kernel-sn2 = %{kver}
+Requires: oracleasm-support >= %{support_ver}
+Conflicts: oracleasmlib < %{min_enodev}
+BuildRequires: kernel-source = %{kver}, kernel-syms = %{kver}
+
+%description sn2
+Kernel driver for the Oracle Automatic Storage Management library.
+This package is compiled for UP Itanium2 kernels.
+%endif
+
+
+%if %{buildiseries64}
+%package iseries64
+Summary: The Oracle Automatic Storage Management library driver for IBM iSeries systems.
+Group: System Environment/Kernel
+Provides: oracleasm = %{version}
+AutoReqProv: no
+Requires: kernel-iseries64 = %{kver}
+Requires: oracleasm-support >= %{support_ver}
+Conflicts: oracleasmlib < %{min_enodev}
+BuildRequires: kernel-source = %{kver}, kernel-syms = %{kver}
+
+%description iseries64
+Kernel driver for the Oracle Automatic Storage Management library.
+This package is compiled for IBM iSeries systems.
+%endif
+
+
+%if %{buildpmac64}
+%package pmac64
+Summary: The Oracle Automatic Storage Management library driver for 64-bit Power Macintosh kernels.
+Group: System Environment/Kernel
+Provides: oracleasm = %{version}
+AutoReqProv: no
+Requires: kernel-pmac64 = %{kver}
+Requires: oracleasm-support >= %{support_ver}
+Conflicts: oracleasmlib < %{min_enodev}
+BuildRequires: kernel-source = %{kver}, kernel-syms = %{kver}
+
+%description pmac64
+Kernel driver for the Oracle Automatic Storage Management library.
+This package is compiled for 64-bit Power Macintosh kernels.
+%endif
+
+
+%if %{buildpseries64}
+%package pseries64
+Summary: The Oracle Automatic Storage Management library driver for IBM pSeries systems.
+Group: System Environment/Kernel
+Provides: oracleasm = %{version}
+AutoReqProv: no
+Requires: kernel-pseries64 = %{kver}
+Requires: oracleasm-support >= %{support_ver}
+Conflicts: oracleasmlib < %{min_enodev}
+BuildRequires: kernel-source = %{kver}, kernel-syms = %{kver}
+
+%description pseries64
+Kernel driver for the Oracle Automatic Storage Management library.
+This package is compiled for IBM pSeries systems.
+%endif
+
+
+%prep
+%setup -n oracleasm-%{version}
+
+
+%build
+
+local_configure()
+{
+	./configure					\
+		--prefix=%{_prefix}			\
+		--exec-prefix=%{_exec_prefix}		\
+		--bindir=%{_bindir}			\
+		--sbindir=%{_sbindir}			\
+		--sysconfdir=%{_sysconfdir}		\
+		--datadir=%{_datadir}			\
+		--includedir=%{_includedir}		\
+		--libdir=%{_libdir}			\
+		--libexecdir=%{_libexecdir}		\
+		--localstatedir=%{_localstatedir}	\
+		--sharedstatedir=%{_sharedstatedir}	\
+		--mandir=%{_mandir}			\
+		--infodir=%{_infodir}			\
+		--with-vendor=sles10			\
+		--with-vendorkernel="$1"
+}
+
+%if %{builddefault}
+local_configure "%{kver}-default"
+make QUIET=1
+make DESTDIR="$RPM_BUILD_ROOT" INSTALL_MOD_PATH='$(DESTDIR)' install 
+
+# 2.6 kbuild can't do this install nicely
+EXTRA_MODLIB="${RPM_BUILD_ROOT}/lib/modules/%{kver}-default/extra"
+INST_MODLIB="${RPM_BUILD_ROOT}/lib/modules/%{kver}-default/kernel/drivers/addon/oracleasm"
+mkdir -p "${INST_MODLIB}"
+mv "${EXTRA_MODLIB}"/oracleasm.ko "${INST_MODLIB}/"
+
+make clean
+%endif
+
+%if %{buildsmp}
+local_configure "%{kver}-smp"
+make QUIET=1
+make DESTDIR="$RPM_BUILD_ROOT" INSTALL_MOD_PATH='$(DESTDIR)' install 
+
+# 2.6 kbuild can't do this install nicely
+EXTRA_MODLIB="${RPM_BUILD_ROOT}/lib/modules/%{kver}-smp/extra"
+INST_MODLIB="${RPM_BUILD_ROOT}/lib/modules/%{kver}-smp/kernel/drivers/addon/oracleasm"
+mkdir -p "${INST_MODLIB}"
+mv "${EXTRA_MODLIB}"/oracleasm.ko "${INST_MODLIB}/"
+
+make clean
+%endif
+
+%if %{buildbigsmp}
+local_configure "%{kver}-bigsmp"
+make QUIET=1
+make DESTDIR="$RPM_BUILD_ROOT" INSTALL_MOD_PATH='$(DESTDIR)' install 
+
+# 2.6 kbuild can't do this install nicely
+EXTRA_MODLIB="${RPM_BUILD_ROOT}/lib/modules/%{kver}-bigsmp/extra"
+INST_MODLIB="${RPM_BUILD_ROOT}/lib/modules/%{kver}-bigsmp/kernel/drivers/addon/oracleasm"
+mkdir -p "${INST_MODLIB}"
+mv "${EXTRA_MODLIB}"/oracleasm.ko "${INST_MODLIB}/"
+
+make clean
+%endif
+
+%if %{build64kpagesize}
+local_configure "%{kver}-64k-pagesize"
+make QUIET=1
+make DESTDIR="$RPM_BUILD_ROOT" INSTALL_MOD_PATH='$(DESTDIR)' install 
+
+# 2.6 kbuild can't do this install nicely
+EXTRA_MODLIB="${RPM_BUILD_ROOT}/lib/modules/%{kver}-64k-pagesize/extra"
+INST_MODLIB="${RPM_BUILD_ROOT}/lib/modules/%{kver}-64k-pagesize/kernel/drivers/addon/oracleasm"
+mkdir -p "${INST_MODLIB}"
+mv "${EXTRA_MODLIB}"/oracleasm.ko "${INST_MODLIB}/"
+
+make clean
+%endif
+
+%if %{buildsn2}
+local_configure "%{kver}-sn2"
+make QUIET=1
+make DESTDIR="$RPM_BUILD_ROOT" INSTALL_MOD_PATH='$(DESTDIR)' install 
+
+# 2.6 kbuild can't do this install nicely
+EXTRA_MODLIB="${RPM_BUILD_ROOT}/lib/modules/%{kver}-sn2/extra"
+INST_MODLIB="${RPM_BUILD_ROOT}/lib/modules/%{kver}-sn2/kernel/drivers/addon/oracleasm"
+mkdir -p "${INST_MODLIB}"
+mv "${EXTRA_MODLIB}"/oracleasm.ko "${INST_MODLIB}/"
+
+make clean
+%endif
+
+%if %{buildiseries64}
+local_configure "%{kver}-iseries64"
+make QUIET=1
+make DESTDIR="$RPM_BUILD_ROOT" INSTALL_MOD_PATH='$(DESTDIR)' install 
+
+# 2.6 kbuild can't do this install nicely
+EXTRA_MODLIB="${RPM_BUILD_ROOT}/lib/modules/%{kver}-iseries64/extra"
+INST_MODLIB="${RPM_BUILD_ROOT}/lib/modules/%{kver}-iseries64/kernel/drivers/addon/oracleasm"
+mkdir -p "${INST_MODLIB}"
+mv "${EXTRA_MODLIB}"/oracleasm.ko "${INST_MODLIB}/"
+
+make clean
+%endif
+
+%if %{buildpmac64}
+local_configure "%{kver}-pmac64"
+make QUIET=1
+make DESTDIR="$RPM_BUILD_ROOT" INSTALL_MOD_PATH='$(DESTDIR)' install 
+
+# 2.6 kbuild can't do this install nicely
+EXTRA_MODLIB="${RPM_BUILD_ROOT}/lib/modules/%{kver}-pmac64/extra"
+INST_MODLIB="${RPM_BUILD_ROOT}/lib/modules/%{kver}-pmac64/kernel/drivers/addon/oracleasm"
+mkdir -p "${INST_MODLIB}"
+mv "${EXTRA_MODLIB}"/oracleasm.ko "${INST_MODLIB}/"
+
+make clean
+%endif
+
+%if %{buildpseries64}
+local_configure "%{kver}-pseries64"
+make QUIET=1
+make DESTDIR="$RPM_BUILD_ROOT" INSTALL_MOD_PATH='$(DESTDIR)' install 
+
+# 2.6 kbuild can't do this install nicely
+EXTRA_MODLIB="${RPM_BUILD_ROOT}/lib/modules/%{kver}-pseries64/extra"
+INST_MODLIB="${RPM_BUILD_ROOT}/lib/modules/%{kver}-pseries64/kernel/drivers/addon/oracleasm"
+mkdir -p "${INST_MODLIB}"
+mv "${EXTRA_MODLIB}"/oracleasm.ko "${INST_MODLIB}/"
+
+make clean
+%endif
+
+
+%install
+
+
+
+%clean
+rm -rf "$RPM_BUILD_ROOT"
+
+
+
+%if %{builddefault}
+%post default
+depmod -ae %{kver}-default
+
+%files default
+%defattr(-,root,root)
+/lib/modules/%{kver}-default/kernel/drivers/addon/oracleasm
+%endif
+
+
+%if %{buildsmp}
+%post smp
+depmod -ae %{kver}-smp
+
+%files smp
+%defattr(-,root,root)
+/lib/modules/%{kver}-smp/kernel/drivers/addon/oracleasm
+%endif
+
+
+%if %{buildbigsmp}
+%post bigsmp
+depmod -ae %{kver}-bigsmp
+
+%files bigsmp
+%defattr(-,root,root)
+/lib/modules/%{kver}-bigsmp/kernel/drivers/addon/oracleasm
+%endif
+
+
+%if %{build64kpagesize}
+%post 64k-pagesize
+depmod -ae %{kver}-64k-pagesize
+
+%files 64k-pagesize
+%defattr(-,root,root)
+/lib/modules/%{kver}-64k-pagesize/kernel/drivers/addon/oracleasm
+%endif
+
+
+%if %{buildsn2}
+%post sn2
+depmod -ae %{kver}-sn2/
+
+%files sn2
+%defattr(-,root,root)
+/lib/modules/%{kver}-sn2/kernel/drivers/addon/oracleasm
+%endif
+
+
+%if %{buildiseries64}
+%post iseries64
+depmod -ae %{kver}-iseries64
+
+%files iseries64
+%defattr(-,root,root)
+/lib/modules/%{kver}-iseries64/kernel/drivers/addon/oracleasm
+%endif
+
+
+%if %{buildpmac64}
+%post pmac64
+depmod -ae %{kver}-pmac64
+
+%files pmac64
+%defattr(-,root,root)
+/lib/modules/%{kver}-pmac64/kernel/drivers/addon/oracleasm
+%endif
+
+
+%if %{buildpseries64}
+%post pseries64
+depmod -ae %{kver}-pseries64
+
+%files pseries64
+%defattr(-,root,root)
+/lib/modules/%{kver}-pseries64/kernel/drivers/addon/oracleasm
+%endif
+
+
+
+%changelog
+* Thu Oct 23 2008 Joel Becker <joel.becker@oracle.com>
+- Remove s390 sections, as it now uses -default.
+
+* Tue Sep 21 2004 Joel Becker <joel.becker@oracle.com>
+- Make SLES9 specfile.
+
+* Tue Jan 13 2004 Joel Becker <joel.becker@oracle.com>
+- Make kernel-only.
+
+* Thu Nov 20 2003 Joel Becker <joel.becker@oracle.com>
+- Add x86 and ia64 targets.
+
+* Wed Nov 19 2003 Joel Becker <joel.becker@oracle.com>
+- Make the UL SP3 changes.
+
+* Wed Nov 12 2003 Joel Becker <joel.becker@oracle.com>
+- Start the ASM rename.
+
+* Thu Oct 30 2003 Joel Becker <joel.becker@oracle.com>
+- Created EL3 version
+
+* Mon Jun 23 2003 Joel Becker <joel.becker@oracle.com>
+- Added osm-lib bits
+
+* Fri Jun 20 2003 Joel Becker <joel.becker@oracle.com>
+- Initial RPM
+
diff -ruN oracleasm-2.0.5/vendor/sles11/rpmarch.guess oracleasm-2.0.5-fix/vendor/sles11/rpmarch.guess
--- oracleasm-2.0.5/vendor/sles11/rpmarch.guess	1970-01-01 01:00:00.000000000 +0100
+++ oracleasm-2.0.5-fix/vendor/sles11/rpmarch.guess	2009-06-18 22:54:13.000000000 +0200
@@ -0,0 +1,70 @@
+#! /bin/sh
+
+mode="$1"
+srcdir="$2"
+
+host_cpu=
+
+QUERYFILE=/etc/SuSE-release
+
+if test -n "$QUERYFILE"; then
+  host_cpu="`rpm -qf $QUERYFILE --queryformat \"%{ARCH}\"`"
+fi
+
+if test -z "$host_cpu" -o "$host_cpu" = "noarch" ; then
+  host_alias=`$srcdir/config.guess`
+  host=`$srcdir/config.sub $host_alias`
+  host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+fi
+
+case "$host_cpu" in
+  x86_64|ia64|s390x)
+    TOOLSARCH="$host_cpu"
+    ;;
+  i386|i486|i586|i686|i786|k6|k7)
+    TOOLSARCH="i386"
+    ;;
+  ppc|ppc64|ppciseries|ppcpseries|ppc64iseries|ppc64pseries|powerpc|powerpc64)
+    TOOLSARCH="ppc64"
+    ;;
+  *)
+    echo "rpmarch.guess: Warning: unknown RPM CPU architecture: $host_cpu" >&2
+    TOOLSARCH=""
+    ;;
+esac
+
+# Only a few of these need to be overwritten from RPM's default
+case "$host_cpu" in
+  i586)
+    MODULEARCH="$host_cpu"
+    ;;
+  i386|i686)
+    MODULEARCH="i586"
+    ;;
+  ppc|ppc64|ppciseries|ppcpseries|ppc64iseries|ppc64pseries|powerpc|powerpc64)
+    MODULEARCH="ppc64"
+    ;;
+  *)
+    MODULEARCH=""
+    ;;
+esac
+
+case "$mode" in
+  module)
+    if [ -n "$MODULEARCH" ] ; then
+      echo "--target $MODULEARCH"
+    fi
+    ;;
+  tools)
+    if [ -n "$TOOLSARCH" ] ; then
+      echo "--target $TOOLSARCH"
+    fi
+    ;;
+  *)
+    echo "rpmarch.guess: Invalid mode: $mode" >&2
+    echo "error"
+    exit 1
+    ;;
+esac
+
+exit 0
diff -ruN oracleasm-2.0.5/vendor/sles11/vendor.guess oracleasm-2.0.5-fix/vendor/sles11/vendor.guess
--- oracleasm-2.0.5/vendor/sles11/vendor.guess	1970-01-01 01:00:00.000000000 +0100
+++ oracleasm-2.0.5-fix/vendor/sles11/vendor.guess	2009-06-18 22:54:13.000000000 +0200
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+if [ ! -f /etc/SuSE-release ]
+then
+    exit 1
+fi
+
+if [ "`rpm -qf /etc/SuSE-release --qf '%{VERSION}' 2>/dev/null`" != "11" ]
+then
+    exit 1
+fi
+
+exit 0
