]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Merge 1.3.77 from /debian/openafs/vendor/development onto experimental branch
authorSam Hartman <hartmans@debian.org>
Sun, 9 Jan 2005 00:27:18 +0000 (00:27 +0000)
committerSam Hartman <hartmans@debian.org>
Sun, 9 Jan 2005 00:27:18 +0000 (00:27 +0000)
169 files changed:
Makefile.in
README
README-NT
acinclude.m4
aclocal.m4
configure
configure-libafs
configure-libafs.in
configure.in
debian/changelog
src/WINNT/afsapplib/NTMakefile
src/WINNT/afsd/NTMakefile
src/WINNT/afsd/afsd.h
src/WINNT/afsd/afsd_init.c
src/WINNT/afsd/afsd_service.c
src/WINNT/afsd/afsicf.cpp
src/WINNT/afsd/afslogon.c
src/WINNT/afsd/cm_buf.c
src/WINNT/afsd/cm_callback.c
src/WINNT/afsd/cm_callback.h
src/WINNT/afsd/cm_config.c
src/WINNT/afsd/cm_config.h
src/WINNT/afsd/cm_freelance.c
src/WINNT/afsd/cm_freelance.h
src/WINNT/afsd/cm_ioctl.c
src/WINNT/afsd/cm_scache.c
src/WINNT/afsd/cm_scache.h
src/WINNT/afsd/cm_server.h
src/WINNT/afsd/cm_user.c
src/WINNT/afsd/cm_user.h
src/WINNT/afsd/cm_vnodeops.c
src/WINNT/afsd/cm_volume.c
src/WINNT/afsd/smb.c
src/WINNT/afsd/smb.h
src/WINNT/afsd/smb3.c
src/WINNT/afsd/smb3.h
src/WINNT/afssvrcfg/NTMakefile
src/WINNT/afssvrcpa/NTMakefile
src/WINNT/afssvrmgr/NTMakefile
src/WINNT/afsusrmgr/NTMakefile
src/WINNT/client_config/drivemap.cpp
src/WINNT/client_config/tab_drives.cpp
src/WINNT/client_creds/NTMakefile
src/WINNT/client_creds/creds.cpp
src/WINNT/client_creds/credstab.cpp
src/WINNT/client_osi/NTMakefile
src/WINNT/install/NSIS/OpenAFS.nsi
src/WINNT/install/wix/feature.wxi
src/WINNT/install/wix/property.wxi
src/WINNT/install/wix/registry.wxi
src/WINNT/pthread/NTMakefile
src/WINNT/pthread/pthread.c
src/afs/LINUX/osi_alloc.c
src/afs/LINUX/osi_file.c
src/afs/LINUX/osi_machdep.h
src/afs/LINUX/osi_misc.c
src/afs/LINUX/osi_module.c
src/afs/LINUX/osi_prototypes.h
src/afs/LINUX/osi_sleep.c
src/afs/LINUX/osi_vfs.hin
src/afs/LINUX/osi_vfsops.c
src/afs/LINUX/osi_vnodeops.c
src/afs/OBSD/osi_vfsops.c
src/afs/VNOPS/afs_vnop_attrs.c
src/afs/VNOPS/afs_vnop_flock.c
src/afs/VNOPS/afs_vnop_lookup.c
src/afs/VNOPS/afs_vnop_remove.c
src/afs/VNOPS/afs_vnop_write.c
src/afs/afs.h
src/afs/afs_call.c
src/afs/afs_conn.c
src/afs/afs_daemons.c
src/afs/afs_dcache.c
src/afs/afs_init.c
src/afs/afs_memcache.c
src/afs/afs_osi.c
src/afs/afs_pioctl.c
src/afs/afs_prototypes.h
src/afs/afs_segments.c
src/afs/afs_server.c
src/afs/afs_stats.h
src/afs/afs_util.c
src/afs/afs_volume.c
src/afs/sysincludes.h
src/afsd/afsd.c
src/aklog/aklog.1 [new file with mode: 0644]
src/aklog/aklog.c [new file with mode: 0644]
src/aklog/aklog.h [new file with mode: 0644]
src/aklog/aklog_main.c [new file with mode: 0644]
src/aklog/aklog_param.c [new file with mode: 0644]
src/aklog/krb_util.c [new file with mode: 0644]
src/aklog/linked_list.c [new file with mode: 0644]
src/aklog/linked_list.h [new file with mode: 0644]
src/cf/linux-test1.m4
src/cf/linux-test3.m4
src/cf/osconf.m4
src/comerr/Makefile.in
src/config/NTMakefile.i386_nt40
src/config/NTVersioninfo.rc
src/config/afs_args.h
src/config/afs_sysnames.h
src/config/afsconfig.h.in
src/config/param.amd64_linux26.h
src/config/param.i386_nbsd21.h [new file with mode: 0644]
src/config/param.i386_umlinux26.h [new file with mode: 0644]
src/config/param.ia64_linux26.h [new file with mode: 0644]
src/config/param.nbsd21.h [new file with mode: 0644]
src/config/param.sun4x_510.h
src/config/param.sun4x_58.h
src/config/param.sun4x_59.h
src/des/Makefile.in
src/export/cfgexport.c
src/kauth/admin_tools.c
src/kauth/authclient.c
src/libadmin/kas/afs_kasAdmin.c
src/libafs/MakefileProto.LINUX.in
src/libafsauthent/Makefile.in
src/libafsauthent/NTMakefile
src/libafsrpc/Makefile.in
src/libuafs/MakefileProto.AIX.in
src/lwp/Makefile.in
src/lwp/lwp.c
src/lwp/lwp.h
src/lwp/lwp_elf.h
src/packaging/MacOS/OpenAFS.Info.plist
src/packaging/MacOS/OpenAFS.info
src/rx/LINUX/rx_knet.c
src/rx/rx.c
src/rx/rx.h
src/rx/rx_event.c
src/rx/rx_event.h
src/rx/rx_getaddr.c
src/rx/rx_globals.c
src/rx/rx_kcommon.h
src/rx/rx_lwp.c
src/rx/rx_multi.c
src/rx/rx_packet.c
src/rx/rx_prototypes.h
src/rx/rx_rdwr.c
src/rx/rxdebug.c
src/rx/xdr.c
src/rx/xdr_afsuuid.c
src/rx/xdr_array.c
src/rx/xdr_arrayn.c
src/rx/xdr_int32.c
src/rx/xdr_rx.c
src/rxdebug/rxdebug.c
src/rxkad/Makefile.in
src/rxkad/rxkad.p.h
src/rxkad/rxkad_common.c
src/rxkad/rxkad_prototypes.h
src/shlibafsauthent/Makefile.in
src/shlibafsrpc/Makefile.in
src/sys/Makefile.in
src/sys/NTMakefile
src/sys/pioctl_nt.c
src/tests/dumptool.c
src/ubik/ubik.p.h
src/ubik/ubikclient.c
src/util/afs_lhash.c
src/venus/Makefile.in
src/venus/kdump.c
src/vol/Makefile.in
src/vol/NTMakefile
src/vol/vol-bless.c [new file with mode: 0644]
src/vol/volume.c
src/vol/volume.h
src/volser/volprocs.c
src/volser/vsutils.c

index e8bf92dbe62054b65f1d638ac324325fbf12c0e6..303d8cce1553a96ba5f9d213db6adbb835d861ea 100644 (file)
@@ -166,7 +166,7 @@ afs: export pinstall comerr afs_depinstall
 des: config pinstall
        ${COMPILE_PART1} des ${COMPILE_PART2} 
 
-sys: cmd comerr afs des rx rxstat fsint
+sys: cmd comerr afs des rx rxstat fsint sys_depinstall
        ${COMPILE_PART1} sys ${COMPILE_PART2}
 
 rxkad: cmd comerr sys des rx rxkad_depinstall
@@ -365,6 +365,9 @@ afs_depinstall: pinstall comerr
 dir_depinstall: pinstall
        ${COMPILE_PART1} dir ${COMPILE_DEPINSTALL}
 
+sys_depinstall: pinstall
+       ${COMPILE_PART1} sys ${COMPILE_DEPINSTALL}
+
 kauth_depinstall: pinstall rxgen comerr
        ${COMPILE_PART1} kauth ${COMPILE_DEPINSTALL}
 
@@ -379,11 +382,11 @@ libafs_setup: config export
        src/config/config src/libafs/MakefileProto.${MKAFS_OSTYPE} src/libafs/Makefile ${SYS_NAME}
 
 libafs: libafs_setup lwp_depinstall rx_depinstall vlserver_depinstall rxkad_depinstall fsint_depinstall \
-               libacl_depinstall afs_depinstall dir_depinstall rxstat_depinstall
+               libacl_depinstall afs_depinstall dir_depinstall rxstat_depinstall sys_depinstall
        ${COMPILE_PART1} libafs ${COMPILE_PART2}
 
 libafs_tree: libafs_setup lwp_depinstall rx_depinstall vlserver_depinstall rxkad_depinstall fsint_depinstall \
-               libacl_depinstall afs_depinstall dir_depinstall rxstat_depinstall
+               libacl_depinstall afs_depinstall dir_depinstall rxstat_depinstall sys_depinstall
        ${TOP_SRCDIR}/config/make_libafs_tree.pl \
                -sn $(SYS_NAME) \
                -os $(MKAFS_OSTYPE) \
@@ -405,7 +408,7 @@ libuafs_setup: config export
 libuafs: libuafs_setup vlserver_depinstall rx_depinstall fsint_depinstall \
                auth_depinstall dir_depinstall libacl_depinstall rxkad_depinstall \
                ubik_depinstall afs_depinstall kauth_depinstall ptserver_depinstall \
-               rxstat_depinstall lwp_depinstall des
+               rxstat_depinstall lwp_depinstall sys_depinstall des
        set -x; \
        case ${SYS_NAME} in \
        hp_ux102* | *_obsd* | sun*_4* | *_nbsd*| hp_ux11i | ia64_hpux112*) \
diff --git a/README b/README
index 6757cd5858773bf7ccd380c09856fb615d8c6c8a..086c44de88aee81f39e31e939f03dea8e217321d 100644 (file)
--- a/README
+++ b/README
@@ -53,6 +53,7 @@ A. Creating the proper directory structure.
       alpha_linux22 
       alpha_linux24 
       ia64_linux24
+      ia64_linux26
       sparc_linux22
       sparc_linux24
       sparc64_linux22
index 40e4103fb6c41e79ecb608d7601ea68f330483f4..7507062ddde763d6227bcab90dbb5d85ffcda148 100644 (file)
--- a/README-NT
+++ b/README-NT
@@ -42,14 +42,14 @@ The Microsoft development tools require anywhere from 660 MB to 1.8GB
 of storage depending on which compilers are selected.  The following 
 versions are supported:
 
-    Microsoft Visual .NET 
+    Microsoft Visual Studio .NET 
       available via a MSDN subscription
 
-    Microsoft Visual .NET 2003 (recommended)
+    Microsoft Visual Studio .NET 2003 (recommended)
       available via a MSDN subscription
 
-    Microsoft Visual C++ Toolkit 2003 (same as .NET 2003)
-      http://msdn.microsoft.com/visualc/vctoolkit2003/
+    Microsoft Visual Studio .NET 2005 (do not use for production)
+      available via a MSDN subscription
 
 The following Microsoft SDK is required:
 
@@ -129,8 +129,8 @@ The AFS base directory should look something like the following:
 
 STEP B. Install compiler and development tools.
 
-Install a copy of Microsoft Visual .NET, Visual .NET 2003, Visual C++
-Toolkit 2003.  The "Typical" install setting is sufficient.
+Install a copy of Microsoft Visual Studio .NET, Visual Studio .NET 2003, 
+or Visual Studio .NET 2005.  The "Typical" install setting is sufficient.
 
 (1) You can reduce the installation size by selecting "Custom" install
 and remove all but the following Options:
@@ -176,9 +176,9 @@ customized for use on your development system.  The following variables
 must be defined to match your configuration:
 
   AFSVER_CL: Set to 1200 if using MS Visual C++ 6.0
-             Set to 1300 if using MS Visual .NET
-             Set to 1310 if using MS Visual .NET 2003
-             Set to 1400 if using MS Visual .NET 2005
+             Set to 1300 if using MS Visual Studio .NET
+             Set to 1310 if using MS Visual Studio .NET 2003
+             Set to 1400 if using MS Visual Studio .NET 2005
 
   MSVCDIR: Set to the short name version of the directory into which
            the visual C++ compiler was installed regardless of version
index a887fc73731b762c063afffdae72ef5c16176d80..49b317a580a6136d4cc6ecf4b9afd5c87c97f581 100644 (file)
@@ -106,6 +106,7 @@ AC_MSG_CHECKING(your OS)
 system=$host
 case $system in
         *-linux*)
+
                MKAFS_OSTYPE=LINUX
                if test "x$enable_redhat_buildsys" = "xyes"; then
                 AC_DEFINE(ENABLE_REDHAT_BUILDSYS, 1, [define if you have redhat buildsystem])
@@ -156,170 +157,12 @@ case $system in
                  SUBARCH=default
                fi
                AC_MSG_RESULT(linux)
-               if test "x$enable_kernel_module" = "xyes"; then
-                if test "x$enable_debug_kernel" = "xno"; then
-                       LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -fomit-frame-pointer"
-                fi
-                OPENAFS_GCC_SUPPORTS_MARCH
-                AC_SUBST(P5PLUS_KOPTS)
-                OPENAFS_GCC_NEEDS_NO_STRENGTH_REDUCE
-                OPENAFS_GCC_NEEDS_NO_STRICT_ALIASING
-                OPENAFS_GCC_SUPPORTS_NO_COMMON
-                OPENAFS_GCC_SUPPORTS_PIPE
-                AC_SUBST(LINUX_GCC_KOPTS)
-                ifdef([OPENAFS_CONFIGURE_LIBAFS],
-                  [LINUX_BUILD_VNODE_FROM_INODE(src/config,afs)],
-                  [LINUX_BUILD_VNODE_FROM_INODE(${srcdir}/src/config,src/afs/LINUX,${srcdir}/src/afs/LINUX)]
-                )
-                LINUX_COMPLETION_H_EXISTS
-                LINUX_DEFINES_FOR_EACH_PROCESS
-                LINUX_DEFINES_PREV_TASK
-                LINUX_EXPORTS_TASKLIST_LOCK
-                LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK
-                LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_GFP_MASK
-                LINUX_FS_STRUCT_INODE_HAS_I_ALLOC_SEM
-                LINUX_FS_STRUCT_INODE_HAS_I_TRUNCATE_SEM
-                LINUX_FS_STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS
-                LINUX_FS_STRUCT_INODE_HAS_I_DEVICES
-                LINUX_FS_STRUCT_INODE_HAS_I_SECURITY
-                LINUX_INODE_SETATTR_RETURN_TYPE
-                LINUX_KERNEL_LINUX_SYSCALL_H
-                LINUX_KERNEL_SELINUX
-                LINUX_KERNEL_SOCK_CREATE
-                LINUX_NEED_RHCONFIG
-                LINUX_RECALC_SIGPENDING_ARG_TYPE
-                LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_PARENT
-                LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_REAL_PARENT
-                LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIG
-                LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGHAND
-                LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGMASK_LOCK
-                LINUX_WHICH_MODULES
-                 if test "x$ac_cv_linux_config_modversions" = "xno"; then
-                   AC_MSG_WARN([Cannot determine sys_call_table status. assuming it isn't exported])
-                   ac_cv_linux_exports_sys_call_table=no
-                  if test -f "$LINUX_KERNEL_PATH/include/asm/ia32_unistd.h"; then
-                    ac_cv_linux_exports_ia32_sys_call_table=yes
-                  fi
-                 else
-                   LINUX_EXPORTS_INIT_MM
-                   LINUX_EXPORTS_KALLSYMS_ADDRESS
-                   LINUX_EXPORTS_KALLSYMS_SYMBOL
-                   LINUX_EXPORTS_SYS_CALL_TABLE
-                   LINUX_EXPORTS_IA32_SYS_CALL_TABLE
-                   LINUX_EXPORTS_SYS_CHDIR
-                   LINUX_EXPORTS_SYS_CLOSE
-                   LINUX_EXPORTS_SYS_WAIT4
-                   if test "x$ac_cv_linux_exports_sys_call_table" = "xno"; then
-                         linux_syscall_method=none
-                         if test "x$ac_cv_linux_exports_init_mm" = "xyes"; then
-                            linux_syscall_method=scan
-                            if test "x$ac_cv_linux_exports_kallsyms_address" = "xyes"; then
-                               linux_syscall_method=scan_with_kallsyms_address
-                            fi
-                         fi
-                         if test "x$ac_cv_linux_exports_kallsyms_symbol" = "xyes"; then
-                            linux_syscall_method=kallsyms_symbol
-                         fi
-                         if test "x$linux_syscall_method" = "xnone"; then
-                        AC_MSG_ERROR([no available sys_call_table access method])
-                         fi
-                   fi
+                if test "x$enable_kernel_module" = "xyes"; then
+                 AFS_SYSKVERS=`echo $LINUX_VERSION | awk -F\. '{print $[]1 $[]2}'`
+                 if test "x${AFS_SYSKVERS}" = "x"; then
+                  AC_MSG_ERROR(Couldn't guess your Linux version [2])
                  fi
-                if test -f "$LINUX_KERNEL_PATH/include/linux/in_systm.h"; then
-                 AC_DEFINE(HAVE_IN_SYSTM_H, 1, [define if you have in_systm.h header file])
-                fi
-                if test -f "$LINUX_KERNEL_PATH/include/linux/mm_inline.h"; then
-                 AC_DEFINE(HAVE_MM_INLINE_H, 1, [define if you have mm_inline.h header file])
-                fi
-                if test -f "$LINUX_KERNEL_PATH/include/linux/in_systm.h"; then
-                 AC_DEFINE(HAVE_IN_SYSTM_H, 1, [define if you have in_systm.h header file])
-                fi
-                if test "x$ac_cv_linux_exports_sys_chdir" = "xyes" ; then
-                 AC_DEFINE(EXPORTED_SYS_CHDIR, 1, [define if your linux kernel exports sys_chdir])
-                fi
-                if test "x$ac_cv_linux_exports_sys_close" = "xyes" ; then
-                 AC_DEFINE(EXPORTED_SYS_CLOSE, 1, [define if your linux kernel exports sys_close])
-                fi
-                if test "x$ac_cv_linux_exports_sys_wait4" = "xyes" ; then
-                 AC_DEFINE(EXPORTED_SYS_WAIT4, 1, [define if your linux kernel exports sys_wait4])
-                fi
-                if test "x$ac_cv_linux_exports_tasklist_lock" = "xyes" ; then
-                 AC_DEFINE(EXPORTED_TASKLIST_LOCK, 1, [define if your linux kernel exports tasklist_lock])
-                fi
-                 if test "x$ac_cv_linux_exports_sys_call_table" = "xyes"; then
-                  AC_DEFINE(EXPORTED_SYS_CALL_TABLE)
-                 fi
-                 if test "x$ac_cv_linux_exports_ia32_sys_call_table" = "xyes"; then
-                  AC_DEFINE(EXPORTED_IA32_SYS_CALL_TABLE)
-                 fi
-                 if test "x$ac_cv_linux_exports_kallsyms_symbol" = "xyes"; then
-                  AC_DEFINE(EXPORTED_KALLSYMS_SYMBOL)
-                 fi
-                 if test "x$ac_cv_linux_exports_kallsyms_address" = "xyes"; then
-                  AC_DEFINE(EXPORTED_KALLSYMS_ADDRESS)
-                 fi
-                if test "x$ac_cv_linux_completion_h_exists" = "xyes" ; then
-                 AC_DEFINE(COMPLETION_H_EXISTS, 1, [define if completion_h exists])
-                fi
-                if test "x$ac_cv_linux_defines_for_each_process" = "xyes" ; then
-                 AC_DEFINE(DEFINED_FOR_EACH_PROCESS, 1, [define if for_each_process defined])
-                fi
-                if test "x$ac_cv_linux_defines_prev_task" = "xyes" ; then
-                 AC_DEFINE(DEFINED_PREV_TASK, 1, [define if prev_task defined])
-                fi
-                if test "x$ac_cv_linux_func_inode_setattr_returns_int" = "xyes" ; then
-                 AC_DEFINE(INODE_SETATTR_NOT_VOID, 1, [define if your setattr return return non-void])
-                fi
-                if test "x$ac_cv_linux_fs_struct_address_space_has_page_lock" = "xyes"; then 
-                 AC_DEFINE(STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK, 1, [define if your struct address_space has page_lock])
-                fi
-                if test "x$ac_cv_linux_fs_struct_address_space_has_gfp_mask" = "xyes"; then 
-                 AC_DEFINE(STRUCT_ADDRESS_SPACE_HAS_GFP_MASK, 1, [define if your struct address_space has gfp_mask])
-                fi
-                if test "x$ac_cv_linux_fs_struct_inode_has_i_truncate_sem" = "xyes"; then 
-                 AC_DEFINE(STRUCT_INODE_HAS_I_TRUNCATE_SEM, 1, [define if your struct inode has truncate_sem])
-                fi
-                if test "x$ac_cv_linux_fs_struct_inode_has_i_alloc_sem" = "xyes"; then 
-                 AC_DEFINE(STRUCT_INODE_HAS_I_ALLOC_SEM, 1, [define if your struct inode has alloc_sem])
-                fi
-                if test "x$ac_cv_linux_fs_struct_inode_has_i_devices" = "xyes"; then 
-                 AC_DEFINE(STRUCT_INODE_HAS_I_DEVICES, 1, [define if you struct inode has i_devices])
-                fi
-                if test "x$ac_cv_linux_fs_struct_inode_has_i_security" = "xyes"; then 
-                 AC_DEFINE(STRUCT_INODE_HAS_I_SECURITY, 1, [define if you struct inode has i_security])
-                fi
-                if test "x$ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers" = "xyes"; then 
-                 AC_DEFINE(STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS, 1, [define if your struct inode has data_buffers])
-                fi
-                if test "x$ac_cv_linux_func_recalc_sigpending_takes_void" = "xyes"; then 
-                 AC_DEFINE(RECALC_SIGPENDING_TAKES_VOID, 1, [define if your recalc_sigpending takes void])
-                fi
-                if test "x$ac_cv_linux_kernel_is_selinux" = "xyes" ; then
-                 AC_DEFINE(LINUX_KERNEL_IS_SELINUX, 1, [define if your linux kernel uses SELinux features])
-                fi
-                if test "x$ac_cv_linux_kernel_sock_create_v" = "xyes" ; then
-                 AC_DEFINE(LINUX_KERNEL_SOCK_CREATE_V, 1, [define if your linux kernel uses 5 arguments for sock_create])
-                fi
-                if test "x$ac_linux_syscall" = "xyes" ; then
-                 AC_DEFINE(HAVE_KERNEL_LINUX_SYSCALL_H, 1, [define if your linux kernel has linux/syscall.h])
-                fi
-                if test "x$ac_cv_linux_sched_struct_task_struct_has_parent" = "xyes"; then 
-                 AC_DEFINE(STRUCT_TASK_STRUCT_HAS_PARENT, 1, [define if your struct task_struct has parent])
-                fi
-                if test "x$ac_cv_linux_sched_struct_task_struct_has_real_parent" = "xyes"; then 
-                 AC_DEFINE(STRUCT_TASK_STRUCT_HAS_REAL_PARENT, 1, [define if your struct task_struct has real_parent])
-                fi
-                if test "x$ac_cv_linux_sched_struct_task_struct_has_sigmask_lock" = "xyes"; then 
-                 AC_DEFINE(STRUCT_TASK_STRUCT_HAS_SIGMASK_LOCK, 1, [define if your struct task_struct has sigmask_lock])
-                fi
-                if test "x$ac_cv_linux_sched_struct_task_struct_has_sighand" = "xyes"; then 
-                 AC_DEFINE(STRUCT_TASK_STRUCT_HAS_SIGHAND, 1, [define if your struct task_struct has sighand])
-                fi
-                if test "x$ac_cv_linux_sched_struct_task_struct_has_sig" = "xyes"; then 
-                 AC_DEFINE(STRUCT_TASK_STRUCT_HAS_SIG, 1, [define if your struct task_struct has sig])
-                fi
-                :
-               fi
+                fi
                 ;;
         *-solaris*)
                MKAFS_OSTYPE=SOLARIS
@@ -473,6 +316,10 @@ else
                        AFS_PARAM_COMMON=param.nbsd16.h
                        AFS_SYSNAME="ppc_nbsd16"
                        ;;
+               i?86-*-netbsd*2.99*)
+                       AFS_PARAM_COMMON=param.nbsd21.h
+                       AFS_SYSNAME="i386_nbsd21"
+                       ;;
                hppa*-hp-hpux11.0*)
                        AFS_SYSNAME="hp_ux110"
                        ;;
@@ -628,15 +475,19 @@ else
                        ;;
                power*-ibm-aix4.2*)
                        AFS_SYSNAME="rs_aix42"
+                       enable_pam="no"
                        ;;
                power*-ibm-aix4.3*)
                        AFS_SYSNAME="rs_aix42"
+                       enable_pam="no"
                        ;;
                power*-ibm-aix5.1*)
                        AFS_SYSNAME="rs_aix51"
+                       enable_pam="no"
                        ;;
                power*-ibm-aix5.2*)
                        AFS_SYSNAME="rs_aix52"
+                       enable_pam="no"
                        ;;
                x86_64-*-linux-gnu)
                        AFS_SYSNAME="amd64_linuxXX"
@@ -648,8 +499,7 @@ else
                        ;;
        esac
        case $AFS_SYSNAME in
-               *_linux*)
-                       AFS_SYSKVERS=`echo $LINUX_VERSION | awk -F\. '{print $[]1 $[]2}'`
+               *_linux* | *_umlinux*)
                        if test "x${AFS_SYSKVERS}" = "x"; then
                         AC_MSG_ERROR(Couldn't guess your Linux version. Please use the --with-afs-sysname option to configure an AFS sysname.)
                        fi
@@ -673,6 +523,193 @@ else
         AC_MSG_RESULT($AFS_SYSNAME)
 fi
 
+case $AFS_SYSNAME in *_linux* | *_umlinux*)
+
+               # Add (sub-) architecture-specific paths needed by conftests
+               case $AFS_SYSNAME  in
+                       *_umlinux26)
+                               UMLINUX26_FLAGS="-I$LINUX_KERNEL_PATH/arch/um/include"
+                               UMLINUX26_FLAGS="$UMLINUX26_FLAGS -I$LINUX_KERNEL_PATH/arch/um/kernel/tt/include"
+                               UMLINUX26_FLAGS="$UMLINUX26_FLAGS -I$LINUX_KERNEL_PATH/arch/um/kernel/skas/include"
+                               CPPFLAGS="$CPPFLAGS $UMLINUX26_FLAGS"
+               esac
+
+               if test "x$enable_kernel_module" = "xyes"; then
+                if test "x$enable_debug_kernel" = "xno"; then
+                       LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -fomit-frame-pointer"
+                fi
+                OPENAFS_GCC_SUPPORTS_MARCH
+                AC_SUBST(P5PLUS_KOPTS)
+                OPENAFS_GCC_NEEDS_NO_STRENGTH_REDUCE
+                OPENAFS_GCC_NEEDS_NO_STRICT_ALIASING
+                OPENAFS_GCC_SUPPORTS_NO_COMMON
+                OPENAFS_GCC_SUPPORTS_PIPE
+                AC_SUBST(LINUX_GCC_KOPTS)
+                ifdef([OPENAFS_CONFIGURE_LIBAFS],
+                  [LINUX_BUILD_VNODE_FROM_INODE(src/config,afs)],
+                  [LINUX_BUILD_VNODE_FROM_INODE(${srcdir}/src/config,src/afs/LINUX,${srcdir}/src/afs/LINUX)]
+                )
+                LINUX_COMPLETION_H_EXISTS
+                LINUX_DEFINES_FOR_EACH_PROCESS
+                LINUX_DEFINES_PREV_TASK
+                LINUX_EXPORTS_TASKLIST_LOCK
+                LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK
+                LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_GFP_MASK
+                LINUX_FS_STRUCT_INODE_HAS_I_ALLOC_SEM
+                LINUX_FS_STRUCT_INODE_HAS_I_TRUNCATE_SEM
+                LINUX_FS_STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS
+                LINUX_FS_STRUCT_INODE_HAS_I_DEVICES
+                LINUX_FS_STRUCT_INODE_HAS_I_SECURITY
+                LINUX_INODE_SETATTR_RETURN_TYPE
+                LINUX_WRITE_INODE_RETURN_TYPE
+                LINUX_IOP_NAMEIDATA
+                LINUX_AOP_WRITEBACK_CONTROL
+                LINUX_KERNEL_LINUX_SYSCALL_H
+                LINUX_KERNEL_SELINUX
+                LINUX_KERNEL_SOCK_CREATE
+                LINUX_KERNEL_PAGE_FOLLOW_LINK
+                LINUX_NEED_RHCONFIG
+                LINUX_RECALC_SIGPENDING_ARG_TYPE
+                LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_PARENT
+                LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_REAL_PARENT
+                LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIG
+                LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGHAND
+                LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGMASK_LOCK
+                LINUX_WHICH_MODULES
+                 if test "x$ac_cv_linux_config_modversions" = "xno" -o $AFS_SYSKVERS -ge 26; then
+                   AC_MSG_WARN([Cannot determine sys_call_table status. assuming it isn't exported])
+                   ac_cv_linux_exports_sys_call_table=no
+                  if test -f "$LINUX_KERNEL_PATH/include/asm/ia32_unistd.h"; then
+                    ac_cv_linux_exports_ia32_sys_call_table=yes
+                  fi
+                 else
+                   LINUX_EXPORTS_INIT_MM
+                   LINUX_EXPORTS_KALLSYMS_ADDRESS
+                   LINUX_EXPORTS_KALLSYMS_SYMBOL
+                   LINUX_EXPORTS_SYS_CALL_TABLE
+                   LINUX_EXPORTS_IA32_SYS_CALL_TABLE
+                   LINUX_EXPORTS_SYS_CHDIR
+                   LINUX_EXPORTS_SYS_CLOSE
+                   LINUX_EXPORTS_SYS_WAIT4
+                   if test "x$ac_cv_linux_exports_sys_call_table" = "xno"; then
+                         linux_syscall_method=none
+                         if test "x$ac_cv_linux_exports_init_mm" = "xyes"; then
+                            linux_syscall_method=scan
+                            if test "x$ac_cv_linux_exports_kallsyms_address" = "xyes"; then
+                               linux_syscall_method=scan_with_kallsyms_address
+                            fi
+                         fi
+                         if test "x$ac_cv_linux_exports_kallsyms_symbol" = "xyes"; then
+                            linux_syscall_method=kallsyms_symbol
+                         fi
+                         if test "x$linux_syscall_method" = "xnone"; then
+                        AC_MSG_ERROR([no available sys_call_table access method])
+                         fi
+                   fi
+                 fi
+                if test -f "$LINUX_KERNEL_PATH/include/linux/in_systm.h"; then
+                 AC_DEFINE(HAVE_IN_SYSTM_H, 1, [define if you have in_systm.h header file])
+                fi
+                if test -f "$LINUX_KERNEL_PATH/include/linux/mm_inline.h"; then
+                 AC_DEFINE(HAVE_MM_INLINE_H, 1, [define if you have mm_inline.h header file])
+                fi
+                if test -f "$LINUX_KERNEL_PATH/include/linux/in_systm.h"; then
+                 AC_DEFINE(HAVE_IN_SYSTM_H, 1, [define if you have in_systm.h header file])
+                fi
+                if test "x$ac_cv_linux_exports_sys_chdir" = "xyes" ; then
+                 AC_DEFINE(EXPORTED_SYS_CHDIR, 1, [define if your linux kernel exports sys_chdir])
+                fi
+                if test "x$ac_cv_linux_exports_sys_close" = "xyes" ; then
+                 AC_DEFINE(EXPORTED_SYS_CLOSE, 1, [define if your linux kernel exports sys_close])
+                fi
+                if test "x$ac_cv_linux_exports_sys_wait4" = "xyes" ; then
+                 AC_DEFINE(EXPORTED_SYS_WAIT4, 1, [define if your linux kernel exports sys_wait4])
+                fi
+                if test "x$ac_cv_linux_exports_tasklist_lock" = "xyes" ; then
+                 AC_DEFINE(EXPORTED_TASKLIST_LOCK, 1, [define if your linux kernel exports tasklist_lock])
+                fi
+                 if test "x$ac_cv_linux_exports_sys_call_table" = "xyes"; then
+                  AC_DEFINE(EXPORTED_SYS_CALL_TABLE)
+                 fi
+                 if test "x$ac_cv_linux_exports_ia32_sys_call_table" = "xyes"; then
+                  AC_DEFINE(EXPORTED_IA32_SYS_CALL_TABLE)
+                 fi
+                 if test "x$ac_cv_linux_exports_kallsyms_symbol" = "xyes"; then
+                  AC_DEFINE(EXPORTED_KALLSYMS_SYMBOL)
+                 fi
+                 if test "x$ac_cv_linux_exports_kallsyms_address" = "xyes"; then
+                  AC_DEFINE(EXPORTED_KALLSYMS_ADDRESS)
+                 fi
+                if test "x$ac_cv_linux_completion_h_exists" = "xyes" ; then
+                 AC_DEFINE(COMPLETION_H_EXISTS, 1, [define if completion_h exists])
+                fi
+                if test "x$ac_cv_linux_defines_for_each_process" = "xyes" ; then
+                 AC_DEFINE(DEFINED_FOR_EACH_PROCESS, 1, [define if for_each_process defined])
+                fi
+                if test "x$ac_cv_linux_defines_prev_task" = "xyes" ; then
+                 AC_DEFINE(DEFINED_PREV_TASK, 1, [define if prev_task defined])
+                fi
+                if test "x$ac_cv_linux_func_inode_setattr_returns_int" = "xyes" ; then
+                 AC_DEFINE(INODE_SETATTR_NOT_VOID, 1, [define if your setattr return return non-void])
+                fi
+                if test "x$ac_cv_linux_func_write_inode_returns_int" = "xyes" ; then
+                 AC_DEFINE(WRITE_INODE_NOT_VOID, 1, [define if your sops.write_inode returns non-void])
+                fi
+                if test "x$ac_cv_linux_fs_struct_address_space_has_page_lock" = "xyes"; then 
+                 AC_DEFINE(STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK, 1, [define if your struct address_space has page_lock])
+                fi
+                if test "x$ac_cv_linux_fs_struct_address_space_has_gfp_mask" = "xyes"; then 
+                 AC_DEFINE(STRUCT_ADDRESS_SPACE_HAS_GFP_MASK, 1, [define if your struct address_space has gfp_mask])
+                fi
+                if test "x$ac_cv_linux_fs_struct_inode_has_i_truncate_sem" = "xyes"; then 
+                 AC_DEFINE(STRUCT_INODE_HAS_I_TRUNCATE_SEM, 1, [define if your struct inode has truncate_sem])
+                fi
+                if test "x$ac_cv_linux_fs_struct_inode_has_i_alloc_sem" = "xyes"; then 
+                 AC_DEFINE(STRUCT_INODE_HAS_I_ALLOC_SEM, 1, [define if your struct inode has alloc_sem])
+                fi
+                if test "x$ac_cv_linux_fs_struct_inode_has_i_devices" = "xyes"; then 
+                 AC_DEFINE(STRUCT_INODE_HAS_I_DEVICES, 1, [define if you struct inode has i_devices])
+                fi
+                if test "x$ac_cv_linux_fs_struct_inode_has_i_security" = "xyes"; then 
+                 AC_DEFINE(STRUCT_INODE_HAS_I_SECURITY, 1, [define if you struct inode has i_security])
+                fi
+                if test "x$ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers" = "xyes"; then 
+                 AC_DEFINE(STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS, 1, [define if your struct inode has data_buffers])
+                fi
+                if test "x$ac_cv_linux_func_recalc_sigpending_takes_void" = "xyes"; then 
+                 AC_DEFINE(RECALC_SIGPENDING_TAKES_VOID, 1, [define if your recalc_sigpending takes void])
+                fi
+                if test "x$ac_cv_linux_kernel_is_selinux" = "xyes" ; then
+                 AC_DEFINE(LINUX_KERNEL_IS_SELINUX, 1, [define if your linux kernel uses SELinux features])
+                fi
+                if test "x$ac_cv_linux_kernel_sock_create_v" = "xyes" ; then
+                 AC_DEFINE(LINUX_KERNEL_SOCK_CREATE_V, 1, [define if your linux kernel uses 5 arguments for sock_create])
+                fi
+                if test "x$ac_cv_linux_kernel_page_follow_link" = "xyes" ; then
+                 AC_DEFINE(HAVE_KERNEL_PAGE_FOLLOW_LINK, 1, [define if your linux kernel provides page_follow_link])
+                fi
+                if test "x$ac_linux_syscall" = "xyes" ; then
+                 AC_DEFINE(HAVE_KERNEL_LINUX_SYSCALL_H, 1, [define if your linux kernel has linux/syscall.h])
+                fi
+                if test "x$ac_cv_linux_sched_struct_task_struct_has_parent" = "xyes"; then 
+                 AC_DEFINE(STRUCT_TASK_STRUCT_HAS_PARENT, 1, [define if your struct task_struct has parent])
+                fi
+                if test "x$ac_cv_linux_sched_struct_task_struct_has_real_parent" = "xyes"; then 
+                 AC_DEFINE(STRUCT_TASK_STRUCT_HAS_REAL_PARENT, 1, [define if your struct task_struct has real_parent])
+                fi
+                if test "x$ac_cv_linux_sched_struct_task_struct_has_sigmask_lock" = "xyes"; then 
+                 AC_DEFINE(STRUCT_TASK_STRUCT_HAS_SIGMASK_LOCK, 1, [define if your struct task_struct has sigmask_lock])
+                fi
+                if test "x$ac_cv_linux_sched_struct_task_struct_has_sighand" = "xyes"; then 
+                 AC_DEFINE(STRUCT_TASK_STRUCT_HAS_SIGHAND, 1, [define if your struct task_struct has sighand])
+                fi
+                if test "x$ac_cv_linux_sched_struct_task_struct_has_sig" = "xyes"; then 
+                 AC_DEFINE(STRUCT_TASK_STRUCT_HAS_SIG, 1, [define if your struct task_struct has sig])
+                fi
+                :
+               fi
+esac
+
 case $AFS_SYSNAME in
        *_darwin*)
                DARWIN_PLIST=src/libafs/afs.${AFS_SYSNAME}.plist
index 6458da4caaf77c8bdc5b440a3dd6162b3a13f8bf..1331f11bb395df1da5638b50a96b1a57d99013c0 100644 (file)
@@ -119,6 +119,7 @@ AC_MSG_CHECKING(your OS)
 system=$host
 case $system in
         *-linux*)
+
                MKAFS_OSTYPE=LINUX
                if test "x$enable_redhat_buildsys" = "xyes"; then
                 AC_DEFINE(ENABLE_REDHAT_BUILDSYS, 1, [define if you have redhat buildsystem])
@@ -169,170 +170,12 @@ case $system in
                  SUBARCH=default
                fi
                AC_MSG_RESULT(linux)
-               if test "x$enable_kernel_module" = "xyes"; then
-                if test "x$enable_debug_kernel" = "xno"; then
-                       LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -fomit-frame-pointer"
-                fi
-                OPENAFS_GCC_SUPPORTS_MARCH
-                AC_SUBST(P5PLUS_KOPTS)
-                OPENAFS_GCC_NEEDS_NO_STRENGTH_REDUCE
-                OPENAFS_GCC_NEEDS_NO_STRICT_ALIASING
-                OPENAFS_GCC_SUPPORTS_NO_COMMON
-                OPENAFS_GCC_SUPPORTS_PIPE
-                AC_SUBST(LINUX_GCC_KOPTS)
-                ifdef([OPENAFS_CONFIGURE_LIBAFS],
-                  [LINUX_BUILD_VNODE_FROM_INODE(src/config,afs)],
-                  [LINUX_BUILD_VNODE_FROM_INODE(${srcdir}/src/config,src/afs/LINUX,${srcdir}/src/afs/LINUX)]
-                )
-                LINUX_COMPLETION_H_EXISTS
-                LINUX_DEFINES_FOR_EACH_PROCESS
-                LINUX_DEFINES_PREV_TASK
-                LINUX_EXPORTS_TASKLIST_LOCK
-                LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK
-                LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_GFP_MASK
-                LINUX_FS_STRUCT_INODE_HAS_I_ALLOC_SEM
-                LINUX_FS_STRUCT_INODE_HAS_I_TRUNCATE_SEM
-                LINUX_FS_STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS
-                LINUX_FS_STRUCT_INODE_HAS_I_DEVICES
-                LINUX_FS_STRUCT_INODE_HAS_I_SECURITY
-                LINUX_INODE_SETATTR_RETURN_TYPE
-                LINUX_KERNEL_LINUX_SYSCALL_H
-                LINUX_KERNEL_SELINUX
-                LINUX_KERNEL_SOCK_CREATE
-                LINUX_NEED_RHCONFIG
-                LINUX_RECALC_SIGPENDING_ARG_TYPE
-                LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_PARENT
-                LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_REAL_PARENT
-                LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIG
-                LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGHAND
-                LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGMASK_LOCK
-                LINUX_WHICH_MODULES
-                 if test "x$ac_cv_linux_config_modversions" = "xno"; then
-                   AC_MSG_WARN([Cannot determine sys_call_table status. assuming it isn't exported])
-                   ac_cv_linux_exports_sys_call_table=no
-                  if test -f "$LINUX_KERNEL_PATH/include/asm/ia32_unistd.h"; then
-                    ac_cv_linux_exports_ia32_sys_call_table=yes
-                  fi
-                 else
-                   LINUX_EXPORTS_INIT_MM
-                   LINUX_EXPORTS_KALLSYMS_ADDRESS
-                   LINUX_EXPORTS_KALLSYMS_SYMBOL
-                   LINUX_EXPORTS_SYS_CALL_TABLE
-                   LINUX_EXPORTS_IA32_SYS_CALL_TABLE
-                   LINUX_EXPORTS_SYS_CHDIR
-                   LINUX_EXPORTS_SYS_CLOSE
-                   LINUX_EXPORTS_SYS_WAIT4
-                   if test "x$ac_cv_linux_exports_sys_call_table" = "xno"; then
-                         linux_syscall_method=none
-                         if test "x$ac_cv_linux_exports_init_mm" = "xyes"; then
-                            linux_syscall_method=scan
-                            if test "x$ac_cv_linux_exports_kallsyms_address" = "xyes"; then
-                               linux_syscall_method=scan_with_kallsyms_address
-                            fi
-                         fi
-                         if test "x$ac_cv_linux_exports_kallsyms_symbol" = "xyes"; then
-                            linux_syscall_method=kallsyms_symbol
-                         fi
-                         if test "x$linux_syscall_method" = "xnone"; then
-                        AC_MSG_ERROR([no available sys_call_table access method])
-                         fi
-                   fi
-                 fi
-                if test -f "$LINUX_KERNEL_PATH/include/linux/in_systm.h"; then
-                 AC_DEFINE(HAVE_IN_SYSTM_H, 1, [define if you have in_systm.h header file])
-                fi
-                if test -f "$LINUX_KERNEL_PATH/include/linux/mm_inline.h"; then
-                 AC_DEFINE(HAVE_MM_INLINE_H, 1, [define if you have mm_inline.h header file])
-                fi
-                if test -f "$LINUX_KERNEL_PATH/include/linux/in_systm.h"; then
-                 AC_DEFINE(HAVE_IN_SYSTM_H, 1, [define if you have in_systm.h header file])
-                fi
-                if test "x$ac_cv_linux_exports_sys_chdir" = "xyes" ; then
-                 AC_DEFINE(EXPORTED_SYS_CHDIR, 1, [define if your linux kernel exports sys_chdir])
-                fi
-                if test "x$ac_cv_linux_exports_sys_close" = "xyes" ; then
-                 AC_DEFINE(EXPORTED_SYS_CLOSE, 1, [define if your linux kernel exports sys_close])
-                fi
-                if test "x$ac_cv_linux_exports_sys_wait4" = "xyes" ; then
-                 AC_DEFINE(EXPORTED_SYS_WAIT4, 1, [define if your linux kernel exports sys_wait4])
-                fi
-                if test "x$ac_cv_linux_exports_tasklist_lock" = "xyes" ; then
-                 AC_DEFINE(EXPORTED_TASKLIST_LOCK, 1, [define if your linux kernel exports tasklist_lock])
-                fi
-                 if test "x$ac_cv_linux_exports_sys_call_table" = "xyes"; then
-                  AC_DEFINE(EXPORTED_SYS_CALL_TABLE)
-                 fi
-                 if test "x$ac_cv_linux_exports_ia32_sys_call_table" = "xyes"; then
-                  AC_DEFINE(EXPORTED_IA32_SYS_CALL_TABLE)
+                if test "x$enable_kernel_module" = "xyes"; then
+                 AFS_SYSKVERS=`echo $LINUX_VERSION | awk -F\. '{print $[]1 $[]2}'`
+                 if test "x${AFS_SYSKVERS}" = "x"; then
+                  AC_MSG_ERROR(Couldn't guess your Linux version [2])
                  fi
-                 if test "x$ac_cv_linux_exports_kallsyms_symbol" = "xyes"; then
-                  AC_DEFINE(EXPORTED_KALLSYMS_SYMBOL)
-                 fi
-                 if test "x$ac_cv_linux_exports_kallsyms_address" = "xyes"; then
-                  AC_DEFINE(EXPORTED_KALLSYMS_ADDRESS)
-                 fi
-                if test "x$ac_cv_linux_completion_h_exists" = "xyes" ; then
-                 AC_DEFINE(COMPLETION_H_EXISTS, 1, [define if completion_h exists])
-                fi
-                if test "x$ac_cv_linux_defines_for_each_process" = "xyes" ; then
-                 AC_DEFINE(DEFINED_FOR_EACH_PROCESS, 1, [define if for_each_process defined])
-                fi
-                if test "x$ac_cv_linux_defines_prev_task" = "xyes" ; then
-                 AC_DEFINE(DEFINED_PREV_TASK, 1, [define if prev_task defined])
-                fi
-                if test "x$ac_cv_linux_func_inode_setattr_returns_int" = "xyes" ; then
-                 AC_DEFINE(INODE_SETATTR_NOT_VOID, 1, [define if your setattr return return non-void])
-                fi
-                if test "x$ac_cv_linux_fs_struct_address_space_has_page_lock" = "xyes"; then 
-                 AC_DEFINE(STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK, 1, [define if your struct address_space has page_lock])
-                fi
-                if test "x$ac_cv_linux_fs_struct_address_space_has_gfp_mask" = "xyes"; then 
-                 AC_DEFINE(STRUCT_ADDRESS_SPACE_HAS_GFP_MASK, 1, [define if your struct address_space has gfp_mask])
-                fi
-                if test "x$ac_cv_linux_fs_struct_inode_has_i_truncate_sem" = "xyes"; then 
-                 AC_DEFINE(STRUCT_INODE_HAS_I_TRUNCATE_SEM, 1, [define if your struct inode has truncate_sem])
-                fi
-                if test "x$ac_cv_linux_fs_struct_inode_has_i_alloc_sem" = "xyes"; then 
-                 AC_DEFINE(STRUCT_INODE_HAS_I_ALLOC_SEM, 1, [define if your struct inode has alloc_sem])
-                fi
-                if test "x$ac_cv_linux_fs_struct_inode_has_i_devices" = "xyes"; then 
-                 AC_DEFINE(STRUCT_INODE_HAS_I_DEVICES, 1, [define if you struct inode has i_devices])
-                fi
-                if test "x$ac_cv_linux_fs_struct_inode_has_i_security" = "xyes"; then 
-                 AC_DEFINE(STRUCT_INODE_HAS_I_SECURITY, 1, [define if you struct inode has i_security])
-                fi
-                if test "x$ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers" = "xyes"; then 
-                 AC_DEFINE(STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS, 1, [define if your struct inode has data_buffers])
-                fi
-                if test "x$ac_cv_linux_func_recalc_sigpending_takes_void" = "xyes"; then 
-                 AC_DEFINE(RECALC_SIGPENDING_TAKES_VOID, 1, [define if your recalc_sigpending takes void])
-                fi
-                if test "x$ac_cv_linux_kernel_is_selinux" = "xyes" ; then
-                 AC_DEFINE(LINUX_KERNEL_IS_SELINUX, 1, [define if your linux kernel uses SELinux features])
-                fi
-                if test "x$ac_cv_linux_kernel_sock_create_v" = "xyes" ; then
-                 AC_DEFINE(LINUX_KERNEL_SOCK_CREATE_V, 1, [define if your linux kernel uses 5 arguments for sock_create])
-                fi
-                if test "x$ac_linux_syscall" = "xyes" ; then
-                 AC_DEFINE(HAVE_KERNEL_LINUX_SYSCALL_H, 1, [define if your linux kernel has linux/syscall.h])
-                fi
-                if test "x$ac_cv_linux_sched_struct_task_struct_has_parent" = "xyes"; then 
-                 AC_DEFINE(STRUCT_TASK_STRUCT_HAS_PARENT, 1, [define if your struct task_struct has parent])
-                fi
-                if test "x$ac_cv_linux_sched_struct_task_struct_has_real_parent" = "xyes"; then 
-                 AC_DEFINE(STRUCT_TASK_STRUCT_HAS_REAL_PARENT, 1, [define if your struct task_struct has real_parent])
-                fi
-                if test "x$ac_cv_linux_sched_struct_task_struct_has_sigmask_lock" = "xyes"; then 
-                 AC_DEFINE(STRUCT_TASK_STRUCT_HAS_SIGMASK_LOCK, 1, [define if your struct task_struct has sigmask_lock])
-                fi
-                if test "x$ac_cv_linux_sched_struct_task_struct_has_sighand" = "xyes"; then 
-                 AC_DEFINE(STRUCT_TASK_STRUCT_HAS_SIGHAND, 1, [define if your struct task_struct has sighand])
-                fi
-                if test "x$ac_cv_linux_sched_struct_task_struct_has_sig" = "xyes"; then 
-                 AC_DEFINE(STRUCT_TASK_STRUCT_HAS_SIG, 1, [define if your struct task_struct has sig])
-                fi
-                :
-               fi
+                fi
                 ;;
         *-solaris*)
                MKAFS_OSTYPE=SOLARIS
@@ -486,6 +329,10 @@ else
                        AFS_PARAM_COMMON=param.nbsd16.h
                        AFS_SYSNAME="ppc_nbsd16"
                        ;;
+               i?86-*-netbsd*2.99*)
+                       AFS_PARAM_COMMON=param.nbsd21.h
+                       AFS_SYSNAME="i386_nbsd21"
+                       ;;
                hppa*-hp-hpux11.0*)
                        AFS_SYSNAME="hp_ux110"
                        ;;
@@ -641,15 +488,19 @@ else
                        ;;
                power*-ibm-aix4.2*)
                        AFS_SYSNAME="rs_aix42"
+                       enable_pam="no"
                        ;;
                power*-ibm-aix4.3*)
                        AFS_SYSNAME="rs_aix42"
+                       enable_pam="no"
                        ;;
                power*-ibm-aix5.1*)
                        AFS_SYSNAME="rs_aix51"
+                       enable_pam="no"
                        ;;
                power*-ibm-aix5.2*)
                        AFS_SYSNAME="rs_aix52"
+                       enable_pam="no"
                        ;;
                x86_64-*-linux-gnu)
                        AFS_SYSNAME="amd64_linuxXX"
@@ -661,8 +512,7 @@ else
                        ;;
        esac
        case $AFS_SYSNAME in
-               *_linux*)
-                       AFS_SYSKVERS=`echo $LINUX_VERSION | awk -F\. '{print $[]1 $[]2}'`
+               *_linux* | *_umlinux*)
                        if test "x${AFS_SYSKVERS}" = "x"; then
                         AC_MSG_ERROR(Couldn't guess your Linux version. Please use the --with-afs-sysname option to configure an AFS sysname.)
                        fi
@@ -686,6 +536,193 @@ else
         AC_MSG_RESULT($AFS_SYSNAME)
 fi
 
+case $AFS_SYSNAME in *_linux* | *_umlinux*)
+
+               # Add (sub-) architecture-specific paths needed by conftests
+               case $AFS_SYSNAME  in
+                       *_umlinux26)
+                               UMLINUX26_FLAGS="-I$LINUX_KERNEL_PATH/arch/um/include"
+                               UMLINUX26_FLAGS="$UMLINUX26_FLAGS -I$LINUX_KERNEL_PATH/arch/um/kernel/tt/include"
+                               UMLINUX26_FLAGS="$UMLINUX26_FLAGS -I$LINUX_KERNEL_PATH/arch/um/kernel/skas/include"
+                               CPPFLAGS="$CPPFLAGS $UMLINUX26_FLAGS"
+               esac
+
+               if test "x$enable_kernel_module" = "xyes"; then
+                if test "x$enable_debug_kernel" = "xno"; then
+                       LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -fomit-frame-pointer"
+                fi
+                OPENAFS_GCC_SUPPORTS_MARCH
+                AC_SUBST(P5PLUS_KOPTS)
+                OPENAFS_GCC_NEEDS_NO_STRENGTH_REDUCE
+                OPENAFS_GCC_NEEDS_NO_STRICT_ALIASING
+                OPENAFS_GCC_SUPPORTS_NO_COMMON
+                OPENAFS_GCC_SUPPORTS_PIPE
+                AC_SUBST(LINUX_GCC_KOPTS)
+                ifdef([OPENAFS_CONFIGURE_LIBAFS],
+                  [LINUX_BUILD_VNODE_FROM_INODE(src/config,afs)],
+                  [LINUX_BUILD_VNODE_FROM_INODE(${srcdir}/src/config,src/afs/LINUX,${srcdir}/src/afs/LINUX)]
+                )
+                LINUX_COMPLETION_H_EXISTS
+                LINUX_DEFINES_FOR_EACH_PROCESS
+                LINUX_DEFINES_PREV_TASK
+                LINUX_EXPORTS_TASKLIST_LOCK
+                LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK
+                LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_GFP_MASK
+                LINUX_FS_STRUCT_INODE_HAS_I_ALLOC_SEM
+                LINUX_FS_STRUCT_INODE_HAS_I_TRUNCATE_SEM
+                LINUX_FS_STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS
+                LINUX_FS_STRUCT_INODE_HAS_I_DEVICES
+                LINUX_FS_STRUCT_INODE_HAS_I_SECURITY
+                LINUX_INODE_SETATTR_RETURN_TYPE
+                LINUX_WRITE_INODE_RETURN_TYPE
+                LINUX_IOP_NAMEIDATA
+                LINUX_AOP_WRITEBACK_CONTROL
+                LINUX_KERNEL_LINUX_SYSCALL_H
+                LINUX_KERNEL_SELINUX
+                LINUX_KERNEL_SOCK_CREATE
+                LINUX_KERNEL_PAGE_FOLLOW_LINK
+                LINUX_NEED_RHCONFIG
+                LINUX_RECALC_SIGPENDING_ARG_TYPE
+                LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_PARENT
+                LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_REAL_PARENT
+                LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIG
+                LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGHAND
+                LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGMASK_LOCK
+                LINUX_WHICH_MODULES
+                 if test "x$ac_cv_linux_config_modversions" = "xno" -o $AFS_SYSKVERS -ge 26; then
+                   AC_MSG_WARN([Cannot determine sys_call_table status. assuming it isn't exported])
+                   ac_cv_linux_exports_sys_call_table=no
+                  if test -f "$LINUX_KERNEL_PATH/include/asm/ia32_unistd.h"; then
+                    ac_cv_linux_exports_ia32_sys_call_table=yes
+                  fi
+                 else
+                   LINUX_EXPORTS_INIT_MM
+                   LINUX_EXPORTS_KALLSYMS_ADDRESS
+                   LINUX_EXPORTS_KALLSYMS_SYMBOL
+                   LINUX_EXPORTS_SYS_CALL_TABLE
+                   LINUX_EXPORTS_IA32_SYS_CALL_TABLE
+                   LINUX_EXPORTS_SYS_CHDIR
+                   LINUX_EXPORTS_SYS_CLOSE
+                   LINUX_EXPORTS_SYS_WAIT4
+                   if test "x$ac_cv_linux_exports_sys_call_table" = "xno"; then
+                         linux_syscall_method=none
+                         if test "x$ac_cv_linux_exports_init_mm" = "xyes"; then
+                            linux_syscall_method=scan
+                            if test "x$ac_cv_linux_exports_kallsyms_address" = "xyes"; then
+                               linux_syscall_method=scan_with_kallsyms_address
+                            fi
+                         fi
+                         if test "x$ac_cv_linux_exports_kallsyms_symbol" = "xyes"; then
+                            linux_syscall_method=kallsyms_symbol
+                         fi
+                         if test "x$linux_syscall_method" = "xnone"; then
+                        AC_MSG_ERROR([no available sys_call_table access method])
+                         fi
+                   fi
+                 fi
+                if test -f "$LINUX_KERNEL_PATH/include/linux/in_systm.h"; then
+                 AC_DEFINE(HAVE_IN_SYSTM_H, 1, [define if you have in_systm.h header file])
+                fi
+                if test -f "$LINUX_KERNEL_PATH/include/linux/mm_inline.h"; then
+                 AC_DEFINE(HAVE_MM_INLINE_H, 1, [define if you have mm_inline.h header file])
+                fi
+                if test -f "$LINUX_KERNEL_PATH/include/linux/in_systm.h"; then
+                 AC_DEFINE(HAVE_IN_SYSTM_H, 1, [define if you have in_systm.h header file])
+                fi
+                if test "x$ac_cv_linux_exports_sys_chdir" = "xyes" ; then
+                 AC_DEFINE(EXPORTED_SYS_CHDIR, 1, [define if your linux kernel exports sys_chdir])
+                fi
+                if test "x$ac_cv_linux_exports_sys_close" = "xyes" ; then
+                 AC_DEFINE(EXPORTED_SYS_CLOSE, 1, [define if your linux kernel exports sys_close])
+                fi
+                if test "x$ac_cv_linux_exports_sys_wait4" = "xyes" ; then
+                 AC_DEFINE(EXPORTED_SYS_WAIT4, 1, [define if your linux kernel exports sys_wait4])
+                fi
+                if test "x$ac_cv_linux_exports_tasklist_lock" = "xyes" ; then
+                 AC_DEFINE(EXPORTED_TASKLIST_LOCK, 1, [define if your linux kernel exports tasklist_lock])
+                fi
+                 if test "x$ac_cv_linux_exports_sys_call_table" = "xyes"; then
+                  AC_DEFINE(EXPORTED_SYS_CALL_TABLE)
+                 fi
+                 if test "x$ac_cv_linux_exports_ia32_sys_call_table" = "xyes"; then
+                  AC_DEFINE(EXPORTED_IA32_SYS_CALL_TABLE)
+                 fi
+                 if test "x$ac_cv_linux_exports_kallsyms_symbol" = "xyes"; then
+                  AC_DEFINE(EXPORTED_KALLSYMS_SYMBOL)
+                 fi
+                 if test "x$ac_cv_linux_exports_kallsyms_address" = "xyes"; then
+                  AC_DEFINE(EXPORTED_KALLSYMS_ADDRESS)
+                 fi
+                if test "x$ac_cv_linux_completion_h_exists" = "xyes" ; then
+                 AC_DEFINE(COMPLETION_H_EXISTS, 1, [define if completion_h exists])
+                fi
+                if test "x$ac_cv_linux_defines_for_each_process" = "xyes" ; then
+                 AC_DEFINE(DEFINED_FOR_EACH_PROCESS, 1, [define if for_each_process defined])
+                fi
+                if test "x$ac_cv_linux_defines_prev_task" = "xyes" ; then
+                 AC_DEFINE(DEFINED_PREV_TASK, 1, [define if prev_task defined])
+                fi
+                if test "x$ac_cv_linux_func_inode_setattr_returns_int" = "xyes" ; then
+                 AC_DEFINE(INODE_SETATTR_NOT_VOID, 1, [define if your setattr return return non-void])
+                fi
+                if test "x$ac_cv_linux_func_write_inode_returns_int" = "xyes" ; then
+                 AC_DEFINE(WRITE_INODE_NOT_VOID, 1, [define if your sops.write_inode returns non-void])
+                fi
+                if test "x$ac_cv_linux_fs_struct_address_space_has_page_lock" = "xyes"; then 
+                 AC_DEFINE(STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK, 1, [define if your struct address_space has page_lock])
+                fi
+                if test "x$ac_cv_linux_fs_struct_address_space_has_gfp_mask" = "xyes"; then 
+                 AC_DEFINE(STRUCT_ADDRESS_SPACE_HAS_GFP_MASK, 1, [define if your struct address_space has gfp_mask])
+                fi
+                if test "x$ac_cv_linux_fs_struct_inode_has_i_truncate_sem" = "xyes"; then 
+                 AC_DEFINE(STRUCT_INODE_HAS_I_TRUNCATE_SEM, 1, [define if your struct inode has truncate_sem])
+                fi
+                if test "x$ac_cv_linux_fs_struct_inode_has_i_alloc_sem" = "xyes"; then 
+                 AC_DEFINE(STRUCT_INODE_HAS_I_ALLOC_SEM, 1, [define if your struct inode has alloc_sem])
+                fi
+                if test "x$ac_cv_linux_fs_struct_inode_has_i_devices" = "xyes"; then 
+                 AC_DEFINE(STRUCT_INODE_HAS_I_DEVICES, 1, [define if you struct inode has i_devices])
+                fi
+                if test "x$ac_cv_linux_fs_struct_inode_has_i_security" = "xyes"; then 
+                 AC_DEFINE(STRUCT_INODE_HAS_I_SECURITY, 1, [define if you struct inode has i_security])
+                fi
+                if test "x$ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers" = "xyes"; then 
+                 AC_DEFINE(STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS, 1, [define if your struct inode has data_buffers])
+                fi
+                if test "x$ac_cv_linux_func_recalc_sigpending_takes_void" = "xyes"; then 
+                 AC_DEFINE(RECALC_SIGPENDING_TAKES_VOID, 1, [define if your recalc_sigpending takes void])
+                fi
+                if test "x$ac_cv_linux_kernel_is_selinux" = "xyes" ; then
+                 AC_DEFINE(LINUX_KERNEL_IS_SELINUX, 1, [define if your linux kernel uses SELinux features])
+                fi
+                if test "x$ac_cv_linux_kernel_sock_create_v" = "xyes" ; then
+                 AC_DEFINE(LINUX_KERNEL_SOCK_CREATE_V, 1, [define if your linux kernel uses 5 arguments for sock_create])
+                fi
+                if test "x$ac_cv_linux_kernel_page_follow_link" = "xyes" ; then
+                 AC_DEFINE(HAVE_KERNEL_PAGE_FOLLOW_LINK, 1, [define if your linux kernel provides page_follow_link])
+                fi
+                if test "x$ac_linux_syscall" = "xyes" ; then
+                 AC_DEFINE(HAVE_KERNEL_LINUX_SYSCALL_H, 1, [define if your linux kernel has linux/syscall.h])
+                fi
+                if test "x$ac_cv_linux_sched_struct_task_struct_has_parent" = "xyes"; then 
+                 AC_DEFINE(STRUCT_TASK_STRUCT_HAS_PARENT, 1, [define if your struct task_struct has parent])
+                fi
+                if test "x$ac_cv_linux_sched_struct_task_struct_has_real_parent" = "xyes"; then 
+                 AC_DEFINE(STRUCT_TASK_STRUCT_HAS_REAL_PARENT, 1, [define if your struct task_struct has real_parent])
+                fi
+                if test "x$ac_cv_linux_sched_struct_task_struct_has_sigmask_lock" = "xyes"; then 
+                 AC_DEFINE(STRUCT_TASK_STRUCT_HAS_SIGMASK_LOCK, 1, [define if your struct task_struct has sigmask_lock])
+                fi
+                if test "x$ac_cv_linux_sched_struct_task_struct_has_sighand" = "xyes"; then 
+                 AC_DEFINE(STRUCT_TASK_STRUCT_HAS_SIGHAND, 1, [define if your struct task_struct has sighand])
+                fi
+                if test "x$ac_cv_linux_sched_struct_task_struct_has_sig" = "xyes"; then 
+                 AC_DEFINE(STRUCT_TASK_STRUCT_HAS_SIG, 1, [define if your struct task_struct has sig])
+                fi
+                :
+               fi
+esac
+
 case $AFS_SYSNAME in
        *_darwin*)
                DARWIN_PLIST=src/libafs/afs.${AFS_SYSNAME}.plist
@@ -1291,6 +1328,59 @@ if test "$openafs_cv_c_bigendian_compile" = "yes"; then
 fi
 ])
 
+AC_DEFUN([SOLARIS_UFSVFS_HAS_DQRWLOCK], [
+AC_MSG_CHECKING(for vfs_dqrwlock in struct ufsvfs)
+AC_CACHE_VAL(ac_cv_solaris_ufsvfs_has_dqrwlock,
+[
+AC_TRY_COMPILE(
+[#define _KERNEL
+#include <sys/fs/ufs_inode.h>],
+[struct ufsvfs _ufsvfs;
+(void) _ufsvfs.vfs_dqrwlock;], 
+ac_cv_solaris_ufsvfs_has_dqrwlock=yes,
+ac_cv_solaris_ufsvfs_has_dqrwlock=no)])
+AC_MSG_RESULT($ac_cv_solaris_ufsvfs_has_dqrwlock)
+if test "$ac_cv_solaris_ufsvfs_has_dqrwlock" = "yes"; then
+  AC_DEFINE(HAVE_VFS_DQRWLOCK, 1, [define if struct ufsvfs has vfs_dqrwlock])
+fi
+])
+
+
+AC_DEFUN([SOLARIS_PROC_HAS_P_COREFILE], [
+AC_MSG_CHECKING(for p_corefile in struct proc)
+AC_CACHE_VAL(ac_cv_solaris_proc_has_p_corefile,
+[
+AC_TRY_COMPILE(
+[#define _KERNEL
+#include <sys/proc.h>],
+[struct proc _proc;
+(void) _proc.p_corefile;], 
+ac_cv_solaris_proc_has_p_corefile=yes,
+ac_cv_solaris_proc_has_p_corefile=no)])
+AC_MSG_RESULT($ac_cv_solaris_proc_has_p_corefile)
+if test "$ac_cv_solaris_proc_has_p_corefile" = "yes"; then
+  AC_DEFINE(HAVE_P_COREFILE, 1, [define if struct proc has p_corefile])
+fi
+])
+
+
+AC_DEFUN([SOLARIS_FS_HAS_FS_ROLLED], [
+AC_MSG_CHECKING(for fs_rolled in struct proc)
+AC_CACHE_VAL(ac_cv_solaris_fs_has_fs_rolled,
+[
+AC_TRY_COMPILE(
+[#include <sys/fs/ufs_fs.h>],
+[struct fs _fs;
+(void) _fs.fs_rolled;], 
+ac_cv_solaris_fs_has_fs_rolled=yes,
+ac_cv_solaris_fs_has_fs_rolled=no)])
+AC_MSG_RESULT($ac_cv_solaris_fs_has_fs_rolled)
+if test "$ac_cv_solaris_fs_has_fs_rolled" = "yes"; then
+  AC_DEFINE(STRUCT_FS_HAS_FS_ROLLED, 1, [define if struct fs has fs_rolled])
+fi
+])
+
+
 
 AC_DEFUN([OPENAFS_GCC_SUPPORTS_MARCH], [
 AC_MSG_CHECKING(if $CC accepts -march=pentium)
@@ -1879,6 +1969,113 @@ ac_cv_linux_func_inode_setattr_returns_int=no)])
 AC_MSG_RESULT($ac_cv_linux_func_inode_setattr_returns_int)
 CPPFLAGS="$save_CPPFLAGS"])
 
+AC_DEFUN([LINUX_WRITE_INODE_RETURN_TYPE],[
+AC_MSG_CHECKING(for write_inode return type)
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+AC_CACHE_VAL(ac_cv_linux_func_write_inode_returns_int,
+[
+AC_TRY_COMPILE(
+[#include <linux/fs.h>],
+[struct inode _inode; 
+struct super_operations _sops;
+int i; 
+i = _sops.write_inode(&_inode, 0);], 
+ac_cv_linux_func_write_inode_returns_int=yes,
+ac_cv_linux_func_write_inode_returns_int=no)])
+AC_MSG_RESULT($ac_cv_linux_func_write_inode_returns_int)
+CPPFLAGS="$save_CPPFLAGS"])
+
+AC_DEFUN([LINUX_IOP_NAMEIDATA],[
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+AC_MSG_CHECKING(whether inode_operations.create takes a nameidata)
+AC_CACHE_VAL(ac_cv_linux_func_i_create_takes_nameidata,
+[
+AC_TRY_COMPILE(
+[#include <linux/fs.h>
+#include <linux/namei.h>],
+[struct inode _inode; 
+struct dentry _dentry;
+struct nameidata _nameidata;
+(void)_inode.i_op->create(&_inode, &_dentry, 0, &_nameidata);],
+ac_cv_linux_func_i_create_takes_nameidata=yes,
+ac_cv_linux_func_i_create_takes_nameidata=no)])
+AC_MSG_RESULT($ac_cv_linux_func_i_create_takes_nameidata)
+if test "x$ac_cv_linux_func_i_create_takes_nameidata" = "xyes" ; then
+AC_DEFINE(IOP_CREATE_TAKES_NAMEIDATA, 1, [define if your iops.create takes a nameidata argument])
+fi
+AC_MSG_CHECKING(whether inode_operations.lookup takes a nameidata)
+AC_CACHE_VAL(ac_cv_linux_func_i_lookup_takes_nameidata,
+[
+AC_TRY_COMPILE(
+[#include <linux/fs.h>
+#include <linux/namei.h>],
+[struct inode _inode; 
+struct dentry _dentry;
+struct nameidata _nameidata;
+(void)_inode.i_op->lookup(&_inode, &_dentry, &_nameidata);],
+ac_cv_linux_func_i_lookup_takes_nameidata=yes,
+ac_cv_linux_func_i_lookup_takes_nameidata=no)])
+AC_MSG_RESULT($ac_cv_linux_func_i_lookup_takes_nameidata)
+if test "x$ac_cv_linux_func_i_lookup_takes_nameidata" = "xyes" ; then
+AC_DEFINE(IOP_LOOKUP_TAKES_NAMEIDATA, 1, [define if your iops.lookup takes a nameidata argument])
+fi
+AC_MSG_CHECKING(whether inode_operations.permission takes a nameidata)
+AC_CACHE_VAL(ac_cv_linux_func_i_permission_takes_nameidata,
+[
+AC_TRY_COMPILE(
+[#include <linux/fs.h>
+#include <linux/namei.h>],
+[struct inode _inode; 
+struct nameidata _nameidata;
+(void)_inode.i_op->permission(&_inode, 0, &_nameidata);],
+ac_cv_linux_func_i_permission_takes_nameidata=yes,
+ac_cv_linux_func_i_permission_takes_nameidata=no)])
+AC_MSG_RESULT($ac_cv_linux_func_i_permission_takes_nameidata)
+if test "x$ac_cv_linux_func_i_permission_takes_nameidata" = "xyes" ; then
+AC_DEFINE(IOP_PERMISSION_TAKES_NAMEIDATA, 1, [define if your iops.permission takes a nameidata argument])
+fi
+AC_MSG_CHECKING(whether dentry_operations.d_revalidate takes a nameidata)
+CPPFLAGS="$CPPFLAGS -Werror"
+AC_CACHE_VAL(ac_cv_linux_func_d_revalidate_takes_nameidata,
+[
+AC_TRY_COMPILE(
+[#include <linux/fs.h>
+#include <linux/namei.h>],
+[struct dentry _dentry; 
+struct nameidata _nameidata;
+(void)_dentry.d_op->d_revalidate(&_dentry, &_nameidata);],
+ac_cv_linux_func_d_revalidate_takes_nameidata=yes,
+ac_cv_linux_func_d_revalidate_takes_nameidata=no)])
+AC_MSG_RESULT($ac_cv_linux_func_d_revalidate_takes_nameidata)
+if test "x$ac_cv_linux_func_d_revalidate_takes_nameidata" = "xyes" ; then
+  AC_DEFINE(DOP_REVALIDATE_TAKES_NAMEIDATA, 1, [define if your dops.d_revalidate takes a nameidata argument])
+fi
+CPPFLAGS="$save_CPPFLAGS"])
+
+AC_DEFUN([LINUX_AOP_WRITEBACK_CONTROL],[
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+AC_MSG_CHECKING(whether address_space_operations.writepage takes a writeback_control)
+AC_CACHE_VAL(ac_cv_linux_func_a_writepage_takes_writeback_control,
+[
+AC_TRY_COMPILE(
+[#include <linux/fs.h>
+#include <linux/mm.h>
+#include <linux/writeback.h>],
+[struct address_space_operations _aops; 
+struct page _page;
+struct writeback_control _writeback_control;
+(void)_aops.writepage(&_page, &_writeback_control);],
+ac_cv_linux_func_a_writepage_takes_writeback_control=yes,
+ac_cv_linux_func_a_writepage_takes_writeback_control=no)])
+AC_MSG_RESULT($ac_cv_linux_func_a_writepage_takes_writeback_control)
+if test "x$ac_cv_linux_func_a_writepage_takes_writeback_control" = "xyes" ; then
+AC_DEFINE(AOP_WRITEPAGE_TAKES_WRITEBACK_CONTROL, 1, [define if your aops.writepage takes a struct writeback_control argument])
+fi
+CPPFLAGS="$save_CPPFLAGS"])
+
 AC_DEFUN([LINUX_KERNEL_LINUX_SYSCALL_H],[
   AC_MSG_CHECKING(for linux/syscall.h in kernel)
   if test -f "${LINUX_KERNEL_PATH}/include/linux/syscall.h"; then
@@ -1926,7 +2123,7 @@ else
 [#include <linux/version.h>
 #include <linux/config.h>
 ],
-[#if !defined(CONFIG_MODVERSIONS) || (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0))
+[#if !defined(CONFIG_MODVERSIONS)
 lose;
 #endif
 ],
@@ -1936,6 +2133,8 @@ lose;
   AC_MSG_CHECKING(which kernel modules to build)
   if false; then
       MPS="MP SP"
+  elif test "x$ac_cv_linux_config_modversions" = "xno" -a "$AFS_SYSKVERS" -lt 26; then
+      MPS="MP SP"
   else
   AC_CACHE_VAL(ac_cv_linux_config_smp, [
   AC_TRY_COMPILE(
@@ -1992,59 +2191,21 @@ AC_TRY_COMPILE(
 AC_MSG_RESULT($ac_cv_linux_kernel_sock_create_v)
 CPPFLAGS="$save_CPPFLAGS"])
 
-
-AC_DEFUN([SOLARIS_UFSVFS_HAS_DQRWLOCK], [
-AC_MSG_CHECKING(for vfs_dqrwlock in struct ufsvfs)
-AC_CACHE_VAL(ac_cv_solaris_ufsvfs_has_dqrwlock,
-[
-AC_TRY_COMPILE(
-[#define _KERNEL
-#include <sys/fs/ufs_inode.h>],
-[struct ufsvfs _ufsvfs;
-(void) _ufsvfs.vfs_dqrwlock;], 
-ac_cv_solaris_ufsvfs_has_dqrwlock=yes,
-ac_cv_solaris_ufsvfs_has_dqrwlock=no)])
-AC_MSG_RESULT($ac_cv_solaris_ufsvfs_has_dqrwlock)
-if test "$ac_cv_solaris_ufsvfs_has_dqrwlock" = "yes"; then
-  AC_DEFINE(HAVE_VFS_DQRWLOCK, 1, [define if struct ufsvfs has vfs_dqrwlock])
-fi
-])
-
-
-AC_DEFUN([SOLARIS_PROC_HAS_P_COREFILE], [
-AC_MSG_CHECKING(for p_corefile in struct proc)
-AC_CACHE_VAL(ac_cv_solaris_proc_has_p_corefile,
-[
-AC_TRY_COMPILE(
-[#define _KERNEL
-#include <sys/proc.h>],
-[struct proc _proc;
-(void) _proc.p_corefile;], 
-ac_cv_solaris_proc_has_p_corefile=yes,
-ac_cv_solaris_proc_has_p_corefile=no)])
-AC_MSG_RESULT($ac_cv_solaris_proc_has_p_corefile)
-if test "$ac_cv_solaris_proc_has_p_corefile" = "yes"; then
-  AC_DEFINE(HAVE_P_COREFILE, 1, [define if struct proc has p_corefile])
-fi
-])
-
-
-AC_DEFUN([SOLARIS_FS_HAS_FS_ROLLED], [
-AC_MSG_CHECKING(for fs_rolled in struct proc)
-AC_CACHE_VAL(ac_cv_solaris_fs_has_fs_rolled,
+AC_DEFUN([LINUX_KERNEL_PAGE_FOLLOW_LINK],[
+AC_MSG_CHECKING(for page_follow_link_light vs page_follow_link)
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
+AC_CACHE_VAL(ac_cv_linux_kernel_page_follow_link,
 [
 AC_TRY_COMPILE(
-[#include <sys/fs/ufs_fs.h>],
-[struct fs _fs;
-(void) _fs.fs_rolled;], 
-ac_cv_solaris_fs_has_fs_rolled=yes,
-ac_cv_solaris_fs_has_fs_rolled=no)])
-AC_MSG_RESULT($ac_cv_solaris_fs_has_fs_rolled)
-if test "$ac_cv_solaris_fs_has_fs_rolled" = "yes"; then
-  AC_DEFINE(STRUCT_FS_HAS_FS_ROLLED, 1, [define if struct fs has fs_rolled])
-fi
-])
-
+  [#include <linux/fs.h>],
+  [
+  page_follow_link(0,0)
+  ],
+  ac_cv_linux_kernel_page_follow_link=yes,
+  ac_cv_linux_kernel_page_follow_link=no)])
+AC_MSG_RESULT($ac_cv_linux_kernel_page_follow_page)
+CPPFLAGS="$save_CPPFLAGS"])
 
 AC_DEFUN([AC_FUNC_RES_SEARCH], [
   ac_cv_func_res_search=no
@@ -2267,7 +2428,7 @@ case $AFS_SYSNAME in
                YACC="byacc"
                ;;
 
-       *nbsd20)
+       *nbsd2*)
                LEX="flex -l"
                MT_CFLAGS='${XCFLAGS} -DAFS_PTHREAD_ENV -D_REENTRANT '
                MT_LIBS="-lpthread" # XXX -pthread soon
@@ -2289,7 +2450,7 @@ case $AFS_SYSNAME in
                YACC="bison -y"
                ;;
 
-       ia64_linux24)
+       ia64_linux24|ia64_linux26)
                KERN_OPTMZ=-O2
                LEX="flex -l"
                MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
@@ -2396,6 +2557,26 @@ case $AFS_SYSNAME in
                SHLIB_LINKER="${MT_CC} -shared"
                ;;
 
+       i386_umlinux26)
+               CC="gcc -pipe"
+               CCOBJ="gcc -pipe"
+               MT_CC="gcc -pipe"
+               KERN_OPTMZ=-O2
+               LEX="flex -l"
+               MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
+               MT_LIBS="-lpthread"
+               DBG=-g
+               KERN_DBG=-g
+               LWP_DBG=-g
+               LWP_OPTMZ=-O2
+               OPTMZ=-O2
+               PAM_CFLAGS="-g -O2 -Dlinux -DLINUX_PAM -fPIC"
+               SHLIB_LDFLAGS="-shared -Xlinker -x"
+               TXLIBS="-lncurses"
+               XCFLAGS="-g -O2 -D_LARGEFILE64_SOURCE"
+               SHLIB_LINKER="${MT_CC} -shared"
+               ;;
+
        *_obsd*)
                LEX="flex -l"
                MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
index 42f0c21cad2d87dcbf3b282493017390bbc78512..84954bbfc114aa4aaf132816f78f06fd3eee1a20 100755 (executable)
--- a/configure
+++ b/configure
@@ -309,7 +309,7 @@ ac_includes_default="\
 # 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 datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE am__leading_dot CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE build build_cpu build_vendor build_os host host_cpu host_vendor host_os CPP EGREP LN_S RANLIB ac_ct_RANLIB YACC LEX LEXLIB LEX_OUTPUT_ROOT P5PLUS_KOPTS LINUX_GCC_KOPTS RHCONFIG_SP RHCONFIG_MP MPS HEADER_RT PTHREAD_LIBS XBSA_CFLAGS HAVE_PAM BUILD_LOGIN afsconfdir viceetcdir afskerneldir afssrvbindir afssrvsbindir afssrvlibexecdir afsdbdir afslogsdir afslocaldir afsbackupdir afsbosconfigdir AFS_SYSNAME AFS_PARAM_COMMON ENABLE_KERNEL_MODULE LIB_AFSDB LINUX_KERNEL_PATH BSD_KERNEL_PATH BSD_KERNEL_BUILD LINUX_VERSION MKAFS_OSTYPE TOP_OBJDIR TOP_SRCDIR TOP_INCDIR TOP_LIBDIR DEST WITH_OBSOLETE WITH_INSECURE DARWIN_INFOFILE IRIX_BUILD_IP35 AS AR MV RM LD CP LORDER XFS_SIZE_CHECK install_XFS_SIZE_CHECK dest_XFS_SIZE_CHECK FS_CONV_SOL26 install_FS_CONV_SOL26 dest_FS_CONV_SOL26 FS_CONV_OSF40D install_FS_CONV_OSF40D dest_FS_CONV_OSF40D CCXPG2 CCOBJ AFSD_LIBS AFSD_LDFLAGS AIX64 DBG FSINCLUDES KERN_DBG KERN_OPTMZ LWP_DBG LWP_OPTMZ MT_CC MT_CFLAGS MT_LIBS OPTMZ PAM_CFLAGS PAM_LIBS PINSTALL_LIBS REGEX_OBJ SHLIB_CFLAGS SHLIB_LDFLAGS SHLIB_LINKER SHLIB_SUFFIX TXLIBS VFSCK_CFLAGS XCFLAGS XCFLAGS64 XLDFLAGS XLDFLAGS64 XLIBELFA XLIBKVM XLIBS HELPER_SPLINT HELPER_SPLINTCFG LIBOBJS LTLIBOBJS'
+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 datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE am__leading_dot CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE build build_cpu build_vendor build_os host host_cpu host_vendor host_os CPP EGREP LN_S RANLIB ac_ct_RANLIB YACC LEX LEXLIB LEX_OUTPUT_ROOT HEADER_RT P5PLUS_KOPTS LINUX_GCC_KOPTS RHCONFIG_SP RHCONFIG_MP MPS PTHREAD_LIBS XBSA_CFLAGS HAVE_PAM BUILD_LOGIN afsconfdir viceetcdir afskerneldir afssrvbindir afssrvsbindir afssrvlibexecdir afsdbdir afslogsdir afslocaldir afsbackupdir afsbosconfigdir AFS_SYSNAME AFS_PARAM_COMMON ENABLE_KERNEL_MODULE LIB_AFSDB LINUX_KERNEL_PATH BSD_KERNEL_PATH BSD_KERNEL_BUILD LINUX_VERSION MKAFS_OSTYPE TOP_OBJDIR TOP_SRCDIR TOP_INCDIR TOP_LIBDIR DEST WITH_OBSOLETE WITH_INSECURE DARWIN_INFOFILE IRIX_BUILD_IP35 AS AR MV RM LD CP LORDER XFS_SIZE_CHECK install_XFS_SIZE_CHECK dest_XFS_SIZE_CHECK FS_CONV_SOL26 install_FS_CONV_SOL26 dest_FS_CONV_SOL26 FS_CONV_OSF40D install_FS_CONV_OSF40D dest_FS_CONV_OSF40D CCXPG2 CCOBJ AFSD_LIBS AFSD_LDFLAGS AIX64 DBG FSINCLUDES KERN_DBG KERN_OPTMZ LWP_DBG LWP_OPTMZ MT_CC MT_CFLAGS MT_LIBS OPTMZ PAM_CFLAGS PAM_LIBS PINSTALL_LIBS REGEX_OBJ SHLIB_CFLAGS SHLIB_LDFLAGS SHLIB_LINKER SHLIB_SUFFIX TXLIBS VFSCK_CFLAGS XCFLAGS XCFLAGS64 XLDFLAGS XLDFLAGS64 XLIBELFA XLIBKVM XLIBS HELPER_SPLINT HELPER_SPLINTCFG LIBOBJS LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
@@ -1612,7 +1612,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE=openafs
- VERSION=1.3.74
+ VERSION=1.3.77
 
 
 cat >>confdefs.h <<_ACEOF
@@ -4777,6 +4777,7 @@ echo $ECHO_N "checking your OS... $ECHO_C" >&6
 system=$host
 case $system in
         *-linux*)
+
                MKAFS_OSTYPE=LINUX
                if test "x$enable_redhat_buildsys" = "xyes"; then
 
@@ -4838,16 +4839,23 @@ echo "$as_me: WARNING: No usable linux headers found at $LINUX_KERNEL_PATH so di
                fi
                echo "$as_me:$LINENO: result: linux" >&5
 echo "${ECHO_T}linux" >&6
-               if test "x$enable_kernel_module" = "xyes"; then
-                if test "x$enable_debug_kernel" = "xno"; then
-                       LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -fomit-frame-pointer"
-                fi
+                if test "x$enable_kernel_module" = "xyes"; then
+                 AFS_SYSKVERS=`echo $LINUX_VERSION | awk -F\. '{print $1 $2}'`
+                 if test "x${AFS_SYSKVERS}" = "x"; then
+                  { { echo "$as_me:$LINENO: error: Couldn't guess your Linux version 2" >&5
+echo "$as_me: error: Couldn't guess your Linux version 2" >&2;}
+   { (exit 1); exit 1; }; }
+                 fi
+                fi
+                ;;
+        *-solaris*)
+               MKAFS_OSTYPE=SOLARIS
+                echo "$as_me:$LINENO: result: sun4" >&5
+echo "${ECHO_T}sun4" >&6
 
-echo "$as_me:$LINENO: checking if $CC accepts -march=pentium" >&5
-echo $ECHO_N "checking if $CC accepts -march=pentium... $ECHO_C" >&6
-save_CFLAGS="$CFLAGS"
-CFLAGS="-MARCH=pentium"
-if test "${openafs_gcc_supports_march+set}" = set; then
+echo "$as_me:$LINENO: checking for vfs_dqrwlock in struct ufsvfs" >&5
+echo $ECHO_N "checking for vfs_dqrwlock in struct ufsvfs... $ECHO_C" >&6
+if test "${ac_cv_solaris_ufsvfs_has_dqrwlock+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
@@ -4857,11 +4865,13 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
+#define _KERNEL
+#include <sys/fs/ufs_inode.h>
 int
 main ()
 {
-int x;
+struct ufsvfs _ufsvfs;
+(void) _ufsvfs.vfs_dqrwlock;
   ;
   return 0;
 }
@@ -4887,94 +4897,30 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  openafs_gcc_supports_march=yes
+  ac_cv_solaris_ufsvfs_has_dqrwlock=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-openafs_gcc_supports_march=no
+ac_cv_solaris_ufsvfs_has_dqrwlock=no
 fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 
-echo "$as_me:$LINENO: result: $openafs_gcc_supports_march" >&5
-echo "${ECHO_T}$openafs_gcc_supports_march" >&6
-if test x$openafs_gcc_supports_march = xyes; then
-  P5PLUS_KOPTS="-march=pentium"
-else
-  P5PLUS_KOPTS="-m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2"
-fi
-CFLAGS="$save_CFLAGS"
-
-
-
-echo "$as_me:$LINENO: checking if $CC needs -fno-strength-reduce" >&5
-echo $ECHO_N "checking if $CC needs -fno-strength-reduce... $ECHO_C" >&6
-save_CFLAGS="$CFLAGS"
-CFLAGS="-fno-strength-reduce"
-if test "${openafs_gcc_needs_no_strength_reduce+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.  */
+echo "$as_me:$LINENO: result: $ac_cv_solaris_ufsvfs_has_dqrwlock" >&5
+echo "${ECHO_T}$ac_cv_solaris_ufsvfs_has_dqrwlock" >&6
+if test "$ac_cv_solaris_ufsvfs_has_dqrwlock" = "yes"; then
 
-int
-main ()
-{
-int x;
-  ;
-  return 0;
-}
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_VFS_DQRWLOCK 1
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  openafs_gcc_needs_no_strength_reduce=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-openafs_gcc_needs_no_strength_reduce=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
 
-echo "$as_me:$LINENO: result: $openafs_gcc_needs_no_strength_reduce" >&5
-echo "${ECHO_T}$openafs_gcc_needs_no_strength_reduce" >&6
-if test x$openafs_gcc_needs_no_strength_reduce = xyes; then
-  LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -fno-strength-reduce"
 fi
-CFLAGS="$save_CFLAGS"
 
 
-echo "$as_me:$LINENO: checking if $CC needs -fno-strict-aliasing" >&5
-echo $ECHO_N "checking if $CC needs -fno-strict-aliasing... $ECHO_C" >&6
-save_CFLAGS="$CFLAGS"
-CFLAGS="-fno-strict-aliasing"
-if test "${openafs_gcc_needs_no_strict_aliasing+set}" = set; then
+echo "$as_me:$LINENO: checking for p_corefile in struct proc" >&5
+echo $ECHO_N "checking for p_corefile in struct proc... $ECHO_C" >&6
+if test "${ac_cv_solaris_proc_has_p_corefile+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
@@ -4984,11 +4930,13 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
+#define _KERNEL
+#include <sys/proc.h>
 int
 main ()
 {
-int x;
+struct proc _proc;
+(void) _proc.p_corefile;
   ;
   return 0;
 }
@@ -5014,91 +4962,30 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  openafs_gcc_needs_no_strict_aliasing=yes
+  ac_cv_solaris_proc_has_p_corefile=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-openafs_gcc_needs_no_strict_aliasing=no
+ac_cv_solaris_proc_has_p_corefile=no
 fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 
-echo "$as_me:$LINENO: result: $openafs_gcc_needs_no_strict_aliasing" >&5
-echo "${ECHO_T}$openafs_gcc_needs_no_strict_aliasing" >&6
-if test x$openafs_gcc_needs_no_strict_aliasing = xyes; then
-  LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -fno-strict-aliasing"
-fi
-CFLAGS="$save_CFLAGS"
-
-
-echo "$as_me:$LINENO: checking if $CC supports -fno-common" >&5
-echo $ECHO_N "checking if $CC supports -fno-common... $ECHO_C" >&6
-save_CFLAGS="$CFLAGS"
-CFLAGS="-fno-common"
-if test "${openafs_gcc_supports_no_common+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.  */
+echo "$as_me:$LINENO: result: $ac_cv_solaris_proc_has_p_corefile" >&5
+echo "${ECHO_T}$ac_cv_solaris_proc_has_p_corefile" >&6
+if test "$ac_cv_solaris_proc_has_p_corefile" = "yes"; then
 
-int
-main ()
-{
-int x;
-  ;
-  return 0;
-}
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_P_COREFILE 1
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  openafs_gcc_supports_no_common=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-openafs_gcc_supports_no_common=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
 
-echo "$as_me:$LINENO: result: $openafs_gcc_supports_no_common" >&5
-echo "${ECHO_T}$openafs_gcc_supports_no_common" >&6
-if test x$openafs_gcc_supports_no_common = xyes; then
-  LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -fno-common"
 fi
-CFLAGS="$save_CFLAGS"
 
 
-echo "$as_me:$LINENO: checking if $CC supports -pipe" >&5
-echo $ECHO_N "checking if $CC supports -pipe... $ECHO_C" >&6
-save_CFLAGS="$CFLAGS"
-CFLAGS="-pipe"
-if test "${openafs_gcc_supports_pipe+set}" = set; then
+echo "$as_me:$LINENO: checking for fs_rolled in struct proc" >&5
+echo $ECHO_N "checking for fs_rolled in struct proc... $ECHO_C" >&6
+if test "${ac_cv_solaris_fs_has_fs_rolled+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
@@ -5108,11 +4995,12 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
+#include <sys/fs/ufs_fs.h>
 int
 main ()
 {
-int x;
+struct fs _fs;
+(void) _fs.fs_rolled;
   ;
   return 0;
 }
@@ -5138,2392 +5026,97 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  openafs_gcc_supports_pipe=yes
+  ac_cv_solaris_fs_has_fs_rolled=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-openafs_gcc_supports_pipe=no
+ac_cv_solaris_fs_has_fs_rolled=no
 fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 
-echo "$as_me:$LINENO: result: $openafs_gcc_supports_pipe" >&5
-echo "${ECHO_T}$openafs_gcc_supports_pipe" >&6
-if test x$openafs_gcc_supports_pipe = xyes; then
-  LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -pipe"
-fi
-CFLAGS="$save_CFLAGS"
-
-
-
-echo "$as_me:$LINENO: checking whether to build osi_vfs.h" >&5
-echo $ECHO_N "checking whether to build osi_vfs.h... $ECHO_C" >&6
-configdir=${srcdir}/src/config
-outputdir=src/afs/LINUX
-tmpldir=${srcdir}/src/afs/LINUX
-chmod +x $configdir/make_vnode.pl
-$configdir/make_vnode.pl -i $LINUX_KERNEL_PATH -t ${tmpldir} -o $outputdir
-
-
-
-echo "$as_me:$LINENO: checking for linux/completion.h existance" >&5
-echo $ECHO_N "checking for linux/completion.h existance... $ECHO_C" >&6
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
-if test "${ac_cv_linux_completion_h_exists+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
+echo "$as_me:$LINENO: result: $ac_cv_solaris_fs_has_fs_rolled" >&5
+echo "${ECHO_T}$ac_cv_solaris_fs_has_fs_rolled" >&6
+if test "$ac_cv_solaris_fs_has_fs_rolled" = "yes"; then
 
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
+cat >>confdefs.h <<\_ACEOF
+#define STRUCT_FS_HAS_FS_ROLLED 1
 _ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <linux/completion.h>
-#include <linux/version.h>
-int
-main ()
-{
-struct completion _c;
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,4,8)
-lose
-#endif
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_completion_h_exists=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_completion_h_exists=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_linux_completion_h_exists" >&5
-echo "${ECHO_T}$ac_cv_linux_completion_h_exists" >&6
-CPPFLAGS="$save_CPPFLAGS"
-
-echo "$as_me:$LINENO: checking for defined for_each_process" >&5
-echo $ECHO_N "checking for defined for_each_process... $ECHO_C" >&6
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
-if test "${ac_cv_linux_defines_for_each_process+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.  */
-#include <linux/sched.h>
-int
-main ()
-{
-#ifndef for_each_process(p)
-#error for_each_process not defined
-#endif
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_defines_for_each_process=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_defines_for_each_process=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 
-echo "$as_me:$LINENO: result: $ac_cv_linux_defines_for_each_process" >&5
-echo "${ECHO_T}$ac_cv_linux_defines_for_each_process" >&6
-CPPFLAGS="$save_CPPFLAGS"
-
-echo "$as_me:$LINENO: checking for defined prev_task" >&5
-echo $ECHO_N "checking for defined prev_task... $ECHO_C" >&6
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
-if test "${ac_cv_linux_defines_prev_task+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.  */
-#include <linux/sched.h>
-int
-main ()
-{
-#ifndef prev_task(p)
-#error prev_task not defined
-#endif
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_defines_prev_task=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_defines_prev_task=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
+                ;;
+        *-sunos*)
+               MKAFS_OSTYPE=SUNOS
+               enable_kernel_module=no
+                echo "$as_me:$LINENO: result: sun4" >&5
+echo "${ECHO_T}sun4" >&6
+                ;;
+        *-hpux*)
+               MKAFS_OSTYPE=HPUX
+                echo "$as_me:$LINENO: result: hp_ux" >&5
+echo "${ECHO_T}hp_ux" >&6
+                ;;
+        *-irix*)
+               if test -d /usr/include/sys/SN/SN1; then
+                IRIX_BUILD_IP35="IP35"
+               fi
+               MKAFS_OSTYPE=IRIX
+                echo "$as_me:$LINENO: result: sgi" >&5
+echo "${ECHO_T}sgi" >&6
+                ;;
+        *-aix*)
+               MKAFS_OSTYPE=AIX
+                echo "$as_me:$LINENO: result: rs_aix" >&5
+echo "${ECHO_T}rs_aix" >&6
+                ;;
+        *-osf*)
+               MKAFS_OSTYPE=DUX
+                echo "$as_me:$LINENO: result: alpha_dux" >&5
+echo "${ECHO_T}alpha_dux" >&6
+               if test "x$enable_kernel_module" = "xyes"; then
+                if test "x$with_dux_kernel_headers" != "x"; then
+                  HEADER_RT=`ls ${with_dux_kernel_headers}/rt_preempt.h | head -1 | sed 's,/rt_preempt.h,,;s,/usr/sys/,,'`
+                else
+                  HEADER_RT=`ls /usr/sys/*/rt_preempt.h | head -1 | sed 's,/rt_preempt.h,,;s,/usr/sys/,,'`
+                fi
+               fi
+               if test "$HEADER_RT" = "*" ; then
+                       { { echo "$as_me:$LINENO: error: Need a configured kernel directory" >&5
+echo "$as_me: error: Need a configured kernel directory" >&2;}
+   { (exit 1); exit 1; }; }
+               fi
 
-echo "$as_me:$LINENO: result: $ac_cv_linux_defines_prev_task" >&5
-echo "${ECHO_T}$ac_cv_linux_defines_prev_task" >&6
-CPPFLAGS="$save_CPPFLAGS"
+                ;;
+        *-darwin*)
+               MKAFS_OSTYPE=DARWIN
+                echo "$as_me:$LINENO: result: ppc_darwin" >&5
+echo "${ECHO_T}ppc_darwin" >&6
+                ;;
+       *-freebsd*)
+               MKAFS_OSTYPE=FBSD
+               echo "$as_me:$LINENO: result: i386_fbsd" >&5
+echo "${ECHO_T}i386_fbsd" >&6
+               ;;
+       *-netbsd*)
+               MKAFS_OSTYPE=NBSD
+               echo "$as_me:$LINENO: result: nbsd" >&5
+echo "${ECHO_T}nbsd" >&6
+               ;;
+       *-openbsd*)
+               MKAFS_OSTYPE=OBSD
+               echo "$as_me:$LINENO: result: i386_obsd" >&5
+echo "${ECHO_T}i386_obsd" >&6
+               ;;
+        *)
+                echo "$as_me:$LINENO: result: $system" >&5
+echo "${ECHO_T}$system" >&6
+                ;;
+esac
 
-echo "$as_me:$LINENO: checking for exported tasklist_lock" >&5
-echo $ECHO_N "checking for exported tasklist_lock... $ECHO_C" >&6
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
-if test "${ac_cv_linux_exports_tasklist_lock+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.  */
-#include <linux/modversions.h>
-int
-main ()
-{
-#ifndef __ver_tasklist_lock
-#error tasklist_lock not exported
-#endif
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_exports_tasklist_lock=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_exports_tasklist_lock=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_linux_exports_tasklist_lock" >&5
-echo "${ECHO_T}$ac_cv_linux_exports_tasklist_lock" >&6
-CPPFLAGS="$save_CPPFLAGS"
-
-echo "$as_me:$LINENO: checking for page_lock in struct address_space" >&5
-echo $ECHO_N "checking for page_lock in struct address_space... $ECHO_C" >&6
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
-if test "${ac_cv_linux_fs_struct_address_space_has_page_lock+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.  */
-#include <linux/fs.h>
-int
-main ()
-{
-struct address_space _a_s;
-printf("%x\n", _a_s.page_lock);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_fs_struct_address_space_has_page_lock=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_fs_struct_address_space_has_page_lock=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_linux_fs_struct_address_space_has_page_lock" >&5
-echo "${ECHO_T}$ac_cv_linux_fs_struct_address_space_has_page_lock" >&6
-CPPFLAGS="$save_CPPFLAGS"
-
-echo "$as_me:$LINENO: checking for gfp_mask in struct address_space" >&5
-echo $ECHO_N "checking for gfp_mask in struct address_space... $ECHO_C" >&6
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
-if test "${ac_cv_linux_fs_struct_address_space_has_gfp_mask+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.  */
-#include <linux/fs.h>
-int
-main ()
-{
-struct address_space _a;
-printf("%d\n", _a.gfp_mask);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_fs_struct_address_space_has_gfp_mask=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_fs_struct_address_space_has_gfp_mask=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_linux_fs_struct_address_space_has_gfp_mask" >&5
-echo "${ECHO_T}$ac_cv_linux_fs_struct_address_space_has_gfp_mask" >&6
-CPPFLAGS="$save_CPPFLAGS"
-
-echo "$as_me:$LINENO: checking for i_alloc_sem in struct inode" >&5
-echo $ECHO_N "checking for i_alloc_sem in struct inode... $ECHO_C" >&6
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
-if test "${ac_cv_linux_fs_struct_inode_has_i_alloc_sem+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.  */
-#include <linux/fs.h>
-int
-main ()
-{
-struct inode _i;
-printf("%x\n", _i.i_alloc_sem);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_fs_struct_inode_has_i_alloc_sem=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_fs_struct_inode_has_i_alloc_sem=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_linux_fs_struct_inode_has_i_alloc_sem" >&5
-echo "${ECHO_T}$ac_cv_linux_fs_struct_inode_has_i_alloc_sem" >&6
-CPPFLAGS="$save_CPPFLAGS"
-
-echo "$as_me:$LINENO: checking for i_truncate_sem in struct inode" >&5
-echo $ECHO_N "checking for i_truncate_sem in struct inode... $ECHO_C" >&6
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
-if test "${ac_cv_linux_fs_struct_inode_has_i_truncate_sem+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.  */
-#include <linux/fs.h>
-int
-main ()
-{
-struct inode _i;
-printf("%x\n", _i.i_truncate_sem);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_fs_struct_inode_has_i_truncate_sem=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_fs_struct_inode_has_i_truncate_sem=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_linux_fs_struct_inode_has_i_truncate_sem" >&5
-echo "${ECHO_T}$ac_cv_linux_fs_struct_inode_has_i_truncate_sem" >&6
-CPPFLAGS="$save_CPPFLAGS"
-
-echo "$as_me:$LINENO: checking for i_dirty_data_buffers in struct inode" >&5
-echo $ECHO_N "checking for i_dirty_data_buffers in struct inode... $ECHO_C" >&6
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
-if test "${ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers+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.  */
-#include <linux/fs.h>
-int
-main ()
-{
-struct inode _inode;
-printf("%d\n", _inode.i_dirty_data_buffers);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers" >&5
-echo "${ECHO_T}$ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers" >&6
-CPPFLAGS="$save_CPPFLAGS"
-
-echo "$as_me:$LINENO: checking for i_devices in struct inode" >&5
-echo $ECHO_N "checking for i_devices in struct inode... $ECHO_C" >&6
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
-if test "${ac_cv_linux_fs_struct_inode_has_i_cdev+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.  */
-#include <linux/fs.h>
-int
-main ()
-{
-struct inode _inode;
-printf("%d\n", _inode.i_devices);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_fs_struct_inode_has_i_devices=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_fs_struct_inode_has_i_devices=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_linux_fs_struct_inode_has_i_devices" >&5
-echo "${ECHO_T}$ac_cv_linux_fs_struct_inode_has_i_devices" >&6
-CPPFLAGS="$save_CPPFLAGS"
-
-echo "$as_me:$LINENO: checking for i_security in struct inode" >&5
-echo $ECHO_N "checking for i_security in struct inode... $ECHO_C" >&6
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
-if test "${ac_cv_linux_fs_struct_inode_has_i_security+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.  */
-#include <linux/fs.h>
-int
-main ()
-{
-struct inode _inode;
-printf("%d\n", _inode.i_security);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_fs_struct_inode_has_i_security=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_fs_struct_inode_has_i_security=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_linux_fs_struct_inode_has_i_security" >&5
-echo "${ECHO_T}$ac_cv_linux_fs_struct_inode_has_i_security" >&6
-CPPFLAGS="$save_CPPFLAGS"
-
-echo "$as_me:$LINENO: checking for inode_setattr return type" >&5
-echo $ECHO_N "checking for inode_setattr return type... $ECHO_C" >&6
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
-if test "${ac_cv_linux_func_inode_setattr_returns_int+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.  */
-#include <linux/fs.h>
-int
-main ()
-{
-struct inode _inode;
-struct iattr _iattr;
-int i;
-i = inode_setattr(&_inode, &_iattr);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_func_inode_setattr_returns_int=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_func_inode_setattr_returns_int=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_linux_func_inode_setattr_returns_int" >&5
-echo "${ECHO_T}$ac_cv_linux_func_inode_setattr_returns_int" >&6
-CPPFLAGS="$save_CPPFLAGS"
-
-  echo "$as_me:$LINENO: checking for linux/syscall.h in kernel" >&5
-echo $ECHO_N "checking for linux/syscall.h in kernel... $ECHO_C" >&6
-  if test -f "${LINUX_KERNEL_PATH}/include/linux/syscall.h"; then
-    ac_linux_syscall=yes
-    echo "$as_me:$LINENO: result: $ac_linux_syscall" >&5
-echo "${ECHO_T}$ac_linux_syscall" >&6
-  else
-    ac_linux_syscall=no
-    echo "$as_me:$LINENO: result: $ac_linux_syscall" >&5
-echo "${ECHO_T}$ac_linux_syscall" >&6
-  fi
-
-
-echo "$as_me:$LINENO: checking for SELinux kernel" >&5
-echo $ECHO_N "checking for SELinux kernel... $ECHO_C" >&6
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include $CPPFLAGS"
-if test "${ac_cv_linux_kernel_is_selinux+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.  */
-#include <linux/autoconf.h>
-int
-main ()
-{
-#ifndef CONFIG_SECURITY_SELINUX
-   #error not SELINUX
-   #endif
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_kernel_is_selinux=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_kernel_is_selinux=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_linux_kernel_is_selinux" >&5
-echo "${ECHO_T}$ac_cv_linux_kernel_is_selinux" >&6
-CPPFLAGS="$save_CPPFLAGS"
-
-echo "$as_me:$LINENO: checking for 5th argument in sock_create found in some SELinux kernels" >&5
-echo $ECHO_N "checking for 5th argument in sock_create found in some SELinux kernels... $ECHO_C" >&6
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
-if test "${ac_cv_linux_kernel_sock_create_v+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.  */
-#include <linux/net.h>
-int
-main ()
-{
-
-  sock_create(0,0,0,0,0)
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_kernel_sock_create_v=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_kernel_sock_create_v=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_linux_kernel_sock_create_v" >&5
-echo "${ECHO_T}$ac_cv_linux_kernel_sock_create_v" >&6
-CPPFLAGS="$save_CPPFLAGS"
-
-RHCONFIG_SP=""
-RHCONFIG_MP=""
-if test "x$enable_redhat_buildsys" = "xyes"; then
-  { echo "$as_me:$LINENO: WARNING: Configured to build from a Red Hat SPEC file" >&5
-echo "$as_me: WARNING: Configured to build from a Red Hat SPEC file" >&2;}
-else
-  echo "$as_me:$LINENO: checking for redhat kernel configuration" >&5
-echo $ECHO_N "checking for redhat kernel configuration... $ECHO_C" >&6
-  if test -f "${LINUX_KERNEL_PATH}/include/linux/rhconfig.h"; then
-    ac_linux_rhconfig=yes
-    RHCONFIG_SP="-D__BOOT_KERNEL_UP=1 -D__BOOT_KERNEL_SMP=0"
-    RHCONFIG_MP="-D__BOOT_KERNEL_UP=0 -D__BOOT_KERNEL_SMP=1"
-    echo "$as_me:$LINENO: result: $ac_linux_rhconfig" >&5
-echo "${ECHO_T}$ac_linux_rhconfig" >&6
-    if test ! -f "/boot/kernel.h"; then
-        { echo "$as_me:$LINENO: WARNING: /boot/kernel.h does not exist. build may fail" >&5
-echo "$as_me: WARNING: /boot/kernel.h does not exist. build may fail" >&2;}
-    fi
-  else
-    ac_linux_rhconfig=no
-    echo "$as_me:$LINENO: result: $ac_linux_rhconfig" >&5
-echo "${ECHO_T}$ac_linux_rhconfig" >&6
-  fi
-fi
-
-
-
-
-echo "$as_me:$LINENO: checking for recalc_sigpending arg type" >&5
-echo $ECHO_N "checking for recalc_sigpending arg type... $ECHO_C" >&6
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
-if test "${ac_cv_linux_func_recalc_sigpending_takes_void+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.  */
-#include <linux/sched.h>
-int
-main ()
-{
-recalc_sigpending();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_func_recalc_sigpending_takes_void=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_func_recalc_sigpending_takes_void=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_linux_func_recalc_sigpending_takes_void" >&5
-echo "${ECHO_T}$ac_cv_linux_func_recalc_sigpending_takes_void" >&6
-CPPFLAGS="$save_CPPFLAGS"
-
-echo "$as_me:$LINENO: checking for parent in struct task_struct" >&5
-echo $ECHO_N "checking for parent in struct task_struct... $ECHO_C" >&6
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
-if test "${ac_cv_linux_sched_struct_task_struct_has_parent+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.  */
-#include <linux/sched.h>
-int
-main ()
-{
-struct task_struct _tsk;
-printf("%d\n", _tsk.parent);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_sched_struct_task_struct_has_parent=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_sched_struct_task_struct_has_parent=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_linux_sched_struct_task_struct_has_parent" >&5
-echo "${ECHO_T}$ac_cv_linux_sched_struct_task_struct_has_parent" >&6
-CPPFLAGS="$save_CPPFLAGS"
-
-echo "$as_me:$LINENO: checking for real_parent in struct task_struct" >&5
-echo $ECHO_N "checking for real_parent in struct task_struct... $ECHO_C" >&6
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
-if test "${ac_cv_linux_sched_struct_task_struct_has_real_parent+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.  */
-#include <linux/sched.h>
-int
-main ()
-{
-struct task_struct _tsk;
-printf("%d\n", _tsk.real_parent);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_sched_struct_task_struct_has_real_parent=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_sched_struct_task_struct_has_real_parent=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_linux_sched_struct_task_struct_has_real_parent" >&5
-echo "${ECHO_T}$ac_cv_linux_sched_struct_task_struct_has_real_parent" >&6
-CPPFLAGS="$save_CPPFLAGS"
-
-echo "$as_me:$LINENO: checking for sig in struct task_struct" >&5
-echo $ECHO_N "checking for sig in struct task_struct... $ECHO_C" >&6
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
-if test "${ac_cv_linux_sched_struct_task_struct_has_sig+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.  */
-#include <linux/sched.h>
-int
-main ()
-{
-struct task_struct _tsk;
-printf("%d\n", _tsk.sig);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_sched_struct_task_struct_has_sig=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_sched_struct_task_struct_has_sig=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_linux_sched_struct_task_struct_has_sig" >&5
-echo "${ECHO_T}$ac_cv_linux_sched_struct_task_struct_has_sig" >&6
-CPPFLAGS="$save_CPPFLAGS"
-
-echo "$as_me:$LINENO: checking for sighand in struct task_struct" >&5
-echo $ECHO_N "checking for sighand in struct task_struct... $ECHO_C" >&6
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
-if test "${ac_cv_linux_sched_struct_task_struct_has_sighand+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.  */
-#include <linux/sched.h>
-int
-main ()
-{
-struct task_struct _tsk;
-printf("%d\n", _tsk.sighand);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_sched_struct_task_struct_has_sighand=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_sched_struct_task_struct_has_sighand=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_linux_sched_struct_task_struct_has_sighand" >&5
-echo "${ECHO_T}$ac_cv_linux_sched_struct_task_struct_has_sighand" >&6
-CPPFLAGS="$save_CPPFLAGS"
-
-echo "$as_me:$LINENO: checking for sigmask_lock in struct task_struct" >&5
-echo $ECHO_N "checking for sigmask_lock in struct task_struct... $ECHO_C" >&6
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
-if test "${ac_cv_linux_sched_struct_task_struct_has_sigmask_lock+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.  */
-#include <linux/sched.h>
-int
-main ()
-{
-struct task_struct _tsk;
-printf("%d\n", _tsk.sigmask_lock);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_sched_struct_task_struct_has_sigmask_lock=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_sched_struct_task_struct_has_sigmask_lock=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_linux_sched_struct_task_struct_has_sigmask_lock" >&5
-echo "${ECHO_T}$ac_cv_linux_sched_struct_task_struct_has_sigmask_lock" >&6
-CPPFLAGS="$save_CPPFLAGS"
-
-if test "x$enable_redhat_buildsys" = "xyes"; then
-  MPS=Default
-else
-  save_CPPFLAGS="$CPPFLAGS"
-  CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $RHCONFIG_SP $CPPFLAGS"
-  echo "$as_me:$LINENO: checking if kernel uses MODVERSIONS" >&5
-echo $ECHO_N "checking if kernel uses MODVERSIONS... $ECHO_C" >&6
-  if test "${ac_cv_linux_config_modversions+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.  */
-#include <linux/version.h>
-#include <linux/config.h>
-
-int
-main ()
-{
-#if !defined(CONFIG_MODVERSIONS) || (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0))
-lose;
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_config_modversions=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_config_modversions=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-  echo "$as_me:$LINENO: result: $ac_cv_linux_config_modversions" >&5
-echo "${ECHO_T}$ac_cv_linux_config_modversions" >&6
-  echo "$as_me:$LINENO: checking which kernel modules to build" >&5
-echo $ECHO_N "checking which kernel modules to build... $ECHO_C" >&6
-  if false; then
-      MPS="MP SP"
-  else
-  if test "${ac_cv_linux_config_smp+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.  */
-#include <linux/config.h>
-
-int
-main ()
-{
-#ifndef CONFIG_SMP
-lose;
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_config_smp=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_config_smp=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-        if test "x$ac_cv_linux_config_smp" = "xyes"; then
-          MPS=MP
-      else
-          MPS=SP
-      fi
-  fi
-  CPPFLAGS=$save_CPPFLAGS
-  echo "$as_me:$LINENO: result: $MPS" >&5
-echo "${ECHO_T}$MPS" >&6
-fi
-
-
-                 if test "x$ac_cv_linux_config_modversions" = "xno"; then
-                   { echo "$as_me:$LINENO: WARNING: Cannot determine sys_call_table status. assuming it isn't exported" >&5
-echo "$as_me: WARNING: Cannot determine sys_call_table status. assuming it isn't exported" >&2;}
-                   ac_cv_linux_exports_sys_call_table=no
-                  if test -f "$LINUX_KERNEL_PATH/include/asm/ia32_unistd.h"; then
-                    ac_cv_linux_exports_ia32_sys_call_table=yes
-                  fi
-                 else
-
-echo "$as_me:$LINENO: checking for exported init_mm" >&5
-echo $ECHO_N "checking for exported init_mm... $ECHO_C" >&6
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
-if test "${ac_cv_linux_exports_init_mm+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.  */
-#include <linux/modversions.h>
-int
-main ()
-{
-#ifndef __ver_init_mm
-#error init_mm not exported
-#endif
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_exports_init_mm=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_exports_init_mm=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_linux_exports_init_mm" >&5
-echo "${ECHO_T}$ac_cv_linux_exports_init_mm" >&6
-CPPFLAGS="$save_CPPFLAGS"
-
-echo "$as_me:$LINENO: checking for exported kallsyms_address_to_symbol" >&5
-echo $ECHO_N "checking for exported kallsyms_address_to_symbol... $ECHO_C" >&6
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
-if test "${ac_cv_linux_exports_kallsyms_address+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.  */
-#include <linux/modversions.h>
-int
-main ()
-{
-#ifndef __ver_kallsyms_address_to_symbol
-#error kallsyms_address_to_symbol not exported
-#endif
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_exports_kallsyms_address=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_exports_kallsyms_address=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_linux_exports_kallsyms_address" >&5
-echo "${ECHO_T}$ac_cv_linux_exports_kallsyms_address" >&6
-CPPFLAGS="$save_CPPFLAGS"
-
-echo "$as_me:$LINENO: checking for exported kallsyms_symbol_to_address" >&5
-echo $ECHO_N "checking for exported kallsyms_symbol_to_address... $ECHO_C" >&6
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
-if test "${ac_cv_linux_exports_kallsyms_symbol+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.  */
-#include <linux/modversions.h>
-int
-main ()
-{
-#ifndef __ver_kallsyms_symbol_to_address
-#error kallsyms_symbol_to_address not exported
-#endif
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_exports_kallsyms_symbol=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_exports_kallsyms_symbol=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_linux_exports_kallsyms_symbol" >&5
-echo "${ECHO_T}$ac_cv_linux_exports_kallsyms_symbol" >&6
-CPPFLAGS="$save_CPPFLAGS"
-
-echo "$as_me:$LINENO: checking for exported sys_call_table" >&5
-echo $ECHO_N "checking for exported sys_call_table... $ECHO_C" >&6
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
-if test "${ac_cv_linux_exports_sys_call_table+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.  */
-#include <linux/modversions.h>
-int
-main ()
-{
-#ifndef __ver_sys_call_table
-#error sys_call_table not exported
-#endif
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_exports_sys_call_table=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_exports_sys_call_table=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_linux_exports_sys_call_table" >&5
-echo "${ECHO_T}$ac_cv_linux_exports_sys_call_table" >&6
-CPPFLAGS="$save_CPPFLAGS"
-
-echo "$as_me:$LINENO: checking for exported ia32_sys_call_table" >&5
-echo $ECHO_N "checking for exported ia32_sys_call_table... $ECHO_C" >&6
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
-if test "${ac_cv_linux_exports_ia32_sys_call_table+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.  */
-#include <linux/modversions.h>
-int
-main ()
-{
-#ifndef __ver_ia32_sys_call_table
-#error ia32_sys_call_table not exported
-#endif
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_exports_ia32_sys_call_table=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_exports_ia32_sys_call_table=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_linux_exports_ia32_sys_call_table" >&5
-echo "${ECHO_T}$ac_cv_linux_exports_ia32_sys_call_table" >&6
-CPPFLAGS="$save_CPPFLAGS"
-
-echo "$as_me:$LINENO: checking for exported sys_chdir" >&5
-echo $ECHO_N "checking for exported sys_chdir... $ECHO_C" >&6
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
-if test "${ac_cv_linux_exports_sys_chdir+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.  */
-#include <linux/modversions.h>
-int
-main ()
-{
-#ifndef __ver_sys_chdir
-#error sys_chdir not exported
-#endif
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_exports_sys_chdir=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_exports_sys_chdir=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_linux_exports_sys_chdir" >&5
-echo "${ECHO_T}$ac_cv_linux_exports_sys_chdir" >&6
-CPPFLAGS="$save_CPPFLAGS"
-
-echo "$as_me:$LINENO: checking for exported sys_close" >&5
-echo $ECHO_N "checking for exported sys_close... $ECHO_C" >&6
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
-if test "${ac_cv_linux_exports_sys_close+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.  */
-#include <linux/modversions.h>
-int
-main ()
-{
-#ifndef __ver_sys_close
-#error sys_close not exported
-#endif
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_exports_sys_close=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_exports_sys_close=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_linux_exports_sys_close" >&5
-echo "${ECHO_T}$ac_cv_linux_exports_sys_close" >&6
-CPPFLAGS="$save_CPPFLAGS"
-
-echo "$as_me:$LINENO: checking for exported sys_wait4" >&5
-echo $ECHO_N "checking for exported sys_wait4... $ECHO_C" >&6
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
-if test "${ac_cv_linux_exports_sys_wait4+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.  */
-#include <linux/modversions.h>
-int
-main ()
-{
-#ifndef __ver_sys_wait4
-#error sys_wait4 not exported
-#endif
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_exports_sys_wait4=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_exports_sys_wait4=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_linux_exports_sys_wait4" >&5
-echo "${ECHO_T}$ac_cv_linux_exports_sys_wait4" >&6
-CPPFLAGS="$save_CPPFLAGS"
-                   if test "x$ac_cv_linux_exports_sys_call_table" = "xno"; then
-                         linux_syscall_method=none
-                         if test "x$ac_cv_linux_exports_init_mm" = "xyes"; then
-                            linux_syscall_method=scan
-                            if test "x$ac_cv_linux_exports_kallsyms_address" = "xyes"; then
-                               linux_syscall_method=scan_with_kallsyms_address
-                            fi
-                         fi
-                         if test "x$ac_cv_linux_exports_kallsyms_symbol" = "xyes"; then
-                            linux_syscall_method=kallsyms_symbol
-                         fi
-                         if test "x$linux_syscall_method" = "xnone"; then
-                        { { echo "$as_me:$LINENO: error: no available sys_call_table access method" >&5
-echo "$as_me: error: no available sys_call_table access method" >&2;}
-   { (exit 1); exit 1; }; }
-                         fi
-                   fi
-                 fi
-                if test -f "$LINUX_KERNEL_PATH/include/linux/in_systm.h"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_IN_SYSTM_H 1
-_ACEOF
-
-                fi
-                if test -f "$LINUX_KERNEL_PATH/include/linux/mm_inline.h"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_MM_INLINE_H 1
-_ACEOF
-
-                fi
-                if test -f "$LINUX_KERNEL_PATH/include/linux/in_systm.h"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_IN_SYSTM_H 1
-_ACEOF
-
-                fi
-                if test "x$ac_cv_linux_exports_sys_chdir" = "xyes" ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define EXPORTED_SYS_CHDIR 1
-_ACEOF
-
-                fi
-                if test "x$ac_cv_linux_exports_sys_close" = "xyes" ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define EXPORTED_SYS_CLOSE 1
-_ACEOF
-
-                fi
-                if test "x$ac_cv_linux_exports_sys_wait4" = "xyes" ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define EXPORTED_SYS_WAIT4 1
-_ACEOF
-
-                fi
-                if test "x$ac_cv_linux_exports_tasklist_lock" = "xyes" ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define EXPORTED_TASKLIST_LOCK 1
-_ACEOF
-
-                fi
-                 if test "x$ac_cv_linux_exports_sys_call_table" = "xyes"; then
-                  cat >>confdefs.h <<\_ACEOF
-#define EXPORTED_SYS_CALL_TABLE 1
-_ACEOF
-
-                 fi
-                 if test "x$ac_cv_linux_exports_ia32_sys_call_table" = "xyes"; then
-                  cat >>confdefs.h <<\_ACEOF
-#define EXPORTED_IA32_SYS_CALL_TABLE 1
-_ACEOF
-
-                 fi
-                 if test "x$ac_cv_linux_exports_kallsyms_symbol" = "xyes"; then
-                  cat >>confdefs.h <<\_ACEOF
-#define EXPORTED_KALLSYMS_SYMBOL 1
-_ACEOF
-
-                 fi
-                 if test "x$ac_cv_linux_exports_kallsyms_address" = "xyes"; then
-                  cat >>confdefs.h <<\_ACEOF
-#define EXPORTED_KALLSYMS_ADDRESS 1
-_ACEOF
-
-                 fi
-                if test "x$ac_cv_linux_completion_h_exists" = "xyes" ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define COMPLETION_H_EXISTS 1
-_ACEOF
-
-                fi
-                if test "x$ac_cv_linux_defines_for_each_process" = "xyes" ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define DEFINED_FOR_EACH_PROCESS 1
-_ACEOF
-
-                fi
-                if test "x$ac_cv_linux_defines_prev_task" = "xyes" ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define DEFINED_PREV_TASK 1
-_ACEOF
-
-                fi
-                if test "x$ac_cv_linux_func_inode_setattr_returns_int" = "xyes" ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define INODE_SETATTR_NOT_VOID 1
-_ACEOF
-
-                fi
-                if test "x$ac_cv_linux_fs_struct_address_space_has_page_lock" = "xyes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK 1
-_ACEOF
-
-                fi
-                if test "x$ac_cv_linux_fs_struct_address_space_has_gfp_mask" = "xyes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define STRUCT_ADDRESS_SPACE_HAS_GFP_MASK 1
-_ACEOF
-
-                fi
-                if test "x$ac_cv_linux_fs_struct_inode_has_i_truncate_sem" = "xyes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define STRUCT_INODE_HAS_I_TRUNCATE_SEM 1
-_ACEOF
-
-                fi
-                if test "x$ac_cv_linux_fs_struct_inode_has_i_alloc_sem" = "xyes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define STRUCT_INODE_HAS_I_ALLOC_SEM 1
-_ACEOF
-
-                fi
-                if test "x$ac_cv_linux_fs_struct_inode_has_i_devices" = "xyes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define STRUCT_INODE_HAS_I_DEVICES 1
-_ACEOF
-
-                fi
-                if test "x$ac_cv_linux_fs_struct_inode_has_i_security" = "xyes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define STRUCT_INODE_HAS_I_SECURITY 1
-_ACEOF
-
-                fi
-                if test "x$ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers" = "xyes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS 1
-_ACEOF
-
-                fi
-                if test "x$ac_cv_linux_func_recalc_sigpending_takes_void" = "xyes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define RECALC_SIGPENDING_TAKES_VOID 1
-_ACEOF
-
-                fi
-                if test "x$ac_cv_linux_kernel_is_selinux" = "xyes" ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define LINUX_KERNEL_IS_SELINUX 1
-_ACEOF
-
-                fi
-                if test "x$ac_cv_linux_kernel_sock_create_v" = "xyes" ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define LINUX_KERNEL_SOCK_CREATE_V 1
-_ACEOF
-
-                fi
-                if test "x$ac_linux_syscall" = "xyes" ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_KERNEL_LINUX_SYSCALL_H 1
-_ACEOF
-
-                fi
-                if test "x$ac_cv_linux_sched_struct_task_struct_has_parent" = "xyes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define STRUCT_TASK_STRUCT_HAS_PARENT 1
-_ACEOF
-
-                fi
-                if test "x$ac_cv_linux_sched_struct_task_struct_has_real_parent" = "xyes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define STRUCT_TASK_STRUCT_HAS_REAL_PARENT 1
-_ACEOF
-
-                fi
-                if test "x$ac_cv_linux_sched_struct_task_struct_has_sigmask_lock" = "xyes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define STRUCT_TASK_STRUCT_HAS_SIGMASK_LOCK 1
-_ACEOF
-
-                fi
-                if test "x$ac_cv_linux_sched_struct_task_struct_has_sighand" = "xyes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define STRUCT_TASK_STRUCT_HAS_SIGHAND 1
-_ACEOF
-
-                fi
-                if test "x$ac_cv_linux_sched_struct_task_struct_has_sig" = "xyes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define STRUCT_TASK_STRUCT_HAS_SIG 1
-_ACEOF
-
-                fi
-                :
-               fi
-                ;;
-        *-solaris*)
-               MKAFS_OSTYPE=SOLARIS
-                echo "$as_me:$LINENO: result: sun4" >&5
-echo "${ECHO_T}sun4" >&6
-
-echo "$as_me:$LINENO: checking for vfs_dqrwlock in struct ufsvfs" >&5
-echo $ECHO_N "checking for vfs_dqrwlock in struct ufsvfs... $ECHO_C" >&6
-if test "${ac_cv_solaris_ufsvfs_has_dqrwlock+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.  */
-#define _KERNEL
-#include <sys/fs/ufs_inode.h>
-int
-main ()
-{
-struct ufsvfs _ufsvfs;
-(void) _ufsvfs.vfs_dqrwlock;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_solaris_ufsvfs_has_dqrwlock=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_solaris_ufsvfs_has_dqrwlock=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_solaris_ufsvfs_has_dqrwlock" >&5
-echo "${ECHO_T}$ac_cv_solaris_ufsvfs_has_dqrwlock" >&6
-if test "$ac_cv_solaris_ufsvfs_has_dqrwlock" = "yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_VFS_DQRWLOCK 1
-_ACEOF
-
-fi
-
-
-echo "$as_me:$LINENO: checking for p_corefile in struct proc" >&5
-echo $ECHO_N "checking for p_corefile in struct proc... $ECHO_C" >&6
-if test "${ac_cv_solaris_proc_has_p_corefile+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.  */
-#define _KERNEL
-#include <sys/proc.h>
-int
-main ()
-{
-struct proc _proc;
-(void) _proc.p_corefile;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_solaris_proc_has_p_corefile=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_solaris_proc_has_p_corefile=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_solaris_proc_has_p_corefile" >&5
-echo "${ECHO_T}$ac_cv_solaris_proc_has_p_corefile" >&6
-if test "$ac_cv_solaris_proc_has_p_corefile" = "yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_P_COREFILE 1
-_ACEOF
-
-fi
-
-
-echo "$as_me:$LINENO: checking for fs_rolled in struct proc" >&5
-echo $ECHO_N "checking for fs_rolled in struct proc... $ECHO_C" >&6
-if test "${ac_cv_solaris_fs_has_fs_rolled+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.  */
-#include <sys/fs/ufs_fs.h>
-int
-main ()
-{
-struct fs _fs;
-(void) _fs.fs_rolled;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_solaris_fs_has_fs_rolled=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_solaris_fs_has_fs_rolled=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_solaris_fs_has_fs_rolled" >&5
-echo "${ECHO_T}$ac_cv_solaris_fs_has_fs_rolled" >&6
-if test "$ac_cv_solaris_fs_has_fs_rolled" = "yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define STRUCT_FS_HAS_FS_ROLLED 1
-_ACEOF
-
-fi
-
-                ;;
-        *-sunos*)
-               MKAFS_OSTYPE=SUNOS
-               enable_kernel_module=no
-                echo "$as_me:$LINENO: result: sun4" >&5
-echo "${ECHO_T}sun4" >&6
-                ;;
-        *-hpux*)
-               MKAFS_OSTYPE=HPUX
-                echo "$as_me:$LINENO: result: hp_ux" >&5
-echo "${ECHO_T}hp_ux" >&6
-                ;;
-        *-irix*)
-               if test -d /usr/include/sys/SN/SN1; then
-                IRIX_BUILD_IP35="IP35"
-               fi
-               MKAFS_OSTYPE=IRIX
-                echo "$as_me:$LINENO: result: sgi" >&5
-echo "${ECHO_T}sgi" >&6
-                ;;
-        *-aix*)
-               MKAFS_OSTYPE=AIX
-                echo "$as_me:$LINENO: result: rs_aix" >&5
-echo "${ECHO_T}rs_aix" >&6
-                ;;
-        *-osf*)
-               MKAFS_OSTYPE=DUX
-                echo "$as_me:$LINENO: result: alpha_dux" >&5
-echo "${ECHO_T}alpha_dux" >&6
-               if test "x$enable_kernel_module" = "xyes"; then
-                if test "x$with_dux_kernel_headers" != "x"; then
-                  HEADER_RT=`ls ${with_dux_kernel_headers}/rt_preempt.h | head -1 | sed 's,/rt_preempt.h,,;s,/usr/sys/,,'`
-                else
-                  HEADER_RT=`ls /usr/sys/*/rt_preempt.h | head -1 | sed 's,/rt_preempt.h,,;s,/usr/sys/,,'`
-                fi
-               fi
-               if test "$HEADER_RT" = "*" ; then
-                       { { echo "$as_me:$LINENO: error: Need a configured kernel directory" >&5
-echo "$as_me: error: Need a configured kernel directory" >&2;}
-   { (exit 1); exit 1; }; }
-               fi
-
-                ;;
-        *-darwin*)
-               MKAFS_OSTYPE=DARWIN
-                echo "$as_me:$LINENO: result: ppc_darwin" >&5
-echo "${ECHO_T}ppc_darwin" >&6
-                ;;
-       *-freebsd*)
-               MKAFS_OSTYPE=FBSD
-               echo "$as_me:$LINENO: result: i386_fbsd" >&5
-echo "${ECHO_T}i386_fbsd" >&6
-               ;;
-       *-netbsd*)
-               MKAFS_OSTYPE=NBSD
-               echo "$as_me:$LINENO: result: nbsd" >&5
-echo "${ECHO_T}nbsd" >&6
-               ;;
-       *-openbsd*)
-               MKAFS_OSTYPE=OBSD
-               echo "$as_me:$LINENO: result: i386_obsd" >&5
-echo "${ECHO_T}i386_obsd" >&6
-               ;;
-        *)
-                echo "$as_me:$LINENO: result: $system" >&5
-echo "${ECHO_T}$system" >&6
-                ;;
-esac
-
-if test "x$with_afs_sysname" != "x"; then
-        AFS_SYSNAME="$with_afs_sysname"
+if test "x$with_afs_sysname" != "x"; then
+        AFS_SYSNAME="$with_afs_sysname"
 else
        echo "$as_me:$LINENO: checking your AFS sysname" >&5
 echo $ECHO_N "checking your AFS sysname... $ECHO_C" >&6
@@ -7612,6 +5205,10 @@ echo $ECHO_N "checking your AFS sysname... $ECHO_C" >&6
                        AFS_PARAM_COMMON=param.nbsd16.h
                        AFS_SYSNAME="ppc_nbsd16"
                        ;;
+               i?86-*-netbsd*2.99*)
+                       AFS_PARAM_COMMON=param.nbsd21.h
+                       AFS_SYSNAME="i386_nbsd21"
+                       ;;
                hppa*-hp-hpux11.0*)
                        AFS_SYSNAME="hp_ux110"
                        ;;
@@ -7767,15 +5364,19 @@ echo $ECHO_N "checking your AFS sysname... $ECHO_C" >&6
                        ;;
                power*-ibm-aix4.2*)
                        AFS_SYSNAME="rs_aix42"
+                       enable_pam="no"
                        ;;
                power*-ibm-aix4.3*)
                        AFS_SYSNAME="rs_aix42"
+                       enable_pam="no"
                        ;;
                power*-ibm-aix5.1*)
                        AFS_SYSNAME="rs_aix51"
+                       enable_pam="no"
                        ;;
                power*-ibm-aix5.2*)
                        AFS_SYSNAME="rs_aix52"
+                       enable_pam="no"
                        ;;
                x86_64-*-linux-gnu)
                        AFS_SYSNAME="amd64_linuxXX"
@@ -7789,8 +5390,7 @@ echo "$as_me: error: An AFS sysname is required" >&2;}
                        ;;
        esac
        case $AFS_SYSNAME in
-               *_linux*)
-                       AFS_SYSKVERS=`echo $LINUX_VERSION | awk -F\. '{print $1 $2}'`
+               *_linux* | *_umlinux*)
                        if test "x${AFS_SYSKVERS}" = "x"; then
                         { { echo "$as_me:$LINENO: error: Couldn't guess your Linux version. Please use the --with-afs-sysname option to configure an AFS sysname." >&5
 echo "$as_me: error: Couldn't guess your Linux version. Please use the --with-afs-sysname option to configure an AFS sysname." >&2;}
@@ -7803,58 +5403,2957 @@ echo "$as_me: error: Couldn't guess your Linux version. Please use the --with-af
                        cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <linux/autoconf.h>
-int
-main ()
-{
-#ifndef CONFIG_USERMODE
-                         #error not UML
-                         #endif
-  ;
-  return 0;
-}
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <linux/autoconf.h>
+int
+main ()
+{
+#ifndef CONFIG_USERMODE
+                         #error not UML
+                         #endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_is_uml=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+                       if test "${ac_cv_linux_is_uml}" = yes; then
+                        _AFS_SYSNAME=`echo $AFS_SYSNAME|sed s/linux/umlinux/`
+                       fi
+                       CPPFLAGS="$save_CPPFLAGS"
+                       AFS_SYSNAME="$_AFS_SYSNAME"
+                       ;;
+       esac
+        echo "$as_me:$LINENO: result: $AFS_SYSNAME" >&5
+echo "${ECHO_T}$AFS_SYSNAME" >&6
+fi
+
+case $AFS_SYSNAME in *_linux* | *_umlinux*)
+
+               # Add (sub-) architecture-specific paths needed by conftests
+               case $AFS_SYSNAME  in
+                       *_umlinux26)
+                               UMLINUX26_FLAGS="-I$LINUX_KERNEL_PATH/arch/um/include"
+                               UMLINUX26_FLAGS="$UMLINUX26_FLAGS -I$LINUX_KERNEL_PATH/arch/um/kernel/tt/include"
+                               UMLINUX26_FLAGS="$UMLINUX26_FLAGS -I$LINUX_KERNEL_PATH/arch/um/kernel/skas/include"
+                               CPPFLAGS="$CPPFLAGS $UMLINUX26_FLAGS"
+               esac
+
+               if test "x$enable_kernel_module" = "xyes"; then
+                if test "x$enable_debug_kernel" = "xno"; then
+                       LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -fomit-frame-pointer"
+                fi
+
+echo "$as_me:$LINENO: checking if $CC accepts -march=pentium" >&5
+echo $ECHO_N "checking if $CC accepts -march=pentium... $ECHO_C" >&6
+save_CFLAGS="$CFLAGS"
+CFLAGS="-MARCH=pentium"
+if test "${openafs_gcc_supports_march+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.  */
+
+int
+main ()
+{
+int x;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  openafs_gcc_supports_march=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+openafs_gcc_supports_march=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $openafs_gcc_supports_march" >&5
+echo "${ECHO_T}$openafs_gcc_supports_march" >&6
+if test x$openafs_gcc_supports_march = xyes; then
+  P5PLUS_KOPTS="-march=pentium"
+else
+  P5PLUS_KOPTS="-m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2"
+fi
+CFLAGS="$save_CFLAGS"
+
+
+
+echo "$as_me:$LINENO: checking if $CC needs -fno-strength-reduce" >&5
+echo $ECHO_N "checking if $CC needs -fno-strength-reduce... $ECHO_C" >&6
+save_CFLAGS="$CFLAGS"
+CFLAGS="-fno-strength-reduce"
+if test "${openafs_gcc_needs_no_strength_reduce+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.  */
+
+int
+main ()
+{
+int x;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  openafs_gcc_needs_no_strength_reduce=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+openafs_gcc_needs_no_strength_reduce=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $openafs_gcc_needs_no_strength_reduce" >&5
+echo "${ECHO_T}$openafs_gcc_needs_no_strength_reduce" >&6
+if test x$openafs_gcc_needs_no_strength_reduce = xyes; then
+  LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -fno-strength-reduce"
+fi
+CFLAGS="$save_CFLAGS"
+
+
+echo "$as_me:$LINENO: checking if $CC needs -fno-strict-aliasing" >&5
+echo $ECHO_N "checking if $CC needs -fno-strict-aliasing... $ECHO_C" >&6
+save_CFLAGS="$CFLAGS"
+CFLAGS="-fno-strict-aliasing"
+if test "${openafs_gcc_needs_no_strict_aliasing+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.  */
+
+int
+main ()
+{
+int x;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  openafs_gcc_needs_no_strict_aliasing=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+openafs_gcc_needs_no_strict_aliasing=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $openafs_gcc_needs_no_strict_aliasing" >&5
+echo "${ECHO_T}$openafs_gcc_needs_no_strict_aliasing" >&6
+if test x$openafs_gcc_needs_no_strict_aliasing = xyes; then
+  LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -fno-strict-aliasing"
+fi
+CFLAGS="$save_CFLAGS"
+
+
+echo "$as_me:$LINENO: checking if $CC supports -fno-common" >&5
+echo $ECHO_N "checking if $CC supports -fno-common... $ECHO_C" >&6
+save_CFLAGS="$CFLAGS"
+CFLAGS="-fno-common"
+if test "${openafs_gcc_supports_no_common+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.  */
+
+int
+main ()
+{
+int x;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  openafs_gcc_supports_no_common=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+openafs_gcc_supports_no_common=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $openafs_gcc_supports_no_common" >&5
+echo "${ECHO_T}$openafs_gcc_supports_no_common" >&6
+if test x$openafs_gcc_supports_no_common = xyes; then
+  LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -fno-common"
+fi
+CFLAGS="$save_CFLAGS"
+
+
+echo "$as_me:$LINENO: checking if $CC supports -pipe" >&5
+echo $ECHO_N "checking if $CC supports -pipe... $ECHO_C" >&6
+save_CFLAGS="$CFLAGS"
+CFLAGS="-pipe"
+if test "${openafs_gcc_supports_pipe+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.  */
+
+int
+main ()
+{
+int x;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  openafs_gcc_supports_pipe=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+openafs_gcc_supports_pipe=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $openafs_gcc_supports_pipe" >&5
+echo "${ECHO_T}$openafs_gcc_supports_pipe" >&6
+if test x$openafs_gcc_supports_pipe = xyes; then
+  LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -pipe"
+fi
+CFLAGS="$save_CFLAGS"
+
+
+
+echo "$as_me:$LINENO: checking whether to build osi_vfs.h" >&5
+echo $ECHO_N "checking whether to build osi_vfs.h... $ECHO_C" >&6
+configdir=${srcdir}/src/config
+outputdir=src/afs/LINUX
+tmpldir=${srcdir}/src/afs/LINUX
+chmod +x $configdir/make_vnode.pl
+$configdir/make_vnode.pl -i $LINUX_KERNEL_PATH -t ${tmpldir} -o $outputdir
+
+
+
+echo "$as_me:$LINENO: checking for linux/completion.h existance" >&5
+echo $ECHO_N "checking for linux/completion.h existance... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+if test "${ac_cv_linux_completion_h_exists+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.  */
+#include <linux/completion.h>
+#include <linux/version.h>
+int
+main ()
+{
+struct completion _c;
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,4,8)
+lose
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_completion_h_exists=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_completion_h_exists=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_completion_h_exists" >&5
+echo "${ECHO_T}$ac_cv_linux_completion_h_exists" >&6
+CPPFLAGS="$save_CPPFLAGS"
+
+echo "$as_me:$LINENO: checking for defined for_each_process" >&5
+echo $ECHO_N "checking for defined for_each_process... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+if test "${ac_cv_linux_defines_for_each_process+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.  */
+#include <linux/sched.h>
+int
+main ()
+{
+#ifndef for_each_process(p)
+#error for_each_process not defined
+#endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_defines_for_each_process=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_defines_for_each_process=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_defines_for_each_process" >&5
+echo "${ECHO_T}$ac_cv_linux_defines_for_each_process" >&6
+CPPFLAGS="$save_CPPFLAGS"
+
+echo "$as_me:$LINENO: checking for defined prev_task" >&5
+echo $ECHO_N "checking for defined prev_task... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+if test "${ac_cv_linux_defines_prev_task+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.  */
+#include <linux/sched.h>
+int
+main ()
+{
+#ifndef prev_task(p)
+#error prev_task not defined
+#endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_defines_prev_task=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_defines_prev_task=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_defines_prev_task" >&5
+echo "${ECHO_T}$ac_cv_linux_defines_prev_task" >&6
+CPPFLAGS="$save_CPPFLAGS"
+
+echo "$as_me:$LINENO: checking for exported tasklist_lock" >&5
+echo $ECHO_N "checking for exported tasklist_lock... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+if test "${ac_cv_linux_exports_tasklist_lock+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.  */
+#include <linux/modversions.h>
+int
+main ()
+{
+#ifndef __ver_tasklist_lock
+#error tasklist_lock not exported
+#endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_exports_tasklist_lock=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_exports_tasklist_lock=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_exports_tasklist_lock" >&5
+echo "${ECHO_T}$ac_cv_linux_exports_tasklist_lock" >&6
+CPPFLAGS="$save_CPPFLAGS"
+
+echo "$as_me:$LINENO: checking for page_lock in struct address_space" >&5
+echo $ECHO_N "checking for page_lock in struct address_space... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+if test "${ac_cv_linux_fs_struct_address_space_has_page_lock+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.  */
+#include <linux/fs.h>
+int
+main ()
+{
+struct address_space _a_s;
+printf("%x\n", _a_s.page_lock);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_fs_struct_address_space_has_page_lock=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_fs_struct_address_space_has_page_lock=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_fs_struct_address_space_has_page_lock" >&5
+echo "${ECHO_T}$ac_cv_linux_fs_struct_address_space_has_page_lock" >&6
+CPPFLAGS="$save_CPPFLAGS"
+
+echo "$as_me:$LINENO: checking for gfp_mask in struct address_space" >&5
+echo $ECHO_N "checking for gfp_mask in struct address_space... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+if test "${ac_cv_linux_fs_struct_address_space_has_gfp_mask+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.  */
+#include <linux/fs.h>
+int
+main ()
+{
+struct address_space _a;
+printf("%d\n", _a.gfp_mask);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_fs_struct_address_space_has_gfp_mask=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_fs_struct_address_space_has_gfp_mask=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_fs_struct_address_space_has_gfp_mask" >&5
+echo "${ECHO_T}$ac_cv_linux_fs_struct_address_space_has_gfp_mask" >&6
+CPPFLAGS="$save_CPPFLAGS"
+
+echo "$as_me:$LINENO: checking for i_alloc_sem in struct inode" >&5
+echo $ECHO_N "checking for i_alloc_sem in struct inode... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+if test "${ac_cv_linux_fs_struct_inode_has_i_alloc_sem+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.  */
+#include <linux/fs.h>
+int
+main ()
+{
+struct inode _i;
+printf("%x\n", _i.i_alloc_sem);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_fs_struct_inode_has_i_alloc_sem=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_fs_struct_inode_has_i_alloc_sem=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_fs_struct_inode_has_i_alloc_sem" >&5
+echo "${ECHO_T}$ac_cv_linux_fs_struct_inode_has_i_alloc_sem" >&6
+CPPFLAGS="$save_CPPFLAGS"
+
+echo "$as_me:$LINENO: checking for i_truncate_sem in struct inode" >&5
+echo $ECHO_N "checking for i_truncate_sem in struct inode... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+if test "${ac_cv_linux_fs_struct_inode_has_i_truncate_sem+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.  */
+#include <linux/fs.h>
+int
+main ()
+{
+struct inode _i;
+printf("%x\n", _i.i_truncate_sem);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_fs_struct_inode_has_i_truncate_sem=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_fs_struct_inode_has_i_truncate_sem=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_fs_struct_inode_has_i_truncate_sem" >&5
+echo "${ECHO_T}$ac_cv_linux_fs_struct_inode_has_i_truncate_sem" >&6
+CPPFLAGS="$save_CPPFLAGS"
+
+echo "$as_me:$LINENO: checking for i_dirty_data_buffers in struct inode" >&5
+echo $ECHO_N "checking for i_dirty_data_buffers in struct inode... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+if test "${ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers+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.  */
+#include <linux/fs.h>
+int
+main ()
+{
+struct inode _inode;
+printf("%d\n", _inode.i_dirty_data_buffers);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers" >&5
+echo "${ECHO_T}$ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers" >&6
+CPPFLAGS="$save_CPPFLAGS"
+
+echo "$as_me:$LINENO: checking for i_devices in struct inode" >&5
+echo $ECHO_N "checking for i_devices in struct inode... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+if test "${ac_cv_linux_fs_struct_inode_has_i_cdev+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.  */
+#include <linux/fs.h>
+int
+main ()
+{
+struct inode _inode;
+printf("%d\n", _inode.i_devices);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_fs_struct_inode_has_i_devices=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_fs_struct_inode_has_i_devices=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_fs_struct_inode_has_i_devices" >&5
+echo "${ECHO_T}$ac_cv_linux_fs_struct_inode_has_i_devices" >&6
+CPPFLAGS="$save_CPPFLAGS"
+
+echo "$as_me:$LINENO: checking for i_security in struct inode" >&5
+echo $ECHO_N "checking for i_security in struct inode... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+if test "${ac_cv_linux_fs_struct_inode_has_i_security+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.  */
+#include <linux/fs.h>
+int
+main ()
+{
+struct inode _inode;
+printf("%d\n", _inode.i_security);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_fs_struct_inode_has_i_security=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_fs_struct_inode_has_i_security=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_fs_struct_inode_has_i_security" >&5
+echo "${ECHO_T}$ac_cv_linux_fs_struct_inode_has_i_security" >&6
+CPPFLAGS="$save_CPPFLAGS"
+
+echo "$as_me:$LINENO: checking for inode_setattr return type" >&5
+echo $ECHO_N "checking for inode_setattr return type... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+if test "${ac_cv_linux_func_inode_setattr_returns_int+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.  */
+#include <linux/fs.h>
+int
+main ()
+{
+struct inode _inode;
+struct iattr _iattr;
+int i;
+i = inode_setattr(&_inode, &_iattr);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_func_inode_setattr_returns_int=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_func_inode_setattr_returns_int=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_func_inode_setattr_returns_int" >&5
+echo "${ECHO_T}$ac_cv_linux_func_inode_setattr_returns_int" >&6
+CPPFLAGS="$save_CPPFLAGS"
+
+echo "$as_me:$LINENO: checking for write_inode return type" >&5
+echo $ECHO_N "checking for write_inode return type... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+if test "${ac_cv_linux_func_write_inode_returns_int+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.  */
+#include <linux/fs.h>
+int
+main ()
+{
+struct inode _inode;
+struct super_operations _sops;
+int i;
+i = _sops.write_inode(&_inode, 0);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_func_write_inode_returns_int=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_func_write_inode_returns_int=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_func_write_inode_returns_int" >&5
+echo "${ECHO_T}$ac_cv_linux_func_write_inode_returns_int" >&6
+CPPFLAGS="$save_CPPFLAGS"
+
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+echo "$as_me:$LINENO: checking whether inode_operations.create takes a nameidata" >&5
+echo $ECHO_N "checking whether inode_operations.create takes a nameidata... $ECHO_C" >&6
+if test "${ac_cv_linux_func_i_create_takes_nameidata+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.  */
+#include <linux/fs.h>
+#include <linux/namei.h>
+int
+main ()
+{
+struct inode _inode;
+struct dentry _dentry;
+struct nameidata _nameidata;
+(void)_inode.i_op->create(&_inode, &_dentry, 0, &_nameidata);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_func_i_create_takes_nameidata=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_func_i_create_takes_nameidata=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_func_i_create_takes_nameidata" >&5
+echo "${ECHO_T}$ac_cv_linux_func_i_create_takes_nameidata" >&6
+if test "x$ac_cv_linux_func_i_create_takes_nameidata" = "xyes" ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define IOP_CREATE_TAKES_NAMEIDATA 1
+_ACEOF
+
+fi
+echo "$as_me:$LINENO: checking whether inode_operations.lookup takes a nameidata" >&5
+echo $ECHO_N "checking whether inode_operations.lookup takes a nameidata... $ECHO_C" >&6
+if test "${ac_cv_linux_func_i_lookup_takes_nameidata+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.  */
+#include <linux/fs.h>
+#include <linux/namei.h>
+int
+main ()
+{
+struct inode _inode;
+struct dentry _dentry;
+struct nameidata _nameidata;
+(void)_inode.i_op->lookup(&_inode, &_dentry, &_nameidata);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_func_i_lookup_takes_nameidata=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_func_i_lookup_takes_nameidata=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_func_i_lookup_takes_nameidata" >&5
+echo "${ECHO_T}$ac_cv_linux_func_i_lookup_takes_nameidata" >&6
+if test "x$ac_cv_linux_func_i_lookup_takes_nameidata" = "xyes" ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define IOP_LOOKUP_TAKES_NAMEIDATA 1
+_ACEOF
+
+fi
+echo "$as_me:$LINENO: checking whether inode_operations.permission takes a nameidata" >&5
+echo $ECHO_N "checking whether inode_operations.permission takes a nameidata... $ECHO_C" >&6
+if test "${ac_cv_linux_func_i_permission_takes_nameidata+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.  */
+#include <linux/fs.h>
+#include <linux/namei.h>
+int
+main ()
+{
+struct inode _inode;
+struct nameidata _nameidata;
+(void)_inode.i_op->permission(&_inode, 0, &_nameidata);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_func_i_permission_takes_nameidata=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_func_i_permission_takes_nameidata=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_func_i_permission_takes_nameidata" >&5
+echo "${ECHO_T}$ac_cv_linux_func_i_permission_takes_nameidata" >&6
+if test "x$ac_cv_linux_func_i_permission_takes_nameidata" = "xyes" ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define IOP_PERMISSION_TAKES_NAMEIDATA 1
+_ACEOF
+
+fi
+echo "$as_me:$LINENO: checking whether dentry_operations.d_revalidate takes a nameidata" >&5
+echo $ECHO_N "checking whether dentry_operations.d_revalidate takes a nameidata... $ECHO_C" >&6
+CPPFLAGS="$CPPFLAGS -Werror"
+if test "${ac_cv_linux_func_d_revalidate_takes_nameidata+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.  */
+#include <linux/fs.h>
+#include <linux/namei.h>
+int
+main ()
+{
+struct dentry _dentry;
+struct nameidata _nameidata;
+(void)_dentry.d_op->d_revalidate(&_dentry, &_nameidata);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_func_d_revalidate_takes_nameidata=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_func_d_revalidate_takes_nameidata=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_func_d_revalidate_takes_nameidata" >&5
+echo "${ECHO_T}$ac_cv_linux_func_d_revalidate_takes_nameidata" >&6
+if test "x$ac_cv_linux_func_d_revalidate_takes_nameidata" = "xyes" ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define DOP_REVALIDATE_TAKES_NAMEIDATA 1
+_ACEOF
+
+fi
+CPPFLAGS="$save_CPPFLAGS"
+
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+echo "$as_me:$LINENO: checking whether address_space_operations.writepage takes a writeback_control" >&5
+echo $ECHO_N "checking whether address_space_operations.writepage takes a writeback_control... $ECHO_C" >&6
+if test "${ac_cv_linux_func_a_writepage_takes_writeback_control+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.  */
+#include <linux/fs.h>
+#include <linux/mm.h>
+#include <linux/writeback.h>
+int
+main ()
+{
+struct address_space_operations _aops;
+struct page _page;
+struct writeback_control _writeback_control;
+(void)_aops.writepage(&_page, &_writeback_control);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_func_a_writepage_takes_writeback_control=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_func_a_writepage_takes_writeback_control=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_func_a_writepage_takes_writeback_control" >&5
+echo "${ECHO_T}$ac_cv_linux_func_a_writepage_takes_writeback_control" >&6
+if test "x$ac_cv_linux_func_a_writepage_takes_writeback_control" = "xyes" ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define AOP_WRITEPAGE_TAKES_WRITEBACK_CONTROL 1
+_ACEOF
+
+fi
+CPPFLAGS="$save_CPPFLAGS"
+
+  echo "$as_me:$LINENO: checking for linux/syscall.h in kernel" >&5
+echo $ECHO_N "checking for linux/syscall.h in kernel... $ECHO_C" >&6
+  if test -f "${LINUX_KERNEL_PATH}/include/linux/syscall.h"; then
+    ac_linux_syscall=yes
+    echo "$as_me:$LINENO: result: $ac_linux_syscall" >&5
+echo "${ECHO_T}$ac_linux_syscall" >&6
+  else
+    ac_linux_syscall=no
+    echo "$as_me:$LINENO: result: $ac_linux_syscall" >&5
+echo "${ECHO_T}$ac_linux_syscall" >&6
+  fi
+
+
+echo "$as_me:$LINENO: checking for SELinux kernel" >&5
+echo $ECHO_N "checking for SELinux kernel... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include $CPPFLAGS"
+if test "${ac_cv_linux_kernel_is_selinux+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.  */
+#include <linux/autoconf.h>
+int
+main ()
+{
+#ifndef CONFIG_SECURITY_SELINUX
+   #error not SELINUX
+   #endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_kernel_is_selinux=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_kernel_is_selinux=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_kernel_is_selinux" >&5
+echo "${ECHO_T}$ac_cv_linux_kernel_is_selinux" >&6
+CPPFLAGS="$save_CPPFLAGS"
+
+echo "$as_me:$LINENO: checking for 5th argument in sock_create found in some SELinux kernels" >&5
+echo $ECHO_N "checking for 5th argument in sock_create found in some SELinux kernels... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
+if test "${ac_cv_linux_kernel_sock_create_v+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.  */
+#include <linux/net.h>
+int
+main ()
+{
+
+  sock_create(0,0,0,0,0)
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_kernel_sock_create_v=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_kernel_sock_create_v=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_kernel_sock_create_v" >&5
+echo "${ECHO_T}$ac_cv_linux_kernel_sock_create_v" >&6
+CPPFLAGS="$save_CPPFLAGS"
+
+echo "$as_me:$LINENO: checking for page_follow_link_light vs page_follow_link" >&5
+echo $ECHO_N "checking for page_follow_link_light vs page_follow_link... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
+if test "${ac_cv_linux_kernel_page_follow_link+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.  */
+#include <linux/fs.h>
+int
+main ()
+{
+
+  page_follow_link(0,0)
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_kernel_page_follow_link=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_kernel_page_follow_link=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_kernel_page_follow_page" >&5
+echo "${ECHO_T}$ac_cv_linux_kernel_page_follow_page" >&6
+CPPFLAGS="$save_CPPFLAGS"
+
+RHCONFIG_SP=""
+RHCONFIG_MP=""
+if test "x$enable_redhat_buildsys" = "xyes"; then
+  { echo "$as_me:$LINENO: WARNING: Configured to build from a Red Hat SPEC file" >&5
+echo "$as_me: WARNING: Configured to build from a Red Hat SPEC file" >&2;}
+else
+  echo "$as_me:$LINENO: checking for redhat kernel configuration" >&5
+echo $ECHO_N "checking for redhat kernel configuration... $ECHO_C" >&6
+  if test -f "${LINUX_KERNEL_PATH}/include/linux/rhconfig.h"; then
+    ac_linux_rhconfig=yes
+    RHCONFIG_SP="-D__BOOT_KERNEL_UP=1 -D__BOOT_KERNEL_SMP=0"
+    RHCONFIG_MP="-D__BOOT_KERNEL_UP=0 -D__BOOT_KERNEL_SMP=1"
+    echo "$as_me:$LINENO: result: $ac_linux_rhconfig" >&5
+echo "${ECHO_T}$ac_linux_rhconfig" >&6
+    if test ! -f "/boot/kernel.h"; then
+        { echo "$as_me:$LINENO: WARNING: /boot/kernel.h does not exist. build may fail" >&5
+echo "$as_me: WARNING: /boot/kernel.h does not exist. build may fail" >&2;}
+    fi
+  else
+    ac_linux_rhconfig=no
+    echo "$as_me:$LINENO: result: $ac_linux_rhconfig" >&5
+echo "${ECHO_T}$ac_linux_rhconfig" >&6
+  fi
+fi
+
+
+
+
+echo "$as_me:$LINENO: checking for recalc_sigpending arg type" >&5
+echo $ECHO_N "checking for recalc_sigpending arg type... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+if test "${ac_cv_linux_func_recalc_sigpending_takes_void+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.  */
+#include <linux/sched.h>
+int
+main ()
+{
+recalc_sigpending();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_func_recalc_sigpending_takes_void=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_func_recalc_sigpending_takes_void=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_func_recalc_sigpending_takes_void" >&5
+echo "${ECHO_T}$ac_cv_linux_func_recalc_sigpending_takes_void" >&6
+CPPFLAGS="$save_CPPFLAGS"
+
+echo "$as_me:$LINENO: checking for parent in struct task_struct" >&5
+echo $ECHO_N "checking for parent in struct task_struct... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+if test "${ac_cv_linux_sched_struct_task_struct_has_parent+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.  */
+#include <linux/sched.h>
+int
+main ()
+{
+struct task_struct _tsk;
+printf("%d\n", _tsk.parent);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_sched_struct_task_struct_has_parent=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_sched_struct_task_struct_has_parent=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_sched_struct_task_struct_has_parent" >&5
+echo "${ECHO_T}$ac_cv_linux_sched_struct_task_struct_has_parent" >&6
+CPPFLAGS="$save_CPPFLAGS"
+
+echo "$as_me:$LINENO: checking for real_parent in struct task_struct" >&5
+echo $ECHO_N "checking for real_parent in struct task_struct... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+if test "${ac_cv_linux_sched_struct_task_struct_has_real_parent+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.  */
+#include <linux/sched.h>
+int
+main ()
+{
+struct task_struct _tsk;
+printf("%d\n", _tsk.real_parent);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_sched_struct_task_struct_has_real_parent=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_sched_struct_task_struct_has_real_parent=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_sched_struct_task_struct_has_real_parent" >&5
+echo "${ECHO_T}$ac_cv_linux_sched_struct_task_struct_has_real_parent" >&6
+CPPFLAGS="$save_CPPFLAGS"
+
+echo "$as_me:$LINENO: checking for sig in struct task_struct" >&5
+echo $ECHO_N "checking for sig in struct task_struct... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+if test "${ac_cv_linux_sched_struct_task_struct_has_sig+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.  */
+#include <linux/sched.h>
+int
+main ()
+{
+struct task_struct _tsk;
+printf("%d\n", _tsk.sig);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_sched_struct_task_struct_has_sig=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_sched_struct_task_struct_has_sig=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_sched_struct_task_struct_has_sig" >&5
+echo "${ECHO_T}$ac_cv_linux_sched_struct_task_struct_has_sig" >&6
+CPPFLAGS="$save_CPPFLAGS"
+
+echo "$as_me:$LINENO: checking for sighand in struct task_struct" >&5
+echo $ECHO_N "checking for sighand in struct task_struct... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+if test "${ac_cv_linux_sched_struct_task_struct_has_sighand+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.  */
+#include <linux/sched.h>
+int
+main ()
+{
+struct task_struct _tsk;
+printf("%d\n", _tsk.sighand);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_sched_struct_task_struct_has_sighand=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_sched_struct_task_struct_has_sighand=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_sched_struct_task_struct_has_sighand" >&5
+echo "${ECHO_T}$ac_cv_linux_sched_struct_task_struct_has_sighand" >&6
+CPPFLAGS="$save_CPPFLAGS"
+
+echo "$as_me:$LINENO: checking for sigmask_lock in struct task_struct" >&5
+echo $ECHO_N "checking for sigmask_lock in struct task_struct... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+if test "${ac_cv_linux_sched_struct_task_struct_has_sigmask_lock+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.  */
+#include <linux/sched.h>
+int
+main ()
+{
+struct task_struct _tsk;
+printf("%d\n", _tsk.sigmask_lock);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_sched_struct_task_struct_has_sigmask_lock=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_sched_struct_task_struct_has_sigmask_lock=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_sched_struct_task_struct_has_sigmask_lock" >&5
+echo "${ECHO_T}$ac_cv_linux_sched_struct_task_struct_has_sigmask_lock" >&6
+CPPFLAGS="$save_CPPFLAGS"
+
+if test "x$enable_redhat_buildsys" = "xyes"; then
+  MPS=Default
+else
+  save_CPPFLAGS="$CPPFLAGS"
+  CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $RHCONFIG_SP $CPPFLAGS"
+  echo "$as_me:$LINENO: checking if kernel uses MODVERSIONS" >&5
+echo $ECHO_N "checking if kernel uses MODVERSIONS... $ECHO_C" >&6
+  if test "${ac_cv_linux_config_modversions+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.  */
+#include <linux/version.h>
+#include <linux/config.h>
+
+int
+main ()
+{
+#if !defined(CONFIG_MODVERSIONS)
+lose;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_config_modversions=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_config_modversions=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+  echo "$as_me:$LINENO: result: $ac_cv_linux_config_modversions" >&5
+echo "${ECHO_T}$ac_cv_linux_config_modversions" >&6
+  echo "$as_me:$LINENO: checking which kernel modules to build" >&5
+echo $ECHO_N "checking which kernel modules to build... $ECHO_C" >&6
+  if false; then
+      MPS="MP SP"
+  elif test "x$ac_cv_linux_config_modversions" = "xno" -a "$AFS_SYSKVERS" -lt 26; then
+      MPS="MP SP"
+  else
+  if test "${ac_cv_linux_config_smp+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.  */
+#include <linux/config.h>
+
+int
+main ()
+{
+#ifndef CONFIG_SMP
+lose;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_config_smp=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_config_smp=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+        if test "x$ac_cv_linux_config_smp" = "xyes"; then
+          MPS=MP
+      else
+          MPS=SP
+      fi
+  fi
+  CPPFLAGS=$save_CPPFLAGS
+  echo "$as_me:$LINENO: result: $MPS" >&5
+echo "${ECHO_T}$MPS" >&6
+fi
+
+
+                 if test "x$ac_cv_linux_config_modversions" = "xno" -o $AFS_SYSKVERS -ge 26; then
+                   { echo "$as_me:$LINENO: WARNING: Cannot determine sys_call_table status. assuming it isn't exported" >&5
+echo "$as_me: WARNING: Cannot determine sys_call_table status. assuming it isn't exported" >&2;}
+                   ac_cv_linux_exports_sys_call_table=no
+                  if test -f "$LINUX_KERNEL_PATH/include/asm/ia32_unistd.h"; then
+                    ac_cv_linux_exports_ia32_sys_call_table=yes
+                  fi
+                 else
+
+echo "$as_me:$LINENO: checking for exported init_mm" >&5
+echo $ECHO_N "checking for exported init_mm... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+if test "${ac_cv_linux_exports_init_mm+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.  */
+#include <linux/modversions.h>
+int
+main ()
+{
+#ifndef __ver_init_mm
+#error init_mm not exported
+#endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_exports_init_mm=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_exports_init_mm=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_exports_init_mm" >&5
+echo "${ECHO_T}$ac_cv_linux_exports_init_mm" >&6
+CPPFLAGS="$save_CPPFLAGS"
+
+echo "$as_me:$LINENO: checking for exported kallsyms_address_to_symbol" >&5
+echo $ECHO_N "checking for exported kallsyms_address_to_symbol... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+if test "${ac_cv_linux_exports_kallsyms_address+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.  */
+#include <linux/modversions.h>
+int
+main ()
+{
+#ifndef __ver_kallsyms_address_to_symbol
+#error kallsyms_address_to_symbol not exported
+#endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_exports_kallsyms_address=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_exports_kallsyms_address=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_exports_kallsyms_address" >&5
+echo "${ECHO_T}$ac_cv_linux_exports_kallsyms_address" >&6
+CPPFLAGS="$save_CPPFLAGS"
+
+echo "$as_me:$LINENO: checking for exported kallsyms_symbol_to_address" >&5
+echo $ECHO_N "checking for exported kallsyms_symbol_to_address... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+if test "${ac_cv_linux_exports_kallsyms_symbol+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.  */
+#include <linux/modversions.h>
+int
+main ()
+{
+#ifndef __ver_kallsyms_symbol_to_address
+#error kallsyms_symbol_to_address not exported
+#endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_exports_kallsyms_symbol=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_exports_kallsyms_symbol=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_exports_kallsyms_symbol" >&5
+echo "${ECHO_T}$ac_cv_linux_exports_kallsyms_symbol" >&6
+CPPFLAGS="$save_CPPFLAGS"
+
+echo "$as_me:$LINENO: checking for exported sys_call_table" >&5
+echo $ECHO_N "checking for exported sys_call_table... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+if test "${ac_cv_linux_exports_sys_call_table+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.  */
+#include <linux/modversions.h>
+int
+main ()
+{
+#ifndef __ver_sys_call_table
+#error sys_call_table not exported
+#endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_exports_sys_call_table=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_exports_sys_call_table=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_exports_sys_call_table" >&5
+echo "${ECHO_T}$ac_cv_linux_exports_sys_call_table" >&6
+CPPFLAGS="$save_CPPFLAGS"
+
+echo "$as_me:$LINENO: checking for exported ia32_sys_call_table" >&5
+echo $ECHO_N "checking for exported ia32_sys_call_table... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+if test "${ac_cv_linux_exports_ia32_sys_call_table+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.  */
+#include <linux/modversions.h>
+int
+main ()
+{
+#ifndef __ver_ia32_sys_call_table
+#error ia32_sys_call_table not exported
+#endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_exports_ia32_sys_call_table=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_exports_ia32_sys_call_table=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_exports_ia32_sys_call_table" >&5
+echo "${ECHO_T}$ac_cv_linux_exports_ia32_sys_call_table" >&6
+CPPFLAGS="$save_CPPFLAGS"
+
+echo "$as_me:$LINENO: checking for exported sys_chdir" >&5
+echo $ECHO_N "checking for exported sys_chdir... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+if test "${ac_cv_linux_exports_sys_chdir+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.  */
+#include <linux/modversions.h>
+int
+main ()
+{
+#ifndef __ver_sys_chdir
+#error sys_chdir not exported
+#endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_exports_sys_chdir=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_exports_sys_chdir=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_exports_sys_chdir" >&5
+echo "${ECHO_T}$ac_cv_linux_exports_sys_chdir" >&6
+CPPFLAGS="$save_CPPFLAGS"
+
+echo "$as_me:$LINENO: checking for exported sys_close" >&5
+echo $ECHO_N "checking for exported sys_close... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+if test "${ac_cv_linux_exports_sys_close+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.  */
+#include <linux/modversions.h>
+int
+main ()
+{
+#ifndef __ver_sys_close
+#error sys_close not exported
+#endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_exports_sys_close=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_exports_sys_close=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_exports_sys_close" >&5
+echo "${ECHO_T}$ac_cv_linux_exports_sys_close" >&6
+CPPFLAGS="$save_CPPFLAGS"
+
+echo "$as_me:$LINENO: checking for exported sys_wait4" >&5
+echo $ECHO_N "checking for exported sys_wait4... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+if test "${ac_cv_linux_exports_sys_wait4+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.  */
+#include <linux/modversions.h>
+int
+main ()
+{
+#ifndef __ver_sys_wait4
+#error sys_wait4 not exported
+#endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_exports_sys_wait4=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_exports_sys_wait4=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_exports_sys_wait4" >&5
+echo "${ECHO_T}$ac_cv_linux_exports_sys_wait4" >&6
+CPPFLAGS="$save_CPPFLAGS"
+                   if test "x$ac_cv_linux_exports_sys_call_table" = "xno"; then
+                         linux_syscall_method=none
+                         if test "x$ac_cv_linux_exports_init_mm" = "xyes"; then
+                            linux_syscall_method=scan
+                            if test "x$ac_cv_linux_exports_kallsyms_address" = "xyes"; then
+                               linux_syscall_method=scan_with_kallsyms_address
+                            fi
+                         fi
+                         if test "x$ac_cv_linux_exports_kallsyms_symbol" = "xyes"; then
+                            linux_syscall_method=kallsyms_symbol
+                         fi
+                         if test "x$linux_syscall_method" = "xnone"; then
+                        { { echo "$as_me:$LINENO: error: no available sys_call_table access method" >&5
+echo "$as_me: error: no available sys_call_table access method" >&2;}
+   { (exit 1); exit 1; }; }
+                         fi
+                   fi
+                 fi
+                if test -f "$LINUX_KERNEL_PATH/include/linux/in_systm.h"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_IN_SYSTM_H 1
+_ACEOF
+
+                fi
+                if test -f "$LINUX_KERNEL_PATH/include/linux/mm_inline.h"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_MM_INLINE_H 1
+_ACEOF
+
+                fi
+                if test -f "$LINUX_KERNEL_PATH/include/linux/in_systm.h"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_IN_SYSTM_H 1
+_ACEOF
+
+                fi
+                if test "x$ac_cv_linux_exports_sys_chdir" = "xyes" ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define EXPORTED_SYS_CHDIR 1
+_ACEOF
+
+                fi
+                if test "x$ac_cv_linux_exports_sys_close" = "xyes" ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define EXPORTED_SYS_CLOSE 1
+_ACEOF
+
+                fi
+                if test "x$ac_cv_linux_exports_sys_wait4" = "xyes" ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define EXPORTED_SYS_WAIT4 1
+_ACEOF
+
+                fi
+                if test "x$ac_cv_linux_exports_tasklist_lock" = "xyes" ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define EXPORTED_TASKLIST_LOCK 1
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_is_uml=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-                       if test "${ac_cv_linux_is_uml}" = yes; then
-                        _AFS_SYSNAME=`echo $AFS_SYSNAME|sed s/linux/umlinux/`
-                       fi
-                       CPPFLAGS="$save_CPPFLAGS"
-                       AFS_SYSNAME="$_AFS_SYSNAME"
-                       ;;
-       esac
-        echo "$as_me:$LINENO: result: $AFS_SYSNAME" >&5
-echo "${ECHO_T}$AFS_SYSNAME" >&6
-fi
+                fi
+                 if test "x$ac_cv_linux_exports_sys_call_table" = "xyes"; then
+                  cat >>confdefs.h <<\_ACEOF
+#define EXPORTED_SYS_CALL_TABLE 1
+_ACEOF
+
+                 fi
+                 if test "x$ac_cv_linux_exports_ia32_sys_call_table" = "xyes"; then
+                  cat >>confdefs.h <<\_ACEOF
+#define EXPORTED_IA32_SYS_CALL_TABLE 1
+_ACEOF
+
+                 fi
+                 if test "x$ac_cv_linux_exports_kallsyms_symbol" = "xyes"; then
+                  cat >>confdefs.h <<\_ACEOF
+#define EXPORTED_KALLSYMS_SYMBOL 1
+_ACEOF
+
+                 fi
+                 if test "x$ac_cv_linux_exports_kallsyms_address" = "xyes"; then
+                  cat >>confdefs.h <<\_ACEOF
+#define EXPORTED_KALLSYMS_ADDRESS 1
+_ACEOF
+
+                 fi
+                if test "x$ac_cv_linux_completion_h_exists" = "xyes" ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define COMPLETION_H_EXISTS 1
+_ACEOF
+
+                fi
+                if test "x$ac_cv_linux_defines_for_each_process" = "xyes" ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define DEFINED_FOR_EACH_PROCESS 1
+_ACEOF
+
+                fi
+                if test "x$ac_cv_linux_defines_prev_task" = "xyes" ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define DEFINED_PREV_TASK 1
+_ACEOF
+
+                fi
+                if test "x$ac_cv_linux_func_inode_setattr_returns_int" = "xyes" ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define INODE_SETATTR_NOT_VOID 1
+_ACEOF
+
+                fi
+                if test "x$ac_cv_linux_func_write_inode_returns_int" = "xyes" ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define WRITE_INODE_NOT_VOID 1
+_ACEOF
+
+                fi
+                if test "x$ac_cv_linux_fs_struct_address_space_has_page_lock" = "xyes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK 1
+_ACEOF
+
+                fi
+                if test "x$ac_cv_linux_fs_struct_address_space_has_gfp_mask" = "xyes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STRUCT_ADDRESS_SPACE_HAS_GFP_MASK 1
+_ACEOF
+
+                fi
+                if test "x$ac_cv_linux_fs_struct_inode_has_i_truncate_sem" = "xyes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STRUCT_INODE_HAS_I_TRUNCATE_SEM 1
+_ACEOF
+
+                fi
+                if test "x$ac_cv_linux_fs_struct_inode_has_i_alloc_sem" = "xyes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STRUCT_INODE_HAS_I_ALLOC_SEM 1
+_ACEOF
+
+                fi
+                if test "x$ac_cv_linux_fs_struct_inode_has_i_devices" = "xyes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STRUCT_INODE_HAS_I_DEVICES 1
+_ACEOF
+
+                fi
+                if test "x$ac_cv_linux_fs_struct_inode_has_i_security" = "xyes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STRUCT_INODE_HAS_I_SECURITY 1
+_ACEOF
+
+                fi
+                if test "x$ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers" = "xyes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS 1
+_ACEOF
+
+                fi
+                if test "x$ac_cv_linux_func_recalc_sigpending_takes_void" = "xyes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define RECALC_SIGPENDING_TAKES_VOID 1
+_ACEOF
+
+                fi
+                if test "x$ac_cv_linux_kernel_is_selinux" = "xyes" ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define LINUX_KERNEL_IS_SELINUX 1
+_ACEOF
+
+                fi
+                if test "x$ac_cv_linux_kernel_sock_create_v" = "xyes" ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define LINUX_KERNEL_SOCK_CREATE_V 1
+_ACEOF
+
+                fi
+                if test "x$ac_cv_linux_kernel_page_follow_link" = "xyes" ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_KERNEL_PAGE_FOLLOW_LINK 1
+_ACEOF
+
+                fi
+                if test "x$ac_linux_syscall" = "xyes" ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_KERNEL_LINUX_SYSCALL_H 1
+_ACEOF
+
+                fi
+                if test "x$ac_cv_linux_sched_struct_task_struct_has_parent" = "xyes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STRUCT_TASK_STRUCT_HAS_PARENT 1
+_ACEOF
+
+                fi
+                if test "x$ac_cv_linux_sched_struct_task_struct_has_real_parent" = "xyes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STRUCT_TASK_STRUCT_HAS_REAL_PARENT 1
+_ACEOF
+
+                fi
+                if test "x$ac_cv_linux_sched_struct_task_struct_has_sigmask_lock" = "xyes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STRUCT_TASK_STRUCT_HAS_SIGMASK_LOCK 1
+_ACEOF
+
+                fi
+                if test "x$ac_cv_linux_sched_struct_task_struct_has_sighand" = "xyes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STRUCT_TASK_STRUCT_HAS_SIGHAND 1
+_ACEOF
+
+                fi
+                if test "x$ac_cv_linux_sched_struct_task_struct_has_sig" = "xyes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STRUCT_TASK_STRUCT_HAS_SIG 1
+_ACEOF
+
+                fi
+                :
+               fi
+esac
 
 case $AFS_SYSNAME in
        *_darwin*)
@@ -12259,7 +12758,7 @@ case $AFS_SYSNAME in
                YACC="byacc"
                ;;
 
-       *nbsd20)
+       *nbsd2*)
                LEX="flex -l"
                MT_CFLAGS='${XCFLAGS} -DAFS_PTHREAD_ENV -D_REENTRANT '
                MT_LIBS="-lpthread" # XXX -pthread soon
@@ -12281,7 +12780,7 @@ case $AFS_SYSNAME in
                YACC="bison -y"
                ;;
 
-       ia64_linux24)
+       ia64_linux24|ia64_linux26)
                KERN_OPTMZ=-O2
                LEX="flex -l"
                MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
@@ -12388,6 +12887,26 @@ case $AFS_SYSNAME in
                SHLIB_LINKER="${MT_CC} -shared"
                ;;
 
+       i386_umlinux26)
+               CC="gcc -pipe"
+               CCOBJ="gcc -pipe"
+               MT_CC="gcc -pipe"
+               KERN_OPTMZ=-O2
+               LEX="flex -l"
+               MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
+               MT_LIBS="-lpthread"
+               DBG=-g
+               KERN_DBG=-g
+               LWP_DBG=-g
+               LWP_OPTMZ=-O2
+               OPTMZ=-O2
+               PAM_CFLAGS="-g -O2 -Dlinux -DLINUX_PAM -fPIC"
+               SHLIB_LDFLAGS="-shared -Xlinker -x"
+               TXLIBS="-lncurses"
+               XCFLAGS="-g -O2 -D_LARGEFILE64_SOURCE"
+               SHLIB_LINKER="${MT_CC} -shared"
+               ;;
+
        *_obsd*)
                LEX="flex -l"
                MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
@@ -13907,12 +14426,12 @@ s,@YACC@,$YACC,;t t
 s,@LEX@,$LEX,;t t
 s,@LEXLIB@,$LEXLIB,;t t
 s,@LEX_OUTPUT_ROOT@,$LEX_OUTPUT_ROOT,;t t
+s,@HEADER_RT@,$HEADER_RT,;t t
 s,@P5PLUS_KOPTS@,$P5PLUS_KOPTS,;t t
 s,@LINUX_GCC_KOPTS@,$LINUX_GCC_KOPTS,;t t
 s,@RHCONFIG_SP@,$RHCONFIG_SP,;t t
 s,@RHCONFIG_MP@,$RHCONFIG_MP,;t t
 s,@MPS@,$MPS,;t t
-s,@HEADER_RT@,$HEADER_RT,;t t
 s,@PTHREAD_LIBS@,$PTHREAD_LIBS,;t t
 s,@XBSA_CFLAGS@,$XBSA_CFLAGS,;t t
 s,@HAVE_PAM@,$HAVE_PAM,;t t
index 2010c827e8a582755634069adddac6c79476fe19..3a0e0c13ca5af0f6b02dc75db556a7163a59e7b2 100755 (executable)
@@ -309,7 +309,7 @@ ac_includes_default="\
 # 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 datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE am__leading_dot CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE build build_cpu build_vendor build_os host host_cpu host_vendor host_os CPP EGREP LN_S RANLIB ac_ct_RANLIB YACC LEX LEXLIB LEX_OUTPUT_ROOT P5PLUS_KOPTS LINUX_GCC_KOPTS RHCONFIG_SP RHCONFIG_MP MPS HEADER_RT PTHREAD_LIBS XBSA_CFLAGS HAVE_PAM BUILD_LOGIN afsconfdir viceetcdir afskerneldir afssrvbindir afssrvsbindir afssrvlibexecdir afsdbdir afslogsdir afslocaldir afsbackupdir afsbosconfigdir AFS_SYSNAME AFS_PARAM_COMMON ENABLE_KERNEL_MODULE LIB_AFSDB LINUX_KERNEL_PATH BSD_KERNEL_PATH BSD_KERNEL_BUILD LINUX_VERSION MKAFS_OSTYPE TOP_OBJDIR TOP_SRCDIR TOP_INCDIR TOP_LIBDIR DEST WITH_OBSOLETE WITH_INSECURE DARWIN_INFOFILE IRIX_BUILD_IP35 AS AR MV RM LD CP LORDER XFS_SIZE_CHECK install_XFS_SIZE_CHECK dest_XFS_SIZE_CHECK FS_CONV_SOL26 install_FS_CONV_SOL26 dest_FS_CONV_SOL26 FS_CONV_OSF40D install_FS_CONV_OSF40D dest_FS_CONV_OSF40D CCXPG2 CCOBJ AFSD_LIBS AFSD_LDFLAGS AIX64 DBG FSINCLUDES KERN_DBG KERN_OPTMZ LWP_DBG LWP_OPTMZ MT_CC MT_CFLAGS MT_LIBS OPTMZ PAM_CFLAGS PAM_LIBS PINSTALL_LIBS REGEX_OBJ SHLIB_CFLAGS SHLIB_LDFLAGS SHLIB_LINKER SHLIB_SUFFIX TXLIBS VFSCK_CFLAGS XCFLAGS XCFLAGS64 XLDFLAGS XLDFLAGS64 XLIBELFA XLIBKVM XLIBS HELPER_SPLINT HELPER_SPLINTCFG LIBOBJS LTLIBOBJS'
+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 datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE am__leading_dot CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE build build_cpu build_vendor build_os host host_cpu host_vendor host_os CPP EGREP LN_S RANLIB ac_ct_RANLIB YACC LEX LEXLIB LEX_OUTPUT_ROOT HEADER_RT P5PLUS_KOPTS LINUX_GCC_KOPTS RHCONFIG_SP RHCONFIG_MP MPS PTHREAD_LIBS XBSA_CFLAGS HAVE_PAM BUILD_LOGIN afsconfdir viceetcdir afskerneldir afssrvbindir afssrvsbindir afssrvlibexecdir afsdbdir afslogsdir afslocaldir afsbackupdir afsbosconfigdir AFS_SYSNAME AFS_PARAM_COMMON ENABLE_KERNEL_MODULE LIB_AFSDB LINUX_KERNEL_PATH BSD_KERNEL_PATH BSD_KERNEL_BUILD LINUX_VERSION MKAFS_OSTYPE TOP_OBJDIR TOP_SRCDIR TOP_INCDIR TOP_LIBDIR DEST WITH_OBSOLETE WITH_INSECURE DARWIN_INFOFILE IRIX_BUILD_IP35 AS AR MV RM LD CP LORDER XFS_SIZE_CHECK install_XFS_SIZE_CHECK dest_XFS_SIZE_CHECK FS_CONV_SOL26 install_FS_CONV_SOL26 dest_FS_CONV_SOL26 FS_CONV_OSF40D install_FS_CONV_OSF40D dest_FS_CONV_OSF40D CCXPG2 CCOBJ AFSD_LIBS AFSD_LDFLAGS AIX64 DBG FSINCLUDES KERN_DBG KERN_OPTMZ LWP_DBG LWP_OPTMZ MT_CC MT_CFLAGS MT_LIBS OPTMZ PAM_CFLAGS PAM_LIBS PINSTALL_LIBS REGEX_OBJ SHLIB_CFLAGS SHLIB_LDFLAGS SHLIB_LINKER SHLIB_SUFFIX TXLIBS VFSCK_CFLAGS XCFLAGS XCFLAGS64 XLDFLAGS XLDFLAGS64 XLIBELFA XLIBKVM XLIBS HELPER_SPLINT HELPER_SPLINTCFG LIBOBJS LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
@@ -1612,7 +1612,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE=openafs-libafs
- VERSION=1.3.74
+ VERSION=1.3.77
 
 
 cat >>confdefs.h <<_ACEOF
@@ -4778,6 +4778,7 @@ echo $ECHO_N "checking your OS... $ECHO_C" >&6
 system=$host
 case $system in
         *-linux*)
+
                MKAFS_OSTYPE=LINUX
                if test "x$enable_redhat_buildsys" = "xyes"; then
 
@@ -4839,16 +4840,23 @@ echo "$as_me: WARNING: No usable linux headers found at $LINUX_KERNEL_PATH so di
                fi
                echo "$as_me:$LINENO: result: linux" >&5
 echo "${ECHO_T}linux" >&6
-               if test "x$enable_kernel_module" = "xyes"; then
-                if test "x$enable_debug_kernel" = "xno"; then
-                       LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -fomit-frame-pointer"
-                fi
+                if test "x$enable_kernel_module" = "xyes"; then
+                 AFS_SYSKVERS=`echo $LINUX_VERSION | awk -F\. '{print $1 $2}'`
+                 if test "x${AFS_SYSKVERS}" = "x"; then
+                  { { echo "$as_me:$LINENO: error: Couldn't guess your Linux version 2" >&5
+echo "$as_me: error: Couldn't guess your Linux version 2" >&2;}
+   { (exit 1); exit 1; }; }
+                 fi
+                fi
+                ;;
+        *-solaris*)
+               MKAFS_OSTYPE=SOLARIS
+                echo "$as_me:$LINENO: result: sun4" >&5
+echo "${ECHO_T}sun4" >&6
 
-echo "$as_me:$LINENO: checking if $CC accepts -march=pentium" >&5
-echo $ECHO_N "checking if $CC accepts -march=pentium... $ECHO_C" >&6
-save_CFLAGS="$CFLAGS"
-CFLAGS="-MARCH=pentium"
-if test "${openafs_gcc_supports_march+set}" = set; then
+echo "$as_me:$LINENO: checking for vfs_dqrwlock in struct ufsvfs" >&5
+echo $ECHO_N "checking for vfs_dqrwlock in struct ufsvfs... $ECHO_C" >&6
+if test "${ac_cv_solaris_ufsvfs_has_dqrwlock+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
@@ -4858,11 +4866,13 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
+#define _KERNEL
+#include <sys/fs/ufs_inode.h>
 int
 main ()
 {
-int x;
+struct ufsvfs _ufsvfs;
+(void) _ufsvfs.vfs_dqrwlock;
   ;
   return 0;
 }
@@ -4888,94 +4898,30 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  openafs_gcc_supports_march=yes
+  ac_cv_solaris_ufsvfs_has_dqrwlock=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-openafs_gcc_supports_march=no
+ac_cv_solaris_ufsvfs_has_dqrwlock=no
 fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 
-echo "$as_me:$LINENO: result: $openafs_gcc_supports_march" >&5
-echo "${ECHO_T}$openafs_gcc_supports_march" >&6
-if test x$openafs_gcc_supports_march = xyes; then
-  P5PLUS_KOPTS="-march=pentium"
-else
-  P5PLUS_KOPTS="-m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2"
-fi
-CFLAGS="$save_CFLAGS"
-
-
-
-echo "$as_me:$LINENO: checking if $CC needs -fno-strength-reduce" >&5
-echo $ECHO_N "checking if $CC needs -fno-strength-reduce... $ECHO_C" >&6
-save_CFLAGS="$CFLAGS"
-CFLAGS="-fno-strength-reduce"
-if test "${openafs_gcc_needs_no_strength_reduce+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.  */
+echo "$as_me:$LINENO: result: $ac_cv_solaris_ufsvfs_has_dqrwlock" >&5
+echo "${ECHO_T}$ac_cv_solaris_ufsvfs_has_dqrwlock" >&6
+if test "$ac_cv_solaris_ufsvfs_has_dqrwlock" = "yes"; then
 
-int
-main ()
-{
-int x;
-  ;
-  return 0;
-}
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_VFS_DQRWLOCK 1
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  openafs_gcc_needs_no_strength_reduce=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-openafs_gcc_needs_no_strength_reduce=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
 
-echo "$as_me:$LINENO: result: $openafs_gcc_needs_no_strength_reduce" >&5
-echo "${ECHO_T}$openafs_gcc_needs_no_strength_reduce" >&6
-if test x$openafs_gcc_needs_no_strength_reduce = xyes; then
-  LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -fno-strength-reduce"
 fi
-CFLAGS="$save_CFLAGS"
 
 
-echo "$as_me:$LINENO: checking if $CC needs -fno-strict-aliasing" >&5
-echo $ECHO_N "checking if $CC needs -fno-strict-aliasing... $ECHO_C" >&6
-save_CFLAGS="$CFLAGS"
-CFLAGS="-fno-strict-aliasing"
-if test "${openafs_gcc_needs_no_strict_aliasing+set}" = set; then
+echo "$as_me:$LINENO: checking for p_corefile in struct proc" >&5
+echo $ECHO_N "checking for p_corefile in struct proc... $ECHO_C" >&6
+if test "${ac_cv_solaris_proc_has_p_corefile+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
@@ -4985,11 +4931,13 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
+#define _KERNEL
+#include <sys/proc.h>
 int
 main ()
 {
-int x;
+struct proc _proc;
+(void) _proc.p_corefile;
   ;
   return 0;
 }
@@ -5015,91 +4963,30 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  openafs_gcc_needs_no_strict_aliasing=yes
+  ac_cv_solaris_proc_has_p_corefile=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-openafs_gcc_needs_no_strict_aliasing=no
+ac_cv_solaris_proc_has_p_corefile=no
 fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 
-echo "$as_me:$LINENO: result: $openafs_gcc_needs_no_strict_aliasing" >&5
-echo "${ECHO_T}$openafs_gcc_needs_no_strict_aliasing" >&6
-if test x$openafs_gcc_needs_no_strict_aliasing = xyes; then
-  LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -fno-strict-aliasing"
-fi
-CFLAGS="$save_CFLAGS"
-
-
-echo "$as_me:$LINENO: checking if $CC supports -fno-common" >&5
-echo $ECHO_N "checking if $CC supports -fno-common... $ECHO_C" >&6
-save_CFLAGS="$CFLAGS"
-CFLAGS="-fno-common"
-if test "${openafs_gcc_supports_no_common+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.  */
+echo "$as_me:$LINENO: result: $ac_cv_solaris_proc_has_p_corefile" >&5
+echo "${ECHO_T}$ac_cv_solaris_proc_has_p_corefile" >&6
+if test "$ac_cv_solaris_proc_has_p_corefile" = "yes"; then
 
-int
-main ()
-{
-int x;
-  ;
-  return 0;
-}
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_P_COREFILE 1
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  openafs_gcc_supports_no_common=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-openafs_gcc_supports_no_common=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
 
-echo "$as_me:$LINENO: result: $openafs_gcc_supports_no_common" >&5
-echo "${ECHO_T}$openafs_gcc_supports_no_common" >&6
-if test x$openafs_gcc_supports_no_common = xyes; then
-  LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -fno-common"
 fi
-CFLAGS="$save_CFLAGS"
 
 
-echo "$as_me:$LINENO: checking if $CC supports -pipe" >&5
-echo $ECHO_N "checking if $CC supports -pipe... $ECHO_C" >&6
-save_CFLAGS="$CFLAGS"
-CFLAGS="-pipe"
-if test "${openafs_gcc_supports_pipe+set}" = set; then
+echo "$as_me:$LINENO: checking for fs_rolled in struct proc" >&5
+echo $ECHO_N "checking for fs_rolled in struct proc... $ECHO_C" >&6
+if test "${ac_cv_solaris_fs_has_fs_rolled+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
@@ -5109,11 +4996,12 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
+#include <sys/fs/ufs_fs.h>
 int
 main ()
 {
-int x;
+struct fs _fs;
+(void) _fs.fs_rolled;
   ;
   return 0;
 }
@@ -5139,2391 +5027,97 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  openafs_gcc_supports_pipe=yes
+  ac_cv_solaris_fs_has_fs_rolled=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-openafs_gcc_supports_pipe=no
+ac_cv_solaris_fs_has_fs_rolled=no
 fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 
-echo "$as_me:$LINENO: result: $openafs_gcc_supports_pipe" >&5
-echo "${ECHO_T}$openafs_gcc_supports_pipe" >&6
-if test x$openafs_gcc_supports_pipe = xyes; then
-  LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -pipe"
-fi
-CFLAGS="$save_CFLAGS"
-
-
-
-echo "$as_me:$LINENO: checking whether to build osi_vfs.h" >&5
-echo $ECHO_N "checking whether to build osi_vfs.h... $ECHO_C" >&6
-configdir=src/config
-outputdir=afs
-tmpldir=src/afs/LINUX
-chmod +x $configdir/make_vnode.pl
-$configdir/make_vnode.pl -i $LINUX_KERNEL_PATH -t ${tmpldir} -o $outputdir
-
-
-echo "$as_me:$LINENO: checking for linux/completion.h existance" >&5
-echo $ECHO_N "checking for linux/completion.h existance... $ECHO_C" >&6
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
-if test "${ac_cv_linux_completion_h_exists+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
+echo "$as_me:$LINENO: result: $ac_cv_solaris_fs_has_fs_rolled" >&5
+echo "${ECHO_T}$ac_cv_solaris_fs_has_fs_rolled" >&6
+if test "$ac_cv_solaris_fs_has_fs_rolled" = "yes"; then
 
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
+cat >>confdefs.h <<\_ACEOF
+#define STRUCT_FS_HAS_FS_ROLLED 1
 _ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <linux/completion.h>
-#include <linux/version.h>
-int
-main ()
-{
-struct completion _c;
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,4,8)
-lose
-#endif
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_completion_h_exists=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_completion_h_exists=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_linux_completion_h_exists" >&5
-echo "${ECHO_T}$ac_cv_linux_completion_h_exists" >&6
-CPPFLAGS="$save_CPPFLAGS"
-
-echo "$as_me:$LINENO: checking for defined for_each_process" >&5
-echo $ECHO_N "checking for defined for_each_process... $ECHO_C" >&6
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
-if test "${ac_cv_linux_defines_for_each_process+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.  */
-#include <linux/sched.h>
-int
-main ()
-{
-#ifndef for_each_process(p)
-#error for_each_process not defined
-#endif
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_defines_for_each_process=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_defines_for_each_process=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 
-echo "$as_me:$LINENO: result: $ac_cv_linux_defines_for_each_process" >&5
-echo "${ECHO_T}$ac_cv_linux_defines_for_each_process" >&6
-CPPFLAGS="$save_CPPFLAGS"
-
-echo "$as_me:$LINENO: checking for defined prev_task" >&5
-echo $ECHO_N "checking for defined prev_task... $ECHO_C" >&6
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
-if test "${ac_cv_linux_defines_prev_task+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.  */
-#include <linux/sched.h>
-int
-main ()
-{
-#ifndef prev_task(p)
-#error prev_task not defined
-#endif
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_defines_prev_task=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_defines_prev_task=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
+                ;;
+        *-sunos*)
+               MKAFS_OSTYPE=SUNOS
+               enable_kernel_module=no
+                echo "$as_me:$LINENO: result: sun4" >&5
+echo "${ECHO_T}sun4" >&6
+                ;;
+        *-hpux*)
+               MKAFS_OSTYPE=HPUX
+                echo "$as_me:$LINENO: result: hp_ux" >&5
+echo "${ECHO_T}hp_ux" >&6
+                ;;
+        *-irix*)
+               if test -d /usr/include/sys/SN/SN1; then
+                IRIX_BUILD_IP35="IP35"
+               fi
+               MKAFS_OSTYPE=IRIX
+                echo "$as_me:$LINENO: result: sgi" >&5
+echo "${ECHO_T}sgi" >&6
+                ;;
+        *-aix*)
+               MKAFS_OSTYPE=AIX
+                echo "$as_me:$LINENO: result: rs_aix" >&5
+echo "${ECHO_T}rs_aix" >&6
+                ;;
+        *-osf*)
+               MKAFS_OSTYPE=DUX
+                echo "$as_me:$LINENO: result: alpha_dux" >&5
+echo "${ECHO_T}alpha_dux" >&6
+               if test "x$enable_kernel_module" = "xyes"; then
+                if test "x$with_dux_kernel_headers" != "x"; then
+                  HEADER_RT=`ls ${with_dux_kernel_headers}/rt_preempt.h | head -1 | sed 's,/rt_preempt.h,,;s,/usr/sys/,,'`
+                else
+                  HEADER_RT=`ls /usr/sys/*/rt_preempt.h | head -1 | sed 's,/rt_preempt.h,,;s,/usr/sys/,,'`
+                fi
+               fi
+               if test "$HEADER_RT" = "*" ; then
+                       { { echo "$as_me:$LINENO: error: Need a configured kernel directory" >&5
+echo "$as_me: error: Need a configured kernel directory" >&2;}
+   { (exit 1); exit 1; }; }
+               fi
 
-echo "$as_me:$LINENO: result: $ac_cv_linux_defines_prev_task" >&5
-echo "${ECHO_T}$ac_cv_linux_defines_prev_task" >&6
-CPPFLAGS="$save_CPPFLAGS"
+                ;;
+        *-darwin*)
+               MKAFS_OSTYPE=DARWIN
+                echo "$as_me:$LINENO: result: ppc_darwin" >&5
+echo "${ECHO_T}ppc_darwin" >&6
+                ;;
+       *-freebsd*)
+               MKAFS_OSTYPE=FBSD
+               echo "$as_me:$LINENO: result: i386_fbsd" >&5
+echo "${ECHO_T}i386_fbsd" >&6
+               ;;
+       *-netbsd*)
+               MKAFS_OSTYPE=NBSD
+               echo "$as_me:$LINENO: result: nbsd" >&5
+echo "${ECHO_T}nbsd" >&6
+               ;;
+       *-openbsd*)
+               MKAFS_OSTYPE=OBSD
+               echo "$as_me:$LINENO: result: i386_obsd" >&5
+echo "${ECHO_T}i386_obsd" >&6
+               ;;
+        *)
+                echo "$as_me:$LINENO: result: $system" >&5
+echo "${ECHO_T}$system" >&6
+                ;;
+esac
 
-echo "$as_me:$LINENO: checking for exported tasklist_lock" >&5
-echo $ECHO_N "checking for exported tasklist_lock... $ECHO_C" >&6
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
-if test "${ac_cv_linux_exports_tasklist_lock+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.  */
-#include <linux/modversions.h>
-int
-main ()
-{
-#ifndef __ver_tasklist_lock
-#error tasklist_lock not exported
-#endif
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_exports_tasklist_lock=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_exports_tasklist_lock=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_linux_exports_tasklist_lock" >&5
-echo "${ECHO_T}$ac_cv_linux_exports_tasklist_lock" >&6
-CPPFLAGS="$save_CPPFLAGS"
-
-echo "$as_me:$LINENO: checking for page_lock in struct address_space" >&5
-echo $ECHO_N "checking for page_lock in struct address_space... $ECHO_C" >&6
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
-if test "${ac_cv_linux_fs_struct_address_space_has_page_lock+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.  */
-#include <linux/fs.h>
-int
-main ()
-{
-struct address_space _a_s;
-printf("%x\n", _a_s.page_lock);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_fs_struct_address_space_has_page_lock=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_fs_struct_address_space_has_page_lock=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_linux_fs_struct_address_space_has_page_lock" >&5
-echo "${ECHO_T}$ac_cv_linux_fs_struct_address_space_has_page_lock" >&6
-CPPFLAGS="$save_CPPFLAGS"
-
-echo "$as_me:$LINENO: checking for gfp_mask in struct address_space" >&5
-echo $ECHO_N "checking for gfp_mask in struct address_space... $ECHO_C" >&6
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
-if test "${ac_cv_linux_fs_struct_address_space_has_gfp_mask+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.  */
-#include <linux/fs.h>
-int
-main ()
-{
-struct address_space _a;
-printf("%d\n", _a.gfp_mask);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_fs_struct_address_space_has_gfp_mask=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_fs_struct_address_space_has_gfp_mask=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_linux_fs_struct_address_space_has_gfp_mask" >&5
-echo "${ECHO_T}$ac_cv_linux_fs_struct_address_space_has_gfp_mask" >&6
-CPPFLAGS="$save_CPPFLAGS"
-
-echo "$as_me:$LINENO: checking for i_alloc_sem in struct inode" >&5
-echo $ECHO_N "checking for i_alloc_sem in struct inode... $ECHO_C" >&6
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
-if test "${ac_cv_linux_fs_struct_inode_has_i_alloc_sem+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.  */
-#include <linux/fs.h>
-int
-main ()
-{
-struct inode _i;
-printf("%x\n", _i.i_alloc_sem);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_fs_struct_inode_has_i_alloc_sem=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_fs_struct_inode_has_i_alloc_sem=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_linux_fs_struct_inode_has_i_alloc_sem" >&5
-echo "${ECHO_T}$ac_cv_linux_fs_struct_inode_has_i_alloc_sem" >&6
-CPPFLAGS="$save_CPPFLAGS"
-
-echo "$as_me:$LINENO: checking for i_truncate_sem in struct inode" >&5
-echo $ECHO_N "checking for i_truncate_sem in struct inode... $ECHO_C" >&6
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
-if test "${ac_cv_linux_fs_struct_inode_has_i_truncate_sem+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.  */
-#include <linux/fs.h>
-int
-main ()
-{
-struct inode _i;
-printf("%x\n", _i.i_truncate_sem);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_fs_struct_inode_has_i_truncate_sem=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_fs_struct_inode_has_i_truncate_sem=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_linux_fs_struct_inode_has_i_truncate_sem" >&5
-echo "${ECHO_T}$ac_cv_linux_fs_struct_inode_has_i_truncate_sem" >&6
-CPPFLAGS="$save_CPPFLAGS"
-
-echo "$as_me:$LINENO: checking for i_dirty_data_buffers in struct inode" >&5
-echo $ECHO_N "checking for i_dirty_data_buffers in struct inode... $ECHO_C" >&6
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
-if test "${ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers+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.  */
-#include <linux/fs.h>
-int
-main ()
-{
-struct inode _inode;
-printf("%d\n", _inode.i_dirty_data_buffers);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers" >&5
-echo "${ECHO_T}$ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers" >&6
-CPPFLAGS="$save_CPPFLAGS"
-
-echo "$as_me:$LINENO: checking for i_devices in struct inode" >&5
-echo $ECHO_N "checking for i_devices in struct inode... $ECHO_C" >&6
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
-if test "${ac_cv_linux_fs_struct_inode_has_i_cdev+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.  */
-#include <linux/fs.h>
-int
-main ()
-{
-struct inode _inode;
-printf("%d\n", _inode.i_devices);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_fs_struct_inode_has_i_devices=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_fs_struct_inode_has_i_devices=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_linux_fs_struct_inode_has_i_devices" >&5
-echo "${ECHO_T}$ac_cv_linux_fs_struct_inode_has_i_devices" >&6
-CPPFLAGS="$save_CPPFLAGS"
-
-echo "$as_me:$LINENO: checking for i_security in struct inode" >&5
-echo $ECHO_N "checking for i_security in struct inode... $ECHO_C" >&6
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
-if test "${ac_cv_linux_fs_struct_inode_has_i_security+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.  */
-#include <linux/fs.h>
-int
-main ()
-{
-struct inode _inode;
-printf("%d\n", _inode.i_security);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_fs_struct_inode_has_i_security=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_fs_struct_inode_has_i_security=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_linux_fs_struct_inode_has_i_security" >&5
-echo "${ECHO_T}$ac_cv_linux_fs_struct_inode_has_i_security" >&6
-CPPFLAGS="$save_CPPFLAGS"
-
-echo "$as_me:$LINENO: checking for inode_setattr return type" >&5
-echo $ECHO_N "checking for inode_setattr return type... $ECHO_C" >&6
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
-if test "${ac_cv_linux_func_inode_setattr_returns_int+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.  */
-#include <linux/fs.h>
-int
-main ()
-{
-struct inode _inode;
-struct iattr _iattr;
-int i;
-i = inode_setattr(&_inode, &_iattr);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_func_inode_setattr_returns_int=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_func_inode_setattr_returns_int=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_linux_func_inode_setattr_returns_int" >&5
-echo "${ECHO_T}$ac_cv_linux_func_inode_setattr_returns_int" >&6
-CPPFLAGS="$save_CPPFLAGS"
-
-  echo "$as_me:$LINENO: checking for linux/syscall.h in kernel" >&5
-echo $ECHO_N "checking for linux/syscall.h in kernel... $ECHO_C" >&6
-  if test -f "${LINUX_KERNEL_PATH}/include/linux/syscall.h"; then
-    ac_linux_syscall=yes
-    echo "$as_me:$LINENO: result: $ac_linux_syscall" >&5
-echo "${ECHO_T}$ac_linux_syscall" >&6
-  else
-    ac_linux_syscall=no
-    echo "$as_me:$LINENO: result: $ac_linux_syscall" >&5
-echo "${ECHO_T}$ac_linux_syscall" >&6
-  fi
-
-
-echo "$as_me:$LINENO: checking for SELinux kernel" >&5
-echo $ECHO_N "checking for SELinux kernel... $ECHO_C" >&6
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include $CPPFLAGS"
-if test "${ac_cv_linux_kernel_is_selinux+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.  */
-#include <linux/autoconf.h>
-int
-main ()
-{
-#ifndef CONFIG_SECURITY_SELINUX
-   #error not SELINUX
-   #endif
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_kernel_is_selinux=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_kernel_is_selinux=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_linux_kernel_is_selinux" >&5
-echo "${ECHO_T}$ac_cv_linux_kernel_is_selinux" >&6
-CPPFLAGS="$save_CPPFLAGS"
-
-echo "$as_me:$LINENO: checking for 5th argument in sock_create found in some SELinux kernels" >&5
-echo $ECHO_N "checking for 5th argument in sock_create found in some SELinux kernels... $ECHO_C" >&6
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
-if test "${ac_cv_linux_kernel_sock_create_v+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.  */
-#include <linux/net.h>
-int
-main ()
-{
-
-  sock_create(0,0,0,0,0)
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_kernel_sock_create_v=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_kernel_sock_create_v=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_linux_kernel_sock_create_v" >&5
-echo "${ECHO_T}$ac_cv_linux_kernel_sock_create_v" >&6
-CPPFLAGS="$save_CPPFLAGS"
-
-RHCONFIG_SP=""
-RHCONFIG_MP=""
-if test "x$enable_redhat_buildsys" = "xyes"; then
-  { echo "$as_me:$LINENO: WARNING: Configured to build from a Red Hat SPEC file" >&5
-echo "$as_me: WARNING: Configured to build from a Red Hat SPEC file" >&2;}
-else
-  echo "$as_me:$LINENO: checking for redhat kernel configuration" >&5
-echo $ECHO_N "checking for redhat kernel configuration... $ECHO_C" >&6
-  if test -f "${LINUX_KERNEL_PATH}/include/linux/rhconfig.h"; then
-    ac_linux_rhconfig=yes
-    RHCONFIG_SP="-D__BOOT_KERNEL_UP=1 -D__BOOT_KERNEL_SMP=0"
-    RHCONFIG_MP="-D__BOOT_KERNEL_UP=0 -D__BOOT_KERNEL_SMP=1"
-    echo "$as_me:$LINENO: result: $ac_linux_rhconfig" >&5
-echo "${ECHO_T}$ac_linux_rhconfig" >&6
-    if test ! -f "/boot/kernel.h"; then
-        { echo "$as_me:$LINENO: WARNING: /boot/kernel.h does not exist. build may fail" >&5
-echo "$as_me: WARNING: /boot/kernel.h does not exist. build may fail" >&2;}
-    fi
-  else
-    ac_linux_rhconfig=no
-    echo "$as_me:$LINENO: result: $ac_linux_rhconfig" >&5
-echo "${ECHO_T}$ac_linux_rhconfig" >&6
-  fi
-fi
-
-
-
-
-echo "$as_me:$LINENO: checking for recalc_sigpending arg type" >&5
-echo $ECHO_N "checking for recalc_sigpending arg type... $ECHO_C" >&6
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
-if test "${ac_cv_linux_func_recalc_sigpending_takes_void+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.  */
-#include <linux/sched.h>
-int
-main ()
-{
-recalc_sigpending();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_func_recalc_sigpending_takes_void=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_func_recalc_sigpending_takes_void=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_linux_func_recalc_sigpending_takes_void" >&5
-echo "${ECHO_T}$ac_cv_linux_func_recalc_sigpending_takes_void" >&6
-CPPFLAGS="$save_CPPFLAGS"
-
-echo "$as_me:$LINENO: checking for parent in struct task_struct" >&5
-echo $ECHO_N "checking for parent in struct task_struct... $ECHO_C" >&6
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
-if test "${ac_cv_linux_sched_struct_task_struct_has_parent+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.  */
-#include <linux/sched.h>
-int
-main ()
-{
-struct task_struct _tsk;
-printf("%d\n", _tsk.parent);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_sched_struct_task_struct_has_parent=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_sched_struct_task_struct_has_parent=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_linux_sched_struct_task_struct_has_parent" >&5
-echo "${ECHO_T}$ac_cv_linux_sched_struct_task_struct_has_parent" >&6
-CPPFLAGS="$save_CPPFLAGS"
-
-echo "$as_me:$LINENO: checking for real_parent in struct task_struct" >&5
-echo $ECHO_N "checking for real_parent in struct task_struct... $ECHO_C" >&6
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
-if test "${ac_cv_linux_sched_struct_task_struct_has_real_parent+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.  */
-#include <linux/sched.h>
-int
-main ()
-{
-struct task_struct _tsk;
-printf("%d\n", _tsk.real_parent);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_sched_struct_task_struct_has_real_parent=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_sched_struct_task_struct_has_real_parent=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_linux_sched_struct_task_struct_has_real_parent" >&5
-echo "${ECHO_T}$ac_cv_linux_sched_struct_task_struct_has_real_parent" >&6
-CPPFLAGS="$save_CPPFLAGS"
-
-echo "$as_me:$LINENO: checking for sig in struct task_struct" >&5
-echo $ECHO_N "checking for sig in struct task_struct... $ECHO_C" >&6
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
-if test "${ac_cv_linux_sched_struct_task_struct_has_sig+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.  */
-#include <linux/sched.h>
-int
-main ()
-{
-struct task_struct _tsk;
-printf("%d\n", _tsk.sig);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_sched_struct_task_struct_has_sig=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_sched_struct_task_struct_has_sig=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_linux_sched_struct_task_struct_has_sig" >&5
-echo "${ECHO_T}$ac_cv_linux_sched_struct_task_struct_has_sig" >&6
-CPPFLAGS="$save_CPPFLAGS"
-
-echo "$as_me:$LINENO: checking for sighand in struct task_struct" >&5
-echo $ECHO_N "checking for sighand in struct task_struct... $ECHO_C" >&6
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
-if test "${ac_cv_linux_sched_struct_task_struct_has_sighand+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.  */
-#include <linux/sched.h>
-int
-main ()
-{
-struct task_struct _tsk;
-printf("%d\n", _tsk.sighand);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_sched_struct_task_struct_has_sighand=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_sched_struct_task_struct_has_sighand=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_linux_sched_struct_task_struct_has_sighand" >&5
-echo "${ECHO_T}$ac_cv_linux_sched_struct_task_struct_has_sighand" >&6
-CPPFLAGS="$save_CPPFLAGS"
-
-echo "$as_me:$LINENO: checking for sigmask_lock in struct task_struct" >&5
-echo $ECHO_N "checking for sigmask_lock in struct task_struct... $ECHO_C" >&6
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
-if test "${ac_cv_linux_sched_struct_task_struct_has_sigmask_lock+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.  */
-#include <linux/sched.h>
-int
-main ()
-{
-struct task_struct _tsk;
-printf("%d\n", _tsk.sigmask_lock);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_sched_struct_task_struct_has_sigmask_lock=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_sched_struct_task_struct_has_sigmask_lock=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_linux_sched_struct_task_struct_has_sigmask_lock" >&5
-echo "${ECHO_T}$ac_cv_linux_sched_struct_task_struct_has_sigmask_lock" >&6
-CPPFLAGS="$save_CPPFLAGS"
-
-if test "x$enable_redhat_buildsys" = "xyes"; then
-  MPS=Default
-else
-  save_CPPFLAGS="$CPPFLAGS"
-  CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $RHCONFIG_SP $CPPFLAGS"
-  echo "$as_me:$LINENO: checking if kernel uses MODVERSIONS" >&5
-echo $ECHO_N "checking if kernel uses MODVERSIONS... $ECHO_C" >&6
-  if test "${ac_cv_linux_config_modversions+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.  */
-#include <linux/version.h>
-#include <linux/config.h>
-
-int
-main ()
-{
-#if !defined(CONFIG_MODVERSIONS) || (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0))
-lose;
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_config_modversions=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_config_modversions=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-  echo "$as_me:$LINENO: result: $ac_cv_linux_config_modversions" >&5
-echo "${ECHO_T}$ac_cv_linux_config_modversions" >&6
-  echo "$as_me:$LINENO: checking which kernel modules to build" >&5
-echo $ECHO_N "checking which kernel modules to build... $ECHO_C" >&6
-  if false; then
-      MPS="MP SP"
-  else
-  if test "${ac_cv_linux_config_smp+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.  */
-#include <linux/config.h>
-
-int
-main ()
-{
-#ifndef CONFIG_SMP
-lose;
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_config_smp=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_config_smp=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-        if test "x$ac_cv_linux_config_smp" = "xyes"; then
-          MPS=MP
-      else
-          MPS=SP
-      fi
-  fi
-  CPPFLAGS=$save_CPPFLAGS
-  echo "$as_me:$LINENO: result: $MPS" >&5
-echo "${ECHO_T}$MPS" >&6
-fi
-
-
-                 if test "x$ac_cv_linux_config_modversions" = "xno"; then
-                   { echo "$as_me:$LINENO: WARNING: Cannot determine sys_call_table status. assuming it isn't exported" >&5
-echo "$as_me: WARNING: Cannot determine sys_call_table status. assuming it isn't exported" >&2;}
-                   ac_cv_linux_exports_sys_call_table=no
-                  if test -f "$LINUX_KERNEL_PATH/include/asm/ia32_unistd.h"; then
-                    ac_cv_linux_exports_ia32_sys_call_table=yes
-                  fi
-                 else
-
-echo "$as_me:$LINENO: checking for exported init_mm" >&5
-echo $ECHO_N "checking for exported init_mm... $ECHO_C" >&6
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
-if test "${ac_cv_linux_exports_init_mm+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.  */
-#include <linux/modversions.h>
-int
-main ()
-{
-#ifndef __ver_init_mm
-#error init_mm not exported
-#endif
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_exports_init_mm=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_exports_init_mm=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_linux_exports_init_mm" >&5
-echo "${ECHO_T}$ac_cv_linux_exports_init_mm" >&6
-CPPFLAGS="$save_CPPFLAGS"
-
-echo "$as_me:$LINENO: checking for exported kallsyms_address_to_symbol" >&5
-echo $ECHO_N "checking for exported kallsyms_address_to_symbol... $ECHO_C" >&6
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
-if test "${ac_cv_linux_exports_kallsyms_address+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.  */
-#include <linux/modversions.h>
-int
-main ()
-{
-#ifndef __ver_kallsyms_address_to_symbol
-#error kallsyms_address_to_symbol not exported
-#endif
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_exports_kallsyms_address=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_exports_kallsyms_address=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_linux_exports_kallsyms_address" >&5
-echo "${ECHO_T}$ac_cv_linux_exports_kallsyms_address" >&6
-CPPFLAGS="$save_CPPFLAGS"
-
-echo "$as_me:$LINENO: checking for exported kallsyms_symbol_to_address" >&5
-echo $ECHO_N "checking for exported kallsyms_symbol_to_address... $ECHO_C" >&6
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
-if test "${ac_cv_linux_exports_kallsyms_symbol+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.  */
-#include <linux/modversions.h>
-int
-main ()
-{
-#ifndef __ver_kallsyms_symbol_to_address
-#error kallsyms_symbol_to_address not exported
-#endif
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_exports_kallsyms_symbol=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_exports_kallsyms_symbol=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_linux_exports_kallsyms_symbol" >&5
-echo "${ECHO_T}$ac_cv_linux_exports_kallsyms_symbol" >&6
-CPPFLAGS="$save_CPPFLAGS"
-
-echo "$as_me:$LINENO: checking for exported sys_call_table" >&5
-echo $ECHO_N "checking for exported sys_call_table... $ECHO_C" >&6
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
-if test "${ac_cv_linux_exports_sys_call_table+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.  */
-#include <linux/modversions.h>
-int
-main ()
-{
-#ifndef __ver_sys_call_table
-#error sys_call_table not exported
-#endif
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_exports_sys_call_table=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_exports_sys_call_table=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_linux_exports_sys_call_table" >&5
-echo "${ECHO_T}$ac_cv_linux_exports_sys_call_table" >&6
-CPPFLAGS="$save_CPPFLAGS"
-
-echo "$as_me:$LINENO: checking for exported ia32_sys_call_table" >&5
-echo $ECHO_N "checking for exported ia32_sys_call_table... $ECHO_C" >&6
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
-if test "${ac_cv_linux_exports_ia32_sys_call_table+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.  */
-#include <linux/modversions.h>
-int
-main ()
-{
-#ifndef __ver_ia32_sys_call_table
-#error ia32_sys_call_table not exported
-#endif
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_exports_ia32_sys_call_table=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_exports_ia32_sys_call_table=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_linux_exports_ia32_sys_call_table" >&5
-echo "${ECHO_T}$ac_cv_linux_exports_ia32_sys_call_table" >&6
-CPPFLAGS="$save_CPPFLAGS"
-
-echo "$as_me:$LINENO: checking for exported sys_chdir" >&5
-echo $ECHO_N "checking for exported sys_chdir... $ECHO_C" >&6
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
-if test "${ac_cv_linux_exports_sys_chdir+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.  */
-#include <linux/modversions.h>
-int
-main ()
-{
-#ifndef __ver_sys_chdir
-#error sys_chdir not exported
-#endif
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_exports_sys_chdir=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_exports_sys_chdir=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_linux_exports_sys_chdir" >&5
-echo "${ECHO_T}$ac_cv_linux_exports_sys_chdir" >&6
-CPPFLAGS="$save_CPPFLAGS"
-
-echo "$as_me:$LINENO: checking for exported sys_close" >&5
-echo $ECHO_N "checking for exported sys_close... $ECHO_C" >&6
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
-if test "${ac_cv_linux_exports_sys_close+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.  */
-#include <linux/modversions.h>
-int
-main ()
-{
-#ifndef __ver_sys_close
-#error sys_close not exported
-#endif
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_exports_sys_close=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_exports_sys_close=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_linux_exports_sys_close" >&5
-echo "${ECHO_T}$ac_cv_linux_exports_sys_close" >&6
-CPPFLAGS="$save_CPPFLAGS"
-
-echo "$as_me:$LINENO: checking for exported sys_wait4" >&5
-echo $ECHO_N "checking for exported sys_wait4... $ECHO_C" >&6
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
-if test "${ac_cv_linux_exports_sys_wait4+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.  */
-#include <linux/modversions.h>
-int
-main ()
-{
-#ifndef __ver_sys_wait4
-#error sys_wait4 not exported
-#endif
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_exports_sys_wait4=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_linux_exports_sys_wait4=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_linux_exports_sys_wait4" >&5
-echo "${ECHO_T}$ac_cv_linux_exports_sys_wait4" >&6
-CPPFLAGS="$save_CPPFLAGS"
-                   if test "x$ac_cv_linux_exports_sys_call_table" = "xno"; then
-                         linux_syscall_method=none
-                         if test "x$ac_cv_linux_exports_init_mm" = "xyes"; then
-                            linux_syscall_method=scan
-                            if test "x$ac_cv_linux_exports_kallsyms_address" = "xyes"; then
-                               linux_syscall_method=scan_with_kallsyms_address
-                            fi
-                         fi
-                         if test "x$ac_cv_linux_exports_kallsyms_symbol" = "xyes"; then
-                            linux_syscall_method=kallsyms_symbol
-                         fi
-                         if test "x$linux_syscall_method" = "xnone"; then
-                        { { echo "$as_me:$LINENO: error: no available sys_call_table access method" >&5
-echo "$as_me: error: no available sys_call_table access method" >&2;}
-   { (exit 1); exit 1; }; }
-                         fi
-                   fi
-                 fi
-                if test -f "$LINUX_KERNEL_PATH/include/linux/in_systm.h"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_IN_SYSTM_H 1
-_ACEOF
-
-                fi
-                if test -f "$LINUX_KERNEL_PATH/include/linux/mm_inline.h"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_MM_INLINE_H 1
-_ACEOF
-
-                fi
-                if test -f "$LINUX_KERNEL_PATH/include/linux/in_systm.h"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_IN_SYSTM_H 1
-_ACEOF
-
-                fi
-                if test "x$ac_cv_linux_exports_sys_chdir" = "xyes" ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define EXPORTED_SYS_CHDIR 1
-_ACEOF
-
-                fi
-                if test "x$ac_cv_linux_exports_sys_close" = "xyes" ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define EXPORTED_SYS_CLOSE 1
-_ACEOF
-
-                fi
-                if test "x$ac_cv_linux_exports_sys_wait4" = "xyes" ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define EXPORTED_SYS_WAIT4 1
-_ACEOF
-
-                fi
-                if test "x$ac_cv_linux_exports_tasklist_lock" = "xyes" ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define EXPORTED_TASKLIST_LOCK 1
-_ACEOF
-
-                fi
-                 if test "x$ac_cv_linux_exports_sys_call_table" = "xyes"; then
-                  cat >>confdefs.h <<\_ACEOF
-#define EXPORTED_SYS_CALL_TABLE 1
-_ACEOF
-
-                 fi
-                 if test "x$ac_cv_linux_exports_ia32_sys_call_table" = "xyes"; then
-                  cat >>confdefs.h <<\_ACEOF
-#define EXPORTED_IA32_SYS_CALL_TABLE 1
-_ACEOF
-
-                 fi
-                 if test "x$ac_cv_linux_exports_kallsyms_symbol" = "xyes"; then
-                  cat >>confdefs.h <<\_ACEOF
-#define EXPORTED_KALLSYMS_SYMBOL 1
-_ACEOF
-
-                 fi
-                 if test "x$ac_cv_linux_exports_kallsyms_address" = "xyes"; then
-                  cat >>confdefs.h <<\_ACEOF
-#define EXPORTED_KALLSYMS_ADDRESS 1
-_ACEOF
-
-                 fi
-                if test "x$ac_cv_linux_completion_h_exists" = "xyes" ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define COMPLETION_H_EXISTS 1
-_ACEOF
-
-                fi
-                if test "x$ac_cv_linux_defines_for_each_process" = "xyes" ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define DEFINED_FOR_EACH_PROCESS 1
-_ACEOF
-
-                fi
-                if test "x$ac_cv_linux_defines_prev_task" = "xyes" ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define DEFINED_PREV_TASK 1
-_ACEOF
-
-                fi
-                if test "x$ac_cv_linux_func_inode_setattr_returns_int" = "xyes" ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define INODE_SETATTR_NOT_VOID 1
-_ACEOF
-
-                fi
-                if test "x$ac_cv_linux_fs_struct_address_space_has_page_lock" = "xyes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK 1
-_ACEOF
-
-                fi
-                if test "x$ac_cv_linux_fs_struct_address_space_has_gfp_mask" = "xyes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define STRUCT_ADDRESS_SPACE_HAS_GFP_MASK 1
-_ACEOF
-
-                fi
-                if test "x$ac_cv_linux_fs_struct_inode_has_i_truncate_sem" = "xyes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define STRUCT_INODE_HAS_I_TRUNCATE_SEM 1
-_ACEOF
-
-                fi
-                if test "x$ac_cv_linux_fs_struct_inode_has_i_alloc_sem" = "xyes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define STRUCT_INODE_HAS_I_ALLOC_SEM 1
-_ACEOF
-
-                fi
-                if test "x$ac_cv_linux_fs_struct_inode_has_i_devices" = "xyes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define STRUCT_INODE_HAS_I_DEVICES 1
-_ACEOF
-
-                fi
-                if test "x$ac_cv_linux_fs_struct_inode_has_i_security" = "xyes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define STRUCT_INODE_HAS_I_SECURITY 1
-_ACEOF
-
-                fi
-                if test "x$ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers" = "xyes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS 1
-_ACEOF
-
-                fi
-                if test "x$ac_cv_linux_func_recalc_sigpending_takes_void" = "xyes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define RECALC_SIGPENDING_TAKES_VOID 1
-_ACEOF
-
-                fi
-                if test "x$ac_cv_linux_kernel_is_selinux" = "xyes" ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define LINUX_KERNEL_IS_SELINUX 1
-_ACEOF
-
-                fi
-                if test "x$ac_cv_linux_kernel_sock_create_v" = "xyes" ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define LINUX_KERNEL_SOCK_CREATE_V 1
-_ACEOF
-
-                fi
-                if test "x$ac_linux_syscall" = "xyes" ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_KERNEL_LINUX_SYSCALL_H 1
-_ACEOF
-
-                fi
-                if test "x$ac_cv_linux_sched_struct_task_struct_has_parent" = "xyes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define STRUCT_TASK_STRUCT_HAS_PARENT 1
-_ACEOF
-
-                fi
-                if test "x$ac_cv_linux_sched_struct_task_struct_has_real_parent" = "xyes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define STRUCT_TASK_STRUCT_HAS_REAL_PARENT 1
-_ACEOF
-
-                fi
-                if test "x$ac_cv_linux_sched_struct_task_struct_has_sigmask_lock" = "xyes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define STRUCT_TASK_STRUCT_HAS_SIGMASK_LOCK 1
-_ACEOF
-
-                fi
-                if test "x$ac_cv_linux_sched_struct_task_struct_has_sighand" = "xyes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define STRUCT_TASK_STRUCT_HAS_SIGHAND 1
-_ACEOF
-
-                fi
-                if test "x$ac_cv_linux_sched_struct_task_struct_has_sig" = "xyes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define STRUCT_TASK_STRUCT_HAS_SIG 1
-_ACEOF
-
-                fi
-                :
-               fi
-                ;;
-        *-solaris*)
-               MKAFS_OSTYPE=SOLARIS
-                echo "$as_me:$LINENO: result: sun4" >&5
-echo "${ECHO_T}sun4" >&6
-
-echo "$as_me:$LINENO: checking for vfs_dqrwlock in struct ufsvfs" >&5
-echo $ECHO_N "checking for vfs_dqrwlock in struct ufsvfs... $ECHO_C" >&6
-if test "${ac_cv_solaris_ufsvfs_has_dqrwlock+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.  */
-#define _KERNEL
-#include <sys/fs/ufs_inode.h>
-int
-main ()
-{
-struct ufsvfs _ufsvfs;
-(void) _ufsvfs.vfs_dqrwlock;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_solaris_ufsvfs_has_dqrwlock=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_solaris_ufsvfs_has_dqrwlock=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_solaris_ufsvfs_has_dqrwlock" >&5
-echo "${ECHO_T}$ac_cv_solaris_ufsvfs_has_dqrwlock" >&6
-if test "$ac_cv_solaris_ufsvfs_has_dqrwlock" = "yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_VFS_DQRWLOCK 1
-_ACEOF
-
-fi
-
-
-echo "$as_me:$LINENO: checking for p_corefile in struct proc" >&5
-echo $ECHO_N "checking for p_corefile in struct proc... $ECHO_C" >&6
-if test "${ac_cv_solaris_proc_has_p_corefile+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.  */
-#define _KERNEL
-#include <sys/proc.h>
-int
-main ()
-{
-struct proc _proc;
-(void) _proc.p_corefile;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_solaris_proc_has_p_corefile=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_solaris_proc_has_p_corefile=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_solaris_proc_has_p_corefile" >&5
-echo "${ECHO_T}$ac_cv_solaris_proc_has_p_corefile" >&6
-if test "$ac_cv_solaris_proc_has_p_corefile" = "yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_P_COREFILE 1
-_ACEOF
-
-fi
-
-
-echo "$as_me:$LINENO: checking for fs_rolled in struct proc" >&5
-echo $ECHO_N "checking for fs_rolled in struct proc... $ECHO_C" >&6
-if test "${ac_cv_solaris_fs_has_fs_rolled+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.  */
-#include <sys/fs/ufs_fs.h>
-int
-main ()
-{
-struct fs _fs;
-(void) _fs.fs_rolled;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_solaris_fs_has_fs_rolled=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_solaris_fs_has_fs_rolled=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_solaris_fs_has_fs_rolled" >&5
-echo "${ECHO_T}$ac_cv_solaris_fs_has_fs_rolled" >&6
-if test "$ac_cv_solaris_fs_has_fs_rolled" = "yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define STRUCT_FS_HAS_FS_ROLLED 1
-_ACEOF
-
-fi
-
-                ;;
-        *-sunos*)
-               MKAFS_OSTYPE=SUNOS
-               enable_kernel_module=no
-                echo "$as_me:$LINENO: result: sun4" >&5
-echo "${ECHO_T}sun4" >&6
-                ;;
-        *-hpux*)
-               MKAFS_OSTYPE=HPUX
-                echo "$as_me:$LINENO: result: hp_ux" >&5
-echo "${ECHO_T}hp_ux" >&6
-                ;;
-        *-irix*)
-               if test -d /usr/include/sys/SN/SN1; then
-                IRIX_BUILD_IP35="IP35"
-               fi
-               MKAFS_OSTYPE=IRIX
-                echo "$as_me:$LINENO: result: sgi" >&5
-echo "${ECHO_T}sgi" >&6
-                ;;
-        *-aix*)
-               MKAFS_OSTYPE=AIX
-                echo "$as_me:$LINENO: result: rs_aix" >&5
-echo "${ECHO_T}rs_aix" >&6
-                ;;
-        *-osf*)
-               MKAFS_OSTYPE=DUX
-                echo "$as_me:$LINENO: result: alpha_dux" >&5
-echo "${ECHO_T}alpha_dux" >&6
-               if test "x$enable_kernel_module" = "xyes"; then
-                if test "x$with_dux_kernel_headers" != "x"; then
-                  HEADER_RT=`ls ${with_dux_kernel_headers}/rt_preempt.h | head -1 | sed 's,/rt_preempt.h,,;s,/usr/sys/,,'`
-                else
-                  HEADER_RT=`ls /usr/sys/*/rt_preempt.h | head -1 | sed 's,/rt_preempt.h,,;s,/usr/sys/,,'`
-                fi
-               fi
-               if test "$HEADER_RT" = "*" ; then
-                       { { echo "$as_me:$LINENO: error: Need a configured kernel directory" >&5
-echo "$as_me: error: Need a configured kernel directory" >&2;}
-   { (exit 1); exit 1; }; }
-               fi
-
-                ;;
-        *-darwin*)
-               MKAFS_OSTYPE=DARWIN
-                echo "$as_me:$LINENO: result: ppc_darwin" >&5
-echo "${ECHO_T}ppc_darwin" >&6
-                ;;
-       *-freebsd*)
-               MKAFS_OSTYPE=FBSD
-               echo "$as_me:$LINENO: result: i386_fbsd" >&5
-echo "${ECHO_T}i386_fbsd" >&6
-               ;;
-       *-netbsd*)
-               MKAFS_OSTYPE=NBSD
-               echo "$as_me:$LINENO: result: nbsd" >&5
-echo "${ECHO_T}nbsd" >&6
-               ;;
-       *-openbsd*)
-               MKAFS_OSTYPE=OBSD
-               echo "$as_me:$LINENO: result: i386_obsd" >&5
-echo "${ECHO_T}i386_obsd" >&6
-               ;;
-        *)
-                echo "$as_me:$LINENO: result: $system" >&5
-echo "${ECHO_T}$system" >&6
-                ;;
-esac
-
-if test "x$with_afs_sysname" != "x"; then
-        AFS_SYSNAME="$with_afs_sysname"
+if test "x$with_afs_sysname" != "x"; then
+        AFS_SYSNAME="$with_afs_sysname"
 else
        echo "$as_me:$LINENO: checking your AFS sysname" >&5
 echo $ECHO_N "checking your AFS sysname... $ECHO_C" >&6
@@ -7612,6 +5206,10 @@ echo $ECHO_N "checking your AFS sysname... $ECHO_C" >&6
                        AFS_PARAM_COMMON=param.nbsd16.h
                        AFS_SYSNAME="ppc_nbsd16"
                        ;;
+               i?86-*-netbsd*2.99*)
+                       AFS_PARAM_COMMON=param.nbsd21.h
+                       AFS_SYSNAME="i386_nbsd21"
+                       ;;
                hppa*-hp-hpux11.0*)
                        AFS_SYSNAME="hp_ux110"
                        ;;
@@ -7767,15 +5365,19 @@ echo $ECHO_N "checking your AFS sysname... $ECHO_C" >&6
                        ;;
                power*-ibm-aix4.2*)
                        AFS_SYSNAME="rs_aix42"
+                       enable_pam="no"
                        ;;
                power*-ibm-aix4.3*)
                        AFS_SYSNAME="rs_aix42"
+                       enable_pam="no"
                        ;;
                power*-ibm-aix5.1*)
                        AFS_SYSNAME="rs_aix51"
+                       enable_pam="no"
                        ;;
                power*-ibm-aix5.2*)
                        AFS_SYSNAME="rs_aix52"
+                       enable_pam="no"
                        ;;
                x86_64-*-linux-gnu)
                        AFS_SYSNAME="amd64_linuxXX"
@@ -7789,8 +5391,7 @@ echo "$as_me: error: An AFS sysname is required" >&2;}
                        ;;
        esac
        case $AFS_SYSNAME in
-               *_linux*)
-                       AFS_SYSKVERS=`echo $LINUX_VERSION | awk -F\. '{print $1 $2}'`
+               *_linux* | *_umlinux*)
                        if test "x${AFS_SYSKVERS}" = "x"; then
                         { { echo "$as_me:$LINENO: error: Couldn't guess your Linux version. Please use the --with-afs-sysname option to configure an AFS sysname." >&5
 echo "$as_me: error: Couldn't guess your Linux version. Please use the --with-afs-sysname option to configure an AFS sysname." >&2;}
@@ -7803,58 +5404,2956 @@ echo "$as_me: error: Couldn't guess your Linux version. Please use the --with-af
                        cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <linux/autoconf.h>
-int
-main ()
-{
-#ifndef CONFIG_USERMODE
-                         #error not UML
-                         #endif
-  ;
-  return 0;
-}
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <linux/autoconf.h>
+int
+main ()
+{
+#ifndef CONFIG_USERMODE
+                         #error not UML
+                         #endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_is_uml=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+                       if test "${ac_cv_linux_is_uml}" = yes; then
+                        _AFS_SYSNAME=`echo $AFS_SYSNAME|sed s/linux/umlinux/`
+                       fi
+                       CPPFLAGS="$save_CPPFLAGS"
+                       AFS_SYSNAME="$_AFS_SYSNAME"
+                       ;;
+       esac
+        echo "$as_me:$LINENO: result: $AFS_SYSNAME" >&5
+echo "${ECHO_T}$AFS_SYSNAME" >&6
+fi
+
+case $AFS_SYSNAME in *_linux* | *_umlinux*)
+
+               # Add (sub-) architecture-specific paths needed by conftests
+               case $AFS_SYSNAME  in
+                       *_umlinux26)
+                               UMLINUX26_FLAGS="-I$LINUX_KERNEL_PATH/arch/um/include"
+                               UMLINUX26_FLAGS="$UMLINUX26_FLAGS -I$LINUX_KERNEL_PATH/arch/um/kernel/tt/include"
+                               UMLINUX26_FLAGS="$UMLINUX26_FLAGS -I$LINUX_KERNEL_PATH/arch/um/kernel/skas/include"
+                               CPPFLAGS="$CPPFLAGS $UMLINUX26_FLAGS"
+               esac
+
+               if test "x$enable_kernel_module" = "xyes"; then
+                if test "x$enable_debug_kernel" = "xno"; then
+                       LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -fomit-frame-pointer"
+                fi
+
+echo "$as_me:$LINENO: checking if $CC accepts -march=pentium" >&5
+echo $ECHO_N "checking if $CC accepts -march=pentium... $ECHO_C" >&6
+save_CFLAGS="$CFLAGS"
+CFLAGS="-MARCH=pentium"
+if test "${openafs_gcc_supports_march+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.  */
+
+int
+main ()
+{
+int x;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  openafs_gcc_supports_march=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+openafs_gcc_supports_march=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $openafs_gcc_supports_march" >&5
+echo "${ECHO_T}$openafs_gcc_supports_march" >&6
+if test x$openafs_gcc_supports_march = xyes; then
+  P5PLUS_KOPTS="-march=pentium"
+else
+  P5PLUS_KOPTS="-m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2"
+fi
+CFLAGS="$save_CFLAGS"
+
+
+
+echo "$as_me:$LINENO: checking if $CC needs -fno-strength-reduce" >&5
+echo $ECHO_N "checking if $CC needs -fno-strength-reduce... $ECHO_C" >&6
+save_CFLAGS="$CFLAGS"
+CFLAGS="-fno-strength-reduce"
+if test "${openafs_gcc_needs_no_strength_reduce+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.  */
+
+int
+main ()
+{
+int x;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  openafs_gcc_needs_no_strength_reduce=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+openafs_gcc_needs_no_strength_reduce=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $openafs_gcc_needs_no_strength_reduce" >&5
+echo "${ECHO_T}$openafs_gcc_needs_no_strength_reduce" >&6
+if test x$openafs_gcc_needs_no_strength_reduce = xyes; then
+  LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -fno-strength-reduce"
+fi
+CFLAGS="$save_CFLAGS"
+
+
+echo "$as_me:$LINENO: checking if $CC needs -fno-strict-aliasing" >&5
+echo $ECHO_N "checking if $CC needs -fno-strict-aliasing... $ECHO_C" >&6
+save_CFLAGS="$CFLAGS"
+CFLAGS="-fno-strict-aliasing"
+if test "${openafs_gcc_needs_no_strict_aliasing+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.  */
+
+int
+main ()
+{
+int x;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  openafs_gcc_needs_no_strict_aliasing=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+openafs_gcc_needs_no_strict_aliasing=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $openafs_gcc_needs_no_strict_aliasing" >&5
+echo "${ECHO_T}$openafs_gcc_needs_no_strict_aliasing" >&6
+if test x$openafs_gcc_needs_no_strict_aliasing = xyes; then
+  LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -fno-strict-aliasing"
+fi
+CFLAGS="$save_CFLAGS"
+
+
+echo "$as_me:$LINENO: checking if $CC supports -fno-common" >&5
+echo $ECHO_N "checking if $CC supports -fno-common... $ECHO_C" >&6
+save_CFLAGS="$CFLAGS"
+CFLAGS="-fno-common"
+if test "${openafs_gcc_supports_no_common+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.  */
+
+int
+main ()
+{
+int x;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  openafs_gcc_supports_no_common=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+openafs_gcc_supports_no_common=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $openafs_gcc_supports_no_common" >&5
+echo "${ECHO_T}$openafs_gcc_supports_no_common" >&6
+if test x$openafs_gcc_supports_no_common = xyes; then
+  LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -fno-common"
+fi
+CFLAGS="$save_CFLAGS"
+
+
+echo "$as_me:$LINENO: checking if $CC supports -pipe" >&5
+echo $ECHO_N "checking if $CC supports -pipe... $ECHO_C" >&6
+save_CFLAGS="$CFLAGS"
+CFLAGS="-pipe"
+if test "${openafs_gcc_supports_pipe+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.  */
+
+int
+main ()
+{
+int x;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  openafs_gcc_supports_pipe=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+openafs_gcc_supports_pipe=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $openafs_gcc_supports_pipe" >&5
+echo "${ECHO_T}$openafs_gcc_supports_pipe" >&6
+if test x$openafs_gcc_supports_pipe = xyes; then
+  LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -pipe"
+fi
+CFLAGS="$save_CFLAGS"
+
+
+
+echo "$as_me:$LINENO: checking whether to build osi_vfs.h" >&5
+echo $ECHO_N "checking whether to build osi_vfs.h... $ECHO_C" >&6
+configdir=src/config
+outputdir=afs
+tmpldir=src/afs/LINUX
+chmod +x $configdir/make_vnode.pl
+$configdir/make_vnode.pl -i $LINUX_KERNEL_PATH -t ${tmpldir} -o $outputdir
+
+
+echo "$as_me:$LINENO: checking for linux/completion.h existance" >&5
+echo $ECHO_N "checking for linux/completion.h existance... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+if test "${ac_cv_linux_completion_h_exists+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.  */
+#include <linux/completion.h>
+#include <linux/version.h>
+int
+main ()
+{
+struct completion _c;
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,4,8)
+lose
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_completion_h_exists=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_completion_h_exists=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_completion_h_exists" >&5
+echo "${ECHO_T}$ac_cv_linux_completion_h_exists" >&6
+CPPFLAGS="$save_CPPFLAGS"
+
+echo "$as_me:$LINENO: checking for defined for_each_process" >&5
+echo $ECHO_N "checking for defined for_each_process... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+if test "${ac_cv_linux_defines_for_each_process+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.  */
+#include <linux/sched.h>
+int
+main ()
+{
+#ifndef for_each_process(p)
+#error for_each_process not defined
+#endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_defines_for_each_process=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_defines_for_each_process=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_defines_for_each_process" >&5
+echo "${ECHO_T}$ac_cv_linux_defines_for_each_process" >&6
+CPPFLAGS="$save_CPPFLAGS"
+
+echo "$as_me:$LINENO: checking for defined prev_task" >&5
+echo $ECHO_N "checking for defined prev_task... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+if test "${ac_cv_linux_defines_prev_task+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.  */
+#include <linux/sched.h>
+int
+main ()
+{
+#ifndef prev_task(p)
+#error prev_task not defined
+#endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_defines_prev_task=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_defines_prev_task=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_defines_prev_task" >&5
+echo "${ECHO_T}$ac_cv_linux_defines_prev_task" >&6
+CPPFLAGS="$save_CPPFLAGS"
+
+echo "$as_me:$LINENO: checking for exported tasklist_lock" >&5
+echo $ECHO_N "checking for exported tasklist_lock... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+if test "${ac_cv_linux_exports_tasklist_lock+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.  */
+#include <linux/modversions.h>
+int
+main ()
+{
+#ifndef __ver_tasklist_lock
+#error tasklist_lock not exported
+#endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_exports_tasklist_lock=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_exports_tasklist_lock=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_exports_tasklist_lock" >&5
+echo "${ECHO_T}$ac_cv_linux_exports_tasklist_lock" >&6
+CPPFLAGS="$save_CPPFLAGS"
+
+echo "$as_me:$LINENO: checking for page_lock in struct address_space" >&5
+echo $ECHO_N "checking for page_lock in struct address_space... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+if test "${ac_cv_linux_fs_struct_address_space_has_page_lock+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.  */
+#include <linux/fs.h>
+int
+main ()
+{
+struct address_space _a_s;
+printf("%x\n", _a_s.page_lock);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_fs_struct_address_space_has_page_lock=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_fs_struct_address_space_has_page_lock=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_fs_struct_address_space_has_page_lock" >&5
+echo "${ECHO_T}$ac_cv_linux_fs_struct_address_space_has_page_lock" >&6
+CPPFLAGS="$save_CPPFLAGS"
+
+echo "$as_me:$LINENO: checking for gfp_mask in struct address_space" >&5
+echo $ECHO_N "checking for gfp_mask in struct address_space... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+if test "${ac_cv_linux_fs_struct_address_space_has_gfp_mask+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.  */
+#include <linux/fs.h>
+int
+main ()
+{
+struct address_space _a;
+printf("%d\n", _a.gfp_mask);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_fs_struct_address_space_has_gfp_mask=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_fs_struct_address_space_has_gfp_mask=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_fs_struct_address_space_has_gfp_mask" >&5
+echo "${ECHO_T}$ac_cv_linux_fs_struct_address_space_has_gfp_mask" >&6
+CPPFLAGS="$save_CPPFLAGS"
+
+echo "$as_me:$LINENO: checking for i_alloc_sem in struct inode" >&5
+echo $ECHO_N "checking for i_alloc_sem in struct inode... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+if test "${ac_cv_linux_fs_struct_inode_has_i_alloc_sem+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.  */
+#include <linux/fs.h>
+int
+main ()
+{
+struct inode _i;
+printf("%x\n", _i.i_alloc_sem);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_fs_struct_inode_has_i_alloc_sem=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_fs_struct_inode_has_i_alloc_sem=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_fs_struct_inode_has_i_alloc_sem" >&5
+echo "${ECHO_T}$ac_cv_linux_fs_struct_inode_has_i_alloc_sem" >&6
+CPPFLAGS="$save_CPPFLAGS"
+
+echo "$as_me:$LINENO: checking for i_truncate_sem in struct inode" >&5
+echo $ECHO_N "checking for i_truncate_sem in struct inode... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+if test "${ac_cv_linux_fs_struct_inode_has_i_truncate_sem+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.  */
+#include <linux/fs.h>
+int
+main ()
+{
+struct inode _i;
+printf("%x\n", _i.i_truncate_sem);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_fs_struct_inode_has_i_truncate_sem=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_fs_struct_inode_has_i_truncate_sem=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_fs_struct_inode_has_i_truncate_sem" >&5
+echo "${ECHO_T}$ac_cv_linux_fs_struct_inode_has_i_truncate_sem" >&6
+CPPFLAGS="$save_CPPFLAGS"
+
+echo "$as_me:$LINENO: checking for i_dirty_data_buffers in struct inode" >&5
+echo $ECHO_N "checking for i_dirty_data_buffers in struct inode... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+if test "${ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers+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.  */
+#include <linux/fs.h>
+int
+main ()
+{
+struct inode _inode;
+printf("%d\n", _inode.i_dirty_data_buffers);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers" >&5
+echo "${ECHO_T}$ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers" >&6
+CPPFLAGS="$save_CPPFLAGS"
+
+echo "$as_me:$LINENO: checking for i_devices in struct inode" >&5
+echo $ECHO_N "checking for i_devices in struct inode... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+if test "${ac_cv_linux_fs_struct_inode_has_i_cdev+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.  */
+#include <linux/fs.h>
+int
+main ()
+{
+struct inode _inode;
+printf("%d\n", _inode.i_devices);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_fs_struct_inode_has_i_devices=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_fs_struct_inode_has_i_devices=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_fs_struct_inode_has_i_devices" >&5
+echo "${ECHO_T}$ac_cv_linux_fs_struct_inode_has_i_devices" >&6
+CPPFLAGS="$save_CPPFLAGS"
+
+echo "$as_me:$LINENO: checking for i_security in struct inode" >&5
+echo $ECHO_N "checking for i_security in struct inode... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+if test "${ac_cv_linux_fs_struct_inode_has_i_security+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.  */
+#include <linux/fs.h>
+int
+main ()
+{
+struct inode _inode;
+printf("%d\n", _inode.i_security);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_fs_struct_inode_has_i_security=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_fs_struct_inode_has_i_security=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_fs_struct_inode_has_i_security" >&5
+echo "${ECHO_T}$ac_cv_linux_fs_struct_inode_has_i_security" >&6
+CPPFLAGS="$save_CPPFLAGS"
+
+echo "$as_me:$LINENO: checking for inode_setattr return type" >&5
+echo $ECHO_N "checking for inode_setattr return type... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+if test "${ac_cv_linux_func_inode_setattr_returns_int+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.  */
+#include <linux/fs.h>
+int
+main ()
+{
+struct inode _inode;
+struct iattr _iattr;
+int i;
+i = inode_setattr(&_inode, &_iattr);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_func_inode_setattr_returns_int=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_func_inode_setattr_returns_int=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_func_inode_setattr_returns_int" >&5
+echo "${ECHO_T}$ac_cv_linux_func_inode_setattr_returns_int" >&6
+CPPFLAGS="$save_CPPFLAGS"
+
+echo "$as_me:$LINENO: checking for write_inode return type" >&5
+echo $ECHO_N "checking for write_inode return type... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+if test "${ac_cv_linux_func_write_inode_returns_int+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.  */
+#include <linux/fs.h>
+int
+main ()
+{
+struct inode _inode;
+struct super_operations _sops;
+int i;
+i = _sops.write_inode(&_inode, 0);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_func_write_inode_returns_int=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_func_write_inode_returns_int=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_func_write_inode_returns_int" >&5
+echo "${ECHO_T}$ac_cv_linux_func_write_inode_returns_int" >&6
+CPPFLAGS="$save_CPPFLAGS"
+
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+echo "$as_me:$LINENO: checking whether inode_operations.create takes a nameidata" >&5
+echo $ECHO_N "checking whether inode_operations.create takes a nameidata... $ECHO_C" >&6
+if test "${ac_cv_linux_func_i_create_takes_nameidata+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.  */
+#include <linux/fs.h>
+#include <linux/namei.h>
+int
+main ()
+{
+struct inode _inode;
+struct dentry _dentry;
+struct nameidata _nameidata;
+(void)_inode.i_op->create(&_inode, &_dentry, 0, &_nameidata);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_func_i_create_takes_nameidata=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_func_i_create_takes_nameidata=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_func_i_create_takes_nameidata" >&5
+echo "${ECHO_T}$ac_cv_linux_func_i_create_takes_nameidata" >&6
+if test "x$ac_cv_linux_func_i_create_takes_nameidata" = "xyes" ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define IOP_CREATE_TAKES_NAMEIDATA 1
+_ACEOF
+
+fi
+echo "$as_me:$LINENO: checking whether inode_operations.lookup takes a nameidata" >&5
+echo $ECHO_N "checking whether inode_operations.lookup takes a nameidata... $ECHO_C" >&6
+if test "${ac_cv_linux_func_i_lookup_takes_nameidata+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.  */
+#include <linux/fs.h>
+#include <linux/namei.h>
+int
+main ()
+{
+struct inode _inode;
+struct dentry _dentry;
+struct nameidata _nameidata;
+(void)_inode.i_op->lookup(&_inode, &_dentry, &_nameidata);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_func_i_lookup_takes_nameidata=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_func_i_lookup_takes_nameidata=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_func_i_lookup_takes_nameidata" >&5
+echo "${ECHO_T}$ac_cv_linux_func_i_lookup_takes_nameidata" >&6
+if test "x$ac_cv_linux_func_i_lookup_takes_nameidata" = "xyes" ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define IOP_LOOKUP_TAKES_NAMEIDATA 1
+_ACEOF
+
+fi
+echo "$as_me:$LINENO: checking whether inode_operations.permission takes a nameidata" >&5
+echo $ECHO_N "checking whether inode_operations.permission takes a nameidata... $ECHO_C" >&6
+if test "${ac_cv_linux_func_i_permission_takes_nameidata+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.  */
+#include <linux/fs.h>
+#include <linux/namei.h>
+int
+main ()
+{
+struct inode _inode;
+struct nameidata _nameidata;
+(void)_inode.i_op->permission(&_inode, 0, &_nameidata);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_func_i_permission_takes_nameidata=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_func_i_permission_takes_nameidata=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_func_i_permission_takes_nameidata" >&5
+echo "${ECHO_T}$ac_cv_linux_func_i_permission_takes_nameidata" >&6
+if test "x$ac_cv_linux_func_i_permission_takes_nameidata" = "xyes" ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define IOP_PERMISSION_TAKES_NAMEIDATA 1
+_ACEOF
+
+fi
+echo "$as_me:$LINENO: checking whether dentry_operations.d_revalidate takes a nameidata" >&5
+echo $ECHO_N "checking whether dentry_operations.d_revalidate takes a nameidata... $ECHO_C" >&6
+CPPFLAGS="$CPPFLAGS -Werror"
+if test "${ac_cv_linux_func_d_revalidate_takes_nameidata+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.  */
+#include <linux/fs.h>
+#include <linux/namei.h>
+int
+main ()
+{
+struct dentry _dentry;
+struct nameidata _nameidata;
+(void)_dentry.d_op->d_revalidate(&_dentry, &_nameidata);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_func_d_revalidate_takes_nameidata=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_func_d_revalidate_takes_nameidata=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_func_d_revalidate_takes_nameidata" >&5
+echo "${ECHO_T}$ac_cv_linux_func_d_revalidate_takes_nameidata" >&6
+if test "x$ac_cv_linux_func_d_revalidate_takes_nameidata" = "xyes" ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define DOP_REVALIDATE_TAKES_NAMEIDATA 1
+_ACEOF
+
+fi
+CPPFLAGS="$save_CPPFLAGS"
+
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+echo "$as_me:$LINENO: checking whether address_space_operations.writepage takes a writeback_control" >&5
+echo $ECHO_N "checking whether address_space_operations.writepage takes a writeback_control... $ECHO_C" >&6
+if test "${ac_cv_linux_func_a_writepage_takes_writeback_control+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.  */
+#include <linux/fs.h>
+#include <linux/mm.h>
+#include <linux/writeback.h>
+int
+main ()
+{
+struct address_space_operations _aops;
+struct page _page;
+struct writeback_control _writeback_control;
+(void)_aops.writepage(&_page, &_writeback_control);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_func_a_writepage_takes_writeback_control=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_func_a_writepage_takes_writeback_control=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_func_a_writepage_takes_writeback_control" >&5
+echo "${ECHO_T}$ac_cv_linux_func_a_writepage_takes_writeback_control" >&6
+if test "x$ac_cv_linux_func_a_writepage_takes_writeback_control" = "xyes" ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define AOP_WRITEPAGE_TAKES_WRITEBACK_CONTROL 1
+_ACEOF
+
+fi
+CPPFLAGS="$save_CPPFLAGS"
+
+  echo "$as_me:$LINENO: checking for linux/syscall.h in kernel" >&5
+echo $ECHO_N "checking for linux/syscall.h in kernel... $ECHO_C" >&6
+  if test -f "${LINUX_KERNEL_PATH}/include/linux/syscall.h"; then
+    ac_linux_syscall=yes
+    echo "$as_me:$LINENO: result: $ac_linux_syscall" >&5
+echo "${ECHO_T}$ac_linux_syscall" >&6
+  else
+    ac_linux_syscall=no
+    echo "$as_me:$LINENO: result: $ac_linux_syscall" >&5
+echo "${ECHO_T}$ac_linux_syscall" >&6
+  fi
+
+
+echo "$as_me:$LINENO: checking for SELinux kernel" >&5
+echo $ECHO_N "checking for SELinux kernel... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include $CPPFLAGS"
+if test "${ac_cv_linux_kernel_is_selinux+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.  */
+#include <linux/autoconf.h>
+int
+main ()
+{
+#ifndef CONFIG_SECURITY_SELINUX
+   #error not SELINUX
+   #endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_kernel_is_selinux=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_kernel_is_selinux=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_kernel_is_selinux" >&5
+echo "${ECHO_T}$ac_cv_linux_kernel_is_selinux" >&6
+CPPFLAGS="$save_CPPFLAGS"
+
+echo "$as_me:$LINENO: checking for 5th argument in sock_create found in some SELinux kernels" >&5
+echo $ECHO_N "checking for 5th argument in sock_create found in some SELinux kernels... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
+if test "${ac_cv_linux_kernel_sock_create_v+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.  */
+#include <linux/net.h>
+int
+main ()
+{
+
+  sock_create(0,0,0,0,0)
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_kernel_sock_create_v=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_kernel_sock_create_v=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_kernel_sock_create_v" >&5
+echo "${ECHO_T}$ac_cv_linux_kernel_sock_create_v" >&6
+CPPFLAGS="$save_CPPFLAGS"
+
+echo "$as_me:$LINENO: checking for page_follow_link_light vs page_follow_link" >&5
+echo $ECHO_N "checking for page_follow_link_light vs page_follow_link... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
+if test "${ac_cv_linux_kernel_page_follow_link+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.  */
+#include <linux/fs.h>
+int
+main ()
+{
+
+  page_follow_link(0,0)
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_kernel_page_follow_link=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_kernel_page_follow_link=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_kernel_page_follow_page" >&5
+echo "${ECHO_T}$ac_cv_linux_kernel_page_follow_page" >&6
+CPPFLAGS="$save_CPPFLAGS"
+
+RHCONFIG_SP=""
+RHCONFIG_MP=""
+if test "x$enable_redhat_buildsys" = "xyes"; then
+  { echo "$as_me:$LINENO: WARNING: Configured to build from a Red Hat SPEC file" >&5
+echo "$as_me: WARNING: Configured to build from a Red Hat SPEC file" >&2;}
+else
+  echo "$as_me:$LINENO: checking for redhat kernel configuration" >&5
+echo $ECHO_N "checking for redhat kernel configuration... $ECHO_C" >&6
+  if test -f "${LINUX_KERNEL_PATH}/include/linux/rhconfig.h"; then
+    ac_linux_rhconfig=yes
+    RHCONFIG_SP="-D__BOOT_KERNEL_UP=1 -D__BOOT_KERNEL_SMP=0"
+    RHCONFIG_MP="-D__BOOT_KERNEL_UP=0 -D__BOOT_KERNEL_SMP=1"
+    echo "$as_me:$LINENO: result: $ac_linux_rhconfig" >&5
+echo "${ECHO_T}$ac_linux_rhconfig" >&6
+    if test ! -f "/boot/kernel.h"; then
+        { echo "$as_me:$LINENO: WARNING: /boot/kernel.h does not exist. build may fail" >&5
+echo "$as_me: WARNING: /boot/kernel.h does not exist. build may fail" >&2;}
+    fi
+  else
+    ac_linux_rhconfig=no
+    echo "$as_me:$LINENO: result: $ac_linux_rhconfig" >&5
+echo "${ECHO_T}$ac_linux_rhconfig" >&6
+  fi
+fi
+
+
+
+
+echo "$as_me:$LINENO: checking for recalc_sigpending arg type" >&5
+echo $ECHO_N "checking for recalc_sigpending arg type... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+if test "${ac_cv_linux_func_recalc_sigpending_takes_void+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.  */
+#include <linux/sched.h>
+int
+main ()
+{
+recalc_sigpending();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_func_recalc_sigpending_takes_void=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_func_recalc_sigpending_takes_void=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_func_recalc_sigpending_takes_void" >&5
+echo "${ECHO_T}$ac_cv_linux_func_recalc_sigpending_takes_void" >&6
+CPPFLAGS="$save_CPPFLAGS"
+
+echo "$as_me:$LINENO: checking for parent in struct task_struct" >&5
+echo $ECHO_N "checking for parent in struct task_struct... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+if test "${ac_cv_linux_sched_struct_task_struct_has_parent+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.  */
+#include <linux/sched.h>
+int
+main ()
+{
+struct task_struct _tsk;
+printf("%d\n", _tsk.parent);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_sched_struct_task_struct_has_parent=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_sched_struct_task_struct_has_parent=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_sched_struct_task_struct_has_parent" >&5
+echo "${ECHO_T}$ac_cv_linux_sched_struct_task_struct_has_parent" >&6
+CPPFLAGS="$save_CPPFLAGS"
+
+echo "$as_me:$LINENO: checking for real_parent in struct task_struct" >&5
+echo $ECHO_N "checking for real_parent in struct task_struct... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+if test "${ac_cv_linux_sched_struct_task_struct_has_real_parent+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.  */
+#include <linux/sched.h>
+int
+main ()
+{
+struct task_struct _tsk;
+printf("%d\n", _tsk.real_parent);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_sched_struct_task_struct_has_real_parent=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_sched_struct_task_struct_has_real_parent=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_sched_struct_task_struct_has_real_parent" >&5
+echo "${ECHO_T}$ac_cv_linux_sched_struct_task_struct_has_real_parent" >&6
+CPPFLAGS="$save_CPPFLAGS"
+
+echo "$as_me:$LINENO: checking for sig in struct task_struct" >&5
+echo $ECHO_N "checking for sig in struct task_struct... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+if test "${ac_cv_linux_sched_struct_task_struct_has_sig+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.  */
+#include <linux/sched.h>
+int
+main ()
+{
+struct task_struct _tsk;
+printf("%d\n", _tsk.sig);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_sched_struct_task_struct_has_sig=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_sched_struct_task_struct_has_sig=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_sched_struct_task_struct_has_sig" >&5
+echo "${ECHO_T}$ac_cv_linux_sched_struct_task_struct_has_sig" >&6
+CPPFLAGS="$save_CPPFLAGS"
+
+echo "$as_me:$LINENO: checking for sighand in struct task_struct" >&5
+echo $ECHO_N "checking for sighand in struct task_struct... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+if test "${ac_cv_linux_sched_struct_task_struct_has_sighand+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.  */
+#include <linux/sched.h>
+int
+main ()
+{
+struct task_struct _tsk;
+printf("%d\n", _tsk.sighand);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_sched_struct_task_struct_has_sighand=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_sched_struct_task_struct_has_sighand=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_sched_struct_task_struct_has_sighand" >&5
+echo "${ECHO_T}$ac_cv_linux_sched_struct_task_struct_has_sighand" >&6
+CPPFLAGS="$save_CPPFLAGS"
+
+echo "$as_me:$LINENO: checking for sigmask_lock in struct task_struct" >&5
+echo $ECHO_N "checking for sigmask_lock in struct task_struct... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+if test "${ac_cv_linux_sched_struct_task_struct_has_sigmask_lock+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.  */
+#include <linux/sched.h>
+int
+main ()
+{
+struct task_struct _tsk;
+printf("%d\n", _tsk.sigmask_lock);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_sched_struct_task_struct_has_sigmask_lock=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_sched_struct_task_struct_has_sigmask_lock=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_sched_struct_task_struct_has_sigmask_lock" >&5
+echo "${ECHO_T}$ac_cv_linux_sched_struct_task_struct_has_sigmask_lock" >&6
+CPPFLAGS="$save_CPPFLAGS"
+
+if test "x$enable_redhat_buildsys" = "xyes"; then
+  MPS=Default
+else
+  save_CPPFLAGS="$CPPFLAGS"
+  CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $RHCONFIG_SP $CPPFLAGS"
+  echo "$as_me:$LINENO: checking if kernel uses MODVERSIONS" >&5
+echo $ECHO_N "checking if kernel uses MODVERSIONS... $ECHO_C" >&6
+  if test "${ac_cv_linux_config_modversions+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.  */
+#include <linux/version.h>
+#include <linux/config.h>
+
+int
+main ()
+{
+#if !defined(CONFIG_MODVERSIONS)
+lose;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_config_modversions=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_config_modversions=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+  echo "$as_me:$LINENO: result: $ac_cv_linux_config_modversions" >&5
+echo "${ECHO_T}$ac_cv_linux_config_modversions" >&6
+  echo "$as_me:$LINENO: checking which kernel modules to build" >&5
+echo $ECHO_N "checking which kernel modules to build... $ECHO_C" >&6
+  if false; then
+      MPS="MP SP"
+  elif test "x$ac_cv_linux_config_modversions" = "xno" -a "$AFS_SYSKVERS" -lt 26; then
+      MPS="MP SP"
+  else
+  if test "${ac_cv_linux_config_smp+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.  */
+#include <linux/config.h>
+
+int
+main ()
+{
+#ifndef CONFIG_SMP
+lose;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_config_smp=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_config_smp=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+        if test "x$ac_cv_linux_config_smp" = "xyes"; then
+          MPS=MP
+      else
+          MPS=SP
+      fi
+  fi
+  CPPFLAGS=$save_CPPFLAGS
+  echo "$as_me:$LINENO: result: $MPS" >&5
+echo "${ECHO_T}$MPS" >&6
+fi
+
+
+                 if test "x$ac_cv_linux_config_modversions" = "xno" -o $AFS_SYSKVERS -ge 26; then
+                   { echo "$as_me:$LINENO: WARNING: Cannot determine sys_call_table status. assuming it isn't exported" >&5
+echo "$as_me: WARNING: Cannot determine sys_call_table status. assuming it isn't exported" >&2;}
+                   ac_cv_linux_exports_sys_call_table=no
+                  if test -f "$LINUX_KERNEL_PATH/include/asm/ia32_unistd.h"; then
+                    ac_cv_linux_exports_ia32_sys_call_table=yes
+                  fi
+                 else
+
+echo "$as_me:$LINENO: checking for exported init_mm" >&5
+echo $ECHO_N "checking for exported init_mm... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+if test "${ac_cv_linux_exports_init_mm+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.  */
+#include <linux/modversions.h>
+int
+main ()
+{
+#ifndef __ver_init_mm
+#error init_mm not exported
+#endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_exports_init_mm=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_exports_init_mm=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_exports_init_mm" >&5
+echo "${ECHO_T}$ac_cv_linux_exports_init_mm" >&6
+CPPFLAGS="$save_CPPFLAGS"
+
+echo "$as_me:$LINENO: checking for exported kallsyms_address_to_symbol" >&5
+echo $ECHO_N "checking for exported kallsyms_address_to_symbol... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+if test "${ac_cv_linux_exports_kallsyms_address+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.  */
+#include <linux/modversions.h>
+int
+main ()
+{
+#ifndef __ver_kallsyms_address_to_symbol
+#error kallsyms_address_to_symbol not exported
+#endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_exports_kallsyms_address=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_exports_kallsyms_address=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_exports_kallsyms_address" >&5
+echo "${ECHO_T}$ac_cv_linux_exports_kallsyms_address" >&6
+CPPFLAGS="$save_CPPFLAGS"
+
+echo "$as_me:$LINENO: checking for exported kallsyms_symbol_to_address" >&5
+echo $ECHO_N "checking for exported kallsyms_symbol_to_address... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+if test "${ac_cv_linux_exports_kallsyms_symbol+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.  */
+#include <linux/modversions.h>
+int
+main ()
+{
+#ifndef __ver_kallsyms_symbol_to_address
+#error kallsyms_symbol_to_address not exported
+#endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_exports_kallsyms_symbol=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_exports_kallsyms_symbol=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_exports_kallsyms_symbol" >&5
+echo "${ECHO_T}$ac_cv_linux_exports_kallsyms_symbol" >&6
+CPPFLAGS="$save_CPPFLAGS"
+
+echo "$as_me:$LINENO: checking for exported sys_call_table" >&5
+echo $ECHO_N "checking for exported sys_call_table... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+if test "${ac_cv_linux_exports_sys_call_table+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.  */
+#include <linux/modversions.h>
+int
+main ()
+{
+#ifndef __ver_sys_call_table
+#error sys_call_table not exported
+#endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_exports_sys_call_table=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_exports_sys_call_table=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_exports_sys_call_table" >&5
+echo "${ECHO_T}$ac_cv_linux_exports_sys_call_table" >&6
+CPPFLAGS="$save_CPPFLAGS"
+
+echo "$as_me:$LINENO: checking for exported ia32_sys_call_table" >&5
+echo $ECHO_N "checking for exported ia32_sys_call_table... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+if test "${ac_cv_linux_exports_ia32_sys_call_table+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.  */
+#include <linux/modversions.h>
+int
+main ()
+{
+#ifndef __ver_ia32_sys_call_table
+#error ia32_sys_call_table not exported
+#endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_exports_ia32_sys_call_table=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_exports_ia32_sys_call_table=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_exports_ia32_sys_call_table" >&5
+echo "${ECHO_T}$ac_cv_linux_exports_ia32_sys_call_table" >&6
+CPPFLAGS="$save_CPPFLAGS"
+
+echo "$as_me:$LINENO: checking for exported sys_chdir" >&5
+echo $ECHO_N "checking for exported sys_chdir... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+if test "${ac_cv_linux_exports_sys_chdir+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.  */
+#include <linux/modversions.h>
+int
+main ()
+{
+#ifndef __ver_sys_chdir
+#error sys_chdir not exported
+#endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_exports_sys_chdir=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_exports_sys_chdir=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_exports_sys_chdir" >&5
+echo "${ECHO_T}$ac_cv_linux_exports_sys_chdir" >&6
+CPPFLAGS="$save_CPPFLAGS"
+
+echo "$as_me:$LINENO: checking for exported sys_close" >&5
+echo $ECHO_N "checking for exported sys_close... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+if test "${ac_cv_linux_exports_sys_close+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.  */
+#include <linux/modversions.h>
+int
+main ()
+{
+#ifndef __ver_sys_close
+#error sys_close not exported
+#endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_exports_sys_close=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_exports_sys_close=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_exports_sys_close" >&5
+echo "${ECHO_T}$ac_cv_linux_exports_sys_close" >&6
+CPPFLAGS="$save_CPPFLAGS"
+
+echo "$as_me:$LINENO: checking for exported sys_wait4" >&5
+echo $ECHO_N "checking for exported sys_wait4... $ECHO_C" >&6
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+if test "${ac_cv_linux_exports_sys_wait4+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.  */
+#include <linux/modversions.h>
+int
+main ()
+{
+#ifndef __ver_sys_wait4
+#error sys_wait4 not exported
+#endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_linux_exports_sys_wait4=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_linux_exports_sys_wait4=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_linux_exports_sys_wait4" >&5
+echo "${ECHO_T}$ac_cv_linux_exports_sys_wait4" >&6
+CPPFLAGS="$save_CPPFLAGS"
+                   if test "x$ac_cv_linux_exports_sys_call_table" = "xno"; then
+                         linux_syscall_method=none
+                         if test "x$ac_cv_linux_exports_init_mm" = "xyes"; then
+                            linux_syscall_method=scan
+                            if test "x$ac_cv_linux_exports_kallsyms_address" = "xyes"; then
+                               linux_syscall_method=scan_with_kallsyms_address
+                            fi
+                         fi
+                         if test "x$ac_cv_linux_exports_kallsyms_symbol" = "xyes"; then
+                            linux_syscall_method=kallsyms_symbol
+                         fi
+                         if test "x$linux_syscall_method" = "xnone"; then
+                        { { echo "$as_me:$LINENO: error: no available sys_call_table access method" >&5
+echo "$as_me: error: no available sys_call_table access method" >&2;}
+   { (exit 1); exit 1; }; }
+                         fi
+                   fi
+                 fi
+                if test -f "$LINUX_KERNEL_PATH/include/linux/in_systm.h"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_IN_SYSTM_H 1
+_ACEOF
+
+                fi
+                if test -f "$LINUX_KERNEL_PATH/include/linux/mm_inline.h"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_MM_INLINE_H 1
+_ACEOF
+
+                fi
+                if test -f "$LINUX_KERNEL_PATH/include/linux/in_systm.h"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_IN_SYSTM_H 1
+_ACEOF
+
+                fi
+                if test "x$ac_cv_linux_exports_sys_chdir" = "xyes" ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define EXPORTED_SYS_CHDIR 1
+_ACEOF
+
+                fi
+                if test "x$ac_cv_linux_exports_sys_close" = "xyes" ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define EXPORTED_SYS_CLOSE 1
+_ACEOF
+
+                fi
+                if test "x$ac_cv_linux_exports_sys_wait4" = "xyes" ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define EXPORTED_SYS_WAIT4 1
+_ACEOF
+
+                fi
+                if test "x$ac_cv_linux_exports_tasklist_lock" = "xyes" ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define EXPORTED_TASKLIST_LOCK 1
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_linux_is_uml=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-                       if test "${ac_cv_linux_is_uml}" = yes; then
-                        _AFS_SYSNAME=`echo $AFS_SYSNAME|sed s/linux/umlinux/`
-                       fi
-                       CPPFLAGS="$save_CPPFLAGS"
-                       AFS_SYSNAME="$_AFS_SYSNAME"
-                       ;;
-       esac
-        echo "$as_me:$LINENO: result: $AFS_SYSNAME" >&5
-echo "${ECHO_T}$AFS_SYSNAME" >&6
-fi
+                fi
+                 if test "x$ac_cv_linux_exports_sys_call_table" = "xyes"; then
+                  cat >>confdefs.h <<\_ACEOF
+#define EXPORTED_SYS_CALL_TABLE 1
+_ACEOF
+
+                 fi
+                 if test "x$ac_cv_linux_exports_ia32_sys_call_table" = "xyes"; then
+                  cat >>confdefs.h <<\_ACEOF
+#define EXPORTED_IA32_SYS_CALL_TABLE 1
+_ACEOF
+
+                 fi
+                 if test "x$ac_cv_linux_exports_kallsyms_symbol" = "xyes"; then
+                  cat >>confdefs.h <<\_ACEOF
+#define EXPORTED_KALLSYMS_SYMBOL 1
+_ACEOF
+
+                 fi
+                 if test "x$ac_cv_linux_exports_kallsyms_address" = "xyes"; then
+                  cat >>confdefs.h <<\_ACEOF
+#define EXPORTED_KALLSYMS_ADDRESS 1
+_ACEOF
+
+                 fi
+                if test "x$ac_cv_linux_completion_h_exists" = "xyes" ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define COMPLETION_H_EXISTS 1
+_ACEOF
+
+                fi
+                if test "x$ac_cv_linux_defines_for_each_process" = "xyes" ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define DEFINED_FOR_EACH_PROCESS 1
+_ACEOF
+
+                fi
+                if test "x$ac_cv_linux_defines_prev_task" = "xyes" ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define DEFINED_PREV_TASK 1
+_ACEOF
+
+                fi
+                if test "x$ac_cv_linux_func_inode_setattr_returns_int" = "xyes" ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define INODE_SETATTR_NOT_VOID 1
+_ACEOF
+
+                fi
+                if test "x$ac_cv_linux_func_write_inode_returns_int" = "xyes" ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define WRITE_INODE_NOT_VOID 1
+_ACEOF
+
+                fi
+                if test "x$ac_cv_linux_fs_struct_address_space_has_page_lock" = "xyes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK 1
+_ACEOF
+
+                fi
+                if test "x$ac_cv_linux_fs_struct_address_space_has_gfp_mask" = "xyes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STRUCT_ADDRESS_SPACE_HAS_GFP_MASK 1
+_ACEOF
+
+                fi
+                if test "x$ac_cv_linux_fs_struct_inode_has_i_truncate_sem" = "xyes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STRUCT_INODE_HAS_I_TRUNCATE_SEM 1
+_ACEOF
+
+                fi
+                if test "x$ac_cv_linux_fs_struct_inode_has_i_alloc_sem" = "xyes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STRUCT_INODE_HAS_I_ALLOC_SEM 1
+_ACEOF
+
+                fi
+                if test "x$ac_cv_linux_fs_struct_inode_has_i_devices" = "xyes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STRUCT_INODE_HAS_I_DEVICES 1
+_ACEOF
+
+                fi
+                if test "x$ac_cv_linux_fs_struct_inode_has_i_security" = "xyes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STRUCT_INODE_HAS_I_SECURITY 1
+_ACEOF
+
+                fi
+                if test "x$ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers" = "xyes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS 1
+_ACEOF
+
+                fi
+                if test "x$ac_cv_linux_func_recalc_sigpending_takes_void" = "xyes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define RECALC_SIGPENDING_TAKES_VOID 1
+_ACEOF
+
+                fi
+                if test "x$ac_cv_linux_kernel_is_selinux" = "xyes" ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define LINUX_KERNEL_IS_SELINUX 1
+_ACEOF
+
+                fi
+                if test "x$ac_cv_linux_kernel_sock_create_v" = "xyes" ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define LINUX_KERNEL_SOCK_CREATE_V 1
+_ACEOF
+
+                fi
+                if test "x$ac_cv_linux_kernel_page_follow_link" = "xyes" ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_KERNEL_PAGE_FOLLOW_LINK 1
+_ACEOF
+
+                fi
+                if test "x$ac_linux_syscall" = "xyes" ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_KERNEL_LINUX_SYSCALL_H 1
+_ACEOF
+
+                fi
+                if test "x$ac_cv_linux_sched_struct_task_struct_has_parent" = "xyes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STRUCT_TASK_STRUCT_HAS_PARENT 1
+_ACEOF
+
+                fi
+                if test "x$ac_cv_linux_sched_struct_task_struct_has_real_parent" = "xyes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STRUCT_TASK_STRUCT_HAS_REAL_PARENT 1
+_ACEOF
+
+                fi
+                if test "x$ac_cv_linux_sched_struct_task_struct_has_sigmask_lock" = "xyes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STRUCT_TASK_STRUCT_HAS_SIGMASK_LOCK 1
+_ACEOF
+
+                fi
+                if test "x$ac_cv_linux_sched_struct_task_struct_has_sighand" = "xyes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STRUCT_TASK_STRUCT_HAS_SIGHAND 1
+_ACEOF
+
+                fi
+                if test "x$ac_cv_linux_sched_struct_task_struct_has_sig" = "xyes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STRUCT_TASK_STRUCT_HAS_SIG 1
+_ACEOF
+
+                fi
+                :
+               fi
+esac
 
 case $AFS_SYSNAME in
        *_darwin*)
@@ -12259,7 +12758,7 @@ case $AFS_SYSNAME in
                YACC="byacc"
                ;;
 
-       *nbsd20)
+       *nbsd2*)
                LEX="flex -l"
                MT_CFLAGS='${XCFLAGS} -DAFS_PTHREAD_ENV -D_REENTRANT '
                MT_LIBS="-lpthread" # XXX -pthread soon
@@ -12281,7 +12780,7 @@ case $AFS_SYSNAME in
                YACC="bison -y"
                ;;
 
-       ia64_linux24)
+       ia64_linux24|ia64_linux26)
                KERN_OPTMZ=-O2
                LEX="flex -l"
                MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
@@ -12388,6 +12887,26 @@ case $AFS_SYSNAME in
                SHLIB_LINKER="${MT_CC} -shared"
                ;;
 
+       i386_umlinux26)
+               CC="gcc -pipe"
+               CCOBJ="gcc -pipe"
+               MT_CC="gcc -pipe"
+               KERN_OPTMZ=-O2
+               LEX="flex -l"
+               MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
+               MT_LIBS="-lpthread"
+               DBG=-g
+               KERN_DBG=-g
+               LWP_DBG=-g
+               LWP_OPTMZ=-O2
+               OPTMZ=-O2
+               PAM_CFLAGS="-g -O2 -Dlinux -DLINUX_PAM -fPIC"
+               SHLIB_LDFLAGS="-shared -Xlinker -x"
+               TXLIBS="-lncurses"
+               XCFLAGS="-g -O2 -D_LARGEFILE64_SOURCE"
+               SHLIB_LINKER="${MT_CC} -shared"
+               ;;
+
        *_obsd*)
                LEX="flex -l"
                MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
@@ -13792,12 +14311,12 @@ s,@YACC@,$YACC,;t t
 s,@LEX@,$LEX,;t t
 s,@LEXLIB@,$LEXLIB,;t t
 s,@LEX_OUTPUT_ROOT@,$LEX_OUTPUT_ROOT,;t t
+s,@HEADER_RT@,$HEADER_RT,;t t
 s,@P5PLUS_KOPTS@,$P5PLUS_KOPTS,;t t
 s,@LINUX_GCC_KOPTS@,$LINUX_GCC_KOPTS,;t t
 s,@RHCONFIG_SP@,$RHCONFIG_SP,;t t
 s,@RHCONFIG_MP@,$RHCONFIG_MP,;t t
 s,@MPS@,$MPS,;t t
-s,@HEADER_RT@,$HEADER_RT,;t t
 s,@PTHREAD_LIBS@,$PTHREAD_LIBS,;t t
 s,@XBSA_CFLAGS@,$XBSA_CFLAGS,;t t
 s,@HAVE_PAM@,$HAVE_PAM,;t t
index 9cdfec49c95bdf6b3a887f54289fcabfd6613f07..265e6f18b74c4d7687f5fdf63737efb3ee864fe8 100644 (file)
@@ -1,5 +1,5 @@
 AC_INIT(src/libafs/Makefile.common.in)
-AM_INIT_AUTOMAKE(openafs-libafs,1.3.74)
+AM_INIT_AUTOMAKE(openafs-libafs,1.3.77)
 AC_CONFIG_HEADER(src/config/afsconfig.h)
 define(OPENAFS_CONFIGURE_LIBAFS)
 
index 09a744b64bee4ff68077e8ccdd1574b6df7dc964..2098caadec4f7f363a5c7f36df232478ad04cc16 100644 (file)
@@ -1,5 +1,5 @@
 AC_INIT(src/config/stds.h)
-AM_INIT_AUTOMAKE(openafs,1.3.74)
+AM_INIT_AUTOMAKE(openafs,1.3.77)
 AC_CONFIG_HEADER(src/config/afsconfig.h)
 
 AC_PROG_CC
index 0e415134b057eeb2e5ddc5e7ded39720b255d133..805213afa4158898957a248ef03c5ab1f9fd566a 100644 (file)
@@ -1,3 +1,9 @@
+openafs (1.3.77-1) unstable; urgency=low
+
+  * 
+
+ --
+
 openafs (1.3.74-1) experimental; urgency=low
 
   * New upstream version
index 3b757ec6d50d5c989b7a77113ee765c21de3aaa0..d4976d008db99ec5d6a58a345ae24f8778975345 100644 (file)
@@ -127,7 +127,7 @@ $(DLLFILE) : $(DLLOBJS) $(DLLLIBS)
 
 clean::
        $(CD) lang
-       for /f %l in ('dir /B ??_??') do @$(NTLANG) %l $(MAKECMD) /nologo /f NTMakefile clean
+       for /f %l in ('dir /B ??_??') do ( if exist @$(NTLANG) do @$(NTLANG) %l $(MAKECMD) /nologo /f NTMakefile clean )
        $(CD) ..
 
 
index 4797139ece767ad3bc1e630610fcc2e6cfbfff1f..c3be71c5e5e35ee7d7595663d728ed27ff42cd57 100644 (file)
@@ -337,9 +337,9 @@ $(EXEDIR)\unlog.exe: $(OUT)\cunlog.obj $(OUT)\unlog.res $(EXELIBS)
 AFSD_EXEFILE = $(EXEDIR)\afsd.exe
 
 AFSD_SDKLIBS =\
-       largeint.lib \
        netapi32.lib \
-        dnsapi.lib mpr.lib \
+        dnsapi.lib \
+        mpr.lib \
        rpcrt4.lib \
        user32.lib \
         Dbghelp.lib \
@@ -366,7 +366,7 @@ $(AFSD_EXEFILE): $(OUT)\afsd.obj $(AFSDOBJS) $(OUT)\afsd.res  $(RXOBJS) $(AFSD_E
 
 # afsd_service.exe
 $(EXEDIR)\afsd_service.exe: $(OUT)\afsd_service.obj $(AFSDOBJS) $(OUT)\afsd_service.res  $(RXOBJS) $(AFSD_EXELIBS)
-       $(EXECONLINK) $(AFSD_SDKLIBS) /MAP 
+       $(EXECONLINK) $(AFSD_SDKLIBS) /MAP /LARGEADDRESSAWARE
        $(EXEPREP)
 
 # fs.exe
index 1e3a7571ea2851952607d76d08fcdc1e66079697..495e2ba14f96d44a96cdd4cb24d46afb0820becb 100644 (file)
@@ -62,6 +62,7 @@ BOOL APIENTRY About(HWND, unsigned int, unsigned int, long);
 #include "cm_buf.h"
 #include "cm_freelance.h"
 #include "smb_ioctl.h"
+#include "afsd_init.h"
 #ifdef DJGPP
 #include "afs/afsmsg95.h"
 #endif
index 8c3456849b8eefdd02d1256e8dcbd10adbd9da98..ae625b85e8ea1c2fe8b4821df8785186305019db 100644 (file)
@@ -16,6 +16,8 @@
 #include <nb30.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <locale.h>
+#include <mbctype.h>
 #include <winsock2.h>
 
 #include <osi.h>
@@ -37,6 +39,8 @@ extern afs_int32 cryptall;
 
 char AFSConfigKeyName[] =
        "SYSTEM\\CurrentControlSet\\Services\\TransarcAFSDaemon\\Parameters";
+char OpenAFSConfigKeyName[] =
+       "SOFTWARE\\OpenAFS\\Client";
 
 osi_log_t *afsd_logp;
 
@@ -99,25 +103,52 @@ HANDLE afsi_file;
 int cm_dnsEnabled = 1;
 #endif
 
+
+static int afsi_log_useTimestamp = 1;
+
+void
+afsi_log(char *pattern, ...)
+{
+    char s[256], t[100], d[100], u[512];
+    DWORD zilch;
+    va_list ap;
+    va_start(ap, pattern);
+
+    StringCbVPrintfA(s, sizeof(s), pattern, ap);
+    if ( afsi_log_useTimestamp ) {
+        GetTimeFormat(LOCALE_SYSTEM_DEFAULT, 0, NULL, NULL, t, sizeof(t));
+        GetDateFormat(LOCALE_SYSTEM_DEFAULT, 0, NULL, NULL, d, sizeof(d));
+        StringCbPrintfA(u, sizeof(u), "%s %s: %s\n", d, t, s);
+        if (afsi_file != INVALID_HANDLE_VALUE)
+            WriteFile(afsi_file, u, strlen(u), &zilch, NULL);
+#ifdef NOTSERVICE
+        printf("%s", u);
+#endif 
+    } else {
+        if (afsi_file != INVALID_HANDLE_VALUE)
+            WriteFile(afsi_file, s, strlen(s), &zilch, NULL);
+    }
+}
+
 extern initUpperCaseTable();
 void afsd_initUpperCaseTable() 
 {
-       initUpperCaseTable();
+    initUpperCaseTable();
 }
 
 void
 afsi_start()
 {
-       char wd[100];
-       char t[100], u[100], *p, *path;
-       int zilch;
-       int code;
+    char wd[100];
+    char t[100], u[100], *p, *path;
+    int zilch;
+    int code;
     DWORD dwLow, dwHigh;
-       HKEY parmKey;
-       DWORD dummyLen;
+    HKEY parmKey;
+    DWORD dummyLen;
     DWORD maxLogSize = 100 * 1024;
 
-       afsi_file = INVALID_HANDLE_VALUE;
+    afsi_file = INVALID_HANDLE_VALUE;
     if (getenv("TEMP"))
     {
         StringCbCopyA(wd, sizeof(wd), getenv("TEMP"));
@@ -125,21 +156,22 @@ afsi_start()
     else
     {
         code = GetWindowsDirectory(wd, sizeof(wd));
-        if (code == 0) return;
+        if (code == 0) 
+            return;
     }
-       StringCbCatA(wd, sizeof(wd), "\\afsd_init.log");
-       GetTimeFormat(LOCALE_SYSTEM_DEFAULT, 0, NULL, NULL, t, sizeof(t));
-       afsi_file = CreateFile(wd, GENERIC_WRITE, FILE_SHARE_READ, NULL,
+    StringCbCatA(wd, sizeof(wd), "\\afsd_init.log");
+    GetTimeFormat(LOCALE_SYSTEM_DEFAULT, 0, NULL, NULL, t, sizeof(t));
+    afsi_file = CreateFile(wd, GENERIC_WRITE, FILE_SHARE_READ, NULL,
                            OPEN_ALWAYS, FILE_FLAG_WRITE_THROUGH, NULL);
 
     code = RegOpenKeyEx(HKEY_LOCAL_MACHINE, AFSConfigKeyName,
                          0, KEY_QUERY_VALUE, &parmKey);
-       if (code == ERROR_SUCCESS) {
+    if (code == ERROR_SUCCESS) {
         dummyLen = sizeof(maxLogSize);
         code = RegQueryValueEx(parmKey, "MaxLogSize", NULL, NULL,
                                 (BYTE *) &maxLogSize, &dummyLen);
         RegCloseKey (parmKey);
-       }
+    }
 
     if (maxLogSize) {
         dwLow = GetFileSize( afsi_file, &dwHigh );
@@ -151,42 +183,30 @@ afsi_start()
     }
 
     SetFilePointer(afsi_file, 0, NULL, FILE_END);
-       GetTimeFormat(LOCALE_SYSTEM_DEFAULT, 0, NULL, NULL, u, sizeof(u));
-       StringCbCatA(t, sizeof(t), ": Create log file\n");
-       StringCbCatA(u, sizeof(u), ": Created log file\n");
-       WriteFile(afsi_file, t, strlen(t), &zilch, NULL);
-       WriteFile(afsi_file, u, strlen(u), &zilch, NULL);
+    GetTimeFormat(LOCALE_SYSTEM_DEFAULT, 0, NULL, NULL, u, sizeof(u));
+    StringCbCatA(t, sizeof(t), ": Create log file\n");
+    StringCbCatA(u, sizeof(u), ": Created log file\n");
+    WriteFile(afsi_file, t, strlen(t), &zilch, NULL);
+    WriteFile(afsi_file, u, strlen(u), &zilch, NULL);
     p = "PATH=";
     path = getenv("PATH");
-       WriteFile(afsi_file, p, strlen(p), &zilch, NULL);
-       WriteFile(afsi_file, path, strlen(path), &zilch, NULL);
-       WriteFile(afsi_file, "\n", 1, &zilch, NULL);
-}
-
-static int afsi_log_useTimestamp = 1;
-
-void
-afsi_log(char *pattern, ...)
-{
-       char s[256], t[100], d[100], u[512];
-       int zilch;
-       va_list ap;
-       va_start(ap, pattern);
-
-       StringCbVPrintfA(s, sizeof(s), pattern, ap);
-    if ( afsi_log_useTimestamp ) {
-        GetTimeFormat(LOCALE_SYSTEM_DEFAULT, 0, NULL, NULL, t, sizeof(t));
-               GetDateFormat(LOCALE_SYSTEM_DEFAULT, 0, NULL, NULL, d, sizeof(d));
-               StringCbPrintfA(u, sizeof(u), "%s %s: %s\n", d, t, s);
-        if (afsi_file != INVALID_HANDLE_VALUE)
-            WriteFile(afsi_file, u, strlen(u), &zilch, NULL);
-#ifdef NOTSERVICE
-        printf("%s", u);
-#endif 
-    } else {
-        if (afsi_file != INVALID_HANDLE_VALUE)
-            WriteFile(afsi_file, s, strlen(s), &zilch, NULL);
-    }
+    WriteFile(afsi_file, p, strlen(p), &zilch, NULL);
+    WriteFile(afsi_file, path, strlen(path), &zilch, NULL);
+    WriteFile(afsi_file, "\n", 1, &zilch, NULL);
+
+    /* Initialize C RTL Code Page conversion functions */
+    /* All of the path info obtained from the SMB client is in the OEM code page */
+    afsi_log("OEM Code Page = %d", GetOEMCP());
+    afsi_log("locale =  %s", setlocale(LC_ALL,NULL));
+#ifdef COMMENT
+    /* Two things to look into.  First, should mbstowcs() be performing 
+     * character set translations from OEM to Unicode in smb3.c; 
+     * Second, do we need to set this translation in each function 
+     * due to multi-threading. 
+     */
+    afsi_log("locale -> %s", setlocale(LC_ALL, ".OCP"));
+    afsi_log("_setmbcp = %d -> %d", _setmbcp(_MB_CP_OEM), _getmbcp());
+#endif /* COMMENT */
 }
 
 /*
@@ -195,25 +215,25 @@ afsi_log(char *pattern, ...)
 
 void afsd_ForceTrace(BOOL flush)
 {
-       HANDLE handle;
-       int len;
-       char buf[256];
+    HANDLE handle;
+    int len;
+    char buf[256];
 
-       if (!logReady) 
+    if (!logReady) 
         return;
 
-       len = GetTempPath(sizeof(buf)-10, buf);
-       StringCbCopyA(&buf[len], sizeof(buf)-len, "/afsd.log");
-       handle = CreateFile(buf, GENERIC_WRITE, FILE_SHARE_READ,
-                           NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
-       if (handle == INVALID_HANDLE_VALUE) {
-               logReady = 0;
-               osi_panic("Cannot create log file", __FILE__, __LINE__);
-       }
-       osi_LogPrint(afsd_logp, handle);
-       if (flush)
-               FlushFileBuffers(handle);
-       CloseHandle(handle);
+    len = GetTempPath(sizeof(buf)-10, buf);
+    StringCbCopyA(&buf[len], sizeof(buf)-len, "/afsd.log");
+    handle = CreateFile(buf, GENERIC_WRITE, FILE_SHARE_READ,
+                         NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+    if (handle == INVALID_HANDLE_VALUE) {
+        logReady = 0;
+        osi_panic("Cannot create log file", __FILE__, __LINE__);
+    }
+    osi_LogPrint(afsd_logp, handle);
+    if (flush)
+        FlushFileBuffers(handle);
+    CloseHandle(handle);
 }
 
 static void
@@ -250,7 +270,7 @@ configureBackConnectionHostNames(void)
     DWORD dwType;
     DWORD dwSize;
     DWORD dwValue;
-    PBYTE pHostNames = NULL, pName;
+    PBYTE pHostNames = NULL, pName = NULL;
     BOOL  bNameFound = FALSE;   
 
     if ( RegOpenKeyEx( HKEY_LOCAL_MACHINE, 
@@ -273,12 +293,14 @@ configureBackConnectionHostNames(void)
         }
              
         if ( !bNameFound ) {
+            int size = strlen(cm_NetbiosName) + 2;
             if ( !pHostNames ) {
-                pName = pHostNames = malloc(strlen(cm_NetbiosName) + 2);
+                pHostNames = malloc(size);
                 dwSize = 1;
             }
-            strcpy(pName, cm_NetbiosName);
-            pName += strlen(cm_NetbiosName) + 1;
+            pName = pHostNames;
+            StringCbCopyA(pName, size, cm_NetbiosName);
+            pName += size - 1;
             *pName = '\0';  /* add a second nul terminator */
 
             dwType = REG_MULTI_SZ;
@@ -971,12 +993,12 @@ int afsd_InitCM(char **reasonP)
 
 int afsd_InitDaemons(char **reasonP)
 {
-       long code;
-       cm_req_t req;
+    long code;
+    cm_req_t req;
 
-       cm_InitReq(&req);
+    cm_InitReq(&req);
 
-       /* this should really be in an init daemon from here on down */
+    /* this should really be in an init daemon from here on down */
 
     if (!cm_freelanceEnabled) {
                osi_Log0(afsd_logp, "Loading Root Volume from cell");
@@ -990,39 +1012,55 @@ int afsd_InitDaemons(char **reasonP)
         }
     }
 
-       /* compute the root fid */
-       if (!cm_freelanceEnabled) {
+    /* compute the root fid */
+    if (!cm_freelanceEnabled) {
         cm_rootFid.cell = cm_rootCellp->cellID;
         cm_rootFid.volume = cm_GetROVolumeID(cm_rootVolumep);
         cm_rootFid.vnode = 1;
         cm_rootFid.unique = 1;
-       }
-       else
+    }
+    else
         cm_FakeRootFid(&cm_rootFid);
         
     code = cm_GetSCache(&cm_rootFid, &cm_rootSCachep, cm_rootUserp, &req);
-       afsi_log("cm_GetSCache code %x scache %x", code,
+    afsi_log("cm_GetSCache code %x scache %x", code,
              (code ? (cm_scache_t *)-1 : cm_rootSCachep));
-       if (code != 0) {
-               *reasonP = "unknown error";
-               return -1;
-       }
+    if (code != 0) {
+        *reasonP = "unknown error";
+        return -1;
+    }
 
-       cm_InitDaemon(numBkgD);
-       afsi_log("cm_InitDaemon");
+    cm_InitDaemon(numBkgD);
+    afsi_log("cm_InitDaemon");
 
-       return 0;
+    return 0;
 }
 
 int afsd_InitSMB(char **reasonP, void *aMBfunc)
 {
-       /* Do this last so that we don't handle requests before init is done.
+    HKEY parmKey;
+    DWORD dummyLen;
+    DWORD dwValue;
+    DWORD code;
+
+    code = RegOpenKeyEx(HKEY_LOCAL_MACHINE, OpenAFSConfigKeyName,
+                         0, KEY_QUERY_VALUE, &parmKey);
+    if (code == ERROR_SUCCESS) {
+        dummyLen = sizeof(DWORD);
+        code = RegQueryValueEx(parmKey, "StoreAnsiFilenames", NULL, NULL,
+                                (BYTE *) &dwValue, &dummyLen);
+        if (code == ERROR_SUCCESS)
+            smb_StoreAnsiFilenames = dwValue ? 1 : 0;
+        RegCloseKey (parmKey);
+    }
+
+    /* Do this last so that we don't handle requests before init is done.
      * Here we initialize the SMB listener.
      */
     smb_Init(afsd_logp, cm_NetbiosName, smb_UseV3, LANadapter, numSvThreads, aMBfunc);
-    afsi_log("smb_Init");
+    afsi_log("smb_Init complete");
 
-       return 0;
+    return 0;
 }
 
 #ifdef ReadOnly
index d9236c3dddb2557b4aa3a66f06a54b00434258f5..0df35f782a5ffa8634fc79bd9b8e61b9bd5ca382 100644 (file)
@@ -11,6 +11,9 @@
 #include <afs/stds.h>
 
 #include <windows.h>
+#include <softpub.h>
+#include <psapi.h>
+#include <winerror.h>
 #include <string.h>
 #include <setjmp.h>
 #include "afsd.h"
@@ -41,6 +44,9 @@
 
 extern void afsi_log(char *pattern, ...);
 
+static SERVICE_STATUS          ServiceStatus;
+static SERVICE_STATUS_HANDLE   StatusHandle;
+
 HANDLE hAFSDMainThread = NULL;
 
 HANDLE WaitToTerminate;
@@ -93,16 +99,25 @@ static void afsd_notifier(char *msgp, char *filep, long line)
     smb_DumpVCP(afsi_file, "a");                       
     afsi_log("--- end   dump ---");
     
+#ifdef DEBUG
     DebugBreak();      
+#endif
 
     SetEvent(WaitToTerminate);
 
 #ifdef JUMP
     if (GetCurrentThreadId() == MainThreadId)
         longjmp(notifier_jmp, 1);
-    else
 #endif /* JUMP */
-        ExitThread(1);
+
+    ServiceStatus.dwCurrentState = SERVICE_STOPPED;
+    ServiceStatus.dwWin32ExitCode = NO_ERROR;
+    ServiceStatus.dwCheckPoint = 0;
+    ServiceStatus.dwWaitHint = 0;
+    ServiceStatus.dwControlsAccepted = 0;
+    SetServiceStatus(StatusHandle, &ServiceStatus);
+
+    exit(1);
 }
 
 /*
@@ -113,9 +128,6 @@ static int _stdcall DummyMessageBox(HWND h, LPCTSTR l1, LPCTSTR l2, UINT ui)
     return 0;
 }
 
-static SERVICE_STATUS          ServiceStatus;
-static SERVICE_STATUS_HANDLE   StatusHandle;
-
 DWORD
 afsd_ServiceFlushVolume(DWORD dwlpEventData)
 {
@@ -421,6 +433,525 @@ static void DismountGlobalDrives()
     RegCloseKey(hKey);
 }
 
+DWORD
+GetVersionInfo( CHAR * filename, CHAR * szOutput, DWORD dwOutput )
+{
+    DWORD dwVersionHandle;
+    LPVOID pVersionInfo = 0;
+    DWORD retval = 0;
+    LPDWORD pLangInfo = 0;
+    LPTSTR szVersion = 0;
+    UINT len = 0;
+    TCHAR szVerQ[] = TEXT("\\StringFileInfo\\12345678\\FileVersion");
+    DWORD size = GetFileVersionInfoSize(filename, &dwVersionHandle);
+
+    if (!size) {
+        afsi_log("GetFileVersionInfoSize failed");
+        return GetLastError();
+    }
+
+    pVersionInfo = malloc(size);
+    if (!pVersionInfo) {
+        afsi_log("out of memory 1");
+        return ERROR_NOT_ENOUGH_MEMORY;
+    }
+
+    GetFileVersionInfo(filename, dwVersionHandle, size, pVersionInfo);
+    if (retval = GetLastError())
+    {
+        afsi_log("GetFileVersionInfo failed: %d", retval);
+        goto cleanup;
+    }
+
+    VerQueryValue(pVersionInfo, TEXT("\\VarFileInfo\\Translation"),
+                       (LPVOID*)&pLangInfo, &len);
+    if (retval = GetLastError())
+    {
+        afsi_log("VerQueryValue 1 failed: %d", retval);
+        goto cleanup;
+    }
+
+    wsprintf(szVerQ,
+             TEXT("\\StringFileInfo\\%04x%04x\\FileVersion"),
+             LOWORD(*pLangInfo), HIWORD(*pLangInfo));
+
+    VerQueryValue(pVersionInfo, szVerQ, (LPVOID*)&szVersion, &len);
+    if (retval = GetLastError())
+    {
+        /* try again with language 409 since the old binaries were tagged wrong */
+        wsprintf(szVerQ,
+                  TEXT("\\StringFileInfo\\0409%04x\\FileVersion"),
+                  HIWORD(*pLangInfo));
+
+        VerQueryValue(pVersionInfo, szVerQ, (LPVOID*)&szVersion, &len);
+        if (retval = GetLastError()) {
+            afsi_log("VerQueryValue 2 failed: [%s] %d", szVerQ, retval);
+            goto cleanup;
+        }
+    }
+    snprintf(szOutput, dwOutput, TEXT("%s"), szVersion);
+    szOutput[dwOutput - 1] = 0;
+
+ cleanup:
+    if (pVersionInfo)
+        free(pVersionInfo);
+
+    return retval;
+}
+
+static HINSTANCE hCrypt32;
+static DWORD (WINAPI *pCertGetNameString)(PCCERT_CONTEXT pCertContext,  DWORD dwType,  DWORD dwFlags,
+                                          void* pvTypePara, LPTSTR pszNameString, DWORD cchNameString);
+static BOOL (WINAPI *pCryptQueryObject)(DWORD dwObjectType, const void* pvObject, DWORD dwExpectedContentTypeFlags,
+                                        DWORD dwExpectedFormatTypeFlags, DWORD dwFlags,
+                                        DWORD* pdwMsgAndCertEncodingType, DWORD* pdwContentType,
+                                        DWORD* pdwFormatType, HCERTSTORE* phCertStore,
+                                        HCRYPTMSG* phMsg, const void** ppvContext);
+static BOOL (WINAPI *pCryptMsgGetParam)(HCRYPTMSG hCryptMsg, DWORD dwParamType, DWORD dwIndex,
+                                        void* pvData, DWORD* pcbData);
+static PCCERT_CONTEXT (WINAPI *pCertFindCertificateInStore)(HCERTSTORE hCertStore, DWORD dwCertEncodingType,
+                                                            DWORD dwFindFlags, DWORD dwFindType,
+                                                            const void* pvFindPara,
+                                                            PCCERT_CONTEXT pPrevCertContext);
+static BOOL (WINAPI *pCertCloseStore)(HCERTSTORE hCertStore, DWORD dwFlags);
+static BOOL (WINAPI *pCryptMsgClose)(HCRYPTMSG hCryptMsg);
+static BOOL (WINAPI *pCertCompareCertificate)(DWORD dwCertEncodingType, PCERT_INFO pCertId1,
+                                              PCERT_INFO pCertId2);
+static BOOL (WINAPI *pCertFreeCertificateContext)(PCCERT_CONTEXT pCertContext);
+
+void LoadCrypt32(void)
+{
+    hCrypt32 = LoadLibrary("crypt32");
+    if ( !hCrypt32 )
+        return;
+
+    (FARPROC) pCertGetNameString = GetProcAddress( hCrypt32, "CertGetNameString" );
+    (FARPROC) pCryptQueryObject = GetProcAddress( hCrypt32, "CryptQueryObject" );
+    (FARPROC) pCryptMsgGetParam = GetProcAddress( hCrypt32, "CryptMsgGetParam" );
+    (FARPROC) pCertFindCertificateInStore = GetProcAddress( hCrypt32, "CertFindCertificateInStore" );
+    (FARPROC) pCertCloseStore = GetProcAddress( hCrypt32, "CertCloseStore" );
+    (FARPROC) pCryptMsgClose = GetProcAddress( hCrypt32, "CryptMsgClose" );
+    (FARPROC) pCertCompareCertificate = GetProcAddress( hCrypt32, "CertCompareCertificate" );
+    (FARPROC) pCertFreeCertificateContext = GetProcAddress( hCrypt32, "CertFreeCertificateContext" );
+    
+    if ( !pCertGetNameString ||
+         !pCryptQueryObject ||
+         !pCryptMsgGetParam ||
+         !pCertFindCertificateInStore ||
+         !pCertCloseStore ||
+         !pCryptMsgClose ||
+         !pCertCompareCertificate ||
+         !pCertFreeCertificateContext)
+    {
+        FreeLibrary(hCrypt32);
+        hCrypt32 = NULL;
+    }
+}
+
+void UnloadCrypt32(void)
+{
+    FreeLibrary(hCrypt32);
+}
+
+#define ENCODING (X509_ASN_ENCODING | PKCS_7_ASN_ENCODING)
+
+PCCERT_CONTEXT GetCertCtx(CHAR * filename)
+{
+    wchar_t wfilename[260];
+    BOOL fResult;
+    DWORD dwEncoding;
+    DWORD dwContentType;
+    DWORD dwFormatType;
+    DWORD dwSignerInfo;
+    HCERTSTORE hStore = NULL;
+    HCRYPTMSG hMsg = NULL;
+    PCMSG_SIGNER_INFO pSignerInfo = NULL;
+    PCCERT_CONTEXT pCertContext = NULL;
+    CERT_INFO CertInfo;
+
+    if ( hCrypt32 == NULL )
+        return NULL;
+
+    ZeroMemory(&CertInfo, sizeof(CertInfo));
+    mbstowcs(wfilename, filename, 260);
+
+    fResult = pCryptQueryObject(CERT_QUERY_OBJECT_FILE,
+                               wfilename,
+                               CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED_EMBED,
+                               CERT_QUERY_FORMAT_FLAG_BINARY,
+                               0,
+                               &dwEncoding,
+                               &dwContentType,
+                               &dwFormatType,
+                               &hStore,
+                               &hMsg,
+                               NULL);
+
+    if (!fResult) {
+        afsi_log("CryptQueryObject failed for [%s] with error 0x%x",
+                filename,
+                GetLastError());
+       goto __exit;
+    }
+
+    fResult = pCryptMsgGetParam(hMsg,
+                               CMSG_SIGNER_INFO_PARAM,
+                               0,
+                               NULL,
+                               &dwSignerInfo);
+
+    if (!fResult) {
+        afsi_log("CryptMsgGetParam failed for [%s] with error 0x%x",
+                filename,
+                GetLastError());
+       goto __exit;
+    }
+
+    pSignerInfo = (PCMSG_SIGNER_INFO)LocalAlloc(LPTR, dwSignerInfo);
+
+    fResult = pCryptMsgGetParam(hMsg,
+                               CMSG_SIGNER_INFO_PARAM,
+                               0,
+                               (PVOID)pSignerInfo,
+                               &dwSignerInfo);
+    
+    if (!fResult) {
+        afsi_log("CryptMsgGetParam failed for [%s] with error 0x%x",
+                filename,
+                GetLastError());
+       goto __exit;
+    }
+
+    CertInfo.Issuer = pSignerInfo->Issuer;
+    CertInfo.SerialNumber = pSignerInfo->SerialNumber;
+
+    pCertContext = pCertFindCertificateInStore(hStore,
+                                             ENCODING,
+                                             0,
+                                             CERT_FIND_SUBJECT_CERT,
+                                             (PVOID) &CertInfo,
+                                             NULL);
+
+    if (!pCertContext) {
+      afsi_log("CertFindCertificateInStore for file [%s] failed with 0x%x",
+              filename,
+              GetLastError());
+      goto __exit;
+    }
+
+  __exit:
+    if (pSignerInfo)
+      LocalFree(pSignerInfo);
+
+    /*    if (pCertContext)
+         CertFreeCertificateContext(pCertContext);*/
+
+    if (hStore)
+      pCertCloseStore(hStore,0);
+
+    if (hMsg)
+      pCryptMsgClose(hMsg);
+
+    return pCertContext;
+}
+
+BOOL VerifyTrust(CHAR * filename)
+{
+    WIN_TRUST_ACTDATA_CONTEXT_WITH_SUBJECT fContextWSubject;
+    WIN_TRUST_SUBJECT_FILE fSubjectFile;
+    GUID trustAction = WIN_SPUB_ACTION_PUBLISHED_SOFTWARE;
+    GUID subject = WIN_TRUST_SUBJTYPE_PE_IMAGE;
+    wchar_t wfilename[260];
+    LONG ret;
+    BOOL success = FALSE;
+
+    LONG (WINAPI *pWinVerifyTrust)(HWND hWnd, GUID* pgActionID, WINTRUST_DATA* pWinTrustData) = NULL;
+    HINSTANCE hWinTrust;
+
+    if (filename == NULL ) 
+        return FALSE;
+
+    hWinTrust = LoadLibrary("wintrust");
+    if ( !hWinTrust )
+        return FALSE;
+
+    if (((FARPROC) pWinVerifyTrust =
+          GetProcAddress( hWinTrust, "WinVerifyTrust" )) == NULL )
+    {
+        FreeLibrary(hWinTrust);
+        return FALSE;
+    }
+
+    mbstowcs(wfilename, filename, 260);
+
+    fSubjectFile.hFile = CreateFile(filename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING,
+                                    0, NULL);
+    fSubjectFile.lpPath = wfilename;
+    fContextWSubject.hClientToken = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ,
+                                                FALSE, GetCurrentProcessId());
+    fContextWSubject.SubjectType = &subject;
+    fContextWSubject.Subject = &fSubjectFile;
+
+    ret = pWinVerifyTrust(INVALID_HANDLE_VALUE, &trustAction, (WINTRUST_DATA *)&fContextWSubject);
+
+    if ( fSubjectFile.hFile != INVALID_HANDLE_VALUE )
+        CloseHandle( fSubjectFile.hFile );
+    if ( fContextWSubject.hClientToken != INVALID_HANDLE_VALUE )
+        CloseHandle( fContextWSubject.hClientToken );
+
+    if (ret == ERROR_SUCCESS) {
+        success = TRUE;
+    } else {
+        DWORD gle = GetLastError();
+        switch (gle) {
+        case TRUST_E_PROVIDER_UNKNOWN:
+            afsi_log("VerifyTrust failed: \"Generic Verify V2\" Provider Unknown");
+            break;  
+        case TRUST_E_NOSIGNATURE:
+            afsi_log("VerifyTrust failed: Unsigned executable");
+            break;
+        case TRUST_E_EXPLICIT_DISTRUST:
+            afsi_log("VerifyTrust failed: Certificate Marked as Untrusted by the user");
+            break;
+        case TRUST_E_SUBJECT_NOT_TRUSTED:
+            afsi_log("VerifyTrust failed: File is not trusted");
+            break;
+        case TRUST_E_BAD_DIGEST:
+            afsi_log("VerifyTrust failed: Executable has been modified");
+            break;
+        case CRYPT_E_SECURITY_SETTINGS:
+            afsi_log("VerifyTrust failed: local security options prevent verification");
+            break;
+        default:
+            afsi_log("VerifyTrust failed: 0x%X", GetLastError());
+        }
+        success = FALSE;
+    }
+    FreeLibrary(hWinTrust);
+    return success;
+}
+
+void LogCertCtx(PCCERT_CONTEXT pCtx) {
+    DWORD dwData;
+    LPTSTR szName = NULL;
+
+    if ( hCrypt32 == NULL )
+        return;
+
+    // Get Issuer name size.
+    if (!(dwData = pCertGetNameString(pCtx,
+                                     CERT_NAME_SIMPLE_DISPLAY_TYPE,
+                                     CERT_NAME_ISSUER_FLAG,
+                                     NULL,
+                                     NULL,
+                                     0))) {
+        afsi_log("CertGetNameString failed: 0x%x", GetLastError());
+       goto __exit;
+    }
+
+    // Allocate memory for Issuer name.
+    szName = (LPTSTR)LocalAlloc(LPTR, dwData * sizeof(TCHAR));
+
+    // Get Issuer name.
+    if (!(pCertGetNameString(pCtx,
+                            CERT_NAME_SIMPLE_DISPLAY_TYPE,
+                            CERT_NAME_ISSUER_FLAG,
+                            NULL,
+                            szName,
+                            dwData))) {
+        afsi_log("CertGetNameString failed: 0x%x", GetLastError());
+       goto __exit;
+    }
+
+    // print Issuer name.
+    afsi_log("Issuer Name: %s", szName);
+    LocalFree(szName);
+    szName = NULL;
+
+    // Get Subject name size.
+    if (!(dwData = pCertGetNameString(pCtx,
+                                     CERT_NAME_SIMPLE_DISPLAY_TYPE,
+                                     0,
+                                     NULL,
+                                     NULL,
+                                     0))) {
+        afsi_log("CertGetNameString failed: 0x%x", GetLastError());
+       goto __exit;
+    }
+
+    // Allocate memory for subject name.
+    szName = (LPTSTR)LocalAlloc(LPTR, dwData * sizeof(TCHAR));
+
+    // Get subject name.
+    if (!(pCertGetNameString(pCtx,
+                            CERT_NAME_SIMPLE_DISPLAY_TYPE,
+                            0,
+                            NULL,
+                            szName,
+                            dwData))) {
+        afsi_log("CertGetNameString failed: 0x%x", GetLastError());
+       goto __exit;
+    }
+
+    // Print Subject Name.
+    afsi_log("Subject Name: %s", szName);
+
+  __exit:
+
+    if (szName)
+        LocalFree(szName);
+}
+
+BOOL AFSModulesVerify(void)
+{
+    CHAR filename[1024];
+    CHAR afsdVersion[128];
+    CHAR modVersion[128];
+    CHAR checkName[1024];
+    BOOL trustVerified = FALSE;
+    HMODULE hMods[1024];
+    HANDLE hProcess;
+    DWORD cbNeeded;
+    unsigned int i;
+    BOOL success = TRUE;
+    PCCERT_CONTEXT pCtxService = NULL;
+    HINSTANCE hPSAPI;
+    DWORD (WINAPI *pGetModuleFileNameExA)(HANDLE hProcess, HMODULE hModule, LPTSTR lpFilename, DWORD nSize);
+    BOOL (WINAPI *pEnumProcessModules)(HANDLE hProcess, HMODULE* lphModule, DWORD cb, LPDWORD lpcbNeeded);
+    DWORD dummyLen, code;
+    DWORD cacheSize = CM_CONFIGDEFAULT_CACHESIZE;
+    DWORD verifyServiceSig = TRUE;
+    HKEY parmKey;
+
+    hPSAPI = LoadLibrary("psapi");
+
+    if ( hPSAPI == NULL )
+        return FALSE;
+
+    if (!GetModuleFileName(NULL, filename, sizeof(filename)))
+        return FALSE;
+
+    if (GetVersionInfo(filename, afsdVersion, sizeof(afsdVersion)))
+        return FALSE;
+
+    afsi_log("%s version %s", filename, afsdVersion);
+
+    if (((FARPROC) pGetModuleFileNameExA =
+          GetProcAddress( hPSAPI, "GetModuleFileNameExA" )) == NULL ||
+         ((FARPROC) pEnumProcessModules =
+           GetProcAddress( hPSAPI, "EnumProcessModules" )) == NULL)
+    {
+        FreeLibrary(hPSAPI);
+        return FALSE;
+    }
+
+
+    code = RegOpenKeyEx(HKEY_LOCAL_MACHINE, 
+                        "SYSTEM\\CurrentControlSet\\Services\\TransarcAFSDaemon\\Parameters",
+                        0, KEY_QUERY_VALUE, &parmKey);
+    if (code == ERROR_SUCCESS) {
+        dummyLen = sizeof(cacheSize);
+        code = RegQueryValueEx(parmKey, "CacheSize", NULL, NULL,
+                               (BYTE *) &cacheSize, &dummyLen);
+        RegCloseKey (parmKey);
+    }
+
+    code = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\OpenAFS\\Client",
+                         0, KEY_QUERY_VALUE, &parmKey);
+    if (code == ERROR_SUCCESS) {
+        dummyLen = sizeof(verifyServiceSig);
+        code = RegQueryValueEx(parmKey, "VerifyServiceSignature", NULL, NULL,
+                                (BYTE *) &verifyServiceSig, &dummyLen);
+        RegCloseKey (parmKey);
+    }
+
+    if (verifyServiceSig && cacheSize < 716800) {
+        trustVerified = VerifyTrust(filename);
+    } else {
+        afsi_log("Signature Verification disabled");
+    }
+
+    if (trustVerified) {
+        LoadCrypt32();
+
+        // get a certificate context for the signer of afsd_service.
+        pCtxService = GetCertCtx(filename);
+        if (pCtxService)
+            LogCertCtx(pCtxService);
+    }
+
+    // Get a list of all the modules in this process.
+    hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ,
+                           FALSE, GetCurrentProcessId());
+
+    if (pEnumProcessModules(hProcess, hMods, sizeof(hMods), &cbNeeded))
+    {
+        afsi_log("Num of Process Modules: %d", (cbNeeded / sizeof(HMODULE)));
+
+        for (i = 0; i < (cbNeeded / sizeof(HMODULE)); i++)
+        {
+            char szModName[2048];
+
+            // Get the full path to the module's file.
+            if (pGetModuleFileNameExA(hProcess, hMods[i], szModName, sizeof(szModName)))
+            {
+                lstrcpy(checkName, szModName);
+                strlwr(checkName);
+
+                if ( strstr(checkName, "afspthread.dll") ||
+                     strstr(checkName, "afsauthent.dll") ||
+                     strstr(checkName, "afsrpc.dll") ||
+                     strstr(checkName, "libafsconf.dll") ||
+                     strstr(checkName, "libosi.dll") )
+                {
+                    if (GetVersionInfo(szModName, modVersion, sizeof(modVersion))) {
+                        success = FALSE;
+                        continue;
+                    }
+
+                    afsi_log("%s version %s", szModName, modVersion);
+                    if (strcmp(afsdVersion,modVersion)) {
+                        afsi_log("Version mismatch: %s", szModName);
+                        success = FALSE;
+                    }
+                    if ( trustVerified ) {
+                        if ( !VerifyTrust(szModName) ) {
+                            afsi_log("Signature Verification failed: %s", szModName);
+                            success = FALSE;
+                        } 
+                        else if (pCtxService) {
+                            PCCERT_CONTEXT pCtx = GetCertCtx(szModName);
+
+                            if (!pCtx || !pCertCompareCertificate(X509_ASN_ENCODING | PKCS_7_ASN_ENCODING,
+                                                                  pCtxService->pCertInfo,
+                                                                  pCtx->pCertInfo)) {
+                                afsi_log("Certificate mismatch: %s", szModName);
+                                if (pCtx)
+                                    LogCertCtx(pCtx);
+                                
+                                success = FALSE;
+                            }
+                            
+                            if (pCtx)
+                                pCertFreeCertificateContext(pCtx);
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    if (pCtxService) {
+        pCertFreeCertificateContext(pCtxService);
+        UnloadCrypt32();
+    }
+
+    FreeLibrary(hPSAPI);
+
+    CloseHandle(hProcess);
+    return success;
+}
+
 typedef BOOL ( APIENTRY * AfsdInitHook )(void);
 #define AFSD_INIT_HOOK "AfsdInitHook"
 #define AFSD_HOOK_DLL  "afsdhook.dll"
@@ -527,6 +1058,19 @@ void afsd_Main(DWORD argc, LPTSTR *argv)
     }
 #endif
 
+    /* Verify the versions of the DLLs which were loaded */
+    if (!AFSModulesVerify()) {
+        ServiceStatus.dwCurrentState = SERVICE_STOPPED;
+        ServiceStatus.dwWin32ExitCode = NO_ERROR;
+        ServiceStatus.dwCheckPoint = 0;
+        ServiceStatus.dwWaitHint = 0;
+        ServiceStatus.dwControlsAccepted = 0;
+        SetServiceStatus(StatusHandle, &ServiceStatus);
+                       
+        /* exit if initialization failed */
+        return;
+    }
+
     /* allow an exit to be called prior to any initialization */
     hInitHookDll = LoadLibrary(AFSD_HOOK_DLL);
     if (hInitHookDll)
index 08ebec6fc01edcdb0559087ed31fba23c7933ca0..5aec746317ef1bd521d709e3301dac80916ce36a 100644 (file)
@@ -135,6 +135,7 @@ HRESULT icf_CheckAndAddPorts(INetFwProfile * fwProfile, global_afs_port_t * port
        INetFwOpenPort * fwPort = NULL;
        HRESULT hr;
        HRESULT rhr = S_OK; /* return value */
+        int i = 0;
 
        hr = fwProfile->get_GloballyOpenPorts(&fwPorts);
        if (FAILED(hr)) {
@@ -145,7 +146,7 @@ HRESULT icf_CheckAndAddPorts(INetFwProfile * fwProfile, global_afs_port_t * port
        }
 
        // go through the supplied ports
-       for (int i=0; i<nPorts; i++) {
+       for (i=0; i<nPorts; i++) {
                VARIANT_BOOL vbEnabled;
                BSTR bstName = NULL;
                BOOL bCreate = FALSE;
index 7f6b4e1a12a840ef78af2ae1e427d5972e2a4d2e..0446fb4989442b997c78ce4ebabb677240bced11 100644 (file)
@@ -550,10 +550,6 @@ UnicodeStringToANSI(UNICODE_STRING uInputString, LPSTR lpszOutputString, int nOu
 
     GetCPInfo(CP_ACP, &CodePageInfo);
 
-    if (CodePageInfo.MaxCharSize > 1)
-        // Only supporting non-Unicode strings
-        return FALSE;
-    
     if (uInputString.Buffer && ((LPBYTE) uInputString.Buffer)[1] == '\0')
     {
         // Looks like unicode, better translate it
@@ -565,6 +561,7 @@ UnicodeStringToANSI(UNICODE_STRING uInputString, LPSTR lpszOutputString, int nOu
     }
     else
         lpszOutputString[0] = '\0';
+
     return FALSE;
 }  // UnicodeStringToANSI
 
index 06c9cc162cb485e6f28edc442b741c8b801b82a7..8abbf431fab7f9a0d8505347bc73ccb0f7bd7b7e 100644 (file)
@@ -339,6 +339,7 @@ long buf_Init(cm_buf_ops_t *opsp)
                               0, 0,   
                               buf_nbuffers * buf_bufferSize);
         if (data == NULL) {
+            afsi_log("Error mapping view of file: 0x%X", GetLastError());
             if (hf != INVALID_HANDLE_VALUE)
                 CloseHandle(hf);
             CloseHandle(hm);
@@ -1464,17 +1465,16 @@ int cm_DumpBufHashTable(FILE *outputFile, char *cookie)
 
     lock_ObtainRead(&buf_globalLock);
   
-    sprintf(output, "%s - dumping buf_HashTable - buf_hashSize=%d\n", cookie, buf_hashSize);
+    StringCbPrintfA(output, sizeof(output), "%s - dumping buf_HashTable - buf_hashSize=%d\n", cookie, buf_hashSize);
     WriteFile(outputFile, output, strlen(output), &zilch, NULL);
   
     for (i = 0; i < buf_hashSize; i++)
     {
-        for(bp = buf_hashTablepp[i]; bp; bp=bp->hashp) 
+        for (bp = buf_hashTablepp[i]; bp; bp=bp->hashp) 
         {
             if (bp->refCount)
             {
-                sprintf(output, "%s bp=0x%08X, hash=%d, fid (cell=%d, volume=%d,"
-                        "vnode=%d, unique=%d), size=%d refCount=%d\n", 
+                StringCbPrintfA(output, sizeof(output), "vnode=%d, unique=%d), size=%d refCount=%d\n", 
                         cookie, (void *)bp, i, bp->fid.cell, bp->fid.volume, 
                         bp->fid.vnode, bp->fid.unique, bp->size, bp->refCount);
                 WriteFile(outputFile, output, strlen(output), &zilch, NULL);
@@ -1482,7 +1482,7 @@ int cm_DumpBufHashTable(FILE *outputFile, char *cookie)
         }
     }
   
-    sprintf(output, "%s - Done dumping buf_HashTable.\n", cookie);
+    StringCbPrintfA(output, sizeof(output), "%s - Done dumping buf_HashTable.\n", cookie);
     WriteFile(outputFile, output, strlen(output), &zilch, NULL);
 
     lock_ReleaseRead(&buf_globalLock);
index 14dac4286f7aac7a3c558f3da24175e14f3675fd..7e7ec282818e7cb1cc1a7cf681bc4af0948c548b 100644 (file)
@@ -160,7 +160,7 @@ void cm_RevokeCallback(struct rx_call *callp, AFSFid *fidp)
         if (scp->fid.volume == tfid.volume &&
              scp->fid.vnode == tfid.vnode &&
              scp->fid.unique == tfid.unique) {
-            scp->refCount++;
+            cm_HoldSCacheNoLock(scp);
             lock_ReleaseWrite(&cm_scacheLock);
             osi_Log1(afsd_logp, "Discarding SCache scp %x", scp);
             lock_ObtainMutex(&scp->mx);
@@ -168,7 +168,7 @@ void cm_RevokeCallback(struct rx_call *callp, AFSFid *fidp)
             lock_ReleaseMutex(&scp->mx);
             cm_CallbackNotifyChange(scp);
             lock_ObtainWrite(&cm_scacheLock);
-            scp->refCount--;
+            cm_ReleaseSCacheNoLock(scp);
         }
     }
     lock_ReleaseWrite(&cm_scacheLock);
@@ -201,7 +201,7 @@ void cm_RevokeVolumeCallback(struct rx_call *callp, AFSFid *fidp)
     for (hash = 0; hash < cm_hashTableSize; hash++) {
         for(scp=cm_hashTablep[hash]; scp; scp=scp->nextp) {
             if (scp->fid.volume == fidp->Volume) {
-                scp->refCount++;
+                cm_HoldSCacheNoLock(scp);
                 lock_ReleaseWrite(&cm_scacheLock);
                 lock_ObtainMutex(&scp->mx);
                 osi_Log1(afsd_logp, "Discarding SCache scp %x", scp);
@@ -209,7 +209,7 @@ void cm_RevokeVolumeCallback(struct rx_call *callp, AFSFid *fidp)
                 lock_ReleaseMutex(&scp->mx);
                 cm_CallbackNotifyChange(scp);
                 lock_ObtainWrite(&cm_scacheLock);
-                scp->refCount--;
+                cm_ReleaseSCacheNoLock(scp);
             }
         }      /* search one hash bucket */
     }  /* search all hash buckets */
@@ -290,7 +290,7 @@ SRXAFSCB_InitCallBackState(struct rx_call *callp)
        lock_ObtainWrite(&cm_scacheLock);
        for (hash = 0; hash < cm_hashTableSize; hash++) {
             for (scp=cm_hashTablep[hash]; scp; scp=scp->nextp) {
-                scp->refCount++;
+                cm_HoldSCacheNoLock(scp);
                 lock_ReleaseWrite(&cm_scacheLock);
                 lock_ObtainMutex(&scp->mx);
                 discarded = 0;
@@ -306,7 +306,7 @@ SRXAFSCB_InitCallBackState(struct rx_call *callp)
                 if (discarded)
                     cm_CallbackNotifyChange(scp);
                 lock_ObtainWrite(&cm_scacheLock);
-                scp->refCount--;
+                cm_ReleaseSCacheNoLock(scp);
             }  /* search one hash bucket */
        }       /* search all hash buckets */
        
@@ -909,17 +909,17 @@ void cm_CheckCBExpiration(void)
     lock_ObtainWrite(&cm_scacheLock);
     for (i=0; i<cm_hashTableSize; i++) {
         for (scp = cm_hashTablep[i]; scp; scp=scp->nextp) {
-            scp->refCount++;
+            cm_HoldSCacheNoLock(scp);
             lock_ReleaseWrite(&cm_scacheLock);
             if (scp->cbExpires > 0 && (scp->cbServerp == NULL || now > scp->cbExpires)) {
                 osi_Log1(afsd_logp, "Callback Expiration Discarding SCache scp %x", scp);
-                cm_CallbackNotifyChange(scp);
                 lock_ObtainMutex(&scp->mx);
                 cm_DiscardSCache(scp);
                 lock_ReleaseMutex(&scp->mx);
+                cm_CallbackNotifyChange(scp);
             }
             lock_ObtainWrite(&cm_scacheLock);
-            osi_assert(scp->refCount-- > 0);
+            cm_ReleaseSCacheNoLock(scp);
         }
     }
     lock_ReleaseWrite(&cm_scacheLock);
index 3acc6f19e5d50bd96b533536bd9c7622aff912c9..8be706b8e3c5d2f10afddc29838e1f7832635301 100644 (file)
@@ -66,4 +66,6 @@ extern void cm_CheckCBExpiration(void);
 
 extern osi_rwlock_t cm_callbackLock;
 
+extern void cm_CallbackNotifyChange(cm_scache_t *scp);
+
 #endif /*  _CM_CALLBACK_H_ENV__ */
index 94985039927bcc2fd733051ba250cdb77b055b4c..38b6ee69bb4cfaba0b2ea58c3014626a6890b761 100644 (file)
@@ -738,7 +738,7 @@ long cm_CloseCellFile(cm_configFile_t *filep)
 
 void cm_GetConfigDir(char *dir)
 {
-       char wdir[256];
+    char wdir[256];
     int tlen;
 #ifdef AFS_WIN95_ENV
     char *afsconf_path;
index ae8a2cde1ba59c47d660a3434536f52e40d31396..551fb9bcaf11617f296f81c5b20596ef6cb53632 100644 (file)
@@ -55,6 +55,8 @@ extern long cm_CloseCellFile(cm_configFile_t *filep);
 
 extern long cm_GetCellServDB(char *cellNamep);
 
+extern void cm_GetConfigDir(char *dir);
+
 #endif /* __CM_CONFIG_INTERFACES_ONLY__ */
 
 #endif /* __CONFIG_H_ENV_ */
index 0894791a1a0d0382b4ab4e53f0d7cb9ab40d074f..28ee45f8b50b745e08a554b72451e566ba98b996 100644 (file)
@@ -332,7 +332,7 @@ int cm_FakeRootFid(cm_fid_t *fidp)
   
 /* called directly from ioctl */
 /* called while not holding freelance lock */
-int cm_noteLocalMountPointChange() {
+int cm_noteLocalMountPointChange(void) {
     lock_ObtainMutex(&cm_Freelance_Lock);
     cm_fakeDirVersion++;
     cm_localMountPointChangeFlag = 1;
@@ -377,13 +377,14 @@ int cm_reInitLocalMountPoints() {
                  ) {
 
                 // mark the scp to be reused
+                cm_HoldSCacheNoLock(scp);
                 lock_ReleaseWrite(&cm_scacheLock);
                 lock_ObtainMutex(&scp->mx);
                 cm_DiscardSCache(scp);
                 lock_ReleaseMutex(&scp->mx);
                 cm_CallbackNotifyChange(scp);
                 lock_ObtainWrite(&cm_scacheLock);
-                scp->refCount--;
+                cm_ReleaseSCacheNoLock(scp);
 
                 // take the scp out of the hash
                 lscpp = &cm_hashTablep[hash];
@@ -451,10 +452,10 @@ long cm_InitLocalMountPoints() {
 
 #if !defined(DJGPP)
     if (RegOpenKeyEx( HKEY_LOCAL_MACHINE, 
-                        "SOFTWARE\\OpenAFS\\Client\\Freelance",
-                                               0,
-                        KEY_READ|KEY_WRITE|KEY_QUERY_VALUE,
-                        &hkFreelance) == ERROR_SUCCESS) {
+                      "SOFTWARE\\OpenAFS\\Client\\Freelance",
+                      0,
+                      KEY_READ|KEY_WRITE|KEY_QUERY_VALUE,
+                      &hkFreelance) == ERROR_SUCCESS) {
 
         RegQueryInfoKey( hkFreelance,
                          NULL,  /* lpClass */
@@ -473,14 +474,13 @@ long cm_InitLocalMountPoints() {
         smb_UnixTimeFromLargeSearchTime(&FakeFreelanceModTime, &ftLastWriteTime);
 
         if ( dwMountPoints == 0 ) {
-            sprintf(line,"%s#%s:root.cell.\n",rootCellName,rootCellName);
-            dwType = REG_SZ;
-            dwSize = strlen(line) + 1;
-            RegSetValueEx( hkFreelance, "0", 0, dwType, line, dwSize);
-            sprintf(line,".%s%%%s:root.cell.\n",rootCellName,rootCellName);
-            dwSize = strlen(line) + 1;
-            RegSetValueEx( hkFreelance, "1", 0, dwType, line, dwSize);
-            dwMountPoints = 2;
+            rootCellName[0] = '.';
+            code = cm_GetRootCellName(&rootCellName[1]);
+            if (code == 0) {
+                cm_FreelanceAddMount(&rootCellName[1], &rootCellName[1], "root.cell", 0, NULL);
+                cm_FreelanceAddMount(rootCellName, &rootCellName[1], "root.cell", 1, NULL);
+                dwMountPoints = 2;
+            }
         }
 
         if (RegCreateKeyEx( HKEY_LOCAL_MACHINE, 
@@ -527,8 +527,15 @@ long cm_InitLocalMountPoints() {
             TCHAR szValueName[16];
             DWORD dwValueSize = 16;
             dwSize = sizeof(line);
-            RegEnumValue( hkFreelance, dwIndex, szValueName, &dwValueSize, NULL,
-                          &dwType, line, &dwSize);
+            if (RegEnumValue( hkFreelance, dwIndex, szValueName, &dwValueSize, NULL,
+                          &dwType, line, &dwSize))
+            {
+                afsi_log("RegEnumValue(hkFreelance) failed");
+                cm_noLocalMountPoints--;
+                continue;
+            }
+
+            afsi_log("Mountpoint[%d] = %s",dwIndex, line);
 
             /* find the trailing dot; null terminate after it */
             t2 = strrchr(line, '.');
@@ -568,8 +575,15 @@ long cm_InitLocalMountPoints() {
             TCHAR szValueName[16];
             DWORD dwValueSize = 16;
             dwSize = sizeof(line);
-            RegEnumValue( hkFreelanceSymlinks, dwIndex, szValueName, &dwValueSize, NULL,
-                          &dwType, line, &dwSize);
+            if (RegEnumValue( hkFreelanceSymlinks, dwIndex, szValueName, &dwValueSize, NULL,
+                              &dwType, line, &dwSize))
+            {
+                afsi_log("RegEnumValue(hkFreelanceSymlinks) failed");
+                cm_noLocalMountPoints--;
+                continue;
+            }
+
+            afsi_log("Symlink[%d] = %s",dwIndex, line);
 
             /* find the trailing dot; null terminate after it */
             t2 = strrchr(line, '.');
@@ -618,27 +632,14 @@ long cm_InitLocalMountPoints() {
     strcat(hdir, AFS_FREELANCE_INI);
     // open the ini file for reading
     fp = fopen(hdir, "r");
-
-    // if we fail to open the file, create an empty one
     if (!fp) {
-        fp = fopen(hdir, "w");
-       code = cm_GetRootCellName(rootCellName);
-        if (code == 0) {
-            fputs("1\n", fp);
-            fprintf(fp,"%s#%s:root.cell.\n",rootCellName,rootCellName);
-            fprintf(fp,".%s%%%s:root.cell.\n",rootCellName,rootCellName);
-            fclose(fp);
-            fp = fopen(hdir, "r");
-        } else {
-            fputs("0\n", fp);
-            fclose(fp);
-            return 0;  /* success */
-        }
+        /* look in the Windows directory where we used to store the file */
+        GetWindowsDirectory(hdir, sizeof(hdir));
+        strcat(hdir,"\\");
+        strcat(hdir, AFS_FREELANCE_INI);
+        fp = fopen(hdir, "r");
     }
 
-    // we successfully opened the file
-    osi_Log0(afsd_logp,"opened afs_freelance.ini");
-       
 #if !defined(DJGPP)
     RegCreateKeyEx( HKEY_LOCAL_MACHINE, 
                     "SOFTWARE\\OpenAFS\\Client\\Freelance",
@@ -652,6 +653,22 @@ long cm_InitLocalMountPoints() {
     dwIndex = 0;
 #endif
 
+    if (!fp) {
+#if !defined(DJGPP)
+        RegCloseKey(hkFreelance);
+#endif
+        rootCellName[0] = '.';
+       code = cm_GetRootCellName(&rootCellName[1]);
+        if (code == 0) {
+            cm_FreelanceAddMount(&rootCellName[1], &rootCellName[1], "root.cell", 0, NULL);
+            cm_FreelanceAddMount(rootCellName, &rootCellName[1], "root.cell", 1, NULL);
+        }
+        return 0;
+    }
+
+    // we successfully opened the file
+    osi_Log0(afsd_logp,"opened afs_freelance.ini");
+       
     // now we read the first line to see how many entries
     // there are
     fgets(line, sizeof(line), fp);
@@ -668,9 +685,11 @@ long cm_InitLocalMountPoints() {
     // that we read
     cm_noLocalMountPoints = atoi(line);
 
-    // create space to store the local mount points
-    cm_localMountPoints = malloc(sizeof(cm_localMountPoint_t) * cm_noLocalMountPoints);
-    aLocalMountPoint = cm_localMountPoints;
+    if (cm_noLocalMountPoints > 0) {
+        // create space to store the local mount points
+        cm_localMountPoints = malloc(sizeof(cm_localMountPoint_t) * cm_noLocalMountPoints);
+        aLocalMountPoint = cm_localMountPoints;
+    }
 
     // now we read n lines and parse them into local mount points
     // where n is the number of local mount points there are, as
@@ -688,6 +707,11 @@ long cm_InitLocalMountPoints() {
             return -1;
         }
 
+        /* find the trailing dot; null terminate after it */
+        t2 = strrchr(line, '.');
+        if (t2)
+            *(t2+1) = '\0';
+
 #if !defined(DJGPP)
         if ( hkFreelance ) {
             char szIndex[16];
@@ -714,8 +738,8 @@ long cm_InitLocalMountPoints() {
         *(aLocalMountPoint->namep + (t-line)) = 0;
 
         aLocalMountPoint->mountPointStringp=malloc(strlen(line) - (t-line) + 1);
-        memcpy(aLocalMountPoint->mountPointStringp, t, strlen(line)-(t-line)-2);
-        *(aLocalMountPoint->mountPointStringp + (strlen(line)-(t-line)-2)) = 0;
+        memcpy(aLocalMountPoint->mountPointStringp, t, strlen(line)-(t-line)-1);
+        *(aLocalMountPoint->mountPointStringp + (strlen(line)-(t-line)-1)) = 0;
 
         osi_Log2(afsd_logp,"found mount point: name %s, string %s",
                   aLocalMountPoint->namep,
@@ -737,6 +761,158 @@ int cm_getNoLocalMountPoints() {
     return cm_noLocalMountPoints;
 }
 
+#if !defined(DJGPP)
+long cm_FreelanceMountPointExists(char * filename)
+{
+    char* cp;
+    char line[512];
+    char shortname[200];
+    int found = 0;
+    HKEY hkFreelance = 0;
+    DWORD dwType, dwSize;
+    DWORD dwMountPoints;
+    DWORD dwIndex;
+        
+    lock_ObtainMutex(&cm_Freelance_Lock);
+
+    if (RegOpenKeyEx( HKEY_LOCAL_MACHINE, 
+                      "SOFTWARE\\OpenAFS\\Client\\Freelance",
+                      0,
+                      KEY_READ|KEY_QUERY_VALUE,
+                      &hkFreelance) == ERROR_SUCCESS) 
+    {
+        RegQueryInfoKey( hkFreelance,
+                         NULL,  /* lpClass */
+                         NULL,  /* lpcClass */
+                         NULL,  /* lpReserved */
+                         NULL,  /* lpcSubKeys */
+                         NULL,  /* lpcMaxSubKeyLen */
+                         NULL,  /* lpcMaxClassLen */
+                         &dwMountPoints, /* lpcValues */
+                         NULL,  /* lpcMaxValueNameLen */
+                         NULL,  /* lpcMaxValueLen */
+                         NULL,  /* lpcbSecurityDescriptor */
+                         NULL   /* lpftLastWriteTime */
+                         );
+
+        for ( dwIndex = 0; dwIndex < dwMountPoints; dwIndex++ ) {
+            TCHAR szValueName[16];
+            DWORD dwValueSize = 16;
+            dwSize = sizeof(line);
+            RegEnumValue( hkFreelance, dwIndex, szValueName, &dwValueSize, NULL,
+                          &dwType, line, &dwSize);
+
+            cp=strchr(line, '#');
+            if (!cp)
+                cp=strchr(line, '%');
+            memcpy(shortname, line, cp-line);
+            shortname[cp-line]=0;
+
+            if (!strcmp(shortname, filename)) {
+                found = 1;
+                break;
+            }
+        }
+        for ( dwIndex = 0; dwIndex < dwMountPoints; dwIndex++ ) {
+            TCHAR szValueName[16];
+            DWORD dwValueSize = 16;
+            dwSize = sizeof(line);
+            RegEnumValue( hkFreelance, dwIndex, szValueName, &dwValueSize, NULL,
+                          &dwType, line, &dwSize);
+
+            cp=strchr(line, '#');
+            if (!cp)
+                cp=strchr(line, '%');
+            memcpy(shortname, line, cp-line);
+            shortname[cp-line]=0;
+
+            if (!stricmp(shortname, filename)) {
+                found = 1;
+                break;
+            }
+        }
+        RegCloseKey(hkFreelance);
+    }
+
+    lock_ReleaseMutex(&cm_Freelance_Lock);
+
+    return found;
+}
+
+long cm_FreelanceSymlinkExists(char * filename)
+{
+    char* cp;
+    char line[512];
+    char shortname[200];
+    int found = 0;
+    HKEY hkFreelance = 0;
+    DWORD dwType, dwSize;
+    DWORD dwSymlinks;
+    DWORD dwIndex;
+        
+    lock_ObtainMutex(&cm_Freelance_Lock);
+
+    if (RegOpenKeyEx( HKEY_LOCAL_MACHINE, 
+                      "SOFTWARE\\OpenAFS\\Client\\Freelance\\Symlinks",
+                      0,
+                      KEY_READ|KEY_QUERY_VALUE,
+                      &hkFreelance) == ERROR_SUCCESS) 
+    {
+        RegQueryInfoKey( hkFreelance,
+                         NULL,  /* lpClass */
+                         NULL,  /* lpcClass */
+                         NULL,  /* lpReserved */
+                         NULL,  /* lpcSubKeys */
+                         NULL,  /* lpcMaxSubKeyLen */
+                         NULL,  /* lpcMaxClassLen */
+                         &dwSymlinks, /* lpcValues */
+                         NULL,  /* lpcMaxValueNameLen */
+                         NULL,  /* lpcMaxValueLen */
+                         NULL,  /* lpcbSecurityDescriptor */
+                         NULL   /* lpftLastWriteTime */
+                         );
+
+        for ( dwIndex = 0; dwIndex < dwSymlinks; dwIndex++ ) {
+            TCHAR szValueName[16];
+            DWORD dwValueSize = 16;
+            dwSize = sizeof(line);
+            RegEnumValue( hkFreelance, dwIndex, szValueName, &dwValueSize, NULL,
+                          &dwType, line, &dwSize);
+
+            cp=strchr(line, ':');
+            memcpy(shortname, line, cp-line);
+            shortname[cp-line]=0;
+
+            if (!strcmp(shortname, filename)) {
+                found = 1;
+                break;
+            }
+        }
+        for ( dwIndex = 0; dwIndex < dwSymlinks; dwIndex++ ) {
+            TCHAR szValueName[16];
+            DWORD dwValueSize = 16;
+            dwSize = sizeof(line);
+            RegEnumValue( hkFreelance, dwIndex, szValueName, &dwValueSize, NULL,
+                          &dwType, line, &dwSize);
+
+            cp=strchr(line, ':');
+            memcpy(shortname, line, cp-line);
+            shortname[cp-line]=0;
+
+            if (!stricmp(shortname, filename)) {
+                found = 1;
+                break;
+            }
+        }
+        RegCloseKey(hkFreelance);
+    }
+
+    lock_ReleaseMutex(&cm_Freelance_Lock);
+
+    return found;
+}
+#endif
+
 long cm_FreelanceAddMount(char *filename, char *cellname, char *volume, int rw, cm_fid_t *fidp)
 {
     FILE *fp;
@@ -761,6 +937,10 @@ long cm_FreelanceAddMount(char *filename, char *cellname, char *volume, int rw,
               osi_LogSaveString(afsd_logp,cellname), 
               osi_LogSaveString(afsd_logp,volume), 
               rw ? "rw" : "ro");
+
+    if ( filename[0] == '\0' || cellname[0] == '\0' || volume[0] == '\0' )
+        return -1;
+
     if (cellname[0] == '.') {
         if (!cm_GetCell_Gen(&cellname[1], fullname, CM_FLAG_CREATE))
             return -1;
@@ -768,6 +948,12 @@ long cm_FreelanceAddMount(char *filename, char *cellname, char *volume, int rw,
         if (!cm_GetCell_Gen(cellname, fullname, CM_FLAG_CREATE))
             return -1;
     }
+
+#if !defined(DJGPP)
+    if ( cm_FreelanceMountPointExists(filename) ||
+         cm_FreelanceSymlinkExists(filename) )
+        return -1;
+#endif
     
     osi_Log1(afsd_logp,"Freelance Adding Mount for Cell: %s", 
               osi_LogSaveString(afsd_logp,cellname));
@@ -816,9 +1002,9 @@ long cm_FreelanceAddMount(char *filename, char *cellname, char *volume, int rw,
                 RegSetValueEx( hkFreelance, szIndex, 0, dwType, line, dwSize);
                 break;
             } else {
-                               int len = strlen(filename);
-                               if ( dwType == REG_SZ && !strncmp(filename, szMount, len) && 
-                                       (szMount[len] == '%' || szMount[len] == '#')) {
+                int len = strlen(filename);
+                if ( dwType == REG_SZ && !strncmp(filename, szMount, len) && 
+                     (szMount[len] == '%' || szMount[len] == '#')) {
                     /* Replace the existing value */
                     dwType = REG_SZ;
                     dwSize = strlen(line) + 1;
@@ -877,7 +1063,6 @@ long cm_FreelanceRemoveMount(char *toremove)
 
     lock_ObtainMutex(&cm_Freelance_Lock);
 
-
 #if !defined(DJGPP)
     if (RegOpenKeyEx( HKEY_LOCAL_MACHINE, 
                       "SOFTWARE\\OpenAFS\\Client\\Freelance",
@@ -970,11 +1155,8 @@ long cm_FreelanceRemoveMount(char *toremove)
 
 long cm_FreelanceAddSymlink(char *filename, char *destination, cm_fid_t *fidp)
 {
-    FILE *fp;
-    char hfile[120];
     char line[512];
     char fullname[200];
-    int n;
     int alias = 0;
 #if !defined(DJGPP)
     HKEY hkFreelanceSymlinks = 0;
@@ -983,14 +1165,33 @@ long cm_FreelanceAddSymlink(char *filename, char *destination, cm_fid_t *fidp)
     DWORD dwIndex;
 #endif
 
-    /* before adding, verify the cell name; if it is not a valid cell,
-       don't add the mount point.
-       allow partial matches as a means of poor man's alias. */
-    /* major performance issue? */
+    /* before adding, verify the filename.  If it is already in use, either as 
+     * as mount point or a cellname, do not permit the creation of the symlink.
+     */
     osi_Log2(afsd_logp,"Freelance Add Symlink request: filename=%s destination=%s",
               osi_LogSaveString(afsd_logp,filename), 
               osi_LogSaveString(afsd_logp,destination));
     
+    if ( filename[0] == '\0' || destination[0] == '\0' )
+        return -1;
+
+    fullname[0] = '\0';
+    if (filename[0] == '.') {
+        cm_GetCell_Gen(&filename[1], fullname, CM_FLAG_CREATE);
+        if (stricmp(&filename[1],fullname) == 0)
+            return -1;
+    } else {
+        cm_GetCell_Gen(filename, fullname, CM_FLAG_CREATE);
+        if (stricmp(filename,fullname) == 0)
+            return -1;
+    }
+
+#if !defined(DJGPP)
+    if ( cm_FreelanceMountPointExists(filename) ||
+         cm_FreelanceSymlinkExists(filename) )
+        return -1;
+#endif
+
     lock_ObtainMutex(&cm_Freelance_Lock);
 
 #if !defined(DJGPP)
@@ -1036,8 +1237,8 @@ long cm_FreelanceAddSymlink(char *filename, char *destination, cm_fid_t *fidp)
                 RegSetValueEx( hkFreelanceSymlinks, szIndex, 0, dwType, line, dwSize);
                 break;
             } else {
-                               int len = strlen(filename);
-                               if ( dwType == REG_SZ && !strncmp(filename, szLink, len) && szLink[len] == ':') {
+                int len = strlen(filename);
+                if ( dwType == REG_SZ && !strncmp(filename, szLink, len) && szLink[len] == ':') {
                     /* Replace the existing value */
                     dwType = REG_SZ;
                     dwSize = strlen(line) + 1;
@@ -1062,12 +1263,9 @@ long cm_FreelanceAddSymlink(char *filename, char *destination, cm_fid_t *fidp)
 
 long cm_FreelanceRemoveSymlink(char *toremove)
 {
-    int i, n;
     char* cp;
     char line[512];
     char shortname[200];
-    char hfile[120], hfile2[120];
-    FILE *fp1, *fp2;
     int found=0;
 #if !defined(DJGPP)
     HKEY hkFreelanceSymlinks = 0;
@@ -1078,7 +1276,6 @@ long cm_FreelanceRemoveSymlink(char *toremove)
 
     lock_ObtainMutex(&cm_Freelance_Lock);
 
-
 #if !defined(DJGPP)
     if (RegOpenKeyEx( HKEY_LOCAL_MACHINE, 
                       "SOFTWARE\\OpenAFS\\Client\\Freelance\\Symlinks",
index effeb9ee6aea0f3ccbb37f20e247d98e34c36e82..d0fcc78a0f5938409881ae1772dbeaa311322a4b 100644 (file)
@@ -14,6 +14,7 @@ extern long cm_InitLocalMountPoints();
 extern int cm_getLocalMountPointChange();
 extern int cm_reInitLocalMountPoints();
 extern void cm_InitFreelance();
+extern int cm_noteLocalMountPointChange(void);
 extern long cm_FreelanceRemoveMount(char *toremove);
 extern long cm_FreelanceAddMount(char *filename, char *cellname, char *volume, int rw, cm_fid_t *fidp);
 extern long cm_FreelanceRemoveSymlink(char *toremove);
index bb60b77e6b7d1b47afef6c9102807681110e824c..b4d145f60fccb2452c409d16f2af6b13bab95738 100644 (file)
@@ -91,13 +91,13 @@ void cm_ResetACLCache(cm_user_t *userp)
     lock_ObtainWrite(&cm_scacheLock);
     for (hash=0; hash < cm_hashTableSize; hash++) {
         for (scp=cm_hashTablep[hash]; scp; scp=scp->nextp) {
-            scp->refCount++;
+            cm_HoldSCacheNoLock(scp);
             lock_ReleaseWrite(&cm_scacheLock);
             lock_ObtainMutex(&scp->mx);
             cm_InvalidateACLUser(scp, userp);
             lock_ReleaseMutex(&scp->mx);
             lock_ObtainWrite(&cm_scacheLock);
-            scp->refCount--;
+            cm_ReleaseSCacheNoLock(scp);
         }
     }
     lock_ReleaseWrite(&cm_scacheLock);
@@ -259,7 +259,7 @@ void cm_SkipIoctlPath(smb_ioctl_t *ioctlp)
  * easier (because we can always jump past the initial "/afs" to find
  * the AFS path that should be written into afsdsbmt.ini).
  */
-void cm_NormalizeAfsPath (char *outpathp, char *inpathp)
+void cm_NormalizeAfsPath(char *outpathp, long outlen, char *inpathp)
 {
     char *cp;
     char bslash_mountRoot[256];
@@ -268,13 +268,13 @@ void cm_NormalizeAfsPath (char *outpathp, char *inpathp)
     bslash_mountRoot[0] = '\\';
        
     if (!strnicmp (inpathp, cm_mountRoot, strlen(cm_mountRoot)))
-        lstrcpy (outpathp, inpathp);
+        StringCbCopy(outpathp, outlen, inpathp);
     else if (!strnicmp (inpathp, bslash_mountRoot, strlen(bslash_mountRoot)))
-        lstrcpy (outpathp, inpathp);
+        StringCbCopy(outpathp, outlen, inpathp);
     else if ((inpathp[0] == '/') || (inpathp[0] == '\\'))
-        sprintf (outpathp, "%s%s", cm_mountRoot, inpathp);
+        StringCbPrintfA(outpathp, outlen, "%s%s", cm_mountRoot, inpathp);
     else // inpathp looks like "<cell>/usr"
-        sprintf (outpathp, "%s/%s", cm_mountRoot, inpathp);
+        StringCbPrintfA(outpathp, outlen, "%s/%s", cm_mountRoot, inpathp);
 
     for (cp = outpathp; *cp != 0; ++cp) {
         if (*cp == '\\')
@@ -286,10 +286,11 @@ void cm_NormalizeAfsPath (char *outpathp, char *inpathp)
     }
 
     if (!strcmpi (outpathp, cm_mountRoot)) {
-        strcpy (outpathp, cm_mountRoot);
+        StringCbCopy(outpathp, outlen, cm_mountRoot);
     }
 }
 
+#define LEAF_SIZE 256
 /* parse the passed-in file name and do a namei on its parent.  If we fail,
  * return an error code, otherwise return the vnode located in *scpp.
  */
@@ -301,7 +302,7 @@ long cm_ParseIoctlParent(smb_ioctl_t *ioctlp, cm_user_t *userp, cm_req_t *reqp,
     char *tp, *jp;
     cm_scache_t *substRootp;
 
-    strcpy(tbuffer, ioctlp->inDatap);
+    StringCbCopyA(tbuffer, sizeof(tbuffer), ioctlp->inDatap);
     tp = strrchr(tbuffer, '\\');
     jp = strrchr(tbuffer, '/');
     if (!tp)
@@ -309,14 +310,14 @@ long cm_ParseIoctlParent(smb_ioctl_t *ioctlp, cm_user_t *userp, cm_req_t *reqp,
     else if (jp && (tp - tbuffer) < (jp - tbuffer))
         tp = jp;
     if (!tp) {
-        strcpy(tbuffer, "\\");
+        StringCbCopyA(tbuffer, sizeof(tbuffer), "\\");
         if (leafp) 
-            strcpy(leafp, ioctlp->inDatap);
+            StringCbCopyA(leafp, LEAF_SIZE, ioctlp->inDatap);
     }
     else {
         *tp = 0;
         if (leafp) 
-            strcpy(leafp, tp+1);
+            StringCbCopyA(leafp, LEAF_SIZE, tp+1);
     }   
 
     if (tbuffer[0] == tbuffer[1] &&
@@ -463,7 +464,7 @@ long cm_IoctlGetFileCellName(struct smb_ioctl *ioctlp, struct cm_user *userp)
          scp->fid.cell==AFS_FAKE_ROOT_CELL_ID &&
          scp->fid.volume==AFS_FAKE_ROOT_VOL_ID &&
          scp->fid.vnode==0x1 && scp->fid.unique==0x1 ) {
-        strcpy(ioctlp->outDatap, "Freelance.Local.Root");
+        StringCbCopyA(ioctlp->outDatap, 999999, "Freelance.Local.Root");
         ioctlp->outDatap += strlen(ioctlp->outDatap) + 1;
         code = 0;
     } else 
@@ -471,7 +472,7 @@ long cm_IoctlGetFileCellName(struct smb_ioctl *ioctlp, struct cm_user *userp)
     {
         cellp = cm_FindCellByID(scp->fid.cell);
         if (cellp) {
-            strcpy(ioctlp->outDatap, cellp->namep);
+            StringCbCopyA(ioctlp->outDatap, 999999, cellp->namep);
             ioctlp->outDatap += strlen(ioctlp->outDatap) + 1;
             code = 0;
         }
@@ -547,7 +548,7 @@ long cm_IoctlFlushVolume(struct smb_ioctl *ioctlp, struct cm_user *userp)
     for (i=0; i<cm_hashTableSize; i++) {
         for (scp = cm_hashTablep[i]; scp; scp = scp->nextp) {
             if (scp->fid.volume == volume) {
-                scp->refCount++;
+                cm_HoldSCacheNoLock(scp);
                 lock_ReleaseWrite(&cm_scacheLock);
 
                 /* now flush the file */
@@ -555,7 +556,7 @@ long cm_IoctlFlushVolume(struct smb_ioctl *ioctlp, struct cm_user *userp)
                 if ( code )
                     afsi_log("cm_FlushFile returns error: [%x]",code);
                 lock_ObtainWrite(&cm_scacheLock);
-                scp->refCount--;
+                cm_ReleaseSCacheNoLock(scp);
             }
         }
     }
@@ -620,11 +621,11 @@ long cm_IoctlSetVolumeStatus(struct smb_ioctl *ioctlp, struct cm_user *userp)
     cp = ioctlp->inDatap;
     memcpy((char *)&volStat, cp, sizeof(AFSFetchVolumeStatus));
     cp += sizeof(AFSFetchVolumeStatus);
-    strcpy(volName, cp);
+    StringCbCopyA(volName, sizeof(volName), cp);
     cp += strlen(volName)+1;
-    strcpy(offLineMsg, cp);
+    StringCbCopyA(offLineMsg, sizeof(offLineMsg), cp);
     cp +=  strlen(offLineMsg)+1;
-    strcpy(motd, cp);
+    StringCbCopyA(motd, sizeof(motd), cp);
     storeStat.Mask = 0;
     if (volStat.MinQuota != -1) {
         storeStat.MinQuota = volStat.MinQuota;
@@ -660,11 +661,11 @@ long cm_IoctlSetVolumeStatus(struct smb_ioctl *ioctlp, struct cm_user *userp)
     cp = ioctlp->outDatap;
     memcpy(cp, (char *)&volStat, sizeof(VolumeStatus));
     cp += sizeof(VolumeStatus);
-    strcpy(cp, volName);
+    StringCbCopyA(cp, 999999, volName);
     cp += strlen(volName)+1;
-    strcpy(cp, offLineMsg);
+    StringCbCopyA(cp, 999999, offLineMsg);
     cp += strlen(offLineMsg)+1;
-    strcpy(cp, motd);
+    StringCbCopyA(cp, 999999, motd);
     cp += strlen(motd)+1;
 
     /* now return updated return data pointer */
@@ -716,11 +717,11 @@ long cm_IoctlGetVolumeStatus(struct smb_ioctl *ioctlp, struct cm_user *userp)
     cp = ioctlp->outDatap;
     memcpy(cp, (char *)&volStat, sizeof(AFSFetchVolumeStatus));
     cp += sizeof(AFSFetchVolumeStatus);
-    strcpy(cp, volName);
+    StringCbCopyA(cp, 999999, volName);
     cp += strlen(volName)+1;
-    strcpy(cp, offLineMsg);
+    StringCbCopyA(cp, 999999, offLineMsg);
     cp += strlen(offLineMsg)+1;
-    strcpy(cp, motd);
+    StringCbCopyA(cp, 999999, motd);
     cp += strlen(motd)+1;
 
     /* return new size */
@@ -811,7 +812,7 @@ long cm_IoctlStatMountPoint(struct smb_ioctl *ioctlp, struct cm_user *userp)
     code = cm_ReadMountPoint(scp, userp, &req);
     if (code == 0) {
         cp = ioctlp->outDatap;
-        strcpy(cp, scp->mountPointStringp);
+        StringCbCopyA(cp, 999999, scp->mountPointStringp);
         cp += strlen(cp) + 1;
         ioctlp->outDatap = cp;
     }
@@ -1096,7 +1097,7 @@ long cm_IoctlGetCell(struct smb_ioctl *ioctlp, struct cm_user *userp)
         }
         lock_ReleaseRead(&cm_serverLock);
         cp = basep + max * sizeof(afs_int32);
-        strcpy(cp, tcellp->namep);
+        StringCbCopyA(cp, 999999, tcellp->namep);
         cp += strlen(tcellp->namep)+1;
         ioctlp->outDatap = cp;
     }
@@ -1169,7 +1170,7 @@ long cm_IoctlGetWsCell(smb_ioctl_t *ioctlp, cm_user_t *userp)
     }
 
     /* return the default cellname to the caller */
-    strcpy(ioctlp->outDatap, cm_rootCellp->namep);
+    StringCbCopyA(ioctlp->outDatap, 999999, cm_rootCellp->namep);
     ioctlp->outDatap += strlen(ioctlp->outDatap) +1;
 
     /* done: success */
@@ -1218,7 +1219,7 @@ long cm_IoctlSysName(struct smb_ioctl *ioctlp, struct cm_user *userp)
         osi_panic("cm_IoctlSysName: !cm_sysName\n", __FILE__, __LINE__);
 
     if (!setSysName) {      /* user just wants the info */
-        strcpy(outname, cm_sysName);
+        StringCbCopyA(outname, sizeof(outname), cm_sysName);
         foundname = cm_sysNameCount;
         *sysnamelist = cm_sysNameList;
     } else {        
@@ -1226,8 +1227,8 @@ long cm_IoctlSysName(struct smb_ioctl *ioctlp, struct cm_user *userp)
         /* clear @sys entries from the dnlc, once afs_lookup can
          * do lookups of @sys entries and thinks it can trust them */
         /* privs ok, store the entry, ... */
-        strcpy(cm_sysName, inname);
-               strcpy(cm_sysNameList[0], inname);
+        StringCbCopyA(cm_sysName, sizeof(cm_sysName), inname);
+        StringCbCopyA(cm_sysNameList[0], MAXSYSNAME, inname);
         if (setSysName > 1) {       /* ... or list */
             cp = ioctlp->inDatap;
             for (count = 1; count < setSysName; ++count) {
@@ -1235,7 +1236,7 @@ long cm_IoctlSysName(struct smb_ioctl *ioctlp, struct cm_user *userp)
                     osi_panic("cm_IoctlSysName: no cm_sysNameList entry to write\n",
                                __FILE__, __LINE__);
                 t = strlen(cp);
-                strcpy(cm_sysNameList[count], cp);
+                StringCbCopyA(cm_sysNameList[count], MAXSYSNAME, cp);
                 cp += t + 1;
             }
         }
@@ -1248,7 +1249,7 @@ long cm_IoctlSysName(struct smb_ioctl *ioctlp, struct cm_user *userp)
         memcpy(cp, (char *)&foundname, sizeof(afs_int32));
         cp += sizeof(afs_int32);       /* skip found flag */
         if (foundname) {
-            strcpy(cp, outname);
+            StringCbCopyA(cp, 999999, outname);
             cp += strlen(outname) + 1; /* skip name and terminating null char */
             for ( count=1; count < foundname ; ++count) {   /* ... or list */
                 if ( !(*sysnamelist)[count] )
@@ -1258,7 +1259,7 @@ long cm_IoctlSysName(struct smb_ioctl *ioctlp, struct cm_user *userp)
                 if (t >= MAXSYSNAME)
                     osi_panic("cm_IoctlSysName: sysname entry garbled\n", 
                                __FILE__, __LINE__);
-                strcpy(cp, (*sysnamelist)[count]);
+                StringCbCopyA(cp, 999999, (*sysnamelist)[count]);
                 cp += t + 1;
             }
         }
@@ -1426,7 +1427,7 @@ long cm_IoctlStoreBehind(struct smb_ioctl *ioctlp, struct cm_user *userp)
 
 long cm_IoctlCreateMountPoint(struct smb_ioctl *ioctlp, struct cm_user *userp)
 {
-    char leaf[256];
+    char leaf[LEAF_SIZE];
     long code;
     cm_scache_t *dscp;
     cm_attr_t tattr;
@@ -1453,12 +1454,12 @@ long cm_IoctlCreateMountPoint(struct smb_ioctl *ioctlp, struct cm_user *userp)
      */
 
     /* Extract the possibly partial cell name */
-    strcpy(cell, ioctlp->inDatap + 1);      /* Skip the mp type character */
+    StringCbCopyA(cell, sizeof(cell), ioctlp->inDatap + 1);      /* Skip the mp type character */
         
     if (cp = strchr(cell, ':')) {
         /* Extract the volume name */
         *cp = 0;
-        strcpy(volume,  cp + 1);
+        StringCbCopyA(volume,  sizeof(volume), cp + 1);
        
         /* Get the full name for this cell */
         code = cm_SearchCellFile(cell, fullCell, 0, 0);
@@ -1469,10 +1470,10 @@ long cm_IoctlCreateMountPoint(struct smb_ioctl *ioctlp, struct cm_user *userp)
         if (code)
             return CM_ERROR_NOSUCHCELL;
        
-        sprintf(mpInfo, "%c%s:%s", *ioctlp->inDatap, fullCell, volume);
+        StringCbPrintfA(mpInfo, sizeof(mpInfo), "%c%s:%s", *ioctlp->inDatap, fullCell, volume);
     } else {
         /* No cell name specified */
-        strcpy(mpInfo, ioctlp->inDatap);
+        StringCbCopyA(mpInfo, sizeof(mpInfo), ioctlp->inDatap);
     }
 
 #ifdef AFS_FREELANCE_CLIENT
@@ -1504,7 +1505,7 @@ long cm_IoctlCreateMountPoint(struct smb_ioctl *ioctlp, struct cm_user *userp)
 
 long cm_IoctlSymlink(struct smb_ioctl *ioctlp, struct cm_user *userp)
 {
-    char leaf[256];
+    char leaf[LEAF_SIZE];
     long code;
     cm_scache_t *dscp;
     cm_attr_t tattr;
@@ -1596,11 +1597,11 @@ long cm_IoctlListlink(struct smb_ioctl *ioctlp, struct cm_user *userp)
     if (code == 0) {
         cp = ioctlp->outDatap;
         if (newRootScp != NULL) {
-            strcpy(cp, cm_mountRoot);
-            strcat(cp, "/");
+            StringCbCopyA(cp, 999999, cm_mountRoot);
+            StringCbCatA(cp, 999999, "/");
             cp += strlen(cp);
         }
-        strcpy(cp, spacep->data);
+        StringCbCopyA(cp, 999999, spacep->data);
         cp += strlen(cp) + 1;
         ioctlp->outDatap = cp;
         cm_FreeSpace(spacep);
@@ -1814,7 +1815,8 @@ long cm_IoctlSetToken(struct smb_ioctl *ioctlp, struct cm_user *userp)
     ucellp->kvno = ct.AuthHandle;
     ucellp->expirationTime = ct.EndTimestamp;
     ucellp->gen++;
-    if (uname) strcpy(ucellp->userName, uname);
+    if (uname) 
+        StringCbCopyA(ucellp->userName, MAXKTCNAMELEN, uname);
     ucellp->flags |= CM_UCELLFLAG_RXKAD;
     lock_ReleaseMutex(&userp->mx);
 
@@ -1900,11 +1902,11 @@ long cm_IoctlGetTokenIter(struct smb_ioctl *ioctlp, struct cm_user *userp)
     cp += sizeof(temp);
 
     /* cell name */
-    strcpy(cp, ucellp->cellp->namep);
+    StringCbCopyA(cp, 999999, ucellp->cellp->namep);
     cp += strlen(cp) + 1;
 
     /* user name */
-    strcpy(cp, ucellp->userName);
+    StringCbCopyA(cp, 999999, ucellp->userName);
     cp += strlen(cp) + 1;
 
     ioctlp->outDatap = cp;
@@ -1988,11 +1990,11 @@ long cm_IoctlGetToken(struct smb_ioctl *ioctlp, struct cm_user *userp)
     cp += sizeof(temp);
 
     /* cell name */
-    strcpy(cp, ucellp->cellp->namep);
+    StringCbCopyA(cp, 999999, ucellp->cellp->namep);
     cp += strlen(cp) + 1;
 
     /* user name */
-    strcpy(cp, ucellp->userName);
+    StringCbCopyA(cp, 999999, ucellp->userName);
     cp += strlen(cp) + 1;
 
     ioctlp->outDatap = cp;
@@ -2084,7 +2086,7 @@ long cm_IoctlMakeSubmount(smb_ioctl_t *ioctlp, cm_user_t *userp)
     /* Parse the input parameters--first the required afs path,
      * then the requested submount name (which may be "").
      */
-    cm_NormalizeAfsPath (afspath, ioctlp->inDatap);
+    cm_NormalizeAfsPath (afspath, sizeof(afspath), ioctlp->inDatap);
     submountreqp = ioctlp->inDatap + (strlen(ioctlp->inDatap)+1);
 
     /* If the caller supplied a suggested submount name, see if
@@ -2125,9 +2127,9 @@ long cm_IoctlMakeSubmount(smb_ioctl_t *ioctlp, cm_user_t *userp)
                            strlen(&afspath[strlen(cm_mountRoot)])+1:2);
 
             RegCloseKey( hkSubmounts );
-                       strcpy(ioctlp->outDatap, submountreqp);
-                       ioctlp->outDatap += strlen(ioctlp->outDatap) +1;
-                       lock_ReleaseMutex(&cm_Afsdsbmt_Lock);
+            StringCbCopyA(ioctlp->outDatap, 999999, submountreqp);
+            ioctlp->outDatap += strlen(ioctlp->outDatap) +1;
+            lock_ReleaseMutex(&cm_Afsdsbmt_Lock);
             return 0;
         }
 
@@ -2135,9 +2137,9 @@ long cm_IoctlMakeSubmount(smb_ioctl_t *ioctlp, cm_user_t *userp)
          * supplied path matches the submount's path, we can still
          * use the suggested submount name.
          */
-        cm_NormalizeAfsPath (submountPathNormalized, submountPath);
+        cm_NormalizeAfsPath (submountPathNormalized, sizeof(submountPathNormalized), submountPath);
         if (!strcmp (submountPathNormalized, afspath)) {
-            strcpy(ioctlp->outDatap, submountreqp);
+            StringCbCopyA(ioctlp->outDatap, 999999, submountreqp);
             ioctlp->outDatap += strlen(ioctlp->outDatap) +1;
             RegCloseKey( hkSubmounts );
             lock_ReleaseMutex(&cm_Afsdsbmt_Lock);
@@ -2204,9 +2206,9 @@ long cm_IoctlMakeSubmount(smb_ioctl_t *ioctlp, cm_user_t *userp)
          * that our caller specified. If so, we can return
          * this submount.
          */
-        cm_NormalizeAfsPath (submountPathNormalized, submountPath);
+        cm_NormalizeAfsPath (submountPathNormalized, sizeof(submountPathNormalized), submountPath);
         if (!strcmp (submountPathNormalized, afspath)) {
-            strcpy(ioctlp->outDatap, submountName);
+            StringCbCopyA(ioctlp->outDatap, 999999, submountName);
             ioctlp->outDatap += strlen(ioctlp->outDatap) +1;
             RegCloseKey(hkSubmounts);
             lock_ReleaseMutex(&cm_Afsdsbmt_Lock);
@@ -2221,7 +2223,7 @@ long cm_IoctlMakeSubmount(smb_ioctl_t *ioctlp, cm_user_t *userp)
      * when writing out the submount.
      */
 
-    sprintf(ioctlp->outDatap, "auto%ld", nextAutoSubmount);
+    StringCbPrintfA(ioctlp->outDatap, 999999, "auto%ld", nextAutoSubmount);
 
     RegSetValueEx( hkSubmounts, 
                    ioctlp->outDatap,
index b5e2a7626f886a3cb29ebe98f321361a1575bdbd..41577dcc83872361bf5f57d8f32ac88d51ab19fc 100644 (file)
@@ -235,7 +235,7 @@ cm_scache_t *cm_FindSCache(cm_fid_t *fidp)
     lock_ObtainWrite(&cm_scacheLock);
     for(scp=cm_hashTablep[hash]; scp; scp=scp->nextp) {
         if (cm_FidCmp(fidp, &scp->fid) == 0) {
-            scp->refCount++;
+            cm_HoldSCacheNoLock(scp);
             cm_AdjustLRU(scp);
             lock_ReleaseWrite(&cm_scacheLock);
             return scp;
@@ -272,9 +272,9 @@ long cm_GetSCache(cm_fid_t *fidp, cm_scache_t **outScpp, cm_user_t *userp,
     // yj: check if we have the scp, if so, we don't need
     // to do anything else
     lock_ObtainWrite(&cm_scacheLock);
-    for(scp=cm_hashTablep[hash]; scp; scp=scp->nextp) {
+    for (scp=cm_hashTablep[hash]; scp; scp=scp->nextp) {
         if (cm_FidCmp(fidp, &scp->fid) == 0) {
-            scp->refCount++;
+            cm_HoldSCacheNoLock(scp);
             *outScpp = scp;
             cm_AdjustLRU(scp);
             lock_ReleaseWrite(&cm_scacheLock);
@@ -369,9 +369,10 @@ long cm_GetSCache(cm_fid_t *fidp, cm_scache_t **outScpp, cm_user_t *userp,
     /* otherwise, we have the volume, now reverify that the scp doesn't
      * exist, and proceed.
      */
-    for(scp=cm_hashTablep[hash]; scp; scp=scp->nextp) {
+    for (scp=cm_hashTablep[hash]; scp; scp=scp->nextp) {
         if (cm_FidCmp(fidp, &scp->fid) == 0) {
-            scp->refCount++;
+                       osi_assert(scp->volp == volp);
+            cm_HoldSCacheNoLock(scp);
             cm_AdjustLRU(scp);
             lock_ReleaseWrite(&cm_scacheLock);
             if (volp)
@@ -978,6 +979,14 @@ void cm_AFSFidFromFid(AFSFid *afsFidp, cm_fid_t *fidp)
     afsFidp->Unique = fidp->unique;
 }       
 
+void cm_HoldSCacheNoLock(cm_scache_t *scp)
+{
+#ifdef NOLOCK_ASSERT
+    osi_assert(scp->refCount > 0);
+#endif
+    scp->refCount++;
+}
+
 void cm_HoldSCache(cm_scache_t *scp)
 {
     lock_ObtainWrite(&cm_scacheLock);
@@ -986,6 +995,11 @@ void cm_HoldSCache(cm_scache_t *scp)
     lock_ReleaseWrite(&cm_scacheLock);
 }
 
+void cm_ReleaseSCacheNoLock(cm_scache_t *scp)
+{
+    osi_assert(scp->refCount-- > 0);
+}
+
 void cm_ReleaseSCache(cm_scache_t *scp)
 {
     lock_ObtainWrite(&cm_scacheLock);
@@ -1033,9 +1047,9 @@ int cm_DumpSCache(FILE *outputFile, char *cookie)
   
     for (scp = cm_scacheLRULastp; scp; scp = (cm_scache_t *) osi_QPrev(&scp->q)) 
     {
-        if (scp->refCount != 0)
+        if (scp->refCount > 0)
         {
-            sprintf(output, "%s fid (cell=%d, volume=%d, vnode=%d, unique=%d) refCount=%d\n", 
+            sprintf(output, "%s fid (cell=%d, volume=%d, vnode=%d, unique=%d) refCount=%u\n", 
                     cookie, scp->fid.cell, scp->fid.volume, scp->fid.vnode, scp->fid.unique, 
                     scp->refCount);
             WriteFile(outputFile, output, strlen(output), &zilch, NULL);
@@ -1051,9 +1065,9 @@ int cm_DumpSCache(FILE *outputFile, char *cookie)
         {
             if (scp)
             {
-                if (scp->refCount)
+                if (scp->refCount > 0)
                 {
-                    sprintf(output, "%s scp=0x%08X, hash=%d, fid (cell=%d, volume=%d, vnode=%d, unique=%d) refCount=%d\n", 
+                    sprintf(output, "%s scp=0x%08X, hash=%d, fid (cell=%d, volume=%d, vnode=%d, unique=%d) refCount=%u\n", 
                             cookie, (void *)scp, i, scp->fid.cell, scp->fid.volume, scp->fid.vnode, 
                             scp->fid.unique, scp->refCount);
                     WriteFile(outputFile, output, strlen(output), &zilch, NULL);
index 3cf2bf33c1508cc42d5ce265248de3b5fcc077ce..a162bb9aecddc158083974560f4d3de7cce86ea4 100644 (file)
@@ -58,7 +58,7 @@ typedef struct cm_scache {
                                         * write-locked to prevent buffers from
                                          * being created during a truncate op, etc.
                                          */
-        unsigned long refCount;                        /* reference count; cm_scacheLock */
+        long refCount;                 /* reference count; cm_scacheLock */
         osi_queueData_t *bufReadsp;    /* queue of buffers being read */
         osi_queueData_t *bufWritesp;   /* queue of buffers being written */
 
@@ -240,8 +240,12 @@ extern void cm_MergeStatus(cm_scache_t *, struct AFSFetchStatus *, struct AFSVol
 
 extern void cm_AFSFidFromFid(struct AFSFid *, cm_fid_t *);
 
+extern void cm_HoldSCacheNoLock(cm_scache_t *);
+
 extern void cm_HoldSCache(cm_scache_t *);
 
+extern void cm_ReleaseSCacheNoLock(cm_scache_t *);
+
 extern void cm_ReleaseSCache(cm_scache_t *);
 
 extern cm_scache_t *cm_FindSCache(cm_fid_t *fidp);
@@ -256,4 +260,6 @@ extern cm_scache_t **cm_hashTablep;
 
 extern void cm_DiscardSCache(cm_scache_t *scp);
 
+extern int cm_FindFileType(cm_fid_t *fidp);
+
 #endif /*  __CM_SCACHE_H_ENV__ */
index 0ea6e6787f9a3fa2d6d3797f7a8f8bad1251ca59..348350769a861695627e425bad4f070f5a9bbebe 100644 (file)
  * at the appropriate times to change the pointers to these servers.
  */
 typedef struct cm_server {
-       struct cm_server *allNextp;             /* locked by cm_serverLock */
+    struct cm_server *allNextp;                /* locked by cm_serverLock */
     struct sockaddr_in addr;           /* by mx */
     int type;                          /* by mx */
-       struct cm_conn *connsp;                 /* locked by cm_connLock */
+    struct cm_conn *connsp;            /* locked by cm_connLock */
     long flags;                                /* by mx */
-    struct cm_cell *cellp;                     /* cell containing this server */
-       unsigned long refCount;                         /* locked by cm_serverLock */
-    osi_mutex_t mx;
-       unsigned short ipRank;                  /* server priority */
+    struct cm_cell *cellp;             /* cell containing this server */
+    unsigned long refCount;            /* locked by cm_serverLock */
+    osi_mutex_t mx;                     
+    unsigned short ipRank;             /* server priority */
 } cm_server_t;
 
 enum repstate {not_busy, busy, offline};
index d59c2367ea95a9ad87e1f954ad41c841643d8873..6d7ba073f51c53579d18e265be66979b55ab9212 100644 (file)
@@ -27,95 +27,98 @@ cm_user_t *cm_rootUserp;
 
 void cm_InitUser(void)
 {
-       static osi_once_t once;
+    static osi_once_t once;
         
-        if (osi_Once(&once)) {
-               lock_InitializeRWLock(&cm_userLock, "cm_userLock");
-                osi_EndOnce(&once);
-       }
+    if (osi_Once(&once)) {
+        lock_InitializeRWLock(&cm_userLock, "cm_userLock");
+        osi_EndOnce(&once);
+    }
         
-        cm_rootUserp = cm_NewUser();
+    cm_rootUserp = cm_NewUser();
 }
 
 cm_user_t *cm_NewUser(void)
 {
-       cm_user_t *up;
+    cm_user_t *up;
         
-        up = malloc(sizeof(*up));
-        memset(up, 0, sizeof(*up));
-        up->refCount = 1;
-        up->vcRefs = 1;                /* from caller */
-        lock_InitializeMutex(&up->mx, "cm_user_t");
-        return up;
+    up = malloc(sizeof(*up));
+    memset(up, 0, sizeof(*up));
+    up->refCount = 1;
+    up->vcRefs = 1;            /* from caller */
+    lock_InitializeMutex(&up->mx, "cm_user_t");
+    return up;
 }
 
 /* must be called with locked userp */
 cm_ucell_t *cm_GetUCell(cm_user_t *userp, cm_cell_t *cellp)
 {
-       cm_ucell_t *ucp;
+    cm_ucell_t *ucp;
         
-       lock_AssertMutex(&userp->mx);
-        for(ucp = userp->cellInfop; ucp; ucp=ucp->nextp) {
-               if (ucp->cellp == cellp) break;
-        }
+    lock_AssertMutex(&userp->mx);
+    for (ucp = userp->cellInfop; ucp; ucp=ucp->nextp) {
+        if (ucp->cellp == cellp) 
+            break;
+    }
         
-        if (!ucp) {
-               ucp = malloc(sizeof(*ucp));
-                memset(ucp, 0, sizeof(*ucp));
-                ucp->nextp = userp->cellInfop;
-               if (userp->cellInfop)
-                       ucp->iterator = userp->cellInfop->iterator + 1;
-               else
-                       ucp->iterator = 1;
-                userp->cellInfop = ucp;
-                ucp->cellp = cellp;
-        }
+    if (!ucp) {
+        ucp = malloc(sizeof(*ucp));
+        memset(ucp, 0, sizeof(*ucp));
+        ucp->nextp = userp->cellInfop;
+        if (userp->cellInfop)
+            ucp->iterator = userp->cellInfop->iterator + 1;
+        else
+            ucp->iterator = 1;
+        userp->cellInfop = ucp;
+        ucp->cellp = cellp;
+    }
         
-        return ucp;
+    return ucp;
 }
 
 cm_ucell_t *cm_FindUCell(cm_user_t *userp, int iterator)
 {
-       cm_ucell_t *ucp;
-       cm_ucell_t *best;
-
-       best = NULL;
-       lock_AssertMutex(&userp->mx);
-       for (ucp = userp->cellInfop; ucp; ucp = ucp->nextp) {
-               if (ucp->iterator >= iterator)
-                       best = ucp;
-               else
-                       break;
-       }
-       return best;
+    cm_ucell_t *ucp;
+    cm_ucell_t *best;
+
+    best = NULL;
+    lock_AssertMutex(&userp->mx);
+    for (ucp = userp->cellInfop; ucp; ucp = ucp->nextp) {
+        if (ucp->iterator >= iterator)
+            best = ucp;
+        else
+            break;
+    }       
+    return best;
 }
 
 void cm_HoldUser(cm_user_t *up)
 {
-       lock_ObtainWrite(&cm_userLock);
-       up->refCount++;
-       lock_ReleaseWrite(&cm_userLock);
+    lock_ObtainWrite(&cm_userLock);
+    up->refCount++;
+    lock_ReleaseWrite(&cm_userLock);
 }
 
 void cm_ReleaseUser(cm_user_t *up)
 {
-       cm_ucell_t *ucp;
+    cm_ucell_t *ucp;
     cm_ucell_t *ncp;
 
-       if (up == NULL) return;
-
-       lock_ObtainWrite(&cm_userLock);
-       osi_assert(up->refCount-- > 0);
-       if (up->refCount == 0) {
-               lock_FinalizeMutex(&up->mx);
-        for(ucp = up->cellInfop; ucp; ucp = ncp) {
-                       ncp = ucp->nextp;
-                       if (ucp->ticketp) free(ucp->ticketp);
+    if (up == NULL) 
+        return;
+
+    lock_ObtainWrite(&cm_userLock);
+    osi_assert(up->refCount-- > 0);
+    if (up->refCount == 0) {
+        lock_FinalizeMutex(&up->mx);
+        for (ucp = up->cellInfop; ucp; ucp = ncp) {
+            ncp = ucp->nextp;
+            if (ucp->ticketp) 
+                free(ucp->ticketp);
             free(ucp);
         }
         free(up);
     }
-       lock_ReleaseWrite(&cm_userLock);
+    lock_ReleaseWrite(&cm_userLock);
 }
 
 /* release the count of the # of connections that use this user structure.
@@ -126,10 +129,10 @@ void cm_ReleaseUser(cm_user_t *up)
  */
 void cm_ReleaseUserVCRef(cm_user_t *userp)
 {
-       lock_ObtainMutex(&userp->mx);
-       osi_assert(userp->vcRefs-- > 0);
-       lock_ReleaseMutex(&userp->mx);
-}
+    lock_ObtainMutex(&userp->mx);
+    osi_assert(userp->vcRefs-- > 0);
+    lock_ReleaseMutex(&userp->mx);
+}       
 
 
 /*
@@ -142,46 +145,47 @@ void cm_ReleaseUserVCRef(cm_user_t *userp)
  */
 void cm_CheckTokenCache(long now)
 {
-        extern smb_vc_t *smb_allVCsp; /* global vcp list */
-       smb_vc_t   *vcp;
-       smb_user_t *usersp;
-       cm_user_t  *userp = NULL;
-       cm_ucell_t *ucellp;
-       BOOL bExpired=FALSE;
-  
-       /* 
-        * For every vcp, get the user and check his tokens 
-        */
-       lock_ObtainWrite(&smb_rctLock);
-       for(vcp=smb_allVCsp; vcp; vcp=vcp->nextp) {
-               for(usersp=vcp->usersp; usersp; usersp=usersp->nextp) {
-                               if (usersp->unp) {
-                          if ((userp=usersp->unp->userp)==0)
-                                          continue;
-                               } else
-                                       continue;
-                       lock_ObtainMutex(&userp->mx);
-                       for(ucellp=userp->cellInfop; ucellp; ucellp=ucellp->nextp) {
-                         if(ucellp->flags & CM_UCELLFLAG_RXKAD) {
-                           if(ucellp->expirationTime < now) {
-                                 /* this guy's tokens have expired */
-                                 osi_Log3(afsd_logp, "cm_CheckTokens: Tokens for user:%s have expired expiration time:0x%x ucellp:%x", ucellp->userName, ucellp->expirationTime, ucellp);
-                                 if (ucellp->ticketp) {
-                                         free(ucellp->ticketp);
-                                         ucellp->ticketp = NULL;
-                                 }
-                                 ucellp->flags &= ~CM_UCELLFLAG_RXKAD;
-                                 ucellp->gen++;
-                                 bExpired=TRUE;
-                           }
-                         } 
-                       }
-                       lock_ReleaseMutex(&userp->mx);
-                       if(bExpired) {
-                               bExpired=FALSE;
-                               cm_ResetACLCache(userp);
-                       }
-               }
-       }
-       lock_ReleaseWrite(&smb_rctLock);
+    extern smb_vc_t *smb_allVCsp; /* global vcp list */
+    smb_vc_t   *vcp;
+    smb_user_t *usersp;
+    cm_user_t  *userp = NULL;
+    cm_ucell_t *ucellp;
+    BOOL bExpired=FALSE;
+
+    /* 
+     * For every vcp, get the user and check his tokens 
+     */
+    lock_ObtainWrite(&smb_rctLock);
+    for (vcp=smb_allVCsp; vcp; vcp=vcp->nextp) {
+        for (usersp=vcp->usersp; usersp; usersp=usersp->nextp) {
+            if (usersp->unp) {
+                if ((userp=usersp->unp->userp)==0)
+                    continue;
+            } else
+                continue;
+            lock_ObtainMutex(&userp->mx);
+            for (ucellp=userp->cellInfop; ucellp; ucellp=ucellp->nextp) {
+                if (ucellp->flags & CM_UCELLFLAG_RXKAD) {
+                    if (ucellp->expirationTime < now) {
+                        /* this guy's tokens have expired */
+                        osi_Log3(afsd_logp, "cm_CheckTokens: Tokens for user:%s have expired expiration time:0x%x ucellp:%x", 
+                                 ucellp->userName, ucellp->expirationTime, ucellp);
+                        if (ucellp->ticketp) {
+                            free(ucellp->ticketp);
+                            ucellp->ticketp = NULL;
+                        }
+                        ucellp->flags &= ~CM_UCELLFLAG_RXKAD;
+                        ucellp->gen++;
+                        bExpired=TRUE;
+                    }
+                } 
+            }
+            lock_ReleaseMutex(&userp->mx);
+            if (bExpired) {
+                bExpired=FALSE;
+                cm_ResetACLCache(userp);
+            }
+        }
+    }
+    lock_ReleaseWrite(&smb_rctLock);
 }
index 1e586498b8d2153b7943dfc213539ee570e1d00a..17453e11a9c91d3a4c5fa33a354414f53a6dfb45 100644 (file)
  * corresponding userp's userp->mx mutex.
  */
 typedef struct cm_ucell {
-       struct cm_ucell *nextp;         /* next cell in the list */
-        struct cm_cell *cellp;         /* the cell this applies to */
-       char *ticketp;                  /* locked by mx */
-        int ticketLen;                 /* by mx */
-        struct ktc_encryptionKey sessionKey;   /* by mx */
-        long kvno;                     /* key version in ticket */
-        long expirationTime;           /* when tix expire */
-       int gen;                        /* generation number */
-       int iterator;                   /* for use as ListTokens cookie */
-        long flags;                    /* flags */
-       char userName[MAXKTCNAMELEN];   /* user name */
+    struct cm_ucell *nextp;            /* next cell in the list */
+    struct cm_cell *cellp;             /* the cell this applies to */
+    char *ticketp;                     /* locked by mx */
+    int ticketLen;                     /* by mx */
+    struct ktc_encryptionKey sessionKey;/* by mx */
+    long kvno;                         /* key version in ticket */
+    long expirationTime;               /* when tix expire */
+    int gen;                           /* generation number */
+    int iterator;                      /* for use as ListTokens cookie */
+    long flags;                                /* flags */
+    char userName[MAXKTCNAMELEN];      /* user name */
 } cm_ucell_t;
 
 #define CM_UCELLFLAG_HASTIX    1       /* has Kerberos tickets */
 #define CM_UCELLFLAG_RXKAD     2       /* an rxkad connection */
 #define CM_UCELLFLAG_BADTIX    4       /* tickets are bad or expired */
+#define CM_UCELLFLAG_RXGK       8       /* an rxgk connection */
 
 typedef struct cm_user {
-       unsigned long refCount;                 /* ref count */
-       cm_ucell_t *cellInfop;          /* list of cell info */
-        osi_mutex_t mx;                        /* mutex */
-        int vcRefs;                    /* count of references from virtual circuits */
-        long flags;
+    unsigned long refCount;             /* ref count - cm_userLock */
+    cm_ucell_t *cellInfop;             /* list of cell info */
+    osi_mutex_t mx;                    /* mutex */
+    int vcRefs;                                /* count of references from virtual circuits */
+    long flags;
 } cm_user_t;
 
 #define CM_USERFLAG_DELETE     1       /* delete on last reference */
index 0455b40f75b8042f5078984c184a0c02e9a9731f..af8e7f6aa0dee9fbe3a0323fa4ab018c26c637e5 100644 (file)
@@ -552,10 +552,13 @@ long cm_ApplyDir(cm_scache_t *scp, cm_DirFuncp_t funcp, void *parmp,
             lock_ObtainRead(&scp->bufCreateLock);
             code = buf_Get(scp, &thyper, &bufferp);
             lock_ReleaseRead(&scp->bufCreateLock);
+                       if (code) {
+                               /* if buf_Get() fails we do not have a buffer object to lock */
+                bufferp = NULL;
+                break;
+                       }
 
             lock_ObtainMutex(&bufferp->mx);
-            if (code) 
-                break;
             bufferOffset = thyper;
 
             /* now get the data in the cache */
@@ -1004,10 +1007,29 @@ long cm_LookupInternal(cm_scache_t *dscp, char *namep, long flags, cm_user_t *us
                 return CM_ERROR_NOSUCHFILE;
         }
         else {  /* nonexistent dir on freelance root, so add it */
+            char fullname[200] = ".";
+            int  found = 0;
+
             osi_Log1(afsd_logp,"cm_Lookup adding mount for non-existent directory: %s", 
                       osi_LogSaveString(afsd_logp,namep));
-            code = cm_FreelanceAddMount(namep, namep, "root.cell.", namep[0] == '.', &rock.fid);
-            if (code < 0) {   /* add mount point failed, so give up */
+            if (namep[0] == '.') {
+                if (cm_GetCell_Gen(&namep[1], &fullname[1], CM_FLAG_CREATE)) {
+                    found = 1;
+                    if ( stricmp(&namep[1], &fullname[1]) )
+                        code = cm_FreelanceAddSymlink(namep, fullname, &rock.fid);
+                    else
+                        code = cm_FreelanceAddMount(namep, &fullname[1], "root.cell.", 1, &rock.fid);
+                }
+            } else {
+                if (cm_GetCell_Gen(namep, fullname, CM_FLAG_CREATE)) {
+                    found = 1;
+                    if ( stricmp(namep, fullname) )
+                        code = cm_FreelanceAddSymlink(namep, fullname, &rock.fid);
+                    else
+                        code = cm_FreelanceAddMount(namep, fullname, "root.cell.", 0, &rock.fid);
+                }
+            }
+            if (!found || code < 0) {   /* add mount point failed, so give up */
                 if (flags & CM_FLAG_CHECKPATH)
                     return CM_ERROR_NOSUCHPATH;
                 else
index c784a354513d8d9a5f38f7cd09a9d55e695a265b..f8ab0114e928cae766ce266e34107d1474688c25 100644 (file)
@@ -39,123 +39,244 @@ void cm_InitVolume(void)
 
 /*
  * Update a volume.  Caller holds volume's lock (volp->mx).
+ *
+ *
+ *  shadow / openafs / jhutz@CS.CMU.EDU {ANDREW.CMU.EDU}  01:38    (JHutz)
+ *    Yes, we support multihomed fileservers.
+ *    Since before we got the code from IBM.
+ *    But to find out about multiple addresses on a multihomed server, you need
+ *    to use VL_GetEntryByNameU and VL_GetAddrsU.  If you use
+ *    VL_GetEntryByNameO or VL_GetEntryByNameN, the vlserver just gives you one
+ *    address per server.
+ *  shadow / openafs / jhutz@CS.CMU.EDU {ANDREW.CMU.EDU}  01:39    (JHutz)
+ *    see src/afs/afs_volume.c, paying particular attention to
+ *    afs_NewVolumeByName, afs_SetupVolume, and InstallUVolumeEntry
+ *  shadow / openafs / jaltman {ANDREW.CMU.EDU}  01:40    (Jeffrey Altman)
+ *    thanks.  The windows client calls the 0 versions.
+ *  shadow / openafs / jhutz@CS.CMU.EDU {ANDREW.CMU.EDU}  01:51    (JHutz)
+ *    Oh.  Ew.
+ *    By not using the N versions, you only get up to 8 sites instead of 13.
+ *    By not using the U versions, you don't get to know about multihomed serve
+ *  shadow / openafs / jhutz@CS.CMU.EDU {ANDREW.CMU.EDU}  01:52    (JHutz)
+ *    Of course, you probably want to support the older versions for backward
+ *    compatibility.  If you do that, you need to call the newest interface
+ *    first, and fall back to successively older versions if you get
+ *    RXGEN_OPCODE.
  */
+#define MULTIHOMED 1
 long cm_UpdateVolume(struct cm_cell *cellp, cm_user_t *userp, cm_req_t *reqp,
        cm_volume_t *volp)
 {
     cm_conn_t *connp;
-    int i;
-       cm_serverRef_t *tsrp;
+    int i, j, k;
+    cm_serverRef_t *tsrp;
     cm_server_t *tsp;
     struct sockaddr_in tsockAddr;
     long tflags;
     u_long tempAddr;
-    struct vldbentry vldbEntry;        /* don't use NVLDB yet; they're not common */
-       int ROcount = 0;
-       long code;
+    struct vldbentry vldbEntry;
+    struct nvldbentry nvldbEntry;
+#ifdef MULTIHOMED
+    struct uvldbentry uvldbEntry;
+#endif
+    int type = -1;
+    int ROcount = 0;
+    long code;
 
-       /* clear out old bindings */
+    /* clear out old bindings */
     cm_FreeServerList(&volp->rwServersp);
     cm_FreeServerList(&volp->roServersp);
     cm_FreeServerList(&volp->bkServersp);
 
     /* now we have volume structure locked and held; make RPC to fill it */
     do {
-               code = cm_ConnByMServers(cellp->vlServersp, userp, reqp,
-                                  &connp);
-        if (code) continue;
-               osi_Log1(afsd_logp, "CALL VL_GetEntryByNameO name %s",
-                  volp->namep);
-        code = VL_GetEntryByNameO(connp->callp, volp->namep, &vldbEntry);
-       } while (cm_Analyze(connp, userp, reqp, NULL, NULL, cellp->vlServersp, NULL, code));
+        code = cm_ConnByMServers(cellp->vlServersp, userp, reqp, &connp);
+        if (code) 
+            continue;
+        osi_Log1(afsd_logp, "CALL VL_GetEntryByName{UNO} name %s", volp->namep);
+#ifdef MULTIHOMED
+        code = VL_GetEntryByNameU(connp->callp, volp->namep, &uvldbEntry);
+               type = 2;
+        if ( code == RXGEN_OPCODE ) 
+#endif
+        {
+            code = VL_GetEntryByNameN(connp->callp, volp->namep, &nvldbEntry);
+            type = 1;
+        }
+        if ( code == RXGEN_OPCODE ) {
+            code = VL_GetEntryByNameO(connp->callp, volp->namep, &vldbEntry);
+            type = 0;
+        }
+    } while (cm_Analyze(connp, userp, reqp, NULL, NULL, cellp->vlServersp, NULL, code));
     code = cm_MapVLRPCError(code, reqp);
 
     if (code == 0) {
-               /* decode the response */
-               lock_ObtainWrite(&cm_volumeLock);
-        if (vldbEntry.flags & VLF_RWEXISTS)
-            volp->rwID = vldbEntry.volumeId[0];
-               else
+        afs_int32 flags;
+        afs_int32 nServers;
+        afs_int32 rwID;
+        afs_int32 roID;
+        afs_int32 bkID;
+        afs_int32 serverNumber[NMAXNSERVERS];
+        afs_int32 serverFlags[NMAXNSERVERS];
+
+        switch ( type ) {
+        case 0:
+            flags = vldbEntry.flags;
+            nServers = vldbEntry.nServers;
+            rwID = vldbEntry.volumeId[0];
+            roID = vldbEntry.volumeId[1];
+            bkID = vldbEntry.volumeId[2];
+            for ( i=0; i<nServers; i++ ) {
+                serverFlags[i] = vldbEntry.serverFlags[i];
+                serverNumber[i] = vldbEntry.serverNumber[i];
+            }
+            break;
+        case 1:
+            flags = nvldbEntry.flags;
+            nServers = nvldbEntry.nServers;
+            rwID = nvldbEntry.volumeId[0];
+            roID = nvldbEntry.volumeId[1];
+            bkID = nvldbEntry.volumeId[2];
+            for ( i=0; i<nServers; i++ ) {
+                serverFlags[i] = nvldbEntry.serverFlags[i];
+                serverNumber[i] = nvldbEntry.serverNumber[i];
+            }
+            break;
+#ifdef MULTIHOMED
+        case 2:
+            flags = uvldbEntry.flags;
+            nServers = uvldbEntry.nServers;
+            rwID = uvldbEntry.volumeId[0];
+            roID = uvldbEntry.volumeId[1];
+            bkID = uvldbEntry.volumeId[2];
+            for ( i=0, j=0; i<nServers && j<NMAXNSERVERS; i++ ) {
+                if ( !(uvldbEntry.serverFlags[i] & VLSERVER_FLAG_UUID) ) {
+                    serverFlags[j] = uvldbEntry.serverFlags[i];
+                    serverNumber[j] = uvldbEntry.serverNumber[i].time_low;
+                                       j++;
+                } else {
+                    afs_uint32 * addrp, nentries, code, unique;
+                    bulkaddrs  addrs;
+                    ListAddrByAttributes attrs;
+                    afsUUID uuid;
+
+                    memset((char *)&attrs, 0, sizeof(attrs));
+                    attrs.Mask = VLADDR_UUID;
+                    attrs.uuid = uvldbEntry.serverNumber[i];
+                    memset((char *)&uuid, 0, sizeof(uuid));
+                    memset((char *)&addrs, 0, sizeof(addrs));
+
+                    do {
+                        code = cm_ConnByMServers(cellp->vlServersp, userp, reqp, &connp);
+                        if (code) 
+                            continue;
+                   
+                        code = VL_GetAddrsU(connp->callp, &attrs, &uuid, &unique, &nentries, &addrs);
+
+                        if (code == 0 && nentries == 0)
+                            code = VL_NOENT;
+                    } while (cm_Analyze(connp, userp, reqp, NULL, NULL, cellp->vlServersp, NULL, code));
+                    code = cm_MapVLRPCError(code, reqp);
+                    if (code)
+                        return code;
+
+                    addrp = addrs.bulkaddrs_val;
+                    for (k = 0; k < nentries && j < NMAXNSERVERS; j++, k++) {
+                        serverFlags[j] = uvldbEntry.serverFlags[i];
+                        serverNumber[j] = addrp[k];
+                    }
+
+                    free(addrs.bulkaddrs_val);  /* This is wrong */
+                }
+            }
+                       nServers = j;                                   /* update the server count */
+            break;
+#endif
+        }
+
+        /* decode the response */
+        lock_ObtainWrite(&cm_volumeLock);
+        if (flags & VLF_RWEXISTS)
+            volp->rwID = rwID;
+        else
             volp->rwID = 0;
-        if (vldbEntry.flags & VLF_ROEXISTS)
-            volp->roID = vldbEntry.volumeId[1];
+        if (flags & VLF_ROEXISTS)
+            volp->roID = roID;
         else
             volp->roID = 0;
-        if (vldbEntry.flags & VLF_BACKEXISTS)
-            volp->bkID = vldbEntry.volumeId[2];
-               else
+        if (flags & VLF_BACKEXISTS)
+            volp->bkID = bkID;
+        else
             volp->bkID = 0;
-               lock_ReleaseWrite(&cm_volumeLock);
-        for(i=0; i<vldbEntry.nServers; i++) {
-                       /* create a server entry */
-                       tflags = vldbEntry.serverFlags[i];
-                       if (tflags & VLSF_DONTUSE) continue;
-                       tsockAddr.sin_family = AF_INET;
-                       tempAddr = htonl(vldbEntry.serverNumber[i]);
-                       tsockAddr.sin_addr.s_addr = tempAddr;
-                       tsp = cm_FindServer(&tsockAddr, CM_SERVER_FILE);
-                       if (!tsp)
+        lock_ReleaseWrite(&cm_volumeLock);
+        for (i=0; i<nServers; i++) {
+            /* create a server entry */
+            tflags = serverFlags[i];
+            if (tflags & VLSF_DONTUSE) 
+                continue;
+            tsockAddr.sin_family = AF_INET;
+            tempAddr = htonl(serverNumber[i]);
+            tsockAddr.sin_addr.s_addr = tempAddr;
+            tsp = cm_FindServer(&tsockAddr, CM_SERVER_FILE);
+            if (!tsp)
                 tsp = cm_NewServer(&tsockAddr, CM_SERVER_FILE,
                                     cellp);
 
-                       /* if this server was created by fs setserverprefs */
-                       if ( !tsp->cellp ) 
-                               tsp->cellp = cellp;
+            /* if this server was created by fs setserverprefs */
+            if ( !tsp->cellp ) 
+                tsp->cellp = cellp;
 
             osi_assert(tsp != NULL);
                         
             /* and add it to the list(s). */
-                       /*
+            /*
              * Each call to cm_NewServerRef() increments the
              * ref count of tsp.  These reference will be dropped,
-                        * if and when the volume is reset; see reset code
-                        * earlier in this function.
-                        */
-                       if ((tflags & VLSF_RWVOL)
-                 && (vldbEntry.flags & VLF_RWEXISTS)) {
-                               tsrp = cm_NewServerRef(tsp);
+             * if and when the volume is reset; see reset code
+             * earlier in this function.
+             */
+            if ((tflags & VLSF_RWVOL) && (flags & VLF_RWEXISTS)) {
+                tsrp = cm_NewServerRef(tsp);
                 cm_InsertServerList(&volp->rwServersp, tsrp);
                 lock_ObtainWrite(&cm_serverLock);
                 tsrp->refCount--;       /* drop allocation reference */
                 lock_ReleaseWrite(&cm_serverLock);
-                       }
-            if ((tflags & VLSF_ROVOL)
-                 && (vldbEntry.flags & VLF_ROEXISTS)) {
-                               tsrp = cm_NewServerRef(tsp);
-                               cm_InsertServerList(&volp->roServersp, tsrp);
+            }
+            if ((tflags & VLSF_ROVOL) && (flags & VLF_ROEXISTS)) {
+                tsrp = cm_NewServerRef(tsp);
+                cm_InsertServerList(&volp->roServersp, tsrp);
                 lock_ObtainWrite(&cm_serverLock);
                 tsrp->refCount--;       /* drop allocation reference */
                 lock_ReleaseWrite(&cm_serverLock);
-                               ROcount++;
+                ROcount++;
             }
-                       /* We don't use VLSF_BACKVOL !?! */
-            if ((tflags & VLSF_RWVOL)
-                 && (vldbEntry.flags & VLF_BACKEXISTS)) {
-                               tsrp = cm_NewServerRef(tsp);
+            /* We don't use VLSF_BACKVOL !?! */
+            if ((tflags & VLSF_RWVOL) && (flags & VLF_BACKEXISTS)) {
+                tsrp = cm_NewServerRef(tsp);
                 cm_InsertServerList(&volp->bkServersp, tsrp);
                 lock_ObtainWrite(&cm_serverLock);
                 tsrp->refCount--;       /* drop allocation reference */
                 lock_ReleaseWrite(&cm_serverLock);
-                       }
-                       /* Drop the reference obtained by cm_FindServer() */
-                       cm_PutServer(tsp);
+            }
+            /* Drop the reference obtained by cm_FindServer() */
+            cm_PutServer(tsp);
+        }       
+
+        /*
+         * Randomize RO list
+         *
+         * If the first n servers have the same ipRank, then we 
+         * randomly pick one among them and move it to the beginning.
+         * We don't bother to re-order the whole list because
+         * the rest of the list is used only if the first server is
+         * down.  We only do this for the RO list; we assume the other
+         * lists are length 1.
+         */
+        if (ROcount > 1) {
+            cm_RandomizeServer(&volp->roServersp);
         }
-
-               /*
-                * Randomize RO list
-                *
-                * If the first n servers have the same ipRank, then we 
-                * randomly pick one among them and move it to the beginning.
-                * We don't bother to re-order the whole list because
-                * the rest of the list is used only if the first server is
-                * down.  We only do this for the RO list; we assume the other
-                * lists are length 1.
-                */
-               if (ROcount > 1) {
-                       cm_RandomizeServer(&volp->roServersp);
-               }
-       }
-       return code;
+    }
+    return code;
 }
 
 long cm_GetVolumeByID(cm_cell_t *cellp, long volumeID, cm_user_t *userp,
index ebea271a77f8a17e42fefecfb547b3a353ac230c..573b9745c64cb63c434e05dd462d85a7e4bda521 100644 (file)
@@ -51,6 +51,8 @@ int smbShutdownFlag = 0;
 int smb_LogoffTokenTransfer;
 time_t smb_LogoffTransferTimeout;
 
+int smb_StoreAnsiFilenames = 0;
+
 DWORD last_msg_time = 0;
 
 long ongoingOps = 0;
@@ -95,6 +97,7 @@ LSA_STRING smb_lsaLogonOrigin;
 #define NCBmax MAXIMUM_WAIT_OBJECTS
 EVENT_HANDLE NCBavails[NCBmax], NCBevents[NCBmax];
 EVENT_HANDLE **NCBreturns;
+EVENT_HANDLE *smb_ServerShutdown;
 DWORD NCBsessions[NCBmax];
 NCB *NCBs[NCBmax];
 struct smb_packet *bufs[NCBmax];
@@ -157,7 +160,7 @@ extern HANDLE WaitToTerminate;
  * Time in Unix format of midnight, 1/1/1970 local time.
  * When added to dosUTime, gives Unix (AFS) time.
  */
-long smb_localZero = 0;
+time_t smb_localZero = 0;
 
 /* Time difference for converting to kludge-GMT */
 int smb_NowTZ;
@@ -362,6 +365,10 @@ char * myCrt_2Dispatch(int i)
         return "S(0d)_ReceiveTran2CreateDirectory";
     case 14:
         return "S(0e)_ReceiveTran2SessionSetup";
+    case 16:
+        return "S(10)_ReceiveTran2GetDfsReferral";
+    case 17:
+        return "S(11)_ReceiveTran2ReportDfsInconsistency";
     }
 }       
 
@@ -392,14 +399,7 @@ unsigned int smb_Attributes(cm_scache_t *scp)
     {
         attrs = SMB_ATTR_DIRECTORY;
 #ifdef SPECIAL_FOLDERS
-#ifdef AFS_FREELANCE_CLIENT
-        if ( cm_freelanceEnabled &&
-             scp->fid.cell==AFS_FAKE_ROOT_CELL_ID && 
-             scp->fid.volume==AFS_FAKE_ROOT_VOL_ID &&
-             scp->fid.vnode==0x1 && scp->fid.unique==0x1) {
-            attrs |= SMB_ATTR_SYSTEM;          /* FILE_ATTRIBUTE_SYSTEM */
-        }
-#endif /* AFS_FREELANCE_CLIENT */
+        attrs |= SMB_ATTR_SYSTEM;              /* FILE_ATTRIBUTE_SYSTEM */
 #endif /* SPECIAL_FOLDERS */
     } else
         attrs = 0;
@@ -713,7 +713,7 @@ void smb_UnixTimeFromLargeSearchTime(time_t *unixTimep, FILETIME *largeTimep)
 }       
 #endif /* !DJGPP */
 
-void smb_SearchTimeFromUnixTime(long *dosTimep, time_t unixTime)
+void smb_SearchTimeFromUnixTime(time_t *dosTimep, time_t unixTime)
 {
     struct tm *ltp;
     int dosDate;
@@ -745,8 +745,8 @@ void smb_UnixTimeFromSearchTime(time_t *unixTimep, time_t searchTime)
     unsigned short dosTime;
     struct tm localTm;
         
-    dosDate = searchTime & 0xffff;
-    dosTime = (searchTime >> 16) & 0xffff;
+    dosDate = (unsigned short) (searchTime & 0xffff);
+    dosTime = (unsigned short) ((searchTime >> 16) & 0xffff);
 
     localTm.tm_year = 80 + ((dosDate>>9) & 0x3f);
     localTm.tm_mon = ((dosDate >> 5) & 0xf) - 1;       /* January is 0 in localTm */
@@ -1655,7 +1655,7 @@ void smb_GCDirSearches(int isV3)
     int i;
         
     victimCount = 0;   /* how many have we got so far */
-    for(tp = smb_lastDirSearchp; tp; tp=prevp) {
+    for (tp = smb_lastDirSearchp; tp; tp=prevp) {
         /* we'll move tp from queue, so
          * do this early.
          */
@@ -2118,7 +2118,7 @@ void smb_FormatResponsePacket(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *op
         op->inCom = inSmbp->com;
     }
     outp->reb = 0x80;  /* SERVER_RESP */
-    outp->flg2 = 0x1;  /* KNOWS_LONG_NAMES */
+    outp->flg2 = SMB_FLAGS2_KNOWS_LONG_NAMES;
 
     /* copy fields in generic packet area */
     op->wctp = &outp->wct;
@@ -2764,8 +2764,12 @@ long smb_ReceiveNegotiate(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
          * 32-bit error codes *
          * and NT Find *
          * and NT SMB's *
-         * and raw mode */
+         * and raw mode 
+         * and DFS */
         caps = NTNEGOTIATE_CAPABILITY_NTSTATUS |
+#ifdef DFS_SUPPORT
+               NTNEGOTIATE_CAPABILITY_DFS |
+#endif
                NTNEGOTIATE_CAPABILITY_NTFIND |
                NTNEGOTIATE_CAPABILITY_RAWMODE |
                NTNEGOTIATE_CAPABILITY_NTSMB;
@@ -2869,12 +2873,16 @@ void smb_Daemon(void *parmp)
 {
     afs_uint32 count = 0;
 
-    while(1) {
+    while(smbShutdownFlag == 0) {
         count++;
         thrd_Sleep(10000);
+
+        if (smbShutdownFlag == 1)
+            break;
+        
         if ((count % 72) == 0) {       /* every five minutes */
             struct tm myTime;
-            long old_localZero = smb_localZero;
+            time_t old_localZero = smb_localZero;
                 
             /* Initialize smb_localZero */
             myTime.tm_isdst = -1;              /* compute whether on DST or not */
@@ -2996,6 +3004,8 @@ long smb_ReceiveCoreTreeConnect(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *
     /* parse input parameters */
     tp = smb_GetSMBData(inp, NULL);
     pathp = smb_ParseASCIIBlock(tp, &tp);
+    if (smb_StoreAnsiFilenames)
+        OemToChar(pathp,pathp);
     passwordp = smb_ParseASCIIBlock(tp, &tp);
     tp = strrchr(pathp, '\\');
     if (!tp)
@@ -3172,6 +3182,8 @@ long smb_ReceiveCoreSearchVolume(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t
     tp = smb_GetSMBData(inp, NULL);
     pathp = smb_ParseASCIIBlock(tp, (char **) &tp);
     osi_assert(pathp != NULL);
+    if (smb_StoreAnsiFilenames)
+        OemToChar(pathp,pathp);
     statBlockp = smb_ParseVblBlock(tp, (char **) &tp, &statLen);
     osi_assert(statBlockp != NULL);
     if (statLen == 0) {
@@ -3269,12 +3281,12 @@ long smb_ApplyDirListPatches(smb_dirListPatch_t **dirPatchespp,
         smb_SearchTimeFromUnixTime(&dosTime, scp->clientModTime);
                 
         /* copy out time */
-        shortTemp = dosTime & 0xffff;
+        shortTemp = (unsigned short) (dosTime & 0xffff);
         *((u_short *)dptr) = shortTemp;
         dptr += 2;
 
         /* and copy out date */
-        shortTemp = (dosTime>>16) & 0xffff;
+        shortTemp = (unsigned short) ((dosTime>>16) & 0xffff);
         *((u_short *)dptr) = shortTemp;
         dptr += 2;
                 
@@ -3353,6 +3365,8 @@ long smb_ReceiveCoreSearchDir(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *ou
 
     tp = smb_GetSMBData(inp, NULL);
     pathp = smb_ParseASCIIBlock(tp, &tp);
+    if (smb_StoreAnsiFilenames)
+        OemToChar(pathp,pathp);
     inCookiep = smb_ParseVblBlock(tp, &tp, &dataLength);
 
     /* bail out if request looks bad */
@@ -3362,7 +3376,7 @@ long smb_ReceiveCoreSearchDir(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *ou
 
     /* We can handle long names */
     if (vcp->flags & SMB_VCFLAG_USENT)
-        ((smb_t *)outp)->flg2 |= 0x40; /* IS_LONG_NAME */
+        ((smb_t *)outp)->flg2 |= SMB_FLAGS2_IS_LONG_NAME;
 
     /* make sure we got a whole search status */
     if (dataLength < 21) {
@@ -3655,7 +3669,7 @@ long smb_ReceiveCoreSearchDir(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *ou
              * attributes */
 
             /* no hidden files */
-            if(smb_hideDotFiles && !(dsp->attribute & SMB_ATTR_HIDDEN) && smb_IsDotFile(actualName))
+            if (smb_hideDotFiles && !(dsp->attribute & SMB_ATTR_HIDDEN) && smb_IsDotFile(actualName))
                 goto nextEntry;
 
             if (!(dsp->attribute & SMB_ATTR_DIRECTORY))  /* no directories */
@@ -3724,9 +3738,11 @@ long smb_ReceiveCoreSearchDir(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *ou
              * never hurts to be sure.
              */
             strncpy(op, actualName, 13);
+            if (smb_StoreAnsiFilenames)
+                CharToOem(op, op);
 
             /* Uppercase if requested by client */
-            if ((((smb_t *)inp)->flg2 & 1) == 0)
+            if ((((smb_t *)inp)->flg2 & SMB_FLAGS2_KNOWS_LONG_NAMES) == 0)
                 _strupr(op);
 
             op += 13;
@@ -3807,12 +3823,12 @@ long smb_ReceiveCoreCheckPath(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *ou
 
     pathp = smb_GetSMBData(inp, NULL);
     pathp = smb_ParseASCIIBlock(pathp, NULL);
+    if (!pathp)
+        return CM_ERROR_BADFD;
+    if (smb_StoreAnsiFilenames)
+        OemToChar(pathp,pathp);
     osi_Log1(smb_logp, "SMB receive check path %s",
              osi_LogSaveString(smb_logp, pathp));
-
-    if (!pathp) {
-        return CM_ERROR_BADFD;
-    }
         
     rootScp = cm_rootSCachep;
         
@@ -3879,11 +3895,11 @@ long smb_ReceiveCoreSetFileAttributes(smb_vc_t *vcp, smb_packet_t *inp, smb_pack
 
     pathp = smb_GetSMBData(inp, NULL);
     pathp = smb_ParseASCIIBlock(pathp, NULL);
-
-    if (!pathp) {
+    if (!pathp)
         return CM_ERROR_BADSMB;
-    }
-        
+    if (smb_StoreAnsiFilenames)
+        OemToChar(pathp,pathp);
+               
     osi_Log2(smb_logp, "SMB receive setfile attributes time %d, attr 0x%x",
              dosTime, attribute);
 
@@ -3977,13 +3993,14 @@ long smb_ReceiveCoreGetFileAttributes(smb_vc_t *vcp, smb_packet_t *inp, smb_pack
 
     pathp = smb_GetSMBData(inp, NULL);
     pathp = smb_ParseASCIIBlock(pathp, NULL);
-
-    if (!pathp) {
+    if (!pathp)
         return CM_ERROR_BADSMB;
-    }
         
     if (*pathp == 0)           /* null path */
         pathp = "\\";
+    else
+        if (smb_StoreAnsiFilenames)
+            OemToChar(pathp,pathp);
 
     osi_Log1(smb_logp, "SMB receive getfile attributes path %s",
              osi_LogSaveString(smb_logp, pathp));
@@ -4020,6 +4037,7 @@ long smb_ReceiveCoreGetFileAttributes(smb_vc_t *vcp, smb_packet_t *inp, smb_pack
      */
     spacep = inp->spacep;
     smb_StripLastComponent(spacep->data, &lastComp, pathp);
+#ifndef SPECIAL_FOLDERS
     if (lastComp && stricmp(lastComp, "\\desktop.ini") == 0) {
         code = cm_NameI(rootScp, spacep->data,
                         caseFold | CM_FLAG_DIRSEARCH | CM_FLAG_FOLLOW,
@@ -4042,6 +4060,7 @@ long smb_ReceiveCoreGetFileAttributes(smb_vc_t *vcp, smb_packet_t *inp, smb_pack
             }
         }
     }
+#endif /* SPECIAL_FOLDERS */
 
     code = cm_NameI(rootScp, pathp, caseFold | CM_FLAG_FOLLOW, userp,
                     tidPathp, &req, &newScp);
@@ -4079,8 +4098,8 @@ long smb_ReceiveCoreGetFileAttributes(smb_vc_t *vcp, smb_packet_t *inp, smb_pack
     smb_SetSMBParm(outp, 0, attrs);
         
     smb_DosUTimeFromUnixTime(&dosTime, newScp->clientModTime);
-    smb_SetSMBParm(outp, 1, dosTime & 0xffff);
-    smb_SetSMBParm(outp, 2, (dosTime>>16) & 0xffff);
+    smb_SetSMBParm(outp, 1, (unsigned int)(dosTime & 0xffff));
+    smb_SetSMBParm(outp, 2, (unsigned int)((dosTime>>16) & 0xffff));
     smb_SetSMBParm(outp, 3, newScp->length.LowPart & 0xffff);
     smb_SetSMBParm(outp, 4, (newScp->length.LowPart >> 16) & 0xffff);
     smb_SetSMBParm(outp, 5, 0);
@@ -4135,6 +4154,8 @@ long smb_ReceiveCoreOpen(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
 
     pathp = smb_GetSMBData(inp, NULL);
     pathp = smb_ParseASCIIBlock(pathp, NULL);
+    if (smb_StoreAnsiFilenames)
+        OemToChar(pathp,pathp);
        
     osi_Log1(smb_logp, "SMB receive open file [%s]", osi_LogSaveString(smb_logp, pathp));
 
@@ -4223,8 +4244,8 @@ long smb_ReceiveCoreOpen(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
     smb_SetSMBParm(outp, 0, fidp->fid);
     smb_SetSMBParm(outp, 1, smb_Attributes(scp));
     smb_DosUTimeFromUnixTime(&dosTime, scp->clientModTime);
-    smb_SetSMBParm(outp, 2, dosTime & 0xffff);
-    smb_SetSMBParm(outp, 3, (dosTime >> 16) & 0xffff);
+    smb_SetSMBParm(outp, 2, (unsigned int)(dosTime & 0xffff));
+    smb_SetSMBParm(outp, 3, (unsigned int)((dosTime >> 16) & 0xffff));
     smb_SetSMBParm(outp, 4, scp->length.LowPart & 0xffff);
     smb_SetSMBParm(outp, 5, (scp->length.LowPart >> 16) & 0xffff);
     /* pass the open mode back; XXXX add access checks */
@@ -4320,6 +4341,8 @@ long smb_ReceiveCoreUnlink(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
         
     tp = smb_GetSMBData(inp, NULL);
     pathp = smb_ParseASCIIBlock(tp, &tp);
+    if (smb_StoreAnsiFilenames)
+        OemToChar(pathp,pathp);
 
     osi_Log1(smb_logp, "SMB receive unlink %s",
              osi_LogSaveString(smb_logp, pathp));
@@ -4741,7 +4764,11 @@ smb_ReceiveCoreRename(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
 
     tp = smb_GetSMBData(inp, NULL);
     oldPathp = smb_ParseASCIIBlock(tp, &tp);
+    if (smb_StoreAnsiFilenames)
+        OemToChar(oldPathp,oldPathp);
     newPathp = smb_ParseASCIIBlock(tp, &tp);
+    if (smb_StoreAnsiFilenames)
+        OemToChar(newPathp,newPathp);
 
     osi_Log2(smb_logp, "smb rename [%s] to [%s]",
               osi_LogSaveString(smb_logp, oldPathp),
@@ -4818,6 +4845,8 @@ long smb_ReceiveCoreRemoveDir(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *ou
 
     tp = smb_GetSMBData(inp, NULL);
     pathp = smb_ParseASCIIBlock(tp, &tp);
+    if (smb_StoreAnsiFilenames)
+        OemToChar(pathp,pathp);
 
     spacep = inp->spacep;
     smb_StripLastComponent(spacep->data, &lastNamep, pathp);
@@ -5449,7 +5478,7 @@ long smb_WriteData(smb_fid_t *fidp, osi_hyper_t *offsetp, long count, char *op,
                             writeBackOffset.HighPart, cm_chunkSize, 0, userp);
     }
 
-    osi_Log2(smb_logp, "smb_WriteData fid %d returns %d written %d",
+    osi_Log3(smb_logp, "smb_WriteData fid %d returns %d written %d",
               fidp->fid, code, *writtenp);
     return code;
 }
@@ -5839,6 +5868,8 @@ long smb_ReceiveCoreMakeDir(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp
         
     tp = smb_GetSMBData(inp, NULL);
     pathp = smb_ParseASCIIBlock(tp, &tp);
+    if (smb_StoreAnsiFilenames)
+        OemToChar(pathp,pathp);
 
     if (strcmp(pathp, "\\") == 0)
         return CM_ERROR_EXISTS;
@@ -5953,6 +5984,8 @@ long smb_ReceiveCoreCreate(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
         
     tp = smb_GetSMBData(inp, NULL);
     pathp = smb_ParseASCIIBlock(tp, &tp);
+    if (smb_StoreAnsiFilenames)
+        OemToChar(pathp,pathp);
 
     spacep = inp->spacep;
     smb_StripLastComponent(spacep->data, &lastNamep, pathp);
@@ -5977,8 +6010,10 @@ long smb_ReceiveCoreCreate(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
     /* otherwise, scp points to the parent directory.  Do a lookup, and
      * truncate the file if we find it, otherwise we create the file.
      */
-    if (!lastNamep) lastNamep = pathp;
-    else lastNamep++;
+    if (!lastNamep) 
+        lastNamep = pathp;
+    else 
+        lastNamep++;
 
     if (!smb_IsLegalFilename(lastNamep))
         return CM_ERROR_BADNTFILENAME;
@@ -6351,7 +6386,7 @@ void smb_DispatchPacket(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp,
                 smbp->reh = (unsigned char) ((NTStatus >> 8) & 0xff);
                 smbp->errLow = (unsigned char) ((NTStatus >> 16) & 0xff);
                 smbp->errHigh = (unsigned char) ((NTStatus >> 24) & 0xff);
-                smbp->flg2 |= 0x4000;
+                smbp->flg2 |= SMB_FLAGS2_ERR_STATUS;
                 break;
             }
             else {
@@ -6464,8 +6499,12 @@ void smb_ClientWaiter(void *parmp)
     while (1) {
         code = thrd_WaitForMultipleObjects_Event(numNCBs, NCBevents,
                                                  FALSE, INFINITE);
-        if (code == WAIT_OBJECT_0)
-            continue;
+        if (code == WAIT_OBJECT_0) {
+            if (smbShutdownFlag == 1)
+                break;
+            else
+                continue;
+        }
 
         /* error checking */
         if (code >= WAIT_ABANDONED_0 && code < (WAIT_ABANDONED_0 + numNCBs))
@@ -6523,8 +6562,12 @@ void smb_ServerWaiter(void *parmp)
         /* Get a session */
         code = thrd_WaitForMultipleObjects_Event(numSessions, SessionEvents,
                                                  FALSE, INFINITE);
-        if (code == WAIT_OBJECT_0)
-            continue;
+        if (code == WAIT_OBJECT_0) {
+            if ( smbShutdownFlag == 1 )
+                break;
+            else
+                continue;
+        }
 
         if (code >= WAIT_ABANDONED_0 && code < (WAIT_ABANDONED_0 + numSessions))
         {
@@ -6562,8 +6605,12 @@ void smb_ServerWaiter(void *parmp)
       NCBretry:
         code = thrd_WaitForMultipleObjects_Event(numNCBs, NCBavails,
                                                  FALSE, INFINITE);
-        if (code == WAIT_OBJECT_0)
-            goto NCBretry;
+        if (code == WAIT_OBJECT_0) {
+            if ( smbShutdownFlag == 1 ) 
+                break;
+            else
+                goto NCBretry;
+        }
 
         /* error checking */
         if (code >= WAIT_ABANDONED_0 && code < (WAIT_ABANDONED_0 + numNCBs))
@@ -6603,9 +6650,6 @@ void smb_ServerWaiter(void *parmp)
 
         /* Fire it up */
         ncbp = NCBs[idx_NCB];
-#ifdef DJGPP
-        dos_ncb = ((smb_ncb_t *)ncbp)->dos_ncb;
-#endif /* DJGPP */
         ncbp->ncb_lsn = (unsigned char) LSNs[idx_session];
         ncbp->ncb_command = NCBRECV | ASYNCH;
         ncbp->ncb_lana_num = lanas[idx_session];
@@ -6619,6 +6663,7 @@ void smb_ServerWaiter(void *parmp)
         ((smb_ncb_t*)ncbp)->orig_pkt = bufs[idx_NCB];
         ncbp->ncb_event = NCBreturns[0][idx_NCB];
         ncbp->ncb_length = SMB_PACKETSIZE;
+        dos_ncb = ((smb_ncb_t *)ncbp)->dos_ncb;
         Netbios(ncbp, dos_ncb);
 #endif /* !DJGPP */
     }
@@ -6657,8 +6702,14 @@ void smb_Server(VOID *parmp)
     while (1) {
         code = thrd_WaitForMultipleObjects_Event(numNCBs, NCBreturns[myIdx],
                                                  FALSE, INFINITE);
+
+        /* terminate silently if shutdown flag is set */
         if (code == WAIT_OBJECT_0) {
-            continue;
+            if (smbShutdownFlag == 1) {
+                thrd_SetEvent(smb_ServerShutdown[myIdx]);
+                break;
+            } else
+                continue;
         }
 
         /* error checking */
@@ -6824,7 +6875,7 @@ void smb_Server(VOID *parmp)
          * Either way, we can't do anything with this packet.
          * Log, sleep and resume.
          */
-        if(!vcp) {
+        if (!vcp) {
             HANDLE h;
             char buf[1000];
             char *ptbuf[1];
@@ -6843,7 +6894,7 @@ void smb_Server(VOID *parmp)
             ptbuf[0] = buf;
 
             h = RegisterEventSource(NULL,AFS_DAEMON_EVENT_NAME);
-            if(h) {
+            if (h) {
                 ReportEvent(h, EVENTLOG_ERROR_TYPE, 0, 1001, NULL,1,sizeof(*ncbp),ptbuf,(void*)ncbp);
                 DeregisterEventSource(h);
             }
@@ -7525,6 +7576,15 @@ void smb_Init(osi_log_t *logp, char *snamep, int useV3, int LANadapt,
         NCBreturns[i] = malloc(NCBmax * sizeof(EVENT_HANDLE));
         NCBreturns[i][0] = retHandle;
     }
+
+    smb_ServerShutdown = malloc(smb_NumServerThreads * sizeof(EVENT_HANDLE));
+    for (i = 0; i < smb_NumServerThreads; i++) {
+        sprintf(eventName, "smb_ServerShutdown[%d]", i);
+        smb_ServerShutdown[i] = thrd_CreateEvent(NULL, FALSE, FALSE, eventName);
+        if ( GetLastError() == ERROR_ALREADY_EXISTS )
+            afsi_log("Event Object Already Exists: %s", eventName);
+    }
+
     for (i = 1; i <= nThreads; i++)
         InitNCBslot(i);
     numNCBs = nThreads + 1;
@@ -7625,8 +7685,8 @@ void smb_Init(osi_log_t *logp, char *snamep, int useV3, int LANadapt,
     smb_tran2DispatchTable[12].procp = smb_ReceiveTran2FindNotifyNext;
     smb_tran2DispatchTable[13].procp = smb_ReceiveTran2CreateDirectory;
     smb_tran2DispatchTable[14].procp = smb_ReceiveTran2SessionSetup;
-    smb_tran2DispatchTable[14].procp = smb_ReceiveTran2GetDFSReferral;
-    smb_tran2DispatchTable[14].procp = smb_ReceiveTran2ReportDFSInconsistency;
+    smb_tran2DispatchTable[16].procp = smb_ReceiveTran2GetDFSReferral;
+    smb_tran2DispatchTable[17].procp = smb_ReceiveTran2ReportDFSInconsistency;
 
     /* setup the rap dispatch table */
     memset(smb_rapDispatchTable, 0, sizeof(smb_rapDispatchTable));
@@ -7789,7 +7849,7 @@ void smb_Shutdown(void)
 #ifndef DJGPP
         code = Netbios(ncbp);
 #else
-               code = Netbios(ncbp, dos_ncb);
+        code = Netbios(ncbp, dos_ncb);
 #endif
         /*fprintf(stderr, "returned from NCBHANGUP session %d LSN %d\n", i, LSNs[i]);*/
         if (code == 0) code = ncbp->ncb_retcode;
@@ -7819,6 +7879,23 @@ void smb_Shutdown(void)
         }       
         fflush(stderr);
     }
+
+    /* Trigger the shutdown of all SMB threads */
+    for (i = 0; i < smb_NumServerThreads; i++)
+        thrd_SetEvent(NCBreturns[i][0]);
+
+    thrd_SetEvent(NCBevents[0]);
+    thrd_SetEvent(SessionEvents[0]);
+    thrd_SetEvent(NCBavails[0]);
+
+    for (i = 0;i < smb_NumServerThreads; i++) {
+        DWORD code = thrd_WaitForSingleObject_Event(smb_ServerShutdown[i], INFINITE);
+        if (code == WAIT_OBJECT_0) {
+            continue;
+        } else {
+            afsi_log("smb_Shutdown[%d] wait error",i);
+        }
+    }
 }
 
 /* Get the UNC \\<servername>\<sharename> prefix. */
index 9271bcb4ce0fc9f78c472177075826bfa21547d1..4774e397b62380580cc80d25d70ce645e52d5abd 100644 (file)
 
 /* basic core protocol SMB structure */
 typedef struct smb {
-       unsigned char id[4];
-        unsigned char com;
-        unsigned char rcls;
-        unsigned char reh;
-        unsigned char errLow;
-        unsigned char errHigh;
-        unsigned char reb;
-        unsigned short flg2;
-        unsigned short res[6];
-        unsigned short tid;
-        unsigned short pid;
-        unsigned short uid;
-        unsigned short mid;
-        unsigned char wct;
-        unsigned char vdata[1];
+    unsigned char id[4];
+    unsigned char com;
+    unsigned char rcls;
+    unsigned char reh;
+    unsigned char errLow;
+    unsigned char errHigh;
+    unsigned char reb;
+    unsigned short flg2;
+    unsigned short res[6];
+    unsigned short tid;
+    unsigned short pid;
+    unsigned short uid;
+    unsigned short mid;
+    unsigned char wct;
+    unsigned char vdata[1];
 } smb_t;
 
+/* flg2 values */
+
+#define SMB_FLAGS2_KNOWS_LONG_NAMES        0x0001
+#define SMB_FLAGS2_KNOWS_EAS               0x0002
+#define SMB_FLAGS2_SECURITY_SIGNATURE      0x0004
+#define SMB_FLAGS2_RESERVED1               0x0008
+#define SMB_FLAGS2_IS_LONG_NAME            0x0040
+#define SMB_FLAGS2_EXT_SEC                 0x0800
+#define SMB_FLAGS2_DFS                     0x1000
+#define SMB_FLAGS2_PAGING_IO               0x2000
+#define SMB_FLAGS2_ERR_STATUS              0x4000
+#define SMB_FLAGS2_UNICODE                 0x8000
+
+/* Information Levels */
+#define SMB_INFO_STANDARD               1
+#define SMB_INFO_QUERY_EA_SIZE          2
+#define SMB_INFO_QUERY_EAS_FROM_LIST    3
+#define SMB_INFO_QUERY_ALL_EAS          4
+#define SMB_INFO_IS_NAME_VALID          6
+
+#define SMB_QUERY_FILE_BASIC_INFO       0x101
+#define SMB_QUERY_FILE_STANDARD_INFO    0x102
+#define SMB_QUERY_FILE_EA_INFO          0x103
+#define SMB_QUERY_FILE_NAME_INFO        0x104
+#define SMB_QUERY_FILE_ALL_INFO         0x107
+#define SMB_QUERY_FILE_ALT_NAME_INFO    0x108
+#define SMB_QUERY_FILE_STREAM_INFO      0x109
+#define SMB_QUERY_FILE_COMPRESSION_INFO 0x10B
+#define SMB_QUERY_FILE_UNIX_BASIC       0x200
+#define SMB_QUERY_FILE_UNIX_LINK        0x201
+
+#define SMB_SET_FILE_UNIX_BASIC         0x200
+#define SMB_SET_FILE_UNIX_LINK          0x201
+#define SMB_SET_FILE_UNIX_HLINK         0x203
+
 /* more defines */
 #define SMB_NOPCODES           256     /* # of opcodes in the dispatch table */
 
@@ -59,20 +94,20 @@ typedef struct smb {
 #define NEGOTIATE_SECURITY_SIGNATURES_REQUIRED      0x08
 
 /* Capabilities */
-#define NTNEGOTIATE_CAPABILITY_RAWMODE                         0x00000001L
-#define NTNEGOTIATE_CAPABILITY_MPXMODE                         0x00000002L
-#define NTNEGOTIATE_CAPABILITY_UNICODE                         0x00000004L
-#define NTNEGOTIATE_CAPABILITY_LARGEFILES                      0x00000008L
-#define NTNEGOTIATE_CAPABILITY_NTSMB                           0x00000010L
-#define NTNEGOTIATE_CAPABILITY_RPCAPI                          0x00000020L
-#define NTNEGOTIATE_CAPABILITY_NTSTATUS                                0x00000040L
-#define NTNEGOTIATE_CAPABILITY_LEVEL_II_OPLOCKS                0x00000080L
+#define NTNEGOTIATE_CAPABILITY_RAWMODE                 0x00000001L
+#define NTNEGOTIATE_CAPABILITY_MPXMODE                 0x00000002L
+#define NTNEGOTIATE_CAPABILITY_UNICODE                 0x00000004L
+#define NTNEGOTIATE_CAPABILITY_LARGEFILES              0x00000008L
+#define NTNEGOTIATE_CAPABILITY_NTSMB                   0x00000010L
+#define NTNEGOTIATE_CAPABILITY_RPCAPI                  0x00000020L
+#define NTNEGOTIATE_CAPABILITY_NTSTATUS                        0x00000040L
+#define NTNEGOTIATE_CAPABILITY_LEVEL_II_OPLOCKS                0x00000080L
 #define NTNEGOTIATE_CAPABILITY_LOCK_AND_READ           0x00000100L
-#define NTNEGOTIATE_CAPABILITY_NTFIND                          0x00000200L
-#define NTNEGOTIATE_CAPABILITY_DFS                                     0x00001000L
+#define NTNEGOTIATE_CAPABILITY_NTFIND                  0x00000200L
+#define NTNEGOTIATE_CAPABILITY_DFS                     0x00001000L
 #define NTNEGOTIATE_CAPABILITY_NT_INFO_PASSTHRU                0x00002000L
 #define NTNEGOTIATE_CAPABILITY_BULK_TRANSFER           0x20000000L
-#define NTNEGOTIATE_CAPABILITY_COMPRESSED                      0x40000000L
+#define NTNEGOTIATE_CAPABILITY_COMPRESSED              0x40000000L
 #define NTNEGOTIATE_CAPABILITY_EXTENDED_SECURITY       0x80000000L
 
 /* a packet structure for receiving SMB messages; locked by smb_globalLock.
@@ -94,23 +129,23 @@ typedef struct smb {
  */
 #define SMB_PACKETMAGIC        0x7436353       /* magic # for packets */
 typedef struct smb_packet {
-       char data[SMB_PACKETSIZE];
-       struct smb_packet *nextp;       /* in free list, or whatever */
-        long magic;
-       cm_space_t *spacep;             /* use this for stripping last component */
-       NCB *ncbp;                      /* use this for sending */
-       struct smb_vc *vcp;
-       unsigned long resumeCode;
-        unsigned short inCount;
-        unsigned short fid;            /* for calls bundled with openAndX */
-        unsigned char *wctp;
-        unsigned char inCom;
-       unsigned char oddByte;
-       unsigned short ncb_length;
-       unsigned char flags;
+    char data[SMB_PACKETSIZE];
+    struct smb_packet *nextp;          /* in free list, or whatever */
+    long magic;
+    cm_space_t *spacep;                        /* use this for stripping last component */
+    NCB *ncbp;                         /* use this for sending */
+    struct smb_vc *vcp;
+    unsigned long resumeCode;
+    unsigned short inCount;
+    unsigned short fid;                        /* for calls bundled with openAndX */
+    unsigned char *wctp;
+    unsigned char inCom;
+    unsigned char oddByte;
+    unsigned short ncb_length;
+    unsigned char flags;
 #ifdef DJGPP
-        dos_ptr dos_pkt;
-        unsigned int dos_pkt_sel;
+    dos_ptr dos_pkt;
+    unsigned int dos_pkt_sel;
 #endif /* DJGPP */
 } smb_packet_t;
 
@@ -122,13 +157,13 @@ typedef struct smb_packet {
 /* a structure for making Netbios calls; locked by smb_globalLock */
 #define SMB_NCBMAGIC   0x2334344
 typedef struct myncb {
-       NCB ncb;                        /* ncb to use */
-        struct myncb *nextp;           /* when on free list */
-        long magic;
+    NCB ncb;                           /* ncb to use */
+    struct myncb *nextp;               /* when on free list */
+    long magic;
 #ifdef DJGPP
-        dos_ptr dos_ncb;
-        smb_packet_t *orig_pkt;
-        unsigned int dos_ncb_sel;
+    dos_ptr dos_ncb;
+    smb_packet_t *orig_pkt;
+    unsigned int dos_ncb_sel;
 #endif /* DJGPP */
 } smb_ncb_t;
 
@@ -140,28 +175,27 @@ typedef struct myncb {
 
 /* one per virtual circuit */
 typedef struct smb_vc {
-       struct smb_vc *nextp;           /* not used */
-    unsigned long refCount;                    /* the reference count */
-    long flags;                        /* the flags, if any; locked by mx */
+    struct smb_vc *nextp;              /* not used */
+    unsigned long refCount;            /* the reference count */
+    long flags;                                /* the flags, if any; locked by mx */
     osi_mutex_t mx;                    /* the mutex */
-       long vcID;                      /* VC id */
-    unsigned short lsn;                /* the NCB LSN associated with this */
-       unsigned short uidCounter;      /* session ID counter */
-    unsigned short tidCounter; /* tree ID counter */
-    unsigned short fidCounter; /* file handle ID counter */
+    long vcID;                         /* VC id */
+    unsigned short lsn;                        /* the NCB LSN associated with this */
+    unsigned short uidCounter;         /* session ID counter */
+    unsigned short tidCounter;         /* tree ID counter */
+    unsigned short fidCounter;         /* file handle ID counter */
     struct smb_tid *tidsp;             /* the first child in the tid list */
-    struct smb_user *usersp;   /* the first child in the user session list */
+    struct smb_user *usersp;           /* the first child in the user session list */
     struct smb_fid *fidsp;             /* the first child in the open file list */
-       struct smb_user *justLoggedOut; /* ready for profile upload? */
-       time_t logoffTime;      /* tick count when logged off */
-       /*struct cm_user *logonDLLUser; /* integrated logon user */
-       unsigned char errorCount;
+    struct smb_user *justLoggedOut;    /* ready for profile upload? */
+    time_t logoffTime;                 /* tick count when logged off */
+    unsigned char errorCount;
     char rname[17];
-       int lana;
-       char encKey[MSV1_0_CHALLENGE_LENGTH]; /* MSV1_0_CHALLENGE_LENGTH is 8 */
-    void * secCtx;              /* security context when negotiating SMB extended auth
-                                 * valid when SMB_VCFLAG_AUTH_IN_PROGRESS is set
-                                 */
+    int lana;
+    char encKey[MSV1_0_CHALLENGE_LENGTH]; /* MSV1_0_CHALLENGE_LENGTH is 8 */
+    void * secCtx;                      /* security context when negotiating SMB extended auth
+                                         * valid when SMB_VCFLAG_AUTH_IN_PROGRESS is set
+                                         */
 } smb_vc_t;
 
                                        /* have we negotiated ... */
@@ -176,23 +210,23 @@ typedef struct smb_vc {
 
 /* one per user session */
 typedef struct smb_user {
-       struct smb_user *nextp;         /* next sibling */
-        unsigned long refCount;                        /* ref count */
-        long flags;                    /* flags; locked by mx */
-        osi_mutex_t mx;
-        long userID;                   /* the session identifier */
-        struct smb_vc *vcp;            /* back ptr to virtual circuit */
-  struct smb_username *unp;        /* user name struct */
+    struct smb_user *nextp;            /* next sibling */
+    unsigned long refCount;            /* ref count */
+    long flags;                                /* flags; locked by mx */
+    osi_mutex_t mx;
+    long userID;                       /* the session identifier */
+    struct smb_vc *vcp;                        /* back ptr to virtual circuit */
+    struct smb_username *unp;           /* user name struct */
 } smb_user_t;
 
 typedef struct smb_username {
-       struct smb_username *nextp;             /* next sibling */
-        unsigned long refCount;                        /* ref count */
-        long flags;                    /* flags; locked by mx */
-        osi_mutex_t mx;
-       struct cm_user *userp;          /* CM user structure */
-        char *name;                    /* user name */
-  char *machine;                  /* machine name */
+    struct smb_username *nextp;                /* next sibling */
+    unsigned long refCount;            /* ref count */
+    long flags;                                /* flags; locked by mx */
+    osi_mutex_t mx;
+    struct cm_user *userp;             /* CM user structure */
+    char *name;                                /* user name */
+    char *machine;                      /* machine name */
 } smb_username_t;
 
 #define SMB_USERFLAG_DELETE    1       /* delete struct when ref count zero */
@@ -201,15 +235,15 @@ typedef struct smb_username {
 
 /* one per tree-connect */
 typedef struct smb_tid {
-       struct smb_tid *nextp;          /* next sibling */
-        unsigned long refCount;
-        long flags;
-        osi_mutex_t mx;                        /* for non-tree-related stuff */
-        unsigned short tid;            /* the tid */
-        struct smb_vc *vcp;            /* back ptr */
-        struct cm_user *userp;         /* user logged in at the
+    struct smb_tid *nextp;             /* next sibling */
+    unsigned long refCount;
+    long flags;
+    osi_mutex_t mx;                    /* for non-tree-related stuff */
+    unsigned short tid;                        /* the tid */
+    struct smb_vc *vcp;                        /* back ptr */
+    struct cm_user *userp;             /* user logged in at the
                                         * tree connect level (base) */
-       char *pathname;                 /* pathname derived from sharename */
+    char *pathname;                    /* pathname derived from sharename */
 } smb_tid_t;
 
 #define SMB_TIDFLAG_DELETE     1       /* delete struct when ref count zero */
@@ -217,40 +251,39 @@ typedef struct smb_tid {
 
 /* one per process ID */
 typedef struct smb_pid {
-       struct smb_pid *nextp;          /* next sibling */
-        unsigned long refCount;
-        long flags;
-        osi_mutex_t mx;                        /* for non-tree-related stuff */
-        unsigned short pid;            /* the pid */
-        struct smb_tid *tidp;          /* back ptr */
+    struct smb_pid *nextp;             /* next sibling */
+    unsigned long refCount;
+    long flags;
+    osi_mutex_t mx;                    /* for non-tree-related stuff */
+    unsigned short pid;                        /* the pid */
+    struct smb_tid *tidp;              /* back ptr */
 } smb_pid_t;
 
 /* ioctl parameter, while being assembled and/or processed */
 typedef struct smb_ioctl {
-       /* input side */
-       char *inDatap;                  /* ioctl func's current position
+    /* input side */
+    char *inDatap;                     /* ioctl func's current position
                                         * in input parameter block */
-       char *inAllocp;                 /* allocated input parameter block */
-        long inCopied;                 /* # of input bytes copied in so far
+    char *inAllocp;                    /* allocated input parameter block */
+    long inCopied;                     /* # of input bytes copied in so far
                                         * by write calls */
-       cm_space_t *prefix;             /* prefix for subst drives */
-       char *tidPathp;                 /* Pathname associated with Tree ID */
-
-       /* output side */
-        char *outDatap;                        /* output results assembled so far */
-        char *outAllocp;               /* output results assembled so far */
-        long outCopied;                        /* # of output bytes copied back so far
-                                        * by read calls */
+    cm_space_t *prefix;                        /* prefix for subst drives */
+    char *tidPathp;                    /* Pathname associated with Tree ID */
+
+    /* output side */
+    char *outDatap;                    /* output results assembled so far */
+    char *outAllocp;                   /* output results assembled so far */
+    long outCopied;                    /* # of output bytes copied back so far
+                                         * by read calls */
        
-        /* flags */
-        long flags;
-
-        /* fid pointer */
-        struct smb_fid *fidp;
+    /* flags */
+    long flags;
 
-  /* uid pointer */
-  smb_user_t *uidp;
+    /* fid pointer */
+    struct smb_fid *fidp;
 
+    /* uid pointer */
+    smb_user_t *uidp;
 } smb_ioctl_t;
 
 /* flags for smb_ioctl_t */
@@ -259,27 +292,27 @@ typedef struct smb_ioctl {
 
 /* one per file ID; these are really file descriptors */
 typedef struct smb_fid {
-       osi_queue_t q;
-        unsigned long refCount;
-        unsigned long flags;
-        osi_mutex_t mx;                        /* for non-tree-related stuff */
-        unsigned short fid;            /* the file ID */
-        struct smb_vc *vcp;            /* back ptr */
-        struct cm_scache *scp;         /* scache of open file */
-        long offset;                   /* our file pointer */
-        smb_ioctl_t *ioctlp;           /* ptr to ioctl structure */
+    osi_queue_t q;
+    unsigned long refCount;
+    unsigned long flags;
+    osi_mutex_t mx;                    /* for non-tree-related stuff */
+    unsigned short fid;                        /* the file ID */
+    struct smb_vc *vcp;                        /* back ptr */
+    struct cm_scache *scp;             /* scache of open file */
+    long offset;                       /* our file pointer */
+    smb_ioctl_t *ioctlp;               /* ptr to ioctl structure */
                                        /* Under NT, we may need to know the
                                         * parent directory and pathname used
                                         * to open the file, either to delete
                                         * the file on close, or to do a
                                         * change notification */
-       struct cm_scache *NTopen_dscp;  /* parent directory (NT) */
-       char *NTopen_pathp;             /* path used in open (NT) */
-       char *NTopen_wholepathp;        /* entire path, not just last name */
-       int curr_chunk;                 /* chunk being read */
-       int prev_chunk;                 /* previous chunk read */
-       int raw_writers;                /* pending async raw writes */
-       EVENT_HANDLE raw_write_event;   /* signal this when raw_writers zero */
+    struct cm_scache *NTopen_dscp;     /* parent directory (NT) */
+    char *NTopen_pathp;                        /* path used in open (NT) */
+    char *NTopen_wholepathp;           /* entire path, not just last name */
+    int curr_chunk;                    /* chunk being read */
+    int prev_chunk;                    /* previous chunk read */
+    int raw_writers;                   /* pending async raw writes */
+    EVENT_HANDLE raw_write_event;      /* signal this when raw_writers zero */
 } smb_fid_t;
 
 #define SMB_FID_OPENREAD               1       /* open for reading */
@@ -298,30 +331,37 @@ typedef struct smb_fid {
 #define SMB_FID_NTOPEN                 0x100   /* have dscp and pathp */
 
 /*
- * SMB file attributes
+ * SMB file attributes (32-bit)
  */
-#define SMB_ATTR_ARCHIVE  0x20
-#define SMB_ATTR_COMPRESSED 0x800 /* file or dir is compressed */
-#define SMB_ATTR_NORMAL 0x80 /* normal file. Only valid if used alone */
-#define SMB_ATTR_HIDDEN 0x2 /* hidden file for the purpose of dir listings */
-#define SMB_ATTR_READONLY 0x1
-#define SMB_ATTR_TEMPORARY 0x100
-#define SMB_ATTR_DIRECTORY 0x10
-#define SMB_ATTR_SYSTEM 0x4
+#define SMB_ATTR_READONLY       0x0001
+#define SMB_ATTR_HIDDEN         0x0002 /* hidden file for the purpose of dir listings */
+#define SMB_ATTR_SYSTEM         0x0004
+#define SMB_ATTR_VOLUMEID       0x0008 /* obsolete */
+#define SMB_ATTR_DIRECTORY      0x0010
+#define SMB_ATTR_ARCHIVE        0x0020
+#define SMB_ATTR_DEVICE         0x0040
+#define SMB_ATTR_NORMAL         0x0080 /* normal file. Only valid if used alone */
+#define SMB_ATTR_TEMPORARY      0x0100
+#define SMB_ATTR_SPARSE_FILE    0x0200
+#define SMB_ATTR_REPARSE_POINT  0x0400
+#define SMB_ATTR_COMPRESSED     0x0800 /* file or dir is compressed */
+#define SMB_ATTR_OFFLINE        0x1000
+#define SMB_ATTR_NOT_CONTENT_INDEXED 0x2000
+#define SMB_ATTR_ENCRYPTED      0x4000
 
 /* for tracking in-progress directory searches */
 typedef struct smb_dirSearch {
-       osi_queue_t q;                  /* queue of all outstanding cookies */
-        osi_mutex_t mx;                        /* just in case the caller screws up */
-        unsigned long refCount;                        /* reference count */
-        long cookie;                   /* value returned to the caller */
-        struct cm_scache *scp;         /* vnode of the dir we're searching */
-        time_t lastTime;               /* last time we used this */
-        long flags;                    /* flags (see below);
+    osi_queue_t q;                     /* queue of all outstanding cookies */
+    osi_mutex_t mx;                    /* just in case the caller screws up */
+    unsigned long refCount;            /* reference count */
+    long cookie;                       /* value returned to the caller */
+    struct cm_scache *scp;             /* vnode of the dir we're searching */
+    time_t lastTime;                   /* last time we used this */
+    long flags;                                /* flags (see below);
                                         * locked by smb_globalLock */
-        unsigned short attribute;      /* search attribute
+    unsigned short attribute;          /* search attribute
                                         * (used for extended protocol) */
-        char mask[256];                        /* search mask for V3 */
+    char mask[256];                    /* search mask for V3 */
 } smb_dirSearch_t;
 
 #define SMB_DIRSEARCH_DELETE   1       /* delete struct when ref count zero */
@@ -331,11 +371,11 @@ typedef struct smb_dirSearch {
 
 /* type for patching directory listings */
 typedef struct smb_dirListPatch {
-       osi_queue_t q;
-    char *dptr;                /* ptr to attr, time, data, sizel, sizeh */
-    long flags;     /* flags.  See below */
-       cm_fid_t fid;
-  cm_dirEntry_t *dep;   /* temp */
+    osi_queue_t q;
+    char *dptr;                                /* ptr to attr, time, data, sizel, sizeh */
+    long flags;                         /* flags.  See below */
+    cm_fid_t fid;
+    cm_dirEntry_t *dep;                 /* temp */
 } smb_dirListPatch_t;
 
 /* dirListPatch Flags */
@@ -346,12 +386,12 @@ typedef struct smb_dirListPatch {
 
 /* waiting lock list elements */
 typedef struct smb_waitingLock {
-       osi_queue_t q;
-       smb_vc_t *vcp;
-       smb_packet_t *inp;
-       smb_packet_t *outp;
-       time_t timeRemaining;
-       void *lockp;
+    osi_queue_t q;
+    smb_vc_t *vcp;
+    smb_packet_t *inp;
+    smb_packet_t *outp;
+    time_t timeRemaining;
+    void *lockp;
 } smb_waitingLock_t;
 
 extern smb_waitingLock_t *smb_allWaitingLocks;
@@ -359,8 +399,8 @@ extern smb_waitingLock_t *smb_allWaitingLocks;
 typedef long (smb_proc_t)(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp);
 
 typedef struct smb_dispatch {
-       smb_proc_t *procp;      /* proc to call */
-        int flags;             /* flags describing function */
+    smb_proc_t *procp;                 /* proc to call */
+    int flags;                         /* flags describing function */
 } smb_dispatch_t;
 
 #define SMB_DISPATCHFLAG_CHAINED       1       /* this is an _AND_X function */
@@ -492,6 +532,7 @@ extern time_t smb_LogoffTransferTimeout;
 extern int smb_maxVCPerServer; /* max # of VCs per server */
 extern int smb_maxMpxRequests; /* max # of mpx requests */
 
+extern int smb_StoreAnsiFilenames;
 extern int smb_hideDotFiles;
 extern unsigned int smb_IsDotFile(char *lastComp);
 
@@ -515,12 +556,12 @@ extern LSA_STRING smb_lsaLogonOrigin;
 
 /* used for getting a challenge for SMB auth */
 typedef struct _MSV1_0_LM20_CHALLENGE_REQUEST {  
-       MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
+    MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
 } MSV1_0_LM20_CHALLENGE_REQUEST, *PMSV1_0_LM20_CHALLENGE_REQUEST;
 
 typedef struct _MSV1_0_LM20_CHALLENGE_RESPONSE {  
-       MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;  
-       UCHAR ChallengeToClient[MSV1_0_CHALLENGE_LENGTH];
+    MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;  
+    UCHAR ChallengeToClient[MSV1_0_CHALLENGE_LENGTH];
 } MSV1_0_LM20_CHALLENGE_RESPONSE, *PMSV1_0_LM20_CHALLENGE_RESPONSE;
 /**/
 
@@ -569,6 +610,8 @@ extern BOOL smb_IsLegalFilename(char *filename);
 
 extern char *smb_GetSharename(void);
 
+extern DWORD smb_ServerExceptionFilter(void);
+
 /* include other include files */
 #include "smb3.h"
 #include "smb_ioctl.h"
index 980da2c5a210b170c3b403ae595d6c582fce4b6b..9266d3773cb687df7f69d9b73a88ea249b197cf2 100644 (file)
@@ -21,7 +21,6 @@
 #include <string.h>
 #include <stdio.h>
 #include <time.h>
-
 #include <osi.h>
 
 #include "afsd.h"
@@ -76,14 +75,7 @@ unsigned long smb_ExtAttributes(cm_scache_t *scp)
     {
         attrs = SMB_ATTR_DIRECTORY;
 #ifdef SPECIAL_FOLDERS
-#ifdef AFS_FREELANCE_CLIENT
-        if ( cm_freelanceEnabled &&
-             scp->fid.cell==AFS_FAKE_ROOT_CELL_ID && 
-             scp->fid.volume==AFS_FAKE_ROOT_VOL_ID &&
-             scp->fid.vnode==0x1 && scp->fid.unique==0x1) {
-            attrs |= SMB_ATTR_SYSTEM;          /* FILE_ATTRIBUTE_SYSTEM */
-        }
-#endif /* AFS_FREELANCE_CLIENT */
+        attrs |= SMB_ATTR_SYSTEM;              /* FILE_ATTRIBUTE_SYSTEM */
 #endif /* SPECIAL_FOLDERS */
     } else
         attrs = 0;
@@ -922,6 +914,7 @@ long smb_ReceiveV3UserLogoffX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *ou
 }
 
 #define SMB_SUPPORT_SEARCH_BITS        0x0001
+#define SMB_SHARE_IS_IN_DFS            0x0002
 
 long smb_ReceiveV3TreeConnectX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
 {
@@ -944,6 +937,8 @@ long smb_ReceiveV3TreeConnectX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *o
     tp = smb_GetSMBData(inp, NULL);
     passwordp = smb_ParseString(tp, &tp);
     pathp = smb_ParseString(tp, &tp);
+    if (smb_StoreAnsiFilenames)
+        OemToChar(pathp,pathp);
     servicep = smb_ParseString(tp, &tp);
 
     tp = strrchr(pathp, '\\');
@@ -973,7 +968,7 @@ long smb_ReceiveV3TreeConnectX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *o
         
     tidp = smb_FindTID(vcp, newTid, SMB_FLAG_CREATE);
 
-    if(!ipc) {
+    if (!ipc) {
         uidp = smb_FindUID(vcp, ((smb_t *)inp)->uid, 0);
        shareFound = smb_FindShare(vcp, uidp, shareName, &sharePath);
         if (uidp)
@@ -986,7 +981,11 @@ long smb_ReceiveV3TreeConnectX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *o
        if (vcp->flags & SMB_VCFLAG_USENT)
         {
             int policy = smb_FindShareCSCPolicy(shareName);
-            smb_SetSMBParm(outp, 2, SMB_SUPPORT_SEARCH_BITS | (policy << 2));
+            smb_SetSMBParm(outp, 2, SMB_SUPPORT_SEARCH_BITS | 
+#ifdef DFS_SUPPORT
+                            SMB_SHARE_IS_IN_DFS |
+#endif
+                            (policy << 2));
         }
     } else {
         smb_SetSMBParm(outp, 2, 0);
@@ -996,7 +995,8 @@ long smb_ReceiveV3TreeConnectX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *o
     lock_ObtainMutex(&tidp->mx);
     tidp->userp = userp;
     tidp->pathname = sharePath;
-    if(ipc) tidp->flags |= SMB_TIDFLAG_IPC;
+    if (ipc) 
+        tidp->flags |= SMB_TIDFLAG_IPC;
     lock_ReleaseMutex(&tidp->mx);
     smb_ReleaseTID(tidp);
 
@@ -1004,6 +1004,7 @@ long smb_ReceiveV3TreeConnectX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *o
     ((smb_t *)inp)->tid = newTid;
     tp = smb_GetSMBData(outp, NULL);
     if (!ipc) {
+        /* XXX - why is this a drive letter? - jaltman */
         *tp++ = 'A';
         *tp++ = ':';
         *tp++ = 0;
@@ -1141,7 +1142,7 @@ void smb_SendTran2Error(smb_vc_t *vcp, smb_tran2Packet_t *t2p,
 
     /* We can handle long names */
     if (vcp->flags & SMB_VCFLAG_USENT)
-        smbp->flg2 |= 0x40;    /* IS_LONG_NAME */
+        smbp->flg2 |= SMB_FLAGS2_IS_LONG_NAME;
         
     /* now copy important fields from the tran 2 packet */
     smbp->com = t2p->com;
@@ -1155,7 +1156,7 @@ void smb_SendTran2Error(smb_vc_t *vcp, smb_tran2Packet_t *t2p,
         smbp->reh = (unsigned char) ((NTStatus >> 8) & 0xff);
         smbp->errLow = (unsigned char) ((NTStatus >> 16) & 0xff);
         smbp->errHigh = (unsigned char) ((NTStatus >> 24) & 0xff);
-        smbp->flg2 |= 0x4000;
+        smbp->flg2 |= SMB_FLAGS2_ERR_STATUS;
     }
     else {
         smbp->rcls = errClass;
@@ -1181,7 +1182,7 @@ void smb_SendTran2Packet(smb_vc_t *vcp, smb_tran2Packet_t *t2p, smb_packet_t *tp
 
     /* We can handle long names */
     if (vcp->flags & SMB_VCFLAG_USENT)
-        smbp->flg2 |= 0x40;    /* IS_LONG_NAME */
+        smbp->flg2 |= SMB_FLAGS2_IS_LONG_NAME;
 
     /* now copy important fields from the tran 2 packet */
     smbp->com = t2p->com;
@@ -1210,7 +1211,7 @@ void smb_SendTran2Packet(smb_vc_t *vcp, smb_tran2Packet_t *t2p, smb_packet_t *tp
     smb_SetSMBParm(tp, 7, dataOffset); /* offset of data */
     smb_SetSMBParm(tp, 8, 0);          /* data displacement */
     smb_SetSMBParm(tp, 9, 0);          /* low: setup word count *
-    * high: resvd */
+                                         * high: resvd */
 
     datap = smb_GetSMBData(tp, NULL);
     *datap++ = 0;                              /* we rounded to even */
@@ -1606,9 +1607,9 @@ long smb_ReceiveRAPNetShareGetInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_pack
 
     if (infoLevel == 0)
         totalData = sizeof(smb_rap_share_info_0_t);
-    else if(infoLevel == 1)
+    else if(infoLevel == SMB_INFO_STANDARD)
         totalData = sizeof(smb_rap_share_info_1_t) + 1; /* + empty string */
-    else if(infoLevel == 2)
+    else if(infoLevel == SMB_INFO_QUERY_EA_SIZE)
         totalData = sizeof(smb_rap_share_info_2_t) + 2; /* + two empty strings */
     else
         return CM_ERROR_INVAL;
@@ -1658,7 +1659,7 @@ long smb_ReceiveRAPNetShareGetInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_pack
         smb_rap_share_info_0_t * info = (smb_rap_share_info_0_t *) outp->datap;
         strncpy(info->shi0_netname, shareName, sizeof(info->shi0_netname)-1);
         info->shi0_netname[sizeof(info->shi0_netname)-1] = 0;
-    } else if(infoLevel == 1) {
+    } else if(infoLevel == SMB_INFO_STANDARD) {
         smb_rap_share_info_1_t * info = (smb_rap_share_info_1_t *) outp->datap;
         strncpy(info->shi1_netname, shareName, sizeof(info->shi1_netname)-1);
         info->shi1_netname[sizeof(info->shi1_netname)-1] = 0;
@@ -1832,7 +1833,7 @@ long smb_ReceiveRAPNetServerGetInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_pac
         info0 = (smb_rap_server_info_0_t *) outp->datap;
         cstrp = (char *) (info0 + 1);
         strcpy(info0->sv0_name, "AFS");
-    } else { /* infoLevel == 1 */
+    } else { /* infoLevel == SMB_INFO_STANDARD */
         info1 = (smb_rap_server_info_1_t *) outp->datap;
         cstrp = (char *) (info1 + 1);
         strcpy(info1->sv1_name, "AFS");
@@ -2044,7 +2045,9 @@ long smb_ReceiveTran2Open(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t *op)
     if (attributes & 1) initialModeBits &= ~0222;
         
     pathp = (char *) (&p->parmsp[14]);
-        
+    if (smb_StoreAnsiFilenames)
+        OemToChar(pathp,pathp);
+    
     outp = smb_GetTran2ResponsePacket(vcp, p, op, 40, 0);
 
     spacep = cm_GetSpace();
@@ -2352,6 +2355,8 @@ long smb_ReceiveTran2QFSInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t *
     case 0x103: responseSize = sizeof(qi.u.FSsizeInfo); break;
     case 0x104: responseSize = sizeof(qi.u.FSdeviceInfo); break;
     case 0x105: responseSize = sizeof(qi.u.FSattributeInfo); break;
+    case 0x200: /* CIFS Unix Info */
+    case 0x301: /* Mac FS Info */
     default: return CM_ERROR_INVAL;
     }
 
@@ -2524,13 +2529,20 @@ long smb_ReceiveTran2QPathInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t
     cm_InitReq(&req);
 
     infoLevel = p->parmsp[0];
-    if (infoLevel == 6) nbytesRequired = 0;
-    else if (infoLevel == 1) nbytesRequired = 22;
-    else if (infoLevel == 2) nbytesRequired = 26;
-    else if (infoLevel == 0x101) nbytesRequired = 40;
-    else if (infoLevel == 0x102) nbytesRequired = 24;
-    else if (infoLevel == 0x103) nbytesRequired = 4;
-    else if (infoLevel == 0x108) nbytesRequired = 30;
+    if (infoLevel == SMB_INFO_IS_NAME_VALID) 
+        nbytesRequired = 0;
+    else if (infoLevel == SMB_INFO_STANDARD) 
+        nbytesRequired = 22;
+    else if (infoLevel == SMB_INFO_QUERY_EA_SIZE) 
+        nbytesRequired = 26;
+    else if (infoLevel == SMB_QUERY_FILE_BASIC_INFO) 
+        nbytesRequired = 40;
+    else if (infoLevel == SMB_QUERY_FILE_STANDARD_INFO) 
+        nbytesRequired = 24;
+    else if (infoLevel == SMB_QUERY_FILE_EA_INFO) 
+        nbytesRequired = 4;
+    else if (infoLevel == SMB_QUERY_FILE_ALT_NAME_INFO) 
+        nbytesRequired = 30;
     else {
         osi_Log2(smb_logp, "Bad Tran2 op 0x%x infolevel 0x%x",
                   p->opcode, infoLevel);
@@ -2552,7 +2564,7 @@ long smb_ReceiveTran2QPathInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t
      * the syntax, so we just OK things now.  In particular, we're *not*
      * being asked to verify anything about the state of any parent dirs.
      */
-    if (infoLevel == 6) {
+    if (infoLevel == SMB_INFO_IS_NAME_VALID) {
         smb_SendTran2Packet(vcp, outp, opx);
         smb_FreeTran2Packet(outp);
         return 0;
@@ -2587,13 +2599,14 @@ long smb_ReceiveTran2QPathInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t
      * yet been evaluated and for directories that haven't yet been
      * fetched.
      */
-    if (infoLevel == 0x101) {
+    if (infoLevel == SMB_QUERY_FILE_BASIC_INFO) {
         spacep = cm_GetSpace();
         smb_StripLastComponent(spacep->data, &lastComp,
                                 (char *)(&p->parmsp[3]));
+#ifndef SPECIAL_FOLDERS
         /* Make sure that lastComp is not NULL */
         if (lastComp) {
-            if (strcmp(lastComp, "\\desktop.ini") == 0) {
+            if (stricmp(lastComp, "\\desktop.ini") == 0) {
                 code = cm_NameI(cm_rootSCachep, spacep->data,
                                  CM_FLAG_CASEFOLD
                                  | CM_FLAG_DIRSEARCH
@@ -2621,6 +2634,8 @@ long smb_ReceiveTran2QPathInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t
                 }
             }
         }
+#endif /* SPECIAL_FOLDERS */
+
         cm_FreeSpace(spacep);
     }
 
@@ -2660,7 +2675,7 @@ long smb_ReceiveTran2QPathInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t
 
         goto done;
     }
-    if (infoLevel == 1 || infoLevel == 2) {
+    if (infoLevel == SMB_INFO_STANDARD || infoLevel == SMB_INFO_QUERY_EA_SIZE) {
         smb_SearchTimeFromUnixTime(&dosTime, scp->clientModTime);
         *((u_long *)op) = dosTime; op += 4;    /* creation time */
         *((u_long *)op) = dosTime; op += 4;    /* access time */
@@ -2670,7 +2685,7 @@ long smb_ReceiveTran2QPathInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t
         attributes = smb_Attributes(scp);
         *((u_short *)op) = attributes; op += 2;        /* attributes */
     }
-    else if (infoLevel == 0x101) {
+    else if (infoLevel == SMB_QUERY_FILE_BASIC_INFO) {
         smb_LargeSearchTimeFromUnixTime(&ft, scp->clientModTime);
         *((FILETIME *)op) = ft; op += 8;       /* creation time */
         *((FILETIME *)op) = ft; op += 8;       /* last access time */
@@ -2680,7 +2695,7 @@ long smb_ReceiveTran2QPathInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t
         *((u_long *)op) = extAttributes; op += 4; /* extended attribs */
         *((u_long *)op) = 0; op += 4;  /* don't know what this is */
     }
-    else if (infoLevel == 0x102) {
+    else if (infoLevel == SMB_QUERY_FILE_STANDARD_INFO) {
         *((LARGE_INTEGER *)op) = scp->length; op += 8; /* alloc size */
         *((LARGE_INTEGER *)op) = scp->length; op += 8; /* EOF */
         *((u_long *)op) = scp->linkCount; op += 4;
@@ -2689,12 +2704,12 @@ long smb_ReceiveTran2QPathInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t
         *op++ = (scp->fileType == CM_SCACHETYPE_DIRECTORY ? 1 : 0);
         *op++ = 0;
     }
-    else if (infoLevel == 0x103) {
+    else if (infoLevel == SMB_QUERY_FILE_EA_INFO) {
         memset(op, 0, 4); op += 4;     /* EA size */
     }
 
     /* now, if we are being asked about extended attrs, return a 0 size */
-    if (infoLevel == 2) {
+    if (infoLevel == SMB_INFO_QUERY_EA_SIZE) {
         *((u_long *)op) = 0; op += 4;
     }
 
@@ -2745,10 +2760,14 @@ long smb_ReceiveTran2QFileInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t
     }
 
     infoLevel = p->parmsp[1];
-    if (infoLevel == 0x101) nbytesRequired = 40;
-    else if (infoLevel == 0x102) nbytesRequired = 24;
-    else if (infoLevel == 0x103) nbytesRequired = 4;
-    else if (infoLevel == 0x104) nbytesRequired = 6;
+    if (infoLevel == SMB_QUERY_FILE_BASIC_INFO) 
+        nbytesRequired = 40;
+    else if (infoLevel == SMB_QUERY_FILE_STANDARD_INFO) 
+        nbytesRequired = 24;
+    else if (infoLevel == SMB_QUERY_FILE_EA_INFO)
+        nbytesRequired = 4;
+    else if (infoLevel == SMB_QUERY_FILE_NAME_INFO) 
+        nbytesRequired = 6;
     else {
         osi_Log2(smb_logp, "Bad Tran2 op 0x%x infolevel 0x%x",
                   p->opcode, infoLevel);
@@ -2784,7 +2803,7 @@ long smb_ReceiveTran2QFileInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t
      * Marshall the output data.
      */
     op = outp->datap;
-    if (infoLevel == 0x101) {
+    if (infoLevel == SMB_QUERY_FILE_BASIC_INFO) {
         smb_LargeSearchTimeFromUnixTime(&ft, scp->clientModTime);
         *((FILETIME *)op) = ft; op += 8;       /* creation time */
         *((FILETIME *)op) = ft; op += 8;       /* last access time */
@@ -2794,7 +2813,7 @@ long smb_ReceiveTran2QFileInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t
         *((u_long *)op) = attributes; op += 4;
         *((u_long *)op) = 0; op += 4;
     }
-    else if (infoLevel == 0x102) {
+    else if (infoLevel == SMB_QUERY_FILE_STANDARD_INFO) {
         *((LARGE_INTEGER *)op) = scp->length; op += 8; /* alloc size */
         *((LARGE_INTEGER *)op) = scp->length; op += 8; /* EOF */
         *((u_long *)op) = scp->linkCount; op += 4;
@@ -2803,10 +2822,10 @@ long smb_ReceiveTran2QFileInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t
         *op++ = 0;
         *op++ = 0;
     }
-    else if (infoLevel == 0x103) {
+    else if (infoLevel == SMB_QUERY_FILE_EA_INFO) {
         *((u_long *)op) = 0; op += 4;
     }
-    else if (infoLevel == 0x104) {
+    else if (infoLevel == SMB_QUERY_FILE_NAME_INFO) {
         unsigned long len;
         char *name;
 
@@ -2865,12 +2884,12 @@ long smb_ReceiveTran2SetFileInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet
         return 0;
     }
 
-    if (infoLevel == 0x102 && !(fidp->flags & SMB_FID_OPENDELETE)) {
+    if (infoLevel == SMB_QUERY_FILE_STANDARD_INFO && !(fidp->flags & SMB_FID_OPENDELETE)) {
         smb_SendTran2Error(vcp, p, op, CM_ERROR_NOACCESS);
         smb_ReleaseFID(fidp);
         return 0;
     }
-    if ((infoLevel == 0x103 || infoLevel == 0x104)
+    if ((infoLevel == SMB_QUERY_FILE_EA_INFO || infoLevel == SMB_QUERY_FILE_NAME_INFO)
          && !(fidp->flags & SMB_FID_OPENWRITE)) {
         smb_SendTran2Error(vcp, p, op, CM_ERROR_NOACCESS);
         smb_ReleaseFID(fidp);
@@ -2893,7 +2912,7 @@ long smb_ReceiveTran2SetFileInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet
 
     scp = fidp->scp;
 
-    if (infoLevel == 0x101) {
+    if (infoLevel == SMB_QUERY_FILE_BASIC_INFO) {
         FILETIME lastMod;
         unsigned int attribute;
         cm_attr_t attr;
@@ -2949,7 +2968,7 @@ long smb_ReceiveTran2SetFileInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet
         else
             code = 0;
     }               
-    else if (infoLevel == 0x103 || infoLevel == 0x104) {
+    else if (infoLevel == SMB_QUERY_FILE_EA_INFO || infoLevel == SMB_QUERY_FILE_NAME_INFO) {
         LARGE_INTEGER size = *((LARGE_INTEGER *)(p->datap));
         cm_attr_t attr;
 
@@ -2958,7 +2977,7 @@ long smb_ReceiveTran2SetFileInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet
         attr.length.HighPart = size.HighPart;
         code = cm_SetAttr(scp, &attr, userp, &req);
     }       
-    else if (infoLevel == 0x102) {
+    else if (infoLevel == SMB_QUERY_FILE_STANDARD_INFO) {
         if (*((char *)(p->datap))) {
             code = cm_CheckNTDelete(fidp->NTopen_dscp, scp, userp,
                                      &req);
@@ -3028,6 +3047,16 @@ smb_ReceiveTran2SessionSetup(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t *
 long 
 smb_ReceiveTran2GetDFSReferral(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t *outp)
 {
+    /* This is a UNICODE only request (bit15 of Flags2) */
+    /* The TID must be IPC$ */
+
+    /* The documentation for the Flags response field is contradictory */
+
+    /* Use Version 1 Referral Element Format */
+    /* ServerType = 0; indicates the next server should be queried for the file */
+    /* ReferralFlags = 0x01; PathConsumed characters should be stripped */
+    /* Node = UnicodeString of UNC path of the next share name */
+
     osi_Log0(smb_logp,"ReceiveTran2GetDFSReferral - NOT_SUPPORTED");
     return CM_ERROR_BADOP;
 }
@@ -3035,6 +3064,15 @@ smb_ReceiveTran2GetDFSReferral(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t
 long 
 smb_ReceiveTran2ReportDFSInconsistency(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t *outp)
 {
+    /* This is a UNICODE only request (bit15 of Flags2) */
+
+    /* There is nothing we can do about this operation.  The client is going to
+     * tell us that there is a Version 1 Referral Element for which there is a DFS Error.
+     * Unfortunately, there is really nothing we can do about it other then log it 
+     * somewhere.  Even then I don't think there is anything for us to do.
+     * So let's return an error value.
+     */
+
     osi_Log0(smb_logp,"ReceiveTran2ReportDFSInconsistency - NOT_SUPPORTED");
     return CM_ERROR_BADOP;
 }
@@ -3583,6 +3621,8 @@ long smb_ReceiveTran2SearchDir(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t
         dsp = smb_NewDirSearch(1);
         dsp->attribute = attribute;
         pathp = ((char *) p->parmsp) + 12;     /* points to path */
+        if (smb_StoreAnsiFilenames)
+            OemToChar(pathp,pathp);
         nextCookie = 0;
         maskp = strrchr(pathp, '\\');
         if (maskp == NULL) 
@@ -3892,7 +3932,7 @@ long smb_ReceiveTran2SearchDir(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t
 
         /* Need 8.3 name? */
         NeedShortName = 0;
-        if (infoLevel == 0x104
+        if (infoLevel == SMB_QUERY_FILE_NAME_INFO
              && dep->fid.vnode != 0
              && !cm_Is8Dot3(dep->name)) {
             cm_Gen8Dot3Name(dep, shortName, &shortNameEnd);
@@ -3932,12 +3972,12 @@ long smb_ReceiveTran2SearchDir(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t
             /* standard dir entry stuff */
             if (infoLevel < 0x101)
                 ohbytes = 23;  /* pre-NT */
-            else if (infoLevel == 0x103)
+            else if (infoLevel == SMB_QUERY_FILE_EA_INFO)
                 ohbytes = 12;  /* NT names only */
             else
                 ohbytes = 64;  /* NT */
 
-            if (infoLevel == 0x104)
+            if (infoLevel == SMB_QUERY_FILE_NAME_INFO)
                 ohbytes += 26; /* Short name & length */
 
             if (searchFlags & 4) {
@@ -3974,16 +4014,20 @@ long smb_ReceiveTran2SearchDir(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t
 
             if (infoLevel <= 0x101)
                 *(origOp + ohbytes - 1) = (unsigned char) onbytes;
-            else if (infoLevel == 0x103)
+            else if (infoLevel == SMB_QUERY_FILE_EA_INFO)
                 *((u_long *)(op + 8)) = onbytes;
             else
                 *((u_long *)(op + 60)) = onbytes;
             strcpy(origOp+ohbytes, dep->name);
+            if (smb_StoreAnsiFilenames)
+                CharToOem(origOp+ohbytes, origOp+ohbytes);
 
             /* Short name if requested and needed */
-            if (infoLevel == 0x104) {
+            if (infoLevel == SMB_QUERY_FILE_NAME_INFO) {
                 if (NeedShortName) {
                     strcpy(op + 70, shortName);
+                    if (smb_StoreAnsiFilenames)
+                        CharToOem(op + 70, op + 70);
                     *(op + 68) = shortNameEnd - shortName;
                 }
             }
@@ -4001,7 +4045,7 @@ long smb_ReceiveTran2SearchDir(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t
             /* now we emit the attribute.  This is tricky, since
              * we need to really stat the file to find out what
              * type of entry we've got.  Right now, we're copying
-             * out data from a buffer, while holding the scp
+             * out data from a buffer, while holding the scp
              * locked, so it isn't really convenient to stat
              * something now.  We'll put in a place holder
              * now, and make a second pass before returning this
@@ -4213,6 +4257,8 @@ long smb_ReceiveV3OpenX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
     if (attributes & 1) initialModeBits &= ~0222;
         
     pathp = smb_GetSMBData(inp, NULL);
+    if (smb_StoreAnsiFilenames)
+        OemToChar(pathp,pathp);
 
     spacep = inp->spacep;
     smb_StripLastComponent(spacep->data, &lastNamep, pathp);
@@ -4856,6 +4902,8 @@ long smb_ReceiveNTCreateX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
     realPathp = malloc(nameLength+1);
     memcpy(realPathp, pathp, nameLength);
     realPathp[nameLength] = 0;
+    if (smb_StoreAnsiFilenames)
+        OemToChar(realPathp,realPathp);
 
     spacep = inp->spacep;
     smb_StripLastComponent(spacep->data, &lastNamep, realPathp);
@@ -5477,6 +5525,8 @@ long smb_ReceiveNTTranCreate(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *out
     realPathp = malloc(nameLength+1);
     memcpy(realPathp, pathp, nameLength);
     realPathp[nameLength] = 0;
+    if (smb_StoreAnsiFilenames)
+        OemToChar(realPathp,realPathp);
 
     spacep = cm_GetSpace();
     smb_StripLastComponent(spacep->data, &lastNamep, realPathp);
@@ -5983,16 +6033,16 @@ long smb_ReceiveNTTranNotifyChange(smb_vc_t *vcp, smb_packet_t *inp,
 unsigned char nullSecurityDesc[36] = {
     0x01,                              /* security descriptor revision */
     0x00,                              /* reserved, should be zero */
-    0x00, 0x80,                        /* security descriptor control;
-    * 0x8000 : self-relative format */
+    0x00, 0x80,                                /* security descriptor control;
+                                         * 0x8000 : self-relative format */
     0x14, 0x00, 0x00, 0x00,            /* offset of owner SID */
     0x1c, 0x00, 0x00, 0x00,            /* offset of group SID */
     0x00, 0x00, 0x00, 0x00,            /* offset of DACL would go here */
     0x00, 0x00, 0x00, 0x00,            /* offset of SACL would go here */
     0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    /* "null SID" owner SID */
+                                        /* "null SID" owner SID */
     0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-    /* "null SID" group SID */
+                                        /* "null SID" group SID */
 };      
 
 long smb_ReceiveNTTranQuerySecurityDesc(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
@@ -6073,7 +6123,7 @@ long smb_ReceiveNTTransact(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
 
     /* We can handle long names */
     if (vcp->flags & SMB_VCFLAG_USENT)
-        ((smb_t *)outp)->flg2 |= 0x40; /* IS_LONG_NAME */
+        ((smb_t *)outp)->flg2 |= SMB_FLAGS2_IS_LONG_NAME;
         
     switch (function) {
     case 6: 
@@ -6219,6 +6269,7 @@ void smb_NotifyChange(DWORD action, DWORD notifyFilter,
         smb_SetSMBDataLength(watch, parmCount + 1);
 
         if (parmCount != 0) {
+            char * p;
             outData = smb_GetSMBData(watch, NULL);
             outData++; /* round to get to parmOffset */
             oldOutData = outData;
@@ -6228,7 +6279,11 @@ void smb_NotifyChange(DWORD action, DWORD notifyFilter,
             /* Action */
             *((DWORD *)outData) = nameLen*2; outData += 4;
             /* File Name Length */
-            mbstowcs((WCHAR *)outData, filename, nameLen);
+            p = strdup(filename);
+            if (smb_StoreAnsiFilenames)
+                CharToOem(p,p);
+            mbstowcs((WCHAR *)outData, p, nameLen);
+            free(p);
             /* File Name */
             if (twoEntries) {
                 outData = oldOutData + oldParmCount;
@@ -6238,8 +6293,11 @@ void smb_NotifyChange(DWORD action, DWORD notifyFilter,
                 /* Action */
                 *((DWORD *)outData) = otherNameLen*2;
                 outData += 4;  /* File Name Length */
-                mbstowcs((WCHAR *)outData, otherFilename,
-                          otherNameLen);       /* File Name */
+                p = strdup(otherFilename);
+                if (smb_StoreAnsiFilenames)
+                    CharToOem(p,p);
+                mbstowcs((WCHAR *)outData, p, otherNameLen);   /* File Name */
+                free(p);
             }       
         }       
 
@@ -6256,7 +6314,7 @@ void smb_NotifyChange(DWORD action, DWORD notifyFilter,
             ((smb_t *) watch)->errLow = 0;
             ((smb_t *) watch)->errHigh = 0;
             /* Set NT Status codes flag */
-            ((smb_t *) watch)->flg2 |= 0x4000;
+            ((smb_t *) watch)->flg2 |= SMB_FLAGS2_ERR_STATUS;
         }
 
         smb_SendPacket(vcp, watch);
@@ -6325,7 +6383,7 @@ long smb_ReceiveNTCancel(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
             ((smb_t *)watch)->reh = 0x1;
             ((smb_t *)watch)->errLow = 0;
             ((smb_t *)watch)->errHigh = 0xC0;
-            ((smb_t *)watch)->flg2 |= 0x4000;
+            ((smb_t *)watch)->flg2 |= SMB_FLAGS2_ERR_STATUS;
             smb_SendPacket(vcp, watch);
             if (watch->vcp)
                 smb_ReleaseVC(watch->vcp);
@@ -6351,7 +6409,7 @@ long smb_ReceiveNTCancel(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
 
 long smb_ReceiveNTRename(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
 {
-    char *oldname, *newname;
+    char *oldPathp, *newPathp;
     long code = 0;
     cm_user_t *userp;
     char * tp;
@@ -6367,18 +6425,22 @@ long smb_ReceiveNTRename(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
     }
 
     tp = smb_GetSMBData(inp, NULL);
-    oldname = smb_ParseASCIIBlock(tp, &tp);
-    newname = smb_ParseASCIIBlock(tp, &tp);
+    oldPathp = smb_ParseASCIIBlock(tp, &tp);
+    if (smb_StoreAnsiFilenames)
+        OemToChar(oldPathp,oldPathp);
+    newPathp = smb_ParseASCIIBlock(tp, &tp);
+    if (smb_StoreAnsiFilenames)
+        OemToChar(newPathp,newPathp);
 
     osi_Log3(smb_logp, "NTRename for [%s]->[%s] type [%s]",
-             osi_LogSaveString(smb_logp, oldname),
-             osi_LogSaveString(smb_logp, newname),
+             osi_LogSaveString(smb_logp, oldPathp),
+             osi_LogSaveString(smb_logp, newPathp),
              ((rename_type==RENAME_FLAG_RENAME)?"rename":"hardlink"));
 
     if (rename_type == RENAME_FLAG_RENAME) {
-        code = smb_Rename(vcp,inp,oldname,newname,attrs);
+        code = smb_Rename(vcp,inp,oldPathp,newPathp,attrs);
     } else { /* RENAME_FLAG_HARD_LINK */
-        code = smb_Link(vcp,inp,oldname,newname);
+        code = smb_Link(vcp,inp,oldPathp,newPathp);
     }
     return code;
 }
index 99f5ca5802ee3f46b223dcbb35d72a97e5aba947..6b795665bdf0d4e31874c3aaea49eb7672489d2d 100644 (file)
@@ -41,45 +41,45 @@ typedef struct smb_tran2Dispatch {
 } smb_tran2Dispatch_t;
 
 typedef struct smb_tran2QFSInfo {
-       union {
+    union {
 #pragma pack(push, 2)
-               struct {
-                       long FSID;                      /* file system ID */
-                        long sectorsPerAllocUnit;
-                        long totalAllocUnits;          /* on the disk */
-                        long availAllocUnits;          /* free blocks */
-                        unsigned short bytesPerSector; /* bytes per sector */
-                } allocInfo;
+        struct {
+            long FSID;                 /* file system ID */
+            long sectorsPerAllocUnit;
+            long totalAllocUnits;              /* on the disk */
+            long availAllocUnits;              /* free blocks */
+            unsigned short bytesPerSector;     /* bytes per sector */
+        } allocInfo;
 #pragma pack(pop)
-                struct {
-                       long vsn;       /* volume serial number */
-                        char vnCount;  /* count of chars in label, incl null */
-                        char label[12];        /* pad out with nulls */
-                } volumeInfo;
-               struct {
-                       FILETIME vct;   /* volume creation time */
-                       long vsn;       /* volume serial number */
-                       long vnCount;   /* length of volume label in bytes */
-                       char res[2];    /* reserved */
-                       char label[10]; /* volume label */
-               } FSvolumeInfo;
-               struct {
-                       osi_hyper_t totalAllocUnits;    /* on the disk */
-                       osi_hyper_t availAllocUnits;    /* free blocks */
-                       long sectorsPerAllocUnit;
-                       long bytesPerSector;            /* bytes per sector */
-               } FSsizeInfo;
-               struct {
-                       long devType;   /* device type */
-                       long characteristics;
-               } FSdeviceInfo;
-               struct {
-                       long attributes;
-                       long maxCompLength;     /* max path component length */
-                       long FSnameLength;      /* length of file system name */
-                       char FSname[12];
-               } FSattributeInfo;
-        } u;
+        struct {
+            long vsn;          /* volume serial number */
+            char vnCount;      /* count of chars in label, incl null */
+            char label[12];    /* pad out with nulls */
+        } volumeInfo;
+        struct {
+            FILETIME vct;      /* volume creation time */
+            long vsn;          /* volume serial number */
+            long vnCount;      /* length of volume label in bytes */
+            char res[2];       /* reserved */
+            char label[10];    /* volume label */
+        } FSvolumeInfo;
+        struct {
+            osi_hyper_t totalAllocUnits;       /* on the disk */
+            osi_hyper_t availAllocUnits;       /* free blocks */
+            long sectorsPerAllocUnit;
+            long bytesPerSector;               /* bytes per sector */
+        } FSsizeInfo;
+        struct {
+            long devType;      /* device type */
+            long characteristics;
+        } FSdeviceInfo;
+        struct {
+            long attributes;
+            long maxCompLength;        /* max path component length */
+            long FSnameLength; /* length of file system name */
+            char FSname[12];
+        } FSattributeInfo;
+    } u;
 } smb_tran2QFSInfo_t;
 
 /* more than enough opcodes for today, anyway */
index d74932b89014233d383140550ac2b10d2f254166..db82b5e46175d596b69d1a87655da3b9c7847793 100644 (file)
@@ -91,7 +91,7 @@ lang::
 
 clean::
        $(CD) lang
-       for /f %l in ('dir /B ??_??') do @$(NTLANG) %l $(MAKECMD) /nologo /f NTMakefile clean
+       for /f %l in ('dir /B ??_??') do ( if exist @$(NTLANG) do @$(NTLANG) %l $(MAKECMD) /nologo /f NTMakefile clean )
        $(CD) ..
 
 mkdir:
@@ -99,4 +99,4 @@ mkdir:
        cd lang
        nmake /nologo /f ntmakefile SRC=$(SRC) OBJ=$(OBJ) mkdir
        cd ..
-       
+
index c9dfd8205d60d8c301f546c1b5160d8c550f3e1f..1e5b1c2a89eaff1a8a4505b490548dcd062335fa 100644 (file)
@@ -56,7 +56,7 @@ lang::
 
 clean::
        $(CD) lang
-       for /f %l in ('dir /B ??_??') do @$(NTLANG) %l $(MAKECMD) /nologo /f NTMakefile clean
+       for /f %l in ('dir /B ??_??') do ( if exist @$(NTLANG) do @$(NTLANG) %l $(MAKECMD) /nologo /f NTMakefile clean )
        $(CD) ..
 
 mkdir:
index 0526ac91a43cf3a914b408021b6a7dc4dc865941..ec161ad371e6fc9f7de16fefabeb6fe1c4ec014f 100644 (file)
@@ -118,7 +118,7 @@ $(OUT)\svrmgr_stub.res : AFS_component_version_number.h
 
 clean::
        $(CD) lang
-       for /f %l in ('dir /B ??_??') do @$(NTLANG) %l $(MAKECMD) /nologo /f NTMakefile clean
+       for /f %l in ('dir /B ??_??') do ( if exist @$(NTLANG) do @$(NTLANG) %l $(MAKECMD) /nologo /f NTMakefile clean )
        $(CD) ..
 
 mkdir:
index 3514cc0d5e42477b05f0bd63935b72998bccc010..319d5a10c989bd0c6fa3c076055a23d9c1a00715 100644 (file)
@@ -95,7 +95,7 @@ $(OUT)\AfsUsrMgr_stub.res : AFS_component_version_number.h
 
 clean::
        $(CD) lang
-       for /f %l in ('dir /B ??_??') do @$(NTLANG) %l $(MAKECMD) /nologo /f NTMakefile clean
+       for /f %l in ('dir /B ??_??') do ( if exist @$(NTLANG) do @$(NTLANG) %l $(MAKECMD) /nologo /f NTMakefile clean )
        $(CD) ..
 
 mkdir:
@@ -103,4 +103,4 @@ mkdir:
        cd lang
        nmake /nologo /f ntmakefile SRC=$(SRC) OBJ=$(OBJ) mkdir
        cd ..
-       
+
index 5305f3c651364545651b234c692ec07b5ad7f171..c7bc1fc4cabdf89af7669a4635c9c1640cac8d9e 100644 (file)
@@ -141,7 +141,7 @@ DeleteRegistryString(HKEY key, TCHAR * subkey, LPTSTR lhs)
                     0,
                     NULL,
                     REG_OPTION_NON_VOLATILE,
-                    KEY_READ,
+                    KEY_WRITE,
                     NULL,
                     &hkSub,
                     NULL);
index 3ec357f21390b27b650eb1997aab3e70ccc0843c..39c56d43165dc0efb3764401cb16c78bd12218e0 100644 (file)
@@ -722,37 +722,57 @@ void Submounts_OnRemove (HWND hDlg)
 // Action - On Add or On Edit a submount item
 void Submounts_EditSubmount (HWND hDlg, PSUBMOUNT pSubmount)
 {
-   HWND hList = GetDlgItem (hDlg, IDC_LIST);
+    TCHAR szOrigSubmount[MAX_PATH];
+    _tcscpy(szOrigSubmount, pSubmount->szSubmount);
 
-   if (ModalDialogParam (IDD_SUBMOUNT_EDIT, GetParent(hDlg), (DLGPROC)SubEdit_DlgProc, (LPARAM)pSubmount) == IDOK)
-      {
-      TCHAR szMapping[ MAX_PATH ];
-      AdjustAfsPath (szMapping, pSubmount->szMapping, TRUE, FALSE);
+    HWND hList = GetDlgItem (hDlg, IDC_LIST);
 
-      HLISTITEM hItem;
-      for (hItem = FastList_FindFirst (hList); hItem; hItem = FastList_FindNext (hList, hItem))
-         {
-         LPCTSTR pszSubmount;
-         if ((pszSubmount = FastList_GetItemText (hList, hItem, 0)) == NULL)
-            continue;
+    if (ModalDialogParam (IDD_SUBMOUNT_EDIT, GetParent(hDlg), (DLGPROC)SubEdit_DlgProc, (LPARAM)pSubmount) == IDOK)
+    {
+        TCHAR szMapping[ MAX_PATH ];
+        BOOL bNameChange = (szOrigSubmount[0] && _tcsicmp(szOrigSubmount, pSubmount->szSubmount));
 
-         if (!lstrcmpi (pszSubmount, pSubmount->szSubmount))
-            break;
-         }
+        AdjustAfsPath (szMapping, pSubmount->szMapping, TRUE, FALSE);
 
-      if (!hItem)
-         {
-         FASTLISTADDITEM ai;
-         memset (&ai, 0x00, sizeof(FASTLISTADDITEM));
-         ai.iFirstImage = IMAGE_NOIMAGE;
-         ai.iSecondImage = IMAGE_NOIMAGE;
-         ai.pszText = pSubmount->szSubmount;
-         ai.lParam = 0;
-         hItem = FastList_AddItem (hList, &ai);
-         }
+        HLISTITEM hItem;
 
-      FastList_SetItemText (hList, hItem, 1, szMapping);
-      }
+        if ( bNameChange ) {
+            for (hItem = FastList_FindFirst (hList); hItem; hItem = FastList_FindNext (hList, hItem))
+            {
+                LPCTSTR pszSubmount;
+                if ((pszSubmount = FastList_GetItemText (hList, hItem, 0)) == NULL)
+                    continue;
+
+                if (!_tcsicmp(szOrigSubmount, pszSubmount) ) {
+                    FastList_RemoveItem (hList, hItem);
+                    break;
+                }
+            }
+        }
+
+        for (hItem = FastList_FindFirst (hList); hItem; hItem = FastList_FindNext (hList, hItem))
+        {
+            LPCTSTR pszSubmount;
+            if ((pszSubmount = FastList_GetItemText (hList, hItem, 0)) == NULL)
+                continue;
+
+            if (!_tcsicmp(pszSubmount, pSubmount->szSubmount))
+                break;
+        }
+
+        if (!hItem)
+        {
+            FASTLISTADDITEM ai;
+            memset (&ai, 0x00, sizeof(FASTLISTADDITEM));
+            ai.iFirstImage = IMAGE_NOIMAGE;
+            ai.iSecondImage = IMAGE_NOIMAGE;
+            ai.pszText = pSubmount->szSubmount;
+            ai.lParam = 0;
+            hItem = FastList_AddItem (hList, &ai);
+        }
+
+        FastList_SetItemText (hList, hItem, 1, szMapping);
+    }
 }
 
 
index b58c51e07c8979231b0e04c9021d0fdc784ceeaa..4853b5d68b164ad1623ebf11d64456960ee76d05 100644 (file)
@@ -129,7 +129,7 @@ $(OUT)\afscreds_stub.res : afscreds_stub.rc AFS_component_version_number.h
 
 clean::
        $(CD) lang
-       for /f %l in ('dir /B ??_??') do @$(NTLANG) %l $(MAKECMD) /nologo /f NTMakefile clean
+       for /f %l in ('dir /B ??_??') do ( if exist @$(NTLANG) do @$(NTLANG) %l $(MAKECMD) /nologo /f NTMakefile clean )
        $(CD) ..
 
 mkdir:
index ff568ca18ee499c97bf864f9f049efb62e5a6f73..47312c911a627b8270b26d3e14194c80eac3c68e 100644 (file)
@@ -446,7 +446,7 @@ int GetDefaultCell (LPTSTR pszCell)
     }
     else if (IsServiceRunning())
     {
-        char szCellA[ 256 ] = "";
+        char szCellA[ cchRESOURCE ] = "";
         int rc;
         HKEY hk;
 
@@ -463,8 +463,8 @@ int GetDefaultCell (LPTSTR pszCell)
         } else {
             rc = 0;
         }
-               if (rc == 0)
-                       CopyAnsiToString(pszCell, szCellA);
+        if (rc == 0)
+            CopyAnsiToString(pszCell, szCellA);
     }
     return rc;
 }
index 2ab0949fba6b62d6b5133bb1a7caca87e4adbfe5..d9ac53ea41bcc5ecf053c0322650740c551c5c03 100644 (file)
@@ -389,6 +389,10 @@ void NewCreds_OnCancel (HWND hDlg)
        pszCell = (LPTSTR)GetWindowLong (hDlg, DWL_USER);
    if (pszCell)
       {
+      HWND hTab = GetDlgItem (g.hMain, IDC_TABS);
+      LPTSTR pszTab = (LPTSTR)GetTabParam (hTab, TabCtrl_GetCurSel(hTab));
+      HWND hChildDlg = NULL;
+
       lock_ObtainMutex(&g.credsLock);
       for (size_t iCreds = 0; iCreds < g.cCreds; ++iCreds)
          {
@@ -399,17 +403,16 @@ void NewCreds_OnCancel (HWND hDlg)
 
             // Check the active tab, and fix its checkbox if necessary
             //
-            HWND hTab = GetDlgItem (g.hMain, IDC_TABS);
-            LPTSTR pszTab = (LPTSTR)GetTabParam (hTab, TabCtrl_GetCurSel(hTab));
             if (pszTab && HIWORD(pszTab) && (!lstrcmpi (pszTab, pszCell)))
                {
-               HWND hDlg = GetTabChild (hTab);
-               if (hDlg)
-                  CheckDlgButton (hDlg, IDC_CREDS_REMIND, FALSE);
+               hChildDlg = GetTabChild (hTab);
                }
             }
          }
       lock_ReleaseMutex(&g.credsLock);
-      }
+
+      if (hChildDlg)
+         CheckDlgButton (hChildDlg, IDC_CREDS_REMIND, FALSE);
+         }
 }
 
index 631b006575ba5800e664ecbcddec1238a2e679e2..47199b97b501c178fa64dc5873b82ed93eb0b880 100644 (file)
@@ -72,8 +72,8 @@ DLLOBJS =\
 DLLLIBS =\
         rpcndr.lib \
         rpcrt4.lib \
-        rpcns4.lib \
-       largeint.lib
+        rpcns4.lib
+#      largeint.lib
 
 $(DLLFILE): $(DLLOBJS) 
        $(DLLGUILINK) $(DLLLIBS) -def:libosi.def
index 686a8ea62fe7db6b02a4bb486e2adddc09aae949..42c425049068b006dce1716adb72f7d172e16d22 100644 (file)
@@ -574,6 +574,10 @@ Section "AFS Client" secClient
   WriteRegStr HKCR "FOLDER\shellex\ContextMenuHandlers\AFS Client Shell Extension" "" "{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}"
   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved" "{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}" "AFS Client Shell Extension"
   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Control Panel\Cpls" "afs_cpa" "$INSTDIR\Client\Program\afs_cpa.cpl"
+
+  ; Support for apps that wrote submount data directly to afsdsbmt.ini
+  WriteRegStr HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\IniFileMapping\afsdsbmt.ini" "AFS Mappings" "USR:Software\OpenAFS\Client\mappings"
+  WriteRegStr HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\IniFileMapping\afsdsbmt.ini" "AFS Submounts" "SYS:OpenAFS\Client\Submounts"
   
   ; AFS Reg entries
   DeleteRegKey HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion"
@@ -1963,7 +1967,10 @@ StartRemove:
   DeleteRegKey /ifempty HKLM "${AFS_REGKEY_ROOT}"
   DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenAFS"
   DeleteRegValue HKLM "SYSTEM\CurrentControlSet\Services\NetBT\Parameters" "SmbDeviceEnabled"
+
+  ; Support for apps that wrote submount data directly to afsdsbmt.ini
+  DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\IniFileMapping\afsdsbmt.ini"
+
   RMDir  "$INSTDIR"
 
 SectionEnd
@@ -2232,18 +2239,49 @@ Function AFSPageGetCellName
   StrCmp $R0 "0" good
   
 startOver:
+   ; We want to read in the existing parameters and make them the defaults
+   
+   ;AFS Crypt security
+   ReadRegDWORD $R1 HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "SecurityLevel"
+   StrCmp $R1 "" +3
+   WriteINIStr $1 "Field 3" "State" $R1
+   goto +2
+   WriteINIStr $1 "Field 3" "State" "1"
+   
+   ;Use DNS
+   ReadRegDWORD $R1 HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "UseDNS"
+   StrCmp $R1 "" +3
+   WriteINIStr $1 "Field 9" "State" $R1
+   goto +2
+   WriteINIStr $1 "Field 9" "State" "1"
+   
+   ; Use integrated logon
+   ReadRegDWORD $R1 HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "LogonOptions"
+   StrCmp $R1 "" +3
+   WriteINIStr $1 "Field 7" "State" $R1
+   goto +2
+   WriteINIStr $1 "Field 7" "State" "0"
+   
    ; If this is a server install, we do NOT want to recommend the Freelance client
    ; And we do not need to ask for the cell name.
    SectionGetFlags ${secServer} $R1
    IntOp $R1 $R1 & ${SF_SELECTED}
    StrCmp $R1 "1" +1 NotServer
    WriteINIStr $1 "Field 6" "Text" "Enable AFS Freelance client (Not Recommended for servers)"
+   ReadRegDWORD $R1 HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "FreelanceClient"
+   StrCmp $R1 "" +3
+   WriteINIStr $1 "Field 5" "State" $R1
+   goto +2
    WriteINIStr $1 "Field 5" "State" "0"
    WriteINIStr $1 "Field 1" "Flags" "DISABLED"
    WriteINIStr $1 "Field 2" "Flags" "DISABLED"
    goto SkipServerTest
 NotServer:
    WriteINIStr $1 "Field 6" "Text" "Enable AFS Freelance client (Recommended)"
+   ReadRegDWORD $R1 HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "FreelanceClient"
+   StrCmp $R1 "" +3
+   WriteINIStr $1 "Field 5" "State" $R1
+   goto +2
    WriteINIStr $1 "Field 5" "State" "1"
    WriteINIStr $1 "Field 1" "Flags" ""
    WriteINIStr $1 "Field 2" "Flags" ""
index d786b2d75920e3f1f3748a8a9c7ab5db3e665d2b..cb35995b17fc03b1d27773d47abf74bbf01a68ea 100644 (file)
@@ -35,6 +35,7 @@
                                <ComponentRef Id="rcm_Client" />
                 <ComponentRef Id="rcm_ClientCacheSize" />
                 <ComponentRef Id="rcm_ClientCachePath" />
+                <ComponentRef Id="rcm_StoreAnsiFilenames" />
 
                                <ComponentRef Id="cmp_CommonDir" />
 
index d3edf9eef10a3e5b2cc77770cf47005f218c469a..3dfb8b0eddf5e12d3e12ab95cf3a83e52952ccea 100644 (file)
@@ -26,6 +26,9 @@
        <!-- empty property
        <Property Id="AFSCACHESIZE"></Property>
        -->
+       <!-- empty property
+       <Property Id="STOREANSIFILENAMES"></Property>
+       -->
 
     <!-- Add/remove programs -->
     <Property Id="ARPCOMMENTS">$(var.ProductComments)</Property>
index fcc86ac1450ff520c77bcb19ff22f0c4d6a31610..1fd0dbab3decd8e898b05ec5a665f94070454611 100644 (file)
         <Registry Root="HKLM" Key="SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" Name="UseDNS" Type="integer" Value="[USEDNS]" Id="reg_Full_Client10" />
         <Registry Root="HKLM" Key="SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" Name="SecurityLevel" Type="integer" Value="[SECURITYLEVEL]" Id="reg_Full_Client12" />
         <Registry Root="HKLM" Key="SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" Name="SMBAuthType" Type="integer" Value="[SMBAUTHTYPE]" Id="reg_Full_Client13" />
+        <Registry Root="HKLM" Key="SOFTWARE\Microsoft\Windows NT\CurrentVersion\IniFileMapping\afsdsbmt.ini" Name="AFS Mappings" Type="string" Value="USR:Software\OpenAFS\Client\mappings" Id="reg_Full_Client14" />
+        <Registry Root="HKLM" Key="SOFTWARE\Microsoft\Windows NT\CurrentVersion\IniFileMapping\afsdsbmt.ini" Name="AFS Submounts" Type="string" Value="SYS:OpenAFS\Client\Submounts" Id="reg_Full_Client15" />
     </Component>
     <Component Id="rcm_ClientCachePath" Guid="4080E08D-6649-4A06-B286-F5E737DF4D8A" Transitive="yes">
-        <Registry Root="HKLM" Key="SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" Name="CachePath" Type="expandable" Value="[AFSCACHEPATH]" Id="reg_Full_Client14" KeyPath="yes" />
+        <Registry Root="HKLM" Key="SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" Name="CachePath" Type="expandable" Value="[AFSCACHEPATH]" Id="reg_Full_Client16" KeyPath="yes" />
         <Condition>AFSCACHEPATH &lt;&gt; ""</Condition>
     </Component>
     <Component Id="rcm_ClientCacheSize" Guid="F3A12290-920B-42E9-8E49-4958D7C0B6E2" Transitive="yes">
-        <Registry Root="HKLM" Key="SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" Name="CacheSize" Type="integer" Value="[AFSCACHESIZE]" Id="reg_Full_Client15" KeyPath="yes" />
+        <Registry Root="HKLM" Key="SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" Name="CacheSize" Type="integer" Value="[AFSCACHESIZE]" Id="reg_Full_Client17" KeyPath="yes" />
         <Condition>AFSCACHESIZE &lt;&gt; ""</Condition>
     </Component>
+    <Component Id="rcm_StoreAnsiFilenames" Guid="EAC84AD6-CF90-4b28-AF32-6F96DF55C3C4" Transitive="yes">
+        <Registry Root="HKLM" Key="SOFTWARE\OpenAFS\Client" Name="StoreAnsiFilenames" Type="integer" Value="[STOREANSIFILENAMES]" Id="reg_Full_Client18" KeyPath="yes" />
+        <Condition>STOREANSIFILENAMES &lt;&gt; ""</Condition>
+    </Component>
     <Component Id="rcm_Documentation" Guid="97493526-4A5C-4C55-A1D6-EA38841B1B85">
         <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS Supplemental Documentation" KeyPath="yes" Id="reg_Docs2" />
         <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS Supplemental Documentation" Action="createKeyAndRemoveKeyOnUninstall" Id="reg_Docs" />
index c9fd2a8507d3631c6038c4f53106f48e0c08b4bf..11424d8a4882003f17e20091aa4509eae3d5b9ce 100644 (file)
@@ -20,6 +20,9 @@ LIBINCLUDES = \
 
 PTHR_DLLFILE = $(DESTDIR)\lib\afspthread.dll
 
+$(OUT)\pthread.res: pthread.rc AFS_component_version_number.h
+       $(RC) /fo$*.res $(*F).rc 
+
 PTHR_DLLOBJS = \
        $(OUT)\pthread.obj \
        $(OUT)\pthread.res
index 4c72ab6c17b1391029746a3d3856b59d5dd8a9a2..33a17a4a03e032b3063cb7a7fbdd92474af6437f 100644 (file)
@@ -590,11 +590,14 @@ static void pthread_sync_terminate_thread(void) {
     (pthread_cache_done || pthread_once(&pthread_cache_once, create_once));
 
     if (terminate_thread_handle == INVALID_HANDLE_VALUE) {
-       terminate_thread_wakeup_event = CreateEvent((LPSECURITY_ATTRIBUTES) 0,
-                               TRUE, FALSE, (LPCTSTR) 0);
-       terminate_thread_handle = CreateThread((LPSECURITY_ATTRIBUTES) 0, 0, 
-                               terminate_thread_routine, (LPVOID) 0, 0, 
-                               &terminate_thread_id);
+        CHAR eventName[MAX_PATH];
+        static eventCount = 0;
+        sprintf(eventName, "terminate_thread_wakeup_event %d::%d", _getpid(), eventCount++);
+        terminate_thread_wakeup_event = CreateEvent((LPSECURITY_ATTRIBUTES) 0,
+                                                     TRUE, FALSE, (LPCTSTR) eventName);
+        terminate_thread_handle = CreateThread((LPSECURITY_ATTRIBUTES) 0, 0, 
+                                                terminate_thread_routine, (LPVOID) 0, 0, 
+                                                &terminate_thread_id);
     } else {
        SetEvent (terminate_thread_wakeup_event);
     }
@@ -711,8 +714,11 @@ static cond_waiters_t *get_waiter() {
     if (queue_IsEmpty(&waiter_cache)) {
         new = (cond_waiters_t *) malloc(sizeof(cond_waiters_t));
        if (new != NULL) {
-           new->event = CreateEvent((LPSECURITY_ATTRIBUTES) 0, FALSE,
-                                    FALSE, (LPCTSTR) 0);
+        CHAR eventName[MAX_PATH];
+        static eventCount = 0;
+        sprintf(eventName, "cond_waiters_t %d::%d", _getpid(), eventCount++);
+        new->event = CreateEvent((LPSECURITY_ATTRIBUTES) 0, FALSE,
+                                  FALSE, (LPCTSTR) eventName);
            if (new->event == NULL) {
                free(new);
                new = NULL;
index 0ee694840efe40ac5ba2b226fcce8d3fbdbca64b..8df4b527016f3b1822a2ae621296e204d0a08632 100644 (file)
@@ -15,7 +15,7 @@
 #include "afs/param.h"
 
 RCSID
-    ("$Header: /cvs/openafs/src/afs/LINUX/osi_alloc.c,v 1.22 2004/07/14 04:14:31 shadow Exp $");
+    ("$Header: /cvs/openafs/src/afs/LINUX/osi_alloc.c,v 1.22.2.1 2004/12/07 06:12:12 shadow Exp $");
 
 #include "afs/sysincludes.h"
 #include "afsincludes.h"
@@ -96,11 +96,11 @@ linux_alloc(unsigned int asize, int drop_glock)
 #endif
                );
            if (new)            /* piggy back alloc type */
-               (unsigned long)new |= KM_TYPE;
+               new = (void *)(KM_TYPE | (unsigned long)new);
        } else {
            new = (void *)vmalloc(asize);
            if (new)            /* piggy back alloc type */
-               (unsigned long)new |= VM_TYPE;
+               new = (void *)(VM_TYPE | (unsigned long)new);
        }
 
        if (!new) {
@@ -143,8 +143,8 @@ linux_free(void *p)
        vfree(MEMADDR(p));
        break;
     default:
-       printf("afs_osi_Free: Asked to free unknown type %d at 0x%x\n",
-              MEMTYPE(p), MEMADDR(p));
+       printf("afs_osi_Free: Asked to free unknown type %d at 0x%lx\n",
+              (int)MEMTYPE(p), (unsigned long)MEMADDR(p));
        break;
     }
 
@@ -196,8 +196,8 @@ hash_verify(size_t index, unsigned key, void *data)
     memtype = MEMTYPE(lmp->chunk);
     if (memtype != KM_TYPE && memtype != VM_TYPE) {
        printf
-           ("osi_linux_verify_alloced_memory: unknown type %d at 0x%x, index=%d\n",
-            memtype, lmp->chunk, index);
+           ("osi_linux_verify_alloced_memory: unknown type %d at 0x%lx, index=%lu\n",
+            (int)memtype, (unsigned long)lmp->chunk, (unsigned long)index);
     }
     afs_linux_hash_verify_count++;
 }
index 0191e78a72ef79a3ce5b32ff391c7bdc2677a868..f823adc263f0ffc16f1ce8a02316bfee3dc620fa 100644 (file)
 #include "afs/param.h"
 
 RCSID
-    ("$Header: /cvs/openafs/src/afs/LINUX/osi_file.c,v 1.19 2004/04/12 16:04:32 shadow Exp $");
+    ("$Header: /cvs/openafs/src/afs/LINUX/osi_file.c,v 1.19.2.3 2004/12/08 17:21:46 shadow Exp $");
 
+#include "h/module.h" /* early to avoid printf->printk mapping */
 #include "afs/sysincludes.h"   /* Standard vendor system headers */
 #include "afsincludes.h"       /* Afs-based standard headers */
 #include "afs/afs_stats.h"     /* afs statistics */
 #include "h/smp_lock.h"
-#include "h/module.h"
 
 
 int afs_osicred_initialized = 0;
@@ -29,11 +29,9 @@ extern struct super_block *afs_cacheSBp;
 void *
 osi_UFSOpen(afs_int32 ainode)
 {
-    struct inode *ip;
     register struct osi_file *afile = NULL;
     extern int cacheDiskType;
     afs_int32 code = 0;
-    int dummy;
     struct inode *tip = NULL;
     struct file *filp = NULL;
     AFS_STATCNT(osi_UFSOpen);
@@ -121,7 +119,6 @@ osi_UFSClose(register struct osi_file *afile)
 int
 osi_UFSTruncate(register struct osi_file *afile, afs_int32 asize)
 {
-    struct AFS_UCRED *oldCred;
     register afs_int32 code;
     struct osi_stat tstat;
     struct iattr newattrs;
@@ -141,7 +138,7 @@ osi_UFSTruncate(register struct osi_file *afile, afs_int32 asize)
     down_write(&inode->i_alloc_sem);
 #endif
     down(&inode->i_sem);
-    inode->i_size = newattrs.ia_size = asize;
+    newattrs.ia_size = asize;
     newattrs.ia_valid = ATTR_SIZE | ATTR_CTIME;
 #if defined(AFS_LINUX24_ENV)
     newattrs.ia_ctime = CURRENT_TIME;
@@ -159,6 +156,7 @@ osi_UFSTruncate(register struct osi_file *afile, afs_int32 asize)
     if (!code)
        truncate_inode_pages(&inode->i_data, asize);
 #else
+    inode->i_size = asize;
     if (inode->i_sb->s_op && inode->i_sb->s_op->notify_change) {
        code = inode->i_sb->s_op->notify_change(&afile->dentry, &newattrs);
     }
@@ -184,10 +182,8 @@ int
 afs_osi_Read(register struct osi_file *afile, int offset, void *aptr,
             afs_int32 asize)
 {
-    struct AFS_UCRED *oldCred;
     size_t resid;
     register afs_int32 code;
-    register afs_int32 cnt1 = 0;
     AFS_STATCNT(osi_Read);
 
     /**
@@ -222,7 +218,6 @@ int
 afs_osi_Write(register struct osi_file *afile, afs_int32 offset, void *aptr,
              afs_int32 asize)
 {
-    struct AFS_UCRED *oldCred;
     size_t resid;
     register afs_int32 code;
     AFS_STATCNT(osi_Write);
index 038a19040b862118f635c7d51b07b59d2113278b..278e56ae95bfd90fb550ca5064964f6ff4c9497f 100644 (file)
 #define afs_hz HZ
 #include "h/sched.h"
 #define osi_Time() (xtime.tv_sec)
+#ifdef AFS_LINUX_64BIT_KERNEL
+#define osi_GetTime(V)                                 \
+    do {                                               \
+       struct timeval tv;                              \
+       do_gettimeofday(&tv);                           \
+       (V)->tv_sec = (afs_int32)tv.tv_sec;             \
+       (V)->tv_usec = (afs_int32)tv.tv_usec;           \
+    } while (0)
+#else
 #define osi_GetTime(V) do_gettimeofday((V))
+#endif
 
 #undef gop_lookupname
 #define gop_lookupname osi_lookupname
index 2ef2eeabf01bdba22658b1001de26ba4c2d2252b..82c116cf6d448106f6e0be0b221b71035416cbcd 100644 (file)
@@ -15,7 +15,7 @@
 #include "afs/param.h"
 
 RCSID
-    ("$Header: /cvs/openafs/src/afs/LINUX/osi_misc.c,v 1.34 2004/05/15 06:43:12 shadow Exp $");
+    ("$Header: /cvs/openafs/src/afs/LINUX/osi_misc.c,v 1.34.2.1 2004/12/07 06:12:12 shadow Exp $");
 
 #include "afs/sysincludes.h"
 #include "afsincludes.h"
@@ -167,7 +167,6 @@ int
 osi_file_uio_rdwr(struct osi_file *osifile, uio_t * uiop, int rw)
 {
     struct file *filp = &osifile->file;
-    struct inode *ip = FILE_INODE(&osifile->file);
     KERNEL_SPACE_DECL;
     int code = 0;
     struct iovec *iov;
@@ -227,10 +226,10 @@ osi_file_uio_rdwr(struct osi_file *osifile, uio_t * uiop, int rw)
  * Setup a uio struct.
  */
 void
-setup_uio(uio_t * uiop, struct iovec *iovecp, char *buf, afs_offs_t pos,
+setup_uio(uio_t * uiop, struct iovec *iovecp, const char *buf, afs_offs_t pos,
          int count, uio_flag_t flag, uio_seg_t seg)
 {
-    iovecp->iov_base = buf;
+    iovecp->iov_base = (char *)buf;
     iovecp->iov_len = count;
     uiop->uio_iov = iovecp;
     uiop->uio_iovcnt = 1;
@@ -248,7 +247,7 @@ setup_uio(uio_t * uiop, struct iovec *iovecp, char *buf, afs_offs_t pos,
 int
 uiomove(char *dp, int length, uio_flag_t rw, uio_t * uiop)
 {
-    int count, n;
+    int count;
     struct iovec *iov;
     int code;
 
@@ -371,8 +370,8 @@ osi_linux_free_inode_pages(void)
 #else
                if (ip->i_nrpages) {
 #endif
-                   printf("Failed to invalidate all pages on inode 0x%x\n",
-                          ip);
+                   printf("Failed to invalidate all pages on inode 0x%lx\n",
+                          (unsigned long)ip);
                }
            }
        }
@@ -387,11 +386,14 @@ osi_clear_inode(struct inode *ip)
 
 #if defined(AFS_LINUX24_ENV)
     if (atomic_read(&ip->i_count) > 1)
+       printf("afs_put_inode: ino %ld (0x%lx) has count %ld\n",
+              (long)ip->i_ino, (unsigned long)ip,
+              (long)atomic_read(&ip->i_count));
 #else
     if (ip->i_count > 1)
+       printf("afs_put_inode: ino %ld (0x%lx) has count %ld\n",
+              (long)ip->i_ino, (unsigned long)ip, (long)ip->i_count);
 #endif
-       printf("afs_put_inode: ino %d (0x%x) has count %d\n", ip->i_ino, ip,
-              ip->i_count);
 
     afs_InactiveVCache(vcp, credp);
     ObtainWriteLock(&vcp->lock, 504);
index d9b92521fbb05aaf2de0b8d6ed586284420b770b..89bd661b2ceeffbcff6f8da4c4ec87f7aa695670 100644 (file)
@@ -15,8 +15,9 @@
 #include "afs/param.h"
 
 RCSID
-    ("$Header: /cvs/openafs/src/afs/LINUX/osi_module.c,v 1.52.2.2 2004/10/18 17:43:51 shadow Exp $");
+    ("$Header: /cvs/openafs/src/afs/LINUX/osi_module.c,v 1.52.2.5 2004/12/17 15:29:30 shadow Exp $");
 
+#include <linux/module.h> /* early to avoid printf->printk mapping */
 #include "afs/sysincludes.h"
 #include "afsincludes.h"
 #include "h/unistd.h"          /* For syscall numbers. */
@@ -26,7 +27,6 @@ RCSID
 #include "../asm/ia32_unistd.h"
 #endif
 
-#include <linux/module.h>
 #include <linux/proc_fs.h>
 #include <linux/slab.h>
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
@@ -68,7 +68,9 @@ static void **sys_call_table; /* safer for other linuces */
 
 extern struct file_system_type afs_fs_type;
 
+#if !defined(AFS_LINUX24_ENV)
 static long get_page_offset(void);
+#endif
 
 #if defined(AFS_LINUX24_ENV)
 DECLARE_MUTEX(afs_global_lock);
@@ -138,12 +140,52 @@ static struct file_operations afs_syscall_fops = {
     .ioctl = afs_ioctl,
 };
 
+int
+csdbproc_read(char *buffer, char **start, off_t offset, int count,
+             int *eof, void *data)
+{
+    int len, j;
+    struct afs_q *cq, *tq;
+    struct cell *tc;
+    char tbuffer[16];
+    afs_uint32 addr;
+    
+    len = 0;
+    ObtainReadLock(&afs_xcell);
+    for (cq = CellLRU.next; cq != &CellLRU; cq = tq) {
+       tc = QTOC(cq); tq = QNext(cq);
+       len += sprintf(buffer + len, ">%s #(%d/%d)\n", tc->cellName, 
+                      tc->cellNum, tc->cellIndex);
+       for (j = 0; j < MAXCELLHOSTS; j++) {
+           if (!tc->cellHosts[j]) break;
+           addr = ntohl(tc->cellHosts[j]->addr->sa_ip);
+           sprintf(tbuffer, "%d.%d.%d.%d", 
+                   (int)((addr>>24) & 0xff), (int)((addr>>16) & 0xff),
+                   (int)((addr>>8)  & 0xff), (int)( addr      & 0xff));
+            len += sprintf(buffer + len, "%s #%s\n", tbuffer, tbuffer);
+       }
+    }
+    ReleaseReadLock(&afs_xcell);
+    
+    if (offset >= len) {
+       *start = buffer;
+       *eof = 1;
+       return 0;
+    }
+    *start = buffer + offset;
+    if ((len -= offset) > count)
+       return count;
+    *eof = 1;
+    return len;
+}
+
 static struct proc_dir_entry *openafs_procfs;
 
 static int
-afsproc_init()
+afsproc_init(void)
 {
     struct proc_dir_entry *entry1;
+    struct proc_dir_entry *entry2;
 
     openafs_procfs = proc_mkdir(PROC_FSDIRNAME, proc_root_fs);
     entry1 = create_proc_entry(PROC_SYSCALL_NAME, 0666, openafs_procfs);
@@ -152,12 +194,15 @@ afsproc_init()
 
     entry1->owner = THIS_MODULE;
 
+    entry2 = create_proc_read_entry(PROC_CELLSERVDB_NAME, (S_IFREG|S_IRUGO), openafs_procfs, csdbproc_read, NULL);
+
     return 0;
 }
 
 static void
-afsproc_exit()
+afsproc_exit(void)
 {
+    remove_proc_entry(PROC_CELLSERVDB_NAME, openafs_procfs);
     remove_proc_entry(PROC_SYSCALL_NAME, openafs_procfs);
     remove_proc_entry(PROC_FSDIRNAME, proc_root_fs);
 }
@@ -188,9 +233,9 @@ afs_syscall_stub(int r0, int r1, long r2, long r3, long r4, long gp)
 {
     __asm__ __volatile__("alloc r42 = ar.pfs, 8, 3, 6, 0\n\t" "mov r41 = b0\n\t"       /* save rp */
                         "mov out0 = in0\n\t" "mov out1 = in1\n\t" "mov out2 = in2\n\t" "mov out3 = in3\n\t" "mov out4 = in4\n\t" "mov out5 = gp\n\t"   /* save gp */
-                        ";;\n" ".L1:    mov r3 = ip\n\t" ";;\n\t" "addl r15=.fptr_afs_syscall-.L1,r3\n\t" ";;\n\t" "ld8 r15=[r15]\n\t" ";;\n\t" "ld8 r16=[r15],8\n\t" ";;\n\t" "ld8 gp=[r15]\n\t" "mov b6=r16\n\t" "br.call.sptk.many b0 = b6\n\t" ";;\n\t" "mov ar.pfs = r42\n\t" "mov b0 = r41\n\t" "mov gp = r48\n\t"       /* restore gp */
+                        ";;\n" ".L1:\n\t" "mov r3 = ip\n\t" ";;\n\t" "addl r15=.fptr_afs_syscall-.L1,r3\n\t" ";;\n\t" "ld8 r15=[r15]\n\t" ";;\n\t" "ld8 r16=[r15],8\n\t" ";;\n\t" "ld8 gp=[r15]\n\t" "mov b6=r16\n\t" "br.call.sptk.many b0 = b6\n\t" ";;\n\t" "mov ar.pfs = r42\n\t" "mov b0 = r41\n\t" "mov gp = r48\n\t"    /* restore gp */
                         "br.ret.sptk.many b0\n" ".fptr_afs_syscall:\n\t"
-                        "data8 @fptr(afs_syscall)");
+                        "data8 @fptr(afs_syscall)\n\t" ".skip 8");
 }
 
 asmlinkage long
@@ -198,9 +243,9 @@ afs_xsetgroups_stub(int r0, int r1, long r2, long r3, long r4, long gp)
 {
     __asm__ __volatile__("alloc r42 = ar.pfs, 8, 3, 6, 0\n\t" "mov r41 = b0\n\t"       /* save rp */
                         "mov out0 = in0\n\t" "mov out1 = in1\n\t" "mov out2 = in2\n\t" "mov out3 = in3\n\t" "mov out4 = in4\n\t" "mov out5 = gp\n\t"   /* save gp */
-                        ";;\n" ".L2:    mov r3 = ip\n\t" ";;\n\t" "addl r15=.fptr_afs_xsetgroups - .L2,r3\n\t" ";;\n\t" "ld8 r15=[r15]\n\t" ";;\n\t" "ld8 r16=[r15],8\n\t" ";;\n\t" "ld8 gp=[r15]\n\t" "mov b6=r16\n\t" "br.call.sptk.many b0 = b6\n\t" ";;\n\t" "mov ar.pfs = r42\n\t" "mov b0 = r41\n\t" "mov gp = r48\n\t"  /* restore gp */
+                        ";;\n" ".L2:\n\t" "mov r3 = ip\n\t" ";;\n\t" "addl r15=.fptr_afs_xsetgroups - .L2,r3\n\t" ";;\n\t" "ld8 r15=[r15]\n\t" ";;\n\t" "ld8 r16=[r15],8\n\t" ";;\n\t" "ld8 gp=[r15]\n\t" "mov b6=r16\n\t" "br.call.sptk.many b0 = b6\n\t" ";;\n\t" "mov ar.pfs = r42\n\t" "mov b0 = r41\n\t" "mov gp = r48\n\t"       /* restore gp */
                         "br.ret.sptk.many b0\n" ".fptr_afs_xsetgroups:\n\t"
-                        "data8 @fptr(afs_xsetgroups)");
+                        "data8 @fptr(afs_xsetgroups)\n\t" ".skip 8");
 }
 
 struct fptr {
@@ -254,8 +299,11 @@ init_module(void)
     unsigned long *ptr;
     unsigned long offset=0;
     unsigned long datalen=0;
-    int ret;
+#if defined(EXPORTED_KALLSYMS_SYMBOL)
     unsigned long token=0;
+#endif
+#if defined(EXPORTED_KALLSYMS_SYMBOL) || defined(EXPORTED_KALLSYMS_ADDRESS)
+    int ret;
     char *mod_name;
     unsigned long mod_start=0;
     unsigned long mod_end=0;
@@ -265,6 +313,7 @@ init_module(void)
     char *sym_name;
     unsigned long sym_start=0;
     unsigned long sym_end=0;
+#endif
 #endif /* EXPORTED_SYS_CALL_TABLE */
 
     RWLOCK_INIT(&afs_xosi, "afs_xosi");
@@ -366,7 +415,7 @@ init_module(void)
     if (!sys_call_table) {
        printf("Failed to find address of sys_call_table\n");
     } else {
-       printf("Found sys_call_table at %x\n", sys_call_table);
+       printf("Found sys_call_table at %lx\n", (unsigned long)sys_call_table);
 #if defined(AFS_SPARC64_LINUX20_ENV) || defined(AFS_S390X_LINUX24_ENV)
        error cant support this yet.;
 #endif /* AFS_SPARC64_LINUX20_ENV */
@@ -428,10 +477,10 @@ init_module(void)
        if (!ia32_sys_call_table) {
            printf("Warning: Failed to find address of ia32_sys_call_table\n");
        } else {
-           printf("Found ia32_sys_call_table at %x\n", ia32_sys_call_table);
+           printf("Found ia32_sys_call_table at %lx\n", (unsigned long)ia32_sys_call_table);
        }
 #else
-       printf("Found ia32_sys_call_table at %x\n", ia32_sys_call_table);
+       printf("Found ia32_sys_call_table at %lx\n", (unsigned long)ia32_sys_call_table);
 #endif /* IA32_SYS_CALL_TABLE */
 #endif
 
@@ -536,8 +585,6 @@ void
 cleanup_module(void)
 #endif
 {
-    struct task_struct *t;
-
     osi_sysctl_clean();
     if (sys_call_table) {
 #if defined(AFS_IA64_LINUX20_ENV)
index 233e8af93733a544cff2af508275f040115f069a..3174826f9dac1c130e01a81178cc96853d010c56 100644 (file)
@@ -41,6 +41,10 @@ extern void afs_osi_SetTime(osi_timeval_t * tvp);
 extern void osi_linux_free_inode_pages(void);
 extern void check_bad_parent(struct dentry *dp);
 
+/* osi_sysctl.c */
+extern int osi_sysctl_init(void);
+extern void osi_sysctl_clean(void);
+
 /* osi_vm.c */
 extern int osi_VM_FlushVCache(struct vcache *avc, int *slept);
 extern void osi_VM_TryToSmush(struct vcache *avc, struct AFS_UCRED *acred,
@@ -53,6 +57,11 @@ extern void osi_VM_Truncate(struct vcache *avc, int alen,
 
 /* osi_vfsops.c */
 extern void set_inode_cache(struct inode *ip, struct vattr *vp);
+extern void put_inode_on_dummy_list(struct inode *ip);
+extern void vattr2inode(struct inode *ip, struct vattr *vp);
 
+/* osi_vnodeops.c */
+extern int afs_linux_writepage_sync(struct inode *ip, struct page *pp,
+                                   unsigned long offset, unsigned int count);
 
 #endif /* _OSI_PROTO_H_ */
index b86855299894e84904e2a1693a6a0c43ae5fd759..1002c5e80345819cb76d4fdac61ee1b4f41c756d 100644 (file)
@@ -11,7 +11,7 @@
 #include "afs/param.h"
 
 RCSID
-    ("$Header: /cvs/openafs/src/afs/LINUX/osi_sleep.c,v 1.22 2004/06/21 19:30:21 shadow Exp $");
+    ("$Header: /cvs/openafs/src/afs/LINUX/osi_sleep.c,v 1.22.2.1 2004/12/07 06:12:13 shadow Exp $");
 
 #include "afs/sysincludes.h"   /* Standard vendor system headers */
 #include "afsincludes.h"       /* Afs-based standard headers */
@@ -50,7 +50,6 @@ int
 afs_osi_Wait(afs_int32 ams, struct afs_osi_WaitHandle *ahandle, int aintok)
 {
     afs_int32 endTime;
-    struct timer_list *timer = NULL;
     int code;
 
     AFS_STATCNT(osi_Wait);
index 87d58fe655ae6f06f1895534a8386fa1b4cfa40b..c6c52f46df9c030ba8f3b8a7254d3e82f4d037c5 100644 (file)
@@ -98,19 +98,6 @@ typedef struct vattr {
 #define VATTR_NULL(A) memset(A, 0, sizeof(struct vattr))
 
 
-/* va_masks - these should match their respective ATTR_xxx #defines in fs.h.
- * afs_notify_change has to use the attr bits in both the Linux and AFS
- * meanings. The glue layer code uses the ATTR_xxx style names.
- */
-#define AT_SIZE                ATTR_SIZE
-#define AT_MODE                ATTR_MODE
-#undef AT_UID
-#define AT_UID         ATTR_UID
-#undef AT_GID
-#define AT_GID         ATTR_GID
-#define AT_MTIME       ATTR_MTIME
-
-
 #define vnodeops inode_operations
 
 #endif /* OSI_VFS_H_ */
index be8418d52f392402c760e147a47a924efe691b6d..e1567948b98d338276a32090fc79584034f6aae4 100644 (file)
 #include "afs/param.h"
 
 RCSID
-    ("$Header: /cvs/openafs/src/afs/LINUX/osi_vfsops.c,v 1.29 2004/07/29 03:08:48 shadow Exp $");
+    ("$Header: /cvs/openafs/src/afs/LINUX/osi_vfsops.c,v 1.29.2.1 2004/12/07 06:12:13 shadow Exp $");
 
+#define __NO_VERSION__         /* don't define kernel_version in module.h */
+#include <linux/module.h> /* early to avoid printf->printk mapping */
 #include "afs/sysincludes.h"
 #include "afsincludes.h"
 #include "afs/afs_stats.h"
@@ -28,9 +30,6 @@ RCSID
 #include "h/smp_lock.h"
 #endif
 
-#define __NO_VERSION__         /* don't define kernel_version in module.h */
-#include <linux/module.h>
-
 
 struct vcache *afs_globalVp = 0;
 struct vfs *afs_globalVFS = 0;
@@ -52,7 +51,6 @@ static int afs_root(struct super_block *afsp);
 struct super_block *afs_read_super(struct super_block *sb, void *data, int silent);
 int afs_fill_super(struct super_block *sb, void *data, int silent);
 static struct super_block *afs_get_sb(struct file_system_type *fs_type, int flags, const char *dev_name, void *data);
-void put_inode_on_dummy_list(struct inode *ip);
 
 /* afs_file_system
  * VFS entry for Linux - installed in init_module
@@ -267,7 +265,11 @@ static LIST_HEAD(dummy_inode_list);
  * has synced some pages of a file to disk.
  */
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+#ifdef WRITE_INODE_NOT_VOID
+static int
+#else
 static void
+#endif
 afs_write_inode(struct inode *ip, int unused)
 #else
 static void
@@ -280,6 +282,9 @@ afs_write_inode(struct inode *ip)
 
     /* for now we don't actually update the metadata during msync. This
      * is just to keep linux happy.  */
+#ifdef WRITE_INODE_NOT_VOID
+    return 0;
+#endif
 }
 
 
@@ -300,8 +305,6 @@ afs_destroy_inode(struct inode *ip)
 static void
 afs_delete_inode(struct inode *ip)
 {
-    struct vcache *vp = ITOAFS(ip);
-
 #ifdef AFS_LINUX26_ENV
     put_inode_on_dummy_list(ip);
 #endif
@@ -317,9 +320,7 @@ afs_delete_inode(struct inode *ip)
 static void
 afs_put_super(struct super_block *sbp)
 {
-    extern int afs_afs_cold_shutdown;
     int code = 0;
-    int fv_slept;
 
     AFS_GLOCK();
     AFS_STATCNT(afs_unmount);
@@ -339,7 +340,6 @@ afs_put_super(struct super_block *sbp)
 #endif
 
     osi_linux_verify_alloced_memory();
-  done:
     AFS_GUNLOCK();
 
     if (!code) {
index b843665bf5f354c3f5beeb69820cbe0d032fccae..56e58fd6883c345d0eab363b334bfc7d0fd5d0de 100644 (file)
@@ -22,7 +22,7 @@
 #include "afs/param.h"
 
 RCSID
-    ("$Header: /cvs/openafs/src/afs/LINUX/osi_vnodeops.c,v 1.81.2.4 2004/11/09 17:15:02 shadow Exp $");
+    ("$Header: /cvs/openafs/src/afs/LINUX/osi_vnodeops.c,v 1.81.2.8 2004/12/17 14:43:23 shadow Exp $");
 
 #include "afs/sysincludes.h"
 #include "afsincludes.h"
@@ -36,6 +36,9 @@ RCSID
 #if defined(AFS_LINUX24_ENV)
 #include "h/smp_lock.h"
 #endif
+#if defined(AFS_LINUX26_ENV)
+#include "h/writeback.h"
+#endif
 
 #ifdef pgoff2loff
 #define pageoff(pp) pgoff2loff((pp)->index)
@@ -84,7 +87,6 @@ afs_linux_read(struct file *fp, char *buf, size_t count, loff_t * offp)
        if (*offp + count > afs_vmMappingEnd) {
            uio_t tuio;
            struct iovec iov;
-           afs_size_t oldOffset = *offp;
            afs_int32 xfered = 0;
 
            if (*offp < afs_vmMappingEnd) {
@@ -145,7 +147,7 @@ static ssize_t
 afs_linux_write(struct file *fp, const char *buf, size_t count, loff_t * offp)
 {
     ssize_t code = 0;
-    int code2;
+    int code2 = 0;
     struct vcache *vcp = ITOAFS(fp->f_dentry->d_inode);
     struct vrequest treq;
     cred_t *credp = crref();
@@ -252,6 +254,8 @@ afs_linux_write(struct file *fp, const char *buf, size_t count, loff_t * offp)
     return code;
 }
 
+extern int BlobScan(struct dcache * afile, afs_int32 ablob);
+
 /* This is a complete rewrite of afs_readdir, since we can make use of
  * filldir instead of afs_readdir_move. Note that changes to vcache/dcache
  * handling and use of bulkstats will need to be reflected here as well.
@@ -346,8 +350,8 @@ afs_linux_readdir(struct file *fp, void *dirbuf, filldir_t filldir)
        if (de->name)
            len = strlen(de->name);
        else {
-           printf("afs_linux_readdir: afs_dir_GetBlob failed, null name (inode %x, dirpos %d)\n", 
-                  &tdc->f.inode, dirpos);
+           printf("afs_linux_readdir: afs_dir_GetBlob failed, null name (inode %lx, dirpos %d)\n", 
+                  (unsigned long)&tdc->f.inode, dirpos);
            DRelease((struct buffer *) de, 0);
            afs_PutDCache(tdc);
            ReleaseReadLock(&avc->lock);
@@ -486,7 +490,6 @@ afs_linux_vma_close(struct vm_area_struct *vmap)
            ReleaseWriteLock(&vcp->lock);
     }
 
-  unlock_exit:
     AFS_GUNLOCK();
 }
 
@@ -753,6 +756,9 @@ struct file_operations afs_file_fops = {
   .mmap =      afs_linux_mmap,
   .open =      afs_linux_open,
   .flush =     afs_linux_flush,
+#ifdef AFS_LINUX26_ENV
+  .sendfile =   generic_file_sendfile,
+#endif
   .release =   afs_linux_release,
   .fsync =     afs_linux_fsync,
   .lock =      afs_linux_lock,
@@ -837,14 +843,19 @@ afs_linux_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *sta
  * later on, we shouldn't have to do it until later. Perhaps in the future..
  */
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,10)
+#ifdef DOP_REVALIDATE_TAKES_NAMEIDATA
+static int
+afs_linux_dentry_revalidate(struct dentry *dp, struct nameidata *nd)
+#else
 static int
 afs_linux_dentry_revalidate(struct dentry *dp, int flags)
+#endif
 #else
 static int
 afs_linux_dentry_revalidate(struct dentry *dp)
 #endif
 {
-    char *name;
+    char *name = NULL;
     cred_t *credp = crref();
     struct vrequest treq;
     struct vcache *lookupvcp = NULL;
@@ -985,13 +996,18 @@ struct dentry_operations afs_dentry_operations = {
  *
  * name is in kernel space at this point.
  */
+#ifdef IOP_CREATE_TAKES_NAMEIDATA
+int
+afs_linux_create(struct inode *dip, struct dentry *dp, int mode,
+                struct nameidata *nd)
+#else
 int
 afs_linux_create(struct inode *dip, struct dentry *dp, int mode)
+#endif
 {
     int code;
     cred_t *credp = crref();
     struct vattr vattr;
-    enum vcexcl excl;
     const char *name = dp->d_name.name;
     struct inode *ip;
 
@@ -1003,7 +1019,7 @@ afs_linux_create(struct inode *dip, struct dentry *dp, int mode)
 #endif
     AFS_GLOCK();
     code =
-       afs_create(ITOAFS(dip), name, &vattr, NONEXCL, mode,
+       afs_create(ITOAFS(dip), (char *)name, &vattr, NONEXCL, mode,
                   (struct vcache **)&ip, credp);
 
     if (!code) {
@@ -1045,8 +1061,14 @@ afs_linux_create(struct inode *dip, struct dentry *dp, int mode)
 
 /* afs_linux_lookup */
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,10)
+#ifdef IOP_LOOKUP_TAKES_NAMEIDATA
+struct dentry *
+afs_linux_lookup(struct inode *dip, struct dentry *dp,
+                struct nameidata *nd)
+#else
 struct dentry *
 afs_linux_lookup(struct inode *dip, struct dentry *dp)
+#endif
 #else
 int
 afs_linux_lookup(struct inode *dip, struct dentry *dp)
@@ -1144,18 +1166,63 @@ afs_linux_link(struct dentry *olddp, struct inode *dip, struct dentry *newdp)
 int
 afs_linux_unlink(struct inode *dip, struct dentry *dp)
 {
-    int code;
+    int code = EBUSY;
     cred_t *credp = crref();
     const char *name = dp->d_name.name;
+    struct vcache *tvc = ITOAFS(dp->d_inode);
 
 #if defined(AFS_LINUX26_ENV)
     lock_kernel();
 #endif
+    if (((VREFCOUNT(tvc) > 0) && tvc->opens > 0)
+                               && !(tvc->states & CUnlinked)) {
+       struct dentry *__dp;
+       char *__name;
+       extern char *afs_newname();
+
+       __dp = NULL;
+       __name = NULL;
+       do {
+           dput(__dp);
+
+           AFS_GLOCK();
+           if (__name)
+               osi_FreeSmallSpace(__name);
+           __name = afs_newname();
+           AFS_GUNLOCK();
+
+           __dp = lookup_one_len(__name, dp->d_parent, strlen(__name));
+               
+           if (IS_ERR(__dp))
+               goto out;
+       } while (__dp->d_inode != NULL);
+
+       AFS_GLOCK();
+       code = afs_rename(ITOAFS(dip), dp->d_name.name, ITOAFS(dip), __dp->d_name.name, credp);
+       if (!code) {
+            tvc->mvid = __name;
+            crhold(credp);
+            if (tvc->uncred) {
+                crfree(tvc->uncred);
+            }
+            tvc->uncred = credp;
+           tvc->states |= CUnlinked;
+       }
+       AFS_GUNLOCK();
+
+       if (!code)
+           d_move(dp, __dp);
+       dput(__dp);
+
+       goto out;
+    }
+
     AFS_GLOCK();
     code = afs_remove(ITOAFS(dip), name, credp);
     AFS_GUNLOCK();
     if (!code)
        d_drop(dp);
+out:
 #if defined(AFS_LINUX26_ENV)
     unlock_kernel();
 #endif
@@ -1471,8 +1538,13 @@ afs_linux_readpage(struct file *fp, struct page *pp)
 }
 
 #if defined(AFS_LINUX24_ENV)
+#ifdef AOP_WRITEPAGE_TAKES_WRITEBACK_CONTROL
+int
+afs_linux_writepage(struct page *pp, struct writeback_control *wbc)
+#else
 int
 afs_linux_writepage(struct page *pp)
+#endif
 {
     struct address_space *mapping = pp->mapping;
     struct inode *inode;
@@ -1480,7 +1552,11 @@ afs_linux_writepage(struct page *pp)
     unsigned offset = PAGE_CACHE_SIZE;
     long status;
 
-#ifdef PageLaunder
+#if defined(AFS_LINUX26_ENV)
+    if (PageReclaim(pp)) {
+       return WRITEPAGE_ACTIVATE;
+    }
+#else
     if (PageLaunder(pp)) {
        return(fail_writepage(pp));
     }
@@ -1513,8 +1589,13 @@ afs_linux_writepage(struct page *pp)
 /* afs_linux_permission
  * Check access rights - returns error if can't check or permission denied.
  */
+#ifdef IOP_PERMISSION_TAKES_NAMEIDATA
+int
+afs_linux_permission(struct inode *ip, int mode, struct nameidata *nd)
+#else
 int
 afs_linux_permission(struct inode *ip, int mode)
+#endif
 {
     int code;
     cred_t *credp = crref();
@@ -1762,7 +1843,11 @@ struct address_space_operations afs_symlink_aops = {
 struct inode_operations afs_symlink_iops = {
 #if defined(AFS_LINUX24_ENV)
   .readlink =          page_readlink,
+#if defined(HAVE_KERNEL_PAGE_FOLLOW_LINK)
   .follow_link =       page_follow_link,
+#else
+  .follow_link =       page_follow_link_light,
+#endif
   .setattr =           afs_notify_change,
 #else
   .readlink =          afs_linux_readlink,
index 595d22b2324bac21a8b1f8073e68c3a829c5ce9a..55346bb1f288cdb2144fabeaaa197f7e7d56d46b 100644 (file)
@@ -3,7 +3,7 @@
  * Original NetBSD version for Transarc afs by John Kohl <jtk@MIT.EDU>
  * OpenBSD version by Jim Rees <rees@umich.edu>
  *
- * $Id: osi_vfsops.c,v 1.18 2004/03/25 17:04:44 rees Exp $
+ * $Id: osi_vfsops.c,v 1.18.2.1 2004/12/07 06:19:16 shadow Exp $
  */
 
 /*
@@ -94,7 +94,7 @@ NONINFRINGEMENT.
 #include "afs/param.h"
 
 RCSID
-    ("$Header: /cvs/openafs/src/afs/OBSD/osi_vfsops.c,v 1.18 2004/03/25 17:04:44 rees Exp $");
+    ("$Header: /cvs/openafs/src/afs/OBSD/osi_vfsops.c,v 1.18.2.1 2004/12/07 06:19:16 shadow Exp $");
 
 #include "afs/sysincludes.h"   /* Standard vendor system headers */
 #include "afs/afsincludes.h"   /* Afs-based standard headers */
@@ -116,7 +116,6 @@ static int lkmid = -1;
 static int afs_badcall(struct proc *p, void *xx, register_t * yy);
 static struct sysent old_sysent;
 
-char afs_NetBSD_osname[] = "OpenBSD";
 struct osi_vfs *afs_globalVFS;
 struct vcache *afs_globalVp;
 
@@ -463,7 +462,7 @@ afs_vfs_load(struct lkm_table *lkmtp, int cmd)
     if (memname[M_AFSBUFFER] == NULL)
        memname[M_AFSBUFFER] = afsbfrmem;
     lkmid = lkmtp->id;
-    printf("OpenAFS ($Revision: 1.18 $) lkm loaded\n");
+    printf("OpenAFS ($Revision: 1.18.2.1 $) lkm loaded\n");
     return 0;
 }
 
@@ -495,11 +494,6 @@ int
 libafs_lkmentry(struct lkm_table *lkmtp, int cmd, int ver)
 {
     if (cmd == LKM_E_LOAD) {
-       if (strcmp(ostype, afs_NetBSD_osname)) {
-           printf("This is %s version %s\n", ostype, osrelease);
-           printf("This version of AFS is only for %s\n", afs_NetBSD_osname);
-           return EPROGMISMATCH;
-       }
        if (sysent[AFS_SYSCALL].sy_call == afs3_syscall
            || sysent[AFS_SYSCALL].sy_call == afs_badcall) {
            printf("AFS already loaded\n");
index 90dc9aef25311e477eeab9f49dea4ffe08ca7fc7..40ec6d436ed178eb40ff3921a17616ecb88799d8 100644 (file)
@@ -24,7 +24,7 @@
 #include "afs/param.h"
 
 RCSID
-    ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_attrs.c,v 1.27.2.2 2004/11/09 17:17:25 shadow Exp $");
+    ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_attrs.c,v 1.27.2.3 2004/12/07 06:12:13 shadow Exp $");
 
 #include "afs/sysincludes.h"   /* Standard vendor system headers */
 #include "afsincludes.h"       /* Afs-based standard headers */
@@ -399,11 +399,15 @@ afs_VAttrToAS(register struct vcache *avc, register struct vattr *av,
 /* Boy, was this machine dependent bogosity hard to swallow????.... */
     if (av->va_mode != -1) {
 #else
-#if    defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_LINUX22_ENV)
+#if    defined(AFS_LINUX22_ENV)
+    if (av->va_mask & ATTR_MODE) {
+#else
+#if    defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV)
     if (av->va_mask & AT_MODE) {
 #else
     if (av->va_mode != ((unsigned short)-1)) {
 #endif
+#endif
 #endif
        mask |= AFS_SETMODE;
        as->UnixModeBits = av->va_mode & 0xffff;
@@ -413,7 +417,10 @@ afs_VAttrToAS(register struct vcache *avc, register struct vattr *av,
            ReleaseWriteLock(&avc->lock);
        }
     }
-#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_LINUX22_ENV)
+#if defined(AFS_LINUX22_ENV)
+    if (av->va_mask & ATTR_GID) {
+#else
+#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV)
     if (av->va_mask & AT_GID) {
 #else
 #if (defined(AFS_HPUX_ENV) || defined(AFS_SUN_ENV))
@@ -426,10 +433,14 @@ afs_VAttrToAS(register struct vcache *avc, register struct vattr *av,
     if (av->va_gid != -1) {
 #endif
 #endif /* AFS_SUN5_ENV */
+#endif /* AFS_LINUX22_ENV */
        mask |= AFS_SETGROUP;
        as->Group = av->va_gid;
     }
-#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_LINUX22_ENV)
+#if defined(AFS_LINUX22_ENV)
+    if (av->va_mask & ATTR_UID) {
+#else
+#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV)
     if (av->va_mask & AT_UID) {
 #else
 #if (defined(AFS_HPUX_ENV) || defined(AFS_SUN_ENV))
@@ -442,13 +453,18 @@ afs_VAttrToAS(register struct vcache *avc, register struct vattr *av,
     if (av->va_uid != -1) {
 #endif
 #endif /* AFS_SUN5_ENV */
+#endif /* AFS_LINUX22_ENV */
        mask |= AFS_SETOWNER;
        as->Owner = av->va_uid;
     }
-#if    defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_LINUX22_ENV)
+#if    defined(AFS_LINUX22_ENV)
+    if (av->va_mask & ATTR_MTIME) {
+#else
+#if    defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV)
     if (av->va_mask & AT_MTIME) {
 #else
     if (av->va_mtime.tv_sec != -1) {
+#endif
 #endif
        mask |= AFS_SETMODTIME;
 #ifndef        AFS_SGI_ENV
@@ -526,7 +542,10 @@ afs_setattr(OSI_VC_DECL(avc), register struct vattr *attrs,
      * path (unlike BSD or SUNOS), so we skip this check for Ultrix.
      *
      */
-#if    defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_LINUX22_ENV)
+#if    defined(AFS_LINUX22_ENV)
+    if (attrs->va_mask & ATTR_SIZE) {
+#else
+#if    defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV)
     if (attrs->va_mask & AT_SIZE) {
 #else
 #ifdef AFS_OSF_ENV
@@ -538,6 +557,7 @@ afs_setattr(OSI_VC_DECL(avc), register struct vattr *attrs,
     if (attrs->va_size != ~0) {
 #endif
 #endif
+#endif
 #endif
        if (!afs_AccessOK(avc, PRSFS_WRITE, &treq, DONT_CHECK_MODE_BITS)) {
            code = EACCES;
@@ -560,7 +580,10 @@ afs_setattr(OSI_VC_DECL(avc), register struct vattr *attrs,
 #if defined(AFS_SGI_ENV)
     AFS_RWLOCK((vnode_t *) avc, VRWLOCK_WRITE);
 #endif
-#if    defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_LINUX22_ENV)
+#if    defined(AFS_LINUX22_ENV)
+    if (attrs->va_mask & ATTR_SIZE) {
+#else
+#if    defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV)
     if (attrs->va_mask & AT_SIZE) {
 #else
 #if    defined(AFS_OSF_ENV)
@@ -568,6 +591,7 @@ afs_setattr(OSI_VC_DECL(avc), register struct vattr *attrs,
 #else /* AFS_OSF_ENV */
     if (attrs->va_size != -1) {
 #endif
+#endif
 #endif
        afs_size_t tsize = attrs->va_size;
        ObtainWriteLock(&avc->lock, 128);
index f1c7cdc374f6c6381dae87fafa0da443f354b6d5..abae67ed3695922d64176c25d60f221118e4adba 100644 (file)
@@ -16,7 +16,7 @@
 #include "afs/param.h"
 
 RCSID
-    ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_flock.c,v 1.24.2.1 2004/08/25 07:09:35 shadow Exp $");
+    ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_flock.c,v 1.24.2.2 2004/12/07 06:12:13 shadow Exp $");
 
 #include "afs/sysincludes.h"   /* Standard vendor system headers */
 #include "afsincludes.h"       /* Afs-based standard headers */
@@ -469,15 +469,15 @@ DoLockWarning(void)
 
 
 #ifdef AFS_OSF_ENV
-afs_lockctl(struct vcache * avc, struct eflock * af, int flag,
-           struct AFS_UCRED * acred, pid_t clid, off_t offset)
+int afs_lockctl(struct vcache * avc, struct eflock * af, int flag,
+               struct AFS_UCRED * acred, pid_t clid, off_t offset)
 #elif defined(AFS_SGI_ENV) || (defined(AFS_SUN_ENV) && !defined(AFS_SUN5_ENV)) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
-afs_lockctl(struct vcache * avc, struct AFS_FLOCK * af, int acmd,
-           struct AFS_UCRED * acred, pid_t clid)
+int afs_lockctl(struct vcache * avc, struct AFS_FLOCK * af, int acmd,
+               struct AFS_UCRED * acred, pid_t clid)
 #else
 u_int clid = 0;
-afs_lockctl(struct vcache * avc, struct AFS_FLOCK * af, int acmd,
-           struct AFS_UCRED * acred)
+int afs_lockctl(struct vcache * avc, struct AFS_FLOCK * af, int acmd,
+               struct AFS_UCRED * acred)
 #endif
 {
     struct vrequest treq;
index 99d0de3a21bd68dd03002f753737a134e19e6b4b..89b455abe7da8c941318afe142017d28d312cdf9 100644 (file)
@@ -18,7 +18,7 @@
 #include "afs/param.h"
 
 RCSID
-    ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_lookup.c,v 1.50.2.4 2004/11/09 17:15:04 shadow Exp $");
+    ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_lookup.c,v 1.50.2.5 2004/12/07 06:12:13 shadow Exp $");
 
 #include "afs/sysincludes.h"   /* Standard vendor system headers */
 #include "afsincludes.h"       /* Afs-based standard headers */
@@ -67,7 +67,7 @@ EvalMountPoint(register struct vcache *avc, struct vcache *advc,
     char *cpos, *volnamep;
     char type, *buf;
     afs_int32 prefetch;                /* 1=>None  2=>RO  3=>BK */
-    afs_int32 mtptCell, assocCell, hac = 0;
+    afs_int32 mtptCell, assocCell = 0, hac = 0;
     afs_int32 samecell, roname, len;
 
     AFS_STATCNT(EvalMountPoint);
@@ -432,7 +432,7 @@ afs_getsysname(register struct vrequest *areq, register struct vcache *adp,
 }
 
 void
-Check_AtSys(register struct vcache *avc, char *aname,
+Check_AtSys(register struct vcache *avc, const char *aname,
            struct sysname_info *state, struct vrequest *areq)
 {
     int num = 0;
@@ -448,7 +448,7 @@ Check_AtSys(register struct vcache *avc, char *aname,
        state->offset = -1;
        state->allocked = 0;
        state->index = 0;
-       state->name = aname;
+       state->name = (char *)aname;
     }
 }
 
@@ -500,10 +500,10 @@ Next_AtSys(register struct vcache *avc, struct vrequest *areq,
            }
            afs_PutUser(au, 0);
        }
-       if (++(state->index) >= num || !(*sysnamelist)[state->index])
+       if (++(state->index) >= num || !(*sysnamelist)[(unsigned int)state->index])
            return 0;           /* end of list */
     }
-    strcpy(state->name + state->offset, (*sysnamelist)[state->index]);
+    strcpy(state->name + state->offset, (*sysnamelist)[(unsigned int)state->index]);
     return 1;
 }
 
@@ -546,14 +546,14 @@ afs_DoBulkStat(struct vcache *adp, long dirCookie, struct vrequest *areqp)
     struct afs_q *tq;          /* temp queue variable */
     AFSCBFids fidParm;         /* file ID parm for bulk stat */
     AFSBulkStats statParm;     /* stat info parm for bulk stat */
-    int fidIndex;              /* which file were stating */
-    struct conn *tcp;          /* conn for call */
+    int fidIndex = 0;          /* which file were stating */
+    struct conn *tcp = 0;      /* conn for call */
     AFSCBs cbParm;             /* callback parm for bulk stat */
     struct server *hostp = 0;  /* host we got callback from */
     long startTime;            /* time we started the call,
                                 * for callback expiration base
                                 */
-    afs_size_t statSeqNo;      /* Valued of file size to detect races */
+    afs_size_t statSeqNo = 0;  /* Valued of file size to detect races */
     int code;                  /* error code */
     long newIndex;             /* new index in the dir */
     struct DirEntry *dirEntryp;        /* dir entry we are examining */
@@ -564,7 +564,7 @@ afs_DoBulkStat(struct vcache *adp, long dirCookie, struct vrequest *areqp)
     long volStates;            /* flags from vol structure */
     struct volume *volp = 0;   /* volume ptr */
     struct VenusFid dotdot;
-    int flagIndex;             /* First file with bulk fetch flag set */
+    int flagIndex = 0;         /* First file with bulk fetch flag set */
     int inlinebulk = 0;                /* Did we use InlineBulk RPC or not? */
     XSTATS_DECLS;
     /* first compute some basic parameters.  We dont want to prefetch more
@@ -606,12 +606,12 @@ afs_DoBulkStat(struct vcache *adp, long dirCookie, struct vrequest *areqp)
   tagain:
     code = afs_VerifyVCache(adp, areqp);
     if (code)
-       goto done;
+       goto done2;
 
     dcp = afs_GetDCache(adp, (afs_size_t) 0, areqp, &temp, &temp, 1);
     if (!dcp) {
        code = ENOENT;
-       goto done;
+       goto done2;
     }
 
     /* lock the directory cache entry */
@@ -1067,6 +1067,7 @@ afs_DoBulkStat(struct vcache *adp, long dirCookie, struct vrequest *areqp)
     } else {
        code = 0;
     }
+  done2:
     osi_FreeLargeSpace(statMemp);
     osi_FreeLargeSpace(cbfMemp);
     return code;
index 409bd8b045d45f98070d68de4345a4d509ef8e7a..067a083272d5dd7ab6f077492ff4bef38e05f03d 100644 (file)
  * afs_IsWired (DUX)
  * afsremove
  * afs_remove
- *
- * Local:
- * newname
+ * afs_newname
  *
  */
 #include <afsconfig.h>
 #include "afs/param.h"
 
 RCSID
-    ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_remove.c,v 1.31.2.3 2004/11/09 17:15:04 shadow Exp $");
+    ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_remove.c,v 1.31.2.5 2004/12/13 19:35:05 shadow Exp $");
 
 #include "afs/sysincludes.h"   /* Standard vendor system headers */
 #include "afsincludes.h"       /* Afs-based standard headers */
@@ -193,8 +191,8 @@ afsremove(register struct vcache *adp, register struct dcache *tdc,
     return (0);
 }
 
-static char *
-newname(void)
+char *
+afs_newname(void)
 {
     char *name, *sp, *p = ".__afs";
     afs_int32 rd = afs_random() & 0xffff;
@@ -412,7 +410,7 @@ afs_remove(OSI_VC_ARG(adp), aname, acred)
 #endif
 #endif
     {
-       char *unlname = newname();
+       char *unlname = afs_newname();
 
        ReleaseWriteLock(&adp->lock);
        if (tdc)
@@ -459,7 +457,9 @@ afs_remunlink(register struct vcache *avc, register int doit)
     struct VenusFid dirFid;
     register struct dcache *tdc;
     afs_int32 code = 0;
+#ifdef AFS_DARWIN14_ENV
     int oldref;
+#endif
 
     if (NBObtainWriteLock(&avc->lock, 423))
        return 0;
index 3319259d98114f55e3e5d9d947b541e91833546e..7b24a01ef37cd93674c35b98610a1f77e63789f7 100644 (file)
@@ -21,7 +21,7 @@
 #include "afs/param.h"
 
 RCSID
-    ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_write.c,v 1.36.2.1 2004/08/25 07:09:35 shadow Exp $");
+    ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_write.c,v 1.36.2.2 2004/12/07 06:12:14 shadow Exp $");
 
 #include "afs/sysincludes.h"   /* Standard vendor system headers */
 #include "afsincludes.h"       /* Afs-based standard headers */
@@ -181,7 +181,7 @@ afs_MemWrite(register struct vcache *avc, struct uio *auio, int aio,
      * high-level write op.
      */
     if (avc->execsOrWriters <= 0) {
-       printf("WARNING: afs_ufswr vp=%x, exOrW=%d\n", avc,
+       printf("WARNING: afs_ufswr vp=%lx, exOrW=%d\n", (unsigned long)avc,
               avc->execsOrWriters);
     }
 #else
@@ -432,7 +432,7 @@ afs_UFSWrite(register struct vcache *avc, struct uio *auio, int aio,
      * high-level write op.
      */
     if (avc->execsOrWriters <= 0) {
-       printf("WARNING: afs_ufswr vcp=%x, exOrW=%d\n", avc,
+       printf("WARNING: afs_ufswr vcp=%lx, exOrW=%d\n", (unsigned long)avc,
               avc->execsOrWriters);
     }
 #else
index c5105aac85bab477a17b6415e6291043d9b58363..c5087c62a1aa9d65de10e15db847627427b9b8ba 100644 (file)
@@ -43,7 +43,7 @@ extern int afs_shuttingdown;
 #if     defined(AFS_HPUX102_ENV)
 #define AFS_FLOCK       k_flock
 #else
-#if     defined(AFS_SUN56_ENV) || (defined(AFS_LINUX24_ENV) && !defined(AFS_PPC64_LINUX26_ENV) && !defined(AFS_AMD64_LINUX26_ENV))
+#if     defined(AFS_SUN56_ENV) || (defined(AFS_LINUX24_ENV) && !defined(AFS_PPC64_LINUX26_ENV) && !defined(AFS_AMD64_LINUX26_ENV) && !defined(AFS_IA64_LINUX26_ENV))
 #define AFS_FLOCK       flock64
 #else
 #define AFS_FLOCK       flock
index c3fc5779b1656eb4b9452580011fc7715a5e71a9..36aede0df9ebbd799c7d2764062cbfdfaa08ba37 100644 (file)
@@ -11,7 +11,7 @@
 #include "afs/param.h"
 
 RCSID
-    ("$Header: /cvs/openafs/src/afs/afs_call.c,v 1.74.2.2 2004/08/25 07:16:11 shadow Exp $");
+    ("$Header: /cvs/openafs/src/afs/afs_call.c,v 1.74.2.3 2004/12/07 06:12:11 shadow Exp $");
 
 #include "afs/sysincludes.h"   /* Standard vendor system headers */
 #include "afsincludes.h"       /* Afs-based standard headers */
@@ -271,7 +271,7 @@ afsd_thread(void *rock)
        complete_and_exit(0, 0);
        break;
     default:
-       printf("Unknown op %d in StartDaemon()\n", parm);
+       printf("Unknown op %ld in StartDaemon()\n", (long)parm);
        break;
     }
     return 0;
@@ -1096,6 +1096,7 @@ struct iparam32 {
 };
 
 
+#if defined(AFS_HPUX_64BIT_ENV) || defined(AFS_SUN57_64BIT_ENV) || (defined(AFS_LINUX_64BIT_KERNEL) && !defined(AFS_ALPHA_LINUX20_ENV) && !defined(AFS_IA64_LINUX20_ENV) && !defined(AFS_AMD64_LINUX20_ENV))
 static void
 iparam32_to_iparam(const struct iparam32 *src, struct iparam *dst)
 {
@@ -1104,6 +1105,7 @@ iparam32_to_iparam(const struct iparam32 *src, struct iparam *dst)
     dst->param3 = src->param3;
     dst->param4 = src->param4;
 }
+#endif
 
 /*
  * If you need to change copyin_iparam(), you may also need to change
@@ -3018,7 +3020,7 @@ afs_icl_EnumerateSets(int (*aproc)
     for (tp = afs_icl_allSets; tp; tp = np) {
        tp->refCount++;         /* hold this guy */
        ReleaseWriteLock(&afs_icl_lock);
-       code = (*aproc) (tp->name, arock, tp);
+       code = (*aproc) (tp->name, arock, (struct afs_icl_log *)tp);
        ObtainWriteLock(&afs_icl_lock, 206);
        np = tp->nextp;         /* tp may disappear next, but not np */
        if (--tp->refCount == 0 && (tp->states & ICL_SETF_DELETED))
index 404dda10acf03638eca49fc769d471766a906488..e520b436bce231dbf4a5cb0b9a258e27a9add44b 100644 (file)
@@ -14,7 +14,7 @@
 #include "afs/param.h"
 
 RCSID
-    ("$Header: /cvs/openafs/src/afs/afs_conn.c,v 1.13 2003/07/15 23:14:11 shadow Exp $");
+    ("$Header: /cvs/openafs/src/afs/afs_conn.c,v 1.13.2.1 2004/12/07 06:12:11 shadow Exp $");
 
 #include "afs/stds.h"
 #include "afs/sysincludes.h"   /* Standard vendor system headers */
@@ -220,7 +220,8 @@ afs_ConnBySA(struct srvAddr *sap, unsigned short aport, afs_int32 acell,
            }
            isec = 2;
            /* kerberos tickets on channel 2 */
-           csec = rxkad_NewClientSecurityObject(level, tu->ct.HandShakeKey,
+           csec = rxkad_NewClientSecurityObject(level,
+                                                 (struct ktc_encryptionKey *)tu->ct.HandShakeKey,
                                                 /* kvno */
                                                 tu->ct.AuthHandle, tu->stLen,
                                                 tu->stp);
index a741b78503d53f8c0efe350872321fb02b0bc3e5..8c6e9d8f05526ca9207f048db62d3303eac36cb1 100644 (file)
@@ -11,7 +11,7 @@
 #include "afs/param.h"
 
 RCSID
-    ("$Header: /cvs/openafs/src/afs/afs_daemons.c,v 1.28.2.1 2004/08/25 07:16:11 shadow Exp $");
+    ("$Header: /cvs/openafs/src/afs/afs_daemons.c,v 1.28.2.2 2004/12/07 06:12:11 shadow Exp $");
 
 #ifdef AFS_AIX51_ENV
 #define __FULL_PROTO
@@ -292,33 +292,28 @@ afs_CheckRootVolume(void)
        strcpy(rootVolName, afs_rootVolumeName);
     }
 
-    if (!usingDynroot) {
+    if (usingDynroot) {
+       afs_GetDynrootFid(&afs_rootFid);
+       tvp = afs_GetVolume(&afs_rootFid, NULL, READ_LOCK);
+    } else {
        struct cell *lc = afs_GetPrimaryCell(READ_LOCK);
 
        if (!lc)
            return ENOENT;
        localcell = lc->cellNum;
        afs_PutCell(lc, READ_LOCK);
-    }
-
-    if (usingDynroot) {
-       afs_GetDynrootFid(&afs_rootFid);
-       tvp = afs_GetVolume(&afs_rootFid, NULL, READ_LOCK);
-    } else {
        tvp = afs_GetVolumeByName(rootVolName, localcell, 1, NULL, READ_LOCK);
-    }
-    if (!tvp && !usingDynroot) {
-       char buf[128];
-       int len = strlen(rootVolName);
-
-       if ((len < 9) || strcmp(&rootVolName[len - 9], ".readonly")) {
-           strcpy(buf, rootVolName);
-           afs_strcat(buf, ".readonly");
-           tvp = afs_GetVolumeByName(buf, localcell, 1, NULL, READ_LOCK);
+       if (!tvp) {
+           char buf[128];
+           int len = strlen(rootVolName);
+
+           if ((len < 9) || strcmp(&rootVolName[len - 9], ".readonly")) {
+               strcpy(buf, rootVolName);
+               afs_strcat(buf, ".readonly");
+               tvp = afs_GetVolumeByName(buf, localcell, 1, NULL, READ_LOCK);
+           }
        }
-    }
-    if (tvp) {
-       if (!usingDynroot) {
+       if (tvp) {
            int volid = (tvp->roVol ? tvp->roVol : tvp->volume);
            afs_rootFid.Cell = localcell;
            if (afs_rootFid.Fid.Volume && afs_rootFid.Fid.Volume != volid
@@ -337,6 +332,8 @@ afs_CheckRootVolume(void)
            afs_rootFid.Fid.Vnode = 1;
            afs_rootFid.Fid.Unique = 1;
        }
+    }
+    if (tvp) {
        afs_initState = 300;    /* won */
        afs_osi_Wakeup(&afs_initState);
        afs_PutVolume(tvp, READ_LOCK);
index c6605e4cf42266e4795c5ed9cd0b12cb5aeda1c2..bda8bc5e78555118b1e60dd36841223fb3a7a2b6 100644 (file)
@@ -14,7 +14,7 @@
 #include "afs/param.h"
 
 RCSID
-    ("$Header: /cvs/openafs/src/afs/afs_dcache.c,v 1.42.2.3 2004/11/09 17:14:57 shadow Exp $");
+    ("$Header: /cvs/openafs/src/afs/afs_dcache.c,v 1.42.2.4 2004/12/07 06:12:11 shadow Exp $");
 
 #include "afs/sysincludes.h"   /*Standard vendor system headers */
 #include "afsincludes.h"       /*AFS-based standard headers */
@@ -1199,7 +1199,7 @@ afs_FindDCache(register struct vcache *avc, afs_size_t abyte)
 {
     afs_int32 chunk;
     register afs_int32 i, index;
-    register struct dcache *tdc;
+    register struct dcache *tdc = NULL;
 
     AFS_STATCNT(afs_FindDCache);
     chunk = AFS_CHUNK(abyte);
@@ -1526,7 +1526,7 @@ afs_GetDCache(register struct vcache *avc, afs_size_t abyte,
     register struct osi_file *file;
     register struct conn *tc;
     int downDCount = 0;
-    struct server *newCallback;
+    struct server *newCallback = NULL;
     char setNewCallback;
     char setVcacheStatus;
     char doVcacheUpdate;
index 956a9778f8074376505040157069a04334acfce9..f6e027b05303dae91606a0eaacaed6ca2bf46608 100644 (file)
@@ -17,7 +17,7 @@
 #include "afs/param.h"
 
 RCSID
-    ("$Header: /cvs/openafs/src/afs/afs_init.c,v 1.28 2004/05/08 04:23:56 shadow Exp $");
+    ("$Header: /cvs/openafs/src/afs/afs_init.c,v 1.28.2.1 2004/12/07 06:12:11 shadow Exp $");
 
 #include "afs/stds.h"
 #include "afs/sysincludes.h"   /* Standard vendor system headers */
@@ -351,7 +351,9 @@ afs_InitCacheInfo(register char *afile)
     struct osi_stat tstat;
     register struct osi_file *tfile;
     struct afs_fheader theader;
+#ifndef AFS_LINUX22_ENV
     struct vnode *filevp;
+#endif
     int goodFile;
 
     AFS_STATCNT(afs_InitCacheInfo);
index 58f4ca7c0b74b1fc2bf0829b73c174cebc161299..169dbaad37402d7350557a0e6353d21cf2a5e109 100644 (file)
@@ -11,7 +11,7 @@
 #include "afs/param.h"
 
 RCSID
-    ("$Header: /cvs/openafs/src/afs/afs_memcache.c,v 1.15 2003/07/15 23:14:12 shadow Exp $");
+    ("$Header: /cvs/openafs/src/afs/afs_memcache.c,v 1.15.2.1 2004/12/07 06:12:11 shadow Exp $");
 
 #include "afs/sysincludes.h"   /* Standard vendor system headers */
 #ifndef AFS_LINUX22_ENV
@@ -84,13 +84,18 @@ afs_InitMemCache(int blkCount, int blkSize, int flags)
 }
 
 int
-afs_MemCacheClose(char *file)
+afs_MemCacheClose(struct osi_file *file)
 {
     return 0;
 }
 
+#if defined(AFS_SUN57_64BIT_ENV) || defined(AFS_SGI62_ENV)
 void *
 afs_MemCacheOpen(ino_t blkno)
+#else
+void *
+afs_MemCacheOpen(afs_int32 blkno)
+#endif
 {
     struct memCacheEntry *mep;
 
@@ -108,9 +113,10 @@ afs_MemCacheOpen(ino_t blkno)
  * this routine simulates a read in the Memory Cache 
  */
 int
-afs_MemReadBlk(register struct memCacheEntry *mceP, int offset, char *dest,
+afs_MemReadBlk(register struct osi_file *fP, int offset, void *dest,
               int size)
 {
+    register struct memCacheEntry *mceP = (struct memCacheEntry *)fP;
     int bytesRead;
 
     MObtainReadLock(&mceP->afs_memLock);
@@ -188,9 +194,10 @@ afs_MemReadUIO(ino_t blkno, struct uio *uioP)
 
 /*XXX: this extends a block arbitrarily to support big directories */
 int
-afs_MemWriteBlk(register struct memCacheEntry *mceP, int offset, char *src,
+afs_MemWriteBlk(register struct osi_file *fP, int offset, void *src,
                int size)
 {
+    register struct memCacheEntry *mceP = (struct memCacheEntry *)fP;
     AFS_STATCNT(afs_MemWriteBlk);
     MObtainWriteLock(&mceP->afs_memLock, 560);
     if (size + offset > mceP->dataSize) {
@@ -300,8 +307,9 @@ afs_MemWriteUIO(ino_t blkno, struct uio *uioP)
 }
 
 int
-afs_MemCacheTruncate(register struct memCacheEntry *mceP, int size)
+afs_MemCacheTruncate(register struct osi_file *fP, int size)
 {
+    register struct memCacheEntry *mceP = (struct memCacheEntry *)fP;
     AFS_STATCNT(afs_MemCacheTruncate);
 
     MObtainWriteLock(&mceP->afs_memLock, 313);
@@ -321,11 +329,12 @@ afs_MemCacheTruncate(register struct memCacheEntry *mceP, int size)
 
 int
 afs_MemCacheStoreProc(register struct rx_call *acall,
-                     register struct memCacheEntry *mceP,
+                     register struct osi_file *fP,
                      register afs_int32 alen, struct vcache *avc,
                      int *shouldWake, afs_size_t * abytesToXferP,
-                     afs_size_t * abytesXferredP, afs_int32 length)
+                     afs_size_t * abytesXferredP)
 {
+    register struct memCacheEntry *mceP = (struct memCacheEntry *)fP;
 
     register afs_int32 code;
     register int tlen;
@@ -407,11 +416,12 @@ afs_MemCacheStoreProc(register struct rx_call *acall,
 
 int
 afs_MemCacheFetchProc(register struct rx_call *acall,
-                     register struct memCacheEntry *mceP, afs_size_t abase,
+                     register struct osi_file *fP, afs_size_t abase,
                      struct dcache *adc, struct vcache *avc,
                      afs_size_t * abytesToXferP, afs_size_t * abytesXferredP,
                      afs_int32 lengthFound)
 {
+    register struct memCacheEntry *mceP = (struct memCacheEntry *)fP;
     register afs_int32 code;
     afs_int32 length;
     int moredata = 0;
index b45a5312e74dbe22546b9a6614dc2e085ee56fd7..d50d878430c3d3f5a1be46c18437406fc81839ae 100644 (file)
@@ -11,7 +11,7 @@
 #include "afs/param.h"
 
 RCSID
-    ("$Header: /cvs/openafs/src/afs/afs_osi.c,v 1.48 2004/08/09 00:17:33 shadow Exp $");
+    ("$Header: /cvs/openafs/src/afs/afs_osi.c,v 1.48.2.1 2004/12/07 06:12:11 shadow Exp $");
 
 #include "afs/sysincludes.h"   /* Standard vendor system headers */
 #include "afsincludes.h"       /* Afs-based standard headers */
@@ -445,8 +445,10 @@ afs_osi_SetTime(osi_timeval_t * atv)
 void *
 afs_osi_Alloc(size_t x)
 {
+#if !defined(AFS_LINUX20_ENV) && !defined(AFS_FBSD_ENV)
     register struct osimem *tm = NULL;
     register int size;
+#endif
 
     AFS_STATCNT(osi_Alloc);
     /* 0-length allocs may return NULL ptr from AFS_KALLOC, so we special-case
index 6b98bca28938fa745928e2af1d289acf1d73ac6c..dc2a66e72bfe764e8c375c15b62872d13e53229a 100644 (file)
@@ -11,7 +11,7 @@
 #include "afs/param.h"
 
 RCSID
-    ("$Header: /cvs/openafs/src/afs/afs_pioctl.c,v 1.81.2.3 2004/11/09 17:14:57 shadow Exp $");
+    ("$Header: /cvs/openafs/src/afs/afs_pioctl.c,v 1.81.2.4 2004/12/07 06:12:11 shadow Exp $");
 
 #include "afs/sysincludes.h"   /* Standard vendor system headers */
 #ifdef AFS_OBSD_ENV
@@ -195,6 +195,7 @@ static int (*(CpioctlSw[])) () = {
 #define PSetClientContext 99   /*  Special pioctl to setup caller's creds  */
 int afs_nobody = NFS_NOBODY;
 
+#if (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL)) || defined(AFS_HPUX_64BIT_ENV) || defined(AFS_SUN57_64BIT_ENV) || (defined(AFS_SGI_ENV) && (_MIPS_SZLONG==64)) || (defined(AFS_LINUX_64BIT_KERNEL) && !defined(AFS_ALPHA_LINUX20_ENV) && !defined(AFS_IA64_LINUX20_ENV) && !defined(AFS_AMD64_LINUX20_ENV))
 static void
 afs_ioctl32_to_afs_ioctl(const struct afs_ioctl32 *src, struct afs_ioctl *dst)
 {
@@ -203,6 +204,7 @@ afs_ioctl32_to_afs_ioctl(const struct afs_ioctl32 *src, struct afs_ioctl *dst)
     dst->in_size = src->in_size;
     dst->out_size = src->out_size;
 }
+#endif
 
 /*
  * If you need to change copyin_afs_ioctl(), you may also need to change
@@ -846,9 +848,12 @@ afs_syscall_pioctl(path, com, cmarg, follow)
      int follow;
 {
     struct afs_ioctl data;
-    struct AFS_UCRED *tmpcred, *foreigncreds = NULL;
+#ifdef AFS_NEED_CLIENTCONTEXT
+    struct AFS_UCRED *tmpcred;
+#endif
+    struct AFS_UCRED *foreigncreds = NULL;
     register afs_int32 code = 0;
-    struct vnode *vp;
+    struct vnode *vp = NULL;
 #ifdef AFS_DEC_ENV
     struct vnode *gp;
 #endif
@@ -1519,7 +1524,7 @@ DECL_PIOCTL(PGetVolumeStatus)
     char *motd = afs_osi_Alloc(256);
     register struct conn *tc;
     register afs_int32 code = 0;
-    struct VolumeStatus volstat;
+    struct AFSFetchVolumeStatus volstat;
     register char *cp;
     char *Name, *OfflineMsg, *MOTD;
     XSTATS_DECLS;
@@ -2691,7 +2696,7 @@ DECL_PIOCTL(PGetVnodeXStatus)
  /* for the reader.  */
 DECL_PIOCTL(PSetSysName)
 {
-    char *cp, *cp2, inname[MAXSYSNAME], outname[MAXSYSNAME];
+    char *cp, *cp2 = NULL, inname[MAXSYSNAME], outname[MAXSYSNAME];
     int setsysname, foundname = 0;
     register struct afs_exporter *exporter;
     register struct unixuser *au;
index 33464593c51b176edc56a8f7baf84fb47ca92332..d388b03093f69685427bcb11b05964ef047d517c 100644 (file)
@@ -196,6 +196,8 @@ extern void afs_DequeueCallback(struct vcache *avc);
 
 /* afs_cell.c */
 extern afs_rwlock_t afs_xcell;
+extern struct afs_q CellLRU;           
+
 extern void afs_CellInit(void);
 extern void shutdown_cell(void);
 extern int afs_cellname_init(ino_t inode, int lookupcode);
@@ -424,28 +426,31 @@ extern void shutdown_mariner(void);
 
 /* afs_memcache.c */
 extern int afs_InitMemCache(int blkCount, int blkSize, int flags);
-extern int afs_MemCacheClose(char *file);
+extern int afs_MemCacheClose(struct osi_file *file);
+#if defined(AFS_SUN57_64BIT_ENV) || defined(AFS_SGI62_ENV)
 extern void *afs_MemCacheOpen(ino_t blkno);
-extern int afs_MemReadBlk(register struct memCacheEntry *mceP, int offset,
-                         char *dest, int size);
+#else
+extern void *afs_MemCacheOpen(afs_int32 blkno);
+#endif
+extern int afs_MemReadBlk(register struct osi_file *fP, int offset,
+                         void *dest, int size);
 extern int afs_MemReadvBlk(register struct memCacheEntry *mceP, int offset,
                           struct iovec *iov, int nio, int size);
 extern int afs_MemReadUIO(ino_t blkno, struct uio *uioP);
-extern int afs_MemWriteBlk(register struct memCacheEntry *mceP, int offset,
-                          char *src, int size);
+extern int afs_MemWriteBlk(register struct osi_file *fP, int offset,
+                          void *src, int size);
 extern int afs_MemWritevBlk(register struct memCacheEntry *mceP, int offset,
                            struct iovec *iov, int nio, int size);
 extern int afs_MemWriteUIO(ino_t blkno, struct uio *uioP);
-extern int afs_MemCacheTruncate(register struct memCacheEntry *mceP,
+extern int afs_MemCacheTruncate(register struct osi_file *fP,
                                int size);
 extern int afs_MemCacheStoreProc(register struct rx_call *acall,
-                                register struct memCacheEntry *mceP,
+                                register struct osi_file *fP,
                                 register afs_int32 alen, struct vcache *avc,
                                 int *shouldWake, afs_size_t * abytesToXferP,
-                                afs_size_t * abytesXferredP,
-                                afs_int32 length);
+                                afs_size_t * abytesXferredP);
 extern int afs_MemCacheFetchProc(register struct rx_call *acall,
-                                register struct memCacheEntry *mceP,
+                                register struct osi_file *fP,
                                 afs_size_t abase, struct dcache *adc,
                                 struct vcache *avc,
                                 afs_size_t * abytesToXferP,
@@ -545,7 +550,7 @@ extern int osi_InitCacheInfo(char *aname);
 extern int osi_rdwr(int rw, struct osi_file *file, caddr_t addrp,
                    size_t asize, size_t * resid);
 extern int osi_file_uio_rdwr(struct osi_file *osifile, uio_t * uiop, int rw);
-extern void setup_uio(uio_t * uiop, struct iovec *iovecp, char *buf,
+extern void setup_uio(uio_t * uiop, struct iovec *iovecp, const char *buf,
                      afs_offs_t pos, int count, uio_flag_t flag,
                      uio_seg_t seg);
 extern int uiomove(char *dp, int length, uio_flag_t rw, uio_t * uiop);
@@ -659,6 +664,7 @@ extern struct vfs *afs_globalVFS;
 extern struct vcache *afs_globalVp;
 #ifdef AFS_LINUX20_ENV
 extern void vcache2inode(struct vcache *avc);
+extern void vcache2fakeinode(struct vcache *rootvp, struct vcache *mpvp);
 #endif
 
 /* afs_pioctl.c */
@@ -705,7 +711,7 @@ extern void afs_FlushServer(struct server *srvp);
 extern void afs_RemoveSrvAddr(struct srvAddr *sap);
 extern void afs_ActivateServer(struct srvAddr *sap);
 #ifdef AFS_USERSPACE_IP_ADDR
-extern int afsi_SetServerIPRank(struct srvAddr *sa, afs_int32 addr,
+extern void afsi_SetServerIPRank(struct srvAddr *sa, afs_int32 addr,
                                afs_uint32 subnetmask);
 #else
 #if (!defined(AFS_SUN5_ENV)) && defined(USEIFADDR)
@@ -713,6 +719,7 @@ void afsi_SetServerIPRank(struct srvAddr *sa, struct in_ifaddr *ifa);
 #endif
 #endif
 extern int afs_HaveCallBacksFrom(struct server *aserver);
+extern void shutdown_server(void);
 
 
 
@@ -952,7 +959,7 @@ extern int afs_TryEvalFakeStat(struct vcache **avcp,
                               struct vrequest *areq);
 extern void afs_PutFakeStat(struct afs_fakestat_state *state);
 extern int afs_ENameOK(register char *aname);
-extern void Check_AtSys(register struct vcache *avc, char *aname,
+extern void Check_AtSys(register struct vcache *avc, const char *aname,
                        struct sysname_info *state, struct vrequest *areq);
 extern int Next_AtSys(register struct vcache *avc, struct vrequest *areq,
                      struct sysname_info *state);
@@ -981,6 +988,8 @@ extern int afs_MemRead(register struct vcache *avc, struct uio *auio,
 extern int afs_UFSRead(register struct vcache *avc, struct uio *auio,
                       struct AFS_UCRED *acred, daddr_t albn,
                       struct buf **abpp, int noLock);
+extern void afs_PrefetchChunk(struct vcache *avc, struct dcache *adc,
+                             struct AFS_UCRED *acred, struct vrequest *areq);
 
 
 /* VNOPS/afs_vnop_readdir.c */
index a76b229a0706f03eb5087f2a315ecbb60cbbdf6c..8da25423dad40ee1f6e9b1d5d0c6d6e475174607 100644 (file)
@@ -14,7 +14,7 @@
 #include "afs/param.h"
 
 RCSID
-    ("$Header: /cvs/openafs/src/afs/afs_segments.c,v 1.16.2.3 2004/11/09 17:14:57 shadow Exp $");
+    ("$Header: /cvs/openafs/src/afs/afs_segments.c,v 1.16.2.4 2004/12/07 06:12:12 shadow Exp $");
 
 #include "afs/sysincludes.h"   /*Standard vendor system headers */
 #include "afsincludes.h"       /*AFS-based standard headers */
@@ -236,7 +236,6 @@ afs_StoreAllSegments(register struct vcache *avc, struct vrequest *areq,
      */
     origCBs = afs_allCBs;
 
-  retry:
     maxStoredLength = 0;
     tlen = avc->m.Length;
     minj = 0;
@@ -301,7 +300,7 @@ afs_StoreAllSegments(register struct vcache *avc, struct vrequest *areq,
            afs_size_t base, bytes;
            afs_uint32 nchunks;
            int nomore;
-           unsigned int first;
+           unsigned int first = 0;
            int *shouldwake;
            struct conn *tc;
            struct osi_file *tfile;
index 89e55e57617dfc139aac001f0566942d90634a8a..d54d91287c40cd5ff3248a62f4fb1fd63da29cf2 100644 (file)
@@ -33,7 +33,7 @@
 #include "afs/param.h"
 
 RCSID
-    ("$Header: /cvs/openafs/src/afs/afs_server.c,v 1.33.2.1 2004/08/25 07:07:53 shadow Exp $");
+    ("$Header: /cvs/openafs/src/afs/afs_server.c,v 1.33.2.3 2004/12/07 06:12:40 shadow Exp $");
 
 #include "afs/stds.h"
 #include "afs/sysincludes.h"   /* Standard vendor system headers */
@@ -498,9 +498,9 @@ afs_CheckServers(int adown, struct cell *acellp)
     struct conn *tc;
     afs_int32 i, j;
     afs_int32 code;
-    afs_int32 start, end, delta;
+    afs_int32 start, end = 0, delta;
+    afs_int32 m_error;
     osi_timeval_t tv;
-    int setTimer;
     struct unixuser *tu;
     char tbuffer[CVBS];
     int srvAddrCount;
@@ -508,9 +508,7 @@ afs_CheckServers(int adown, struct cell *acellp)
     struct conn **conns;
     int nconns;
     struct rx_connection **rxconns;      
-    int nrxconns;
     afs_int32 *conntimer, *deltas;
-    XSTATS_DECLS;
 
     AFS_STATCNT(afs_CheckServers);
 
@@ -600,40 +598,47 @@ afs_CheckServers(int adown, struct cell *acellp)
     start = osi_Time();         /* time the gettimeofday call */
     AFS_GUNLOCK(); 
     multi_Rx(rxconns,nconns)
-       {
-           tv.tv_sec = tv.tv_usec = 0;
-           multi_RXAFS_GetTime(&tv.tv_sec, &tv.tv_usec);
-           tc = conns[multi_i];
-           sa = tc->srvr;
-           if (conntimer[multi_i] == 0)
-               rx_SetConnDeadTime(tc->id, AFS_RXDEADTIME);
-           end = osi_Time();
-           if ((start == end) && !multi_error)
-               deltas[multi_i] = end - tv.tv_sec;
-           if (( multi_error >= 0 ) && (sa->sa_flags & SRVADDR_ISDOWN) && (tc->srvr == sa)) {
-               /* server back up */
-               print_internet_address("afs: file server ", sa, " is back up", 2);
-               
-                ObtainWriteLock(&afs_xserver, 244);
-                ObtainWriteLock(&afs_xsrvAddr, 245);        
-                afs_MarkServerUpOrDown(sa, 0);
-                ReleaseWriteLock(&afs_xsrvAddr);
-                ReleaseWriteLock(&afs_xserver);
-               
-               if (afs_waitForeverCount) {
-                   afs_osi_Wakeup(&afs_waitForever);
-               }
-           } else {
-               if (multi_error < 0) {
-                               /* server crashed */
-                   afs_ServerDown(sa);
-                   ForceNewConnections(sa);  /* multi homed clients */
-               }
-           }
-           
-       } multi_End;
+      {
+       tv.tv_sec = tv.tv_usec = 0;
+       multi_RXAFS_GetTime(&tv.tv_sec, &tv.tv_usec);
+       tc = conns[multi_i];
+       sa = tc->srvr;
+       if (conntimer[multi_i] == 0)
+         rx_SetConnDeadTime(tc->id, AFS_RXDEADTIME);
+       end = osi_Time();
+       m_error=multi_error;
+       if ((start == end) && !multi_error)
+         deltas[multi_i] = end - tv.tv_sec;
+       
+      } multi_End;
     AFS_GLOCK(); 
+    
+    for(i=0;i<nconns;i++){
+      tc = conns[i];
+      sa = tc->srvr;
+      
+      if (( m_error >= 0 ) && (sa->sa_flags & SRVADDR_ISDOWN) && (tc->srvr == sa)) {
+       /* server back up */
+       print_internet_address("afs: file server ", sa, " is back up", 2);
+       
+       ObtainWriteLock(&afs_xserver, 244);
+       ObtainWriteLock(&afs_xsrvAddr, 245);        
+       afs_MarkServerUpOrDown(sa, 0);
+       ReleaseWriteLock(&afs_xsrvAddr);
+       ReleaseWriteLock(&afs_xserver);
+       
+       if (afs_waitForeverCount) {
+         afs_osi_Wakeup(&afs_waitForever);
+       }
+      } else {
+       if (m_error < 0) {
+         /* server crashed */
+         afs_ServerDown(sa);
+         ForceNewConnections(sa);  /* multi homed clients */
+       }
+      }
+    }
+
     /*
      * If we're supposed to set the time, and the call worked
      * quickly (same second response) and this is the host we
@@ -1053,7 +1058,7 @@ typedef struct ill_s {
  * afs_uint32 subnetmask;         subnet mask of local addr in net order
  *
  */
-int
+void
 afsi_SetServerIPRank(struct srvAddr *sa, afs_int32 addr,
                     afs_uint32 subnetmask)
 {
index 2fa76aa2a411838af3359adadda5d8c35add163f..0206c4797372f23bcf5ffe0a5c77a2814b8181f3 100644 (file)
@@ -45,7 +45,7 @@
 typedef struct timeval osi_timeval_t;
 #endif /* !KERNEL */
 
-#define XSTATS_DECLS struct afs_stats_opTimingData *opP; \
+#define XSTATS_DECLS struct afs_stats_opTimingData *opP = NULL; \
     osi_timeval_t opStartTime, opStopTime, elapsedTime
 
 #define XSTATS_START_TIME(arg) \
index a8ee024c5be9d8ac6960d9c92481e5db7f2f3f00..1dde621318473dabe4bd046cc70f90027839a50e 100644 (file)
@@ -16,7 +16,7 @@
 #include "afs/param.h"
 
 RCSID
-    ("$Header: /cvs/openafs/src/afs/afs_util.c,v 1.17 2003/07/15 23:14:13 shadow Exp $");
+    ("$Header: /cvs/openafs/src/afs/afs_util.c,v 1.17.2.1 2004/12/07 06:12:12 shadow Exp $");
 
 #include "afs/stds.h"
 #include "afs/sysincludes.h"   /* Standard vendor system headers */
@@ -301,7 +301,7 @@ afs_CheckLocks(void)
        for (i = 0; i < NSERVERS; i++) {
            for (ts = afs_servers[i]; ts; ts = ts->next) {
                if (ts->flags & SRVR_ISDOWN)
-                   printf("Server entry %x is marked down\n", ts);
+                   printf("Server entry %lx is marked down\n", (unsigned long)ts);
                for (sa = ts->addr; sa; sa = sa->next_sa) {
                    for (tc = sa->conns; tc; tc = tc->next) {
                        if (tc->refCount)
@@ -329,7 +329,7 @@ afs_CheckLocks(void)
        for (i = 0; i < NUSERS; i++) {
            for (tu = afs_users[i]; tu; tu = tu->next) {
                if (tu->refCount)
-                   printf("user at %x is held\n", tu);
+                   printf("user at %lx is held\n", (unsigned long)tu);
            }
        }
     }
index dc53216451c0505194a8b64c178b64515f37636e..d3cf368d86f4445f29561793a372ad3a78ca9333 100644 (file)
@@ -19,7 +19,7 @@
 #include "afs/param.h"
 
 RCSID
-    ("$Header: /cvs/openafs/src/afs/afs_volume.c,v 1.26 2003/08/27 21:43:16 rees Exp $");
+    ("$Header: /cvs/openafs/src/afs/afs_volume.c,v 1.26.2.1 2004/12/07 06:12:12 shadow Exp $");
 
 #include "afs/stds.h"
 #include "afs/sysincludes.h"   /* Standard vendor system headers */
@@ -411,7 +411,7 @@ afs_GetVolume(struct VenusFid *afid, struct vrequest *areq,
 
 
 static struct volume *
-afs_SetupVolume(afs_int32 volid, char *aname, char *ve, struct cell *tcell,
+afs_SetupVolume(afs_int32 volid, char *aname, void *ve, struct cell *tcell,
                afs_int32 agood, afs_int32 type, struct vrequest *areq)
 {
     struct volume *tv;
index 1b0fec866d6d0a4534a79bfdb9bba8d0bc4c233c..b0dcf217059e72413a132e3c4b5f655276fafeb4 100644 (file)
@@ -72,7 +72,9 @@
 /* Avoid conflicts with coda overloading AFS type namespace. Must precede
  * inclusion of uaccess.h.
  */
+#ifndef _LINUX_CODA_FS_I
 #define _LINUX_CODA_FS_I
+#endif
 #define _CFS_HEADER_
 struct coda_inode_info {
 };
@@ -140,6 +142,12 @@ typedef unsigned short etap_event_t;
 #include "sys/cmn_err.h"
 #ifdef AFS_SGI64_ENV
 #include <ksys/behavior.h>
+/* in 6.5.20f, ksys/behavior.h doesn't bother to define BHV_IS_BHVL,
+ * but sys/vnode.h uses it in VNODE_TO_FIRST_BHV. It looks like from
+ * older headers like we want the old behavior, so we fake it. */
+#if defined(BHV_PREPARE) && !defined(CELL_CAPABLE)
+#define BHV_IS_BHVL(bhp) (0)
+#endif
 #endif /* AFS_SGI64_ENV */
 #include "fs/efs_inode.h"
 #ifdef AFS_SGI_EFS_IOPS_ENV
index 7b99f84c17211140e5fa4fbcfc98aead452a83bf..d30001982a93627d2e56a68ad20fc3b7f44b1234 100644 (file)
@@ -56,7 +56,7 @@
 #include <afs/param.h>
 
 RCSID
-    ("$Header: /cvs/openafs/src/afsd/afsd.c,v 1.43 2004/07/28 22:47:58 shadow Exp $");
+    ("$Header: /cvs/openafs/src/afsd/afsd.c,v 1.43.2.1 2004/12/07 18:25:08 shadow Exp $");
 
 #define VFS 1
 
@@ -1384,7 +1384,7 @@ mainproc(as, arock)
        /* -chunksize */
        chunkSize = atoi(as->parms[12].items->data);
        if (chunkSize < 0 || chunkSize > 30) {
-           printf("afsd:invalid chunk size spec'd, using default\n");
+           printf("afsd:invalid chunk size (not in range 0-30), using default\n");
            chunkSize = 0;
        }
     }
diff --git a/src/aklog/aklog.1 b/src/aklog/aklog.1
new file mode 100644 (file)
index 0000000..58d08a4
--- /dev/null
@@ -0,0 +1,189 @@
+.\" 
+.\" $Id: aklog.1,v 1.1.2.1 2004/12/17 15:39:45 shadow Exp $
+.\"
+.\" Copyright 1990,1991 by the Massachusetts Institute of Technology
+.\" For distribution and copying rights, see the file "mit-copyright.h"
+.\"
+.TH AKLOG 1 "August 1, 1990"
+.UC 4
+.SH NAME
+aklog \- Obtain tokens for authentication to AFS
+
+.SH SYNOPSIS
+.B aklog 
+[ 
+.B \-d 
+] [ 
+.B \-hosts
+] [ 
+.B \-zsubs 
+] [ 
+.B \-noprdb 
+] [ [
+.B \-cell | \-c 
+] cell [
+.B \-k 
+kerberos-realm
+] ] [ [ 
+.B \-path | \-p 
+] pathname ]
+
+.SH DESCRIPTION
+The 
+.I aklog
+program is used to authenticate to a cell or directory in 
+.I AFS,
+the Andrew Filesystem, by obtaining AFS 
+.I tokens.  
+Ordinarily, aklog is not used directly but called by
+.IR attach (1).
+
+If 
+.I aklog
+is invoked with no command line arguments, it will obtain tokens 
+for the workstation's local cell.  It is possible to invoke
+.I aklog
+with arbitrarily many cells and pathnames
+specified on the command line.  
+.I aklog 
+knows how to expand cell name abbreviations, so short
+forms of cell names can be use used.  In addition, 
+.I aklog
+understands the following command line options:
+
+.TP 4 
+.B  \-cell | \-c \fRcell
+This flag is not ordinarily necessary since 
+.I aklog
+can usually figure out when an argument is a cell.  It can be
+used to introduce a cell name that would ordinarily be mistaken
+for a path name if this should be required.  If this flag is
+omitted, an argument will be treated as a cell name if it
+contains no slashes (/) and is neither "." nor ".." .
+
+.TP
+.B \-k \fRkerberos-realm
+This flag is valid only when immediately following the name of a
+cell.  It is used to tell 
+.I aklog
+what kerberos realm should be used while authenticating to the
+preceding cell.  This argument is unnecessary except when the
+workstation is not properly configured.  Ordinarily, 
+.I aklog
+can determine this information on its own.
+
+.TP
+.B \-path | \-p \fRpathname
+Like the \-cell flag, this flag is usually unnecessary.  When it
+appears, the next command line argument is always treated as a
+path name.  Ordinarily, an argument is treated as a path name
+if it is "." or ".." or if it contains a slash (/).  
+
+.TP
+.B \-hosts
+Prints all the server addresses which may act as a single point of
+failure in accessing the specified directory path.  Each element of the
+path is examined, and as new volumes are traversed, if they are not
+replicated, the server's IP address containing the volume will be
+displayed.
+.IR Attach (1)
+invokes 
+.I aklog
+with this option.  The output is of the form
+
+host: 
+.I IP address
+
+.TP
+.B \-zsubs
+Causes the printing of the zephyr subscription information that a
+person using a given path or cell would want.  
+.IR Attach (1)
+invokes 
+.I aklog
+with this option.  The output is of the form
+
+zsub: 
+.I instance
+
+where 
+.I instance
+is the instance of a class filsrv zephyr subscription.
+
+.TP
+.B \-noprdb
+Ordinarily, aklog looks up the AFS ID corresponding to the name
+of the person invoking the command.  Specifying this flag turns
+off this functionality.  This may be desirable if the protection
+database is unavailable for some reason and tokens are desired
+anyway.  
+
+.TP
+.B \-d
+Turns on printing of debugging information.  This option is not
+intended for general users.
+
+.SH EXIT CODES
+The exit status of
+.I aklog
+will be one of the following:
+.TP 5
+0
+Success -- No error occurred.
+.TP 5
+1
+Usage -- Bad command syntax; accompanied by a usage message.
+.TP 5
+2
+Something failed -- More than one cell or pathname was given on
+the command line and at least one failure occurred.
+A more specific error status is returned when only one directive
+is given.
+.TP 5
+3
+AFS -- Unable to get AFS configuration or unable to get
+information about a specific cell.
+.TP 5
+4
+Kerberos -- Unable to get tickets for authentication.
+.TP 5
+5
+Token -- Unable to get tokens.
+.TP 5
+6
+Bad pathname -- The path given was not a directory or 
+.I lstat(2)
+failed on some component of the pathname.
+.TP 5
+7
+Miscellaneous -- An internal failure occurred.  For example, 
+.I aklog
+returns this if it runs out of memory.
+
+.SH EXAMPLES
+.br
+To get tokens for the local cell:
+.br
+% aklog
+
+To get tokens for the athena.mit.edu cell:
+.br
+% aklog athena.mit.edu
+.br
+or
+.br
+% aklog athena
+
+To get tokens adequate to read /afs/athena.mit.edu/user/p/potato:
+.br
+% aklog /afs/athena.mit.edu/user/p/potato
+
+To get tokens for a test cell that is in a test Kerberos realm:
+.br
+% aklog testcell.mit.edu -k TESTREALM.MIT.EDU
+
+.SH SEE ALSO
+attach(1), tokens(1), unlog(1)
+
+.SH AUTHOR
+Emanuel Jay Berkenbilt (MIT-Project Athena)
diff --git a/src/aklog/aklog.c b/src/aklog/aklog.c
new file mode 100644 (file)
index 0000000..979e6a0
--- /dev/null
@@ -0,0 +1,114 @@
+/* 
+ * $Id: aklog.c,v 1.1.2.1 2004/12/07 05:51:24 shadow Exp $
+ *
+ * Copyright 1990,1991 by the Massachusetts Institute of Technology
+ * For distribution and copying rights, see the file "mit-copyright.h"
+ */
+
+#if !defined(lint) && !defined(SABER)
+static char *rcsid = "$Id: aklog.c,v 1.1.2.1 2004/12/07 05:51:24 shadow Exp $";
+#endif /* lint || SABER */
+
+#include "aklog.h"
+
+#ifndef WINDOWS
+
+#ifdef __STDC__
+main(int argc, char *argv[])
+#else
+main(argc, argv)
+  int argc;
+  char *argv[];
+#endif /* __STDC__ */
+{
+    aklog_params params;
+
+    aklog_init_params(&params);
+    aklog(argc, argv, &params);
+}
+
+#else /* WINDOWS */
+
+#include <windows.h>
+#include <windowsx.h>
+
+static void parse_cmdline();
+
+
+int PASCAL
+WinMain(HINSTANCE hinst, HINSTANCE hprevinstance, LPSTR cmdline, int noshow)
+{
+       int argc = 0;
+       char **argv;
+
+    aklog_params params;
+
+       parse_cmdline(cmdline, &argv, &argc);
+
+    aklog_init_params(&params);
+    aklog(argc, argv, &params);
+
+       return 0;
+}
+
+/*
+ * Generate agrv/argc here from command line.
+ * Note that windows doesn't pass us the executible name, so
+ * we need to fill that in manually.
+ */
+
+static void
+parse_cmdline(char *cmdline, char ***pargv, int *pargc)
+{
+       char **argv;
+       int argc = 0;
+       char *arg, *sep = " \t";
+       int argv_size = 10;             /* to start with */
+
+
+       argv = malloc(argv_size * sizeof(char *));
+
+       if (!argv) {
+               MessageBox(NULL, "Fatal Error: Out of memory", AKLOG_DIALOG_NAME, 
+                                  MB_OK | MB_ICONSTOP);
+               exit(1);
+       }
+
+       argv[argc++] = "aklog";
+
+       arg = strtok(cmdline, sep);
+
+       while(arg) {
+               argv[argc] = strdup(arg);
+
+               if (!argv[argc]) {
+                       MessageBox(NULL, "Fatal Error: Out of memory", AKLOG_DIALOG_NAME, 
+                                          MB_OK | MB_ICONSTOP);
+                       exit(1);
+               }
+
+               argc++;
+
+               if (argc == argv_size) {
+                       argv_size += 10;
+                       argv = realloc(argv, argv_size * sizeof(char *));
+
+                       if (!argv) {
+                               MessageBox(NULL, "Fatal Error: Out of memory",
+                                                  AKLOG_DIALOG_NAME, 
+                                                  MB_OK | MB_ICONSTOP);
+                               exit(1);
+                       }
+               }
+
+               arg = strtok(NULL, sep);
+       }
+
+       argv[argc] = NULL;
+
+       *pargv = argv;
+       *pargc = argc;
+}
+
+#endif /* WINDOWS */
+
diff --git a/src/aklog/aklog.h b/src/aklog/aklog.h
new file mode 100644 (file)
index 0000000..4420b22
--- /dev/null
@@ -0,0 +1,71 @@
+/* 
+ * $Id: aklog.h,v 1.1.2.1 2004/12/07 05:51:24 shadow Exp $
+ *
+ * Copyright 1990,1991 by the Massachusetts Institute of Technology
+ * For distribution and copying rights, see the file "mit-copyright.h"
+ */
+
+#ifndef __AKLOG_H__
+#define __AKLOG_H__
+
+#if !defined(lint) && !defined(SABER)
+static char *rcsid_aklog_h = "$Id: aklog.h,v 1.1.2.1 2004/12/07 05:51:24 shadow Exp $";
+#endif /* lint || SABER */
+
+#include <krb5.h>
+#include <kerberosIV/krb.h>
+#include "linked_list.h"
+
+#ifdef __STDC__
+#define ARGS(x) x
+#else
+#define ARGS(x) ()
+#endif /* __STDC__ */
+
+typedef struct {
+    int (*readlink)ARGS((char *, char *, size_t));
+    int (*isdir)ARGS((char *, unsigned char *));
+    char *(*getwd)ARGS((char *));
+    int (*get_cred)ARGS((krb5_context, char *, char *, char *, CREDENTIALS *,
+               krb5_creds **));
+    int (*get_user_realm)ARGS((krb5_context, char *));
+    void (*pstderr)ARGS((char *));
+    void (*pstdout)ARGS((char *));
+    void (*exitprog)ARGS((char));
+} aklog_params;
+
+void aklog ARGS((int, char *[], aklog_params *));
+void aklog_init_params ARGS((aklog_params *));
+
+#ifdef WINDOWS
+/*
+ * Complete server info for one cell.
+ *
+ * Normally this is defined in afs/cellconfig.h, but the Windows header
+ * files and API don't use this structure. So, I'll include it here so
+ * I don't have to rewrite large chunks of code.
+ */
+#define MAXCELLCHARS    64
+#define MAXHOSTCHARS    64
+#define MAXHOSTSPERCELL  8
+
+struct afsconf_cell {
+    char name[MAXCELLCHARS];        /* Cell name */
+    short numServers;               /* Num active servers for the cell*/
+    short flags;                    /* useful flags */
+    struct sockaddr_in hostAddr[MAXHOSTSPERCELL];
+                                   /* IP addresses for cell's servers*/
+    char hostName[MAXHOSTSPERCELL][MAXHOSTCHARS];       
+                                    /* Names for cell's servers */
+    char *linkedCell;               /* Linked cell name, if any */
+};
+
+/* Windows krb5 libraries don't seem to have this call */
+#define krb5_xfree(p)  free(p)
+
+/* Title for dialog boxes */
+#define AKLOG_DIALOG_NAME              "aklog"
+
+#endif /* WINDOWS */
+
+#endif /* __AKLOG_H__ */
diff --git a/src/aklog/aklog_main.c b/src/aklog/aklog_main.c
new file mode 100644 (file)
index 0000000..b977439
--- /dev/null
@@ -0,0 +1,1610 @@
+/* 
+ * $Id: aklog_main.c,v 1.1.2.1 2004/12/07 05:51:24 shadow Exp $
+ *
+ * Copyright 1990,1991 by the Massachusetts Institute of Technology
+ * For distribution and copying rights, see the file "mit-copyright.h"
+ */
+
+#if !defined(lint) && !defined(SABER)
+static char *rcsid =
+       "$Id: aklog_main.c,v 1.1.2.1 2004/12/07 05:51:24 shadow Exp $";
+#endif /* lint || SABER */
+
+#include <stdio.h>
+#include <string.h>
+#include <ctype.h>
+#include <sys/types.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_MEMORY_H
+#include <memory.h>
+#endif
+#include <errno.h>
+
+#include <sys/stat.h>
+#include <fcntl.h>
+
+#ifndef WINDOWS
+#include <sys/param.h>
+#include <sys/errno.h>
+#include <netdb.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <pwd.h>
+#endif /* WINDOWS */
+
+/* on AIX AFS has an unresolved reference to osi_audit. We will define
+ * it here as extern. It also trys to call the ntohl and htonl routines
+ * as routines rather then macros. We need a real routine here. 
+ * We do this before the ntohl and htonl macros are defined in net/in.h
+ */
+int osi_audit()
+    { return(0);}
+
+#if 0
+#ifdef _AIX
+u_long htonl(u_long x)
+    { return(x);}
+
+u_long ntohl(u_long x)
+    { return(x);}
+#endif
+
+#include <netinet/in.h>
+/* #include <krb.h> */
+#endif /* 0 */
+
+#include <krb5.h>
+
+#ifdef WINDOWS
+
+#ifdef PRE_AFS35
+#include "afs_tokens.h"
+#include "rxkad.h"
+#else /* !PRE_AFS35 */
+#include <afs/stds.h>
+#include <afs/auth.h>
+#include <rx/rxkad.h>
+#include <afs/dirpath.h>
+#endif /* PRE_AFS35 */
+
+#else /* !WINDOWS */
+#include <afs/stds.h>
+#include <afs/com_err.h>
+
+#include <afs/param.h>
+#ifdef AFS_SUN5_ENV
+#include <sys/ioccom.h>
+#endif
+#include <afs/auth.h>
+#include <afs/cellconfig.h>
+#include <afs/vice.h>
+#include <afs/venus.h>
+#include <afs/ptserver.h>
+#include <afs/dirpath.h>
+#endif /* WINDOWS */
+
+#include "aklog.h"
+#include "linked_list.h"
+
+#define AFSKEY "afs"
+#define AFSINST ""
+
+#ifndef AFS_TRY_FULL_PRINC
+#define AFS_TRY_FULL_PRINC 0
+#endif /* AFS_TRY_FULL_PRINC */
+
+#define AKLOG_SUCCESS 0
+#define AKLOG_USAGE 1
+#define AKLOG_SOMETHINGSWRONG 2
+#define AKLOG_AFS 3
+#define AKLOG_KERBEROS 4
+#define AKLOG_TOKEN 5
+#define AKLOG_BADPATH 6
+#define AKLOG_MISC 7
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+#ifndef TRUE
+#define TRUE 1
+#endif
+
+#ifndef FALSE
+#define FALSE 0
+#endif
+
+#ifndef MAXSYMLINKS
+/* RedHat 4.x doesn't seem to define this */
+#define MAXSYMLINKS    5
+#endif
+
+#define DIR '/'                        /* Character that divides directories */
+#define DIRSTRING "/"          /* String form of above */
+#define VOLMARKER ':'          /* Character separating cellname from mntpt */
+#define VOLMARKERSTRING ":"    /* String form of above */
+
+typedef struct {
+    char cell[BUFSIZ];
+    char realm[REALM_SZ];
+} cellinfo_t;
+
+struct afsconf_cell ak_cellconfig; /* General information about the cell */
+static char linkedcell[MAXCELLCHARS+1];
+static char linkedcell2[MAXCELLCHARS+1];
+
+#ifdef WINDOWS
+
+/* libafsconf.dll */
+extern long cm_GetRootCellName();
+extern long cm_SearchCellFile();
+
+static long cm_SearchCellFile_CallBack();
+
+#else /* !WINDOWS */
+
+/*
+ * Why doesn't AFS provide these prototypes?
+ */
+
+#ifdef AFS_INT32
+typedef afs_int32 int32 ;
+#endif
+
+extern int afsconf_GetLocalCell(struct afsconf_dir *, char *, afs_int32);
+extern int afsconf_GetCellInfo(struct afsconf_dir *, char *, char *,
+                              struct afsconf_cell *);
+extern int afsconf_Close(struct afsconf_dir *);
+extern int ktc_GetToken(struct ktc_principal *, struct ktc_token *, int,
+                       struct ktc_principal *);
+extern int ktc_SetToken(struct ktc_principal *, struct ktc_token *,
+                       struct ktc_principal *, int);
+extern afs_int32 pr_Initialize(afs_int32, char *, char *, afs_int32);
+extern int pr_SNameToId(char *, afs_int32 *);
+extern int pr_CreateUser(char *, afs_int32 *);
+extern int pr_End();
+extern int pioctl(char *, afs_int32, struct ViceIoctl *, afs_int32);
+
+/*
+ * Other prototypes
+ */
+
+extern char *afs_realm_of_cell(krb5_context, struct afsconf_cell *);
+
+#endif /* WINDOWS */
+
+/*
+ * Provide a replacement for strerror if we don't have it
+ */
+
+#ifndef HAVE_STRERROR
+extern char *sys_errlist[];
+#define strerror(x) sys_errlist[x]
+#endif /* HAVE_STRERROR */
+
+static aklog_params params;    /* Various aklog functions */
+static char msgbuf[BUFSIZ];    /* String for constructing error messages */
+static char *progname = NULL;  /* Name of this program */
+static int dflag = FALSE;      /* Give debugging information */
+static int noauth = FALSE;     /* If true, don't try to get tokens */
+static int zsubs = FALSE;      /* Are we keeping track of zephyr subs? */
+static int hosts = FALSE;      /* Are we keeping track of hosts? */
+static int noprdb = FALSE;     /* Skip resolving name to id? */
+static int linked = FALSE;  /* try for both AFS nodes */
+static int afssetpag = FALSE; /* setpag for AFS */
+static int force = FALSE;      /* Bash identical tokens? */
+static linked_list zsublist;   /* List of zephyr subscriptions */
+static linked_list hostlist;   /* List of host addresses */
+static linked_list authedcells;        /* List of cells already logged to */
+
+/* ANL - CMU lifetime convert routine */
+/* for K5.4.1 don't use this for now. Need to see if it is needed */
+/* maybe needed in the krb524d module as well */
+/* extern unsigned long krb_life_to_time(); */
+
+#ifdef __STDC__
+static char *copy_cellinfo(cellinfo_t *cellinfo)
+#else
+static char *copy_cellinfo(cellinfo)
+  cellinfo_t *cellinfo;
+#endif /* __STDC__ */
+{
+    cellinfo_t *new_cellinfo;
+
+    if ((new_cellinfo = (cellinfo_t *)malloc(sizeof(cellinfo_t))))
+       memcpy(new_cellinfo, cellinfo, sizeof(cellinfo_t));
+    
+    return ((char *)new_cellinfo);
+}
+
+
+#ifdef __STDC__
+static char *copy_string(char *string)    
+#else
+static char *copy_string(string)
+  char *string;
+#endif /* __STDC__ */
+{
+    char *new_string;
+
+    if ((new_string = (char *)calloc(strlen(string) + 1, sizeof(char))))
+       (void) strcpy(new_string, string);
+
+    return (new_string);
+}
+
+
+#ifdef __STDC__
+static int get_cellconfig(char *cell, struct afsconf_cell *cellconfig, char *local_cell, char *linkedcell)
+#else
+static int get_cellconfig(cell, cellconfig, local_cell, linkedcell)
+    char *cell;
+    struct afsconf_cell *cellconfig;
+    char *local_cell;
+       char *linkedcell;
+#endif /* __STDC__ */
+{
+    int status = AKLOG_SUCCESS;
+    struct afsconf_dir *configdir;
+#ifndef PRE_AFS35
+    char *dirpath;
+#endif /* ! PRE_AFS35 */
+
+    memset(local_cell, 0, sizeof(local_cell));
+    memset((char *)cellconfig, 0, sizeof(*cellconfig));
+
+#ifndef WINDOWS
+
+    if (!(configdir = afsconf_Open(AFSDIR_CLIENT_ETC_DIRPATH))) {
+       sprintf(msgbuf, 
+               "%s: can't get afs configuration (afsconf_Open(%s))\n",
+               progname, AFSDIR_CLIENT_ETC_DIRPATH);
+       params.pstderr(msgbuf);
+       params.exitprog(AKLOG_AFS);
+    }
+
+    if (afsconf_GetLocalCell(configdir, local_cell, MAXCELLCHARS)) {
+       sprintf(msgbuf, "%s: can't determine local cell.\n", progname);
+       params.pstderr(msgbuf);
+       params.exitprog(AKLOG_AFS);
+    }
+
+    if ((cell == NULL) || (cell[0] == 0))
+       cell = local_cell;
+
+       linkedcell[0] = '\0';
+    if (afsconf_GetCellInfo(configdir, cell, NULL, cellconfig)) {
+       sprintf(msgbuf, "%s: Can't get information about cell %s.\n",
+               progname, cell);
+       params.pstderr(msgbuf);
+       status = AKLOG_AFS;
+    }
+       if (cellconfig->linkedCell) 
+               strncpy(linkedcell,cellconfig->linkedCell,MAXCELLCHARS);
+
+    (void) afsconf_Close(configdir);
+
+#else /* WINDOWS */
+    /*
+     * We'll try to mimic the GetCellInfo call here and fill in as much
+     * of the afsconf_cell structure as we can.
+     */
+    if (cm_GetRootCellName(local_cell)) {
+       sprintf(msgbuf, "%s: can't get local cellname\n", progname);
+       params.pstderr(msgbuf);
+       params.exitprog(AKLOG_AFS);
+    }
+
+    if ((cell == NULL) || (cell[0] == 0))
+       cell = local_cell;
+
+    strcpy(cellconfig->name, cell);
+
+    /* No way of figuring this out as far as I can tell */
+    linkedcell[0] = '\0';
+
+    /* Initialize server info */
+    cellconfig->numServers = 0;
+    cellconfig->hostName[0][0] = "\0";
+
+    /*
+     * Get servers of cell. cm_SearchCellFile_CallBack() gets call with
+     * each server.
+     */
+#ifdef PRE_AFS35
+    status = (int) cm_SearchCellFile(cell, &cm_SearchCellFile_CallBack,
+#else
+    status = (int) cm_SearchCellFile(cell, NULL, &cm_SearchCellFile_CallBack,
+#endif
+                                    cellconfig /* rock */);
+
+    switch(status) {
+    case 0:
+       break;
+
+    case -1:
+       sprintf(msgbuf, "%s: GetWindowsDirectory() failed.\n", progname);
+       break;
+
+    case -2:
+       sprintf(msgbuf, "%s: Couldn't open afsdcells.ini for reading\n",
+               progname);
+       break;
+
+    case -3:
+       sprintf(msgbuf, "%s: Couldn't find any servers for cell %s\n",
+               progname, cell);
+       break;
+
+    case -4:
+       sprintf(msgbuf, "%s: Badly formatted line in afsdcells.ini (does not begin with a \">\" or contain \"#\"\n",
+               progname);
+       break;
+
+    default:
+       sprintf(msgbuf, "%s cm_SearchCellFile returned unknown error %d\n",
+               status);
+    }
+
+    if (status) {
+       params.pstderr(msgbuf);
+       params.exitprog(AKLOG_AFS);
+    }
+
+    status = AKLOG_SUCCESS;
+
+    
+#endif /* WINDOWS */
+
+    return(status);
+}
+
+
+#ifdef WINDOWS
+/*
+ * Callback function for cm_SearchCellFile() in get_cellconfig() above.
+ * This function gets called once for each server that is found for the cell.
+ */
+static long
+cm_SearchCellFile_CallBack(void *rock /* cellconfig */,
+                          struct sockaddr_in *addr, /* Not used */
+                          char *server)
+{
+    struct afsconf_cell *cellconfig = rock;
+
+
+    /*
+     * Save server name and increment count of servers
+     */
+    strcpy(cellconfig->hostName[cellconfig->numServers++], server);
+    
+    return (long) 0;
+}
+
+    
+#endif /* WINDOWS */
+
+
+/* 
+ * Log to a cell.  If the cell has already been logged to, return without
+ * doing anything.  Otherwise, log to it and mark that it has been logged
+ * to.
+ */
+#ifdef __STDC__
+static int auth_to_cell(krb5_context context, char *cell, char *realm)
+#else
+static int auth_to_cell(context, cell, realm)
+
+  krb5_context context;
+  char *cell;
+  char *realm;
+#endif /* __STDC__ */
+{
+    int status = AKLOG_SUCCESS;
+    char username[BUFSIZ];     /* To hold client username structure */
+    long viceId;               /* AFS uid of user */
+
+    char name[ANAME_SZ];       /* Name of afs key */
+    char primary_instance[INST_SZ];    /* Instance of afs key */
+    char secondary_instance[INST_SZ];  /* Backup instance to try */
+    int try_secondary = 0;             /* Flag to indicate if we try second */
+    char realm_of_user[REALM_SZ]; /* Kerberos realm of user */
+    char realm_of_cell[REALM_SZ]; /* Kerberos realm of cell */
+    char local_cell[MAXCELLCHARS+1];
+    char cell_to_use[MAXCELLCHARS+1]; /* Cell to authenticate to */
+    static char lastcell[MAXCELLCHARS+1] = { 0 };
+#ifndef WINDOWS
+    static char confname[512] = { 0 };
+#endif
+    krb5_creds *v5cred = NULL;
+    CREDENTIALS c;
+    struct ktc_principal aserver;
+    struct ktc_principal aclient;
+    struct ktc_token atoken, btoken;
+
+#ifdef ALLOW_REGISTER
+    afs_int32 id;
+#endif /* ALLOW_REGISTER */
+
+    memset(name, 0, sizeof(name));
+    memset(primary_instance, 0, sizeof(primary_instance));
+    memset(secondary_instance, 0, sizeof(secondary_instance));
+    memset(realm_of_user, 0, sizeof(realm_of_user));
+    memset(realm_of_cell, 0, sizeof(realm_of_cell));
+
+#ifndef WINDOWS
+    if (confname[0] == '\0') {
+       strncpy(confname, AFSDIR_CLIENT_ETC_DIRPATH, sizeof(confname));
+       confname[sizeof(confname) - 2] = '\0';
+    }
+#endif /* WINDOWS */
+
+    /* NULL or empty cell returns information on local cell */
+    if ((status = get_cellconfig(cell, &ak_cellconfig,
+                        local_cell, linkedcell)))
+       return(status);
+
+    strncpy(cell_to_use, ak_cellconfig.name, MAXCELLCHARS);
+    cell_to_use[MAXCELLCHARS] = 0;
+
+    if (ll_string(&authedcells, ll_s_check, cell_to_use)) {
+       if (dflag) {
+           sprintf(msgbuf, "Already authenticated to %s (or tried to)\n", 
+                   cell_to_use);
+           params.pstdout(msgbuf);
+       }
+       return(AKLOG_SUCCESS);
+    }
+
+    /* 
+     * Record that we have attempted to log to this cell.  We do this
+     * before we try rather than after so that we will not try
+     * and fail repeatedly for one cell.
+     */
+    (void)ll_string(&authedcells, ll_s_add, cell_to_use);
+
+    /* 
+     * Record this cell in the list of zephyr subscriptions.  We may
+     * want zephyr subscriptions even if authentication fails.
+     * If this is done after we attempt to get tokens, aklog -zsubs
+     * can return something different depending on whether or not we
+     * are in -noauth mode.
+     */
+    if (ll_string(&zsublist, ll_s_add, cell_to_use) == LL_FAILURE) {
+       sprintf(msgbuf, 
+               "%s: failure adding cell %s to zephyr subscriptions list.\n",
+               progname, cell_to_use);
+       params.pstderr(msgbuf);
+       params.exitprog(AKLOG_MISC);
+    }
+    if (ll_string(&zsublist, ll_s_add, local_cell) == LL_FAILURE) {
+       sprintf(msgbuf, 
+               "%s: failure adding cell %s to zephyr subscriptions list.\n",
+               progname, local_cell);
+       params.pstderr(msgbuf);
+       params.exitprog(AKLOG_MISC);
+    }
+
+    if (!noauth) {
+       if (dflag) {
+           sprintf(msgbuf, "Authenticating to cell %s (server %s).\n",
+                   cell_to_use, ak_cellconfig.hostName[0]);
+           params.pstdout(msgbuf);
+       }
+
+       /*
+        * Find out which realm we're supposed to authenticate to.  If one
+        * is not included, use the kerberos realm found in the credentials
+        * cache.
+        */
+
+       if (realm && realm[0]) {
+           strcpy(realm_of_cell, realm);
+           if (dflag) {
+               sprintf(msgbuf, "We were told to authenticate to realm %s.\n",
+                       realm);
+               params.pstdout(msgbuf);
+           }
+       }
+       else {
+           char *realm = afs_realm_of_cell(context, &ak_cellconfig);
+
+           if (!realm) {
+               sprintf(msgbuf, 
+                       "%s: Couldn't figure out realm for cell %s.\n",
+                       progname, cell_to_use);
+               params.pstderr(msgbuf);
+               params.exitprog(AKLOG_MISC);
+           }
+
+           strcpy(realm_of_cell, realm);
+
+           if (dflag) {
+               sprintf(msgbuf, "We've deduced that we need to authenticate to"
+                       " realm %s.\n", realm_of_cell);
+               params.pstdout(msgbuf);
+           }
+       }
+
+       /* We use the afs.<cellname> convention here... 
+        *
+        * Doug Engert's original code had principals of the form:
+        *
+        * "afsx/cell@realm"
+        *
+        * in the KDC, so the name wouldn't conflict with DFS.  Since we're
+        * not using DFS, I changed it just to look for the following
+        * principals:
+        *
+        * afs/<cell>@<realm>
+        * afs@<realm>
+        *
+        * Because people are transitioning from afs@realm to afs/cell,
+        * we configure things so that if the first one isn't found, we
+        * try the second one.  You can select which one you prefer with
+        * a configure option.
+        */
+
+       strcpy(name, AFSKEY);
+
+       if (AFS_TRY_FULL_PRINC || strcasecmp(cell_to_use, realm_of_cell) != 0) {
+           strncpy(primary_instance, cell_to_use, sizeof(primary_instance));
+           primary_instance[sizeof(primary_instance)-1] = '\0';
+           if (strcasecmp(cell_to_use, realm_of_cell) == 0) {
+               try_secondary = 1;
+               secondary_instance[0] = '\0';
+           }
+       } else {
+           primary_instance[0] = '\0';
+           try_secondary = 1;
+           strncpy(secondary_instance, cell_to_use,
+                   sizeof(secondary_instance));
+           secondary_instance[sizeof(secondary_instance)-1] = '\0';
+       }
+
+       /* 
+        * Extract the session key from the ticket file and hand-frob an
+        * afs style authenticator.
+        */
+
+       /*
+        * Try to obtain AFS tickets.  Because there are two valid service
+        * names, we will try both, but trying the more specific first.
+        *
+        *      afs/<cell>@<realm> i.e. allow for single name with "."
+        *      afs@<realm>
+        */
+#if 0
+       if (dflag) {
+               dee_gettokens(); /* DEBUG */
+       }
+#endif
+
+       if (dflag) {
+           sprintf(msgbuf, "Getting tickets: %s/%s@%s\n", name,
+                   primary_instance, realm_of_cell);
+           params.pstdout(msgbuf);
+       }
+
+       status = params.get_cred(context, name, primary_instance, realm_of_cell,
+                        &c, &v5cred);
+
+       if (status == KRB5KDC_ERR_S_PRINCIPAL_UNKNOWN) {
+           if (try_secondary) {
+               if (dflag) {
+                   sprintf(msgbuf, "Principal not found, trying alternate "
+                           "service name: %s/%s@%s\n", name,
+                           secondary_instance, realm_of_cell);
+                   params.pstdout(msgbuf);
+               }
+               status = params.get_cred(context, name, secondary_instance,
+                                        realm_of_cell, &c, &v5cred);
+           }
+       }
+
+       if (status != KSUCCESS) {
+           if (dflag) {
+               sprintf(msgbuf, 
+                       "Kerberos error code returned by get_cred: %d\n",
+                       status);
+               params.pstdout(msgbuf);
+           }
+           sprintf(msgbuf, "%s: Couldn't get %s AFS tickets:\n",
+                   progname, cell_to_use);
+           params.pstderr(msgbuf);
+               com_err(progname, status, "while getting AFS tickets");
+           return(AKLOG_KERBEROS);
+       }
+
+       strncpy(aserver.name, AFSKEY, MAXKTCNAMELEN - 1);
+       strncpy(aserver.instance, AFSINST, MAXKTCNAMELEN - 1);
+       strncpy(aserver.cell, cell_to_use, MAXKTCREALMLEN - 1);
+
+       strcpy (username, c.pname);
+       if (c.pinst[0]) {
+           strcat (username, ".");
+           strcat (username, c.pinst);
+       }
+
+       atoken.kvno = c.kvno;
+       atoken.startTime = c.issue_date;
+       /*
+        * It seems silly to go through a bunch of contortions to
+        * extract the expiration time, when the v5 credentials already
+        * has the exact time!  Let's use that instead.
+        *
+        * Note that this isn't a security hole, as the expiration time
+        * is also contained in the encrypted token
+        */
+       atoken.endTime = v5cred->times.endtime;
+       memcpy(&atoken.sessionKey, c.session, 8);
+       atoken.ticketLen = c.ticket_st.length;
+       memcpy(atoken.ticket, c.ticket_st.dat, atoken.ticketLen);
+       
+       if (!force &&
+           !ktc_GetToken(&aserver, &btoken, sizeof(btoken), &aclient) &&
+           atoken.kvno == btoken.kvno &&
+           atoken.ticketLen == btoken.ticketLen &&
+           !memcmp(&atoken.sessionKey, &btoken.sessionKey, sizeof(atoken.sessionKey)) &&
+           !memcmp(atoken.ticket, btoken.ticket, atoken.ticketLen)) {
+
+           if (dflag) {
+               sprintf(msgbuf, "Identical tokens already exist; skipping.\n");
+               params.pstdout(msgbuf);
+           }
+           return 0;
+       }
+
+#ifdef FORCE_NOPRDB
+       noprdb = 1;
+#endif
+
+#ifndef WINDOWS
+       if (noprdb) {
+#endif
+           if (dflag) {
+               sprintf(msgbuf, "Not resolving name %s to id (-noprdb set)\n",
+                       username);
+               params.pstdout(msgbuf);
+           }
+#ifndef WINDOWS
+       }
+       else {
+           if ((status = params.get_user_realm(context, realm_of_user)) != KSUCCESS) {
+               sprintf(msgbuf, "%s: Couldn't determine realm of user:)",
+                       progname);
+               params.pstderr(msgbuf);
+               com_err(progname, status, " while getting realm");
+               return(AKLOG_KERBEROS);
+           }
+           if (strcmp(realm_of_user, realm_of_cell)) {
+               strcat(username, "@");
+               strcat(username, realm_of_user);
+           }
+
+           if (dflag) {
+               sprintf(msgbuf, "About to resolve name %s to id in cell %s.\n", 
+                       username, aserver.cell);
+               params.pstdout(msgbuf);
+           }
+
+           /*
+            * Talk about DUMB!  It turns out that there is a bug in
+            * pr_Initialize -- even if you give a different cell name
+            * to it, it still uses a connection to a previous AFS server
+            * if one exists.  The way to fix this is to change the
+            * _filename_ argument to pr_Initialize - that forces it to
+            * re-initialize the connection.  We do this by adding and
+            * removing a "/" on the end of the configuration directory name.
+            */
+
+           if (lastcell[0] != '\0' && (strcmp(lastcell, aserver.cell) != 0)) {
+               int i = strlen(confname);
+               if (confname[i - 1] == '/') {
+                   confname[i - 1] = '\0';
+               } else {
+                   confname[i] = '/';
+                   confname[i + 1] = '\0';
+               }
+           }
+
+           strcpy(lastcell, aserver.cell);
+
+           if (!pr_Initialize (0, confname, aserver.cell, 0))
+                   status = pr_SNameToId (username, &viceId);
+           
+           if (dflag) {
+               if (status) 
+                   sprintf(msgbuf, "Error %d\n", status);
+               else
+                   sprintf(msgbuf, "Id %d\n", (int) viceId);
+               params.pstdout(msgbuf);
+           }
+           
+               /*
+                * This is a crock, but it is Transarc's crock, so
+                * we have to play along in order to get the
+                * functionality.  The way the afs id is stored is
+                * as a string in the username field of the token.
+                * Contrary to what you may think by looking at
+                * the code for tokens, this hack (AFS ID %d) will
+                * not work if you change %d to something else.
+                */
+
+               /*
+                * This code is taken from cklog -- it lets people
+                * automatically register with the ptserver in foreign cells
+                */
+
+#ifdef ALLOW_REGISTER
+       if (status == 0) {
+           if (viceId != ANONYMOUSID) {
+#else /* ALLOW_REGISTER */
+           if ((status == 0) && (viceId != ANONYMOUSID))
+#endif /* ALLOW_REGISTER */
+               sprintf (username, "AFS ID %d", (int) viceId);
+#ifdef ALLOW_REGISTER
+           } else if (strcmp(realm_of_user, realm_of_cell) != 0) {
+               if (dflag) {
+                   sprintf(msgbuf, "doing first-time registration of %s "
+                           "at %s\n", username, cell_to_use);
+                   params.pstdout(msgbuf);
+               }
+               id = 0;
+               strncpy(aclient.name, username, MAXKTCNAMELEN - 1);
+               strcpy(aclient.instance, "");
+               strncpy(aclient.cell, c.realm, MAXKTCREALMLEN - 1);
+               if ((status = ktc_SetToken(&aserver, &atoken, &aclient, 0))) {
+                   sprintf(msgbuf, "%s: unable to obtain tokens for cell %s "
+                           "(status: %d).\n", progname, cell_to_use, status);
+                   params.pstderr(msgbuf);
+                   status = AKLOG_TOKEN;
+               }
+
+               /*
+                * In case you're wondering, we don't need to change the
+                * filename here because we're still connecting to the
+                * same cell -- we're just using a different authentication
+                * level
+                */
+
+               if ((status = pr_Initialize(1L, confname, aserver.cell, 0))) {
+                   sprintf(msgbuf, "Error %d\n", status);
+                   params.pstdout(msgbuf);
+               }
+
+               if ((status = pr_CreateUser(username, &id))) {
+                   sprintf(msgbuf, "%s: %s so unable to create remote PTS "
+                           "user %s in cell %s (status: %d).\n", progname,
+                           error_message(status), username, cell_to_use,
+                           status);
+                   params.pstdout(msgbuf);
+               } else {
+                   sprintf(msgbuf, "created cross-cell entry for %s at %s\n",
+                           username, cell_to_use);
+                   params.pstdout(msgbuf);
+                   sprintf(username, "AFS ID %d", (int) id);
+               }
+           }
+       }
+#endif /* ALLOW_REGISTER */
+
+       }
+#endif /* !WINDOWS */
+
+       if (dflag) {
+           sprintf(msgbuf, "Set username to %s\n", username);
+           params.pstdout(msgbuf);
+       }
+
+       /* Reset the "aclient" structure before we call ktc_SetToken.
+        * This structure was first set by the ktc_GetToken call when
+        * we were comparing whether identical tokens already existed.
+        */
+       strncpy(aclient.name, username, MAXKTCNAMELEN - 1);
+       strcpy(aclient.instance, "");
+       strncpy(aclient.cell, c.realm, MAXKTCREALMLEN - 1);
+
+       if (dflag) {
+           sprintf(msgbuf, "Setting tokens. %s / %s @ %s \n",
+                       aclient.name, aclient.instance, aclient.cell );
+           params.pstdout(msgbuf);
+       }
+       /* on AIX 4.1.4 with AFS 3.4a+ if a write is not done before 
+        * this routine, it will not add the token. It is not clear what 
+        * is going on here! So we will do the following operation
+        */
+       write(2,"",0); /* dummy write */
+#ifndef WINDOWS
+       if ((status = ktc_SetToken(&aserver, &atoken, &aclient, afssetpag))) {
+           sprintf(msgbuf, 
+                   "%s: unable to obtain tokens for cell %s (status: %d).\n",
+                   progname, cell_to_use, status);
+           params.pstderr(msgbuf);
+           status = AKLOG_TOKEN;
+       }
+#else /* WINDOWS */
+       /* Note switched 2nd and 3rd args */
+#ifdef PRE_AFS35
+       if ((status = ktc_SetToken(&aserver, &aclient, &atoken, afssetpag))) {
+#else
+       if ((status = ktc_SetToken(&aserver, &atoken, &aclient, afssetpag))) {
+#endif
+           switch(status) {
+           case KTC_INVAL:
+               sprintf(msgbuf, "%s: Bad ticket length", progname);
+               break;
+           case KTC_PIOCTLFAIL:
+               sprintf(msgbuf, "%s: Unknown error contacting AFS service",
+                       progname);
+               break;
+           case KTC_NOCELL:
+               sprintf(msgbuf, "%s: Cell name (%s) not recognized by AFS service",
+                       progname, realm_of_cell);
+               break;
+           case KTC_NOCM:
+               sprintf(msgbuf, "%s: AFS service is unavailable", progname);
+               break;
+           default:
+               sprintf(msgbuf, "%s: Undocumented error (%d) contacting AFS service", progname, status);
+               break;  
+           }
+           params.pstderr(msgbuf);
+           status = AKLOG_TOKEN;           
+       }
+#endif /* !WINDOWS */
+    }
+    else
+       if (dflag) {
+           sprintf(msgbuf, "Noauth mode; not authenticating.\n");
+           params.pstdout(msgbuf);
+       }
+       
+    return(status);
+}
+
+#ifndef WINDOWS /* struct ViceIoctl missing */
+
+#ifdef __STDC__
+static int get_afs_mountpoint(char *file, char *mountpoint, int size)
+#else
+static int get_afs_mountpoint(file, mountpoint, size)
+  char *file;
+  char *mountpoint;
+  int size;
+#endif /* __STDC__ */
+{
+#ifdef AFS_SUN_ENV
+       char V ='V'; /* AFS has problem on Sun with pioctl */
+#endif
+    char our_file[MAXPATHLEN + 1];
+    char *parent_dir;
+    char *last_component;
+    struct ViceIoctl vio;
+    char cellname[BUFSIZ];
+
+    memset(our_file, 0, sizeof(our_file));
+    strcpy(our_file, file);
+
+    if ((last_component = strrchr(our_file, DIR))) {
+       *last_component++ = 0;
+       parent_dir = our_file;
+    }
+    else {
+       last_component = our_file;
+       parent_dir = ".";
+    }    
+    
+    memset(cellname, 0, sizeof(cellname));
+
+    vio.in = last_component;
+    vio.in_size = strlen(last_component)+1;
+    vio.out_size = size;
+    vio.out = mountpoint;
+
+    if (!pioctl(parent_dir, VIOC_AFS_STAT_MT_PT, &vio, 0)) {
+       if (strchr(mountpoint, VOLMARKER) == NULL) {
+           vio.in = file;
+           vio.in_size = strlen(file) + 1;
+           vio.out_size = sizeof(cellname);
+           vio.out = cellname;
+           
+           if (!pioctl(file, VIOC_FILE_CELL_NAME, &vio, 1)) {
+               strcat(cellname, VOLMARKERSTRING);
+               strcat(cellname, mountpoint + 1);
+               memset(mountpoint + 1, 0, size - 1);
+               strcpy(mountpoint + 1, cellname);
+           }
+       }
+       return(TRUE);
+    }
+    else
+       return(FALSE);
+}
+
+/* 
+ * This routine each time it is called returns the next directory 
+ * down a pathname.  It resolves all symbolic links.  The first time
+ * it is called, it should be called with the name of the path
+ * to be descended.  After that, it should be called with the arguemnt
+ * NULL.
+ */
+#ifdef __STDC__
+static char *next_path(char *origpath)
+#else
+static char *next_path(origpath)
+  char *origpath;
+#endif /* __STDC__ */
+{
+    static char path[MAXPATHLEN + 1];
+    static char pathtocheck[MAXPATHLEN + 1];
+
+    int link = FALSE;          /* Is this a symbolic link? */
+    char linkbuf[MAXPATHLEN + 1];
+    char tmpbuf[MAXPATHLEN + 1];
+
+    static char *last_comp;    /* last component of directory name */
+    static char *elast_comp;   /* End of last component */
+    char *t;
+    int len;
+    
+    static int symlinkcount = 0; /* We can't exceed MAXSYMLINKS */
+    
+    /* If we are given something for origpath, we are initializing only. */
+    if (origpath) {
+       memset(path, 0, sizeof(path));
+       memset(pathtocheck, 0, sizeof(pathtocheck));
+       strcpy(path, origpath);
+       last_comp = path;
+       symlinkcount = 0;
+       return(NULL);
+    }
+
+    /* We were not given origpath; find then next path to check */
+    
+    /* If we've gotten all the way through already, return NULL */
+    if (last_comp == NULL)
+       return(NULL);
+
+    do {
+       while (*last_comp == DIR)
+           strncat(pathtocheck, last_comp++, 1);
+       len = (elast_comp = strchr(last_comp, DIR)) 
+           ? elast_comp - last_comp : strlen(last_comp);
+       strncat(pathtocheck, last_comp, len);
+       memset(linkbuf, 0, sizeof(linkbuf));
+       if ((link = (params.readlink(pathtocheck, linkbuf, 
+                                   sizeof(linkbuf)) > 0))) {
+           if (++symlinkcount > MAXSYMLINKS) {
+               sprintf(msgbuf, "%s: %s\n", progname, strerror(ELOOP));
+               params.pstderr(msgbuf);
+               params.exitprog(AKLOG_BADPATH);
+           }
+           memset(tmpbuf, 0, sizeof(tmpbuf));
+           if (elast_comp)
+               strcpy(tmpbuf, elast_comp);
+           if (linkbuf[0] == DIR) {
+               /* 
+                * If this is a symbolic link to an absolute path, 
+                * replace what we have by the absolute path.
+                */
+               memset(path, 0, strlen(path));
+               memcpy(path, linkbuf, sizeof(linkbuf));
+               strcat(path, tmpbuf);
+               last_comp = path;
+               elast_comp = NULL;
+               memset(pathtocheck, 0, sizeof(pathtocheck));
+           }
+           else {
+               /* 
+                * If this is a symbolic link to a relative path, 
+                * replace only the last component with the link name.
+                */
+               strncpy(last_comp, linkbuf, strlen(linkbuf) + 1);
+               strcat(path, tmpbuf);
+               elast_comp = NULL;
+               if ((t = strrchr(pathtocheck, DIR))) {
+                   t++;
+                   memset(t, 0, strlen(t));
+               }
+               else
+                   memset(pathtocheck, 0, sizeof(pathtocheck));
+           }
+       }
+       else
+           last_comp = elast_comp;
+    }
+    while(link);
+
+    return(pathtocheck);
+}
+
+#endif /* WINDOWS */
+
+#if 0
+/*****************************************/
+int dee_gettokens()
+{
+#ifdef AFS_SUN_ENV
+       char V = 'V'; /* AFS has problem on SunOS */
+#endif
+   struct ViceIoctl vio;
+   char outbuf[BUFSIZ];
+   long ind;
+   int fd;
+
+   memset(outbuf, 0, sizeof(outbuf));
+
+   vio.out_size = sizeof(outbuf);
+   vio.in_size = sizeof(ind);
+   vio.out = outbuf;
+   vio.in = &ind;
+
+   ind = 0;
+   fd = open("dee.tok",O_WRONLY);
+   while(!pioctl(0,VIOCGETTOK,&vio,0)) {
+       write(fd,&outbuf,sizeof(outbuf)); 
+       ind++;
+   }
+   close(fd);
+}
+/*****************************************/
+#endif
+
+#ifndef WINDOWS /* struct ViceIoctl missing */
+
+#ifdef __STDC__
+static void add_hosts(char *file)
+#else
+static void add_hosts(file)
+  char *file;
+#endif /* __STDC__ */
+{
+#ifdef AFS_SUN_ENV
+       char V = 'V'; /* AFS has problem on SunOS */
+#endif
+    struct ViceIoctl vio;
+    char outbuf[BUFSIZ];
+    long *phosts;
+    int i;
+    struct hostent *hp;
+    struct in_addr in;
+    
+    memset(outbuf, 0, sizeof(outbuf));
+
+    vio.out_size = sizeof(outbuf);
+    vio.in_size = 0;
+    vio.out = outbuf;
+
+    if (dflag) {
+       sprintf(msgbuf, "Getting list of hosts for %s\n", file);
+       params.pstdout(msgbuf);
+    }
+    /* Don't worry about errors. */
+    if (!pioctl(file, VIOCWHEREIS, &vio, 1)) {
+       phosts = (long *) outbuf;
+
+       /*
+        * Lists hosts that we care about.  If ALLHOSTS is defined,
+        * then all hosts that you ever may possible go through are
+        * included in this list.  If not, then only hosts that are
+        * the only ones appear.  That is, if a volume you must use
+        * is replaced on only one server, that server is included.
+        * If it is replicated on many servers, then none are included.
+        * This is not perfect, but the result is that people don't
+        * get subscribed to a lot of instances of FILSRV that they
+        * probably won't need which reduces the instances of 
+        * people getting messages that don't apply to them.
+        */
+#ifndef ALLHOSTS
+       if (phosts[1] != '\0')
+           return;
+#endif
+       for (i = 0; phosts[i]; i++) {
+           if (hosts) {
+               in.s_addr = phosts[i];
+               if (dflag) {
+                   sprintf(msgbuf, "Got host %s\n", inet_ntoa(in));
+                   params.pstdout(msgbuf);
+               }
+               ll_string(&hostlist, ll_s_add, (char *)inet_ntoa(in));
+           }
+           if (zsubs && (hp=gethostbyaddr((char *) &phosts[i],sizeof(long),AF_INET))) {
+               if (dflag) {
+                   sprintf(msgbuf, "Got host %s\n", hp->h_name);
+                   params.pstdout(msgbuf);
+               }
+               ll_string(&zsublist, ll_s_add, hp->h_name);
+           }
+       }
+    }
+}
+
+#endif /* WINDOWS */
+
+#ifndef WINDOWS /* next_path(), get_afs_mountpoint() */
+
+/*
+ * This routine descends through a path to a directory, logging to 
+ * every cell it encounters along the way.
+ */
+#ifdef __STDC__
+static int auth_to_path(krb5_context context, char *path)
+#else
+static int auth_to_path(context, path)
+  krb5_context context;
+  char *path;                  /* The path to which we try to authenticate */
+#endif /* __STDC__ */
+{
+    int status = AKLOG_SUCCESS;
+    int auth_to_cell_status = AKLOG_SUCCESS;
+
+    char *nextpath;
+    char pathtocheck[MAXPATHLEN + 1];
+    char mountpoint[MAXPATHLEN + 1];
+
+    char *cell;
+    char *endofcell;
+
+    u_char isdir;
+
+    /* Initialize */
+    if (path[0] == DIR)
+       strcpy(pathtocheck, path);
+    else {
+       if (params.getwd(pathtocheck) == NULL) {
+           sprintf(msgbuf, "Unable to find current working directory:\n");
+           params.pstderr(msgbuf);
+           sprintf(msgbuf, "%s\n", pathtocheck);
+           params.pstderr(msgbuf);
+           sprintf(msgbuf, "Try an absolute pathname.\n");
+           params.pstderr(msgbuf);
+           params.exitprog(AKLOG_BADPATH);
+       }
+       else {
+           strcat(pathtocheck, DIRSTRING);
+           strcat(pathtocheck, path);
+       }
+    }
+    next_path(pathtocheck);
+
+    /* Go on to the next level down the path */
+    while ((nextpath = next_path(NULL))) {
+       strcpy(pathtocheck, nextpath);
+       if (dflag) {
+           sprintf(msgbuf, "Checking directory %s\n", pathtocheck);
+           params.pstdout(msgbuf);
+       }
+       /* 
+        * If this is an afs mountpoint, determine what cell from 
+        * the mountpoint name which is of the form 
+        * #cellname:volumename or %cellname:volumename.
+        */
+       if (get_afs_mountpoint(pathtocheck, mountpoint, sizeof(mountpoint))) {
+           /* skip over the '#' or '%' */
+           cell = mountpoint + 1;
+           /* Add this (cell:volumename) to the list of zsubs */
+           if (zsubs)
+               ll_string(&zsublist, ll_s_add, cell);
+           if (zsubs || hosts)
+               add_hosts(pathtocheck);
+           if ((endofcell = strchr(mountpoint, VOLMARKER))) {
+               *endofcell = '\0';
+               if ((auth_to_cell_status = auth_to_cell(context, cell, NULL))) {
+                   if (status == AKLOG_SUCCESS)
+                       status = auth_to_cell_status;
+                   else if (status != auth_to_cell_status)
+                       status = AKLOG_SOMETHINGSWRONG;
+               }
+           }
+       }
+       else {
+           if (params.isdir(pathtocheck, &isdir) < 0) {
+               /*
+                * If we've logged and still can't stat, there's
+                * a problem... 
+                */
+               sprintf(msgbuf, "%s: stat(%s): %s\n", progname, 
+                       pathtocheck, strerror(errno));
+               params.pstderr(msgbuf);
+               return(AKLOG_BADPATH);
+           }
+           else if (! isdir) {
+               /* Allow only directories */
+               sprintf(msgbuf, "%s: %s: %s\n", progname, pathtocheck,
+                       strerror(ENOTDIR));
+               params.pstderr(msgbuf);
+               return(AKLOG_BADPATH);
+           }
+       }
+    }
+    
+
+    return(status);
+}
+
+#endif /* WINDOWS */
+
+
+/* Print usage message and exit */
+#ifdef __STDC__
+static void usage(void)
+#else
+static void usage()
+#endif /* __STDC__ */
+{
+    sprintf(msgbuf, "\nUsage: %s %s%s%s\n", progname,
+           "[-d] [[-cell | -c] cell [-k krb_realm]] ",
+           "[[-p | -path] pathname]\n",
+           "    [-zsubs] [-hosts] [-noauth] [-noprdb] [-force] [-setpag] [-linked]\n");
+    params.pstderr(msgbuf);
+    sprintf(msgbuf, "    -d gives debugging information.\n");
+    params.pstderr(msgbuf);
+    sprintf(msgbuf, "    krb_realm is the kerberos realm of a cell.\n");
+    params.pstderr(msgbuf);
+    sprintf(msgbuf, "    pathname is the name of a directory to which ");
+    params.pstderr(msgbuf);
+    sprintf(msgbuf, "you wish to authenticate.\n");
+    params.pstderr(msgbuf);
+    sprintf(msgbuf, "    -zsubs gives zephyr subscription information.\n");
+    params.pstderr(msgbuf);
+    sprintf(msgbuf, "    -hosts gives host address information.\n");
+    params.pstderr(msgbuf);
+    sprintf(msgbuf, "    -noauth does not attempt to get tokens.\n");
+    params.pstderr(msgbuf);
+    sprintf(msgbuf, "    -noprdb means don't try to determine AFS ID.\n");
+    params.pstderr(msgbuf);
+    sprintf(msgbuf, "    -force means replace identical tickets. \n");
+    params.pstderr(msgbuf);
+    sprintf(msgbuf, "    -linked means if AFS node is linked, try both. \n");
+    params.pstderr(msgbuf);
+    sprintf(msgbuf, "    -setpag set the AFS process authentication group.\n");
+    params.pstderr(msgbuf);
+    sprintf(msgbuf, "    No commandline arguments means ");
+    params.pstderr(msgbuf);
+    sprintf(msgbuf, "authenticate to the local cell.\n");
+    params.pstderr(msgbuf);
+    sprintf(msgbuf, "\n");
+    params.pstderr(msgbuf);
+    params.exitprog(AKLOG_USAGE);
+}
+
+#ifdef __STDC__
+void aklog(int argc, char *argv[], aklog_params *a_params)
+#else
+void aklog(argc, argv, a_params)
+  int argc;
+  char *argv[];
+  aklog_params *a_params;
+#endif /* __STDC__ */
+{
+       krb5_context context;
+    int status = AKLOG_SUCCESS;
+    int i;
+    int somethingswrong = FALSE;
+
+    cellinfo_t cellinfo;
+
+    extern char *progname;     /* Name of this program */
+
+    extern int dflag;          /* Debug mode */
+
+    int cmode = FALSE;         /* Cellname mode */
+    int pmode = FALSE;         /* Path name mode */
+
+    char realm[REALM_SZ];      /* Kerberos realm of afs server */
+    char cell[BUFSIZ];         /* Cell to which we are authenticating */
+    char path[MAXPATHLEN + 1];         /* Path length for path mode */
+
+    linked_list cells;         /* List of cells to log to */
+    linked_list paths;         /* List of paths to log to */
+    ll_node *cur_node;
+
+    memset(&cellinfo, 0, sizeof(cellinfo));
+
+    memset(realm, 0, sizeof(realm));
+    memset(cell, 0, sizeof(cell));
+    memset(path, 0, sizeof(path));
+
+    ll_init(&cells);
+    ll_init(&paths);
+
+    ll_init(&zsublist);
+    ll_init(&hostlist);
+
+    /* Store the program name here for error messages */
+    if ((progname = strrchr(argv[0], DIR)))
+       progname++;
+    else
+       progname = argv[0];
+
+    krb5_init_context(&context);
+#ifndef WINDOWS
+       initialize_ktc_error_table ();
+#endif
+
+    memcpy((char *)&params, (char *)a_params, sizeof(aklog_params));
+
+    /* Initialize list of cells to which we have authenticated */
+    (void)ll_init(&authedcells);
+
+    /* Parse commandline arguments and make list of what to do. */
+    for (i = 1; i < argc; i++) {
+       if (strcmp(argv[i], "-d") == 0)
+           dflag++;
+       else if (strcmp(argv[i], "-noauth") == 0) 
+           noauth++;
+       else if (strcmp(argv[i], "-zsubs") == 0)
+           zsubs++;
+       else if (strcmp(argv[i], "-hosts") == 0)
+           hosts++;
+       else if (strcmp(argv[i], "-noprdb") == 0)
+           noprdb++;
+       else if (strcmp(argv[i], "-linked") == 0)
+               linked++;
+       else if (strcmp(argv[i], "-force") == 0)
+           force++;
+    else if (strcmp(argv[i], "-setpag") == 0)
+           afssetpag++;
+       else if (((strcmp(argv[i], "-cell") == 0) ||
+                 (strcmp(argv[i], "-c") == 0)) && !pmode)
+           if (++i < argc) {
+               cmode++;
+               strcpy(cell, argv[i]);
+           }
+           else
+               usage();
+       else if (((strcmp(argv[i], "-path") == 0) ||
+                 (strcmp(argv[i], "-p") == 0)) && !cmode)
+#ifndef WINDOWS
+           if (++i < argc) {
+               pmode++;
+               strcpy(path, argv[i]);
+           }
+           else
+               usage();
+#else /* WINDOWS */
+       {
+           sprintf(msgbuf, "%s: path mode not supported.\n", progname);
+           params.pstderr(msgbuf);
+           params.exitprog(AKLOG_MISC);
+       }
+#endif /* WINDOWS */
+           
+       else if (argv[i][0] == '-')
+           usage();
+       else if (!pmode && !cmode) {
+           if (strchr(argv[i], DIR) || (strcmp(argv[i], ".") == 0) ||
+               (strcmp(argv[i], "..") == 0)) {
+#ifndef WINDOWS
+               pmode++;
+               strcpy(path, argv[i]);
+#else /* WINDOWS */
+               sprintf(msgbuf, "%s: path mode not supported.\n", progname);
+               params.pstderr(msgbuf);
+               params.exitprog(AKLOG_MISC);
+#endif /* WINDOWS */
+           }
+           else { 
+               cmode++;
+               strcpy(cell, argv[i]);
+           }
+       }
+       else
+           usage();
+
+       if (cmode) {
+           if (((i + 1) < argc) && (strcmp(argv[i + 1], "-k") == 0)) {
+               i+=2;
+               if (i < argc)
+                   strcpy(realm, argv[i]);
+               else
+                   usage();
+           }
+           /* Add this cell to list of cells */
+           strcpy(cellinfo.cell, cell);
+           strcpy(cellinfo.realm, realm);
+           if ((cur_node = ll_add_node(&cells, ll_tail))) {
+               char *new_cellinfo;
+               if ((new_cellinfo = copy_cellinfo(&cellinfo)))
+                   ll_add_data(cur_node, new_cellinfo);
+               else {
+                   sprintf(msgbuf, 
+                           "%s: failure copying cellinfo.\n", progname);
+                   params.pstderr(msgbuf);
+                   params.exitprog(AKLOG_MISC);
+               }
+           }
+           else {
+               sprintf(msgbuf, "%s: failure adding cell to cells list.\n",
+                       progname);
+               params.pstderr(msgbuf);
+               params.exitprog(AKLOG_MISC);
+           }
+           memset(&cellinfo, 0, sizeof(cellinfo));
+           cmode = FALSE;
+           memset(cell, 0, sizeof(cell));
+           memset(realm, 0, sizeof(realm));
+       }
+#ifndef WINDOWS
+       else if (pmode) {
+           /* Add this path to list of paths */
+           if ((cur_node = ll_add_node(&paths, ll_tail))) {
+               char *new_path; 
+               if ((new_path = copy_string(path)))
+                   ll_add_data(cur_node, new_path);
+               else {
+                   sprintf(msgbuf, "%s: failure copying path name.\n",
+                           progname);
+                   params.pstderr(msgbuf);
+                   params.exitprog(AKLOG_MISC);
+               }
+           }
+           else {
+               sprintf(msgbuf, "%s: failure adding path to paths list.\n",
+                       progname);
+               params.pstderr(msgbuf);
+               params.exitprog(AKLOG_MISC);
+           }
+           pmode = FALSE;
+           memset(path, 0, sizeof(path));
+       }
+#endif /* WINDOWS */
+    }
+
+    /*
+     * The code that _used_ to be here called setpag().  When you think
+     * about this, doing this makes no sense!  setpag() allocates a PAG
+     * only for the current process, so the token installed would have
+     * not be usable in the parent!  Since ktc_SetToken() now takes a
+     * 4th argument to control whether or not we're going to allocate
+     * a PAG (and since when you do it _that_ way, it modifies the cred
+     * structure of your parent)), why don't we use that instead?
+     */
+
+#if 0
+    if (afssetpag) {
+          status = setpag();
+          if (dflag) { 
+            int i,j;
+                int gidsetlen = 50;
+         int gidset[50];
+
+                printf("setpag %d\n",status);
+            j = getgroups(gidsetlen,gidset);
+         printf("Groups(%d):",j);
+         for (i = 0; i<j; i++) {
+           printf("%d",gidset[i]);
+           if((i+1)<j) printf(",");
+         }
+         printf("\n");
+          }
+       }
+#endif
+    /* If nothing was given, log to the local cell. */
+    if ((cells.nelements + paths.nelements) == 0) {
+               struct passwd *pwd;
+
+               status = auth_to_cell(context, NULL, NULL);
+       
+               /* If this cell is linked to a DCE cell, and user 
+                * requested -linked, get tokens for both 
+                * This is very usefull when the AFS cell is linked to a DFS 
+                * cell and this system does not also have DFS. 
+                */
+
+               if (!status && linked && linkedcell[0]) {
+                               strncpy(linkedcell2,linkedcell,MAXCELLCHARS);
+                           if (dflag) {
+                               sprintf(msgbuf, "Linked cell: %s\n",
+                                   linkedcell);
+                               params.pstdout(msgbuf);
+                           }
+                               status = auth_to_cell(context, linkedcell2, NULL);
+               }
+
+#ifndef WINDOWS
+               /*
+                * Local hack - if the person has a file in their home
+                * directory called ".xlog", read that for a list of
+                * extra cells to authenticate to
+                */
+
+               if ((pwd = getpwuid(getuid())) != NULL) {
+                   struct stat sbuf;
+                   FILE *f;
+                   char fcell[100], xlog_path[512];
+
+                   strcpy(xlog_path, pwd->pw_dir);
+                   strcat(xlog_path, "/.xlog");
+
+                   if ((stat(xlog_path, &sbuf) == 0) &&
+                       ((f = fopen(xlog_path, "r")) != NULL)) {
+
+                       if (dflag) {
+                           sprintf(msgbuf, "Reading %s for cells to "
+                                   "authenticate to.\n", xlog_path);
+                           params.pstdout(msgbuf);
+                       }
+
+                       while (fgets(fcell, 100, f) != NULL) {
+                           int auth_status;
+
+                           fcell[strlen(fcell) - 1] = '\0';
+
+                           if (dflag) {
+                               sprintf(msgbuf, "Found cell %s in %s.\n",
+                                       fcell, xlog_path);
+                               params.pstdout(msgbuf);
+                           }
+
+                           auth_status = auth_to_cell(context, fcell, NULL);
+                           if (status == AKLOG_SUCCESS)
+                               status = auth_status;
+                           else
+                               status = AKLOG_SOMETHINGSWRONG;
+                       }
+                   }
+               }
+#endif /* WINDOWS */
+       }
+    else {
+       /* Log to all cells in the cells list first */
+       for (cur_node = cells.first; cur_node; cur_node = cur_node->next) {
+           memcpy((char *)&cellinfo, cur_node->data, sizeof(cellinfo));
+           if ((status = auth_to_cell(context, cellinfo.cell, cellinfo.realm)))
+               somethingswrong++;
+               else {
+                       if (linked && linkedcell[0]) {
+                               strncpy(linkedcell2,linkedcell,MAXCELLCHARS);
+                if (dflag) {
+                    sprintf(msgbuf, "Linked cell: %s\n",
+                        linkedcell);
+                    params.pstdout(msgbuf);
+                }
+                               if ((status = auth_to_cell(context,linkedcell2,
+                                                        cellinfo.realm)))
+                               somethingswrong++;
+                       }
+               }
+       }
+       
+#ifndef WINDOWS
+       /* Then, log to all paths in the paths list */
+       for (cur_node = paths.first; cur_node; cur_node = cur_node->next) {
+           if ((status = auth_to_path(context, cur_node->data)))
+               somethingswrong++;
+       }
+#endif /* WINDOWS */
+       
+       /* 
+        * If only one thing was logged to, we'll return the status 
+        * of the single call.  Otherwise, we'll return a generic
+        * something failed status.
+        */
+       if (somethingswrong && ((cells.nelements + paths.nelements) > 1))
+           status = AKLOG_SOMETHINGSWRONG;
+    }
+
+    /* If we are keeping track of zephyr subscriptions, print them. */
+    if (zsubs) 
+       for (cur_node = zsublist.first; cur_node; cur_node = cur_node->next) {
+           sprintf(msgbuf, "zsub: %s\n", cur_node->data);
+           params.pstdout(msgbuf);
+       }
+
+    /* If we are keeping track of host information, print it. */
+    if (hosts)
+       for (cur_node = hostlist.first; cur_node; cur_node = cur_node->next) {
+           sprintf(msgbuf, "host: %s\n", cur_node->data);
+           params.pstdout(msgbuf);
+       }
+
+    params.exitprog(status);
+}
diff --git a/src/aklog/aklog_param.c b/src/aklog/aklog_param.c
new file mode 100644 (file)
index 0000000..01291e9
--- /dev/null
@@ -0,0 +1,218 @@
+/* 
+ * $Id: aklog_param.c,v 1.1.2.1 2004/12/07 05:51:24 shadow Exp $
+ * 
+ * Copyright 1990,1991 by the Massachusetts Institute of Technology
+ * For distribution and copying rights, see the file "mit-copyright.h"
+ */
+
+#if !defined(lint) && !defined(SABER)
+static char *rcsid = "$Id: aklog_param.c,v 1.1.2.1 2004/12/07 05:51:24 shadow Exp $";
+#endif /* lint || SABER */
+
+#include "aklog.h"
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <string.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef HAVE_MEMORY_H
+#include <memory.h>
+#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_MALLOC_H
+#include <malloc.h>
+#endif
+#include <kerberosIV/krb.h>
+#include <krb5.h>
+
+
+#ifndef TRUE
+#define TRUE 1
+#endif
+
+#ifndef FALSE
+#define FALSE 0
+#endif
+
+#ifndef WINDOWS
+#if !defined(HAVE_UNISTD_H) || (defined(__sun__) && ! defined(__svr4__))
+extern int readlink ARGS((char *, char *, size_t));
+#endif
+/* extern int lstat ARGS((char *, struct stat *)); */
+extern char *getwd ARGS((char *));
+#endif /* WINDOWS */
+
+static krb5_ccache  _krb425_ccache = 0;
+
+#ifndef WINDOWS                /* Don't have lstat() */
+#ifdef __STDC__
+static int isdir(char *path, unsigned char *val)
+#else
+static int isdir(path, val)
+  char *path;
+  unsigned char *val;
+#endif /* __STDC__ */
+{
+    struct stat statbuf;
+
+    if (lstat(path, &statbuf) < 0)
+       return (-1);
+    else {
+       if ((statbuf.st_mode & S_IFMT) == S_IFDIR) 
+           *val = TRUE;
+       else
+           *val = FALSE;
+       return (0);
+    }  
+}
+#endif /* WINDOWS */
+
+#ifdef __STDC__
+static int get_cred(krb5_context context, 
+                       char *name, char *inst, char *realm, CREDENTIALS *c,
+                       krb5_creds **creds)
+#else
+static int get_cred(context, name, inst, realm, c, creds)
+  krb5_context context;
+  char *name;
+  char *inst;
+  char *realm;
+  CREDENTIALS *c;
+  krb5_creds **creds;
+#endif /* __STDC__ */
+{
+    krb5_creds increds;
+    krb5_error_code r;
+    static krb5_principal client_principal = 0;
+
+    memset((char *)&increds, 0, sizeof(increds));
+/* ANL - instance may be ptr to a null string. Pass null then */
+    if ((r = krb5_build_principal(context, &increds.server,
+                     strlen(realm), realm,
+                     name,
+           (inst && strlen(inst)) ? inst : (void *) NULL,
+                     (void *) NULL))) {
+        return((int)r);
+    }
+
+    if (!_krb425_ccache)
+        krb5_cc_default(context, &_krb425_ccache);
+    if (!client_principal)
+        krb5_cc_get_principal(context, _krb425_ccache, &client_principal);
+
+    increds.client = client_principal;
+    increds.times.endtime = 0;
+       /* Ask for DES since that is what V4 understands */
+    /* increds.keyblock.enctype = ENCTYPE_DES_CBC_CRC; */
+
+    r = krb5_get_credentials(context, 0, _krb425_ccache, &increds, creds);
+    if (r)
+        return((int)r);
+
+/*       This requires krb524d to be running with the KDC */
+    r = krb5_524_convert_creds(context, *creds, c);
+    return((int)r);
+}
+
+
+#ifdef __STDC__
+static int get_user_realm(krb5_context context,char *realm)
+#else
+static int get_user_realm(context, realm)
+  krb5_context context;
+  char *realm;
+
+#endif /* __STDC__ */
+{
+    static krb5_principal client_principal = 0;
+    int i;
+
+    if (!_krb425_ccache)
+        krb5_cc_default(context, &_krb425_ccache);
+    if (!client_principal)
+        krb5_cc_get_principal(context, _krb425_ccache, &client_principal);
+
+    i = krb5_princ_realm(context, client_principal)->length;
+    if (i > REALM_SZ-1) i = REALM_SZ-1;
+    strncpy(realm,krb5_princ_realm(context, client_principal)->data,i);
+    realm[i] = 0;
+    return(KSUCCESS);
+}
+
+
+#ifndef WINDOWS
+
+#ifdef __STDC__
+static void pstderr(char *string)
+#else
+static void pstderr(string)
+  char *string;
+#endif /* __STDC__ */
+{
+    write(2, string, strlen(string));
+}
+
+
+#ifdef __STDC__
+static void pstdout(char *string)
+#else
+static void pstdout(string)
+  char *string;
+#endif /* __STDC__ */
+{
+    write(1, string, strlen(string));
+}
+
+#else /* WINDOWS */
+
+static void pstderr(char *string)
+{
+    if (_isatty(_fileno(stderr)))
+       fprintf(stderr, "%s\r\n", string);
+    else
+       MessageBox(NULL, string, AKLOG_DIALOG_NAME, MB_OK | MB_ICONSTOP);
+}
+
+static void pstdout(char *string)
+{
+    if (_isatty(_fileno(stdout)))
+       fprintf(stdout, "%s\r\n", string);
+    else
+       MessageBox(NULL, string, AKLOG_DIALOG_NAME, MB_OK);
+}
+
+#endif /* WINDOWS */
+
+#ifdef __STDC__
+static void exitprog(char status)
+#else
+static void exitprog(status)
+  char status;
+#endif /* __STDC__ */
+{
+    exit(status);
+}
+
+
+#ifdef __STDC__
+void aklog_init_params(aklog_params *params)
+#else
+void aklog_init_params(params)
+  aklog_params *params;
+#endif /* __STDC__ */
+{
+#ifndef WINDOWS
+    params->readlink = readlink;
+    params->isdir = isdir;
+    params->getwd = getwd;
+#endif
+    params->get_cred = get_cred;
+    params->get_user_realm = get_user_realm;
+    params->pstderr = pstderr;
+    params->pstdout = pstdout;
+    params->exitprog = exitprog;
+}
diff --git a/src/aklog/krb_util.c b/src/aklog/krb_util.c
new file mode 100644 (file)
index 0000000..4de83cc
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * This file replaces some of the routines in the Kerberos utilities.
+ * It is based on the Kerberos library modules:
+ *     send_to_kdc.c
+ * 
+ * Copyright 1987, 1988, 1992 by the Massachusetts Institute of Technology.
+ *
+ * For copying and distribution information, please see the file
+ * <mit-copyright.h>.
+ */
+
+#ifndef lint
+static char rcsid_send_to_kdc_c[] =
+"$Id: krb_util.c,v 1.1.2.1 2004/12/07 05:51:24 shadow Exp $";
+#endif /* lint */
+
+#if 0
+#include <kerberosIV/mit-copyright.h>
+#endif
+#include <krb5.h>
+#include <kerberosIV/krb.h> 
+
+#ifndef MAX_HSTNM
+#define MAX_HSTNM 100
+#endif
+
+#ifdef WINDOWS
+
+#include "aklog.h"             /* for struct afsconf_cell */
+
+#else /* !WINDOWS */
+
+#include <afs/param.h>
+#include <afs/cellconfig.h>
+
+#endif /* WINDOWS */
+
+#define S_AD_SZ sizeof(struct sockaddr_in)
+
+char *afs_realm_of_cell(context, cellconfig)
+    krb5_context context;
+    struct afsconf_cell *cellconfig;
+{
+    char krbhst[MAX_HSTNM];
+    static char krbrlm[REALM_SZ+1];
+       char **hrealms = 0;
+       krb5_error_code retval;
+
+    if (!cellconfig)
+       return 0;
+    if (retval = krb5_get_host_realm(context,
+                               cellconfig->hostName[0], &hrealms))
+               return 0; 
+       if(!hrealms[0]) return 0;
+       strcpy(krbrlm, hrealms[0]);
+
+       if (hrealms) krb5_free_host_realm(context, hrealms);
+    
+    return krbrlm;
+}
diff --git a/src/aklog/linked_list.c b/src/aklog/linked_list.c
new file mode 100644 (file)
index 0000000..720cf94
--- /dev/null
@@ -0,0 +1,212 @@
+/* 
+ * $Id: linked_list.c,v 1.1.2.1 2004/12/07 05:51:24 shadow Exp $
+ * 
+ * This file contains general linked list routines.
+ * 
+ * Copyright 1990,1991 by the Massachusetts Institute of Technology
+ * For distribution and copying rights, see the file "mit-copyright.h"
+ */
+
+#if !defined(lint) && !defined(SABER)
+static char *rcsid_list_c = "$Id: linked_list.c,v 1.1.2.1 2004/12/07 05:51:24 shadow Exp $";
+#endif /* lint || SABER */
+
+#include <stdio.h>
+#include "linked_list.h"
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+#ifndef TRUE
+#define TRUE 1
+#endif
+
+#ifndef FALSE
+#define FALSE 0
+#endif
+
+char *calloc();
+
+#ifdef __STDC__
+void ll_init(linked_list *list)
+  /* 
+   * Requires:
+   *   List must point to a linked list structure.  It is not acceptable
+   *   to pass a null pointer to this routine.
+   * Modifies:
+   *   list
+   * Effects:
+   *   Initializes the list to be one with no elements.  If list is
+   *   NULL, prints an error message and causes the program to crash.
+   */
+#else
+void ll_init(list)
+  linked_list *list;
+#endif /* __STDC__ */
+{
+    if (list == NULL) {
+       fprintf(stderr, "Error: calling ll_init with null pointer.\n");
+       abort();
+    }
+
+    /* This sets everything to zero, which is what we want. */
+#ifdef WINDOWS
+       memset(list, 0, sizeof(linked_list));
+#else
+    bzero((char *)list, sizeof(linked_list));
+#endif /* WINDOWS */
+}
+
+#ifdef __STDC__
+ll_node *ll_add_node(linked_list *list, ll_end which_end)
+  /*
+   * Modifies:
+   *   list
+   * Effects: 
+   *   Adds a node to one end of the list (as specified by which_end)
+   *   and returns a pointer to the node added.  which_end is of type
+   *   ll_end and should be either ll_head or ll_tail as specified in 
+   *   list.h.  If there is not enough memory to allocate a node, 
+   *   the program returns NULL.
+   */
+#else
+ll_node *ll_add_node(list, which_end)
+  linked_list *list;
+  ll_end which_end;
+#endif /* __STDC__ */
+{
+    ll_node *node = NULL;
+    
+    if ((node = (ll_node *)calloc(1, sizeof(ll_node))) != NULL) {
+       if (list->nelements == 0) {
+           list->first = node;
+           list->last = node;
+           list->nelements = 1;
+       }
+       else {
+           switch (which_end) {
+             case ll_head:
+               list->first->prev = node;
+               node->next = list->first;
+               list->first = node;
+               break;
+             case ll_tail:
+               list->last->next = node;
+               node->prev = list->last;
+               list->last = node;
+               break;
+             default:
+               fprintf(stderr, "%s%s",
+                       "ll_add_node got a which_end parameter that ",
+                       "it can't handle.\n");
+               abort();
+           }
+           list->nelements++;
+       }
+    }
+       
+    return(node);
+}
+
+
+#ifdef __STDC__
+int ll_delete_node(linked_list *list, ll_node *node)
+  /* 
+   * Modifies: 
+   *   list
+   * Effects:
+   *   If node is in list, deletes node and returns LL_SUCCESS.  
+   *   Otherwise, returns LL_FAILURE.  If node contains other data,
+   *   it is the responsibility of the caller to free it.  Also, since
+   *   this routine frees node, after the routine is called, "node"
+   *   won't point to valid data.
+   */
+#else
+int ll_delete_node(list, node)
+  linked_list *list;
+  ll_node *node;
+#endif /* __STDC__ */
+{
+    int status = LL_SUCCESS;
+    ll_node *cur_node = NULL;
+    int found = FALSE;
+
+    if (list->nelements == 0)
+       status = LL_FAILURE;
+    else {
+       for (cur_node = list->first; (cur_node != NULL) && !found;
+            cur_node = cur_node->next) {
+           if (cur_node == node) {
+
+               if (cur_node->prev)
+                   cur_node->prev->next = cur_node->next;
+               else
+                   list->first = cur_node->next;
+
+               if (cur_node->next)
+                   cur_node->next->prev = cur_node->prev;
+               else
+                   list->last = cur_node->prev;
+
+               free(cur_node);
+               list->nelements--;
+               found = TRUE;
+           }
+       }
+    }
+
+    if (!found)
+       status = LL_FAILURE;
+
+    return(status);
+}
+
+
+/* ll_add_data is a macro defined in linked_list.h */
+
+/* This routine maintains a list of strings preventing duplication. */
+#ifdef __STDC__
+int ll_string(linked_list *list, ll_s_action action, char *string)
+#else
+int ll_string(list, action, string)
+  linked_list *list;
+  ll_s_action action;
+  char *string;
+#endif /* __STDC__ */
+{
+    int status = LL_SUCCESS;
+    ll_node *cur_node;
+
+    switch(action) {
+      case ll_s_check:
+       /* Scan the list until we find the string in question */
+       for (cur_node = list->first; cur_node && (status == FALSE); 
+            cur_node = cur_node->next)
+           status = (strcmp(string, cur_node->data) == 0);
+       break;
+      case ll_s_add:
+       /* Add a string to the list. */
+       if (!ll_string(list, ll_s_check, string)) {
+           if (cur_node = ll_add_node(list, ll_tail)) {
+               char *new_string;
+               if (new_string = (char *)calloc(strlen(string) + 1, 
+                                               sizeof(char))) {
+                   strcpy(new_string, string);
+                   ll_add_data(cur_node, new_string);
+               }
+               else 
+                   status = LL_FAILURE;
+           }
+           else
+               status = LL_FAILURE;
+       }
+       break;
+      default:
+       /* This should never happen */
+       status = LL_FAILURE;
+       break;
+    }
+
+    return(status);
+}
diff --git a/src/aklog/linked_list.h b/src/aklog/linked_list.h
new file mode 100644 (file)
index 0000000..415e599
--- /dev/null
@@ -0,0 +1,59 @@
+/* 
+ * $Id: linked_list.h,v 1.1.2.1 2004/12/07 05:51:24 shadow Exp $
+ *
+ * This is the header file for a general list linked package.
+ * 
+ * Copyright 1990,1991 by the Massachusetts Institute of Technology
+ * For distribution and copying rights, see the file "mit-copyright.h"
+ */
+
+#ifndef __LINKED_LIST_H__
+#define __LINKED_LIST_H__
+
+#if !defined(lint) && !defined(SABER)
+static char *rcsid_linked_list_h = "$Id: linked_list.h,v 1.1.2.1 2004/12/07 05:51:24 shadow Exp $";
+#endif /* lint || SABER */
+
+#define LL_SUCCESS 0
+#define LL_FAILURE -1
+
+typedef struct _ll_node {
+    struct _ll_node *prev;
+    struct _ll_node *next;
+    char *data;
+} ll_node;
+
+typedef struct {
+    ll_node *first;
+    ll_node *last;
+    int nelements;
+} linked_list;
+
+typedef enum {ll_head, ll_tail} ll_end;
+typedef enum {ll_s_add, ll_s_check} ll_s_action;
+
+
+/*
+ * ll_add_data just assigns the data field of node to be d.
+ * If this were c++, this would be an inline function and d
+ * would be a void *, but we'll take what we can get...
+ */
+#define ll_add_data(n,d) (((n)->data)=(char*)(d))
+
+#ifdef __STDC__
+
+void ll_init(linked_list *list);
+ll_node *ll_add_node(linked_list *list, ll_end which_end);
+int ll_delete_node(linked_list *list, ll_node *node);
+int ll_string(linked_list *, ll_s_action, char *);
+
+#else /* __STDC__ */
+
+void ll_init();
+ll_node *ll_add_node();
+int ll_delete_node();
+int ll_string();
+
+#endif /* __STDC__ */
+
+#endif /* __LINKED_LIST_H__ */
index 44f2d9f94ffb9b8281d76f2506391dccd01c9d77..3772ed670d4dbf568d5e91e5734e1fdf049de414 100644 (file)
@@ -14,3 +14,110 @@ ac_cv_linux_func_inode_setattr_returns_int=yes,
 ac_cv_linux_func_inode_setattr_returns_int=no)])
 AC_MSG_RESULT($ac_cv_linux_func_inode_setattr_returns_int)
 CPPFLAGS="$save_CPPFLAGS"])
+
+AC_DEFUN([LINUX_WRITE_INODE_RETURN_TYPE],[
+AC_MSG_CHECKING(for write_inode return type)
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+AC_CACHE_VAL(ac_cv_linux_func_write_inode_returns_int,
+[
+AC_TRY_COMPILE(
+[#include <linux/fs.h>],
+[struct inode _inode; 
+struct super_operations _sops;
+int i; 
+i = _sops.write_inode(&_inode, 0);], 
+ac_cv_linux_func_write_inode_returns_int=yes,
+ac_cv_linux_func_write_inode_returns_int=no)])
+AC_MSG_RESULT($ac_cv_linux_func_write_inode_returns_int)
+CPPFLAGS="$save_CPPFLAGS"])
+
+AC_DEFUN([LINUX_IOP_NAMEIDATA],[
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+AC_MSG_CHECKING(whether inode_operations.create takes a nameidata)
+AC_CACHE_VAL(ac_cv_linux_func_i_create_takes_nameidata,
+[
+AC_TRY_COMPILE(
+[#include <linux/fs.h>
+#include <linux/namei.h>],
+[struct inode _inode; 
+struct dentry _dentry;
+struct nameidata _nameidata;
+(void)_inode.i_op->create(&_inode, &_dentry, 0, &_nameidata);],
+ac_cv_linux_func_i_create_takes_nameidata=yes,
+ac_cv_linux_func_i_create_takes_nameidata=no)])
+AC_MSG_RESULT($ac_cv_linux_func_i_create_takes_nameidata)
+if test "x$ac_cv_linux_func_i_create_takes_nameidata" = "xyes" ; then
+AC_DEFINE(IOP_CREATE_TAKES_NAMEIDATA, 1, [define if your iops.create takes a nameidata argument])
+fi
+AC_MSG_CHECKING(whether inode_operations.lookup takes a nameidata)
+AC_CACHE_VAL(ac_cv_linux_func_i_lookup_takes_nameidata,
+[
+AC_TRY_COMPILE(
+[#include <linux/fs.h>
+#include <linux/namei.h>],
+[struct inode _inode; 
+struct dentry _dentry;
+struct nameidata _nameidata;
+(void)_inode.i_op->lookup(&_inode, &_dentry, &_nameidata);],
+ac_cv_linux_func_i_lookup_takes_nameidata=yes,
+ac_cv_linux_func_i_lookup_takes_nameidata=no)])
+AC_MSG_RESULT($ac_cv_linux_func_i_lookup_takes_nameidata)
+if test "x$ac_cv_linux_func_i_lookup_takes_nameidata" = "xyes" ; then
+AC_DEFINE(IOP_LOOKUP_TAKES_NAMEIDATA, 1, [define if your iops.lookup takes a nameidata argument])
+fi
+AC_MSG_CHECKING(whether inode_operations.permission takes a nameidata)
+AC_CACHE_VAL(ac_cv_linux_func_i_permission_takes_nameidata,
+[
+AC_TRY_COMPILE(
+[#include <linux/fs.h>
+#include <linux/namei.h>],
+[struct inode _inode; 
+struct nameidata _nameidata;
+(void)_inode.i_op->permission(&_inode, 0, &_nameidata);],
+ac_cv_linux_func_i_permission_takes_nameidata=yes,
+ac_cv_linux_func_i_permission_takes_nameidata=no)])
+AC_MSG_RESULT($ac_cv_linux_func_i_permission_takes_nameidata)
+if test "x$ac_cv_linux_func_i_permission_takes_nameidata" = "xyes" ; then
+AC_DEFINE(IOP_PERMISSION_TAKES_NAMEIDATA, 1, [define if your iops.permission takes a nameidata argument])
+fi
+AC_MSG_CHECKING(whether dentry_operations.d_revalidate takes a nameidata)
+CPPFLAGS="$CPPFLAGS -Werror"
+AC_CACHE_VAL(ac_cv_linux_func_d_revalidate_takes_nameidata,
+[
+AC_TRY_COMPILE(
+[#include <linux/fs.h>
+#include <linux/namei.h>],
+[struct dentry _dentry; 
+struct nameidata _nameidata;
+(void)_dentry.d_op->d_revalidate(&_dentry, &_nameidata);],
+ac_cv_linux_func_d_revalidate_takes_nameidata=yes,
+ac_cv_linux_func_d_revalidate_takes_nameidata=no)])
+AC_MSG_RESULT($ac_cv_linux_func_d_revalidate_takes_nameidata)
+if test "x$ac_cv_linux_func_d_revalidate_takes_nameidata" = "xyes" ; then
+  AC_DEFINE(DOP_REVALIDATE_TAKES_NAMEIDATA, 1, [define if your dops.d_revalidate takes a nameidata argument])
+fi
+CPPFLAGS="$save_CPPFLAGS"])
+
+AC_DEFUN([LINUX_AOP_WRITEBACK_CONTROL],[
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+AC_MSG_CHECKING(whether address_space_operations.writepage takes a writeback_control)
+AC_CACHE_VAL(ac_cv_linux_func_a_writepage_takes_writeback_control,
+[
+AC_TRY_COMPILE(
+[#include <linux/fs.h>
+#include <linux/mm.h>
+#include <linux/writeback.h>],
+[struct address_space_operations _aops; 
+struct page _page;
+struct writeback_control _writeback_control;
+(void)_aops.writepage(&_page, &_writeback_control);],
+ac_cv_linux_func_a_writepage_takes_writeback_control=yes,
+ac_cv_linux_func_a_writepage_takes_writeback_control=no)])
+AC_MSG_RESULT($ac_cv_linux_func_a_writepage_takes_writeback_control)
+if test "x$ac_cv_linux_func_a_writepage_takes_writeback_control" = "xyes" ; then
+AC_DEFINE(AOP_WRITEPAGE_TAKES_WRITEBACK_CONTROL, 1, [define if your aops.writepage takes a struct writeback_control argument])
+fi
+CPPFLAGS="$save_CPPFLAGS"])
index 1c78bd209a6391a6ce5865c935d49a07f5954dd8..fdfb60995cf6ef5db83d56d281690e117077036b 100644 (file)
@@ -45,7 +45,7 @@ else
 [#include <linux/version.h>
 #include <linux/config.h>
 ],
-[#if !defined(CONFIG_MODVERSIONS) || (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0))
+[#if !defined(CONFIG_MODVERSIONS)
 lose;
 #endif
 ],
@@ -55,6 +55,8 @@ lose;
   AC_MSG_CHECKING(which kernel modules to build)
   if false; then
       MPS="MP SP"
+  elif test "x$ac_cv_linux_config_modversions" = "xno" -a "$AFS_SYSKVERS" -lt 26; then
+      MPS="MP SP"
   else
   AC_CACHE_VAL(ac_cv_linux_config_smp, [
   AC_TRY_COMPILE(
@@ -111,3 +113,18 @@ AC_TRY_COMPILE(
 AC_MSG_RESULT($ac_cv_linux_kernel_sock_create_v)
 CPPFLAGS="$save_CPPFLAGS"])
 
+AC_DEFUN([LINUX_KERNEL_PAGE_FOLLOW_LINK],[
+AC_MSG_CHECKING(for page_follow_link_light vs page_follow_link)
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
+AC_CACHE_VAL(ac_cv_linux_kernel_page_follow_link,
+[
+AC_TRY_COMPILE(
+  [#include <linux/fs.h>],
+  [
+  page_follow_link(0,0)
+  ],
+  ac_cv_linux_kernel_page_follow_link=yes,
+  ac_cv_linux_kernel_page_follow_link=no)])
+AC_MSG_RESULT($ac_cv_linux_kernel_page_follow_page)
+CPPFLAGS="$save_CPPFLAGS"])
index 24fcf675f976ed86f1db4e8aad7bf3f43f0dc7e8..2adcb09eb195cc75824a61552810cc1f3e780740 100644 (file)
@@ -195,7 +195,7 @@ case $AFS_SYSNAME in
                YACC="byacc"
                ;;
 
-       *nbsd20)
+       *nbsd2*)
                LEX="flex -l"
                MT_CFLAGS='${XCFLAGS} -DAFS_PTHREAD_ENV -D_REENTRANT '
                MT_LIBS="-lpthread" # XXX -pthread soon
@@ -217,7 +217,7 @@ case $AFS_SYSNAME in
                YACC="bison -y"
                ;;
 
-       ia64_linux24)
+       ia64_linux24|ia64_linux26)
                KERN_OPTMZ=-O2
                LEX="flex -l"
                MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
@@ -324,6 +324,26 @@ case $AFS_SYSNAME in
                SHLIB_LINKER="${MT_CC} -shared"
                ;;
 
+       i386_umlinux26)
+               CC="gcc -pipe"
+               CCOBJ="gcc -pipe"
+               MT_CC="gcc -pipe"
+               KERN_OPTMZ=-O2
+               LEX="flex -l"
+               MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
+               MT_LIBS="-lpthread"
+               DBG=-g
+               KERN_DBG=-g
+               LWP_DBG=-g
+               LWP_OPTMZ=-O2
+               OPTMZ=-O2
+               PAM_CFLAGS="-g -O2 -Dlinux -DLINUX_PAM -fPIC"
+               SHLIB_LDFLAGS="-shared -Xlinker -x"
+               TXLIBS="-lncurses"
+               XCFLAGS="-g -O2 -D_LARGEFILE64_SOURCE"
+               SHLIB_LINKER="${MT_CC} -shared"
+               ;;
+
        *_obsd*)
                LEX="flex -l"
                MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
index a97c39504474795dc70171056c99ed82d8dec618..208e97792bfe642eac6d72e7dcdd611dc682af47 100644 (file)
@@ -15,7 +15,7 @@ et_lex.lex.c: et_lex.lex.l
 
 compile_et:    compile_et.o error_table.o
        case $(SYS_NAME) in \
-       *_linux* ) \
+       *_linux* | *_umlinux* ) \
        ${CC} ${CFLAGS} -o compile_et compile_et.o error_table.o -L${TOP_LIBDIR} -lafsutil;; \
        * ) \
        ${CC} ${CFLAGS} -o compile_et compile_et.o error_table.o -L${TOP_LIBDIR} -lafsutil -ll;; \
index 59897addcfa7e901018428abc2c1e3d9838262ae..5b23feee596cd028d99441a3b02a7aea71003119 100644 (file)
@@ -80,7 +80,7 @@ LIB = $(AFSDEV_LIB)
 #define used in WinNT/2000 installation and program version display
 AFSPRODUCT_VER_MAJOR=1
 AFSPRODUCT_VER_MINOR=3
-AFSPRODUCT_VER_PATCH=7400
+AFSPRODUCT_VER_PATCH=7700
 AFSPRODUCT_VER_BUILD=0
 
 # For MSI installer, each major release should have a different GUID
index ac79f6b413294d1c29355c417d08e83ca57c2303..569b0021c49fcd514bd478d67cb0d14be3b2ce83 100644 (file)
@@ -24,7 +24,7 @@ BEGIN
     /* Internalname and originalfilename must be specified or explorer won't
        show version and description */
     BEGIN
-        BLOCK "040904E4"
+        BLOCK "000004E4"
         BEGIN
             VALUE "CompanyName",        "OpenAFS Project", "\0"
             VALUE "LegalCopyright",     "Copyright \251 IBM Corporation and others, 1998, 1999, 2000, 2001, 2002, 2003.", "\0"
index 6e0cd5505e487a9c4ace734a14fe0c9f752b9791..e28eae5ffb507e64feb4ce06aa0932fdf9f9706f 100644 (file)
@@ -180,6 +180,7 @@ typedef struct cm_initparams_v1 {
 #define PROC_SYSCALL_NAME "afs_ioctl"
 #define PROC_SYSCALL_FNAME "/proc/fs/openafs/afs_ioctl"
 #define PROC_SYSCALL_ARLA_FNAME "/proc/fs/nnpfs/afs_ioctl"
+#define PROC_CELLSERVDB_NAME "CellServDB"
 #define VIOC_SYSCALL_TYPE 'C' 
 #define VIOC_SYSCALL _IOW(VIOC_SYSCALL_TYPE,1,void *)
  
index 26157d6717b3e761799486e03c6347e0a1b3aacf..25e00047198a47afcf89e8c9525e95ec834dfb4a 100644 (file)
 #define SYS_NAME_ID_ia64_linux2                2200
 #define SYS_NAME_ID_ia64_linux22       2201
 #define SYS_NAME_ID_ia64_linux24       2202
+#define SYS_NAME_ID_ia64_linux26       2203
 
 #define SYS_NAME_ID_m68k_linux22        2301
 #define SYS_NAME_ID_m68k_linux24        2302
 #define SYS_NAME_ID_sparc_nbsd20       2522
 #define SYS_NAME_ID_sparc64_nbsd20     2523
 #define SYS_NAME_ID_macppc_nbsd20      2524
+#define SYS_NAME_ID_i386_nbsd21                2525
 
 #define SYS_NAME_ID_i386_obsd31                2600
 #define SYS_NAME_ID_i386_obsd32                2601
 #define SYS_NAME_ID_i386_umlinux2      2800
 #define SYS_NAME_ID_i386_umlinux22     2801
 #define SYS_NAME_ID_i386_umlinux24     2802
+#define SYS_NAME_ID_i386_umlinux26     2803
 
 #define SYS_NAME_ID_ppc64_linux2       2900
 #define SYS_NAME_ID_ppc64_linux22      2901
index 0ede1fddfcea7112c0cbee7f9c9c8e95ae444da4..fec37ff57cc461e61a6f4cdfe788ff6ed3663802 100644 (file)
@@ -9,6 +9,9 @@
 /* define if you want to want namei fileserver */
 #undef AFS_NAMEI_ENV
 
+/* define if your aops.writepage takes a struct writeback_control argument */
+#undef AOP_WRITEPAGE_TAKES_WRITEBACK_CONTROL
+
 /* define if you want to salvager to check bitmasks later */
 #undef BITMAP_LATER
 
@@ -28,6 +31,9 @@
 /* define if prev_task defined */
 #undef DEFINED_PREV_TASK
 
+/* define if your dops.d_revalidate takes a nameidata argument */
+#undef DOP_REVALIDATE_TAKES_NAMEIDATA
+
 /* define if you have redhat buildsystem */
 #undef ENABLE_REDHAT_BUILDSYS
 
@@ -89,6 +95,9 @@
 /* define if your linux kernel has linux/syscall.h */
 #undef HAVE_KERNEL_LINUX_SYSCALL_H
 
+/* define if your linux kernel provides page_follow_link */
+#undef HAVE_KERNEL_PAGE_FOLLOW_LINK
+
 /* Define to 1 if you have the <malloc.h> header file. */
 #undef HAVE_MALLOC_H
 
 /* define if your setattr return return non-void */
 #undef INODE_SETATTR_NOT_VOID
 
+/* define if your iops.create takes a nameidata argument */
+#undef IOP_CREATE_TAKES_NAMEIDATA
+
+/* define if your iops.lookup takes a nameidata argument */
+#undef IOP_LOOKUP_TAKES_NAMEIDATA
+
+/* define if your iops.permission takes a nameidata argument */
+#undef IOP_PERMISSION_TAKES_NAMEIDATA
+
 /* define if irix has memcpy and friends */
 #undef IRIX_HAS_MEM_FUNCS
 
 /* define if target is big endian */
 #undef WORDS_BIGENDIAN
 
+/* define if your sops.write_inode returns non-void */
+#undef WRITE_INODE_NOT_VOID
+
 /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
    `char[]'. */
 #undef YYTEXT_POINTER
index 9a8444e418b54fcad986a4986f97c51153f285ba..ca6b125e814e6ca91742b3fffc93a66a37ab9ba0 100644 (file)
@@ -19,6 +19,7 @@
 #define AFS_AMD64_LINUX22_ENV   1
 #define AFS_AMD64_LINUX24_ENV   1
 #define AFS_AMD64_LINUX26_ENV   1
+#define AFS_LINUX_64BIT_KERNEL 1
 #define AFS_NONFSTRANS 1
 
 #define AFS_MOUNT_AFS "afs"    /* The name of the filesystem type. */
diff --git a/src/config/param.i386_nbsd21.h b/src/config/param.i386_nbsd21.h
new file mode 100644 (file)
index 0000000..77976f7
--- /dev/null
@@ -0,0 +1,21 @@
+#ifndef        AFS_I386_PARAM_H
+#define        AFS_I386_PARAM_H
+
+#define AFS_X86_XBSD_ENV 1
+#define AFS_X86_ENV 1
+#define AFSLITTLE_ENDIAN 1
+
+#define SYS_NAME       "i386_nbsd21"
+#define SYS_NAME_ID    SYS_NAME_ID_i386_nbsd21
+
+#ifndef UKERNEL
+/* This section for kernel libafs compiles only */
+
+#else /* !defined(UKERNEL) */
+
+/* This section for user space compiles only */
+
+#endif /* !defined(UKERNEL) */
+
+#endif /* AFS_I386_PARAM_H */
+
diff --git a/src/config/param.i386_umlinux26.h b/src/config/param.i386_umlinux26.h
new file mode 100644 (file)
index 0000000..831eb2a
--- /dev/null
@@ -0,0 +1,152 @@
+#ifndef UKERNEL
+/* This section for kernel libafs compiles only */
+
+#ifndef AFS_PARAM_H
+#define AFS_PARAM_H
+
+/* In user space the AFS_LINUX20_ENV should be sufficient. In the kernel,
+ * it's a judgment call. If something is obviously i386 specific, use that
+ * #define instead. Note that "20" refers to the linux 2.0 kernel. The "2"
+ * in the sysname is the current version of the client. This takes into
+ * account the perferred OS user space configuration as well as the kernel.
+ */
+
+#define AFS_LINUX20_ENV        1
+#define AFS_LINUX22_ENV        1
+#define AFS_LINUX24_ENV        1
+#define AFS_LINUX26_ENV        1
+#define AFS_I386_LINUX20_ENV   1
+#define AFS_I386_LINUX22_ENV   1
+#define AFS_I386_LINUX24_ENV   1
+#define AFS_I386_LINUX26_ENV   1
+#define AFS_NONFSTRANS 1
+
+#define AFS_MOUNT_AFS "afs"    /* The name of the filesystem type. */
+#define AFS_SYSCALL 137
+#define AFS_64BIT_IOPS_ENV  1
+#define AFS_NAMEI_ENV     1    /* User space interface to file system */
+#define AFS_64BIT_ENV          1
+#define AFS_64BIT_CLIENT       1
+
+#if defined(__KERNEL__) && !defined(KDUMP_KERNEL)
+#include <linux/threads.h>
+
+#include <linux/config.h>
+#ifdef CONFIG_SMP
+#ifndef AFS_SMP
+#define AFS_SMP 1
+#endif
+#endif
+/* Using "AFS_SMP" to map to however many #define's are required to get
+ * MP to compile for Linux
+ */
+#ifdef AFS_SMP
+#ifndef CONFIG_SMP
+#define CONFIG_SMP 1
+#endif
+#ifndef CONFIG_X86_LOCAL_APIC
+#define CONFIG_X86_LOCAL_APIC 1
+#endif
+#ifndef __SMP__
+#define __SMP__
+#endif
+#define AFS_GLOBAL_SUNLOCK
+#endif
+
+#endif /* __KERNEL__  && !DUMP_KERNEL */
+
+#include <afs/afs_sysnames.h>
+#define AFS_USERSPACE_IP_ADDR 1
+#define RXK_LISTENER_ENV 1
+#define AFS_GCPAGS       2     /* Set to Userdisabled, allow sysctl to override */
+
+#define AFSLITTLE_ENDIAN    1
+#define AFS_HAVE_FFS        1  /* Use system's ffs. */
+#define AFS_HAVE_STATVFS    0  /* System doesn't support statvfs */
+#define AFS_VM_RDWR_ENV            1   /* read/write implemented via VM */
+
+#ifdef KERNEL
+#ifndef MIN
+#define MIN(A,B) ((A) < (B) ? (A) : (B))
+#endif
+#ifndef MAX
+#define MAX(A,B) ((A) > (B) ? (A) : (B))
+#endif
+#endif /* KERNEL */
+
+#ifndef KERNEL
+#define __USE_LARGEFILE64 1
+#if !defined off64_t
+#define off64_t __off64_t
+#endif
+#endif
+
+/* Machine / Operating system information */
+#define SYS_NAME       "i386_umlinux26"
+#define SYS_NAME_ID    SYS_NAME_ID_i386_umlinux26
+
+#endif /* AFS_PARAM_H */
+
+
+
+#else /* !defined(UKERNEL) */
+
+/* This section for user space compiles only */
+
+#ifndef AFS_PARAM_H
+#define AFS_PARAM_H
+
+/* In user space the AFS_LINUX20_ENV should be sufficient. In the kernel,
+ * it's a judgment call. If something is obviously i386 specific, use that
+ * #define instead. Note that "20" refers to the linux 2.0 kernel. The "2"
+ * in the sysname is the current version of the client. This takes into
+ * account the perferred OS user space configuration as well as the kernel.
+ */
+
+#define UKERNEL                        1       /* user space kernel */
+#define AFS_ENV                        1
+#define AFS_USR_LINUX20_ENV    1
+#define AFS_USR_LINUX22_ENV    1
+#define AFS_USR_LINUX24_ENV    1
+#define AFS_USR_LINUX26_ENV    1
+#define AFS_NONFSTRANS 1
+
+#define AFS_MOUNT_AFS "afs"    /* The name of the filesystem type. */
+#define AFS_SYSCALL 137
+#define AFS_64BIT_IOPS_ENV  1
+#define AFS_NAMEI_ENV     1    /* User space interface to file system */
+#include <afs/afs_sysnames.h>
+
+#define AFS_USERSPACE_IP_ADDR 1
+#define RXK_LISTENER_ENV 1
+#define AFS_GCPAGS             0       /* if nonzero, garbage collect PAGs */
+
+
+/* Machine / Operating system information */
+#define SYS_NAME       "i386_umlinux26"
+#define SYS_NAME_ID    SYS_NAME_ID_i386_umlinux26
+#define AFSLITTLE_ENDIAN    1
+#define AFS_HAVE_FFS        1  /* Use system's ffs. */
+#define AFS_HAVE_STATVFS    0  /* System doesn't support statvfs */
+#define AFS_VM_RDWR_ENV            1   /* read/write implemented via VM */
+
+#define        afsio_iov       uio_iov
+#define        afsio_iovcnt    uio_iovcnt
+#define        afsio_offset    uio_offset
+#define        afsio_seg       uio_segflg
+#define        afsio_fmode     uio_fmode
+#define        afsio_resid     uio_resid
+#define        AFS_UIOSYS      1
+#define        AFS_UIOUSER     UIO_USERSPACE
+#define        AFS_CLBYTES     MCLBYTES
+#define        AFS_MINCHANGE   2
+#define        VATTR_NULL      usr_vattr_null
+
+#define AFS_DIRENT
+#ifndef CMSERVERPREF
+#define CMSERVERPREF
+#endif
+
+#endif /* AFS_PARAM_H */
+
+#endif /* !defined(UKERNEL) */
diff --git a/src/config/param.ia64_linux26.h b/src/config/param.ia64_linux26.h
new file mode 100644 (file)
index 0000000..db9a29c
--- /dev/null
@@ -0,0 +1,172 @@
+#ifndef UKERNEL
+/* This section for kernel libafs compiles only */
+
+/* 
+ * Copyright 2000, International Business Machines Corporation and others.
+ * All Rights Reserved.
+ * 
+ * This software has been released under the terms of the IBM Public
+ * License.  For details, see the LICENSE file in the top-level source
+ * directory or online at http://www.openafs.org/dl/license10.html
+ */
+
+
+#ifndef AFS_PARAM_H
+#define AFS_PARAM_H
+
+/* In user space the AFS_LINUX20_ENV should be sufficient. In the kernel,
+ * it's a judgment call. If something is obviously ia64 specific, use that
+ * #define instead. Note that "20" refers to the linux 2.0 kernel. The "2"
+ * in the sysname is the current version of the client. This takes into
+ * account the perferred OS user space configuration as well as the kernel.
+ */
+
+#define AFS_LINUX20_ENV        1
+#define AFS_LINUX22_ENV        1
+#define AFS_LINUX24_ENV        1
+#define AFS_LINUX26_ENV        1
+#define AFS_IA64_LINUX20_ENV   1
+#define AFS_IA64_LINUX22_ENV   1
+#define AFS_IA64_LINUX24_ENV   1
+#define AFS_IA64_LINUX26_ENV   1
+#define AFS_LINUX_64BIT_KERNEL 1
+#define AFS_NONFSTRANS 1
+
+#define AFS_MOUNT_AFS "afs"    /* The name of the filesystem type. */
+#define AFS_SYSCALL 1141
+#define AFS_64BIT_IOPS_ENV  1
+#define AFS_NAMEI_ENV     1    /* User space interface to file system */
+
+#define AFS_64BIT_ENV          1       /* Defines afs_int32 as int, not long. */
+#define AFS_64BIT_CLIENT       1       
+
+#define AFS_64BITPOINTER_ENV   1       /* pointers are 64 bits. */
+
+#if defined(__KERNEL__) && !defined(KDUMP_KERNEL)
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/threads.h>
+
+#include <linux/config.h>
+#ifdef CONFIG_SMP
+#undef CONFIG_SMP
+#endif
+/* Using "AFS_SMP" to map to however many #define's are required to get
+ * MP to compile for Linux
+ */
+#ifdef AFS_SMP
+#define CONFIG_SMP 1
+#ifndef __SMP__
+#define __SMP__
+#endif
+#define AFS_GLOBAL_SUNLOCK
+#endif
+
+#if defined(MODULE) && defined(CONFIG_MODVERSIONS)
+#define MODVERSIONS
+/* #include <config/modversions.h> */
+#endif
+
+#endif /* __KERNEL__  && !DUMP_KERNEL */
+
+#include <afs/afs_sysnames.h>
+
+#define AFS_USERSPACE_IP_ADDR 1
+#define RXK_LISTENER_ENV 1
+#define AFS_GCPAGS       2     /* Set to Userdisabled, allow sysctl to override */
+
+/* Machine / Operating system information */
+#define SYS_NAME       "ia64_linux26"
+#define SYS_NAME_ID    SYS_NAME_ID_ia64_linux26
+#define AFSLITTLE_ENDIAN    1
+#define AFS_HAVE_FFS        1  /* Use system's ffs. */
+#define AFS_HAVE_STATVFS    0  /* System doesn't support statvfs */
+#define AFS_VM_RDWR_ENV            1   /* read/write implemented via VM */
+
+#ifdef KERNEL
+#ifndef MIN
+#define MIN(A,B) ((A) < (B) ? (A) : (B))
+#endif
+#ifndef MAX
+#define MAX(A,B) ((A) > (B) ? (A) : (B))
+#endif
+#endif /* KERNEL */
+
+#define USE_UCONTEXT           /* should be in afsconfig.h */
+
+#endif /* _PARAM_IA64_LINUX20_H_ */
+
+#else /* !defined(UKERNEL) */
+
+/* This section for user space compiles only */
+
+/* 
+ * Copyright 2000, International Business Machines Corporation and others.
+ * All Rights Reserved.
+ * 
+ * This software has been released under the terms of the IBM Public
+ * License.  For details, see the LICENSE file in the top-level source
+ * directory or online at http://www.openafs.org/dl/license10.html
+ */
+
+
+#ifndef AFS_PARAM_H
+#define AFS_PARAM_H
+
+/* In user space the AFS_LINUX20_ENV should be sufficient. In the kernel,
+ * it's a judgment call. If something is obviously i386 specific, use that
+ * #define instead. Note that "20" refers to the linux 2.0 kernel. The "2"
+ * in the sysname is the current version of the client. This takes into
+ * account the perferred OS user space configuration as well as the kernel.
+ */
+
+#define UKERNEL                        1       /* user space kernel */
+#define AFS_ENV                        1
+#define AFS_USR_LINUX20_ENV    1
+#define AFS_USR_LINUX22_ENV    1
+#define AFS_USR_LINUX24_ENV    1
+#define AFS_USR_LINUX26_ENV    1
+#define AFS_NONFSTRANS 1
+
+#define AFS_MOUNT_AFS "afs"    /* The name of the filesystem type. */
+#define AFS_SYSCALL 1141
+#define AFS_64BIT_IOPS_ENV  1
+#define AFS_NAMEI_ENV     1    /* User space interface to file system */
+#include <afs/afs_sysnames.h>
+
+#define AFS_USERSPACE_IP_ADDR 1
+#define RXK_LISTENER_ENV 1
+#define AFS_GCPAGS             0       /* if nonzero, garbage collect PAGs */
+
+
+/* Machine / Operating system information */
+#define SYS_NAME       "ia64_linux26"
+#define SYS_NAME_ID    SYS_NAME_ID_ia64_linux26
+#define AFSLITTLE_ENDIAN    1
+#define AFS_HAVE_FFS        1  /* Use system's ffs. */
+#define AFS_HAVE_STATVFS    0  /* System doesn't support statvfs */
+#define AFS_VM_RDWR_ENV            1   /* read/write implemented via VM */
+
+#define        afsio_iov       uio_iov
+#define        afsio_iovcnt    uio_iovcnt
+#define        afsio_offset    uio_offset
+#define        afsio_seg       uio_segflg
+#define        afsio_fmode     uio_fmode
+#define        afsio_resid     uio_resid
+#define        AFS_UIOSYS      1
+#define        AFS_UIOUSER     UIO_USERSPACE
+#define        AFS_CLBYTES     MCLBYTES
+#define        AFS_MINCHANGE   2
+#define        VATTR_NULL      usr_vattr_null
+
+#define AFS_DIRENT
+#ifndef CMSERVERPREF
+#define CMSERVERPREF
+#endif
+
+#define USE_UCONTEXT           /* should be in afsconfig.h */
+
+#endif /* AFS_PARAM_H */
+
+#endif /* !defined(UKERNEL) */
diff --git a/src/config/param.nbsd21.h b/src/config/param.nbsd21.h
new file mode 100644 (file)
index 0000000..3bc7f39
--- /dev/null
@@ -0,0 +1,162 @@
+/* NetBSD shared section */
+
+#ifndef        AFS_PARAM_COMMON_H
+#define        AFS_PARAM_COMMON_H 1
+
+#define AFS_64BIT_ENV  1
+#define AFS_NAMEI_ENV  1       /* User space interface to file system */
+#define AFS_64BIT_IOPS_ENV 1   /* Needed for NAMEI */
+#define AFS_64BIT_CLIENT 1
+
+#define AFS_MOUNT_AFS "afs"    /* The name of the filesystem type. */
+#define AFS_SYSCALL 210
+
+#ifndef        MOUNT_AFS
+#define        MOUNT_AFS AFS_MOUNT_AFS
+#endif
+
+#define AFS_XBSD_ENV 1         /* {Free,Open,Net}BSD */
+
+#define AFS_NBSD_ENV 1
+#define AFS_NBSD15_ENV 1
+#define AFS_NBSD16_ENV 1
+#define AFS_NBSD20_ENV 1
+#define AFS_NONFSTRANS 1
+#define AFS_KERBEROS_ENV 1
+
+#define AFS_VFSINCL_ENV 1
+
+#define AFS_HAVE_FFS            1      /* Use system's ffs. */
+
+#if    !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) && !defined(IGNORE_STDS_H)
+#if __NetBSD_Version__ >= 200040000
+#define AFS_HAVE_STATVFS    1  /* System supports statvfs */
+#else
+#define AFS_HAVE_STATVFS    0  /* System doesn't supports statvfs */
+#endif
+#endif
+
+#ifndef UKERNEL
+
+#if    !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) && !defined(IGNORE_STDS_H)
+#include <sys/param.h>
+#endif
+
+#define FTRUNC O_TRUNC
+
+#define IUPD 0x0010
+#define IACC 0x0020
+#define ICHG 0x0040
+#define IMOD 0x0080
+
+#define IN_LOCK(ip)     lockmgr(&ip->i_lock, LK_EXCLUSIVE, \
+                                NULL, curproc)
+#define IN_UNLOCK(ip)   lockmgr(&ip->i_lock, LK_RELEASE, \
+                                NULL, curproc)
+
+#include <afs/afs_sysnames.h>
+
+#define AFS_VM_RDWR_ENV        1
+#define AFS_VFS_ENV    1
+#define AFS_GREEDY43_ENV       1
+
+#define AFS_GCPAGS             0       /* if nonzero, garbage collect PAGs */
+#define AFS_USE_GETTIMEOFDAY    1      /* use gettimeofday to implement rx clock */
+
+/* Extra kernel definitions (from kdefs file) */
+#ifdef _KERNEL
+#define AFS_GLOBAL_SUNLOCK        1
+#define        AFS_VFS34       1       /* What is VFS34??? */
+#define        AFS_SHORTGID    1       /* are group id's short? */
+#define        afsio_iov       uio_iov
+#define        afsio_iovcnt    uio_iovcnt
+#define        afsio_offset    uio_offset
+#define        afsio_seg       uio_segflg
+#define        afsio_resid     uio_resid
+#define        AFS_UIOSYS      UIO_SYSSPACE
+#define        AFS_UIOUSER     UIO_USERSPACE
+#define        AFS_CLBYTES     CLBYTES
+#define        osi_GetTime(x)  microtime(x)
+#define        AFS_KALLOC(x)   kalloc(x)
+#define        AFS_KFREE(x,y)  kfree(x,y)
+#define        v_count         v_usecount
+#define v_vfsp         v_mount
+#define vfs_bsize      mnt_stat.f_bsize
+#define vfs_fsid       mnt_stat.f_fsid
+#define va_nodeid      va_fileid
+#define vfs_vnodecovered mnt_vnodecovered
+#define direct         dirent
+#define vnode_t                struct vnode
+
+#ifndef MUTEX_DEFAULT
+#define MUTEX_DEFAULT   0
+#endif /* MUTEX_DEFAULT */
+
+#ifndef SSYS
+#define SSYS            0x00002
+#endif /* SSYS */
+
+#define p_rcred         p_ucred
+
+#define        VN_RELE(vp)     vrele(((struct vnode *)(vp)))
+#define        VN_HOLD(vp)     VREF(((struct vnode *)(vp)))
+
+#if    !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) && !defined(IGNORE_STDS_H)
+enum vcexcl { NONEXCL, EXCL };
+
+#ifdef KERNEL
+#ifndef MIN
+#define MIN(A,B) ((A) < (B) ? (A) : (B))
+#endif
+#ifndef MAX
+#define MAX(A,B) ((A) > (B) ? (A) : (B))
+#endif
+#endif /* KERNEL */
+
+#endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ && !defined(IGNORE_STDS_H) */ 
+#endif /* _KERNEL */
+
+#else /* !defined(UKERNEL) */
+
+
+/* This section for user space compiles only */
+
+#define UKERNEL                        1       /* user space kernel */
+
+#include <afs/afs_sysnames.h>
+
+#define AFS_USERSPACE_IP_ADDR 1
+#define RXK_LISTENER_ENV      1
+#define AFS_GCPAGS           0 /* if nonzero, garbage collect PAGs */
+
+#define        afsio_iov       uio_iov
+#define        afsio_iovcnt    uio_iovcnt
+#define        afsio_offset    uio_offset
+#define        afsio_seg       uio_segflg
+#define        afsio_fmode     uio_fmode
+#define        afsio_resid     uio_resid
+#define        AFS_UIOSYS      UIO_SYSSPACE
+#define        AFS_UIOUSER     UIO_USERSPACE
+#define        AFS_CLBYTES     MCLBYTES
+#define        AFS_MINCHANGE   2
+#define        VATTR_NULL      usr_vattr_null
+
+#define AFS_DIRENT
+#ifndef CMSERVERPREF
+#define CMSERVERPREF
+#endif
+
+#if    !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) && !defined(IGNORE_STDS_H)
+#include <limits.h>
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/mount.h>
+#include <sys/fcntl.h>
+#include <netinet/in.h>
+#include <sys/uio.h>
+#include <sys/socket.h>
+#endif
+
+#endif /* !defined(UKERNEL) */
+
+#endif /* AFS_PARAM_COMMON_H */
index cc2e73d71dfa8bf3001d34571070ba68e1e736ab..50b18dbb4fc376aa808325ba6202dd8293f588b4 100644 (file)
 #define AFS_SUN510_ENV         1
 
 #define AFS_64BIT_ENV          1       /* Defines afs_int32 as int, not long. */
+/*
+ * Only define on 64 bit kernel, until problems with 32 bit
+ * and large file support are resolved
+ */
+#if defined(__sparcv9)
 #define AFS_64BIT_CLIENT       1       
+#endif
 
 #define AFS_HAVE_FLOCK_SYSID   1
 
index 48655381ab61119a290ea66a9701f7612e517b4f..6c058abcd7618801303f55078c2355cf4225d0b1 100644 (file)
 #define AFS_SUN58_ENV          1
 
 #define AFS_64BIT_ENV          1       /* Defines afs_int32 as int, not long. */
+/*
+ * Only define on 64 bit kernel, until problems with 32 bit
+ * and large file support are resolved
+ */
+#if defined(__sparcv9)
 #define AFS_64BIT_CLIENT       1       
+#endif
 
 #define AFS_HAVE_FLOCK_SYSID    1
 
index 79279df3a75cccdebd60d7e061ffc760d6c166fc..d322042469b5df35d4d5c69a5ce84af58ed65892 100644 (file)
 #define AFS_SUN59_ENV          1
 
 #define AFS_64BIT_ENV          1       /* Defines afs_int32 as int, not long. */
+/*
+ * Only define on 64 bit kernel, until problems with 32 bit
+ * and large file support are resolved
+ */
+#if defined(__sparcv9)
 #define AFS_64BIT_CLIENT       1       
+#endif
 
 #define AFS_HAVE_FLOCK_SYSID    1
 
index bc06ea8a9d110fbbda769b4b37ede128d9a70ec0..06332b3167ff33cd03ddb953339ea1d6f9470111 100644 (file)
@@ -94,12 +94,12 @@ make_p:     make_p.o misc.o main.o
 make_s:        make_s.o misc.o main.o 
        ${CC} make_s.o misc.o main.o ${LDFLAGS} -o make_s
 
-crypt.o: crypt.c
+crypt.o: ${srcdir}/crypt.c
        case ${SYS_NAME} in \
        rs_aix*)\
-               ${CCOBJ} -c ${COMMON_INCL} -o crypt.o crypt.c ;;\
+               ${CCOBJ} -c ${COMMON_INCL} -o crypt.o ${srcdir}/crypt.c ;;\
        *)\
-               ${CCOBJ} -c ${CFLAGS} -o crypt.o crypt.c ;;\
+               ${CCOBJ} -c ${CFLAGS} -o crypt.o ${srcdir}/crypt.c ;;\
        esac
 #
 # Table/code generation targets
index 9e83224cf97f1c75d5a10ffea017262f3a3e095b..4eca30fe60626419db3899ad0b59b107b9668227 100644 (file)
@@ -14,7 +14,7 @@
 #include <afs/param.h>
 
 RCSID
-    ("$Header: /cvs/openafs/src/export/cfgexport.c,v 1.11 2003/09/03 16:47:16 rees Exp $");
+    ("$Header: /cvs/openafs/src/export/cfgexport.c,v 1.11.2.1 2004/12/07 16:48:42 shadow Exp $");
 
 #include <errno.h>
 #include <stdio.h>
@@ -202,7 +202,9 @@ get_syms(conf, syms)
     FILE *fp;
     int xsym_compar();
 
-    fp = fopen(syms, "r");
+    if (syms == NULL)
+      sys_error("syms is NULL");
+    fp = fopen(syms, "r"); 
     if (fp == NULL)
        sys_error(syms);
 
@@ -375,6 +377,7 @@ get_syms(conf, syms)
  *     strp    -       ^ to ^ to EXPORT string table
  *     szp     -       ^ to EXPORT string table size
  */
+#define SYMBUFSIZE 262144
 xlate_xtok(xp, kp, strp, szp)
      register struct syment *xp;
      register sym_t *kp;
@@ -386,13 +389,13 @@ xlate_xtok(xp, kp, strp, szp)
     static left, offset, sz;
 
     if (!export_strings) {
-       export_strings = malloc(sz = 1024);
+       export_strings = malloc(sz = SYMBUFSIZE);
        if (!export_strings)
            error("no memory for EXPORT string table");
 
        *strp = export_strings;
        *szp = offset = sizeof(uint);
-       left = 1024 - offset;
+       left = SYMBUFSIZE - offset;
 
        export_strings += offset;
 
@@ -417,11 +420,11 @@ xlate_xtok(xp, kp, strp, szp)
         */
        len = strlen(xstrings + xp->n_offset) + 1;
        while (len >= left) {
-           export_strings = (char *)realloc(*strp, sz += 1024);
+           export_strings = (char *)realloc(*strp, sz += SYMBUFSIZE);
            if (!export_strings)
                error("no memory for EXPORT string table");
            *strp = export_strings;
-           left += 1024;
+           left += SYMBUFSIZE;
            prev = "";          /* lazy */
        }
 
@@ -452,11 +455,11 @@ xlate_xtok(xp, kp, strp, szp)
         */
        len = strlen(xp->n_nptr) + 1;
        while (len >= left) {
-           export_strings = (char *)realloc(*strp, sz += 1024);
+           export_strings = (char *)realloc(*strp, sz += SYMBUFSIZE);
            if (!export_strings)
                error("no memory for EXPORT string table");
            *strp = export_strings;
-           left += 1024;
+           left += SYMBUFSIZE;
            prev = "";          /* lazy */
        }
 
index 540bc2a95319ec0dc3970042c637afa685a177a7..8e30ba32c64a0957411679ff72c5464f6bb85ba3 100644 (file)
@@ -16,7 +16,7 @@
 #include <afs/param.h>
 
 RCSID
-    ("$Header: /cvs/openafs/src/kauth/admin_tools.c,v 1.16.2.1 2004/08/25 07:03:39 shadow Exp $");
+    ("$Header: /cvs/openafs/src/kauth/admin_tools.c,v 1.16.2.3 2004/12/13 19:38:51 shadow Exp $");
 
 #include <afs/stds.h>
 #include <afs/debug.h>
@@ -512,9 +512,9 @@ ka_islocked(char *name, char *instance, afs_uint32 * when)
     do {
        tempwhen = 0;
        code =
-           ubik_CallIter(KAM_LockStatus, conn, UPUBIKONLY, &count, name,
-                         instance, &tempwhen, /*spares */ 0, 0, 0,
-                         0);
+           ubik_CallIter(KAM_LockStatus, conn, UPUBIKONLY, &count, (long) name,
+                         (long) instance, (long) &tempwhen, 0, 0, 0,
+                         0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
        if (code) {
            if (seriouserror(code))
                com_err(whoami, code, "");
@@ -549,8 +549,8 @@ Unlock(struct cmd_syndesc *as, char *arock)
 
     count = 0;
     do {
-       code = ubik_CallIter(KAM_Unlock, conn, 0, &count, name, instance,
-                            /*spares */ 0, 0, 0, 0);
+       code = ubik_CallIter(KAM_Unlock, conn, 0, &count, (long) name, (long) instance,
+                            0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
        if (code && (code != UNOSERVERS)) {
            server = 0;
            if (conn && conn->conns[count - 1]
index a6962858372cc92b72f769a7a591a67dd0bb1f1e..9a59181932bdbb478c49ff26201beec45bd373a6 100644 (file)
@@ -17,7 +17,7 @@
 #endif
 
 RCSID
-    ("$Header: /cvs/openafs/src/kauth/authclient.c,v 1.14.2.2 2004/08/25 07:09:38 shadow Exp $");
+    ("$Header: /cvs/openafs/src/kauth/authclient.c,v 1.14.2.4 2004/12/13 19:38:51 shadow Exp $");
 
 #if defined(UKERNEL)
 #include "afs/sysincludes.h"
@@ -475,8 +475,10 @@ kawrap_ubik_Call(aproc, aclient, aflags, p1, p2, p3, p4, p5, p6, p7, p8)
        do {                    /* Cycle through the servers */
            lcode = code;
            code =
-               ubik_CallIter(aproc, aclient, aflags, &count, p1, p2, p3, p4,
-                             p5, p6, p7, p8);
+               ubik_CallIter(aproc, aclient, aflags, &count, (long) p1,
+                             (long) p2, (long) p3, (long) p4,
+                             (long) p5, (long) p6, (long) p7,
+                             (long) p8, 0, 0, 0, 0, 0, 0, 0, 0);
        } while ((code == UNOQUORUM) || (code == UNOTSYNC)
                 || (code == KALOCKED) || (code == -1));
 
index bafe426b2e7f39bee88e78c22b86aad16c084a57..6f6c79adfe521c031ef409ca9a4e3763e3a4ffc3 100644 (file)
@@ -11,7 +11,7 @@
 #include <afs/param.h>
 
 RCSID
-    ("$Header: /cvs/openafs/src/libadmin/kas/afs_kasAdmin.c,v 1.9 2003/12/07 22:49:30 jaltman Exp $");
+    ("$Header: /cvs/openafs/src/libadmin/kas/afs_kasAdmin.c,v 1.9.2.2 2004/12/13 19:39:18 shadow Exp $");
 
 #include <stdio.h>
 
@@ -36,7 +36,6 @@ RCSID
 #undef ENCRYPT
 
 extern int ubik_Call();
-extern int ubik_CallIter();
 
 typedef struct {
     int begin_magic;
@@ -718,7 +717,7 @@ GetPrincipalLockStatus(const kas_server_p kaserver, const kas_identity_p who,
        tst =
            ubik_CallIter(KAM_LockStatus, kaserver->servers, UPUBIKONLY,
                          &count, who->principal, who->instance, &locked, 0,
-                         0, 0, 0);
+                         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
        if (tst == 0) {
            if (locked) {
                if ((locked < *lockedUntil) || !once) {
@@ -1274,7 +1273,8 @@ kas_PrincipalUnlock(const void *cellHandle, const void *serverHandle,
     do {
        tst =
            ubik_CallIter(KAM_Unlock, kaserver.servers, 0, &count,
-                         who->principal, who->instance, 0, 0, 0, 0);
+                         who->principal, who->instance, 0, 0, 0, 0, 0, 0,
+                         0, 0, 0, 0, 0, 0, 0, 0);
        if (tst && (tst != UNOSERVERS)) {
            if (save_tst == 0) {
                save_tst = tst; /* save the first failure */
index 81d83f8848dd05198a1ab9e99540ac8e8b7acac0..a3f2bd1738443883b4374cb1166c40e84370c8fa 100644 (file)
@@ -49,10 +49,13 @@ DEFINES = $(COMMON_DEFINES) -DCPU=586
 CCFLAGS = $(COMMON_KERN_CFLAGS) -mcmodel=kernel
 DEFINES = $(COMMON_DEFINES) 
 
-<i386_umlinux22 i386_umlinux24>
-CCFLAGS = $(COMMON_KERN_CFLAGS) @P5PLUS_KOPTS@ -I$(LINUX_KERNEL_PATH)/arch/um/include -I$(LINUX_KERNEL_PATH)/arch/um/kernel/tt/include -I$(LINUX_KERNEL_PATH)/arch/um/kernel/skas/include
+<i386_umlinux22 i386_umlinux24 i386_umlinux26>
+CCFLAGS = $(COMMON_KERN_CFLAGS) @P5PLUS_KOPTS@ -Wno-strict-prototypes -I$(LINUX_KERNEL_PATH)/arch/um/include -I$(LINUX_KERNEL_PATH)/arch/um/kernel/tt/include -I$(LINUX_KERNEL_PATH)/arch/um/kernel/skas/include
 DEFINES = $(COMMON_DEFINES) -DCPU=586
 
+<i386_umlinux26>
+EXTRA_CFLAGS = -I$(LINUX_KERNEL_PATH)/arch/um/include -I$(LINUX_KERNEL_PATH)/arch/um/kernel/tt/include -I$(LINUX_KERNEL_PATH)/arch/um/kernel/skas/include
+
 <alpha_linux_22 alpha_linux_24>
 CCFLAGS = $(COMMON_KERN_CFLAGS) -mno-fp-regs -ffixed-8
 DEFINES = $(COMMON_DEFINES)
@@ -108,9 +111,9 @@ DESTDIRS=linux_destdirs
 
 include Makefile.common
 
-<linux26>
+<linux26 umlinux26>
 LINUX_MODULE_EXT=ko
-<all -linux26>
+<all -linux26 -umlinux26>
 LINUX_MODULE_EXT=o
 <all>
 
@@ -152,6 +155,7 @@ ${COMPDIRS} ${INSTDIRS} ${DESTDIRS}:
        ln -fs ${LINUX_KERNEL_PATH}/include/asm-i386 asm
 <i386_umlinux22 i386_umlinux24 i386_umlinux26>
        ln -fs ${LINUX_KERNEL_PATH}/include/asm-um asm
+       ln -fs ${LINUX_KERNEL_PATH}/arch/um/include/sysdep
 <amd64_linux24 amd64_linux26>
        ln -fs ${LINUX_KERNEL_PATH}/include/asm-x86_64 asm
 <s390_linux22 s390_linux24 s390_linux26>
@@ -233,17 +237,16 @@ libafs.ep: $(LIBAFS_EP)
 libafs.bm: $(LIBAFS_BM)
        echo BM Build Complete
 
-<linux26>
+<linux26 umlinux26>
 ${LIBAFS} ${LIBAFS_MP} ${LIBAFS_EP} ${LIBAFS_BM}: libafs.ko
        cp libafs.ko $@
 
 .FORCE:
 libafs.ko: .FORCE
-       ../$(srcdir)/make_kbuild_makefile.pl ${KDIR} $@ \
-         @TOP_OBJDIR@/src/config/Makefile.config Makefile.afs Makefile.common
-       $(MAKE) -C ${LINUX_KERNEL_PATH} M=@TOP_OBJDIR@/src/libafs/${KDIR} modules
+       env EXTRA_CFLAGS="${EXTRA_CFLAGS}" ../$(srcdir)/make_kbuild_makefile.pl ${KDIR} $@ @TOP_OBJDIR@/src/config/Makefile.config Makefile.afs Makefile.common
+       env EXTRA_CFLAGS="${EXTRA_CFLAGS}" $(MAKE) -C ${LINUX_KERNEL_PATH} M=@TOP_OBJDIR@/src/libafs/${KDIR} modules
         
-<all -linux26>
+<all -linux26 -umlinux26>
 
 ${LIBAFS}: $(AFSAOBJS) $(AFSNONFSOBJS)
        $(RM) -f $@
index 04e57910d36d0f88e2601f0fa253213ffea2eed4..083baaeb2ef4156cf08e27e14d2453764a9857f0 100644 (file)
@@ -58,8 +58,7 @@ UTILOBJS = \
        pthread_glock.o \
        get_krbrlm.o \
        dirpath.o \
-       fileutil.o \
-       casestrcpy.o
+       fileutil.o
 
 RXKADOBJS = \
        rxkad_errs.o
@@ -182,9 +181,6 @@ dirpath.o: ${UTIL}/dirpath.c
 fileutil.o: ${UTIL}/fileutil.c
        ${CCRULE}
 
-casestrcpy.o: ${UTIL}/casestrcpy.c
-       ${CCRULE}
-
 pthread_glock.o: ${UTIL}/pthread_glock.c
        ${CCRULE}
 
index 5b8669e7f4880b49d0d572919ccea8b894c309cb..692b2d2d131df428ad121a69111548ee2dbd1e8d 100644 (file)
@@ -142,7 +142,7 @@ DLLLIBS =\
     $(DESTDIR)\lib\lanahelper.lib
 
 $(LIBFILE): $(DLLOBJS) $(DLLLIBS) $(RXOBJS)
-       $(DLLCONLINK) /DEF:afsauthent.def rpcrt4.lib dnsapi.lib mpr.lib
+       $(DLLCONLINK) /DEF:afsauthent.def rpcrt4.lib dnsapi.lib mpr.lib secur32.lib
        $(DLLPREP)
 
 # Definitions for generating versioninfo resources
index 422a735f04e4a0011b385fafa9793b28e545b5e1..6573866b909c2e95d1ee2f9d2196a1e7ed5183d9 100644 (file)
@@ -32,6 +32,7 @@ SYSOBJS =\
        syscall.o
 
 UTILOBJS =\
+       assert.o \
        casestrcpy.o \
        base64.o
 
@@ -202,11 +203,11 @@ md4.o: ${RXKAD}/md4.c
 md5.o: ${RXKAD}/md5.c
        ${CCRULE} ${RXKAD}/md5.c
 
-fcrypt.o: ${TOP_OBJDIR}/src/rxkad/domestic/fcrypt.c
-       ${CCRULE} ${TOP_OBJDIR}/src/rxkad/domestic/fcrypt.c
+fcrypt.o: ${RXKAD}/domestic/fcrypt.c
+       ${CCRULE} ${RXKAD}/domestic/fcrypt.c
 
-crypt_conn.o: ${TOP_OBJDIR}/src/rxkad/domestic/crypt_conn.c
-       ${CCRULE} ${TOP_OBJDIR}/src/rxkad/domestic/crypt_conn.c
+crypt_conn.o: ${RXKAD}/domestic/crypt_conn.c
+       ${CCRULE} ${RXKAD}/domestic/crypt_conn.c
 
 AFS_component_version_number.o: ${TOP_OBJDIR}/src/rx/AFS_component_version_number.c
        ${CCRULE} ${TOP_OBJDIR}/src/rx/AFS_component_version_number.c
@@ -266,7 +267,7 @@ xdr_afsuuid.o: ${RX}/xdr_afsuuid.c
 #
 #   $ what /opt/langtools/bin/pxdb32
 #   /opt/langtools/bin/pxdb32:
-#           HP92453-02 A.10.0A HP-UX SYMBOLIC DEBUGGER (PXDB) $Revision: 1.29.2.1 $
+#           HP92453-02 A.10.0A HP-UX SYMBOLIC DEBUGGER (PXDB) $Revision: 1.29.2.5 $
 #
 # The problem occurs when -g and -O are both used when compiling des.c.
 # The simplest way to work around the problem is to leave out either -g or -O.
@@ -336,6 +337,9 @@ com_err.o: ${COMERR}/com_err.c
 casestrcpy.o: ${UTIL}/casestrcpy.c
        ${CCRULE} ${UTIL}/casestrcpy.c
 
+assert.o: ${UTIL}/assert.c
+       ${CCRULE} ${UTIL}/assert.c
+
 base64.o: ${UTIL}/base64.c
        ${CCRULE} ${UTIL}/base64.c
 
index 993c0564542db4f8a8409f5f1f4a8e35c8bde667..6dfd9c8d8293cb848dd9de8fe30b1f176dae3b65 100644 (file)
@@ -30,7 +30,9 @@ LIBJUAFS = libjuafs.a
 LIBAFSWEB = nsafs.a
 LIBAFSWEBKRB = nsafs.krb.a
 
-OPTF=-O
+# To get __file__ (afs_osi_pag.c) you need to specify language level 
+# C99 to xlc_r like this:
+OPTF=-O -qlanglvl=stdc99
 WEBOPTS = -I../nsapi -qarch=com -DNETSCAPE_NSAPI -DAIX -DNET_SSL -DXP_UNIX -DMCC_HTTPD
 
 include Makefile.common
index c787ba3fcf3c5030491108b8ca9fde01c48a338f..a9b803d4f3307c3c6ce85ab2bfa2e5a4b4cb9b08 100644 (file)
@@ -71,7 +71,7 @@ process.o     : process.s process.i386.s process.c
                ${AS} process.ss -o process.o ;  \
                $(RM) -f process.S ;;\
        ncrx86_* | sunx86_*) \
-               /usr/ccs/lib/cpp -P -D__i386 -DIGNORE_STDS_H -I${TOP_INCDIR} -I${srcdir} ${srcdir}/process.i386.s process.ss; \
+               /usr/ccs/lib/cpp -P -D__sun -D__i386 -DIGNORE_STDS_H -I${TOP_INCDIR} -I${srcdir} ${srcdir}/process.i386.s process.ss; \
                ${AS} -o process.o process.ss; \
                $(RM) process.ss ;; \
        alpha_nbsd* ) \
index e0b11ed7131395b1968a82b2130f7038ea8678ed..14dda48e27ebe327d6371fc270c02d52d3f70711 100644 (file)
@@ -17,7 +17,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /cvs/openafs/src/lwp/lwp.c,v 1.27.2.1 2004/08/25 07:03:40 shadow Exp $");
+RCSID("$Header: /cvs/openafs/src/lwp/lwp.c,v 1.27.2.2 2004/12/13 19:40:19 shadow Exp $");
 
 #include <stdlib.h>
 #include <stdio.h>
@@ -121,7 +121,7 @@ static purge_dead_pcbs();
 struct QUEUE {
     PROCESS head;
     int count;
-} runnable[MAX_PRIORITIES], blocked, qwaiting;
+} runnable[MAX_PRIORITIES], blocked;
 /* Invariant for runnable queues: The head of each queue points to the currently running process if it is in that queue, or it points to the next process in that queue that should run. */
 
 /* Offset of stack field within pcb -- used by stack checking stuff */
@@ -242,7 +242,7 @@ LWP_QWait(void)
 {
     register PROCESS tp;
     (tp = lwp_cpptr)->status = QWAITING;
-    move(tp, &runnable[tp->priority], &qwaiting);
+    lwp_remove(tp, &runnable[tp->priority]);
     Set_LWP_RC();
     return LWP_SUCCESS;
 }
@@ -253,7 +253,7 @@ LWP_QSignal(pid)
 {
     if (pid->status == QWAITING) {
        pid->status = READY;
-       move(pid, &qwaiting, &runnable[pid->priority]);
+       insert(pid, &runnable[pid->priority]);
        return LWP_SUCCESS;
     } else
        return LWP_ENOWAIT;
@@ -561,9 +561,6 @@ Dump_Processes(void)
            for_all_elts(x, blocked, {
                         Dump_One_Process(x);}
        )
-           for_all_elts(x, qwaiting, {
-                        Dump_One_Process(x);}
-       )
     } else
        printf("***LWP: LWP support not initialized\n");
     return 0;
@@ -604,8 +601,6 @@ LWP_InitializeProcessSupport(int priority, PROCESS * pid)
     }
     blocked.head = NULL;
     blocked.count = 0;
-    qwaiting.head = NULL;
-    qwaiting.count = 0;
     lwp_init = (struct lwp_ctl *)malloc(sizeof(struct lwp_ctl));
     temp = (PROCESS) malloc(sizeof(struct lwp_pcb));
     if (lwp_init == NULL || temp == NULL)
@@ -664,9 +659,6 @@ LWP_TerminateProcessSupport(void)
     )
        for_all_elts(cur, blocked, {
                     Free_PCB(cur);}
-    )
-       for_all_elts(cur, qwaiting, {
-                    Free_PCB(cur);}
     )
        free(lwp_init);
     lwp_init = NULL;
@@ -792,9 +784,7 @@ Delete_PCB(register PROCESS pid)
     lwp_remove(pid,
               (pid->blockflag || pid->status == WAITING
                || pid->status ==
-               DESTROYED ? &blocked : 
-               (pid->status == QWAITING) ? &qwaiting :
-               &runnable[pid->priority]));
+               DESTROYED ? &blocked : &runnable[pid->priority]));
     LWPANCHOR.processcnt--;
     return 0;
 }
@@ -821,9 +811,6 @@ Dump_One_Process(PROCESS pid)
     case DESTROYED:
        printf("DESTROYED");
        break;
-    case QWAITING:
-       printf("QWAITING");
-       break;
     default:
        printf("unknown");
     }
@@ -883,13 +870,7 @@ Dispatcher(void)
                     printf(" \"%s\"", p->name);
                     }
        )
-       puts("]");
-       printf("[Qwaiting (%d):", qwaiting.count);
-       for_all_elts(p, qwaiting, {
-                    printf(" \"%s\"", p->name);
-                    }
-       )
-       puts("]");
+           puts("]");
     }
 #endif
 
index 72dcfa212539a1d7fb35ea0ace56d939500887cc..1e62cae93bfc37530a4a411841912c7203a2ddde 100644 (file)
@@ -302,9 +302,13 @@ char lwp_debug;                    /* ON = show LWP debugging trace */
 #if defined(AFS_LINUX22_ENV)
 #define AFS_LWP_MINSTACKSIZE   (192 * 1024)
 #else
+#if defined(AFS_AIX52_ENV)
+#define AFS_LWP_MINSTACKSIZE   (128 * 1024)
+#else
 #define AFS_LWP_MINSTACKSIZE   (48 * 1024)
 #endif
 #endif
+#endif
 
 /* Action to take on stack overflow. */
 #define LWP_SOQUIET    1       /* do nothing */
index 4fd9513cc24142ab863e908dfd3d37c56f1917f5..b646c5ccc78109727ee8a1b173b0e5b205238fa4 100644 (file)
  * This file is mis-named. It is used by both a.out and elf platforms.
  * It either adds the leading underscore or not as needed.
  *
- * $Id: lwp_elf.h,v 1.3 2004/08/03 14:45:49 rees Exp $
+ * $Id: lwp_elf.h,v 1.3.2.2 2004/12/07 22:27:16 shadow Exp $
  */
 
 #ifndef _C_LABEL
-#if !defined(SYSV) && !defined(__ELF__) && !defined(AFS_SUN5_ENV)
+#if defined(SYSV) || defined(__ELF__) || defined(__sun)
+#define _C_LABEL(name)  name
+#else /* SYSV || __ELF__ || __sun */
 #ifdef __STDC__
 #define _C_LABEL(name)     _##name
 #else
 #define _C_LABEL(name)  _/**/name
 #endif
-#else /* SYSV || __ELF__ || AFS_SUN5_ENV */
-#define _C_LABEL(name)  name
 #endif
 #endif /* _C_LABEL */
 
 #ifndef ENTRY
-#if !defined(SYSV) && !defined(__ELF__) && !defined(AFS_SUN5_ENV)
+#if defined(SYSV) || defined(__ELF__) || defined(__sun)
+#define ENTRY(name)     name:
+#else
 #ifdef __STDC__
 #define ENTRY(name)    _##name##:
 #else
 #define ENTRY(name)     _/**/name/**/:
 #endif
-#else /* SYSV || __ELF__ || AFS_SUN5_ENV */
-#define ENTRY(name)     name:
 #endif
 #endif /* _C_LABEL */
index 2c1fab3f7f707b3df1179cbf09162d5683e0d5fd..cc8391dc75ad90bccfce230fc47c440eec9070ea 100644 (file)
@@ -3,13 +3,13 @@
 <plist version="1.0">
 <dict>
        <key>CFBundleGetInfoString</key>
-       <string>OpenAFS 1.3.74</string>
+       <string>OpenAFS 1.3.77</string>
        <key>CFBundleIdentifier</key>
        <string>org.openafs.OpenAFS.pkg</string>
        <key>CFBundleName</key>
        <string>OpenAFS</string>
        <key>CFBundleShortVersionString</key>
-       <string>1.3.74</string>
+       <string>1.3.77</string>
        <key>IFMajorVersion</key>
        <integer>1</integer>
        <key>IFMinorVersion</key>
index 805366ae0bfd035a504cce81f8599809ffe04922..18067566016396f80299d17e57bd3bfc2a9f35fa 100644 (file)
@@ -1,5 +1,5 @@
 Title OpenAFS
-Version 1.3.74
+Version 1.3.77
 Description The OpenAFS distributed filesystem. This package installs an almost-ready-to-run client for OpenAFS. see http://www.openafs.org for more information.
 DefaultLocation /
 Diskname (null)
index e614bb3995189aede70765193a41c62dfaa634fe..035f6ed3104e1f11ebcfcd1169c497cf09bc39c7 100644 (file)
@@ -16,7 +16,7 @@
 #include "afs/param.h"
 
 RCSID
-    ("$Header: /cvs/openafs/src/rx/LINUX/rx_knet.c,v 1.23.2.3 2004/10/18 17:43:59 shadow Exp $");
+    ("$Header: /cvs/openafs/src/rx/LINUX/rx_knet.c,v 1.23.2.4 2004/12/07 06:10:11 shadow Exp $");
 
 #include <linux/version.h>
 #ifdef AFS_LINUX22_ENV
@@ -67,7 +67,8 @@ rxk_NewSocketHost(afs_uint32 ahost, short aport)
     }
 
     TO_USER_SPACE();
-    sockp->ops->setsockopt(sockp, SOL_IP, IP_MTU_DISCOVER, &pmtu, sizeof(pmtu));
+    sockp->ops->setsockopt(sockp, SOL_IP, IP_MTU_DISCOVER, (char *)&pmtu,
+                           sizeof(pmtu));
     TO_KERNEL_SPACE();
     return (struct osi_socket *)sockp;
 }
@@ -208,8 +209,6 @@ osi_StopListener(void)
     read_unlock(&tasklist_lock);
 #endif
     while (rxk_ListenerPid) {
-       struct task_struct *p;
-
        flush_signals(listener);
        force_sig(SIGKILL, listener);
        afs_osi_Sleep(&rxk_ListenerPid);
index 2fb93036f99dddd89d57ce77e1a794c704115a50..685b6078fd70f185f11b656dccb3f191414319f3 100644 (file)
@@ -17,7 +17,7 @@
 #endif
 
 RCSID
-    ("$Header: /cvs/openafs/src/rx/rx.c,v 1.58.2.3 2004/10/18 17:43:57 shadow Exp $");
+    ("$Header: /cvs/openafs/src/rx/rx.c,v 1.58.2.4 2004/12/07 06:10:05 shadow Exp $");
 
 #ifdef KERNEL
 #include "afs/sysincludes.h"
@@ -1788,10 +1788,10 @@ rx_GetCall(int tno, struct rx_service *cur_service, osi_socket * socketp)
  */
 void
 rx_SetArrivalProc(register struct rx_call *call,
-                 register VOID(*proc) (register struct rx_call * call,
-                                       register struct multi_handle * mh,
+                 register void (*proc) (register struct rx_call * call,
+                                       register VOID * mh,
                                        register int index),
-                 register VOID * handle, register VOID * arg)
+                 register VOID * handle, register int arg)
 {
     call->arrivalProc = proc;
     call->arrivalProcHandle = handle;
@@ -1823,7 +1823,7 @@ rx_EndCall(register struct rx_call *call, afs_int32 rc)
        call->abortCount = 0;
     }
 
-    call->arrivalProc = (VOID(*)())0;
+    call->arrivalProc = (void (*)())0;
     if (rc && call->error == 0) {
        rxi_CallError(call, rc);
        /* Send an abort message to the peer if this error code has
@@ -3188,8 +3188,8 @@ rxi_ReceiveDataPacket(register struct rx_call *call,
             * (e.g. multi rx) */
            if (call->arrivalProc) {
                (*call->arrivalProc) (call, call->arrivalProcHandle,
-                                     (int)call->arrivalProcArg);
-               call->arrivalProc = (VOID(*)())0;
+                                     call->arrivalProcArg);
+               call->arrivalProc = (void (*)())0;
            }
 
            /* Update last packet received */
@@ -3869,7 +3869,7 @@ rxi_ReceiveAckPacket(register struct rx_call *call, struct rx_packet *np,
        call->state = RX_STATE_DALLY;
        rxi_ClearTransmitQueue(call, 0);
     } else if (!queue_IsEmpty(&call->tq)) {
-       rxi_Start(0, call, istack);
+       rxi_Start(0, call, 0, istack);
     }
     return np;
 }
@@ -4374,8 +4374,8 @@ rxi_ResetCall(register struct rx_call *call, register int newcall)
     /* Notify anyone who is waiting for asynchronous packet arrival */
     if (call->arrivalProc) {
        (*call->arrivalProc) (call, call->arrivalProcHandle,
-                             (int)call->arrivalProcArg);
-       call->arrivalProc = (VOID(*)())0;
+                             call->arrivalProcArg);
+       call->arrivalProc = (void (*)())0;
     }
 
     if (call->delayedAbortEvent) {
@@ -4907,10 +4907,10 @@ rxi_SendXmitList(struct rx_call *call, struct rx_packet **list, int len,
 /* Call rxi_Start, below, but with the call lock held. */
 void
 rxi_StartUnlocked(struct rxevent *event, register struct rx_call *call,
-                 int istack)
+                 void *arg1, int istack)
 {
     MUTEX_ENTER(&call->lock);
-    rxi_Start(event, call, istack);
+    rxi_Start(event, call, arg1, istack);
     MUTEX_EXIT(&call->lock);
 }
 #endif /* RX_ENABLE_LOCKS */
@@ -4921,7 +4921,8 @@ rxi_StartUnlocked(struct rxevent *event, register struct rx_call *call,
  * better optimized for new packets, the usual case, now that we've
  * got rid of queues of send packets. XXXXXXXXXXX */
 void
-rxi_Start(struct rxevent *event, register struct rx_call *call, int istack)
+rxi_Start(struct rxevent *event, register struct rx_call *call,
+         void *arg1, int istack)
 {
     struct rx_packet *p;
     register struct rx_packet *nxp;    /* Next pointer for queue_Scan */
@@ -5196,12 +5197,12 @@ rxi_Start(struct rxevent *event, register struct rx_call *call, int istack)
 #ifdef RX_ENABLE_LOCKS
                        CALL_HOLD(call, RX_CALL_REFCOUNT_RESEND);
                        call->resendEvent =
-                           rxevent_Post(&retryTime, rxi_StartUnlocked,
-                                        (void *)call, (void *)istack);
+                           rxevent_Post2(&retryTime, rxi_StartUnlocked,
+                                        (void *)call, 0, istack);
 #else /* RX_ENABLE_LOCKS */
                        call->resendEvent =
-                           rxevent_Post(&retryTime, rxi_Start, (void *)call,
-                                        (void *)istack);
+                           rxevent_Post2(&retryTime, rxi_Start, (void *)call,
+                                        0, istack);
 #endif /* RX_ENABLE_LOCKS */
                    }
                }
@@ -5472,9 +5473,8 @@ rxi_SendDelayedCallAbort(struct rxevent *event, register struct rx_call *call,
  * security object associated with the connection */
 void
 rxi_ChallengeEvent(struct rxevent *event, register struct rx_connection *conn,
-                  void *atries)
+                  void *arg1, int tries)
 {
-    int tries = (int)atries;
     conn->challengeEvent = NULL;
     if (RXS_CheckAuthentication(conn->securityObject, conn) != 0) {
        register struct rx_packet *packet;
@@ -5514,8 +5514,8 @@ rxi_ChallengeEvent(struct rxevent *event, register struct rx_connection *conn,
        clock_GetTime(&when);
        when.sec += RX_CHALLENGE_TIMEOUT;
        conn->challengeEvent =
-           rxevent_Post(&when, rxi_ChallengeEvent, conn,
-                        (void *)(tries - 1));
+           rxevent_Post2(&when, rxi_ChallengeEvent, conn, 0,
+                        (tries - 1));
     }
 }
 
@@ -5530,7 +5530,7 @@ rxi_ChallengeOn(register struct rx_connection *conn)
 {
     if (!conn->challengeEvent) {
        RXS_CreateChallenge(conn->securityObject, conn);
-       rxi_ChallengeEvent(NULL, conn, (void *)RX_CHALLENGE_MAXTRIES);
+       rxi_ChallengeEvent(NULL, conn, 0, RX_CHALLENGE_MAXTRIES);
     };
 }
 
index 6778bbcf4a562aa21577df32b51257038b966b49..e34ff3ecf007bbb20ffc553e7484d776e021fcec 100644 (file)
@@ -507,9 +507,9 @@ struct rx_call {
     int abortCount;            /* number of times last error was sent */
     u_int lastSendTime;                /* Last time a packet was sent on this call */
     u_int lastReceiveTime;     /* Last time a packet was received for this call */
-      VOID(*arrivalProc) (register struct rx_call * call, register struct multi_handle * mh, register int index);      /* Procedure to call when reply is received */
+    void (*arrivalProc) (register struct rx_call * call, register VOID * mh, register int index);      /* Procedure to call when reply is received */
     VOID *arrivalProcHandle;   /* Handle to pass to replyFunc */
-    VOID *arrivalProcArg;      /* Additional arg to pass to reply Proc */
+    int arrivalProcArg;         /* Additional arg to pass to reply Proc */
     afs_uint32 lastAcked;      /* last packet "hard" acked by receiver */
     afs_uint32 startWait;      /* time server began waiting for input data/send quota */
     struct clock traceWait;    /* time server began waiting for input data/send quota */
index 7758d227cee9605443b6d5544244dc2a1774e5f6..5c74214458d85754bd5d2f76ee7f0d657655a77c 100644 (file)
@@ -19,7 +19,7 @@
 #endif
 
 RCSID
-    ("$Header: /cvs/openafs/src/rx/rx_event.c,v 1.14.2.1 2004/08/25 07:09:41 shadow Exp $");
+    ("$Header: /cvs/openafs/src/rx/rx_event.c,v 1.14.2.2 2004/12/07 06:10:06 shadow Exp $");
 
 #ifdef KERNEL
 #ifndef UKERNEL
@@ -188,8 +188,9 @@ rxevent_Post(struct clock *when,
                           struct rx_connection * conn,
                           struct rx_call * acall), void *arg, void *arg1)
 #else
-struct rxevent *
-rxevent_Post(struct clock *when, void (*func) (), void *arg, void *arg1)
+static struct rxevent *
+_rxevent_Post(struct clock *when, void (*func) (), void *arg, void *arg1,
+             int arg2, int newargs)
 #endif
 {
     register struct rxevent *ev, *evqe, *evqpr;
@@ -202,9 +203,10 @@ rxevent_Post(struct clock *when, void (*func) (), void *arg, void *arg1)
     if (rx_Log_event) {
        struct clock now;
        clock_GetTime(&now);
-       fprintf(rx_Log_event, "%d.%d: rxevent_Post(%d.%d, %x, %x)\n",
+       fprintf(rx_Log_event, "%d.%d: rxevent_Post(%d.%d, %lx, %lx, %lx, %d)\n",
                (int)now.sec, (int)now.usec, (int)when->sec, (int)when->usec,
-               (unsigned int)func, (unsigned int)arg);
+               (unsigned long)func, (unsigned long)arg,
+               (unsigned long)arg1, arg2);
     }
 #endif
 
@@ -262,6 +264,8 @@ rxevent_Post(struct clock *when, void (*func) (), void *arg, void *arg1)
     ev->func = func;
     ev->arg = arg;
     ev->arg1 = arg1;
+    ev->arg2 = arg2;
+    ev->newargs = newargs;
     rxevent_nPosted += 1;      /* Rather than ++, to shut high-C up
                                 *  regarding never-set variables
                                 */
@@ -291,6 +295,19 @@ rxevent_Post(struct clock *when, void (*func) (), void *arg, void *arg1)
     return ev;
 }
 
+struct rxevent *
+rxevent_Post(struct clock *when, void (*func) (), void *arg, void *arg1)
+{
+    return _rxevent_Post(when, func, arg, arg1, 0, 0);
+}
+
+struct rxevent *
+rxevent_Post2(struct clock *when, void (*func) (), void *arg, void *arg1,
+             int arg2)
+{
+    return _rxevent_Post(when, func, arg, arg1, arg2, 1);
+}
+
 /* Cancel an event by moving it from the event queue to the free list.
  * Warning, the event must be on the event queue!  If not, this should core
  * dump (reference through 0).  This routine should be called using the macro
@@ -311,10 +328,10 @@ rxevent_Cancel_1(register struct rxevent *ev, register struct rx_call *call,
     if (rx_Log_event) {
        struct clock now;
        clock_GetTime(&now);
-       fprintf(rx_Log_event, "%d.%d: rxevent_Cancel_1(%d.%d, %x, %x)\n",
+       fprintf(rx_Log_event, "%d.%d: rxevent_Cancel_1(%d.%d, %lx, %lx)\n",
                (int)now.sec, (int)now.usec, (int)ev->eventTime.sec,
-               (int)ev->eventTime.usec, (unsigned int)ev->func,
-               (unsigned int)ev->arg);
+               (int)ev->eventTime.usec, (unsigned long)ev->func,
+               (unsigned long)ev->arg);
     }
 #endif
     /* Append it to the free list (rather than prepending) to keep the free
@@ -395,7 +412,11 @@ rxevent_RaiseEvents(struct clock *next)
            queue_Remove(ev);
            rxevent_nPosted--;
            MUTEX_EXIT(&rxevent_lock);
-           ev->func(ev, ev->arg, ev->arg1);
+           if (ev->newargs) {
+               ev->func(ev, ev->arg, ev->arg1, ev->arg2);
+           } else {
+               ev->func(ev, ev->arg, ev->arg1);
+           }
            MUTEX_ENTER(&rxevent_lock);
            queue_Append(&rxevent_free, ev);
            rxevent_nFree++;
index 662a2fb2e6803865cfa855069057105a0ececd59..4907b514527749666e686d8b6366e4ff53e5a4fd 100644 (file)
@@ -28,6 +28,8 @@ struct rxevent {
     void (*func) ();           /* Function to call when this expires */
     char *arg;                 /* Argument to the function */
     char *arg1;                        /* Another argument */
+    int arg2;                  /* An integer argument */
+    int newargs;               /* Nonzero if new-form arguments should be used */
 };
 
 /* We used to maintain a sorted list of events, but the amount of CPU
index 82b4c6c3992ced9968360c1580e633da3c8646f4..0e3ec7e6503c122cd2ac24749ba684013f62bae3 100644 (file)
@@ -11,7 +11,7 @@
 #include <afs/param.h>
 
 RCSID
-    ("$Header: /cvs/openafs/src/rx/rx_getaddr.c,v 1.15.2.2 2004/11/09 17:16:12 shadow Exp $");
+    ("$Header: /cvs/openafs/src/rx/rx_getaddr.c,v 1.15.2.3 2004/12/07 05:48:55 shadow Exp $");
 
 #ifndef AFS_DJGPP_ENV
 #ifndef KERNEL
@@ -456,6 +456,9 @@ rxi_getAllAddrMaskMtu(afs_int32 addrBuffer[], afs_int32 maskBuffer[],
                continue;       /* ignore this address */
            }
 
+            if (a->sin_addr.s_addr == htonl(0x7f000001) )
+                continue;   /* skip loopback address as well. */
+
            if (count >= maxSize) {     /* no more space */
                printf("Too many interfaces..ignoring 0x%x\n",
                       a->sin_addr.s_addr);
index 216e057a71cb48bf27049504c6bcee37e4359f0d..e9b824f55d9c210511447b06a5a1dd22a8ced369 100644 (file)
@@ -14,7 +14,7 @@
  * Its value should be as large as the maximum file descriptor limit we
  * are likely to run into on any platform.  Right now, that is 65536
  * which is the default hard fd limit on Solaris 9 */
-#ifndef _WIN32
+#if !defined(_WIN32) && !defined(KERNEL)
 #define FD_SETSIZE 65536
 #endif
 
@@ -26,7 +26,7 @@
 #endif
 
 RCSID
-    ("$Header: /cvs/openafs/src/rx/rx_globals.c,v 1.8 2004/07/19 14:39:42 jaltman Exp $");
+    ("$Header: /cvs/openafs/src/rx/rx_globals.c,v 1.8.2.1 2004/12/07 06:10:06 shadow Exp $");
 
 /* Enable data initialization when the header file is included */
 #define INIT(stuff) = stuff
index 2545055dca1bb0c401e5258d6c3449b0cd2d5401..30b49084360db196a6b95d8c1e80cd8de8f6bd46 100644 (file)
@@ -19,7 +19,9 @@
 #define _RX_KCOMMON_H_
 
 #ifdef AFS_LINUX22_ENV
+#ifndef _LINUX_CODA_FS_I
 #define _LINUX_CODA_FS_I 1
+#endif
 #define _CODA_HEADER_ 1
 struct coda_inode_info {
 };
index f2aead7e00f46e92e89fe316fecf277c3e6abeac..170c38d047af48692823f00e2f8fb9653b98567a 100644 (file)
@@ -22,7 +22,7 @@
 #include <afs/param.h>
 
 RCSID
-    ("$Header: /cvs/openafs/src/rx/rx_lwp.c,v 1.17 2004/07/19 14:39:42 jaltman Exp $");
+    ("$Header: /cvs/openafs/src/rx/rx_lwp.c,v 1.17.2.1 2004/12/07 06:10:06 shadow Exp $");
 
 # include <sys/types.h>                /* fd_set on older platforms */
 # include <errno.h>
@@ -75,7 +75,7 @@ rxi_Wakeup(void *addr)
 }
 
 PROCESS rx_listenerPid = 0;    /* LWP process id of socket listener process */
-static void rx_ListenerProc(void *dummy);
+static int rx_ListenerProc(void *dummy);
 
 /*
  * Delay the current thread the specified number of seconds.
@@ -126,7 +126,7 @@ rxi_StartServerProc(void (*proc) (void), int stacksize)
     char name[32];
 
     sprintf(name, "srv_%d", ++number);
-    LWP_CreateProcess(proc, stacksize, RX_PROCESS_PRIORITY, (void *)0,
+    LWP_CreateProcess((int (*)(void *))proc, stacksize, RX_PROCESS_PRIORITY, (void *)0,
                      "rx_ServerProc", &scratchPid);
     if (registerProgram)
        (*registerProgram) (scratchPid, name);
@@ -320,7 +320,7 @@ rxi_ListenerProc(fd_set * rfds, int *tnop, struct rx_call **newcallp)
 /* This is the listener process request loop. The listener process loop
  * becomes a server thread when rxi_ListenerProc returns, and stays
  * server thread until rxi_ServerProc returns. */
-static void
+static int
 rx_ListenerProc(void *dummy)
 {
     int threadID;
index e619c560e367b9a61722ce4943a42b43239f3073..26042af1560ec2ebc6be439a7a58c263c0aa749b 100644 (file)
@@ -11,7 +11,7 @@
 #include <afs/param.h>
 
 RCSID
-    ("$Header: /cvs/openafs/src/rx/rx_multi.c,v 1.8 2003/11/11 19:03:09 rees Exp $");
+    ("$Header: /cvs/openafs/src/rx/rx_multi.c,v 1.8.2.1 2004/12/07 06:10:06 shadow Exp $");
 
 #ifdef KERNEL
 #include "afs/sysincludes.h"
@@ -55,7 +55,7 @@ multi_Init(struct rx_connection **conns, register int nConns)
     for (i = 0; i < nConns; i++) {
        register struct rx_call *call;
        call = mh->calls[i] = rx_NewCall(conns[i]);
-       rx_SetArrivalProc(call, multi_Ready, (VOID *) mh, (VOID *) i);
+       rx_SetArrivalProc(call, multi_Ready, (VOID *) mh, i);
     }
     return mh;
 }
@@ -95,9 +95,10 @@ multi_Select(register struct multi_handle *mh)
 
 /* Called by Rx when the first reply packet of a call is received, or the call is aborted. */
 void
-multi_Ready(register struct rx_call *call, register struct multi_handle *mh,
+multi_Ready(register struct rx_call *call, register VOID *amh,
            register int index)
 {
+    register struct multi_handle *mh = (struct multi_handle *)amh;
 #ifdef RX_ENABLE_LOCKS
     MUTEX_ENTER(&mh->lock);
 #endif /* RX_ENABLE_LOCKS */
index bf8f9c3f585c60c38965ef73a472c34cc0043b35..6972fac874f8e6964d675dee117865fd260eece6 100644 (file)
@@ -15,7 +15,7 @@
 #endif
 
 RCSID
-    ("$Header: /cvs/openafs/src/rx/rx_packet.c,v 1.35.2.2 2004/10/18 17:43:58 shadow Exp $");
+    ("$Header: /cvs/openafs/src/rx/rx_packet.c,v 1.35.2.3 2004/12/07 06:10:06 shadow Exp $");
 
 #ifdef KERNEL
 #if defined(UKERNEL)
@@ -480,7 +480,7 @@ rx_CheckPackets(void)
 void
 rxi_FreePacketNoLock(struct rx_packet *p)
 {
-    dpf(("Free %x\n", (int)p));
+    dpf(("Free %lx\n", (unsigned long)p));
 
     if (p->flags & RX_PKTFLAG_FREE)
        osi_Panic("rxi_FreePacketNoLock: packet already free\n");
@@ -652,7 +652,7 @@ rxi_AllocPacketNoLock(int class)
     if (!(p->flags & RX_PKTFLAG_FREE))
        osi_Panic("rxi_AllocPacket: packet not free\n");
 
-    dpf(("Alloc %x, class %d\n", (int)p, class));
+    dpf(("Alloc %lx, class %d\n", (unsigned long)p, class));
 
     queue_Remove(p);
     p->flags = 0;              /* clear RX_PKTFLAG_FREE, initialize the rest */
@@ -1653,7 +1653,7 @@ rxi_SendPacket(struct rx_call *call, struct rx_connection *conn,
        AFS_RXGLOCK();
 #ifdef RXDEBUG
     }
-    dpf(("%c %d %s: %x.%u.%u.%u.%u.%u.%u flags %d, packet %x resend %d.%0.3d len %d", deliveryType, p->header.serial, rx_packetTypes[p->header.type - 1], peer->host, peer->port, p->header.serial, p->header.epoch, p->header.cid, p->header.callNumber, p->header.seq, p->header.flags, (int)p, p->retryTime.sec, p->retryTime.usec / 1000, p->length));
+    dpf(("%c %d %s: %x.%u.%u.%u.%u.%u.%u flags %d, packet %lx resend %d.%0.3d len %d", deliveryType, p->header.serial, rx_packetTypes[p->header.type - 1], peer->host, peer->port, p->header.serial, p->header.epoch, p->header.cid, p->header.callNumber, p->header.seq, p->header.flags, (unsigned long)p, p->retryTime.sec, p->retryTime.usec / 1000, p->length));
 #endif
     MUTEX_ENTER(&rx_stats_mutex);
     rx_stats.packetsSent[p->header.type - 1]++;
@@ -1832,7 +1832,7 @@ rxi_SendPacketList(struct rx_call *call, struct rx_connection *conn,
 
     assert(p != NULL);
 
-    dpf(("%c %d %s: %x.%u.%u.%u.%u.%u.%u flags %d, packet %x resend %d.%0.3d len %d", deliveryType, p->header.serial, rx_packetTypes[p->header.type - 1], peer->host, peer->port, p->header.serial, p->header.epoch, p->header.cid, p->header.callNumber, p->header.seq, p->header.flags, (int)p, p->retryTime.sec, p->retryTime.usec / 1000, p->length));
+    dpf(("%c %d %s: %x.%u.%u.%u.%u.%u.%u flags %d, packet %lx resend %d.%0.3d len %d", deliveryType, p->header.serial, rx_packetTypes[p->header.type - 1], peer->host, peer->port, p->header.serial, p->header.epoch, p->header.cid, p->header.callNumber, p->header.seq, p->header.flags, (unsigned long)p, p->retryTime.sec, p->retryTime.usec / 1000, p->length));
 
 #endif
     MUTEX_ENTER(&rx_stats_mutex);
index 6d57e165ef07882ce3a54db9190d79b2892fc4ee..bfdd1b4bd8c9e9d18f42b113fdeecad72c136792 100644 (file)
@@ -13,6 +13,7 @@
 /* rx.c */
 extern void rx_SetEpoch(afs_uint32 epoch);
 extern int rx_Init(u_int port);
+extern int rx_InitHost(u_int host, u_int port);
 #ifndef KERNEL
 extern void rxi_StartServerProcs(int nExistingProcs);
 #endif
@@ -48,12 +49,11 @@ extern void rx_WakeupServerProcs(void);
 extern struct rx_call *rx_GetCall(int tno, struct rx_service *cur_service,
                                  osi_socket * socketp);
 extern void rx_SetArrivalProc(register struct rx_call *call,
-                             register VOID(*proc) (register struct rx_call *
+                             register void (*proc) (register struct rx_call *
                                                    call,
-                                                   register struct
-                                                   multi_handle * mh,
+                                                   register VOID * mh,
                                                    register int index),
-                             register VOID * handle, register VOID * arg);
+                             register VOID * handle, register int arg);
 extern afs_int32 rx_EndCall(register struct rx_call *call, afs_int32 rc);
 extern void rx_Finalize(void);
 extern void rxi_PacketsUnWait(void);
@@ -128,9 +128,10 @@ extern struct rx_packet *rxi_SendAck(register struct rx_call *call, register str
                                     *optionalPacket, int serial, int reason,
                                     int istack);
 extern void rxi_StartUnlocked(struct rxevent *event,
-                             register struct rx_call *call, int istack);
+                             register struct rx_call *call,
+                             void *arg1, int istack);
 extern void rxi_Start(struct rxevent *event, register struct rx_call *call,
-                     int istack);
+                     void *arg1, int istack);
 extern void rxi_Send(register struct rx_call *call,
                     register struct rx_packet *p, int istack);
 #ifdef RX_ENABLE_LOCKS
@@ -150,7 +151,7 @@ extern void rxi_SendDelayedCallAbort(struct rxevent *event,
                                     char *dummy);
 extern void rxi_ChallengeEvent(struct rxevent *event,
                               register struct rx_connection *conn,
-                              void *atries);
+                              void *arg1, int atries);
 extern void rxi_ChallengeOn(register struct rx_connection *conn);
 extern void rxi_ComputeRoundTripTime(register struct rx_packet *p,
                                     register struct clock *sentp,
@@ -284,6 +285,8 @@ at another time. */
 #else
 extern struct rxevent *rxevent_Post(struct clock *when, void (*func) (),
                                    void *arg, void *arg1);
+extern struct rxevent *rxevent_Post2(struct clock *when, void (*func) (),
+                                   void *arg, void *arg1, int arg2);
 #endif
 extern void shutdown_rxevent(void);
 extern struct rxepoch *rxepoch_Allocate(struct clock *when);
@@ -416,7 +419,7 @@ extern struct multi_handle *multi_Init(struct rx_connection **conns,
                                       register int nConns);
 extern int multi_Select(register struct multi_handle *mh);
 extern void multi_Ready(register struct rx_call *call,
-                       register struct multi_handle *mh, register int index);
+                       register VOID *mh, register int index);
 extern void multi_Finalize(register struct multi_handle *mh);
 extern void multi_Finalize_Ignore(register struct multi_handle *mh);
 
index c2521f83dc46b97cafc7cd8982ecfe4b3ede99de..ed1e728b14db70b419aaa8947956b83ef24d0d98 100644 (file)
@@ -15,7 +15,7 @@
 #endif
 
 RCSID
-    ("$Header: /cvs/openafs/src/rx/rx_rdwr.c,v 1.21.2.1 2004/10/18 07:12:06 shadow Exp $");
+    ("$Header: /cvs/openafs/src/rx/rx_rdwr.c,v 1.21.2.2 2004/12/07 06:10:06 shadow Exp $");
 
 #ifdef KERNEL
 #ifndef UKERNEL
@@ -724,7 +724,7 @@ rxi_WriteProc(register struct rx_call *call, register char *buf,
                    (call->
                     flags & (RX_CALL_FAST_RECOVER |
                              RX_CALL_FAST_RECOVER_WAIT))) {
-                   rxi_Start(0, call, 0);
+                   rxi_Start(0, call, 0, 0);
                }
            }
            /* Wait for transmit window to open up */
@@ -1196,7 +1196,7 @@ rxi_WritevProc(struct rx_call *call, struct iovec *iov, int nio, int nbytes)
     }
 
     if (!(call->flags & (RX_CALL_FAST_RECOVER | RX_CALL_FAST_RECOVER_WAIT))) {
-       rxi_Start(0, call, 0);
+       rxi_Start(0, call, 0, 0);
     }
 
     /* Wait for the length of the transmit queue to fall below call->twind */
@@ -1312,7 +1312,7 @@ rxi_FlushWrite(register struct rx_call *call)
        if (!
            (call->
             flags & (RX_CALL_FAST_RECOVER | RX_CALL_FAST_RECOVER_WAIT))) {
-           rxi_Start(0, call, 0);
+           rxi_Start(0, call, 0, 0);
        }
     }
 }
index a6c9560e3a1e4d03ad07ca5a09bbd88af9735322..169d6f8bd15df7dbf3521278be00666f93e37edc 100644 (file)
@@ -11,7 +11,7 @@
 #include <afs/param.h>
 
 RCSID
-    ("$Header: /cvs/openafs/src/rx/rxdebug.c,v 1.15.2.2 2004/10/18 17:43:59 shadow Exp $");
+    ("$Header: /cvs/openafs/src/rx/rxdebug.c,v 1.15.2.3 2004/12/07 06:06:50 shadow Exp $");
 
 #include <sys/types.h>
 #include <errno.h>
@@ -113,6 +113,7 @@ MainCommand(as, arock)
     int withPeers;
     struct rx_debugStats tstats;
     char *portName, *hostName;
+    char hoststr[20];
     struct rx_debugConn tconn;
     short noConns;
     short showPeers;
@@ -213,7 +214,8 @@ MainCommand(as, arock)
     dallyCounter = 0;
 
     hostAddr.s_addr = host;
-    printf("Trying %s (port %d):\n", inet_ntoa(hostAddr), ntohs(port));
+    afs_inet_ntoa_r(hostAddr.s_addr, hoststr);
+    printf("Trying %s (port %d):\n", hoststr, ntohs(port));
     s = socket(AF_INET, SOCK_DGRAM, 0);
     taddr.sin_family = AF_INET;
     taddr.sin_port = 0;
@@ -322,8 +324,9 @@ MainCommand(as, arock)
        }
        if (onlyHost != -1) {
            hostAddr.s_addr = onlyHost;
+           afs_inet_ntoa_r(hostAddr.s_addr, hoststr);
            printf("Showing only connections from host %s\n",
-                  inet_ntoa(hostAddr));
+                  hoststr);
        }
        if (onlyPort != -1)
            printf("Showing only connections on port %u\n", ntohs(onlyPort));
@@ -382,7 +385,8 @@ MainCommand(as, arock)
 
            /* now display the connection */
            hostAddr.s_addr = tconn.host;
-           printf("Connection from host %s, port %hu, ", inet_ntoa(hostAddr),
+           afs_inet_ntoa_r(hostAddr.s_addr, hoststr);
+           printf("Connection from host %s, port %hu, ", hoststr,
                   ntohs(tconn.port));
            if (tconn.epoch)
                printf("Cuid %x/%x", tconn.epoch, tconn.cid);
@@ -544,7 +548,8 @@ MainCommand(as, arock)
 
            /* now display the peer */
            hostAddr.s_addr = tpeer.host;
-           printf("Peer at host %s, port %hu\n", inet_ntoa(hostAddr),
+           afs_inet_ntoa_r(hostAddr.s_addr, hoststr);
+           printf("Peer at host %s, port %hu\n", hoststr, 
                   ntohs(tpeer.port));
            printf("\tifMTU %hu\tnatMTU %hu\tmaxMTU %hu\n", tpeer.ifMTU,
                   tpeer.natMTU, tpeer.maxMTU);
index b118a6fc04ad0b8d0b29df1a7f199229e39efdfb..25bb6da81fdfc54648c9d37179a968ea62b9c998 100644 (file)
@@ -35,7 +35,7 @@
 #endif
 
 RCSID
-    ("$Header: /cvs/openafs/src/rx/xdr.c,v 1.9 2003/11/29 22:08:16 jaltman Exp $");
+    ("$Header: /cvs/openafs/src/rx/xdr.c,v 1.9.2.1 2004/12/07 06:10:06 shadow Exp $");
 
 /*
  * xdr.c, Generic XDR routines implementation.
@@ -80,126 +80,116 @@ xdr_void(void)
     return (TRUE);
 }
 
-#if !defined(AFS_OSF20_ENV) && !defined(AFS_SGI61_ENV)
 /*
- * XDR afs_int32 integers
- * same as xdr_u_long - open coded to save a proc call!
+ * XDR integers
  */
 bool_t
 xdr_int(register XDR * xdrs, int *ip)
 {
+    afs_int32 l;
 
-    if (xdrs->x_op == XDR_ENCODE)
-       return (XDR_PUTINT32(xdrs, (long *)ip));
+    switch (xdrs->x_op) {
 
-    if (xdrs->x_op == XDR_DECODE)
-       return (XDR_GETINT32(xdrs, (long *)ip));
+    case XDR_ENCODE:
+       l = (afs_int32) * ip;
+       return (XDR_PUTINT32(xdrs, &l));
 
-    if (xdrs->x_op == XDR_FREE)
+    case XDR_DECODE:
+       if (!XDR_GETINT32(xdrs, &l)) {
+           return (FALSE);
+       }
+       *ip = (int)l;
        return (TRUE);
 
-    return (FALSE);
-}
-
-/*
- * XDR unsigned afs_int32 integers
- * same as xdr_long - open coded to save a proc call!
- */
-bool_t
-xdr_u_int(register XDR * xdrs, u_int * up)
-{
-
-    if (xdrs->x_op == XDR_DECODE)
-       return (XDR_GETINT32(xdrs, (long *)up));
-
-    if (xdrs->x_op == XDR_ENCODE)
-       return (XDR_PUTINT32(xdrs, (long *)up));
-
-    if (xdrs->x_op == XDR_FREE)
+    case XDR_FREE:
        return (TRUE);
-
+    }
     return (FALSE);
 }
 
-#else
 /*
- * XDR afs_int32 integers
- * same as xdr_u_long - open coded to save a proc call!
+ * XDR unsigned integers
  */
 bool_t
-xdr_int(register XDR * xdrs, int *lp)
+xdr_u_int(register XDR * xdrs, u_int * uip)
 {
+    afs_uint32 l;
 
-    if (xdrs->x_op == XDR_ENCODE)
-       return (XDR_PUTINT32(xdrs, (long *)lp));
+    switch (xdrs->x_op) {
 
-    if (xdrs->x_op == XDR_DECODE)
-       return (XDR_GETINT32(xdrs, (long *)lp));
+    case XDR_ENCODE:
+       l = (afs_uint32) * uip;
+       return (XDR_PUTINT32(xdrs, &l));
 
-    if (xdrs->x_op == XDR_FREE)
+    case XDR_DECODE:
+       if (!XDR_GETINT32(xdrs, &l)) {
+           return (FALSE);
+       }
+       *uip = (u_int) l;
        return (TRUE);
 
+    case XDR_FREE:
+       return (TRUE);
+    }
     return (FALSE);
 }
 
+
 /*
- * XDR unsigned afs_int32 integers
- * same as xdr_long - open coded to save a proc call!
+ * XDR long integers
  */
 bool_t
-xdr_u_int(register XDR * xdrs, u_int * ulp)
+xdr_long(register XDR * xdrs, long *lp)
 {
+    afs_int32 l;
 
-    if (xdrs->x_op == XDR_DECODE)
-       return (XDR_GETINT32(xdrs, (long *)ulp));
+    switch (xdrs->x_op) {
 
-    if (xdrs->x_op == XDR_ENCODE)
-       return (XDR_PUTINT32(xdrs, (long *)ulp));
+    case XDR_ENCODE:
+       l = (afs_int32) * lp;
+       return (XDR_PUTINT32(xdrs, &l));
 
-    if (xdrs->x_op == XDR_FREE)
+    case XDR_DECODE:
+       if (!XDR_GETINT32(xdrs, &l)) {
+           return (FALSE);
+       }
+       *lp = (long)l;
        return (TRUE);
 
+    case XDR_FREE:
+       return (TRUE);
+    }
     return (FALSE);
 }
-#endif
 
 /*
- * XDR afs_int32 integers
- * same as xdr_u_long - open coded to save a proc call!
+ * XDR unsigned long integers
  */
 bool_t
-xdr_long(register XDR * xdrs, long *lp)
+xdr_u_long(register XDR * xdrs, u_long * ulp)
 {
+    afs_uint32 l;
 
-    if (xdrs->x_op == XDR_ENCODE)
-       return (XDR_PUTINT32(xdrs, lp));
+    switch (xdrs->x_op) {
 
-    if (xdrs->x_op == XDR_DECODE)
-       return (XDR_GETINT32(xdrs, lp));
+    case XDR_ENCODE:
+       l = (afs_uint32) * ulp;
+       return (XDR_PUTINT32(xdrs, &l));
 
-    if (xdrs->x_op == XDR_FREE)
+    case XDR_DECODE:
+       if (!XDR_GETINT32(xdrs, &l)) {
+           return (FALSE);
+       }
+       *ulp = (u_long) l;
        return (TRUE);
 
-    return (FALSE);
-}
-
-/*
- * XDR unsigned afs_int32 integers
- * same as xdr_long - open coded to save a proc call!
- */
-bool_t
-xdr_u_long(register XDR * xdrs, u_long * ulp)
-{
-
-    if (xdrs->x_op == XDR_DECODE)
-       return (XDR_GETINT32(xdrs, ulp));
-    if (xdrs->x_op == XDR_ENCODE)
-       return (XDR_PUTINT32(xdrs, ulp));
-    if (xdrs->x_op == XDR_FREE)
+    case XDR_FREE:
        return (TRUE);
+    }
     return (FALSE);
 }
 
+
 /*
  * XDR chars
  */
@@ -384,7 +374,7 @@ xdr_opaque(register XDR * xdrs, caddr_t cp, register u_int cnt)
        }
        if (rndup == 0)
            return (TRUE);
-       return (XDR_GETBYTES(xdrs, crud, rndup));
+       return (XDR_GETBYTES(xdrs, (caddr_t)crud, rndup));
     }
 
     if (xdrs->x_op == XDR_ENCODE) {
@@ -538,6 +528,8 @@ xdr_string(register XDR * xdrs, char **cpp, u_int maxsize)
     case XDR_ENCODE:
        size = strlen(sp);
        break;
+    case XDR_DECODE:
+       break;
     }
 
     if (!xdr_u_int(xdrs, &size)) {
index 04106554d81dcda17d4e85280cde2d3d06d3a61a..b8f41d101f589a7b9288d297b50d2279a5a88d66 100644 (file)
@@ -15,7 +15,7 @@
 #include "afs/param.h"
 
 RCSID
-    ("$Header: /cvs/openafs/src/rx/xdr_afsuuid.c,v 1.8 2004/05/15 04:53:30 shadow Exp $");
+    ("$Header: /cvs/openafs/src/rx/xdr_afsuuid.c,v 1.8.2.1 2004/12/07 06:10:06 shadow Exp $");
 
 #if defined(KERNEL) && !defined(UKERNEL)
 #ifdef AFS_LINUX20_ENV
@@ -55,7 +55,8 @@ xdr_afsUUID(XDR * xdrs, afsUUID * objp)
     if (!xdr_char(xdrs, &objp->clock_seq_low)) {
        return (FALSE);
     }
-    if (!xdr_vector(xdrs, (char *)objp->node, 6, sizeof(char), xdr_char)) {
+    /* Cast needed here because xdrproc_t officially takes 3 args :-( */
+    if (!xdr_vector(xdrs, (char *)objp->node, 6, sizeof(char), (xdrproc_t)xdr_char)) {
        return (FALSE);
     }
     return (TRUE);
index 7b1734a1639cd742139c4fa98aaa4d02cfb3013c..b58d9b5cb068d85271fa614e6573a641cf94b909 100644 (file)
@@ -30,7 +30,7 @@
 #include <afs/param.h>
 
 RCSID
-    ("$Header: /cvs/openafs/src/rx/xdr_array.c,v 1.9 2003/11/29 22:08:16 jaltman Exp $");
+    ("$Header: /cvs/openafs/src/rx/xdr_array.c,v 1.9.2.1 2004/12/07 06:10:06 shadow Exp $");
 
 #ifndef        NeXT
 
@@ -119,6 +119,9 @@ xdr_array(register XDR * xdrs, caddr_t * addrp, u_int * sizep, u_int maxsize,
 
        case XDR_FREE:
            return (TRUE);
+
+       case XDR_ENCODE:
+           break;
        }
 
     /*
index 21486e93153a21fdac6ec17e970fb1030fc3bc3a..fe700d4662407dc7c664f631f8c71d48ed513c35 100644 (file)
@@ -30,7 +30,7 @@
 #include <afs/param.h>
 
 RCSID
-    ("$Header: /cvs/openafs/src/rx/xdr_arrayn.c,v 1.8 2003/07/15 23:16:12 shadow Exp $");
+    ("$Header: /cvs/openafs/src/rx/xdr_arrayn.c,v 1.8.2.1 2004/12/07 06:10:06 shadow Exp $");
 
 #if !defined(NeXT)
 
@@ -123,6 +123,9 @@ xdr_arrayN(register XDR * xdrs, caddr_t * addrp, u_int * sizep, u_int maxsize,
 
        case XDR_FREE:
            return (TRUE);
+
+       case XDR_ENCODE:
+           break;
        }
 
     /*
index 21c1aa3ac1da44cfafbd254594a01b2b8fd86238..a7e72aec272a5e2ed07fbfa397643d3876d667b4 100644 (file)
@@ -35,7 +35,7 @@
 #endif
 
 RCSID
-    ("$Header: /cvs/openafs/src/rx/xdr_int32.c,v 1.5 2003/07/15 23:16:12 shadow Exp $");
+    ("$Header: /cvs/openafs/src/rx/xdr_int32.c,v 1.5.2.1 2004/12/07 06:10:07 shadow Exp $");
 
 #ifndef        NeXT
 
@@ -55,10 +55,10 @@ xdr_afs_int32(register XDR * xdrs, afs_int32 * lp)
 {
 
     if (xdrs->x_op == XDR_ENCODE)
-       return (XDR_PUTINT32(xdrs, (long *)lp));
+       return (XDR_PUTINT32(xdrs, lp));
 
     if (xdrs->x_op == XDR_DECODE)
-       return (XDR_GETINT32(xdrs, (long *)lp));
+       return (XDR_GETINT32(xdrs, lp));
 
     if (xdrs->x_op == XDR_FREE)
        return (TRUE);
@@ -75,9 +75,9 @@ xdr_afs_uint32(register XDR * xdrs, afs_uint32 * ulp)
 {
 
     if (xdrs->x_op == XDR_DECODE)
-       return (XDR_GETINT32(xdrs, (long *)ulp));
+       return (XDR_GETINT32(xdrs, (afs_int32 *)ulp));
     if (xdrs->x_op == XDR_ENCODE)
-       return (XDR_PUTINT32(xdrs, (long *)ulp));
+       return (XDR_PUTINT32(xdrs, (afs_int32 *)ulp));
     if (xdrs->x_op == XDR_FREE)
        return (TRUE);
     return (FALSE);
index 0bf95d9530a063ed402bbf3c41242dbf4b4a6fdb..36b86a96bbbd3f523abdc9ca00e3d22e1d7e1180 100644 (file)
@@ -19,7 +19,7 @@
 #endif
 
 RCSID
-    ("$Header: /cvs/openafs/src/rx/xdr_rx.c,v 1.10 2004/05/15 04:53:30 shadow Exp $");
+    ("$Header: /cvs/openafs/src/rx/xdr_rx.c,v 1.10.2.1 2004/12/07 06:10:07 shadow Exp $");
 
 #ifdef KERNEL
 #ifndef UKERNEL
@@ -73,11 +73,21 @@ RCSID
 #if defined(KERNEL)
 /*
  * kernel version needs to agree with <rpc/xdr.h>
+ * except on Linux which does XDR differently from everyone else
  */
+# if defined(AFS_LINUX20_ENV) && !defined(UKERNEL)
+#  define AFS_XDRS_T void *
+# else
+#  define AFS_XDRS_T XDR *
+# endif
 # if defined(AFS_SUN57_ENV)
 #  define AFS_RPC_INLINE_T rpc_inline_t
 # elif defined(AFS_DUX40_ENV)
 #  define AFS_RPC_INLINE_T int
+# elif defined(AFS_LINUX20_ENV) && !defined(UKERNEL)
+#  define AFS_RPC_INLINE_T afs_int32
+# elif defined(AFS_LINUX20_ENV)
+#  define AFS_RPC_INLINE_T int32_t *
 # else
 #  define AFS_RPC_INLINE_T long
 # endif
@@ -85,23 +95,23 @@ RCSID
 /*
  * user version needs to agree with "xdr.h", i.e. <rx/xdr.h>
  */
+#  define AFS_XDRS_T void *
 #  define AFS_RPC_INLINE_T afs_int32
 #endif /* KERNEL */
 
 /* Static prototypes */
 #if (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG != _MIPS_SZINT)) || defined(AFS_HPUX_64BIT_ENV)
-static bool_t xdrrx_getint64(XDR * xdrs, long *lp);
-static bool_t xdrrx_putint64(XDR * xdrs, long *lp);
+static bool_t xdrrx_getint64(AFS_XDRS_T axdrs, long *lp);
+static bool_t xdrrx_putint64(AFS_XDRS_T axdrs, long *lp);
 #endif /* (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG != _MIPS_SZINT)) || defined(AFS_HPUX_64BIT_ENV) */
 
-static bool_t xdrrx_getint32(XDR * xdrs, afs_int32 * lp);
-static bool_t xdrrx_putint32(register XDR * xdrs, register afs_int32 * lp);
-static bool_t xdrrx_getbytes(register XDR * xdrs, register caddr_t addr,
+static bool_t xdrrx_getint32(AFS_XDRS_T axdrs, afs_int32 * lp);
+static bool_t xdrrx_putint32(AFS_XDRS_T axdrs, register afs_int32 * lp);
+static bool_t xdrrx_getbytes(AFS_XDRS_T axdrs, register caddr_t addr,
                             register u_int len);
-static bool_t xdrrx_putbytes(register XDR * xdrs, register caddr_t addr,
+static bool_t xdrrx_putbytes(AFS_XDRS_T axdrs, register caddr_t addr,
                             register u_int len);
-static AFS_RPC_INLINE_T *xdrrx_inline(register XDR * xdrs,
-                                     register u_int len);
+static AFS_RPC_INLINE_T *xdrrx_inline(AFS_XDRS_T axdrs, register u_int len);
 
 
 /*
@@ -149,8 +159,9 @@ int rx_pin_failed = 0;
 
 #if (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG != _MIPS_SZINT)) || defined(AFS_HPUX_64BIT_ENV)
 static bool_t
-xdrrx_getint64(XDR * xdrs, long *lp)
+xdrrx_getint64(AFS_XDRS_T axdrs, long *lp)
 {
+    XDR * xdrs = (XDR *)axdrs;
     register struct rx_call *call = ((struct rx_call *)(xdrs)->x_private);
     afs_int32 i;
 
@@ -162,8 +173,9 @@ xdrrx_getint64(XDR * xdrs, long *lp)
 }
 
 static bool_t
-xdrrx_putint64(XDR * xdrs, long *lp)
+xdrrx_putint64(AFS_XDRS_T axdrs, long *lp)
 {
+    XDR * xdrs = (XDR *)axdrs;
     afs_int32 code, i = htonl(*lp);
     register struct rx_call *call = ((struct rx_call *)(xdrs)->x_private);
 
@@ -173,9 +185,10 @@ xdrrx_putint64(XDR * xdrs, long *lp)
 #endif /* (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG != _MIPS_SZINT)) || defined(AFS_HPUX_64BIT_ENV) */
 
 static bool_t
-xdrrx_getint32(XDR * xdrs, afs_int32 * lp)
+xdrrx_getint32(AFS_XDRS_T axdrs, afs_int32 * lp)
 {
     afs_int32 l;
+    XDR * xdrs = (XDR *)axdrs;
     register struct rx_call *call = ((struct rx_call *)(xdrs)->x_private);
 #if    defined(KERNEL) && defined(AFS_AIX32_ENV)
     char *saddr = (char *)&l;
@@ -211,9 +224,10 @@ xdrrx_getint32(XDR * xdrs, afs_int32 * lp)
 }
 
 static bool_t
-xdrrx_putint32(register XDR * xdrs, register afs_int32 * lp)
+xdrrx_putint32(register AFS_XDRS_T axdrs, register afs_int32 * lp)
 {
     afs_int32 code, l = htonl(*lp);
+    XDR * xdrs = (XDR *)axdrs;
     register struct rx_call *call = ((struct rx_call *)(xdrs)->x_private);
 #if    defined(KERNEL) && defined(AFS_AIX32_ENV)
     char *saddr = (char *)&code;
@@ -241,9 +255,10 @@ xdrrx_putint32(register XDR * xdrs, register afs_int32 * lp)
 }
 
 static bool_t
-xdrrx_getbytes(register XDR * xdrs, register caddr_t addr, register u_int len)
+xdrrx_getbytes(register AFS_XDRS_T axdrs, register caddr_t addr, register u_int len)
 {
     afs_int32 code;
+    XDR * xdrs = (XDR *)axdrs;
     register struct rx_call *call = ((struct rx_call *)(xdrs)->x_private);
 #if    defined(KERNEL) && defined(AFS_AIX32_ENV)
     char *saddr = (char *)&code;
@@ -272,9 +287,10 @@ xdrrx_getbytes(register XDR * xdrs, register caddr_t addr, register u_int len)
 }
 
 static bool_t
-xdrrx_putbytes(register XDR * xdrs, register caddr_t addr, register u_int len)
+xdrrx_putbytes(register AFS_XDRS_T axdrs, register caddr_t addr, register u_int len)
 {
     afs_int32 code;
+    XDR * xdrs = (XDR *)axdrs;
     register struct rx_call *call = ((struct rx_call *)(xdrs)->x_private);
 #if    defined(KERNEL) && defined(AFS_AIX32_ENV)
     char *saddr = (char *)&code;
@@ -319,7 +335,7 @@ xdrrx_setpos(register XDR * xdrs, u_int pos)
 #endif
 
 static AFS_RPC_INLINE_T *
-xdrrx_inline(register XDR * xdrs, register u_int len)
+xdrrx_inline(AFS_XDRS_T axdrs, register u_int len)
 {
     /* I don't know what this routine is supposed to do, but the stdio module returns null, so we will, too */
     return (0);
index 32010bab0808f8d40c23868096bb13fc624b9259..51aa5de5c14cf750a6653e4aeff7d211e8013653 100644 (file)
@@ -11,7 +11,7 @@
 #include <afs/param.h>
 
 RCSID
-    ("$Header: /cvs/openafs/src/rxdebug/rxdebug.c,v 1.5 2003/07/15 23:16:38 shadow Exp $");
+    ("$Header: /cvs/openafs/src/rxdebug/rxdebug.c,v 1.5.2.1 2004/12/07 06:17:15 shadow Exp $");
 
 #include <sys/types.h>
 #include <errno.h>
@@ -21,6 +21,7 @@ RCSID
 #include <sys/socket.h>
 #include <sys/file.h>
 #include <netdb.h>
+#include <arpa/inet.h>
 #endif
 #ifdef HAVE_NETINET_IN_H
 #include <netinet/in.h>
index c3f9ee7fdfa64bd68f2bd7465dd1d0c54cf997c6..c082725f63bda00d6fd249af97d4d094d10cdf2a 100644 (file)
@@ -100,14 +100,14 @@ md4.o: md4.c ${INCLS}
  
 md5.o: md5.c ${INCLS}
 
-fcrypt.o: domestic/fcrypt.c fcrypt.h sboxes.h rxkad.h rxkad_prototypes.h
-       ${CCOBJ} ${CFLAGS} -c domestic/fcrypt.c
+fcrypt.o: ${srcdir}/domestic/fcrypt.c fcrypt.h sboxes.h rxkad.h rxkad_prototypes.h
+       ${CCOBJ} ${CFLAGS} -c ${srcdir}/domestic/fcrypt.c
 
-crypt_conn.o: domestic/crypt_conn.c fcrypt.h private_data.h ${INCLS}
-       ${CCOBJ} ${CFLAGS} -c domestic/crypt_conn.c
+crypt_conn.o: ${srcdir}/domestic/crypt_conn.c fcrypt.h private_data.h ${INCLS}
+       ${CCOBJ} ${CFLAGS} -c ${srcdir}/domestic/crypt_conn.c
 
-tcrypt.o: domestic/tcrypt.c AFS_component_version_number.o
-       ${CCOBJ} ${CFLAGS} -c domestic/fcrypt.c
+tcrypt.o: ${srcdir}/domestic/tcrypt.c AFS_component_version_number.o
+       ${CCOBJ} ${CFLAGS} -c ${srcdir}/domestic/fcrypt.c
 
 tcrypt: tcrypt.o librxkad.a 
        ${CC} -o tcrypt tcrypt.o librxkad.a
index 5887d23cf40c7516ab033605fdd4fd2fecf288fe..0caab625d52950433a2f1d02ba70d7222881e333 100644 (file)
                /* no ticket good for longer than 30 days */
 #define MAXKTCTICKETLIFETIME (30*24*3600)
 #define MINKTCTICKETLEN              32
+
+#if defined(AFS_AIX52_ENV)
+#ifdef __XCOFF64__
 #define        MAXKTCTICKETLEN       12000     /* was 344 */
+#else
+#define MAXKTCTICKETLEN                344
+#endif
+#else
+#define        MAXKTCTICKETLEN       12000     /* was 344 */
+#endif
+
 #define        MAXKTCNAMELEN         64        /* name & inst should be 256 */
 #define MAXKTCREALMLEN       64        /* should be 256 */
 #define KTC_TIME_UNCERTAINTY (15*60)   /* max skew bet. machines' clocks */
index ec77f9c57129ae8eb2f655074fe8d149c60dde9a..33562561445dcbf0f725f3140816e642fd99ccf7 100644 (file)
@@ -23,7 +23,7 @@
 #define INCLUDE_RXKAD_PRIVATE_DECLS
 
 RCSID
-    ("$Header: /cvs/openafs/src/rxkad/rxkad_common.c,v 1.20.2.1 2004/08/25 07:09:42 shadow Exp $");
+    ("$Header: /cvs/openafs/src/rxkad/rxkad_common.c,v 1.20.2.2 2004/12/07 06:10:16 shadow Exp $");
 
 #ifdef KERNEL
 #ifndef UKERNEL
@@ -83,7 +83,7 @@ RCSID
 #endif
 /* variable initialization for the benefit of darwin compiler; if it causes
    problems elsewhere, conditionalize for darwin or fc_test compile breaks */
-struct rxkad_stats rxkad_stats = { 0 };
+struct rxkad_stats rxkad_stats = { { 0 } };
 
 /* static prototypes */
 static afs_int32 ComputeSum(struct rx_packet *apacket,
@@ -421,7 +421,7 @@ rxkad_PreparePacket(struct rx_securityClass *aobj, struct rx_call *acall,
     fc_KeySchedule *schedule;
     fc_InitializationVector *ivec;
     int len;
-    int nlen;
+    int nlen = 0;
     int word;
     afs_int32 code;
     afs_int32 *preSeq;
index 471b8ac13c1c70deb3f257365ea519d8d0bbe61c..b7ce30758f200e92b3a88a4121978fde9d101b2c 100644 (file)
@@ -50,14 +50,13 @@ extern int rxkad_GetResponse(struct rx_securityClass *aobj,
 extern void rxkad_ResetState(void);
 
 /* rxkad_common.c */
-#if 0
-/* can't prototype these due to types */
+struct rxkad_endpoint;
 extern int rxkad_SetupEndpoint(struct rx_connection *aconnp,
                               struct rxkad_endpoint *aendpointp);
+struct rxkad_v2ChallengeResponse;
 extern afs_uint32 rxkad_CksumChallengeResponse(struct
                                               rxkad_v2ChallengeResponse
                                               *v2r);
-#endif
 extern int rxkad_DeriveXORInfo(struct rx_connection *aconnp,
                               fc_KeySchedule * aschedule, char *aivec,
                               char *aresult);
index 306423f266a250207e9aa04270782b2dabf2fc68..ecc7c74a0dc8486776a807137417cbfe66899b74 100644 (file)
@@ -63,8 +63,7 @@ UTILOBJS = \
        pthread_glock.o \
        get_krbrlm.o \
        dirpath.o \
-       fileutil.o \
-       casestrcpy.o
+       fileutil.o
 
 RXKADOBJS = \
        rxkad_errs.o
@@ -197,9 +196,6 @@ dirpath.o: ${UTIL}/dirpath.c
 fileutil.o: ${UTIL}/fileutil.c
        ${CCRULE}
 
-casestrcpy.o: ${UTIL}/casestrcpy.c
-       ${CCRULE}
-
 pthread_glock.o: ${UTIL}/pthread_glock.c
        ${CCRULE}
 
index 86588b40175428d8e5b9432d7cbf218f46214394..5bac1e13175a21766e346c27281d20d038b45d84 100644 (file)
@@ -37,6 +37,7 @@ SYSOBJS =\
        syscall.o
 
 UTILOBJS =\
+       assert.o \
        casestrcpy.o \
        base64.o
 
@@ -273,7 +274,7 @@ xdr_afsuuid.o: ${RX}/xdr_afsuuid.c
 #
 #   $ what /opt/langtools/bin/pxdb32
 #   /opt/langtools/bin/pxdb32:
-#           HP92453-02 A.10.0A HP-UX SYMBOLIC DEBUGGER (PXDB) $Revision: 1.15.2.1 $
+#           HP92453-02 A.10.0A HP-UX SYMBOLIC DEBUGGER (PXDB) $Revision: 1.15.2.3 $
 #
 # The problem occurs when -g and -O are both used when compiling des.c.
 # The simplest way to work around the problem is to leave out either -g or -O.
@@ -343,6 +344,9 @@ com_err.o: ${COMERR}/com_err.c
 casestrcpy.o: ${UTIL}/casestrcpy.c
        ${CCRULE}
 
+assert.o: ${UTIL}/assert.c
+       ${CCRULE}
+
 base64.o: ${UTIL}/base64.c
        ${CCRULE}
 
index c3e4becb2cad55b50b84eda47b460381a0bdc190..2e2b348ff6d05164090370ebe9540e9cd27e6078 100644 (file)
@@ -201,6 +201,13 @@ ${KERNELDIR}/afs:
 ${KERNELDIR}/afs/xfsattrs.h: xfsattrs.h
        ${INSTALL} $? $@
 
+depinstall: \
+       ${TOP_INCDIR}/afs/afssyscalls.h \
+       ${TOP_INCDIR}/afs/afs.exp \
+       ${TOP_INCDIR}/afs/xfsattrs.h \
+       ${KERNELDIR}/afs/xfsattrs.h \
+       ${UKERNELDIR}/afs/afsl.exp
+
 install: \
        ${DESTDIR}${libdir}/afs/libsys.a \
        ${DESTDIR}${sbindir}/rmtsysd \
index c9a805ac45672ae34caa1e5ce1893901c0cdbfc9..a7dec70948c5ba53600906466119cc0e70c9a8a3 100644 (file)
@@ -24,7 +24,7 @@ LIBOBJS =\
        $(OUT)\pioctl_nt.obj
 
 $(LIBFILE): $(LIBOBJS) $(DESTDIR)\lib\lanahelper.lib
-       $(LIBARCH) $(DESTDIR)\lib\lanahelper.lib
+       $(LIBARCH) $(DESTDIR)\lib\lanahelper.lib secur32.lib
 
 ############################################################################
 # Install target; primary makefile target
index f4bbbc03a88da3b6ee06863acdf3798a44340ca0..5c204e41f81a57c88d2cece84f81c9e21cee05bc 100644 (file)
@@ -11,7 +11,7 @@
 #include <afs/param.h>
 
 RCSID
-    ("$Header: /cvs/openafs/src/sys/pioctl_nt.c,v 1.18.2.3 2004/11/05 19:21:58 jaltman Exp $");
+    ("$Header: /cvs/openafs/src/sys/pioctl_nt.c,v 1.18.2.5 2004/12/07 06:15:58 shadow Exp $");
 
 #include <afs/stds.h>
 #include <windows.h>
@@ -22,6 +22,8 @@ RCSID
 #include <string.h>
 #include <winioctl.h>
 #include <winsock2.h>
+#define SECURITY_WIN32
+#include <security.h>
 #include <nb30.h>
 
 #include <osi.h>
@@ -129,6 +131,15 @@ GetIoctlHandle(char *fileNamep, HANDLE * handlep)
     char netbiosName[MAX_NB_NAME_LENGTH];
     char tbuffer[256]="";
     HANDLE fh;
+    HKEY hk;
+    char szUser[128] = "";
+    char szClient[MAX_PATH] = "";
+    char szPath[MAX_PATH] = "";
+    NETRESOURCE nr;
+    DWORD res;
+    DWORD ioctlDebug = IoctlDebug();
+    DWORD gle;
+    DWORD dwSize = sizeof(szUser);
 
     if (fileNamep) {
         drivep = strchr(fileNamep, ':');
@@ -188,15 +199,6 @@ GetIoctlHandle(char *fileNamep, HANDLE * handlep)
                    FILE_FLAG_WRITE_THROUGH, NULL);
     fflush(stdout);
     if (fh == INVALID_HANDLE_VALUE) {
-        HKEY hk;
-        char szUser[64] = "";
-        char szClient[MAX_PATH] = "";
-        char szPath[MAX_PATH] = "";
-        NETRESOURCE nr;
-        DWORD res;
-        DWORD ioctlDebug = IoctlDebug();
-        DWORD gle;
-
         gle = GetLastError();
         if (gle && ioctlDebug ) {
             char buf[4096];
@@ -210,62 +212,131 @@ GetIoctlHandle(char *fileNamep, HANDLE * handlep)
                                (va_list *) NULL
                                ) )
             {
-                fprintf(stderr,"pioctl CreateFile(%s) failed: [%s]\r\n",tbuffer,buf);
+                fprintf(stderr,"pioctl CreateFile(%s) failed: 0x%8X\r\n\t[%s]\r\n",
+                        tbuffer,gle,buf);
             }
         }
+#ifdef COMMENT
         if (gle != ERROR_DOWNGRADE_DETECTED)
             return -1;                                   
+#endif
 
         lana_GetNetbiosName(szClient, LANA_NETBIOS_NAME_FULL);
-        sprintf(szPath, "\\\\%s", szClient);
 
-        /* We should probably be using GetUserNameEx() for this */
         if (RegOpenKey (HKEY_CURRENT_USER, 
-                        TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer"), &hk) == 0)
+                         TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer"), &hk) == 0)
         {
-            DWORD dwSize = sizeof(szUser);
             DWORD dwType = REG_SZ;
             RegQueryValueEx (hk, TEXT("Logon User Name"), NULL, &dwType, (PBYTE)szUser, &dwSize);
             RegCloseKey (hk);
         }
-        if ( ioctlDebug )
-            fprintf(stderr, "pioctl logon user: [%s]\r\n",szUser);
-
-        memset (&nr, 0x00, sizeof(NETRESOURCE));
-        nr.dwType=RESOURCETYPE_DISK;
-        nr.lpLocalName=0;
-        nr.lpRemoteName=szPath;
-        res = WNetAddConnection2(&nr,NULL,szUser,0);
-        if (res) {
-            if ( ioctlDebug ) {
-                fprintf(stderr, "pioctl WNetAddConnection2(%s,%s) failed: 0x%X\r\n",
-                         szPath,szUser,res);
+
+        if ( szUser[0] ) {
+            if ( ioctlDebug )
+                fprintf(stderr, "pioctl logon user: [%s]\r\n",szUser);
+
+            sprintf(szPath, "\\\\%s", szClient);
+            memset (&nr, 0x00, sizeof(NETRESOURCE));
+            nr.dwType=RESOURCETYPE_DISK;
+            nr.lpLocalName=0;
+            nr.lpRemoteName=szPath;
+            res = WNetAddConnection2(&nr,NULL,szUser,0);
+            if (res) {
+                if ( ioctlDebug ) {
+                    fprintf(stderr, "pioctl WNetAddConnection2(%s,%s) failed: 0x%X\r\n",
+                             szPath,szUser,res);
+                }
+
+                sprintf(szPath, "\\\\%s\\all", szClient);
+                res = WNetAddConnection2(&nr,NULL,szUser,0);
+                if (res) {
+                    if ( ioctlDebug ) {
+                        fprintf(stderr, "pioctl WNetAddConnection2(%s,%s) failed: 0x%X\r\n",
+                                 szPath,szUser,res);
+                    }
+                    goto next_attempt;
+                }
+            }
+
+            fh = CreateFile(tbuffer, GENERIC_READ | GENERIC_WRITE,
+                             FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING,
+                             FILE_FLAG_WRITE_THROUGH, NULL);
+            fflush(stdout);
+            if (fh == INVALID_HANDLE_VALUE) {
+                gle = GetLastError();
+                if (gle && ioctlDebug ) {
+                    char buf[4096];
+
+                    if ( FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM,
+                                        NULL,
+                                        gle,
+                                        MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),
+                                        buf,
+                                        4096,
+                                        (va_list *) NULL
+                                        ) )
+                    {
+                        fprintf(stderr,"pioctl CreateFile(%s) failed: 0x%8X\r\n\t[%s]\r\n",
+                                 tbuffer,gle,buf);
+                    }
+                }
             }
-            return -1;
         }
+    }
+
+  next_attempt:
+    if ( fh == INVALID_HANDLE_VALUE ) {
+        if (GetUserNameEx(NameSamCompatible, szUser, &dwSize)) {
+            if ( ioctlDebug )
+                fprintf(stderr, "pioctl logon user: [%s]\r\n",szUser);
+
+            sprintf(szPath, "\\\\%s", szClient);
+            memset (&nr, 0x00, sizeof(NETRESOURCE));
+            nr.dwType=RESOURCETYPE_DISK;
+            nr.lpLocalName=0;
+            nr.lpRemoteName=szPath;
+            res = WNetAddConnection2(&nr,NULL,szUser,0);
+            if (res) {
+                if ( ioctlDebug ) {
+                    fprintf(stderr, "pioctl WNetAddConnection2(%s,%s) failed: 0x%X\r\n",
+                             szPath,szUser,res);
+                }
+
+                sprintf(szPath, "\\\\%s\\all", szClient);
+                res = WNetAddConnection2(&nr,NULL,szUser,0);
+                if (res) {
+                    if ( ioctlDebug ) {
+                        fprintf(stderr, "pioctl WNetAddConnection2(%s,%s) failed: 0x%X\r\n",
+                                 szPath,szUser,res);
+                    }
+                    return -1;
+                }
+            }
 
-        fh = CreateFile(tbuffer, GENERIC_READ | GENERIC_WRITE,
-                         FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING,
-                         FILE_FLAG_WRITE_THROUGH, NULL);
-        fflush(stdout);
-        if (fh == INVALID_HANDLE_VALUE) {
-            gle = GetLastError();
-            if (gle && ioctlDebug ) {
-                char buf[4096];
-
-                if ( FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM,
-                                    NULL,
-                                    gle,
-                                    MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),
-                                    buf,
-                                    4096,
-                                    (va_list *) NULL
-                                    ) )
-                {
-                    fprintf(stderr,"pioctl CreateFile(%s) failed: [%s]\r\n",tbuffer,buf);
+            fh = CreateFile(tbuffer, GENERIC_READ | GENERIC_WRITE,
+                             FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING,
+                             FILE_FLAG_WRITE_THROUGH, NULL);
+            fflush(stdout);
+            if (fh == INVALID_HANDLE_VALUE) {
+                gle = GetLastError();
+                if (gle && ioctlDebug ) {
+                    char buf[4096];
+
+                    if ( FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM,
+                                        NULL,
+                                        gle,
+                                        MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),
+                                        buf,
+                                        4096,
+                                        (va_list *) NULL
+                                        ) )
+                    {
+                        fprintf(stderr,"pioctl CreateFile(%s) failed: 0x%8X\r\n\t[%s]\r\n",
+                                 tbuffer,gle,buf);
+                    }
                 }
+                return -1;
             }
-            return -1;
         }
     }
 
index c862cad8692fa20d0b32285b379acafa2aa96004..5e8165e23ef31fb85fe084cc2fed403aa3ed00b1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: dumptool.c,v 1.3 2004/02/03 05:31:52 shadow Exp $
+ * $Id: dumptool.c,v 1.3.2.1 2004/12/17 14:39:31 shadow Exp $
  *
  * dumptool - A tool to manage MR-AFS dump files
  *
@@ -238,7 +238,7 @@ extern resid ServerRequestorId;
 struct vnodeData {
     struct VnodeDiskObject *vnode;     /* A pointer to the disk vnode */
     int vnodeNumber;           /* The vnode number */
-    long dumpdata;             /* File offset of dump data (if
+    off64_t dumpdata;          /* File offset of dump data (if
                                 * available */
     unsigned char *filedata;   /* A pointer to the actual file
                                 * data itself (if available) */
@@ -308,7 +308,7 @@ main(int argc, char *argv[])
     unsigned int magic;
     struct DumpHeader dheader;
     VolumeDiskData vol;
-    long offset;
+    off64_t offset;
     int Res, Arg1, Arg2, Arg3, i;
     char *p;
     struct winsize win;
@@ -500,14 +500,14 @@ main(int argc, char *argv[])
      * vnodes, the other to actually build the index.
      */
 
-    offset = ftell(f);
+    offset = ftello64(f);
 
     if (ScanVnodes(f, &vol, 1)) {
        fprintf(stderr, "First vnode scan failed, aborting\n");
        exit(1);
     }
 
-    fseek(f, offset, SEEK_SET);
+    fseeko64(f, offset, SEEK_SET);
 
     if (ScanVnodes(f, &vol, 0)) {
        fprintf(stderr, "Second vnode scan failed, aborting\n");
@@ -883,7 +883,7 @@ ScanVnodes(FILE * f, VolumeDiskData * vol, int sizescan)
     int numDirVnodes = 0;
     unsigned char buf[SIZEOF_LARGEDISKVNODE];
     struct VnodeDiskObject *vnode = (struct VnodeDiskObject *)buf;
-    long offset, oldoffset;
+    off64_t offset, oldoffset;
     struct vnodeData *vdata;
     unsigned int length;
 
@@ -1022,8 +1022,8 @@ ScanVnodes(FILE * f, VolumeDiskData * vol, int sizescan)
                    return -1;
                }
                vnode->length = length;
-               offset = ftell(f);
-               fseek(f, length, SEEK_CUR);
+               offset = ftello64(f);
+               fseeko64(f, length, SEEK_CUR);
                break;
            default:
                if (verbose)
@@ -1097,8 +1097,8 @@ ScanVnodes(FILE * f, VolumeDiskData * vol, int sizescan)
                    return -1;
                }
 
-               oldoffset = ftell(f);
-               fseek(f, offset, SEEK_SET);
+               oldoffset = ftello64(f);
+               fseeko64(f, offset, SEEK_SET);
 
                if (fread(vdata->filedata, length, 1, f) != 1) {
                    if (verbose)
@@ -1106,7 +1106,7 @@ ScanVnodes(FILE * f, VolumeDiskData * vol, int sizescan)
                    return -1;
                }
 
-               fseek(f, oldoffset, SEEK_SET);
+               fseeko64(f, oldoffset, SEEK_SET);
            } else if (vnode->type == vDirectory)
                /*
                 * Warn the user we may not have all directory
@@ -1150,12 +1150,12 @@ ScanVnodes(FILE * f, VolumeDiskData * vol, int sizescan)
  * Parsing the directory information is a pain, but other than that
  * we just use the other tools we already have in here.
  */
-
+#define CMDBUFSIZE     (AFSPATHMAX * 2)
 static void
 InteractiveRestore(FILE * f, VolumeDiskData * vol)
 {
     struct vnodeData *vdatacwd;        /* Vnode data for our current dir */
-    char cmdbuf[256];
+    char cmdbuf[CMDBUFSIZE];
     int argc;
     char **argv;
 
@@ -1190,7 +1190,7 @@ InteractiveRestore(FILE * f, VolumeDiskData * vol)
                numNoDirData);
 
     printf("> ");
-    while (fgets(cmdbuf, 256, stdin)) {
+    while (fgets(cmdbuf, CMDBUFSIZE, stdin)) {
 
        cmdbuf[strlen(cmdbuf) - 1] = '\0';
 
@@ -1550,7 +1550,7 @@ CopyFile(int argc, char **argv, struct vnodeData *vdatacwd, FILE * f)
 {
     struct vnodeData *vdata;
     FILE *out;
-    long cur = 0;
+    off64_t cur = 0;
     int bytes, ret;
     char buffer[COPYBUFSIZE];
 
@@ -1572,7 +1572,7 @@ CopyFile(int argc, char **argv, struct vnodeData *vdatacwd, FILE * f)
        return;
     }
 
-    if (fseek(f, vdata->dumpdata, SEEK_SET)) {
+    if (fseeko64(f, vdata->dumpdata, SEEK_SET)) {
        fprintf(stderr, "Seek failed: %s\n", strerror(errno));
        fclose(out);
        return;
@@ -1621,7 +1621,7 @@ CopyVnode(int argc, char *argv[], FILE * f)
 {
     struct vnodeData *vdata;
     FILE *out;
-    long cur = 0;
+    off64_t cur = 0;
     int bytes, ret;
     char buffer[COPYBUFSIZE];
     unsigned int vnode, uniquifier = 0;
@@ -1661,7 +1661,7 @@ CopyVnode(int argc, char *argv[], FILE * f)
        return;
     }
 
-    if (fseek(f, vdata->dumpdata, SEEK_SET)) {
+    if (fseeko64(f, vdata->dumpdata, SEEK_SET)) {
        fprintf(stderr, "Seek failed: %s\n", strerror(errno));
        fclose(out);
        return;
@@ -1960,7 +1960,7 @@ MakeArgv(char *string, int *argc, char ***argv)
     static char *largv[64];
     char **la = largv;
     char *s = string;
-    static char argbuf[256];
+    static char argbuf[CMDBUFSIZE];
     char *ap = argbuf;
 
     *argc = 0;
index 3999b7014f940b1f0b0738cc57ea82878ea16c21..a0eafc153bca6068e6c85b36698ecb42040a2488 100644 (file)
@@ -354,6 +354,12 @@ extern int ubik_ClientInit(register struct rx_connection **serverconns,
 
 extern afs_int32 ubik_ClientDestroy(struct ubik_client *aclient);
 
+extern afs_int32 ubik_CallIter(int (*aproc) (), struct ubik_client *aclient,
+                              afs_int32 aflags, int *apos, long p1, long p2,
+                              long p3, long p4, long p5, long p6, long p7,
+                              long p8, long p9, long p10, long p11, long p12,
+                              long p13, long p14, long p15, long p16);
+
 /* ubik.c */
 extern int ubik_BeginTrans(register struct ubik_dbase *dbase,
                           afs_int32 transMode, struct ubik_trans **transPtr);
index b296c714aeb6b5d2728415739691c75090fb04a7..08c62c4ddd2bada7a10e970f4c93eb5b2c988e39 100644 (file)
@@ -15,7 +15,7 @@
 #endif
 
 RCSID
-    ("$Header: /cvs/openafs/src/ubik/ubikclient.c,v 1.8.2.1 2004/08/25 07:09:43 shadow Exp $");
+    ("$Header: /cvs/openafs/src/ubik/ubikclient.c,v 1.8.2.2 2004/12/13 19:38:53 shadow Exp $");
 
 #if defined(UKERNEL)
 #include "afs/sysincludes.h"
@@ -46,7 +46,6 @@ RCSID
 #endif /* defined(UKERNEL) */
 
 
-afs_int32 ubik_CallIter();
 short ubik_initializationState;        /* initial state is zero */
 
 
@@ -750,28 +749,11 @@ ubik_Call_New(aproc, aclient, aflags, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10,
  * This is part of an iterator.  It doesn't handle finding sync sites
  */
 afs_int32
-ubik_CallIter(aproc, aclient, aflags, apos, p1, p2, p3, p4, p5, p6, p7, p8,
-             p9, p10, p11, p12, p13, p14, p15, p16)
-     int (*aproc) ();
-     register struct ubik_client *aclient;
-     afs_int32 aflags;
-     int *apos;
-     long p1;
-     long p2;
-     long p3;
-     long p4;
-     long p5;
-     long p6;
-     long p7;
-     long p8;
-     long p9;
-     long p10;
-     long p11;
-     long p12;
-     long p13;
-     long p14;
-     long p15;
-     long p16;
+ubik_CallIter(int (*aproc) (), struct ubik_client *aclient,
+                              afs_int32 aflags, int *apos, long p1, long p2,
+                              long p3, long p4, long p5, long p6, long p7,
+                              long p8, long p9, long p10, long p11, long p12,
+                              long p13, long p14, long p15, long p16)
 {
     return CallIter(aproc, aclient, aflags, apos, p1, p2, p3, p4, p5, p6, p7,
                    p8, p9, p10, p11, p12, p13, p14, p15, p16, NEED_LOCK);
index a516ca94a4ab6033a89eb4347f28797bc558564d..ea64ee7369de2a4fdb4134be5018a876ca68d0aa 100644 (file)
@@ -11,7 +11,7 @@
 #include <afs/param.h>
 
 RCSID
-    ("$Header: /cvs/openafs/src/util/afs_lhash.c,v 1.9 2003/07/15 23:17:15 shadow Exp $");
+    ("$Header: /cvs/openafs/src/util/afs_lhash.c,v 1.9.2.1 2004/12/17 15:29:31 shadow Exp $");
 
 #include "afs_atomlist.h"
 #include "afs_lhash.h"
@@ -169,7 +169,7 @@ afs_lhash_expand(afs_lhash * lh)
     size_t old_address;                /* index of bucket to split */
     size_t new_address;                /* index of new bucket */
 
-    struct bucket *current;    /* for scanning down old chain */
+    struct bucket *current_b;  /* for scanning down old chain */
     struct bucket *previous;
 
     struct bucket *last_of_new;        /* last element in new chain */
@@ -206,36 +206,36 @@ afs_lhash_expand(afs_lhash * lh)
 
     /* relocate records to the new bucket */
 
-    current = lh->table[old_address];
+    current_b = lh->table[old_address];
     previous = 0;
     last_of_new = 0;
     lh->table[new_address] = 0;
 
-    while (current) {
+    while (current_b) {
        size_t addr;
-       addr = afs_lhash_address(lh, current->key);
+       addr = afs_lhash_address(lh, current_b->key);
        if (addr == new_address) {
            /* attach it to the end of the new chain */
            if (last_of_new) {
-               last_of_new->next = current;
+               last_of_new->next = current_b;
            } else {
-               lh->table[new_address] = current;
+               lh->table[new_address] = current_b;
            }
            if (previous) {
-               previous->next = current->next;
+               previous->next = current_b->next;
            } else {
-               lh->table[old_address] = current->next;
+               lh->table[old_address] = current_b->next;
            }
-           last_of_new = current;
-           current = current->next;
+           last_of_new = current_b;
+           current_b = current_b->next;
            last_of_new->next = 0;
        } else {
 #ifdef CHECK_INVARIANTS
            assert(addr == old_address);
 #endif /* CHECK_INVARIANTS */
            /* leave it on the old chain */
-           previous = current;
-           current = current->next;
+           previous = current_b;
+           current_b = current_b->next;
        }
     }
 }
@@ -329,10 +329,10 @@ afs_lhash_iter(afs_lhash * lh,
 #endif /* CHECK_INVARIANTS */
 
     for (i = 0; i < lh->ltable; i++) {
-       struct bucket *current;
+       struct bucket *current_b;
 
-       for (current = lh->table[i]; current; current = current->next) {
-           f(i, current->key, current->data);
+       for (current_b = lh->table[i]; current_b; current_b = current_b->next) {
+           f(i, current_b->key, current_b->data);
        }
     }
 }
@@ -342,15 +342,15 @@ afs_lhash_search(afs_lhash * lh, unsigned key, const void *data)
 {
     size_t k;
     struct bucket *previous;
-    struct bucket *current;
+    struct bucket *current_b;
 
     lh->search_calls++;
 
     k = afs_lhash_address(lh, key);
-    for (previous = 0, current = lh->table[k]; current;
-        previous = current, current = current->next) {
+    for (previous = 0, current_b = lh->table[k]; current_b;
+        previous = current_b, current_b = current_b->next) {
        lh->search_tests++;
-       if (lh->equal(data, current->data)) {
+       if (lh->equal(data, current_b->data)) {
 
            /*
             * Since we found what we were looking for, move
@@ -366,12 +366,12 @@ afs_lhash_search(afs_lhash * lh, unsigned key, const void *data)
             */
 
            if (previous) {
-               previous->next = current->next;
-               current->next = lh->table[k];
-               lh->table[k] = current;
+               previous->next = current_b->next;
+               current_b->next = lh->table[k];
+               lh->table[k] = current_b;
            }
 
-           return current->data;
+           return current_b->data;
        }
     }
 
@@ -382,12 +382,12 @@ void *
 afs_lhash_rosearch(const afs_lhash * lh, unsigned key, const void *data)
 {
     size_t k;
-    struct bucket *current;
+    struct bucket *current_b;
 
     k = afs_lhash_address(lh, key);
-    for (current = lh->table[k]; current; current = current->next) {
-       if (lh->equal(data, current->data)) {
-           return current->data;
+    for (current_b = lh->table[k]; current_b; current_b = current_b->next) {
+       if (lh->equal(data, current_b->data)) {
+           return current_b->data;
        }
     }
 
index 105e209a5c8f9269b047fdceb33ffed7f1675e2b..1f08ca38b7fff3c21c5014c46a7de73fde3d4301 100644 (file)
@@ -286,7 +286,7 @@ ${DEST}/etc/kdump: kdump-build
                ${INSTALL} -s kdump-alpha_linux-${LINUX_VERSION} $@ ;; \
        *linux* ) \
                ${INSTALLex} -f ${srcdir}/kdump.sh.linux ${DEST}/etc/kdump; \
-               ${INSTALL} -s kdump-linux-${LINUX_VERSION} $@ ;; \
+               ${INSTALL} -s kdump-linux-${LINUX_VERSION} $@-${LINUX_VERSION} ;; \
        hp_ux11* ) \
                ${INSTALLex} -f ${srcdir}/kdump.sh.hp_ux11 ${DEST}/etc/kdump; \
                ${INSTALL} -s -f $? $@;; \
index de11e58fcfc3021bc7ec2bc5662cdc752215b664..e7cfe1f8fa6de7f6498233fe61f186f9c1cdc98d 100644 (file)
@@ -11,7 +11,7 @@
 #include <afs/param.h>
 
 RCSID
-    ("$Header: /cvs/openafs/src/venus/kdump.c,v 1.33 2004/07/13 05:49:54 shadow Exp $");
+    ("$Header: /cvs/openafs/src/venus/kdump.c,v 1.33.2.1 2004/12/17 15:31:26 shadow Exp $");
 
 #include <stdio.h>
 #include <errno.h>
@@ -244,7 +244,9 @@ typedef struct adaptive_mutex2 adaptive_mutex2_t;
 #else
 #include "sys/vfs.h"
 #ifdef AFS_LINUX20_ENV
+#ifndef UIO_MAXIOV
 #define UIO_MAXIOV 1           /* don't care */
+#endif
 #if __GLIBC_MINOR__ == 0
 #include <iovec.h>
 #endif
@@ -257,6 +259,9 @@ typedef struct adaptive_mutex2 adaptive_mutex2_t;
 #undef ULONG_MAX
 #define _LINUX_TIME_H
 #define _LINUX_FCNTL_H
+#ifdef AFS_IA64_LINUX24_ENV
+#define flock64  flock
+#endif /* AFS_IA64_LINUX24_ENV */
 #ifdef AFS_S390_LINUX20_ENV
 #define _S390_STATFS_H
 #else
@@ -294,6 +299,16 @@ typedef struct timeval {
 #define timer_t ktimer_t
 #define timer_t_redefined
 #endif
+#ifdef AFS_LINUX26_ENV
+/* For some reason, this doesn't get defined in linux/types.h
+   if __KERNEL_STRICT_NAMES is defined. But the definition of
+   struct inode uses it.
+*/
+#ifndef HAVE_SECTOR_T
+/* got it from linux/types.h */
+typedef unsigned long sector_t;
+#endif /* HAVE_SECTOR_T */
+#endif /* AFS_LINUX26_ENV */
 #include <linux/version.h>
 #include <linux/fs.h>
 #include <osi_vfs.h>
@@ -647,7 +662,11 @@ PrintIPAddr(int addr)
 #define MAXNAMELEN 64
 typedef struct symlist {
     char s_name[MAXNAMELEN];
+#ifdef AFS_LINUX_64BIT_KERNEL
+    unsigned long s_value;
+#else
     int s_value;
+#endif /* AFS_LINUX_64BIT_KERNEL */
 } symlist_t;
 
 #define KSYM_ALLOC_STEP 128
@@ -701,7 +720,11 @@ read_ksyms(void)
                exit(1);
            }
        }
+#ifdef AFS_LINUX_64BIT_KERNEL
+       ksyms[nksyms].s_value = (unsigned long)strtoul(line, &p, 16);
+#else
        ksyms[nksyms].s_value = (int)strtoul(line, &p, 16);
+#endif /* AFS_LINUX_64BIT_KERNEL */
        p++;
 #ifdef AFS_LINUX26_ENV
        /* Linux 2.6 /proc/kallsyms has a one-char symbol type
@@ -728,7 +751,11 @@ read_ksyms(void)
 
 
 /* find_symbol returns 0 if not found, otherwise value for symbol */
+#ifdef AFS_LINUX_64BIT_KERNEL
+unsigned long
+#else
 int
+#endif /* AFS_LINUX_64BIT_KERNEL */
 find_symbol(char *name)
 {
     symlist_t *tmp;
@@ -1906,7 +1933,11 @@ print_alloced_memlist(void)
     findsym("afs_linux_memlist", &symoff);
     kread(kmem, symoff, (char *)&memp, sizeof memp);
     if (memp) {
+#ifdef AFS_LINUX_64BIT_KERNEL
+       kread(kmem, (unsigned long)memp, (char *)&next, sizeof next);
+#else
        kread(kmem, (int)memp, (char *)&next, sizeof next);
+#endif /* AFS_LINUX_64BIT_KERNEL */
     } else {
        memset(&next, 0, sizeof next);
     }
index 278d0013ec2fdd2999134bc36531ecee59e0a9c3..27c26911522ddefa707d414c33c35e33bdf3dcc4 100644 (file)
@@ -25,7 +25,7 @@ VLIBOBJS=vnode.o volume.o vutil.o partition.o fssync.o purge.o \
         clone.o nuke.o devname.o listinodes.o common.o ihandle.o \
         namei_ops.o fstab.o
 
-OBJECTS=${VLIBOBJS} physio.o vol-salvage.o vol-info.o vol-dump.o
+OBJECTS=${VLIBOBJS} physio.o vol-salvage.o vol-info.o vol-dump.o vol-bless.o
 
 all: gi \
        ${TOP_LIBDIR}/vlib.a \
@@ -164,6 +164,9 @@ volinfo: vol-info.o physio.o ihandle.o fstab.o ${LIBS}
        ${CC} ${CFLAGS} -o volinfo vol-info.o physio.o \
                ihandle.o fstab.o ${LIBS} ${XLIBS}
 
+vol-bless: vol-bless.o physio.o ihandle.o ${LIBS}
+       ${CC} ${CFLAGS} -o vol-bless vol-bless.o physio.o ${LIBS} ${XLIBS}
+
 fs_conv_dux40D: fs_conv_411.o
        ${CC} ${CFLAGS} ${TOP_LIBDIR}/libcmd.a -o fs_conv_dux40D fs_conv_411.o  ${LIBS} ${XLIBS}
 
@@ -282,4 +285,4 @@ check-splint::
            vnode.c volume.c vutil.c partition.c fssync.c purge.c \
            clone.c nuke.c devname.c listinodes.c common.c ihandle.c \
            namei_ops.c \
-           physio.c vol-salvage.c vol-info.c
+           physio.c vol-salvage.c vol-info.c vol-bless.c
index 0b966f23fe979398ddd5549a2ab413c869a51e07..6584e8eab22bedab13087202f5d4eff52883b075 100644 (file)
@@ -89,6 +89,14 @@ $(VOLINFO): $(OUT)\vol-info.obj $(OUT)\physio.obj $(OUT)\volinfo.res $(EXEC_LIBS
        $(EXECONLINK)
        $(EXEPREP)
 
+############################################################################
+# build volinfo
+VOLBLESS = $(DESTDIR)\root.server\usr\afs\bin\vol-bless.exe
+
+$(VOLBLESS): $(OUT)\vol-bless.obj $(OUT)\physio.obj $(OUT)\vol-bless.res $(EXEC_LIBS)
+       $(EXECONLINK)
+       $(EXEPREP)
+
 ############################################################################
 # generate versioninfo resources
 $(OUT)\salvager.res: salvager.rc AFS_component_version_number.h
diff --git a/src/vol/vol-bless.c b/src/vol/vol-bless.c
new file mode 100644 (file)
index 0000000..8a25d86
--- /dev/null
@@ -0,0 +1,86 @@
+/*
+ * Copyright 2004, International Business Machines Corporation and others.
+ * All Rights Reserved.
+ * 
+ * This software has been released under the terms of the IBM Public
+ * License.  For details, see the LICENSE file in the top-level source
+ * directory or online at http://www.openafs.org/dl/license10.html
+ */
+
+#include <afsconfig.h>
+#include <afs/param.h>
+
+RCSID
+    ("$Header: /cvs/openafs/src/vol/vol-bless.c,v 1.1.2.1 2004/12/07 06:06:17 shadow Exp $");
+
+#include <stdio.h>
+
+#include <afs/cmd.h>
+
+#include <rx/xdr.h>
+#include <afs/afsint.h>
+#include "nfs.h"
+#include "lock.h"
+#include "ihandle.h"
+#include "vnode.h"
+#include "volume.h"
+
+int VolumeChanged; /* to keep physio happy */
+
+static int
+handleit(struct cmd_syndesc *as, char *arock)
+{
+    Volume *vp;
+    Error ec;
+    int bless, unbless, nofssync;
+    int volumeId;
+
+    volumeId = atoi(as->parms[0].items->data);
+    bless    = !!(as->parms[1].items);
+    unbless  = !!(as->parms[2].items);
+    nofssync = !!(as->parms[3].items);
+
+    if (bless && unbless) {
+       fprintf(stderr,"Cannot use both -bless and -unbless\n");
+       exit(1);
+    }
+
+    if (VInitVolumePackage(nofssync ? salvager : volumeUtility, 5, 5, 1, 0)) {
+       fprintf(stderr,"Unable to initialize volume package\n");
+       exit(1);
+    }
+
+    vp = VAttachVolume(&ec, volumeId, V_VOLUPD);
+    if (ec) {
+       fprintf(stderr,"VAttachVolume failed: %d\n", ec);
+       exit(1);
+    }
+    if (bless) V_blessed(vp) = 1;
+    if (unbless) V_blessed(vp) = 0;
+    VUpdateVolume(&ec, vp);
+    if (ec) {
+       fprintf(stderr,"VUpdateVolume failed: %d\n", ec);
+       VPutVolume(vp);
+       exit(1);
+    }
+    VPutVolume(vp);
+    return 0;
+}
+
+int
+main(int argc, char **argv)
+{
+    register struct cmd_syndesc *ts;
+    afs_int32 code;
+
+    ts = cmd_CreateSyntax(NULL, handleit, 0, "Manipulate volume blessed bit");
+    cmd_AddParm(ts, "-id", CMD_SINGLE, CMD_REQUIRED, "Volume id");
+    cmd_AddParm(ts, "-bless", CMD_FLAG, CMD_OPTIONAL, "Set blessed bit");
+    cmd_AddParm(ts, "-unbless", CMD_FLAG, CMD_OPTIONAL, "Clear blessed bit");
+    cmd_AddParm(ts, "-nofssync", CMD_FLAG, CMD_OPTIONAL,
+               "Don't communicate with running fileserver");
+    code = cmd_Dispatch(argc, argv);
+    return code;
+}
+
+
index 2b4867f246efdd770c32cc43dad4e147947d72c9..cf464a57f54a77c6f9d0755a31181db7907ec0e1 100644 (file)
@@ -20,7 +20,7 @@
 #include <afs/param.h>
 
 RCSID
-    ("$Header: /cvs/openafs/src/vol/volume.c,v 1.35.2.1 2004/08/25 07:14:19 shadow Exp $");
+    ("$Header: /cvs/openafs/src/vol/volume.c,v 1.35.2.2 2004/12/13 19:41:10 shadow Exp $");
 
 #include <rx/xdr.h>
 #include <afs/afsint.h>
@@ -635,7 +635,7 @@ VAttachVolumeByName_r(Error * ec, char *partition, char *name, int mode)
     }
 
     DiskToVolumeHeader(&iheader, &diskHeader);
-    if (programType == volumeUtility && mode != V_SECRETLY) {
+    if (programType == volumeUtility && mode != V_SECRETLY && mode != V_PEEK) {
        if (FSYNC_askfs(iheader.id, partition, FSYNC_NEEDVOLUME, mode)
            == FSYNC_DENIED) {
            Log("VAttachVolume: attach of volume %u apparently denied by file server\n", iheader.id);
@@ -650,7 +650,7 @@ VAttachVolumeByName_r(Error * ec, char *partition, char *name, int mode)
         * takes the volume offline or not.  If the volume isn't
         * offline, we must not return it when we detach the volume,
         * or the server will abort */
-       if (mode == V_READONLY
+       if (mode == V_READONLY || mode == V_PEEK
            || (!VolumeWriteable(vp) && (mode == V_CLONE || mode == V_DUMP)))
            vp->needsPutBack = 0;
        else
@@ -667,7 +667,8 @@ VAttachVolumeByName_r(Error * ec, char *partition, char *name, int mode)
      * for all of that to happen, but if it does, probably the right
      * fix is for the server to allow the return of readonly volumes
      * that it doesn't think are really checked out. */
-    if (programType == volumeUtility && vp == NULL && mode != V_SECRETLY) {
+    if (programType == volumeUtility && vp == NULL &&
+       mode != V_SECRETLY && mode != V_PEEK) {
        FSYNC_askfs(iheader.id, partition, FSYNC_ON, 0);
     } else if (programType == fileServer && vp) {
        V_needsCallback(vp) = 0;
index c737f2b4fadb3928e28eb41241193901c08d755f..779e9b4c0738faca086d4bebf3490025aa8f1514 100644 (file)
@@ -492,6 +492,11 @@ extern void VTakeOffline(register Volume * vp);
                                 * never knows about more than one copy of the same volume--when
                                 * a volume is moved from one partition to another on a single
                                 * server */
+#define V_PEEK     6           /* "Peek" at the volume without telling the fileserver.  This is
+                                * similar to V_SECRETLY, but read-only.  It is used in cases where
+                                * not impacting fileserver performance is more important than
+                                * getting the most recent data. */
+
 
 #if    defined(NEARINODE_HINT)
 #define V_pref(vp,nearInode)  nearInodeHash(V_id(vp),(nearInode)); (nearInode) %= V_partition(vp)->f_files
index ad7b52a877f1aacd60145612489a56f483cbffca..fddf1bd656f8e15dcb638920f893de0df6dac87b 100644 (file)
@@ -11,7 +11,7 @@
 #include <afs/param.h>
 
 RCSID
-    ("$Header: /cvs/openafs/src/volser/volprocs.c,v 1.34.2.2 2004/11/09 17:13:45 shadow Exp $");
+    ("$Header: /cvs/openafs/src/volser/volprocs.c,v 1.34.2.3 2004/12/13 19:41:13 shadow Exp $");
 
 #include <stdio.h>
 #include <sys/types.h>
@@ -1790,7 +1790,7 @@ VolListOneVolume(struct rx_call *acid, afs_int32 partid, afs_int32
                pntr->volid = volid;
                goto drop;
            }
-           tv = VAttachVolumeByName(&error, pname, volname, V_READONLY);
+           tv = VAttachVolumeByName(&error, pname, volname, V_PEEK);
            if (error) {
                pntr->status = 0;       /*things are messed up */
                strcpy(pntr->name, volname);
@@ -2004,7 +2004,7 @@ VolXListOneVolume(struct rx_call *a_rxCidP, afs_int32 a_partID,
            /*
             * Attach the volume, give up on the volume if we can't.
             */
-           tv = VAttachVolumeByName(&error, pname, volname, V_READONLY);
+           tv = VAttachVolumeByName(&error, pname, volname, V_PEEK);
            if (error) {
                xInfoP->status = 0;     /*things are messed up */
                strcpy(xInfoP->name, volname);
@@ -2171,7 +2171,7 @@ VolListVolumes(struct rx_call *acid, afs_int32 partid, afs_int32 flags,
                pntr->volid = volid;
                goto drop;
            }
-           tv = VAttachVolumeByName(&error, pname, volname, V_READONLY);
+           tv = VAttachVolumeByName(&error, pname, volname, V_PEEK);
            if (error) {
                pntr->status = 0;       /*things are messed up */
                strcpy(pntr->name, volname);
@@ -2413,7 +2413,7 @@ VolXListVolumes(struct rx_call *a_rxCidP, afs_int32 a_partID,
            /*
             * Attach the volume, give up on this volume if we can't.
             */
-           tv = VAttachVolumeByName(&error, pname, volname, V_READONLY);
+           tv = VAttachVolumeByName(&error, pname, volname, V_PEEK);
            if (error) {
                xInfoP->status = 0;     /*things are messed up */
                strcpy(xInfoP->name, volname);
index 8191bb3775b176dee49f31649936da62bedb578f..d1a8b42d6996c1760806189192fa59c6ca0af8ef 100644 (file)
@@ -11,7 +11,7 @@
 #include <afs/param.h>
 
 RCSID
-    ("$Header: /cvs/openafs/src/volser/vsutils.c,v 1.16.2.1 2004/10/18 07:12:29 shadow Exp $");
+    ("$Header: /cvs/openafs/src/volser/vsutils.c,v 1.16.2.2 2004/12/07 16:37:09 shadow Exp $");
 
 #include <afs/stds.h>
 #ifdef AFS_NT40_ENV
@@ -490,67 +490,34 @@ vsu_GetVolumeID(astring, acstruct, errp)
      afs_int32 *errp;
      char *astring;
 {
-    afs_uint32 tc, value;
-
-    char *str, *ptr, volname[VOLSER_OLDMAXVOLNAME + 1];
-    int tryname, curval;
+    afs_uint32 value;
+    char volname[VOLSER_OLDMAXVOLNAME + 1];
     struct nvldbentry entry;
     afs_int32 vcode = 0;
     int total;
 
     *errp = 0;
-    total = strlen(astring);
-    str = astring;
-    ptr = astring;
-    tryname = 0;
-    while ((curval = *str++)) {
-       if (curval < '0' || curval > '9')
-           tryname = 1;
-    }
 
-    if (tryname) {
-       vsu_ExtractName(volname, astring);
-       vcode = VLDB_GetEntryByName(volname, &entry);
-       if (!vcode) {
-           if (!strcmp(&astring[total - 9], ".readonly"))
-               return entry.volumeId[ROVOL];
-           else if ((!strcmp(&astring[total - 7], ".backup")))
-               return entry.volumeId[BACKVOL];
-           else
-               return (entry.volumeId[RWVOL]);
-       } else {
-           *errp = vcode;
-           return 0;           /* can't find volume */
-       }
+    if (isdigit(astring[0])) {
+       char *end;
+       afs_uint32 result;
+       result = strtoul(astring, &end, 10);
+       if (result != ULONG_MAX && *end == '\0')
+           return result;
     }
 
-    value = 0;
-    while ((tc = *astring++)) {
-       if (tc & 0x80) {
-           if (!tryname)
-               fprintf(STDERR, "goofed in volid \n");
-           else {
-               fprintf(STDERR, "Could not get entry from vldb for %s\n",
-                       ptr);
-               PrintError("", vcode);
-           }
-           *errp = EINVAL;
-           return 0;
-       }
-       if (tc < '0' || tc > '9') {
-           if (!tryname)
-               fprintf(STDERR,
-                       "internal error: out of range char in vol ID\n");
-           else {
-               fprintf(STDERR, "Could not get entry from vldb for %s\n",
-                       ptr);
-               PrintError("", vcode);
-           }
-           *errp = ERANGE;
-           return 0;
-       }
-       value *= 10;
-       value += (tc - '0');
+    /* It was not a volume number but something else */
+    total = strlen(astring);
+    vsu_ExtractName(volname, astring);
+    vcode = VLDB_GetEntryByName(volname, &entry);
+    if (!vcode) {
+      if (!strcmp(&astring[total - 9], ".readonly"))
+       return entry.volumeId[ROVOL];
+      else if ((!strcmp(&astring[total - 7], ".backup")))
+       return entry.volumeId[BACKVOL];
+      else
+       return (entry.volumeId[RWVOL]);
     }
-    return value;
+    *errp = vcode;
+    return 0;          /* can't find volume */
 }