From 75094553b1e2a5ff6c8a4dcec94de9ccd0015eb2 Mon Sep 17 00:00:00 2001 From: Sam Hartman Date: Wed, 30 Jul 2003 17:23:46 +0000 Subject: [PATCH] Merge conflicts between 1.2.9 and 1.2.10 --- Makefile.in | 48 ++++++-- NEWS | 38 +++++- acinclude.m4 | 114 +++++++++++++++--- src/afs/LINUX/osi_file.c | 16 ++- src/afs/LINUX/osi_misc.c | 54 ++++++--- src/afs/LINUX/osi_module.c | 172 ++++++++++++++++++++++++---- src/afs/Makefile.in | 33 +++--- src/afs/VNOPS/afs_vnop_readdir.c | 25 ++-- src/afs/afs_call.c | 21 ++-- src/afs/afs_pioctl.c | 16 ++- src/audit/Makefile.in | 2 +- src/auth/Makefile.in | 6 +- src/comerr/Makefile.in | 2 +- src/config/Makefile.i386_linux22.in | 2 +- src/config/param.i386_linux24.h | 7 ++ src/des/Makefile.in | 2 +- src/kauth/Makefile.in | 2 +- src/libafs/Makefile.common | 2 +- src/libafs/MakefileProto.LINUX.in | 13 ++- src/lwp/Makefile.in | 2 +- src/lwp/lwp.h | 10 ++ src/lwp/process.c | 14 ++- src/pam/Makefile.in | 8 +- src/pinstall/install.c | 17 ++- src/ptserver/ptserver.c | 5 +- src/rx/Makefile.in | 12 +- src/rx/rx.c | 13 ++- src/rx/rx_kcommon.h | 14 ++- src/rx/rx_packet.c | 8 +- src/rxkad/Makefile.in | 4 +- src/sys/Makefile.in | 2 +- src/uss/uss_procs.c | 46 ++++---- src/uss/uss_vol.c | 8 +- src/venus/Makefile.in | 110 ++++++++++-------- src/venus/fs.c | 9 +- src/venus/kdump.c | 4 +- src/vlserver/cnvldb.c | 10 +- 37 files changed, 639 insertions(+), 232 deletions(-) diff --git a/Makefile.in b/Makefile.in index 421520cdd..9aebd8009 100644 --- a/Makefile.in +++ b/Makefile.in @@ -87,6 +87,20 @@ dest_nolibafs: all dest_dirs dest_only_libafs: all dest_dirs $(MAKE) build TARGET=libafs COMPILE_PART2B=dest +packages: dest + @case ${SYS_NAME} in \ + ppc_darwin* ) \ + ${COMPILE_PART1} packaging/MacOS && sh ./buildpkg.sh ${DEST} ;; \ + hp_ux110 ) \ + ${COMPILE_PART1} packaging/HP-UX && swpackage -s psf-1.2.10-transarc-paths-11.00 ;; \ + hp_ux11i ) \ + ${COMPILE_PART1} packaging/HP-UX && swpackage -s psf-1.2.10-transarc-paths-11.11 ;; \ + ia64_hpux1122 ) \ + ${COMPILE_PART1} packaging/HP-UX && swpackage -s psf-1.2.10-transarc-paths-11.22 ;; \ + *) \ + echo Not building packages for ${SYS_NAME} ;; \ + esac + ${TOP_INCDIR} ${TOP_INCDIR}/afs ${TOP_LIBDIR}: mkdir -p $@ @@ -134,7 +148,7 @@ comerr: util cmd: comerr @case ${SYS_NAME} in \ - sgi_6* | sun4x_57 | sun4x_58 | hp_ux11* | sparc64_linux* | alpha_linux* ) \ + sgi_6* | sun4x_5[789] | hp_ux11* | ia64_hpux* | sparc64_linux* | alpha_linux* ) \ ${COMPILE_PART1} cmd ${COMPILE_PART2}64 ;; \ *) \ ${COMPILE_PART1} cmd ${COMPILE_PART2} ;; \ @@ -240,7 +254,7 @@ viced: project vlserver audit tviced: project viced vlserver libafsrpc libafsauthent case ${SYS_NAME} in \ - alpha_dux*|sgi_*|sun*_5*|rs_aix*|*linux*|hp_ux110) \ + alpha_dux*|sgi_*|sun*_5*|rs_aix*|*linux*|hp_ux11*|ia64_hpux*) \ ${COMPILE_PART1} tviced ${COMPILE_PART2} ;; \ *) \ echo Not building MT viced for ${SYS_NAME} ;; \ @@ -261,7 +275,7 @@ null: project gtx: project null auth # kauth rxkad ? case ${SYS_NAME} in \ - rs_aix* | sun*_5? | sgi_6? | *linux* | ppc_darwin* | *fbsd*) \ + rs_aix* | sun*_5? | sgi_6? | *linux* | ppc_darwin* | *fbsd* | ia64_hpux*) \ $(RM) -f ${TOP_LIBDIR}/libtermlib.a; \ ln -s libnull.a ${TOP_LIBDIR}/libtermlib.a; \ ${COMPILE_PART1} gtx ${COMPILE_PART2};; \ @@ -292,7 +306,7 @@ bozo: project ntp audit vfsck: vol set -x; \ case ${SYS_NAME} in \ - sgi_* | *linux* | rs_aix42 | ppc_darwin* | hp_ux* | *fbsd* | *_obsd* | sun*_4* ) \ + sgi_* | *linux* | rs_aix42 | ppc_darwin* | hp_ux* | ia64_hpux* | *fbsd* | *_obsd* | sun*_4* ) \ echo skip vfsck for ${SYS_NAME} ;; \ * ) \ ${COMPILE_PART1} vfsck ${COMPILE_PART2} ;; \ @@ -311,8 +325,14 @@ login: project kauth rxkad ${COMPILE_PART1} login ${COMPILE_PART2} ;; \ parisc_linux24) \ echo Skipping pam/login for parisc_linux24 ;; \ - sun*_* | hp_ux11* | *linux* | *fbsd* ) \ - ${COMPILE_PART1} pam ${COMPILE_PART2} ;; \ + amd64_linux24) \ + echo Skipping pam/login for amd64_linux24 ;; \ + sun*_* | hp_ux11* | ia64_hpux* | *linux* | *fbsd* ) \ + if test "@HAVE_PAM@" = "yes"; then \ + ${COMPILE_PART1} pam ${COMPILE_PART2} ; \ + else \ + echo Skipping pam for ${SYS_NAME} ; \ + fi ;; \ ppc_darwin* | *_obsd* ) \ echo Skipping login for ${SYS_NAME} ;; \ * ) \ @@ -411,7 +431,7 @@ butc: project bubasics butm budb bucoord cmd tbutc: project bubasics butm budb bucoord cmd butc case ${SYS_NAME} in \ - alpha_dux*|sgi_*|sun*_*|rs_aix4*|*linux*|hp_ux110) \ + alpha_dux*|sgi_*|sun*_*|rs_aix4*|*linux*|hp_ux11*|ia64_hpux*) \ ${COMPILE_PART1} tbutc ${COMPILE_PART2} ;; \ *) \ echo Not building MT butc for ${SYS_NAME} ;; \ @@ -434,7 +454,7 @@ tests: rxtests ubiktests # pthread based user space RX library libafsrpc: rx rxkad des case ${SYS_NAME} in \ - alpha_dux*|sgi_*|sun*_*|rs_aix*|*linux*|hp_ux110|*fbsd*) \ + alpha_dux*|sgi_*|sun*_*|rs_aix*|*linux*|hp_ux11*|ia64_hpux*|*fbsd*) \ ${COMPILE_PART1} libafsrpc ${COMPILE_PART2} ;; \ *) \ echo Not building MT libafsrpc for ${SYS_NAME} ;; \ @@ -442,7 +462,7 @@ libafsrpc: rx rxkad des libafsauthent: ubik auth kauth libafsrpc case ${SYS_NAME} in \ - alpha_dux*|sgi_*|sun*_*|rs_aix*|*linux*|hp_ux110|*fbsd*) \ + alpha_dux*|sgi_*|sun*_*|rs_aix*|*linux*|hp_ux11*|ia64_hpux*|*fbsd*) \ ${COMPILE_PART1} libafsauthent ${COMPILE_PART2} ;; \ *) \ echo Not building MT libafsrpc for ${SYS_NAME} ;; \ @@ -450,7 +470,9 @@ libafsauthent: ubik auth kauth libafsrpc shlibafsrpc: rx rxkad des case ${SYS_NAME} in \ - alpha_dux*|sgi_*|sun*_*|rs_aix*|*linux*|hp_ux110) \ + amd64_linux24) \ + echo Skipping shlibafsprc for amd64_linux24 ;; \ + alpha_dux*|sgi_*|sun*_*|rs_aix*|*linux*|hp_ux11*|ia64_hpux*) \ ${COMPILE_PART1} shlibafsrpc ${COMPILE_PART2} ;; \ *) \ echo Not building shared libafsrpc for ${SYS_NAME} ;; \ @@ -458,7 +480,9 @@ shlibafsrpc: rx rxkad des shlibafsauthent: ubik auth kauth shlibafsrpc case ${SYS_NAME} in \ - alpha_dux*|sgi_*|sun*_*|rs_aix*|*linux*|hp_ux110) \ + amd64_linux24) \ + echo Skipping shlibafsauthent for amd64_linux24 ;; \ + alpha_dux*|sgi_*|sun*_*|rs_aix*|*linux*|hp_ux11*|ia64_hpux*) \ ${COMPILE_PART1} shlibafsauthent ${COMPILE_PART2} ;; \ *) \ echo Not building shared libafsrpc for ${SYS_NAME} ;; \ @@ -478,7 +502,7 @@ libadmin_real: libadmin: libafsauthent bozo case ${SYS_NAME} in \ - alpha_dux*|sgi_*|sun*_*|rs_aix*|*linux*|hp_ux110) \ + alpha_dux*|sgi_*|sun*_*|rs_aix*|*linux*|hp_ux11*|ia64_hpux*) \ $(MAKE) libadmin_real ;; \ *) \ echo Not building MT libadmin for ${SYS_NAME} ;; \ diff --git a/NEWS b/NEWS index b95a74976..cbcbc2670 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,32 @@ -OpenAFS News -- history of user-visible changes. April 10, 2003. +OpenAFS News -- history of user-visible changes. July 29, 2003. + +* Changes incorporated in OpenAFS 1.2.10 + +** dumps to and restores from large files now supported by butc. + +** Linux on AMD Opteron (sysname amd64_linux24), HP-UX 11i on PA-RISC + (sysname hp_ux11i), HP-UX 11.22 on Intel Itanium (sysname ia64_hpux1122), + and User Mode Linux i386 (sysnames i386_umlinux22, i386_umlinux24) now + supported. + +** Windows Largeint support (for VC7) + +** afsd will not shut itself down while /afs is mounted, to preclude panics. + +** On Linux 2.4, the AFS cache cannot be unmounted if afsd is not shut down. + This is consistent with the behavior of other platforms and of Linux 2.2, + but until now Linux 2.4 had not behaved this way. + +** Restore behavior pre-1.2.9 of adding cell aliases we find using AFSDB + for cells that have been statically configured via CellServDB. + +** MacOS X client fakes mode bits so host does not preclude user access to + data incorrectly. + +** MacOS X client enables disk arbitration such that AFS shows up immediately + in Finder, and precludes afs unmount unless force is used, to prevent + Finder from "ejecting" it. AFS can also be mounted multiple times + on the MacOS X client. * Changes incorporated in OpenAFS 1.2.9 @@ -12,6 +40,14 @@ OpenAFS News -- history of user-visible changes. April 10, 2003. ** Solaris 9 12/02 is now supported. Solaris 7 and 8 x86 should now work again. +** On Linux machines using 2.2 series kernels, 2.2.19 or higher is now + required. + +** An OpenAFS 1.2.9 afsd will not work with kernel modules built from + an earlier OpenAFS release. In general, using a mismatched afsd and + kernel modules set is unsupported; it is not recommended that you use + such a configuration on a regular basis. + * Changes incorporated in OpenAFS 1.2.8 ** Mountpoint directory information is now only faked for cross-cell diff --git a/acinclude.m4 b/acinclude.m4 index 9b71f29dd..45b60f95e 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -9,7 +9,7 @@ AC_DEFUN(OPENAFS_CONFIGURE_COMMON,[ AC_CANONICAL_HOST SRCDIR_PARENT=`pwd` -#BOZO_SAVE_CORES BOS_RESTRICTED_MODE BOS_NEW_CONFIG pam sia +#BOZO_SAVE_CORES pam sia AC_ARG_WITH(afs-sysname, [ --with-afs-sysname=sys use sys for the afs sysname] ) @@ -21,6 +21,8 @@ AC_ARG_ENABLE( afsdb, [ --disable-afsdb disable AFSDB RR support],, enable_afsdb="yes") AC_ARG_ENABLE( bos-restricted-mode, [ --enable-bos-restricted-mode enable bosserver restricted mode which disables certain bosserver functionality],, enable_bos_restricted_mode="no") +AC_ARG_ENABLE( bos-new-config, +[ --enable-bos-new-config enable bosserver pickup of BosConfig.new on restarts],, enable_bos_new_config="no") AC_ARG_ENABLE( namei-fileserver, [ --enable-namei-fileserver force compilation of namei fileserver in preference to inode fileserver],, enable_namei_fileserver="no") AC_ARG_ENABLE( fast-restart, @@ -149,10 +151,12 @@ case $system in 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_INODE_SETATTR_RETURN_TYPE + LINUX_KERNEL_LINUX_SYSCALL_H LINUX_NEED_RHCONFIG LINUX_RECALC_SIGPENDING_ARG_TYPE LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_PARENT @@ -164,13 +168,18 @@ case $system in if test "x$ac_cv_linux_config_modversions" = "xno"; then AC_MSG_WARN([Cannot determine sys_call_table status. assuming it's exported]) ac_cv_linux_exports_sys_call_table=yes + 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 @@ -185,20 +194,26 @@ case $system in if test "x$linux_syscall_method" = "xnone"; then AC_MSG_ERROR([no available sys_call_table access method]) 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 fi 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 @@ -226,6 +241,9 @@ case $system in 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 @@ -235,6 +253,9 @@ case $system in 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_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 @@ -333,9 +354,15 @@ else i?86-*-freebsd4.6*) AFS_SYSNAME="i386_fbsd_46" ;; - hppa*-hp-hpux11*) + hppa*-hp-hpux11.0*) AFS_SYSNAME="hp_ux110" ;; + hppa*-hp-hpux11.11) + AFS_SYSNAME="hp_ux11i" + ;; + ia64-hp-hpux*) + AFS_SYSNAME="ia64_hpux1122" + ;; hppa*-hp-hpux10*) AFS_SYSNAME="hp_ux102" ;; @@ -450,6 +477,9 @@ else power*-ibm-aix4.3*) AFS_SYSNAME="rs_aix42" ;; + x86_64-*-linux-gnu) + AFS_SYSNAME="amd64_linuxXX" + ;; *) AC_MSG_ERROR(An AFS sysname is required) exit 1 @@ -463,11 +493,33 @@ else fi _AFS_SYSNAME=`echo $AFS_SYSNAME|sed s/XX\$/$AFS_SYSKVERS/` AFS_SYSNAME="$_AFS_SYSNAME" + if test -f "$LINUX_KERNEL_PATH/include/linux/autoconf.h"; then + AFS_ISUML=`awk '$[]2 == "CONFIG_USERMODE"{print $[]3}' $LINUX_KERNEL_PATH/include/linux/autoconf.h` + if test "x${AFS_ISUML}" = "x1"; then + _AFS_SYSNAME=`echo $AFS_SYSNAME|sed s/linux/umlinux/` + fi + AFS_SYSNAME="$_AFS_SYSNAME" + fi ;; esac AC_MSG_RESULT($AFS_SYSNAME) fi +# KDUMP64 defaults to KDUMP for systems without a separate kdump64 +KDUMP64='${KDUMP}' +KDUMP=kdump +case $AFS_SYSNAME in + sgi_6?) + KDUMP=kdump.IP20;; + sun4x_5[789] | hp_ux11*) + KDUMP=kdump32 + KDUMP64=kdump64;; + *linux*) + KDUMP='kdump-${LINUX_VERSION}';; +esac +AC_SUBST(KDUMP) +AC_SUBST(KDUMP64) + case $AFS_SYSNAME in *_darwin*) DARWIN_PLIST=src/libafs/afs.${AFS_SYSNAME}.plist @@ -517,17 +569,30 @@ else done fi - AC_CHECK_FUNCS(res_search) + openafs_save_libs="$LIBS" + AC_MSG_CHECKING([for res_search]) + AC_FUNC_RES_SEARCH + if test "$ac_cv_func_res_search" = no; then - for lib in dns nsl resolv; do - if test "$HAVE_RES_SEARCH" != 1; then - AC_CHECK_LIB(${lib}, res_search, LIBS="$LIBS -l$lib";HAVE_RES_SEARCH=1;AC_DEFINE(HAVE_RES_SEARCH, 1, [define if you have res_search])) - fi - done - if test "$HAVE_RES_SEARCH" = 1; then - LIB_res_search="-l$lib" - fi - fi + for lib in dns nsl resolv; do + if test "$ac_cv_func_res_search" != yes; then + LIBS="-l$lib $LIBS" + AC_FUNC_RES_SEARCH + LIBS="$openafs_save_libs" + fi + done + if test "$ac_cv_func_res_search" = yes; then + LIB_res_search="-l$lib" + AC_DEFINE(HAVE_RES_SEARCH, 1, []) + AC_MSG_RESULT([yes, in lib$lib]) + else + AC_MSG_RESULT(no) + fi + else + AC_DEFINE(HAVE_RES_SEARCH, 1, []) + AC_MSG_RESULT(yes) + fi + fi PTHREAD_LIBS=error @@ -576,6 +641,10 @@ if test "$enable_bos_restricted_mode" = "yes"; then AC_DEFINE(BOS_RESTRICTED_MODE, 1, [define if you want to want bos restricted mode]) fi +if test "$enable_bos_new_config" = "yes"; then + AC_DEFINE(BOS_NEW_CONFIG, 1, [define if you want to enable automatic renaming of BosConfig.new to BosConfig at startup]) +fi + if test "$enable_namei_fileserver" = "yes"; then AC_DEFINE(AFS_NAMEI_ENV, 1, [define if you want to want namei fileserver]) fi @@ -617,8 +686,15 @@ AC_CHECK_HEADERS(sys/mount.h strings.h termios.h signal.h) AC_CHECK_HEADERS(windows.h malloc.h winsock2.h direct.h io.h) AC_CHECK_HEADERS(security/pam_modules.h siad.h usersec.h ucontext.h) +if test "$ac_cv_header_security_pam_modules_h" = "yes"; then + HAVE_PAM="yes" +else + HAVE_PAM="no" +fi +AC_SUBST(HAVE_PAM) + AC_CHECK_FUNCS(utimes random srandom getdtablesize snprintf re_comp re_exec) -AC_CHECK_FUNCS(setprogname getprogname sigaction) +AC_CHECK_FUNCS(setprogname getprogname sigaction mkstemp strerror) AC_CHECK_TYPE(ssize_t, int) AC_CHECK_FUNCS(timegm) diff --git a/src/afs/LINUX/osi_file.c b/src/afs/LINUX/osi_file.c index bf83a0e0f..98456e438 100644 --- a/src/afs/LINUX/osi_file.c +++ b/src/afs/LINUX/osi_file.c @@ -10,7 +10,7 @@ #include #include "../afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_file.c,v 1.7 2001/09/11 15:47:36 hartmans Exp $"); +RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_file.c,v 1.8 2003/07/30 17:23:43 hartmans Exp $"); #include "../afs/sysincludes.h" /* Standard vendor system headers */ #include "../afs/afsincludes.h" /* Afs-based standard headers */ @@ -126,6 +126,9 @@ osi_UFSTruncate(afile, asize) if (code || tstat.size <= asize) return code; MObtainWriteLock(&afs_xosi,321); AFS_GUNLOCK(); +#ifdef STRUCT_INODE_HAS_I_ALLOC_SEM + down_write(&inode->i_alloc_sem); +#endif down(&inode->i_sem); inode->i_size = newattrs.ia_size = asize; newattrs.ia_valid = ATTR_SIZE | ATTR_CTIME; @@ -156,6 +159,9 @@ osi_UFSTruncate(afile, asize) #endif code = -code; up(&inode->i_sem); +#ifdef STRUCT_INODE_HAS_I_ALLOC_SEM + up_write(&inode->i_alloc_sem); +#endif AFS_GLOCK(); MReleaseWriteLock(&afs_xosi); return code; @@ -211,8 +217,12 @@ afs_osi_Write(afile, offset, aptr, asize) size_t resid; register afs_int32 code; AFS_STATCNT(osi_Write); - if ( !afile ) - osi_Panic("afs_osi_Write called with null param"); + if ( !afile ) { + if ( !afs_shuttingdown ) + osi_Panic("afs_osi_Write called with null param"); + else + return EIO; + } if (offset != -1) afile->offset = offset; AFS_GUNLOCK(); code = osi_rdwr(UIO_WRITE, afile, (caddr_t)aptr, asize, &resid); diff --git a/src/afs/LINUX/osi_misc.c b/src/afs/LINUX/osi_misc.c index dff15511f..f0dcfe437 100644 --- a/src/afs/LINUX/osi_misc.c +++ b/src/afs/LINUX/osi_misc.c @@ -14,7 +14,7 @@ #include #include "../afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_misc.c,v 1.13 2003/04/13 19:32:22 hartmans Exp $"); +RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_misc.c,v 1.14 2003/07/30 17:23:43 hartmans Exp $"); #include "../afs/sysincludes.h" #include "../afs/afsincludes.h" @@ -25,37 +25,53 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_misc.c,v 1.13 2003/04/13 char *crash_addr = 0; /* Induce an oops by writing here. */ +#if defined(AFS_LINUX24_ENV) /* Lookup name and return vnode for same. */ -int osi_lookupname(char *aname, uio_seg_t seg, int followlink, - vnode_t **dirvpp, struct dentry **dpp) +int osi_lookupname_internal(char *aname, uio_seg_t seg, int followlink, + vnode_t **dirvpp, struct dentry **dpp, + struct nameidata *nd) { -#if defined(AFS_LINUX24_ENV) - struct nameidata nd; -#else - struct dentry *dp = NULL; -#endif int code; code = ENOENT; -#if defined(AFS_LINUX24_ENV) if (seg == AFS_UIOUSER) { code = followlink ? - user_path_walk(aname, &nd) : user_path_walk_link(aname, &nd); + user_path_walk(aname, nd) : user_path_walk_link(aname, nd); } else { - if (path_init(aname, followlink ? LOOKUP_FOLLOW : 0, &nd)) - code = path_walk(aname, &nd); + if (path_init(aname, followlink ? LOOKUP_FOLLOW : 0, nd)) + code = path_walk(aname, nd); } if (!code) { - if (nd.dentry->d_inode) { - *dpp = dget(nd.dentry); + if (nd->dentry->d_inode) { + *dpp = dget(nd->dentry); code = 0; - } else + } else { code = ENOENT; - path_release(&nd); + path_release(nd); + } } + return code; +} +#endif + +int osi_lookupname(char *aname, uio_seg_t seg, int followlink, + vnode_t **dirvpp, struct dentry **dpp) +{ +#if defined(AFS_LINUX24_ENV) + struct nameidata nd; + int code = osi_lookupname_internal(aname, seg, followlink, dirvpp, dpp, + &nd); + if (!code) + path_release(&nd); + + return (code); #else + struct dentry *dp = NULL; + int code; + + code = ENOENT; if (seg == AFS_UIOUSER) { dp = followlink ? namei(aname) : lnamei(aname); } @@ -71,9 +87,9 @@ int osi_lookupname(char *aname, uio_seg_t seg, int followlink, else dput(dp); } -#endif return code; +#endif } /* Intialize cache device info and fragment size for disk cache partition. */ @@ -85,8 +101,10 @@ int osi_InitCacheInfo(char *aname) extern struct osi_dev cacheDev; extern afs_int32 afs_fsfragsize; extern struct super_block *afs_cacheSBp; + extern struct nameidata afs_cacheNd; - code = osi_lookupname(aname, AFS_UIOSYS, 1, NULL, &dp); + code = osi_lookupname_internal(aname, AFS_UIOSYS, 1, NULL, &dp, + &afs_cacheNd); if (code) return ENOENT; cacheInode = dp->d_inode->i_ino; diff --git a/src/afs/LINUX/osi_module.c b/src/afs/LINUX/osi_module.c index 093363beb..38e5e344f 100644 --- a/src/afs/LINUX/osi_module.c +++ b/src/afs/LINUX/osi_module.c @@ -14,25 +14,28 @@ #include #include "../afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_module.c,v 1.11 2003/04/13 19:32:22 hartmans Exp $"); +RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_module.c,v 1.12 2003/07/30 17:23:43 hartmans Exp $"); #include "../afs/sysincludes.h" #include "../afs/afsincludes.h" #include "../h/unistd.h" /* For syscall numbers. */ #include "../h/mm.h" +#ifdef AFS_AMD64_LINUX20_ENV +#include "../asm/ia32_unistd.h" +#endif + #include #include #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) #include #include #endif -#ifndef EXPORTED_SYS_CALL_TABLE +#if !defined(EXPORTED_SYS_CALL_TABLE) && defined(HAVE_KERNEL_LINUX_SYSCALL_H) #include #endif - #ifdef AFS_SPARC64_LINUX24_ENV #define __NR_setgroups32 82 /* This number is not exported for some bizarre reason. */ #endif @@ -77,17 +80,31 @@ static unsigned int afs_ni_syscall = 0; static void* afs_ni_syscall = 0; #endif +#ifdef AFS_AMD64_LINUX20_ENV +#ifdef EXPORTED_IA32_SYS_CALL_TABLE +extern void * ia32_sys_call_table[]; +#else +static void **ia32_sys_call_table; +#endif + +static void *ia32_ni_syscall = 0; +asmlinkage long (*sys32_setgroupsp)(int gidsetsize, old_gid_t *grouplist); +#if defined(__NR_ia32_setgroups32) +asmlinkage long (*sys32_setgroups32p)(int gidsetsize, gid_t *grouplist); +#endif /* __NR_ia32_setgroups32 */ +#endif /* AFS_AMD64_LINUX20_ENV */ + #ifdef AFS_SPARC64_LINUX20_ENV static unsigned int afs_ni_syscall32 = 0; asmlinkage int (*sys32_setgroupsp)(int gidsetsize, __kernel_gid_t32 *grouplist); #if defined(__NR_setgroups32) asmlinkage int (*sys32_setgroups32p)(int gidsetsize, __kernel_gid_t32 *grouplist); -#endif +#endif /* __NR_setgroups32 */ #ifdef EXPORTED_SYS_CALL_TABLE extern unsigned int sys_call_table32[]; -#else +#else /* EXPORTED_SYS_CALL_TABLE */ static unsigned int *sys_call_table32; -#endif +#endif /* EXPORTED_SYS_CALL_TABLE */ asmlinkage int afs_syscall32(long syscall, long parm1, long parm2, long parm3, long parm4, long parm5) @@ -99,7 +116,7 @@ __asm__ __volatile__ ("srl %o4, 0, %o4\n\t" "ret\n\t" "nop"); } -#endif +#endif /* AFS_SPARC64_LINUX20_ENV */ #ifdef AFS_IA64_LINUX20_ENV @@ -177,7 +194,7 @@ struct fptr #ifdef AFS_LINUX24_ENV asmlinkage int (*sys_setgroups32p)(int gidsetsize, __kernel_gid32_t *grouplist); -#endif +#endif /* AFS_LINUX24_ENV */ #ifdef AFS_SPARC64_LINUX20_ENV #define POINTER2SYSCALL (unsigned int)(unsigned long) @@ -201,15 +218,18 @@ int init_module(void) extern long afs_xsetgroups(); #if defined(__NR_setgroups32) extern int afs_xsetgroups32(); -#endif -#ifdef AFS_SPARC64_LINUX20_ENV +#endif /* __NR_setgroups32 */ +#if defined(AFS_SPARC64_LINUX20_ENV) || defined (AFS_AMD64_LINUX20_ENV) extern int afs32_xsetgroups(); -#if defined(__NR_setgroups32) +#if (defined(__NR_setgroups32) && defined(AFS_SPARC64_LINUX20_ENV)) extern int afs32_xsetgroups32(); #endif +#if (defined(__NR_ia32_setgroups32) && defined(AFS_AMD64_LINUX20_ENV)) + extern int afs32_xsetgroups32(); #endif +#endif /* AFS_SPARC64_LINUX20_ENV || AFS_AMD64_LINUX20_ENV */ -#ifndef EXPORTED_SYS_CALL_TABLE +#if !defined(EXPORTED_SYS_CALL_TABLE) || (defined(AFS_AMD64_LINUX20_ENV) && !defined(EXPORTED_IA32_SYS_CALL_TABLE)) unsigned long *ptr; unsigned long offset; unsigned long datalen; @@ -224,7 +244,7 @@ int init_module(void) char *sym_name; unsigned long sym_start; unsigned long sym_end; -#endif +#endif /* EXPORTED_SYS_CALL_TABLE */ RWLOCK_INIT(&afs_xosi, "afs_xosi"); @@ -237,7 +257,7 @@ int init_module(void) printf("afs: Unable to obtain PAGE_OFFSET. Exiting.."); return -EIO; } -#endif +#endif /* AFS_S390_LINUX22_ENV */ #ifndef EXPORTED_SYS_CALL_TABLE sys_call_table=0; @@ -266,10 +286,15 @@ int init_module(void) #if defined(AFS_IA64_LINUX20_ENV) ptr = (unsigned long *) (&sys_close - 0x180000); datalen=0x180000/sizeof(ptr); +#else +#if defined(AFS_AMD64_LINUX20_ENV) + ptr=(unsigned long *)&init_mm; + datalen=0x360000/sizeof(ptr); #else ptr=(unsigned long *)&init_mm; datalen=16384; #endif +#endif #endif for (offset=0;offset gp; @@ -356,6 +454,12 @@ error cant support this yet. sys_call_table32[__NR_afs_syscall] = POINTER2SYSCALL afs_syscall32; # endif #endif /* AFS_IA64_LINUX20_ENV */ +#ifdef AFS_AMD64_LINUX20_ENV + if (ia32_sys_call_table) { + ia32_ni_syscall = ia32_sys_call_table[__NR_ia32_afs_syscall]; + ia32_sys_call_table[__NR_ia32_afs_syscall] = POINTER2SYSCALL afs_syscall; + } +#endif osi_Init(); register_filesystem(&afs_file_system); @@ -372,18 +476,32 @@ error cant support this yet. #else /* AFS_IA64_LINUX20_ENV */ sys_setgroupsp = SYSCALL2POINTER sys_call_table[__NR_setgroups]; sys_call_table[__NR_setgroups] = POINTER2SYSCALL afs_xsetgroups; -# ifdef AFS_SPARC64_LINUX20_ENV +#ifdef AFS_SPARC64_LINUX20_ENV sys32_setgroupsp = SYSCALL2POINTER sys_call_table32[__NR_setgroups]; sys_call_table32[__NR_setgroups] = POINTER2SYSCALL afs32_xsetgroups; -# endif -# if defined(__NR_setgroups32) +#endif /* AFS_SPARC64_LINUX20_ENV */ +#if defined(__NR_setgroups32) sys_setgroups32p = SYSCALL2POINTER sys_call_table[__NR_setgroups32]; sys_call_table[__NR_setgroups32] = POINTER2SYSCALL afs_xsetgroups32; -# ifdef AFS_SPARC64_LINUX20_ENV +#ifdef AFS_SPARC64_LINUX20_ENV sys32_setgroups32p = SYSCALL2POINTER sys_call_table32[__NR_setgroups32]; sys_call_table32[__NR_setgroups32] = POINTER2SYSCALL afs32_xsetgroups32; -# endif -# endif +#endif /* AFS_SPARC64_LINUX20_ENV */ +#endif /* __NR_setgroups32 */ +#ifdef AFS_AMD64_LINUX20_ENV + if (ia32_sys_call_table) { + sys32_setgroupsp = + SYSCALL2POINTER ia32_sys_call_table[__NR_ia32_setgroups]; + ia32_sys_call_table[__NR_ia32_setgroups] = + POINTER2SYSCALL afs32_xsetgroups; +#if defined(__NR_ia32_setgroups32) + sys32_setgroups32p = + SYSCALL2POINTER ia32_sys_call_table[__NR_ia32_setgroups32]; + ia32_sys_call_table[__NR_ia32_setgroups32] = + POINTER2SYSCALL afs32_xsetgroups32; +#endif /* __NR_ia32_setgroups32 */ + } +#endif /* AFS_AMD64_LINUX20_ENV */ #endif /* AFS_IA64_LINUX20_ENV */ osi_sysctl_init(); @@ -418,6 +536,18 @@ void cleanup_module(void) # endif # endif #endif /* AFS_IA64_LINUX20_ENV */ +#ifdef AFS_AMD64_LINUX20_ENV + if (ia32_sys_call_table) { + ia32_sys_call_table[__NR_ia32_setgroups] = + POINTER2SYSCALL sys32_setgroupsp; + ia32_sys_call_table[__NR_ia32_afs_syscall] = + POINTER2SYSCALL ia32_ni_syscall; +# if defined(__NR_setgroups32) + ia32_sys_call_table[__NR_ia32_setgroups32] = + POINTER2SYSCALL sys32_setgroups32p; +#endif + } +#endif unregister_filesystem(&afs_file_system); osi_linux_free_inode_pages(); /* Invalidate all pages using AFS inodes. */ @@ -434,7 +564,7 @@ module_exit(afs_cleanup); static long get_page_offset(void) { -#if defined(AFS_PPC_LINUX22_ENV) || defined(AFS_SPARC64_LINUX20_ENV) || defined(AFS_SPARC_LINUX20_ENV) || defined(AFS_ALPHA_LINUX20_ENV) || defined(AFS_S390_LINUX22_ENV) || defined(AFS_IA64_LINUX20_ENV) || defined(AFS_PARISC_LINUX24_ENV) +#if defined(AFS_PPC_LINUX22_ENV) || defined(AFS_SPARC64_LINUX20_ENV) || defined(AFS_SPARC_LINUX20_ENV) || defined(AFS_ALPHA_LINUX20_ENV) || defined(AFS_S390_LINUX22_ENV) || defined(AFS_IA64_LINUX20_ENV) || defined(AFS_PARISC_LINUX24_ENV) || defined(AFS_AMD64_LINUX20_ENV) return PAGE_OFFSET; #else struct task_struct *p, *q; diff --git a/src/afs/Makefile.in b/src/afs/Makefile.in index 90011537d..99d72bd4a 100644 --- a/src/afs/Makefile.in +++ b/src/afs/Makefile.in @@ -25,8 +25,8 @@ TOP_SRCDIR=@TOP_SRCDIR@ SYS_NAME=@AFS_SYSNAME@ SHELL=/bin/sh -KERNELDIR = ../libafs/ -UKERNELDIR = ../libuafs/ +KERNELDIR = ../libafs +UKERNELDIR = ../libuafs include ../config/Makefile.${SYS_NAME} @@ -36,21 +36,25 @@ all: kinstall ukinstall ${TOP_INCDIR}/afs/afs.h ${TOP_INCDIR}/afs/osi_inode.h ${ ${INSTALL} longc_procs.h ${TOP_INCDIR}/afs ;; \ esac +kinstall: ${KERNELDIR}/afs AFS_component_version_number.c afs_trace.h afszcm.cat + -chmod 666 ${KERNELDIR}/afs/* + ${INSTALL} *.[csh] ${KERNELDIR}/afs + ${INSTALL} VNOPS/*.[csh] ${KERNELDIR}/afs + ${INSTALL} ${AFS_OSTYPE}/*.[csh] ${KERNELDIR}/afs + +afs_trace.h: afs_trace.et + ${COMPILE_ET} -v 2 afs_trace.et + # NOTE: linux case uses --new as well to work around bug in some versions of # gencat. -kinstall: ${KERNELDIR}/afs AFS_component_version_number.c - -chmod 666 ${KERNELDIR}afs/* - ${COMPILE_ET} -v 2 afs_trace.et - ${INSTALL} *.[csh] ${KERNELDIR}afs - ${INSTALL} VNOPS/*.[csh] ${KERNELDIR}afs - ${INSTALL} ${AFS_OSTYPE}/*.[csh] ${KERNELDIR}afs +afszcm.cat: afs_trace.msf -$(RM) -f afszcm.cat case ${SYS_NAME} in \ sgi_* ) \ gencat -m afszcm.cat afs_trace.msf ;; \ sun*_4* ) \ /usr/etc/gencat afszcm.cat afs_trace.msf ;; \ - *_linux* ) \ + *_linux* | *_umlinux* ) \ gencat --new afszcm.cat afs_trace.msf ;; \ ppc_darwin* | i386_fbsd*) \ echo No gencat for ${SYS_NAME} ;; \ @@ -61,12 +65,11 @@ kinstall: ${KERNELDIR}/afs AFS_component_version_number.c ${KERNELDIR}/afs: mkdir -p $@ -ukinstall: ${UKERNELDIR}/afs AFS_component_version_number.c - -chmod 666 ${UKERNELDIR}afs/* - ${COMPILE_ET} -v 2 afs_trace.et - ${INSTALL} *.[csh] ${UKERNELDIR}afs - ${INSTALL} VNOPS/*.[csh] ${UKERNELDIR}afs - ${INSTALL} UKERNEL/*.[csh] ${UKERNELDIR}afs +ukinstall: ${UKERNELDIR}/afs AFS_component_version_number.c afs_trace.h + -chmod 666 ${UKERNELDIR}/afs/* + ${INSTALL} *.[csh] ${UKERNELDIR}/afs + ${INSTALL} VNOPS/*.[csh] ${UKERNELDIR}/afs + ${INSTALL} UKERNEL/*.[csh] ${UKERNELDIR}/afs ${UKERNELDIR}/afs: mkdir -p $@ diff --git a/src/afs/VNOPS/afs_vnop_readdir.c b/src/afs/VNOPS/afs_vnop_readdir.c index ea68ed478..669fa44fb 100644 --- a/src/afs/VNOPS/afs_vnop_readdir.c +++ b/src/afs/VNOPS/afs_vnop_readdir.c @@ -22,7 +22,7 @@ #include #include "../afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_readdir.c,v 1.10 2002/12/11 03:00:39 hartmans Exp $"); +RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_readdir.c,v 1.11 2003/07/30 17:23:44 hartmans Exp $"); #include "../afs/sysincludes.h" /* Standard vendor system headers */ #include "../afs/afsincludes.h" /* Afs-based standard headers */ @@ -31,6 +31,11 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_readdir.c,v 1.10 200 #include "../afs/nfsclient.h" #include "../afs/afs_osidnlc.h" +#if defined(AFS_HPUX1122_ENV) +#define DIRPAD 7 +#else +#define DIRPAD 3 +#endif /** * A few definitions. This is until we have a proper header file @@ -172,7 +177,7 @@ struct minnfs_direct { u_short d_reclen; u_short d_namlen; }; -#define NDIRSIZ_LEN(len) ((sizeof (struct dirent)+4 - (MAXNAMLEN+1)) + (((len)+1 + 3) &~ 3)) +#define NDIRSIZ_LEN(len) ((sizeof (struct dirent)+4 - (MAXNAMLEN+1)) + (((len)+1 + DIRPAD) &~ DIRPAD)) #endif #endif /* !defined(UKERNEL) */ @@ -200,7 +205,7 @@ int afs_rd_stash_i = 0; */ #if defined(AFS_HPUX100_ENV) #define DIRSIZ_LEN(len) \ - ((sizeof (struct __dirent) - (_MAXNAMLEN+1)) + (((len)+1 + 3) &~ 3)) + ((sizeof (struct __dirent) - (_MAXNAMLEN+1)) + (((len)+1 + DIRPAD) &~ DIRPAD)) #else #if defined(AFS_SUN56_ENV) #define DIRSIZ_LEN(len) ((18 + (len) + 1 + 7) & ~7 ) @@ -406,7 +411,7 @@ int off; /* pad out the remaining characters with zeros */ if (code == 0) { - AFS_UIOMOVE(bufofzeros, ((slen + 4) & ~3) - slen, UIO_READ, + AFS_UIOMOVE(bufofzeros, ((slen + 1 + DIRPAD) & ~DIRPAD) - slen, UIO_READ, auio, code); } AFS_MOVE_LOCK(); @@ -620,7 +625,7 @@ tagain: AFS_UIOMOVE(ode->name, o_slen, UIO_READ, auio, code); /* pad out the remaining characters with zeros */ if (code == 0) { - AFS_UIOMOVE(bufofzeros, ((o_slen + 4) & ~3) - o_slen, UIO_READ, auio, code); + AFS_UIOMOVE(bufofzeros, ((o_slen + 1 + DIRPAD) & ~DIRPAD) - o_slen, UIO_READ, auio, code); } /* pad out the difference between rlen and slen... */ if (DIRSIZ_LEN(o_slen) < rlen) { @@ -683,7 +688,7 @@ tagain: AFS_UIOMOVE(ode->name, o_slen, UIO_READ, auio, code); /* pad out the remaining characters with zeros */ if (code == 0) { - AFS_UIOMOVE(bufofzeros, ((o_slen + 4) & ~3) - o_slen, UIO_READ, auio, code); + AFS_UIOMOVE(bufofzeros, ((o_slen + 1 + DIRPAD) & ~DIRPAD) - o_slen, UIO_READ, auio, code); } /* pad out the difference between rlen and slen... */ if (DIRSIZ_LEN(o_slen) < rlen) { @@ -734,7 +739,7 @@ tagain: AFS_UIOMOVE(ode->name, o_slen, UIO_READ, auio, code); /* pad out the remaining characters with zeros */ if (code == 0) { - AFS_UIOMOVE(bufofzeros, ((o_slen + 4) & ~3) - o_slen, + AFS_UIOMOVE(bufofzeros, ((o_slen + 1 + DIRPAD) & ~DIRPAD) - o_slen, UIO_READ, auio, code); } /* pad out the difference between rlen and slen... */ @@ -882,7 +887,7 @@ tagain: } /* pad out the remaining characters with zeros */ if (code == 0) { - AFS_UIOMOVE(bufofzeros, ((o_slen + 4) & ~3) - o_slen, UIO_READ, auio, code); + AFS_UIOMOVE(bufofzeros, ((o_slen + 1 + DIRPAD) & ~DIRPAD) - o_slen, UIO_READ, auio, code); } /* pad out the difference between rlen and slen... */ if (NDIRSIZ_LEN(o_slen) < rlen) { @@ -931,7 +936,7 @@ tagain: AFS_UIOMOVE(ode->name, o_slen, UIO_READ, auio, code); /* pad out the remaining characters with zeros */ if (code == 0) { - AFS_UIOMOVE(bufofzeros, ((o_slen + 4) & ~3) - o_slen, UIO_READ, auio, code); + AFS_UIOMOVE(bufofzeros, ((o_slen + 1 + DIRPAD) & ~DIRPAD) - o_slen, UIO_READ, auio, code); } /* pad out the difference between rlen and slen... */ if (NDIRSIZ_LEN(o_slen) < rlen) { @@ -977,7 +982,7 @@ tagain: AFS_UIOMOVE(ode->name, o_slen, UIO_READ, auio, code); /* pad out the remaining characters with zeros */ if (code == 0) { - AFS_UIOMOVE(bufofzeros, ((o_slen + 4) & ~3) - o_slen, UIO_READ, auio, code); + AFS_UIOMOVE(bufofzeros, ((o_slen + 1 + DIRPAD) & ~DIRPAD) - o_slen, UIO_READ, auio, code); } /* pad out the difference between rlen and slen... */ if (NDIRSIZ_LEN(o_slen) < rlen) { diff --git a/src/afs/afs_call.c b/src/afs/afs_call.c index 4280a570f..0e50d3984 100644 --- a/src/afs/afs_call.c +++ b/src/afs/afs_call.c @@ -10,7 +10,7 @@ #include #include "../afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_call.c,v 1.15 2003/04/13 19:32:22 hartmans Exp $"); +RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_call.c,v 1.16 2003/07/30 17:23:42 hartmans Exp $"); #include "../afs/sysincludes.h" /* Standard vendor system headers */ #include "../afs/afsincludes.h" /* Afs-based standard headers */ @@ -731,10 +731,13 @@ long parm, parm2, parm3, parm4, parm5, parm6; #endif afs_cold_shutdown = 0; if (parm == 1) afs_cold_shutdown = 1; - if (afs_globalVFS != 0) - afs_warn("AFS isn't unmounted yet!\n"); - - afs_shutdown(); +#ifndef AFS_DARWIN_ENV + if (afs_globalVFS != 0) { + afs_warn("AFS isn't unmounted yet! Call aborted\n"); + code = EACCES; + } else +#endif + afs_shutdown(); } #if ! defined(AFS_HPUX90_ENV) || defined(AFS_HPUX100_ENV) @@ -1090,11 +1093,13 @@ copyin_iparam(caddr_t cmarg, struct iparam *dst) #ifdef AFS_SPARC64_LINUX24_ENV if (current->thread.flags & SPARC_FLAG_32BIT) -#elif AFS_SPARC64_LINUX20_ENV +#elif defined(AFS_SPARC64_LINUX20_ENV) if (current->tss.flags & SPARC_FLAG_32BIT) +#elif defined(AFS_AMD64_LINUX20_ENV) + if (current->thread.flags & THREAD_IA32) #else #error Not done for this linux version -#endif /* AFS_SPARC64_LINUX20_ENV */ +#endif { AFS_COPYIN(cmarg, (caddr_t) &dst32, sizeof dst32, code); if (!code) @@ -1171,7 +1176,7 @@ struct afssysargs { long parm6; /* not actually used - should be removed */ }; /* Linux system calls only set up for 5 arguments. */ -asmlinkage int afs_syscall(long syscall, long parm1, long parm2, long parm3, +asmlinkage long afs_syscall(long syscall, long parm1, long parm2, long parm3, long parm4) { struct afssysargs args, *uap = &args; diff --git a/src/afs/afs_pioctl.c b/src/afs/afs_pioctl.c index b314112ca..7fd33743b 100644 --- a/src/afs/afs_pioctl.c +++ b/src/afs/afs_pioctl.c @@ -10,7 +10,7 @@ #include #include "../afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_pioctl.c,v 1.16 2003/04/13 19:32:22 hartmans Exp $"); +RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_pioctl.c,v 1.17 2003/07/30 17:23:43 hartmans Exp $"); #include "../afs/sysincludes.h" /* Standard vendor system headers */ #include "../afs/afsincludes.h" /* Afs-based standard headers */ @@ -208,16 +208,18 @@ copyin_afs_ioctl(caddr_t cmarg, struct afs_ioctl *dst) } #endif /* defined(AFS_SGI_ENV) && (_MIPS_SZLONG==64) */ -#if defined(AFS_LINUX_64BIT_KERNEL) && !defined(AFS_ALPHA_LINUX20_ENV) && !defined(AFS_IA64_LINUX20_ENV) +#if defined(AFS_LINUX_64BIT_KERNEL) && !defined(AFS_ALPHA_LINUX20_ENV) && !defined(AFS_IA64_LINUX20_ENV) struct afs_ioctl32 dst32; #ifdef AFS_SPARC64_LINUX24_ENV if (current->thread.flags & SPARC_FLAG_32BIT) -#elif AFS_SPARC64_LINUX20_ENV +#elif defined(AFS_SPARC64_LINUX20_ENV) if (current->tss.flags & SPARC_FLAG_32BIT) +#elif defined(AFS_AMD64_LINUX20_ENV) + if (current->thread.flags & THREAD_IA32) #else #error Not done for this linux type -#endif /* AFS_SPARC64_LINUX20_ENV */ +#endif { AFS_COPYIN(cmarg, (caddr_t) &dst32, sizeof dst32, code); if (!code) @@ -1084,7 +1086,11 @@ afs_HandlePioctl(avc, acom, ablob, afollow, acred) return EINVAL; /* out of range */ } inSize = ablob->in_size; - if (inSize >= PIGGYSIZE) return E2BIG; + + /* Do all range checking before continuing */ + if (inSize >= PIGGYSIZE || inSize < 0 || ablob->out_size < 0) + return E2BIG; + inData = osi_AllocLargeSpace(AFS_LRALLOCSIZ); if (inSize > 0) { AFS_COPYIN(ablob->in, inData, inSize, code); diff --git a/src/audit/Makefile.in b/src/audit/Makefile.in index aebbbdbe5..98bd370b7 100644 --- a/src/audit/Makefile.in +++ b/src/audit/Makefile.in @@ -35,7 +35,7 @@ SHELL = /bin/sh include ../config/Makefile.${SYS_NAME} -UKERNELDIR = ../libuafs/ +UKERNELDIR = ../libuafs CFLAGS=${OPTMZ} -I${TOP_SRCDIR}/config -I${TOP_INCDIR} ${XCFLAGS} diff --git a/src/auth/Makefile.in b/src/auth/Makefile.in index a48c04a5d..a190f1518 100644 --- a/src/auth/Makefile.in +++ b/src/auth/Makefile.in @@ -27,15 +27,15 @@ SHELL = /bin/sh include ../config/Makefile.${SYS_NAME} -KERNELDIR = ../libafs/ -UKERNELDIR = ../libuafs/ +KERNELDIR = ../libafs +UKERNELDIR = ../libuafs COMPILE_ET=${TOP_SRCDIR}/comerr/compile_et OBJS= cellconfig.o ktc.o userok.o writeconfig.o authcon.o \ acfg_errors.o ktc_errors.o KOBJS= cellconfig.o ktc.krb.o userok.o writeconfig.o authcon.o \ acfg_errors.o ktc_errors.o -CFLAGS=-g -I${TOP_SRCDIR}/config -I${TOP_INCDIR} ${XCFLAGS} +CFLAGS=${DBG} -I${TOP_SRCDIR}/config -I${TOP_INCDIR} ${XCFLAGS} LIBS=libauth.a ${TOP_LIBDIR}/libsys.a \ ${TOP_LIBDIR}/librxkad.a ${TOP_LIBDIR}/libdes.a \ ${TOP_LIBDIR}/librx.a ${TOP_LIBDIR}/libsys.a \ diff --git a/src/comerr/Makefile.in b/src/comerr/Makefile.in index ab21fba4f..b0318fb0f 100644 --- a/src/comerr/Makefile.in +++ b/src/comerr/Makefile.in @@ -27,7 +27,7 @@ SHELL = /bin/sh include ../config/Makefile.${SYS_NAME} -UKERNELDIR=../libuafs/ +UKERNELDIR=../libuafs CFLAGS=${OPTMZ} -I${TOP_INCDIR} -I${TOP_SRCDIR}/config ${XCFLAGS} diff --git a/src/config/Makefile.i386_linux22.in b/src/config/Makefile.i386_linux22.in index 6f2b45165..90076d790 100644 --- a/src/config/Makefile.i386_linux22.in +++ b/src/config/Makefile.i386_linux22.in @@ -32,7 +32,7 @@ SHLIB_LINKER=${MT_CC} -shared # # libraries MTLIBS=-lpthread -TXLIBS= /usr/lib/libncurses.so +TXLIBS=-lncurses XLIBS= @LIB_AFSDB@ # # programs diff --git a/src/config/param.i386_linux24.h b/src/config/param.i386_linux24.h index b6018605e..b4a1a5125 100644 --- a/src/config/param.i386_linux24.h +++ b/src/config/param.i386_linux24.h @@ -68,6 +68,13 @@ #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_linux24" #define SYS_NAME_ID SYS_NAME_ID_i386_linux24 diff --git a/src/des/Makefile.in b/src/des/Makefile.in index b72c3620d..55c13ceb7 100644 --- a/src/des/Makefile.in +++ b/src/des/Makefile.in @@ -44,7 +44,7 @@ SYS_NAME=@AFS_SYSNAME@ SHELL = /bin/sh include ../config/Makefile.${SYS_NAME} -UKERNELDIR=../libuafs/ +UKERNELDIR=../libuafs LDFLAGS = ${XLDFLAGS} diff --git a/src/kauth/Makefile.in b/src/kauth/Makefile.in index 4d8db9165..abed8b602 100644 --- a/src/kauth/Makefile.in +++ b/src/kauth/Makefile.in @@ -27,7 +27,7 @@ SHELL = /bin/sh include ../config/Makefile.${SYS_NAME} -UKERNELDIR = ../libuafs/ +UKERNELDIR = ../libuafs COMPILE_ET=${TOP_SRCDIR}/comerr/compile_et CFLAGS=${OPTMZ} -I${TOP_SRCDIR}/config -I${TOP_INCDIR} ${XCFLAGS} diff --git a/src/libafs/Makefile.common b/src/libafs/Makefile.common index 73a84c64d..72be7001f 100644 --- a/src/libafs/Makefile.common +++ b/src/libafs/Makefile.common @@ -8,7 +8,7 @@ # Common elements for Makefiles for all system types. # SHELL=/bin/sh -INCLUDE= -I. -I/usr/include -I${TOP_SRCDIR}/config +INCLUDE= -I. -I${TOP_SRCDIR}/config AFS =../afs RX =../rx AFSINT =../afsint diff --git a/src/libafs/MakefileProto.LINUX.in b/src/libafs/MakefileProto.LINUX.in index 0fd5ad186..f434f24f2 100644 --- a/src/libafs/MakefileProto.LINUX.in +++ b/src/libafs/MakefileProto.LINUX.in @@ -54,10 +54,17 @@ CC = gcc LD = ld GCC_KOPTS=@LINUX_GCC_KOPTS@ # -Wall + +P5PLUS=@P5PLUS_KOPTS@ +CCFLAGS = $(KDEBUG) -O2 $(FOMIT) $(GCC_KOPTS) -pipe $(P5PLUS) -I/usr/src/linux/arch/um/include -I/usr/src/linux/arch/um/kernel/tt/include -I/usr/src/linux/arch/um/kernel/skas/include +DEFINES = -D__KERNEL__ -DCPU=586 -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF} ${KDEFINES} P5PLUS=@P5PLUS_KOPTS@ CCFLAGS = $(KDEBUG) -O2 $(FOMIT) $(GCC_KOPTS) -pipe $(P5PLUS) DEFINES = -D__KERNEL__ -DCPU=586 -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF} ${KDEFINES} + +CCFLAGS = $(KDEBUG) -O2 $(FOMIT) $(GCC_KOPTS) -pipe -mcmodel=kernel +DEFINES = -D__KERNEL__ -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF} CCFLAGS = $(KDEBUG) -O2 $(FOMIT) $(GCC_KOPTS) -pipe -mno-fp-regs -ffixed-8 DEFINES = -D__KERNEL__ -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF} @@ -128,7 +135,7 @@ ${COMPDIRS} ${INSTDIRS} ${DESTDIRS}: $(RM) -f linux ln -s ${LINUX_KERNEL_PATH}/include/linux linux $(RM) -f net - ln -s ${LINUX_KERNEL_PATH}/include/linux net + ln -s ${LINUX_KERNEL_PATH}/include/net net $(RM) -f netinet ln -s ${LINUX_KERNEL_PATH}/include/linux netinet $(RM) -f sys @@ -140,6 +147,10 @@ ${COMPDIRS} ${INSTDIRS} ${DESTDIRS}: ln -s ${LINUX_KERNEL_PATH}/include/asm-alpha asm ln -s ${LINUX_KERNEL_PATH}/include/asm-i386 asm + + ln -s ${LINUX_KERNEL_PATH}/include/asm-um asm + + ln -fs ${LINUX_KERNEL_PATH}/include/asm-x86_64 asm ln -s ${LINUX_KERNEL_PATH}/include/asm-s390 asm diff --git a/src/lwp/Makefile.in b/src/lwp/Makefile.in index 75864ba14..46c0f7bcc 100644 --- a/src/lwp/Makefile.in +++ b/src/lwp/Makefile.in @@ -81,7 +81,7 @@ process.o : process.s process.c /usr/bin/cpp -P process.fbsd.s > process.ss; \ ${AS} -o process.o process.ss; \ $(RM) process.ss ;; \ - hp* | *_linux* | sgi_64 | sgi_65 ) \ + hp* | *_linux* | *_umlinux* | sgi_64 | sgi_65 | ia64_hpux* ) \ ${CC} ${CFLAGS} -c process.c;; \ alpha_osf1 | alpha_osf20 | alpha_osf30 | alpha_osf32 | alpha_osf32c | alpha_dux?? ) \ ${AS} -v -P -DOSF -I${TOP_INCDIR} -DASSEMBLER process.s; \ diff --git a/src/lwp/lwp.h b/src/lwp/lwp.h index 4e9c202a9..0216e8350 100644 --- a/src/lwp/lwp.h +++ b/src/lwp/lwp.h @@ -293,11 +293,21 @@ extern * cases, and also between machines apparently running the same OS * version. */ + +/* + * On ia64 where the ucontext is used, it can be an extra 48K + * Need to account for this. There might be two of these on the + * stack too. This needs to be checked. + */ +#if defined(USE_UCONTEXT) && defined(HAVE_UCONTEXT_H) +#define AFS_LWP_MINSTACKSIZE (288 * 1024) +#else #if defined(AFS_LINUX22_ENV) #define AFS_LWP_MINSTACKSIZE (192 * 1024) #else #define AFS_LWP_MINSTACKSIZE (48 * 1024) #endif +#endif /* Action to take on stack overflow. */ #define LWP_SOQUIET 1 /* do nothing */ diff --git a/src/lwp/process.c b/src/lwp/process.c index 3f24271b9..317d6fd4e 100644 --- a/src/lwp/process.c +++ b/src/lwp/process.c @@ -12,7 +12,7 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/lwp/process.c,v 1.10 2002/09/26 19:18:08 hartmans Exp $"); +RCSID("$Header: /tmp/cvstemp/openafs/src/lwp/process.c,v 1.11 2003/07/30 17:23:44 hartmans Exp $"); #include #include @@ -37,6 +37,14 @@ char* newsp; { #if defined(AFS_IA64_LINUX20_ENV) register unsigned long sp __asm__("r12"); +#elif defined(AFS_HPUX1122_ENV) +/* don't need anything special, will use + * ucontext.uc_stack.ss_sp as it matches r12. + * This should also work for Linux, + * but dont have system to test DEE + */ +#elif defined(AFS_AMD64_LINUX24_ENV) + register unsigned long sp __asm__("sp"); #else #error "You need to update stack pointer register for this platform" #endif @@ -45,7 +53,11 @@ char* newsp; savearea->state = 0; getcontext(&savearea->ucontext); +#if defined(AFS_HPUX1122_ENV) + savearea->topstack = savearea->ucontext.uc_stack.ss_sp; +#else savearea->topstack = sp; +#endif switch (savearea->state) { case 0: diff --git a/src/pam/Makefile.in b/src/pam/Makefile.in index 7f2c9f19a..8f8e5db05 100644 --- a/src/pam/Makefile.in +++ b/src/pam/Makefile.in @@ -24,7 +24,7 @@ RXGEN=${TOP_SRCDIR}/rxgen/rxgen TOP_SRCDIR=@TOP_SRCDIR@ SYS_NAME=@AFS_SYSNAME@ SHELL=/bin/sh -KERNELDIR = ../libafs/ +KERNELDIR = ../libafs include ../config/Makefile.${SYS_NAME} @@ -69,7 +69,7 @@ afs_util_krb.o: afs_util.c afs_util.h pam_afs.so.1: $(SHOBJS) afs_setcred.o afs_auth.o afs_util.o set -x; \ case "$(SYS_NAME)" in \ - hp_ux*) \ + hp_ux* | ia64_hpux*) \ $(LD) $(LDFLAGS) -c mapfile.hp -o $@ afs_setcred.o afs_auth.o afs_util.o\ $(SHOBJS) $(LIBS) ;; \ sun*_5*) \ @@ -86,7 +86,7 @@ pam_afs.so.1: $(SHOBJS) afs_setcred.o afs_auth.o afs_util.o pam_afs.krb.so.1: $(SHOBJS) afs_setcred_krb.o afs_auth_krb.o afs_util_krb.o set -x; \ case "$(SYS_NAME)" in \ - hp_ux*) \ + hp_ux* | ia64_hpux*) \ $(LD) $(LDFLAGS) -c mapfile.hp -o $@ \ afs_setcred_krb.o afs_auth_krb.o afs_util_krb.o $(SHOBJS) $(LDFLAGS) $(KLIBS) ;; \ sun*_5*) \ @@ -103,7 +103,7 @@ pam_afs.krb.so.1: $(SHOBJS) afs_setcred_krb.o afs_auth_krb.o afs_util_krb.o test_pam: test_pam.o set -x; \ case "$(SYS_NAME)" in \ - hp_ux*) \ + hp_ux* | ia64_hpux*) \ $(CC) $(CFLAGS) -o $@ test_pam.o ${PAMLIBS};; \ sun*_5*) \ $(CC) $(CFLAGS) -o $@ test_pam.o ${PAMLIBS};; \ diff --git a/src/pinstall/install.c b/src/pinstall/install.c index f5f3497f0..94ebfd235 100644 --- a/src/pinstall/install.c +++ b/src/pinstall/install.c @@ -49,7 +49,7 @@ Generic install command. Options are: #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/pinstall/install.c,v 1.2 2003/01/02 03:55:51 hartmans Exp $"); +RCSID("$Header: /tmp/cvstemp/openafs/src/pinstall/install.c,v 1.3 2003/07/30 17:23:45 hartmans Exp $"); #include #include @@ -85,12 +85,18 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/pinstall/install.c,v 1.2 2003/01/02 03: struct stat istat, ostat; +/* How many systems don't have strerror now? */ +#ifndef HAVE_STRERROR #if !defined(AFS_DARWIN60_ENV) extern int sys_nerr; #endif #if !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) extern char *sys_errlist[]; #endif +#else +#define ErrorString strerror +#endif + #if defined(AFS_AIX_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_DECOSF_ENV) || defined(AFS_SGI_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) extern struct passwd *getpwnam(); int stripcalled = 0; @@ -123,6 +129,7 @@ static char *strrpbrk (s, set) return 0; } +#ifndef HAVE_STRERROR char *ErrorString(aerrno) int aerrno; { static char tbuffer[100]; @@ -133,6 +140,7 @@ char *ErrorString(aerrno) } return tbuffer; } +#endif int stripName(aname) @@ -162,7 +170,8 @@ atoo(astr) static int quickStrip (iname, oname, ignored, copy_only) char *iname, *oname; { - int pid, status; + int pid; + pid_t status; static char *strip[] = { "strip", 0, 0, }; @@ -186,7 +195,7 @@ char *iname, *oname; { exit(1); default: /* parent */ - if (waitpid(pid, &status, 0) != pid) { + if (waitpid(pid, &status, 0) != pid && errno != ECHILD) { perror("waitpid"); return -1; } @@ -232,7 +241,7 @@ char *iname, *oname; { exit(1); default: /* parent */ - if (waitpid(pid, &status, 0) != pid) { + if (waitpid(pid, &status, 0) != pid && errno != ECHILD) { perror("waitpid"); return -1; } diff --git a/src/ptserver/ptserver.c b/src/ptserver/ptserver.c index 938a9d9da..5d744dfad 100644 --- a/src/ptserver/ptserver.c +++ b/src/ptserver/ptserver.c @@ -10,7 +10,7 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/ptserver/ptserver.c,v 1.8 2002/05/12 05:50:43 hartmans Exp $"); +RCSID("$Header: /tmp/cvstemp/openafs/src/ptserver/ptserver.c,v 1.9 2003/07/30 17:23:45 hartmans Exp $"); #include #ifdef AFS_AIX32_ENV @@ -69,7 +69,7 @@ int pr_rxstat_userok(call) return afsconf_SuperUser(prdir, call, (char *)0); } -void main (argc, argv) +int main (argc, argv) int argc; char **argv; { @@ -292,4 +292,5 @@ void main (argc, argv) rx_StartServer(1); osi_audit (PTS_FinishEvent, -1, AUD_END); + return 0; } diff --git a/src/rx/Makefile.in b/src/rx/Makefile.in index fba2b248c..4f28163be 100644 --- a/src/rx/Makefile.in +++ b/src/rx/Makefile.in @@ -29,8 +29,8 @@ SHELL = /bin/sh include ../config/Makefile.${SYS_NAME} -KERNELDIR = ../libafs/ -UKERNELDIR = ../libuafs/ +KERNELDIR = ../libafs +UKERNELDIR = ../libuafs CFLAGS=${OPTMZ} -I${TOP_SRCDIR}/config -I${TOP_INCDIR} -DRXDEBUG ${XCFLAGS} @@ -162,12 +162,12 @@ includes: \ ${TOP_INCDIR}/rx/xdr.h kinstall: ${KERNELDIR}/rx - $(INSTALL) $(MKAFS_OSTYPE)/*.[ch] $(KERNELDIR)rx - $(INSTALL) $(KSRCS) $(KERNELDIR)rx + $(INSTALL) $(MKAFS_OSTYPE)/*.[ch] $(KERNELDIR)/rx + $(INSTALL) $(KSRCS) $(KERNELDIR)/rx ukinstall: ${UKERNELDIR}/rx - $(INSTALL) $(UKSRCS) $(UKERNELDIR)rx - -$(INSTALL) UKERNEL/*.[ch] $(UKERNELDIR)rx + $(INSTALL) $(UKSRCS) $(UKERNELDIR)/rx + -$(INSTALL) UKERNEL/*.[ch] $(UKERNELDIR)/rx ${DEST}/include/rx/rx_packet.h: rx_packet.h ${INSTALL} $? $@ diff --git a/src/rx/rx.c b/src/rx/rx.c index 9b216b20d..3c754bb13 100644 --- a/src/rx/rx.c +++ b/src/rx/rx.c @@ -16,7 +16,7 @@ #include #endif -RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rx.c,v 1.14 2003/04/13 19:32:24 hartmans Exp $"); +RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rx.c,v 1.15 2003/07/30 17:23:45 hartmans Exp $"); #ifdef KERNEL #include "../afs/sysincludes.h" @@ -1492,6 +1492,13 @@ osi_socket *socketp; MUTEX_EXIT(&rx_serverPool_lock); MUTEX_ENTER(&call->lock); + if (call->flags & RX_CALL_WAIT_PROC) { + call->flags &= ~RX_CALL_WAIT_PROC; + MUTEX_ENTER(&rx_stats_mutex); + rx_nWaiting--; + MUTEX_EXIT(&rx_stats_mutex); + } + if (call->state != RX_STATE_PRECALL || call->error) { MUTEX_EXIT(&call->lock); MUTEX_ENTER(&rx_serverPool_lock); @@ -1505,10 +1512,6 @@ osi_socket *socketp; rxi_SendAck(call, 0, 0, 0, 0, RX_ACK_DELAY, 0); CLEAR_CALL_QUEUE_LOCK(call); - call->flags &= ~RX_CALL_WAIT_PROC; - MUTEX_ENTER(&rx_stats_mutex); - rx_nWaiting--; - MUTEX_EXIT(&rx_stats_mutex); break; } else { diff --git a/src/rx/rx_kcommon.h b/src/rx/rx_kcommon.h index 921e7a2d8..999d61a9f 100644 --- a/src/rx/rx_kcommon.h +++ b/src/rx/rx_kcommon.h @@ -14,6 +14,11 @@ #ifndef _RX_KCOMMON_H_ #define _RX_KCOMMON_H_ +#ifdef AFS_LINUX22_ENV +#define _LINUX_CODA_FS_I 1 +#define _CODA_HEADER_ 1 +struct coda_inode_info {}; +#endif #ifdef AFS_DARWIN_ENV #ifndef _MACH_ETAP_H_ #define _MACH_ETAP_H_ @@ -45,7 +50,9 @@ struct coda_inode_info {}; #include "../h/dir.h" #endif #include "../h/buf.h" +#if !defined(AFS_HPUX110_ENV) #include "../h/mbuf.h" +#endif #else #if defined(AFS_XBSD_ENV) #include "../h/dirent.h" @@ -63,7 +70,11 @@ struct coda_inode_info {}; #include "../h/sysctl.h" #endif #include "../netinet/in.h" +#ifdef AFS_LINUX22_ENV +#include "../linux/route.h" +#else #include "../net/route.h" +#endif #include "../netinet/in_systm.h" #include "../netinet/ip.h" #if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX22_ENV) && !defined(AFS_DARWIN60_ENV) @@ -85,11 +96,12 @@ struct coda_inode_info {}; #ifdef AFS_LINUX22_ENV #include "../h/sched.h" #include "../h/netdevice.h" +#include "../linux/if.h" #else #include "../h/proc.h" #include "../h/file.h" -#endif #include "../net/if.h" +#endif #if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX22_ENV) && !defined(AFS_DARWIN60_ENV) #include "../netinet/in_var.h" #endif /* ! AFS_HPUX110_ENV && ! AFS_LINUX22_ENV */ diff --git a/src/rx/rx_packet.c b/src/rx/rx_packet.c index 3b332ff54..d67f2d6e3 100644 --- a/src/rx/rx_packet.c +++ b/src/rx/rx_packet.c @@ -14,7 +14,7 @@ #include #endif -RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rx_packet.c,v 1.8 2003/04/13 19:32:24 hartmans Exp $"); +RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rx_packet.c,v 1.9 2003/07/30 17:23:45 hartmans Exp $"); #ifdef KERNEL #if defined(UKERNEL) @@ -33,7 +33,7 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rx_packet.c,v 1.8 2003/04/13 19:32:2 #include "../afs/sysincludes.h" #endif #include "../h/socket.h" -#if !defined(AFS_SUN5_ENV) && !defined(AFS_LINUX20_ENV) +#if !defined(AFS_SUN5_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_HPUX110_ENV) #if !defined(AFS_OSF_ENV) && !defined(AFS_AIX41_ENV) #include "../sys/mount.h" /* it gets pulled in by something later anyway */ #endif @@ -959,7 +959,7 @@ int osi_NetSend(socket, addr, dvec, nvecs, length, istack) * message receipt is done in rxk_input or rx_put. */ -#ifdef AFS_SUN5_ENV +#if defined(AFS_SUN5_ENV) || defined(AFS_HPUX110_ENV) /* * Copy an mblock to the contiguous area pointed to by cp. * MTUXXX Supposed to skip bytes and copy bytes, @@ -1081,7 +1081,7 @@ return len; #if !defined(AFS_LINUX20_ENV) int rx_mb_to_packet(amb, free, hdr_len, data_len, phandle) -#ifdef AFS_SUN5_ENV +#if defined(AFS_SUN5_ENV) || defined(AFS_HPUX110_ENV) mblk_t *amb; #else struct mbuf *amb; diff --git a/src/rxkad/Makefile.in b/src/rxkad/Makefile.in index 043bf3f78..c81a041e0 100644 --- a/src/rxkad/Makefile.in +++ b/src/rxkad/Makefile.in @@ -29,8 +29,8 @@ SHELL = /bin/sh include ../config/Makefile.${SYS_NAME} -KERNELDIR = ../libafs/ -UKERNELDIR = ../libuafs/ +KERNELDIR = ../libafs +UKERNELDIR = ../libuafs COMPILE_ET=${TOP_SRCDIR}/comerr/compile_et CFLAGS=${OPTMZ} -I${TOP_SRCDIR}/config -I${TOP_INCDIR} -I. ${XCFLAGS} diff --git a/src/sys/Makefile.in b/src/sys/Makefile.in index bba010ad3..e8a6377e9 100644 --- a/src/sys/Makefile.in +++ b/src/sys/Makefile.in @@ -30,7 +30,7 @@ SHELL = /bin/sh include ../config/Makefile.${SYS_NAME} -UKERNELDIR=../libuafs/ +UKERNELDIR=../libuafs CFLAGS=${DBUG} -I${TOP_SRCDIR}/config -I${TOP_INCDIR} ${XCFLAGS} SFLAGS=-P -I${TOP_INCDIR} LIBS=libsys.a ${TOP_LIBDIR}/librx.a libsys.a ${TOP_LIBDIR}/liblwp.a ${TOP_LIBDIR}/util.a ${XLIBS} diff --git a/src/uss/uss_procs.c b/src/uss/uss_procs.c index 755e4c6bb..a4bdd4624 100644 --- a/src/uss/uss_procs.c +++ b/src/uss/uss_procs.c @@ -18,7 +18,7 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/uss/uss_procs.c,v 1.2 2003/01/02 03:55:52 hartmans Exp $"); +RCSID("$Header: /tmp/cvstemp/openafs/src/uss/uss_procs.c,v 1.3 2003/07/30 17:23:45 hartmans Exp $"); #include "uss_procs.h" /*Module interface*/ #include "uss_common.h" /*Common defs & operations*/ @@ -32,7 +32,13 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/uss/uss_procs.c,v 1.2 2003/01/02 03:55: #include #endif #include /*MAXKTCREALMLEN*/ - +#ifdef HAVE_STRING_H +#include +#else +#ifdef HAVE_STRINGS_H +#include +#endif +#endif #undef USS_PROCS_DB #undef USS_PROCS_DB_INSTANCE @@ -107,7 +113,7 @@ afs_int32 uss_procs_BuildDir(a_path, a_mode, a_owner, a_access) if (errno != EEXIST) { uss_procs_PrintErr(line, "Failed to create directory '%s': %s\n", - a_path, sys_errlist[errno]); + a_path, strerror(errno)); return(1); } /*Directory didn't exist*/ } /*Create the directory*/ @@ -122,13 +128,13 @@ afs_int32 uss_procs_BuildDir(a_path, a_mode, a_owner, a_access) if (chmod(a_path, m)) { uss_procs_PrintErr(line, "Can't chmod() directory '%s' to be '%s' : %s\n", - a_path, a_mode, sys_errlist[errno]); + a_path, a_mode, strerror(errno)); return(1); } /* chmod the directory */ if (chown(a_path, o, -1)) { uss_procs_PrintErr(line, "Can't chown() directory '%s' to be owned by '%s' (uid %d): %s\n", - a_path, a_owner, o, sys_errlist[errno]); + a_path, a_owner, o, strerror(errno)); return(1); } /*Couldn't chown*/ } /*Not a dry run*/ @@ -227,7 +233,7 @@ afs_int32 uss_procs_CpFile(a_path, a_mode, a_owner, a_proto) if (stat(temp, &stbuf)) { uss_procs_PrintErr(line, "Failed to stat '%s': %s\n", - a_proto, sys_errlist[errno]); + a_proto, strerror(errno)); return(1); } @@ -261,7 +267,7 @@ afs_int32 uss_procs_CpFile(a_path, a_mode, a_owner, a_proto) if (chown(a_path, o, -1)) { uss_procs_PrintErr(line, "Can't chown() file '%s' to be owned by '%s' (uid %d): %s\n", - a_path, a_owner, o, sys_errlist[errno]); + a_path, a_owner, o, strerror(errno)); return(1); } /*chown failed*/ } /*Not a dry run*/ @@ -341,7 +347,7 @@ afs_int32 uss_procs_EchoToFile(a_path, a_mode, a_owner, a_content) if (chown(a_path, o, -1)){ uss_procs_PrintErr(line, "Can't chown() file '%s' to be owned by '%s' (uid %d): %s\n", - a_path, a_owner, o, sys_errlist[errno]); + a_path, a_owner, o, strerror(errno)); return(1); } } /*Not a dry run*/ @@ -382,7 +388,7 @@ afs_int32 uss_procs_Exec(a_command) if (system(a_command)) { uss_procs_PrintErr(line, "Failed to run the '%s' command: %s\n", - a_command, sys_errlist[errno]); + a_command, strerror(errno)); return(1); } } /*Not a dry run*/ @@ -441,7 +447,7 @@ afs_int32 uss_procs_SetLink(a_path1, a_path2, a_type) if (symlink(a_path1, a_path2)) { uss_procs_PrintErr(line, "Failed to make symlink '%s' to '%s': %s\n", - a_path1, a_path2, sys_errlist[errno]); + a_path1, a_path2, strerror(errno)); return(1); } } /*Dry run*/ @@ -458,7 +464,7 @@ afs_int32 uss_procs_SetLink(a_path1, a_path2, a_type) if (link(a_path1, a_path2)) { uss_procs_PrintErr(line, "Failed to make hard link '%s' to '%s': %s\n", - a_path1, a_path2, sys_errlist[errno]); + a_path1, a_path2, strerror(errno)); return(1); } } /*Dry run*/ @@ -558,19 +564,19 @@ static int Copy(a_from, a_to, a_mode) if (fd1 < 0) { uss_procs_PrintErr(line, "%s: Failed to open '%s' for overwrite: %s.\n", - uss_whoami, a_to, sys_errlist[errno]); + uss_whoami, a_to, strerror(errno)); return(1); } } else { uss_procs_PrintErr(line, "%s: Failed to open '%s': %s.\n", - uss_whoami, a_to, sys_errlist[errno]); + uss_whoami, a_to, strerror(errno)); return(1); } } if ((fd2 = open(a_from, O_RDONLY, 0)) < 0) { uss_procs_PrintErr(line, "%s: Error reading '%s': %s\n", - uss_whoami, a_from, sys_errlist[errno]); + uss_whoami, a_from, strerror(errno)); close(fd1); return(1); } @@ -582,12 +588,12 @@ static int Copy(a_from, a_to, a_mode) if (rc) { uss_procs_PrintErr(line, "Failed to close '%s' %s\n", - a_to, sys_errlist[errno]); + a_to, strerror(errno)); return(1); } if(rc = close(fd2)) uss_procs_PrintErr(line, "Warning: Failed to close '%s': %s\n", - a_from, sys_errlist[errno]); + a_from, strerror(errno)); return(0); } /*Copy*/ @@ -640,12 +646,12 @@ static int Echo(a_s, a_f, a_mode) if (fd < 0) { uss_procs_PrintErr(line, "%s: Failed to open '%s' for overwrite: %s.\n", - uss_whoami, a_f, sys_errlist[errno]); + uss_whoami, a_f, strerror(errno)); return(1); } } else { uss_procs_PrintErr(line, "%s: Failed to open '%s': %s. \n", - uss_whoami, a_f, sys_errlist[errno]); + uss_whoami, a_f, strerror(errno)); return(1); } } @@ -653,7 +659,7 @@ static int Echo(a_s, a_f, a_mode) write(fd, "\n", 1); if (close(fd)){ uss_procs_PrintErr(line, "Failed to close '%s': %s\n", - a_f, sys_errlist[errno]); + a_f, strerror(errno)); return(1); } return(0); @@ -856,7 +862,7 @@ FILE *uss_procs_FindAndOpen(a_fileToOpen) if (cant_read) fprintf(stderr, "%s: Can't open template '%s': %s\n", - uss_whoami, tmp_str, sys_errlist[errno]); + uss_whoami, tmp_str, strerror(errno)); else { fprintf(stderr, "%s: Can't find template '%s' in searchlist", diff --git a/src/uss/uss_vol.c b/src/uss/uss_vol.c index a3adb6880..728846570 100644 --- a/src/uss/uss_vol.c +++ b/src/uss/uss_vol.c @@ -18,7 +18,7 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/uss/uss_vol.c,v 1.2 2003/01/02 03:55:52 hartmans Exp $"); +RCSID("$Header: /tmp/cvstemp/openafs/src/uss/uss_vol.c,v 1.3 2003/07/30 17:23:45 hartmans Exp $"); #include "uss_vol.h" /*Interface to this module*/ #include "uss_common.h" /*Common definitions*/ @@ -771,7 +771,7 @@ afs_int32 uss_vol_CreateVol(a_volname, a_server, a_partition, a_quota, a_mpoint, else { uss_procs_PrintErr(line, "Couldn't create volume '%s' [error %d]: %s\n", - a_volname, code, sys_errlist[errno]); + a_volname, code, strerror(errno)); return(1); } /*Failure was NOT because it already existed*/ } /*UV_CreateVolume failed*/ @@ -829,7 +829,7 @@ afs_int32 uss_vol_CreateVol(a_volname, a_server, a_partition, a_quota, a_mpoint, } else { fprintf(stderr,"%s: Can't mount volume '%s' on '%s': %s\n", - uss_whoami, a_volname, a_mpoint, sys_errlist[errno]); + uss_whoami, a_volname, a_mpoint, strerror(errno)); if (Oldmpoint) free(Oldmpoint); return(1); @@ -863,7 +863,7 @@ afs_int32 uss_vol_CreateVol(a_volname, a_server, a_partition, a_quota, a_mpoint, if (chown(a_mpoint, o, -1)) { fprintf(stderr, "%s: Can't chown() mountpoint '%s' to owner '%s' (uid %d): %s\n", - uss_whoami, a_mpoint, a_owner, o, sys_errlist[errno]); + uss_whoami, a_mpoint, a_owner, o, strerror(errno)); if (Oldmpoint) free(Oldmpoint); return(1); diff --git a/src/venus/Makefile.in b/src/venus/Makefile.in index 1e82c0410..5bd1b1109 100644 --- a/src/venus/Makefile.in +++ b/src/venus/Makefile.in @@ -34,7 +34,7 @@ include ../config/Makefile.${SYS_NAME} INSTALLex = ${INSTALL} -m 755 CCXPG2= /usr/xpg2bin/cc -CFLAGS=${OPTMZ} -I${TOP_INCDIR} -I${TOP_SRCDIR}/config -I${TOP_INCDIR} ${XCFLAGS} +CFLAGS=${OPTMZ} ${DBG} -I${TOP_INCDIR} -I${TOP_SRCDIR}/config -I${TOP_INCDIR} ${XCFLAGS} INCLS=${TOP_INCDIR}/afs/afsint.h \ ${TOP_INCDIR}/afs/cmd.h \ @@ -69,7 +69,14 @@ CMLIBS=${TOP_LIBDIR}/libsys.a \ LIBS = ${FSLIBS} -all: fs up fstrace cmdebug livesys kdump kdump64 +# +# In order not to rebuild kdump* again and again we use +# AFS_SYSNAME dependent targets (generated by configure) +# +KDUMP=@KDUMP@ +KDUMP64=@KDUMP64@ + +all: fs up fstrace cmdebug livesys ${KDUMP} ${KDUMP64} # # Build targets @@ -94,11 +101,11 @@ ${DEST}/etc/fstrace: fstrace ${DEST}/bin/cmdebug: cmdebug ${INSTALL} -s $? $@ -${DEST}/etc/kdump: kdump +${DEST}/etc/${KDUMP}: ${KDUMP} -set -x; \ case ${SYS_NAME} in \ sgi_6? ) \ - ${INSTALLex} -f kdump.sh.sgi_ipnos $@; \ + ${INSTALLex} -f kdump.sh.sgi_ipnos ${DEST}/etc/kdump; \ ln -fs kdump ${DEST}/etc/kdump32; \ ln -fs kdump.IP20 ${DEST}/etc/kdump.IP22; \ ln -fs kdump.IP20 ${DEST}/etc/kdump.IP32; \ @@ -106,14 +113,16 @@ ${DEST}/etc/kdump: kdump do ${INSTALL} -s $$f ${DEST}/etc/$$f || exit $$? ; \ done ;; \ sun*_5[789] ) \ - ${INSTALLex} -f kdump.sh.solaris7 $@; \ - ${INSTALL} -s -f $? ${DEST}/etc/kdump32;; \ + ${INSTALLex} -f kdump.sh.solaris7 ${DEST}/etc/kdump; \ + ${INSTALL} -s -f $? $@ ;; \ *linux* ) \ - ${INSTALLex} -f kdump.sh.linux $@; \ - ${INSTALL} -s kdump-${LINUX_VERSION} ${DEST}/etc/kdump-${LINUX_VERSION} ;; \ + ${INSTALLex} -f kdump.sh.linux ${DEST}/etc/kdump; \ + ${INSTALL} -s $? $@ ;; \ hp_ux11* ) \ - ${INSTALLex} -f kdump.sh.hp_ux11 $@; \ - ${INSTALL} -s -f $? ${DEST}/etc/kdump32;; \ + ${INSTALLex} -f kdump.sh.hp_ux11 ${DEST}/etc/kdump; \ + ${INSTALL} -s -f $? $@;; \ + ia64_hpux11* ) \ + echo skipping kdump for ${SYS_NAME} ;; \ *) \ ${INSTALL} -s $? $@ ;; \ esac @@ -131,37 +140,37 @@ ${DEST}/etc/kdump64: kdump64 up.o: up.c AFS_component_version_number.c up: up.o - ${CC} ${CFLAGS} -g -o up up.o ${LIBS} ${XLIBS} + ${CC} ${CFLAGS} -o up up.o ${LIBS} ${XLIBS} fs.o: fs.c ${INCLS} AFS_component_version_number.c fs: fs.o $(LIBS) - ${CC} ${CFLAGS} -g -o fs fs.o ${TOP_LIBDIR}/libprot.a $(LIBS) ${XLIBS} + ${CC} ${CFLAGS} -o fs fs.o ${TOP_LIBDIR}/libprot.a $(LIBS) ${XLIBS} livesys.o: livesys.c ${INCLS} AFS_component_version_number.c livesys: livesys.c $(LIBS) - ${CC} -g -o livesys $(CFLAGS) livesys.c $(LIBS) ${XLIBS} + ${CC} -o livesys $(CFLAGS) livesys.c $(LIBS) ${XLIBS} twiddle: twiddle.c $(LIBS) - ${CC} -g -o twiddle $(CFLAGS) twiddle.c $(LIBS) ${XLIBS} + ${CC} -o twiddle $(CFLAGS) twiddle.c $(LIBS) ${XLIBS} gcpags: gcpags.c $(LIBS) - ${CC} -g -o gcpags $(CFLAGS) gcpags.c $(LIBS) ${XLIBS} + ${CC} -o gcpags $(CFLAGS) gcpags.c $(LIBS) ${XLIBS} whatfid.o: whatfid.c ${INCLS} AFS_component_version_number.c whatfid: whatfid.o ${LIBS} - ${CC} ${CFLAGS} -g -o whatfid whatfid.o ${LIBS} ${XLIBS} + ${CC} ${CFLAGS} -o whatfid whatfid.o ${LIBS} ${XLIBS} fstrace.o: fstrace.c AFS_component_version_number.c case ${SYS_NAME} in \ sun4_411 | sun4c_411 | sun4m_412 ) \ - ${CCXPG2} -g -I${TOP_SRCDIR}/config -I${TOP_INCDIR} -I${TOP_INCDIR} -c fstrace.c ;; \ + ${CCXPG2} -I${TOP_SRCDIR}/config -I${TOP_INCDIR} -I${TOP_INCDIR} -c fstrace.c ;; \ sun*_4* ) \ - ${CC} -I/usr/xpg2include -I/usr/5include -g -I${TOP_SRCDIR}/config -I${TOP_INCDIR} -I${TOP_INCDIR} -c fstrace.c ;; \ + ${CC} -I/usr/xpg2include -I/usr/5include -I${TOP_SRCDIR}/config -I${TOP_INCDIR} -I${TOP_INCDIR} -c fstrace.c ;; \ * ) \ - ${CC} ${CFLAGS} -g -I${TOP_SRCDIR}/config -I${TOP_INCDIR} -I${TOP_INCDIR} -c fstrace.c ;; \ + ${CC} ${CFLAGS} -I${TOP_SRCDIR}/config -I${TOP_INCDIR} -I${TOP_INCDIR} -c fstrace.c ;; \ esac fstrace: fstrace.o @@ -169,9 +178,9 @@ fstrace: fstrace.o pmax_ul43 | pmax_ul43a ) \ ${CC} ${CFLAGS} -o fstrace fstrace.o ${TOP_LIBDIR}/libsys.a ${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/util.a /usr/lib/libi.a ;; \ sun4_411 | sun4c_411 | sun4m_412 ) \ - ${CCXPG2} ${CFLAGS} -g -o fstrace fstrace.o ${TOP_LIBDIR}/libsys.a ${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/util.a ;; \ + ${CCXPG2} ${CFLAGS} -o fstrace fstrace.o ${TOP_LIBDIR}/libsys.a ${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/util.a ;; \ sun*_4* ) \ - ${CC} -L/usr/xpg2lib -L/usr/5lib ${CFLAGS} -g -o fstrace fstrace.o ${TOP_LIBDIR}/libsys.a ${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/util.a -lxpg ;; \ + ${CC} -L/usr/xpg2lib -L/usr/5lib ${CFLAGS} -o fstrace fstrace.o ${TOP_LIBDIR}/libsys.a ${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/util.a -lxpg ;; \ hp700_ux100 | hp800_ux100 | hp?00_ux10? | hp_ux10? | hp_ux11?) \ ${CC} -I${TOP_SRCDIR}/config -o fstrace fstrace.o ${TOP_LIBDIR}/libsys.a ${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/util.a ;; \ * ) \ @@ -183,15 +192,15 @@ cmdebug.o: cmdebug.c ${INCLS} AFS_component_version_number.c cmdebug: cmdebug.o ${CMLIBS} $(CC) -o cmdebug cmdebug.o ${CFLAGS} ${CMLIBS} ${XLIBS} -kdump.o: kdump.c ${INCLS} AFS_component_version_number.c +${KDUMP}.o: kdump.c ${INCLS} AFS_component_version_number.c -set -x; \ case ${SYS_NAME} in \ alpha_linux* ) \ - ${CC} -g -I${LINUX_KERNEL_PATH}/include -I${TOP_INCDIR} -I${TOP_SRCDIR}/config -I${TOP_SRCDIR}/libafs/afs -I${TOP_INCDIR} ${XCFLAGS} -mno-fp-regs -ffixed-8 -o kdump-${LINUX_VERSION}.o -c kdump.c ;; \ + ${CC} -I${LINUX_KERNEL_PATH}/include -I${TOP_INCDIR} -I${TOP_SRCDIR}/config -I${TOP_SRCDIR}/libafs/afs -I${TOP_INCDIR} ${XCFLAGS} -mno-fp-regs -ffixed-8 -o kdump-${LINUX_VERSION}.o -c kdump.c ;; \ *linux* ) \ - ${CC} -g -I${LINUX_KERNEL_PATH}/include -I${TOP_INCDIR} -I${TOP_SRCDIR}/config -I${TOP_SRCDIR}/libafs/afs -I${TOP_INCDIR} ${XCFLAGS} -o kdump-${LINUX_VERSION}.o -c kdump.c ;; \ + ${CC} -I${LINUX_KERNEL_PATH}/include -I${TOP_INCDIR} -I${TOP_SRCDIR}/config -I${TOP_SRCDIR}/libafs/afs -I${TOP_INCDIR} ${XCFLAGS} -o kdump-${LINUX_VERSION}.o -c kdump.c ;; \ alpha_osf1 | alpha_osf20 | alpha_osf30 | alpha_osf32 | alpha_osf32c| alpha_dux?? ) \ - ${CC} -g ${CFLAGS} -I/usr/sys/include -I/usr/sys/BINARY -I/usr/sys/AFS -DDEBUGGER -c kdump.c ;;\ + ${CC} ${CFLAGS} -I/usr/sys/include -I/usr/sys/BINARY -I/usr/sys/AFS -DDEBUGGER -c kdump.c ;;\ sgi_6? ) \ for f in ../libafs/STATIC.IP*/CPU_KDEFS; \ do IP=`expr "$$f" : '../libafs/STATIC.\(IP..\)'`; \ @@ -200,14 +209,14 @@ kdump.o: kdump.c ${INCLS} AFS_component_version_number.c echo CPU_KDEFS = $$CPU_KDEFS; \ case $$CPU_KDEFS in \ *-64*) ${CC} -D_KMEMUSER -woff 1178 \ - -g -I${TOP_INCDIR} \ + -I${TOP_INCDIR} \ -I${TOP_SRCDIR}/config \ $$CPU_KDEFS \ ${XCFLAGS64} \ -c kdump.c -o kdump.$$IP.o \ ;; \ *) ${CC} -D_KMEMUSER -woff 1178 \ - -g -I${TOP_INCDIR} \ + -I${TOP_INCDIR} \ -I${TOP_SRCDIR}/config \ $$CPU_KDEFS \ ${XCFLAGS} -DAFS_32BIT_KERNEL_ENV \ @@ -217,23 +226,23 @@ kdump.o: kdump.c ${INCLS} AFS_component_version_number.c done \ ;; \ *) \ - ${CC} -g -I${TOP_INCDIR} -I${TOP_SRCDIR}/config -I${TOP_INCDIR} ${XCFLAGS} -c kdump.c ;; \ + ${CC} -I${TOP_INCDIR} -I${TOP_SRCDIR}/config -I${TOP_INCDIR} ${XCFLAGS} -c kdump.c ;; \ esac ; kdump64.o : kdump.c ${INCLS} AFS_component_version_number.c -set -x; \ case ${SYS_NAME} in \ sun4x_5[789] | hp_ux11* ) \ - ${CC} -g -I${TOP_INCDIR} -I${TOP_SRCDIR}/config -I${TOP_INCDIR} ${XCFLAGS64} -o kdump64.o -c kdump.c ;; \ + ${CC} -I${TOP_INCDIR} -I${TOP_SRCDIR}/config -I${TOP_INCDIR} ${XCFLAGS64} -o kdump64.o -c kdump.c ;; \ esac -kdump: kdump.o +${KDUMP}: ${KDUMP}.o -set -x; \ case ${SYS_NAME} in \ sun4c_51 | sun4c_52 | sun4m_51 | sun4m_52 | sun4c_53 | sun4m_53 | sun4_53 | sun4_54 | sun4c_54 | sun4m_54 | sunx86_54) \ - ${CC} -g -o kdump kdump.o ${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/util.a /usr/lib/libkvm.a -lelf ${XLIBS} ;; \ + ${CC} -o kdump kdump.o ${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/util.a /usr/lib/libkvm.a -lelf ${XLIBS} ;; \ sun*_5? ) \ - ${CC} -g -o kdump kdump.o ${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/util.a ${XLIBELFA} ${XLIBKVM} ${XLIBS} ;; \ + ${CC} -o kdump kdump.o ${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/util.a ${XLIBELFA} ${XLIBKVM} ${XLIBS} ;; \ sgi_6? ) \ for f in ../libafs/STATIC.IP*/CPU_KDEFS; \ do IP=`expr "$$f" : '../libafs/STATIC.\(IP..\)'`; \ @@ -241,12 +250,12 @@ kdump: kdump.o echo IP = $$IP; \ echo CPU_KDEFS = $$CPU_KDEFS; \ case $$CPU_KDEFS in \ - *-64*) ${CC} ${XCFLAGS64} -g \ + *-64*) ${CC} ${XCFLAGS64} \ $$CPU_KDEFS \ -o kdump.$$IP kdump.$$IP.o \ ${TOP_LIBDIR}/libcmd64.a -lelf \ ;; \ - *) ${CC} ${XCFLAGS} -g \ + *) ${CC} ${XCFLAGS} \ $$CPU_KDEFS \ -o kdump.$$IP kdump.$$IP.o \ ${TOP_LIBDIR}/libcmd.a -lelf \ @@ -254,11 +263,11 @@ kdump: kdump.o esac || exit $$? ; \ done ;; \ *linux* ) \ - ${CC} -g -o kdump-${LINUX_VERSION} kdump-${LINUX_VERSION}.o ${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/util.a ${XLIBS} ;; \ + ${CC} -o kdump-${LINUX_VERSION} kdump-${LINUX_VERSION}.o ${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/util.a ${XLIBS} ;; \ alpha_osf1 | alpha_osf20 | alpha_osf30 | alpha_osf32 | alpha_osf32c | alpha_dux??) \ - ${CC} -g -o kdump kdump.o ${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/util.a ${XLIBS} -ll -lmld;; \ - ncrx86_* ) ${CC} -g -o kdump kdump.o ${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/util.a -lelf ${XLIBS} ;; \ - * ) ${CC} -g -o kdump kdump.o ${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/util.a ${XLIBS} ;; \ + ${CC} -o kdump kdump.o ${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/util.a ${XLIBS} -ll -lmld;; \ + ncrx86_* ) ${CC} -o kdump kdump.o ${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/util.a -lelf ${XLIBS} ;; \ + * ) ${CC} -o kdump kdump.o ${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/util.a ${XLIBS} ;; \ esac ## kdump to read from 64 bit kernel dumps @@ -267,7 +276,7 @@ kdump64 : kdump64.o -set -x; \ case ${SYS_NAME} in \ sun4x_5[789] | hp_ux11* ) \ - ${CC} -g ${XCFLAGS64} -o kdump64 kdump64.o ${TOP_LIBDIR}/libcmd64.a ${XLIBELFA} ${XLIBKVM} ${XLIBS} ;; \ + ${CC} ${XCFLAGS64} -o kdump64 kdump64.o ${TOP_LIBDIR}/libcmd64.a ${XLIBELFA} ${XLIBKVM} ${XLIBS} ;; \ esac # @@ -280,8 +289,8 @@ install: \ ${DESTDIR}${bindir}/up \ ${DESTDIR}${sbindir}/fstrace \ ${DESTDIR}${bindir}/cmdebug \ - ${DESTDIR}${sbindir}/kdump \ - ${DESTDIR}${sbindir}/kdump64 + ${DESTDIR}${sbindir}/${KDUMP} \ + ${DESTDIR}${sbindir}/${KDUMP64} # # Misc targets @@ -313,11 +322,11 @@ ${DESTDIR}${sbindir}/fstrace: fstrace ${DESTDIR}${bindir}/cmdebug: cmdebug ${INSTALL} -s $? $@ -${DESTDIR}${sbindir}/kdump: kdump +${DESTDIR}${sbindir}/${KDUMP}: ${KDUMP} -set -x; \ case ${SYS_NAME} in \ sgi_6? ) \ - ${INSTALLex} -f kdump.sh.sgi_ipnos $@; \ + ${INSTALLex} -f kdump.sh.sgi_ipnos ${DESTDIR}${sbindir}/kdump; \ ln -fs kdump ${DESTDIR}${sbindir}/kdump32; \ ln -fs kdump.IP20 ${DESTDIR}${sbindir}/kdump.IP22; \ ln -fs kdump.IP20 ${DESTDIR}${sbindir}/kdump.IP32; \ @@ -325,13 +334,14 @@ ${DESTDIR}${sbindir}/kdump: kdump do ${INSTALL} -s $$f ${DESTDIR}${sbindir}/$$f || exit $$? ; \ done ;; \ sun*_5[789] ) \ - ${INSTALLex} -f kdump.sh.solaris7 $@; \ - ${INSTALL} -s -f $? ${DESTDIR}${sbindir}/kdump32;; \ + ${INSTALLex} -f kdump.sh.solaris7 ${DESTDIR}${sbindir}/kdump32; \ + ${INSTALL} -s -f $? $@;; \ *linux* ) \ - ${INSTALL} -s kdump-${LINUX_VERSION} ${DESTDIR}${sbindir}/kdump-${LINUX_VERSION} ;; \ + ${INSTALLex} -f kdump.sh.linux ${DESTDIR}${sbindir}/kdump; \ + ${INSTALL} -s @? $@ ;; \ hp_ux11* ) \ - ${INSTALLex} -f kdump.sh.hp_ux11 $@; \ - ${INSTALL} -s -f $? ${DESTDIR}${sbindir}/kdump32;; \ + ${INSTALLex} -f kdump.sh.hp_ux11 ${DESTDIR}${sbindir}/kdump; \ + ${INSTALL} -s -f $? $@;; \ *) \ ${INSTALL} -s $? $@ ;; \ esac @@ -352,6 +362,6 @@ dest: \ ${DEST}/bin/up \ ${DEST}/etc/fstrace \ ${DEST}/bin/cmdebug \ - ${DEST}/etc/kdump \ - ${DEST}/etc/kdump64 + ${DEST}/etc/${KDUMP} \ + ${DEST}/etc/${KDUMP64} diff --git a/src/venus/fs.c b/src/venus/fs.c index 4e929f8e8..b821d593b 100644 --- a/src/venus/fs.c +++ b/src/venus/fs.c @@ -10,7 +10,7 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/venus/fs.c,v 1.2 2003/01/02 03:55:52 hartmans Exp $"); +RCSID("$Header: /tmp/cvstemp/openafs/src/venus/fs.c,v 1.3 2003/07/30 17:23:46 hartmans Exp $"); #include #include @@ -43,6 +43,13 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/venus/fs.c,v 1.2 2003/01/02 03:55:52 ha #include #include #include +#ifdef HAVE_STRING_H +#include +#else +#ifdef HAVE_STRINGS_H +#include +#endif +#endif #include #include diff --git a/src/venus/kdump.c b/src/venus/kdump.c index 9f67133a8..a02a4577f 100644 --- a/src/venus/kdump.c +++ b/src/venus/kdump.c @@ -10,7 +10,7 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/venus/kdump.c,v 1.7 2003/04/13 19:32:24 hartmans Exp $"); +RCSID("$Header: /tmp/cvstemp/openafs/src/venus/kdump.c,v 1.8 2003/07/30 17:23:46 hartmans Exp $"); #include #include @@ -53,7 +53,7 @@ struct ntfs_inode_info{}; #define u16 unsigned short #include #if __GLIBC_MINOR__ >= 2 -#define _SYS_TYPES_H +#define _SYS_TYPES_H 1 #endif #define __KERNEL__ #endif diff --git a/src/vlserver/cnvldb.c b/src/vlserver/cnvldb.c index e1c766a5f..c8e0bf7b5 100644 --- a/src/vlserver/cnvldb.c +++ b/src/vlserver/cnvldb.c @@ -10,13 +10,20 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/vlserver/cnvldb.c,v 1.2 2003/01/02 03:55:53 hartmans Exp $"); +RCSID("$Header: /tmp/cvstemp/openafs/src/vlserver/cnvldb.c,v 1.3 2003/07/30 17:23:46 hartmans Exp $"); #include #include #include #include #include +#ifdef HAVE_STRING_H +#include +#else +#ifdef HAVE_STRINGS_H +#include +#endif +#endif #include "cnvldb.h" /* CHANGEME! */ #include #include @@ -25,7 +32,6 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/vlserver/cnvldb.c,v 1.2 2003/01/02 03:5 #include #include "vlserver.h" -#include #define MAXSIZE 2048 /* most I'll get back from PIOCTL */ #define BADSERVERID 255 /* XXX */ -- 2.39.5