From: Sam Hartman Date: Sun, 14 Nov 2004 17:27:57 +0000 (+0000) Subject: Import OpenAFS 1.3.74 from http://www.openafs.org/dl/openafs/1.3.74 X-Git-Tag: upstream/1.3.74 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=7352ddfb32fa44fd3ab4c0fa2d9603d2345b6692;p=packages%2Fo%2Fopenafs.git Import OpenAFS 1.3.74 from http://www.openafs.org/dl/openafs/1.3.74 --- diff --git a/README-NT b/README-NT index 292aa72ad..40e4103fb 100644 --- a/README-NT +++ b/README-NT @@ -42,17 +42,38 @@ 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 C++ 6.0 Microsoft Visual .NET + available via a MSDN subscription + Microsoft Visual .NET 2003 (recommended) + available via a MSDN subscription + + Microsoft Visual C++ Toolkit 2003 (same as .NET 2003) + http://msdn.microsoft.com/visualc/vctoolkit2003/ + +The following Microsoft SDK is required: + + Microsoft Platform SDK for Windows XP SP2 [Core, Data Access and Installer SDKs are required] + http://www.microsoft.com/msdownload/platformsdk/sdkupdate/downlevel.htm [IE required] + http://www.microsoft.com/msdownload/platformsdk/sdkupdate/XPSP2FULLInstall.htm + +The following Microsoft DDK is required: - Microsoft Platform SDK for Windows XP SP2 - [Core and Data Access SDKs are required] + Microsoft Windows Server 2003 DDK + available via a MSDN subscription or via free CD + http://www.microsoft.com/whdc/devtools/ddk/orderddkcd.mspx The NSIS installer requires about 14 MB of storage. The following -version is supported. +version is supported: Nullsoft Scriptable Installation System 2.0 + http://nsis.sourceforge.net/home/ + +The WiX installer requires about 18 MB of storage. The following +version is supported: + + Wix 2.0.2217.0 + http://prdownloads.sourceforge.net/wix/sources-2.0.2217.0.zip The InstallShield scripts (although not supported) require version 5.5 of InstallShiled. Version 6.0 or higher of InstallShield are not @@ -69,13 +90,13 @@ Transfer OpenAFS source tree onto your hardrive. The source can be downloaded from the OpenAFS web site: http://www.OpenAFS.org/release/snapindex.html. -For this example, download source for version 1.3.60 using the +For this example, download source for version 1.3.74 using the following URL: -http://www.openafs.org/dl/openafs/1.3.60/openafs-1.3.60-src.tar +http://www.openafs.org/dl/openafs/1.3.74/openafs-1.3.74-src.tar HINT: DailySnapShots are pre-release source trees and much more likely to have compilation errors. If this is your first attempt, do -your build based on a release version of the source, e.g. 1.3.60. Once +your build based on a release version of the source, e.g. 1.3.74. Once you have completed a build process successfully, you can experiment with other source trees. @@ -83,23 +104,24 @@ You will need an unzip utility that can expand compressed tar files. For example "Pkzip for Windows" from Pkware will uncompress tar files. (http://www.pkware.com/) -Expand the downloaded tar file (openafs-1.3.60-src.tar) into target +Expand the downloaded tar file (openafs-1.3.74-src.tar) into target directory (c:\OpenAFS), the unzip routine will expand the source into a subdirectory tree: - c:\OpenAFS\OpenAFS-1.3.60\src + c:\OpenAFS\OpenAFS-1.3.74\src Copy the files 'NTMakefile' and 'ntbuild.bat' from 'src' to the OpenAFS -base directory: +base directory (aka %AFSROOT%): From a DOS command prompt window, enter the following copy commands: - copy c:\OpenAFS\OpenAFS-1.3.60\src\NTMakefile c:\OpenAFS\OpenAFS-1.3.60\. - copy c:\OpenAFS\OpenAFS-1.3.60\src\ntbuild.bat c:\OpenAFS\OpenAFS-1.3.60\. + cd c:\OpenAFS\OpenAFS-1.3.74 + copy src\NTMakefile . + copy src\ntbuild.bat . The AFS base directory should look something like the following: - c:\OpenAFS\OpenAFS-1.3.60\ + c:\OpenAFS\OpenAFS-1.3.74\ NTMakefile ntbuild.bat src @@ -107,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 C++ 6.0, Visual .NET, or Visual .NET 2003. -The "Typical" install setting is sufficient. +Install a copy of Microsoft Visual .NET, Visual .NET 2003, Visual C++ +Toolkit 2003. The "Typical" install setting is sufficient. (1) You can reduce the installation size by selecting "Custom" install and remove all but the following Options: @@ -121,17 +143,19 @@ and remove all but the following Options: STEP C. Install SDK header files. -Files from Microsoft's Platform SDK (August 2001 or later) are required to -complete a build on Windows 2000 or XP. You can install the "Core SDK" -from +Files from Microsoft's Platform SDK for Windows XP SP2 is required to +complete a build on Windows 2000/XP/2003. You can install the "Core, Data +Access and Installer SDKs" from http://www.microsoft.com/msdownload/platformsdk/sdkupdate/ by using Internet Explorer 5.x or higher. (Active X controls are required) +If you do not which to use IE a complete SDK package is available from + + http://www.microsoft.com/msdownload/platformsdk/sdkupdate/XPSP2FULLInstall.htm The header files that are required are found from a Microsoft SDK are: - netspi.h (Windows 9x builds) npapi.h (Windows 2000,XP,2003 builds) netcfgx.h (NSIS Loopback Adapter installer - Windows 2000,XP,2003 builds) netcfgn.h (NSIS Loopback Adapter installer - Windows 2000,XP,2003 builds) @@ -139,16 +163,11 @@ The header files that are required are found from a Microsoft SDK are: These files come from the following Microsoft DDKs/SDKs: npapi.h: - Windows XP/2003 Platform SDK - include/ + Windows XP SP2 Platform SDK - include/ netcfgn.h, netcfgx.h: Windows XP/2003 DDK - inc/wxp/ - netmpr.h, netspi.h: - July 1998 Windows 95 DDK - net/inc/netmpr.h and net/inc/netspi.h - July 1999 Windows 98 DDK - src/net/inc/netmpr.h and src/net/inc/netspi.h - - you need to install "Legacy and Related - driver samples" STEP D. Configure NTBUILD.BAT. @@ -159,6 +178,7 @@ 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 MSVCDIR: Set to the short name version of the directory into which the visual C++ compiler was installed regardless of version @@ -184,17 +204,17 @@ Edit file %AFSROOT%\src\config\NTMakefile.i386_nt40 AFSPRODUCT_VER_MINOR - Version Minor Number AFSPRODUCT_VER_PATCH - Version Patch Number AFSPRODUCT_VER_BUILD - Version Build Number - CELLSERVDB_INSTALL - The default file name for the CellServDB - included in the install Package. - CELLNAME_DEFAULT - The default home cell name. - CELLSERVDB_WEB - The default web address to obtain CellServDB + CELLSERVDB_INSTALL - The default file name for the CellServDB + included in the install Package. + CELLNAME_DEFAULT - The default home cell name. + CELLSERVDB_WEB - The default web address to obtain CellServDB For example: in the file %AFSROOT%\src\config\NTMakefile.i386_nt40 you would see the following: AFSPRODUCT_VER_MAJOR=1 AFSPRODUCT_VER_MINOR=3 - AFSPRODUCT_VER_PATCH=6000 + AFSPRODUCT_VER_PATCH=7400 AFSPRODUCT_VER_BUILD=0 CELLNAME_DEFAULT=openafs.org CELLSERVDB_INSTALL=CellServDB.GrandCentral @@ -206,7 +226,7 @@ one that can be downloaded from the web (CELLSERVDB_WEB). STEP F. Begin the build -(1) From Windows 2000/XP open up a DOS prompt window. +(1) From Windows 2000/XP/2003 open up a DOS prompt window. (2) Change to the %AFSROOT% directory @@ -267,16 +287,16 @@ sources. The following changes were made to exehead\config.h. STEP H. Build OpenAFS NSIS install package -From the DOS command prompt window run: +From the %AFSROOT% directory execute: nmake /f NTMakefile NSIS STEP I. Install Wix MSI Installer -Download the Wix 2.0.1927.1 installer from +Download the Wix 2.0.2217.0 installer from - http://prdownloads.sourceforge.net/wix/sources-2.0.1927.1.zip + http://prdownloads.sourceforge.net/wix/sources-2.0.2217.0.zip Apply the following patches to the source tree and execute @@ -284,152 +304,114 @@ Apply the following patches to the source tree and execute from the \src\wix directory. +Index: src/wix/Common.cs +=================================================================== +RCS file: /cvsroot/wix/wix/src/wix/Common.cs,v +retrieving revision 1.7 +diff -w -r1.7 Common.cs +140a141,146 +> public static long GetFileTimeFromDateTime(string dateTime) +> { +> System.DateTime sdt = System.Xml.XmlConvert.ToDateTime(dateTime); +> return sdt.ToFileTime(); +> } +> Index: src/wix/Compiler.cs =================================================================== RCS file: /cvsroot/wix/wix/src/wix/Compiler.cs,v -retrieving revision 1.10 -diff -u -w -r1.10 Compiler.cs ---- src/wix/Compiler.cs 28 Jul 2004 15:50:22 -0000 1.10 -+++ src/wix/Compiler.cs 4 Aug 2004 16:28:16 -0000 -@@ -647,7 +647,7 @@ - // add the core registry keys for each context in the class - for (int i = 0; i < contextCount; ++i) - { -- this.AddRegistryKey(sourceLineNumbers, null, 0, String.Concat("CLSID\\", classId, "\\", context[i]), String.Empty, String.Concat("\"[!", fileServer, "]", argument == null ? String.Empty : " ", argument, "\""), componentId); // ClassId context -+ this.AddRegistryKey(sourceLineNumbers, null, 0, String.Concat("CLSID\\", classId, "\\", context[i]), String.Empty, String.Concat("\"[#", fileServer, "]", argument == null ? String.Empty : " ", argument, "\""), componentId); // ClassId context - if (null != icon) // ClassId default icon - { - if (null != iconIndex) -@@ -7385,6 +7385,20 @@ - break; - } - break; -+ case "Delete": -+ switch (attrib.Value) -+ { -+ case "install": -+ events |= MsiInterop.MsidbServiceControlEventDelete; -+ break; -+ case "uninstall": -+ events |= MsiInterop.MsidbServiceControlEventUninstallDelete; -+ break; -+ case "both": -+ events |= MsiInterop.MsidbServiceControlEventDelete | MsiInterop.MsidbServiceControlEventUninstallDelete; -+ break; -+ } -+ break; - case "Wait": - wait = Common.IsYes(attrib.Value, sourceLineNumbers, node.Name, attrib.Name, id) ? "1" : "0"; // strings used since integer column is nullable - break; -@@ -8715,6 +8729,7 @@ - } - bits ^= (bit * 65536); - break; -+ - default: - bit = this.NameToBit(MsiInterop.CommonControlAttributes, attrib.Name, attrib.Value, node.Name, id); - if (-1 == bit) +retrieving revision 1.14 +diff -w -r1.14 Compiler.cs +847c847 +< this.AddRegistryKey(sourceLineNumbers, null, MsiInterop.MsidbRegistryRootClassesRoot, String.Concat("CLSID\\", classId, "\\", context[i]), String.Empty, String.Concat("\"[!", fileServer, "]", argument == null ? String.Empty : " ", argument, "\""), componentId); // ClassId context +--- +> this.AddRegistryKey(sourceLineNumbers, null, MsiInterop.MsidbRegistryRootClassesRoot, String.Concat("CLSID\\", classId, "\\", context[i]), String.Empty, String.Concat("\"[#", fileServer, "]", argument == null ? String.Empty : " ", argument, "\""), componentId); // ClassId context +2352a2353,2358 +> // if a Value attribute was given by itself, make this a type 19 custom action +> if( sourceBits == 0 && targetBits == MsiInterop.MsidbCustomActionTypeTextData ) +> { +> sourceBits = MsiInterop.MsidbCustomActionTypeSourceFile; +> } +> +3881c3887 +< minDate = attrib.Value; +--- +> minDate = Common.GetFileTimeFromDateTime( attrib.Value ).ToString(); +3884c3890 +< maxDate = attrib.Value; +--- +> maxDate = Common.GetFileTimeFromDateTime( attrib.Value ).ToString(); +8187a8194,8207 +> case "Delete": +> switch (attrib.Value) +> { +> case "install": +> events |= MsiInterop.MsidbServiceControlEventDelete; +> break; +> case "uninstall": +> events |= MsiInterop.MsidbServiceControlEventUninstallDelete; +> break; +> case "both": +> events |= MsiInterop.MsidbServiceControlEventDelete | MsiInterop.MsidbServiceControlEventUninstallDelete; +> break; +> } +> break; +9685a9706 +> Index: src/wix/Preprocessor.cs =================================================================== RCS file: /cvsroot/wix/wix/src/wix/Preprocessor.cs,v -retrieving revision 1.5 -diff -u -w -r1.5 Preprocessor.cs ---- src/wix/Preprocessor.cs 28 Jul 2004 15:50:22 -0000 1.5 -+++ src/wix/Preprocessor.cs 4 Aug 2004 16:28:16 -0000 -@@ -267,12 +267,12 @@ - break; - case "ifdef": - stack.Push(context); -- context = new IfContext(context.IsTrue & context.Active, this.variables.ContainsKey(reader.Value.Trim()), IfState.If); -+ context = new IfContext(context.IsTrue & context.Active, this.IsDefined(reader.Value.Trim()), IfState.If); - ignore = true; - break; - case "ifndef": - stack.Push(context); -- context = new IfContext(context.IsTrue & context.Active, !this.variables.ContainsKey(reader.Value.Trim()), IfState.If); -+ context = new IfContext(context.IsTrue & context.Active, !this.IsDefined(reader.Value.Trim()), IfState.If); - ignore = true; - break; - case "elseif": -@@ -354,6 +354,8 @@ - break; - case "endforeach": // endforeach is handled in PreprocessForeach, so seeing it here is an error - throw new WixPreprocessorException(this.GetCurrentSourceLineNumbers(), "Cannot have a processing instruction without a matching ."); -+ case "error": -+ throw new WixPreprocessorException(this.GetCurrentSourceLineNumbers(), this.PreprocessVariables(reader.Value)); - default: - // Console.WriteLine("processing instruction: {0}, {1}", reader.Name, reader.Value); - break; -@@ -401,6 +403,22 @@ - } - - /// -+ /// Returns true if the symbol exists. -+ /// -+ /// symbol name to check -+ /// true if symbol is defined -+ private bool IsDefined(string symbol) -+ { -+ if( symbol.StartsWith("env.") ) -+ return Environment.GetEnvironmentVariable(symbol.Substring(4)) != null; -+ if( symbol.StartsWith("var.") ) -+ return this.variables.ContainsKey(symbol.Substring(4)); -+ if( symbol.StartsWith("sys.") ) -+ return this.systemVariables.ContainsKey(symbol.Substring(4)); -+ return this.variables.ContainsKey(symbol); -+ } -+ -+ /// - /// Replaces parameters in the source text. - /// - /// Text that may contain parameters to replace. +retrieving revision 1.6 +diff -w -r1.6 Preprocessor.cs +274c274 +< context = new IfContext(context.IsTrue & context.Active, this.variables.ContainsKey(reader.Value.Trim()), IfState.If); +--- +> context = new IfContext(context.IsTrue & context.Active, this.IsDefined(reader.Value.Trim()), IfState.If); +279c279 +< context = new IfContext(context.IsTrue & context.Active, !this.variables.ContainsKey(reader.Value.Trim()), IfState.If); +--- +> context = new IfContext(context.IsTrue & context.Active, !this.IsDefined(reader.Value.Trim()), IfState.If); +360a361,362 +> case "error": +> throw new WixPreprocessorException(this.GetCurrentSourceLineNumbers(), this.PreprocessVariables(reader.Value)); +419a422,437 +> /// Returns true if the symbol exists. +> /// +> /// symbol name to check +> /// true if symbol is defined +> private bool IsDefined(string symbol) +> { +> if( symbol.StartsWith("env.") ) +> return Environment.GetEnvironmentVariable(symbol.Substring(4)) != null; +> if( symbol.StartsWith("var.") ) +> return this.variables.ContainsKey(symbol.Substring(4)); +> if( symbol.StartsWith("sys.") ) +> return this.systemVariables.ContainsKey(symbol.Substring(4)); +> return this.variables.ContainsKey(symbol); +> } +> +> /// Index: src/wix/wix.csproj =================================================================== RCS file: /cvsroot/wix/wix/src/wix/wix.csproj,v retrieving revision 1.4 -diff -u -w -r1.4 wix.csproj ---- src/wix/wix.csproj 31 May 2004 01:07:40 -0000 1.4 -+++ src/wix/wix.csproj 4 Aug 2004 16:28:16 -0000 -@@ -659,9 +659,19 @@ - BuildAction = "EmbeddedResource" - /> - -+ -+ - - - -Index: src/wix/Xsd/wix.xsd -=================================================================== -RCS file: /cvsroot/wix/wix/src/wix/Xsd/wix.xsd,v -retrieving revision 1.12 -diff -u -w -r1.12 wix.xsd ---- src/wix/Xsd/wix.xsd 28 Jul 2004 15:50:24 -0000 1.12 -+++ src/wix/Xsd/wix.xsd 4 Aug 2004 16:28:17 -0000 -@@ -2733,6 +2733,7 @@ - - - -+ - - - +diff -w -r1.4 wix.csproj +661a662,666 +> RelPath = "Xsd\wix.xsx" +> DependentUpon = "wix.xsd" +> BuildAction = "None" +> /> +> RelPath = "Xsd\wixloc.xsx" +> DependentUpon = "wixloc.xsd" +> BuildAction = "None" +> /> STEP J. Build Wix MSI install package -From the DOS command prompt window run: +From the %AFSROOT% directory execute: nmake /f NTMakefile wix @@ -442,7 +424,7 @@ STEP K. Final Results The build process generates its binaries in %AFSROOT%\DEST. The subdirectory would look like the following: -%AFSROOT%:\DEST\{checked,free}\ +%AFSROOT%\DEST\{checked,free}\ bin etc include @@ -454,7 +436,8 @@ would look like the following: Bin - contains build utilities. root.client - contains Open AFS binaries root.server - contain Open AFS Server binaries - WinInstall\OpenAFSforWindows.exe - is the install package for Open AFS + WinInstall\OpenAFSforWindows.exe - is the NSIS install package + WinInstall\openafs-en_US.msi - is the WiX MSI install package STEP L. Optional Items diff --git a/acinclude.m4 b/acinclude.m4 index 7876de6ff..379070b0f 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -41,7 +41,7 @@ AC_ARG_WITH(dux-kernel-headers, [ --with-dux-kernel-headers=path use the kernel headers found at path(optional, defaults to first match in /usr/sys)] ) AC_ARG_WITH(linux-kernel-headers, -[ --with-linux-kernel-headers=path use the kernel headers found at path(optional, defaults to /usr/src/linux)] +[ --with-linux-kernel-headers=path use the kernel headers found at path(optional, defaults to /usr/src/linux-2.4, then /usr/src/linux)] ) AC_ARG_WITH(bsd-kernel-headers, [ --with-bsd-kernel-headers=path use the kernel headers found at path(optional, defaults to /usr/src/sys)] @@ -404,6 +404,9 @@ else i?86-*-openbsd3.5) AFS_SYSNAME="i386_obsd35" ;; + i?86-*-openbsd3.6) + AFS_SYSNAME="i386_obsd36" + ;; i?86-*-freebsd4.2*) AFS_SYSNAME="i386_fbsd_42" ;; @@ -431,6 +434,9 @@ else i?86-*-freebsd5.2*) AFS_SYSNAME="i386_fbsd_52" ;; + i?86-*-freebsd5.3*) + AFS_SYSNAME="i386_fbsd_53" + ;; i?86-*-netbsd*1.5*) AFS_PARAM_COMMON=param.nbsd15.h AFS_SYSNAME="i386_nbsd15" diff --git a/aclocal.m4 b/aclocal.m4 index 51b8f5bda..5a1027697 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -53,7 +53,7 @@ AC_ARG_WITH(dux-kernel-headers, [ --with-dux-kernel-headers=path use the kernel headers found at path(optional, defaults to first match in /usr/sys)] ) AC_ARG_WITH(linux-kernel-headers, -[ --with-linux-kernel-headers=path use the kernel headers found at path(optional, defaults to /usr/src/linux)] +[ --with-linux-kernel-headers=path use the kernel headers found at path(optional, defaults to /usr/src/linux-2.4, then /usr/src/linux)] ) AC_ARG_WITH(bsd-kernel-headers, [ --with-bsd-kernel-headers=path use the kernel headers found at path(optional, defaults to /usr/src/sys)] @@ -416,6 +416,9 @@ else i?86-*-openbsd3.5) AFS_SYSNAME="i386_obsd35" ;; + i?86-*-openbsd3.6) + AFS_SYSNAME="i386_obsd36" + ;; i?86-*-freebsd4.2*) AFS_SYSNAME="i386_fbsd_42" ;; @@ -443,6 +446,9 @@ else i?86-*-freebsd5.2*) AFS_SYSNAME="i386_fbsd_52" ;; + i?86-*-freebsd5.3*) + AFS_SYSNAME="i386_fbsd_53" + ;; i?86-*-netbsd*1.5*) AFS_PARAM_COMMON=param.nbsd15.h AFS_SYSNAME="i386_nbsd15" @@ -2158,6 +2164,19 @@ case $AFS_SYSNAME in SHLIB_LINKER="${MT_CC} -shared" ;; + ppc64_linux26) + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + PAM_CFLAGS="-g -O2 -Dlinux -DLINUX_PAM -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-g -O2 -D_LARGEFILE64_SOURCE" + YACC="bison -y" + SHLIB_LINKER="${MT_CC} -shared" + ;; + i386_umlinux22) CC="gcc -pipe" CCOBJ="gcc -pipe" diff --git a/configure b/configure index aa155348a..e5ad3a4c6 100644 --- a/configure +++ b/configure @@ -42,7 +42,7 @@ ac_help="$ac_help --with-dux-kernel-headers=path use the kernel headers found at path(optional, defaults to first match in /usr/sys) " ac_help="$ac_help - --with-linux-kernel-headers=path use the kernel headers found at path(optional, defaults to /usr/src/linux) + --with-linux-kernel-headers=path use the kernel headers found at path(optional, defaults to /usr/src/linux-2.4, then /usr/src/linux) " ac_help="$ac_help --with-bsd-kernel-headers=path use the kernel headers found at path(optional, defaults to /usr/src/sys) @@ -754,7 +754,7 @@ fi PACKAGE=openafs -VERSION=1.3.73 +VERSION=1.3.74 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } @@ -3865,6 +3865,9 @@ echo "configure:3852: checking your AFS sysname" >&5 i?86-*-openbsd3.5) AFS_SYSNAME="i386_obsd35" ;; + i?86-*-openbsd3.6) + AFS_SYSNAME="i386_obsd36" + ;; i?86-*-freebsd4.2*) AFS_SYSNAME="i386_fbsd_42" ;; @@ -3892,6 +3895,9 @@ echo "configure:3852: checking your AFS sysname" >&5 i?86-*-freebsd5.2*) AFS_SYSNAME="i386_fbsd_52" ;; + i?86-*-freebsd5.3*) + AFS_SYSNAME="i386_fbsd_53" + ;; i?86-*-netbsd*1.5*) AFS_PARAM_COMMON=param.nbsd15.h AFS_SYSNAME="i386_nbsd15" @@ -4113,7 +4119,7 @@ echo "configure:3852: checking your AFS sysname" >&5 save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="-I${LINUX_KERNEL_PATH}/include $CPPFLAGS" cat > conftest.$ac_ext < int main() { @@ -4122,7 +4128,7 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:4126: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4132: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_linux_is_uml=yes else @@ -4152,14 +4158,14 @@ EOF ;; *) echo $ac_n "checking for definition of struct buf""... $ac_c" 1>&6 -echo "configure:4156: checking for definition of struct buf" >&5 +echo "configure:4162: checking for definition of struct buf" >&5 if eval "test \"`echo '$''{'ac_cv_have_struct_buf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_have_struct_buf=no cat > conftest.$ac_ext < int main() { @@ -4167,7 +4173,7 @@ struct buf x; printf("%d\n", sizeof(x)); ; return 0; } EOF -if { (eval echo configure:4171: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4177: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_struct_buf=yes else @@ -4195,9 +4201,9 @@ if eval "test \"`echo '$''{'ac_cv_sockaddr_len'+set}'`\" = set"; then else echo $ac_n "checking if struct sockaddr has sa_len field""... $ac_c" 1>&6 -echo "configure:4199: checking if struct sockaddr has sa_len field" >&5 +echo "configure:4205: checking if struct sockaddr has sa_len field" >&5 cat > conftest.$ac_ext < #include @@ -4206,7 +4212,7 @@ struct sockaddr *a; a->sa_len=0; ; return 0; } EOF -if { (eval echo configure:4210: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4216: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_sockaddr_len=yes else @@ -4231,12 +4237,12 @@ else for ac_func in socket do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4235: checking for $ac_func" >&5 +echo "configure:4241: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4288,7 +4294,7 @@ done for lib in socket inet; do if test "$HAVE_SOCKET" != 1; then echo $ac_n "checking for socket in -l${lib}""... $ac_c" 1>&6 -echo "configure:4292: checking for socket in -l${lib}" >&5 +echo "configure:4298: checking for socket in -l${lib}" >&5 ac_lib_var=`echo ${lib}'_'socket | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4296,7 +4302,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l${lib} $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4317: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4337,12 +4343,12 @@ fi for ac_func in connect do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4341: checking for $ac_func" >&5 +echo "configure:4347: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4375: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4394,7 +4400,7 @@ done for lib in nsl; do if test "$HAVE_CONNECT" != 1; then echo $ac_n "checking for connect in -l${lib}""... $ac_c" 1>&6 -echo "configure:4398: checking for connect in -l${lib}" >&5 +echo "configure:4404: checking for connect in -l${lib}" >&5 ac_lib_var=`echo ${lib}'_'connect | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4402,7 +4408,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l${lib} $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4423: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4443,12 +4449,12 @@ fi for ac_func in gethostbyname do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4447: checking for $ac_func" >&5 +echo "configure:4453: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4481: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4499,7 +4505,7 @@ done for lib in dns nsl resolv; do if test "$HAVE_GETHOSTBYNAME" != 1; then echo $ac_n "checking for gethostbyname in -l${lib}""... $ac_c" 1>&6 -echo "configure:4503: checking for gethostbyname in -l${lib}" >&5 +echo "configure:4509: checking for gethostbyname in -l${lib}" >&5 ac_lib_var=`echo ${lib}'_'gethostbyname | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4507,7 +4513,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l${lib} $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4528: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4546,9 +4552,9 @@ fi fi echo $ac_n "checking for the useability of arpa/nameser_compat.h""... $ac_c" 1>&6 -echo "configure:4550: checking for the useability of arpa/nameser_compat.h" >&5 +echo "configure:4556: checking for the useability of arpa/nameser_compat.h" >&5 cat > conftest.$ac_ext < @@ -4565,7 +4571,7 @@ int main() { static int i; i = 0; ; return 0; } EOF -if { (eval echo configure:4569: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4575: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<\EOF @@ -4583,11 +4589,11 @@ rm -f conftest* openafs_save_libs="$LIBS" echo $ac_n "checking for res_search""... $ac_c" 1>&6 -echo "configure:4587: checking for res_search" >&5 +echo "configure:4593: checking for res_search" >&5 ac_cv_func_res_search=no cat > conftest.$ac_ext < @@ -4611,7 +4617,7 @@ return 0; ; return 0; } EOF -if { (eval echo configure:4615: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4621: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_res_search=yes else @@ -4628,7 +4634,7 @@ rm -f conftest* ac_cv_func_res_search=no cat > conftest.$ac_ext < @@ -4652,7 +4658,7 @@ return 0; ; return 0; } EOF -if { (eval echo configure:4656: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4662: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_res_search=yes else @@ -4686,7 +4692,7 @@ fi PTHREAD_LIBS=error echo $ac_n "checking for pthread_attr_init in -lpthread""... $ac_c" 1>&6 -echo "configure:4690: checking for pthread_attr_init in -lpthread" >&5 +echo "configure:4696: checking for pthread_attr_init in -lpthread" >&5 ac_lib_var=`echo pthread'_'pthread_attr_init | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4694,7 +4700,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lpthread $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4715: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4727,7 +4733,7 @@ fi if test "x$PTHREAD_LIBS" = xerror; then echo $ac_n "checking for pthread_attr_init in -lpthreads""... $ac_c" 1>&6 -echo "configure:4731: checking for pthread_attr_init in -lpthreads" >&5 +echo "configure:4737: checking for pthread_attr_init in -lpthreads" >&5 ac_lib_var=`echo pthreads'_'pthread_attr_init | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4735,7 +4741,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lpthreads $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4756: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4769,7 +4775,7 @@ fi fi if test "x$PTHREAD_LIBS" = xerror; then echo $ac_n "checking for pthread_attr_init in -lc_r""... $ac_c" 1>&6 -echo "configure:4773: checking for pthread_attr_init in -lc_r" >&5 +echo "configure:4779: checking for pthread_attr_init in -lc_r" >&5 ac_lib_var=`echo c_r'_'pthread_attr_init | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4777,7 +4783,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lc_r $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4798: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4811,12 +4817,12 @@ fi fi if test "x$PTHREAD_LIBS" = xerror; then echo $ac_n "checking for pthread_attr_init""... $ac_c" 1>&6 -echo "configure:4815: checking for pthread_attr_init" >&5 +echo "configure:4821: checking for pthread_attr_init" >&5 if eval "test \"`echo '$''{'ac_cv_func_pthread_attr_init'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4849: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_pthread_attr_init=yes" else @@ -4959,7 +4965,7 @@ EOF fi echo $ac_n "checking for tivoli tsm butc support""... $ac_c" 1>&6 -echo "configure:4963: checking for tivoli tsm butc support" >&5 +echo "configure:4969: checking for tivoli tsm butc support" >&5 XBSA_CFLAGS="" if test "$enable_tivoli_tsm" = "yes"; then XBSADIR1=/usr/tivoli/tsm/client/api/bin/xopen @@ -4980,12 +4986,12 @@ fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:4984: checking for ANSI C header files" >&5 +echo "configure:4990: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -4993,7 +4999,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4997: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5003: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5010,7 +5016,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -5028,7 +5034,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -5049,7 +5055,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -5060,7 +5066,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:5064: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5070: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -5084,12 +5090,12 @@ EOF fi echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 -echo "configure:5088: checking for sys/wait.h that is POSIX.1 compatible" >&5 +echo "configure:5094: checking for sys/wait.h that is POSIX.1 compatible" >&5 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -5105,7 +5111,7 @@ wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } EOF -if { (eval echo configure:5109: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5115: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_sys_wait_h=yes else @@ -5130,12 +5136,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 -echo "configure:5134: checking for $ac_hdr that defines DIR" >&5 +echo "configure:5140: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_hdr> @@ -5143,7 +5149,7 @@ int main() { DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:5147: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5153: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else @@ -5168,7 +5174,7 @@ done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 -echo "configure:5172: checking for opendir in -ldir" >&5 +echo "configure:5178: checking for opendir in -ldir" >&5 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5176,7 +5182,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5197: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5209,7 +5215,7 @@ fi else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:5213: checking for opendir in -lx" >&5 +echo "configure:5219: checking for opendir in -lx" >&5 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5217,7 +5223,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5238: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5254,17 +5260,17 @@ for ac_hdr in stdlib.h string.h unistd.h fcntl.h sys/time.h sys/file.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5258: checking for $ac_hdr" >&5 +echo "configure:5264: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5268: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5274: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5294,17 +5300,17 @@ for ac_hdr in netinet/in.h netdb.h sys/fcntl.h sys/mnttab.h sys/mntent.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5298: checking for $ac_hdr" >&5 +echo "configure:5304: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5308: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5314: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5334,17 +5340,17 @@ for ac_hdr in mntent.h sys/vfs.h sys/param.h sys/fs_types.h sys/fstyp.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5338: checking for $ac_hdr" >&5 +echo "configure:5344: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5348: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5354: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5374,17 +5380,17 @@ for ac_hdr in sys/mount.h strings.h termios.h signal.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5378: checking for $ac_hdr" >&5 +echo "configure:5384: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5388: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5394: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5414,17 +5420,17 @@ for ac_hdr in windows.h malloc.h winsock2.h direct.h io.h sys/user.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5418: checking for $ac_hdr" >&5 +echo "configure:5424: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5428: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5434: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5454,17 +5460,17 @@ for ac_hdr in security/pam_modules.h siad.h usersec.h ucontext.h regex.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5458: checking for $ac_hdr" >&5 +echo "configure:5464: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5468: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5474: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5508,12 +5514,12 @@ fi for ac_func in utimes random srandom getdtablesize snprintf strlcat strlcpy re_comp re_exec do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5512: checking for $ac_func" >&5 +echo "configure:5518: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5546: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -5563,12 +5569,12 @@ done for ac_func in setprogname getprogname sigaction mkstemp vsnprintf strerror do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5567: checking for $ac_func" >&5 +echo "configure:5573: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5601: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -5619,12 +5625,12 @@ done for ac_func in regcomp regexec regerror do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5623: checking for $ac_func" >&5 +echo "configure:5629: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5657: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -5672,7 +5678,7 @@ fi done echo $ac_n "checking for POSIX regex library""... $ac_c" 1>&6 -echo "configure:5676: checking for POSIX regex library" >&5 +echo "configure:5682: checking for POSIX regex library" >&5 if test "$ac_cv_header_regex_h" = "yes" && \ test "$ac_cv_func_regcomp" = "yes" && \ test "$ac_cv_func_regexec" = "yes" && \ @@ -5687,12 +5693,12 @@ else fi echo $ac_n "checking for ssize_t""... $ac_c" 1>&6 -echo "configure:5691: checking for ssize_t" >&5 +echo "configure:5697: checking for ssize_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_ssize_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -5720,7 +5726,7 @@ EOF fi echo $ac_n "checking size of long""... $ac_c" 1>&6 -echo "configure:5724: checking size of long" >&5 +echo "configure:5730: checking size of long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5728,7 +5734,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -5739,7 +5745,7 @@ main() exit(0); } EOF -if { (eval echo configure:5743: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5749: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long=`cat conftestval` else @@ -5762,12 +5768,12 @@ EOF for ac_func in timegm do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5766: checking for $ac_func" >&5 +echo "configure:5772: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5800: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -5894,7 +5900,7 @@ LWP_OPTMZ=-O # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5898: checking for $ac_word" >&5 +echo "configure:5904: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5926,7 +5932,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5930: checking for $ac_word" >&5 +echo "configure:5936: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5961,7 +5967,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5965: checking for $ac_word" >&5 +echo "configure:5971: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5996,7 +6002,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6000: checking for $ac_word" >&5 +echo "configure:6006: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_MV'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6031,7 +6037,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6035: checking for $ac_word" >&5 +echo "configure:6041: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6066,7 +6072,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6070: checking for $ac_word" >&5 +echo "configure:6076: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6101,7 +6107,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6105: checking for $ac_word" >&5 +echo "configure:6111: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6136,7 +6142,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6140: checking for $ac_word" >&5 +echo "configure:6146: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6171,7 +6177,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6175: checking for $ac_word" >&5 +echo "configure:6181: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LORDER'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6426,6 +6432,19 @@ case $AFS_SYSNAME in SHLIB_LINKER="${MT_CC} -shared" ;; + ppc64_linux26) + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + PAM_CFLAGS="-g -O2 -Dlinux -DLINUX_PAM -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-g -O2 -D_LARGEFILE64_SOURCE" + YACC="bison -y" + SHLIB_LINKER="${MT_CC} -shared" + ;; + i386_umlinux22) CC="gcc -pipe" CCOBJ="gcc -pipe" @@ -7003,7 +7022,7 @@ case $AFS_SYSNAME in sgi_6*) echo $ac_n "checking for mem* in sys/systm.h""... $ac_c" 1>&6 -echo "configure:7007: checking for mem* in sys/systm.h" >&5 +echo "configure:7026: checking for mem* in sys/systm.h" >&5 save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -D_KERNEL -D__STRING_H__" if eval "test \"`echo '$''{'ac_cv_irix_sys_systm_h_has_mem_funcs'+set}'`\" = set"; then @@ -7011,7 +7030,7 @@ if eval "test \"`echo '$''{'ac_cv_irix_sys_systm_h_has_mem_funcs'+set}'`\" = set else cat > conftest.$ac_ext < #include @@ -7021,7 +7040,7 @@ extern void *memcpy(char *, const void *, size_t); ; return 0; } EOF -if { (eval echo configure:7025: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7044: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_irix_sys_systm_h_has_mem_funcs=no else diff --git a/configure-libafs b/configure-libafs index 2fd5e6afe..c9e6a5f42 100644 --- a/configure-libafs +++ b/configure-libafs @@ -42,7 +42,7 @@ ac_help="$ac_help --with-dux-kernel-headers=path use the kernel headers found at path(optional, defaults to first match in /usr/sys) " ac_help="$ac_help - --with-linux-kernel-headers=path use the kernel headers found at path(optional, defaults to /usr/src/linux) + --with-linux-kernel-headers=path use the kernel headers found at path(optional, defaults to /usr/src/linux-2.4, then /usr/src/linux) " ac_help="$ac_help --with-bsd-kernel-headers=path use the kernel headers found at path(optional, defaults to /usr/src/sys) @@ -754,7 +754,7 @@ fi PACKAGE=openafs-libafs -VERSION=1.3.73 +VERSION=1.3.74 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } @@ -3865,6 +3865,9 @@ echo "configure:3852: checking your AFS sysname" >&5 i?86-*-openbsd3.5) AFS_SYSNAME="i386_obsd35" ;; + i?86-*-openbsd3.6) + AFS_SYSNAME="i386_obsd36" + ;; i?86-*-freebsd4.2*) AFS_SYSNAME="i386_fbsd_42" ;; @@ -3892,6 +3895,9 @@ echo "configure:3852: checking your AFS sysname" >&5 i?86-*-freebsd5.2*) AFS_SYSNAME="i386_fbsd_52" ;; + i?86-*-freebsd5.3*) + AFS_SYSNAME="i386_fbsd_53" + ;; i?86-*-netbsd*1.5*) AFS_PARAM_COMMON=param.nbsd15.h AFS_SYSNAME="i386_nbsd15" @@ -4113,7 +4119,7 @@ echo "configure:3852: checking your AFS sysname" >&5 save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="-I${LINUX_KERNEL_PATH}/include $CPPFLAGS" cat > conftest.$ac_ext < int main() { @@ -4122,7 +4128,7 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:4126: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4132: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_linux_is_uml=yes else @@ -4152,14 +4158,14 @@ EOF ;; *) echo $ac_n "checking for definition of struct buf""... $ac_c" 1>&6 -echo "configure:4156: checking for definition of struct buf" >&5 +echo "configure:4162: checking for definition of struct buf" >&5 if eval "test \"`echo '$''{'ac_cv_have_struct_buf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_have_struct_buf=no cat > conftest.$ac_ext < int main() { @@ -4167,7 +4173,7 @@ struct buf x; printf("%d\n", sizeof(x)); ; return 0; } EOF -if { (eval echo configure:4171: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4177: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_struct_buf=yes else @@ -4195,9 +4201,9 @@ if eval "test \"`echo '$''{'ac_cv_sockaddr_len'+set}'`\" = set"; then else echo $ac_n "checking if struct sockaddr has sa_len field""... $ac_c" 1>&6 -echo "configure:4199: checking if struct sockaddr has sa_len field" >&5 +echo "configure:4205: checking if struct sockaddr has sa_len field" >&5 cat > conftest.$ac_ext < #include @@ -4206,7 +4212,7 @@ struct sockaddr *a; a->sa_len=0; ; return 0; } EOF -if { (eval echo configure:4210: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4216: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_sockaddr_len=yes else @@ -4231,12 +4237,12 @@ else for ac_func in socket do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4235: checking for $ac_func" >&5 +echo "configure:4241: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4288,7 +4294,7 @@ done for lib in socket inet; do if test "$HAVE_SOCKET" != 1; then echo $ac_n "checking for socket in -l${lib}""... $ac_c" 1>&6 -echo "configure:4292: checking for socket in -l${lib}" >&5 +echo "configure:4298: checking for socket in -l${lib}" >&5 ac_lib_var=`echo ${lib}'_'socket | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4296,7 +4302,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l${lib} $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4317: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4337,12 +4343,12 @@ fi for ac_func in connect do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4341: checking for $ac_func" >&5 +echo "configure:4347: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4375: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4394,7 +4400,7 @@ done for lib in nsl; do if test "$HAVE_CONNECT" != 1; then echo $ac_n "checking for connect in -l${lib}""... $ac_c" 1>&6 -echo "configure:4398: checking for connect in -l${lib}" >&5 +echo "configure:4404: checking for connect in -l${lib}" >&5 ac_lib_var=`echo ${lib}'_'connect | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4402,7 +4408,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l${lib} $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4423: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4443,12 +4449,12 @@ fi for ac_func in gethostbyname do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4447: checking for $ac_func" >&5 +echo "configure:4453: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4481: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4499,7 +4505,7 @@ done for lib in dns nsl resolv; do if test "$HAVE_GETHOSTBYNAME" != 1; then echo $ac_n "checking for gethostbyname in -l${lib}""... $ac_c" 1>&6 -echo "configure:4503: checking for gethostbyname in -l${lib}" >&5 +echo "configure:4509: checking for gethostbyname in -l${lib}" >&5 ac_lib_var=`echo ${lib}'_'gethostbyname | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4507,7 +4513,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l${lib} $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4528: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4546,9 +4552,9 @@ fi fi echo $ac_n "checking for the useability of arpa/nameser_compat.h""... $ac_c" 1>&6 -echo "configure:4550: checking for the useability of arpa/nameser_compat.h" >&5 +echo "configure:4556: checking for the useability of arpa/nameser_compat.h" >&5 cat > conftest.$ac_ext < @@ -4565,7 +4571,7 @@ int main() { static int i; i = 0; ; return 0; } EOF -if { (eval echo configure:4569: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4575: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<\EOF @@ -4583,11 +4589,11 @@ rm -f conftest* openafs_save_libs="$LIBS" echo $ac_n "checking for res_search""... $ac_c" 1>&6 -echo "configure:4587: checking for res_search" >&5 +echo "configure:4593: checking for res_search" >&5 ac_cv_func_res_search=no cat > conftest.$ac_ext < @@ -4611,7 +4617,7 @@ return 0; ; return 0; } EOF -if { (eval echo configure:4615: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4621: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_res_search=yes else @@ -4628,7 +4634,7 @@ rm -f conftest* ac_cv_func_res_search=no cat > conftest.$ac_ext < @@ -4652,7 +4658,7 @@ return 0; ; return 0; } EOF -if { (eval echo configure:4656: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4662: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_res_search=yes else @@ -4686,7 +4692,7 @@ fi PTHREAD_LIBS=error echo $ac_n "checking for pthread_attr_init in -lpthread""... $ac_c" 1>&6 -echo "configure:4690: checking for pthread_attr_init in -lpthread" >&5 +echo "configure:4696: checking for pthread_attr_init in -lpthread" >&5 ac_lib_var=`echo pthread'_'pthread_attr_init | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4694,7 +4700,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lpthread $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4715: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4727,7 +4733,7 @@ fi if test "x$PTHREAD_LIBS" = xerror; then echo $ac_n "checking for pthread_attr_init in -lpthreads""... $ac_c" 1>&6 -echo "configure:4731: checking for pthread_attr_init in -lpthreads" >&5 +echo "configure:4737: checking for pthread_attr_init in -lpthreads" >&5 ac_lib_var=`echo pthreads'_'pthread_attr_init | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4735,7 +4741,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lpthreads $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4756: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4769,7 +4775,7 @@ fi fi if test "x$PTHREAD_LIBS" = xerror; then echo $ac_n "checking for pthread_attr_init in -lc_r""... $ac_c" 1>&6 -echo "configure:4773: checking for pthread_attr_init in -lc_r" >&5 +echo "configure:4779: checking for pthread_attr_init in -lc_r" >&5 ac_lib_var=`echo c_r'_'pthread_attr_init | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4777,7 +4783,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lc_r $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4798: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4811,12 +4817,12 @@ fi fi if test "x$PTHREAD_LIBS" = xerror; then echo $ac_n "checking for pthread_attr_init""... $ac_c" 1>&6 -echo "configure:4815: checking for pthread_attr_init" >&5 +echo "configure:4821: checking for pthread_attr_init" >&5 if eval "test \"`echo '$''{'ac_cv_func_pthread_attr_init'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4849: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_pthread_attr_init=yes" else @@ -4959,7 +4965,7 @@ EOF fi echo $ac_n "checking for tivoli tsm butc support""... $ac_c" 1>&6 -echo "configure:4963: checking for tivoli tsm butc support" >&5 +echo "configure:4969: checking for tivoli tsm butc support" >&5 XBSA_CFLAGS="" if test "$enable_tivoli_tsm" = "yes"; then XBSADIR1=/usr/tivoli/tsm/client/api/bin/xopen @@ -4980,12 +4986,12 @@ fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:4984: checking for ANSI C header files" >&5 +echo "configure:4990: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -4993,7 +4999,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4997: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5003: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5010,7 +5016,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -5028,7 +5034,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -5049,7 +5055,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -5060,7 +5066,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:5064: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5070: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -5084,12 +5090,12 @@ EOF fi echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 -echo "configure:5088: checking for sys/wait.h that is POSIX.1 compatible" >&5 +echo "configure:5094: checking for sys/wait.h that is POSIX.1 compatible" >&5 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -5105,7 +5111,7 @@ wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } EOF -if { (eval echo configure:5109: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5115: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_sys_wait_h=yes else @@ -5130,12 +5136,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 -echo "configure:5134: checking for $ac_hdr that defines DIR" >&5 +echo "configure:5140: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_hdr> @@ -5143,7 +5149,7 @@ int main() { DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:5147: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5153: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else @@ -5168,7 +5174,7 @@ done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 -echo "configure:5172: checking for opendir in -ldir" >&5 +echo "configure:5178: checking for opendir in -ldir" >&5 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5176,7 +5182,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5197: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5209,7 +5215,7 @@ fi else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:5213: checking for opendir in -lx" >&5 +echo "configure:5219: checking for opendir in -lx" >&5 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5217,7 +5223,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5238: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5254,17 +5260,17 @@ for ac_hdr in stdlib.h string.h unistd.h fcntl.h sys/time.h sys/file.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5258: checking for $ac_hdr" >&5 +echo "configure:5264: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5268: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5274: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5294,17 +5300,17 @@ for ac_hdr in netinet/in.h netdb.h sys/fcntl.h sys/mnttab.h sys/mntent.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5298: checking for $ac_hdr" >&5 +echo "configure:5304: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5308: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5314: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5334,17 +5340,17 @@ for ac_hdr in mntent.h sys/vfs.h sys/param.h sys/fs_types.h sys/fstyp.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5338: checking for $ac_hdr" >&5 +echo "configure:5344: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5348: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5354: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5374,17 +5380,17 @@ for ac_hdr in sys/mount.h strings.h termios.h signal.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5378: checking for $ac_hdr" >&5 +echo "configure:5384: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5388: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5394: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5414,17 +5420,17 @@ for ac_hdr in windows.h malloc.h winsock2.h direct.h io.h sys/user.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5418: checking for $ac_hdr" >&5 +echo "configure:5424: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5428: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5434: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5454,17 +5460,17 @@ for ac_hdr in security/pam_modules.h siad.h usersec.h ucontext.h regex.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5458: checking for $ac_hdr" >&5 +echo "configure:5464: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5468: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5474: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5508,12 +5514,12 @@ fi for ac_func in utimes random srandom getdtablesize snprintf strlcat strlcpy re_comp re_exec do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5512: checking for $ac_func" >&5 +echo "configure:5518: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5546: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -5563,12 +5569,12 @@ done for ac_func in setprogname getprogname sigaction mkstemp vsnprintf strerror do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5567: checking for $ac_func" >&5 +echo "configure:5573: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5601: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -5619,12 +5625,12 @@ done for ac_func in regcomp regexec regerror do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5623: checking for $ac_func" >&5 +echo "configure:5629: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5657: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -5672,7 +5678,7 @@ fi done echo $ac_n "checking for POSIX regex library""... $ac_c" 1>&6 -echo "configure:5676: checking for POSIX regex library" >&5 +echo "configure:5682: checking for POSIX regex library" >&5 if test "$ac_cv_header_regex_h" = "yes" && \ test "$ac_cv_func_regcomp" = "yes" && \ test "$ac_cv_func_regexec" = "yes" && \ @@ -5687,12 +5693,12 @@ else fi echo $ac_n "checking for ssize_t""... $ac_c" 1>&6 -echo "configure:5691: checking for ssize_t" >&5 +echo "configure:5697: checking for ssize_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_ssize_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -5720,7 +5726,7 @@ EOF fi echo $ac_n "checking size of long""... $ac_c" 1>&6 -echo "configure:5724: checking size of long" >&5 +echo "configure:5730: checking size of long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5728,7 +5734,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -5739,7 +5745,7 @@ main() exit(0); } EOF -if { (eval echo configure:5743: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5749: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long=`cat conftestval` else @@ -5762,12 +5768,12 @@ EOF for ac_func in timegm do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5766: checking for $ac_func" >&5 +echo "configure:5772: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5800: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -5894,7 +5900,7 @@ LWP_OPTMZ=-O # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5898: checking for $ac_word" >&5 +echo "configure:5904: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5926,7 +5932,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5930: checking for $ac_word" >&5 +echo "configure:5936: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5961,7 +5967,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5965: checking for $ac_word" >&5 +echo "configure:5971: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5996,7 +6002,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6000: checking for $ac_word" >&5 +echo "configure:6006: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_MV'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6031,7 +6037,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6035: checking for $ac_word" >&5 +echo "configure:6041: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6066,7 +6072,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6070: checking for $ac_word" >&5 +echo "configure:6076: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6101,7 +6107,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6105: checking for $ac_word" >&5 +echo "configure:6111: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6136,7 +6142,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6140: checking for $ac_word" >&5 +echo "configure:6146: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6171,7 +6177,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6175: checking for $ac_word" >&5 +echo "configure:6181: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LORDER'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6426,6 +6432,19 @@ case $AFS_SYSNAME in SHLIB_LINKER="${MT_CC} -shared" ;; + ppc64_linux26) + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + PAM_CFLAGS="-g -O2 -Dlinux -DLINUX_PAM -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-g -O2 -D_LARGEFILE64_SOURCE" + YACC="bison -y" + SHLIB_LINKER="${MT_CC} -shared" + ;; + i386_umlinux22) CC="gcc -pipe" CCOBJ="gcc -pipe" @@ -7003,7 +7022,7 @@ case $AFS_SYSNAME in sgi_6*) echo $ac_n "checking for mem* in sys/systm.h""... $ac_c" 1>&6 -echo "configure:7007: checking for mem* in sys/systm.h" >&5 +echo "configure:7026: checking for mem* in sys/systm.h" >&5 save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -D_KERNEL -D__STRING_H__" if eval "test \"`echo '$''{'ac_cv_irix_sys_systm_h_has_mem_funcs'+set}'`\" = set"; then @@ -7011,7 +7030,7 @@ if eval "test \"`echo '$''{'ac_cv_irix_sys_systm_h_has_mem_funcs'+set}'`\" = set else cat > conftest.$ac_ext < #include @@ -7021,7 +7040,7 @@ extern void *memcpy(char *, const void *, size_t); ; return 0; } EOF -if { (eval echo configure:7025: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7044: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_irix_sys_systm_h_has_mem_funcs=no else diff --git a/configure-libafs.in b/configure-libafs.in index eaf1f0a5b..9cdfec49c 100644 --- a/configure-libafs.in +++ b/configure-libafs.in @@ -1,5 +1,5 @@ AC_INIT(src/libafs/Makefile.common.in) -AM_INIT_AUTOMAKE(openafs-libafs,1.3.73) +AM_INIT_AUTOMAKE(openafs-libafs,1.3.74) AC_CONFIG_HEADER(src/config/afsconfig.h) define(OPENAFS_CONFIGURE_LIBAFS) diff --git a/configure.in b/configure.in index 298ae1841..09a744b64 100644 --- a/configure.in +++ b/configure.in @@ -1,5 +1,5 @@ AC_INIT(src/config/stds.h) -AM_INIT_AUTOMAKE(openafs,1.3.73) +AM_INIT_AUTOMAKE(openafs,1.3.74) AC_CONFIG_HEADER(src/config/afsconfig.h) AC_PROG_CC diff --git a/src/WINNT/afsapplib/NTMakefile b/src/WINNT/afsapplib/NTMakefile index e4503835b..3b757ec6d 100644 --- a/src/WINNT/afsapplib/NTMakefile +++ b/src/WINNT/afsapplib/NTMakefile @@ -126,6 +126,9 @@ $(DLLFILE) : $(DLLOBJS) $(DLLLIBS) $(DEL) $*.lib $*.exp clean:: + $(CD) lang + for /f %l in ('dir /B ??_??') do @$(NTLANG) %l $(MAKECMD) /nologo /f NTMakefile clean + $(CD) .. ############################################################################ diff --git a/src/WINNT/afsd/NTMakefile b/src/WINNT/afsd/NTMakefile index 7f325edd3..4797139ec 100644 --- a/src/WINNT/afsd/NTMakefile +++ b/src/WINNT/afsd/NTMakefile @@ -339,26 +339,26 @@ 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 \ - strsafe.lib \ - mpr.lib \ - secur32.lib \ - ole32.lib \ - oleaut32.lib + Dbghelp.lib \ + strsafe.lib \ + mpr.lib \ + secur32.lib \ + ole32.lib \ + oleaut32.lib AFSD_EXELIBS =\ $(DESTDIR)\lib\libosi.lib \ $(DESTDIR)\lib\afsrpc.lib \ - $(DESTDIR)\lib\afsrx.lib \ + $(DESTDIR)\lib\afsrx.lib \ $(DESTDIR)\lib\afsauthent.lib \ $(DESTDIR)\lib\afs\mtafsvldb.lib \ $(DESTDIR)\lib\afs\mtafsint.lib \ $(DESTDIR)\lib\libafsconf.lib \ $(DESTDIR)\lib\afs\afsreg.lib \ - $(LANAHELPERLIB) + $(LANAHELPERLIB) $(AFSD_EXEFILE): $(OUT)\afsd.obj $(AFSDOBJS) $(OUT)\afsd.res $(RXOBJS) $(AFSD_EXELIBS) $(EXEGUILINK) $(AFSD_SDKLIBS) diff --git a/src/WINNT/afsd/afsd.c b/src/WINNT/afsd/afsd.c index 8e29f678e..d8661ebbb 100644 --- a/src/WINNT/afsd/afsd.c +++ b/src/WINNT/afsd/afsd.c @@ -53,6 +53,7 @@ void afsd_notifier(char *msgp, char *filep, long line) MessageBox(NULL, tbuffer, msgp, MB_OK|MB_ICONSTOP|MB_SETFOREGROUND); afsd_ForceTrace(TRUE); + buf_ForceTrace(TRUE); if (traceOnPanic) { _asm int 3h; diff --git a/src/WINNT/afsd/afsd95.c b/src/WINNT/afsd/afsd95.c index 75cd53ae1..2b77da329 100644 --- a/src/WINNT/afsd/afsd95.c +++ b/src/WINNT/afsd/afsd95.c @@ -52,6 +52,7 @@ void afsd_notifier(char *msgp, char *filep, long line) /*MessageBox(NULL, tbuffer, msgp, MB_OK|MB_ICONSTOP|MB_SETFOREGROUND);*/ afsd_ForceTrace(TRUE); + buf_ForceTrace(TRUE); if (traceOnPanic) { /*asm("int 3");*/ diff --git a/src/WINNT/afsd/afsd_init.c b/src/WINNT/afsd/afsd_init.c index a11118b94..8c3456849 100644 --- a/src/WINNT/afsd/afsd_init.c +++ b/src/WINNT/afsd/afsd_init.c @@ -22,7 +22,6 @@ #include "afsd.h" #include #include - #include #include "smb.h" @@ -651,7 +650,7 @@ int afsd_InitCM(char **reasonP) char * p, *q; afsi_log("Sys name %s", buf); - for (p = q = buf; p < cm_sysName + dummyLen; p++) + for (p = q = buf; p < buf + dummyLen; p++) { if (*p == '\0' || isspace(*p)) { memcpy(cm_sysNameList[cm_sysNameCount],q,p-q); diff --git a/src/WINNT/afsd/afsd_service.c b/src/WINNT/afsd/afsd_service.c index 43fcb783f..d9236c3dd 100644 --- a/src/WINNT/afsd/afsd_service.c +++ b/src/WINNT/afsd/afsd_service.c @@ -82,6 +82,7 @@ static void afsd_notifier(char *msgp, char *filep, long line) osi_LogEnable(afsd_logp); afsd_ForceTrace(TRUE); + buf_ForceTrace(TRUE); afsi_log("--- begin dump ---"); cm_DumpSCache(afsi_file, "a"); @@ -176,8 +177,10 @@ afsd_ServiceControlHandler(DWORD ctrlCode) RegCloseKey (parmKey); if (code != ERROR_SUCCESS) doTrace = 0; - if (doTrace) + if (doTrace) { afsd_ForceTrace(FALSE); + buf_ForceTrace(FALSE); + } doneTrace: ServiceStatus.dwCurrentState = SERVICE_STOP_PENDING; @@ -239,8 +242,10 @@ afsd_ServiceControlHandlerEx( RegCloseKey (parmKey); if (code != ERROR_SUCCESS) doTrace = 0; - if (doTrace) + if (doTrace) { afsd_ForceTrace(FALSE); + buf_ForceTrace(FALSE); + } doneTrace: ServiceStatus.dwCurrentState = SERVICE_STOP_PENDING; diff --git a/src/WINNT/afsd/afskfw.c b/src/WINNT/afsd/afskfw.c index 743374a28..01ace95a8 100644 --- a/src/WINNT/afsd/afskfw.c +++ b/src/WINNT/afsd/afskfw.c @@ -56,7 +56,7 @@ #define USE_MS2MIT -#define USE_KRB4 +#undef USE_KRB4 #include "afskfw-int.h" #include "afskfw.h" @@ -288,6 +288,7 @@ FUNC_INFO k5_fi[] = { END_FUNC_INFO }; +#ifdef USE_KRB4 FUNC_INFO k4_fi[] = { MAKE_FUNC_INFO(krb_get_cred), MAKE_FUNC_INFO(krb_get_tf_realm), @@ -295,6 +296,7 @@ FUNC_INFO k4_fi[] = { MAKE_FUNC_INFO(tkt_string), END_FUNC_INFO }; +#endif FUNC_INFO k524_fi[] = { MAKE_FUNC_INFO(krb524_init_ets), @@ -388,7 +390,9 @@ KFW_initialize(void) if ( !inited ) { inited = 1; LoadFuncs(KRB5_DLL, k5_fi, &hKrb5, 0, 1, 0, 0); +#ifdef USE_KRB4 LoadFuncs(KRB4_DLL, k4_fi, &hKrb4, 0, 1, 0, 0); +#endif /* USE_KRB4 */ LoadFuncs(COMERR_DLL, ce_fi, &hComErr, 0, 0, 1, 0); LoadFuncs(SERVICE_DLL, service_fi, &hService, 0, 1, 0, 0); #ifdef USE_MS2MIT @@ -457,20 +461,17 @@ KFW_use_krb524(void) len = sizeof(use524); code = RegQueryValueEx(parmKey, "Use524", NULL, NULL, (BYTE *) &use524, &len); - if (code != ERROR_SUCCESS) { - RegCloseKey(parmKey); - - code = RegOpenKeyEx(HKEY_LOCAL_MACHINE, OpenAFSConfigKeyName, - 0, KEY_QUERY_VALUE, &parmKey); - if (code == ERROR_SUCCESS) { - len = sizeof(use524); - code = RegQueryValueEx(parmKey, "Use524", NULL, NULL, - (BYTE *) &use524, &len); - if (code != ERROR_SUCCESS) - use524 = 0; - } + RegCloseKey(parmKey); + } + if (code != ERROR_SUCCESS) { + code = RegOpenKeyEx(HKEY_LOCAL_MACHINE, OpenAFSConfigKeyName, + 0, KEY_QUERY_VALUE, &parmKey); + if (code == ERROR_SUCCESS) { + len = sizeof(use524); + code = RegQueryValueEx(parmKey, "Use524", NULL, NULL, + (BYTE *) &use524, &len); + RegCloseKey (parmKey); } - RegCloseKey (parmKey); } return use524; } @@ -488,21 +489,20 @@ KFW_is_available(void) len = sizeof(enableKFW); code = RegQueryValueEx(parmKey, "EnableKFW", NULL, NULL, (BYTE *) &enableKFW, &len); - if (code != ERROR_SUCCESS) { - RegCloseKey(parmKey); - - code = RegOpenKeyEx(HKEY_LOCAL_MACHINE, OpenAFSConfigKeyName, - 0, KEY_QUERY_VALUE, &parmKey); - if (code == ERROR_SUCCESS) { - len = sizeof(enableKFW); - code = RegQueryValueEx(parmKey, "EnableKFW", NULL, NULL, - (BYTE *) &enableKFW, &len); - if (code != ERROR_SUCCESS) - enableKFW = 1; - } - } RegCloseKey (parmKey); } + + if (code != ERROR_SUCCESS) { + code = RegOpenKeyEx(HKEY_LOCAL_MACHINE, OpenAFSConfigKeyName, + 0, KEY_QUERY_VALUE, &parmKey); + if (code == ERROR_SUCCESS) { + len = sizeof(enableKFW); + code = RegQueryValueEx(parmKey, "EnableKFW", NULL, NULL, + (BYTE *) &enableKFW, &len); + RegCloseKey (parmKey); + } + } + if ( !enableKFW ) return FALSE; @@ -2643,7 +2643,8 @@ KFW_AFS_klog( } } #else - goto cleanup; + if (!try_krb5) + goto cleanup; #endif strcpy(realm_of_cell, afs_realm_of_cell(ctx, &ak_cellconfig)); @@ -2700,7 +2701,7 @@ KFW_AFS_klog( code = pkrb5_get_credentials(ctx, 0, cc, &increds, &k5creds); if (code == KRB5KDC_ERR_S_PRINCIPAL_UNKNOWN || code == KRB5KRB_ERR_GENERIC /* heimdal */ || - code == KRB5KRB_AP_ERR_MSG_TYPE) { + code == KRB5KRB_AP_ERR_MSG_TYPE) { /* Or service@REALM */ pkrb5_free_principal(ctx,increds.server); increds.server = 0; @@ -2730,7 +2731,7 @@ KFW_AFS_klog( if ((code == KRB5KDC_ERR_S_PRINCIPAL_UNKNOWN || code == KRB5KRB_ERR_GENERIC /* heimdal */ || - code == KRB5KRB_AP_ERR_MSG_TYPE) && + code == KRB5KRB_AP_ERR_MSG_TYPE) && strcmp(RealmName, realm_of_cell)) { /* Or service/cell@REALM_OF_CELL */ strcpy(RealmName, realm_of_cell); @@ -3021,7 +3022,7 @@ KFW_AFS_klog( if (ctx && (ctx != alt_ctx)) pkrb5_free_context(ctx); - return(rc? rc : code); + return(rc? rc : code); } /**************************************/ diff --git a/src/WINNT/afsd/cm.h b/src/WINNT/afsd/cm.h index b0cef02e8..423bdd30f 100644 --- a/src/WINNT/afsd/cm.h +++ b/src/WINNT/afsd/cm.h @@ -245,8 +245,9 @@ int RXAFS_Lookup (struct rx_connection *, #define CM_ERROR_BUFFERTOOSMALL (CM_ERROR_BASE+38) #define CM_ERROR_RENAME_IDENTICAL (CM_ERROR_BASE+39) #define CM_ERROR_ALLOFFLINE (CM_ERROR_BASE+40) -#define CM_ERROR_AMBIGUOUS_FILENAME (CM_ERROR_BASE+41) -#define CM_ERROR_BADLOGONTYPE (CM_ERROR_BASE+42) -#define CM_ERROR_GSSCONTINUE (CM_ERROR_BASE+43) -#define CM_ERROR_TIDIPC (CM_ERROR_BASE+44) +#define CM_ERROR_AMBIGUOUS_FILENAME (CM_ERROR_BASE+41) +#define CM_ERROR_BADLOGONTYPE (CM_ERROR_BASE+42) +#define CM_ERROR_GSSCONTINUE (CM_ERROR_BASE+43) +#define CM_ERROR_TIDIPC (CM_ERROR_BASE+44) +#define CM_ERROR_TOO_MANY_SYMLINKS (CM_ERROR_BASE+45) #endif /* __CM_H_ENV__ */ diff --git a/src/WINNT/afsd/cm_buf.c b/src/WINNT/afsd/cm_buf.c index 9fef57dfe..06c9cc162 100644 --- a/src/WINNT/afsd/cm_buf.c +++ b/src/WINNT/afsd/cm_buf.c @@ -19,9 +19,14 @@ #include #include #include +#include #include "afsd.h" +#ifdef DEBUG +#define TRACE_BUFFER 1 +#endif + extern void afsi_log(char *pattern, ...); /* This module implements the buffer package used by the local transaction @@ -306,12 +311,12 @@ long buf_Init(cm_buf_ops_t *opsp) OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + FreeCacheFileSA(psa); if (hf == INVALID_HANDLE_VALUE) { afsi_log("Error creating cache file \"%s\" error %d", cm_CachePath, GetLastError()); return CM_ERROR_INVAL; } - FreeCacheFileSA(psa); } else { /* buf_cacheType == CM_BUF_CACHETYPE_VIRTUAL */ hf = INVALID_HANDLE_VALUE; } @@ -378,8 +383,11 @@ long buf_Init(cm_buf_ops_t *opsp) /* just for safety's sake */ buf_maxReservedBufs = buf_nbuffers - 3; +#ifdef TRACE_BUFFER /* init the buffer trace log */ - buf_logp = osi_LogCreate("buffer", 10); + buf_logp = osi_LogCreate("buffer", 1000); + osi_LogEnable(buf_logp); +#endif osi_EndOnce(&once); @@ -532,7 +540,7 @@ void buf_WaitIO(cm_buf_t *bp) bp->flags |= CM_BUF_WAITING; osi_SleepM((long) bp, &bp->mx); lock_ObtainMutex(&bp->mx); - osi_Log1(buf_logp, "buf_WaitIO conflict wait done for 0x%x", bp); + osi_Log1(buf_logp, "buf_WaitIO conflict wait done for 0x%x", bp); } /* if we get here, the IO is done, but we may have to wakeup people waiting for @@ -1481,3 +1489,24 @@ int cm_DumpBufHashTable(FILE *outputFile, char *cookie) return 0; } +void buf_ForceTrace(BOOL flush) +{ + HANDLE handle; + int len; + char buf[256]; + + if (!buf_logp) + return; + + len = GetTempPath(sizeof(buf)-10, buf); + StringCbCopyA(&buf[len], sizeof(buf)-len, "/afs-buffer.log"); + handle = CreateFile(buf, GENERIC_WRITE, FILE_SHARE_READ, + NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + if (handle == INVALID_HANDLE_VALUE) { + osi_panic("Cannot create log file", __FILE__, __LINE__); + } + osi_LogPrint(buf_logp, handle); + if (flush) + FlushFileBuffers(handle); + CloseHandle(handle); +} diff --git a/src/WINNT/afsd/cm_buf.h b/src/WINNT/afsd/cm_buf.h index 4ca977ad4..1f1bc42ac 100644 --- a/src/WINNT/afsd/cm_buf.h +++ b/src/WINNT/afsd/cm_buf.h @@ -195,6 +195,8 @@ extern long buf_FlushCleanPages(cm_scache_t *scp, cm_user_t *userp, extern long buf_SetNBuffers(long nbuffers); +extern void buf_ForceTrace(BOOL flush); + /* error codes */ #define CM_BUF_EXISTS 1 /* buffer exists, and shouldn't */ #define CM_ERROR_BASEBUF 0x33333333 diff --git a/src/WINNT/afsd/cm_conn.c b/src/WINNT/afsd/cm_conn.c index 32e748ad1..4dbfb2cfd 100644 --- a/src/WINNT/afsd/cm_conn.c +++ b/src/WINNT/afsd/cm_conn.c @@ -384,12 +384,12 @@ out: long cm_ConnByMServers(cm_serverRef_t *serversp, cm_user_t *usersp, cm_req_t *reqp, cm_conn_t **connpp) { - long code; - cm_serverRef_t *tsrp; + long code; + cm_serverRef_t *tsrp; cm_server_t *tsp; long firstError = 0; - int someBusy = 0, someOffline = 0, allBusy = 1, allDown = 1; - long timeUsed, timeLeft, hardTimeLeft; + int someBusy = 0, someOffline = 0, allBusy = 1, allDown = 1; + long timeUsed, timeLeft, hardTimeLeft; #ifdef DJGPP struct timeval now; #endif /* DJGPP */ @@ -397,17 +397,17 @@ long cm_ConnByMServers(cm_serverRef_t *serversp, cm_user_t *usersp, *connpp = NULL; #ifndef DJGPP - timeUsed = (GetCurrentTime() - reqp->startTime) / 1000; + timeUsed = (GetCurrentTime() - reqp->startTime) / 1000; #else gettimeofday(&now, NULL); timeUsed = sub_time(now, reqp->startTime) / 1000; #endif - /* leave 5 seconds margin of safety */ - timeLeft = ConnDeadtimeout - timeUsed - 5; - hardTimeLeft = HardDeadtimeout - timeUsed - 5; + /* leave 5 seconds margin of safety */ + timeLeft = ConnDeadtimeout - timeUsed - 5; + hardTimeLeft = HardDeadtimeout - timeUsed - 5; - lock_ObtainWrite(&cm_serverLock); + lock_ObtainWrite(&cm_serverLock); for (tsrp = serversp; tsrp; tsrp=tsrp->next) { tsp = tsrp->server; cm_GetServerNoLock(tsp); @@ -419,7 +419,7 @@ long cm_ConnByMServers(cm_serverRef_t *serversp, cm_user_t *usersp, else if (tsrp->status == offline) someOffline = 1; else { - allBusy = 0; + allBusy = 0; code = cm_ConnByServer(tsp, usersp, connpp); if (code == 0) { cm_PutServer(tsp); @@ -439,24 +439,24 @@ long cm_ConnByMServers(cm_serverRef_t *serversp, cm_user_t *usersp, if (firstError == 0) firstError = code; } - } + } lock_ObtainWrite(&cm_serverLock); cm_PutServerNoLock(tsp); } - lock_ReleaseWrite(&cm_serverLock); - if (firstError == 0) { + lock_ReleaseWrite(&cm_serverLock); + if (firstError == 0) { if (serversp == NULL) - firstError = CM_ERROR_NOSUCHVOLUME; + firstError = CM_ERROR_NOSUCHVOLUME; else if (allDown) - firstError = CM_ERROR_ALLOFFLINE; - else if (allBusy) - firstError = CM_ERROR_ALLBUSY; - else - firstError = CM_ERROR_TIMEDOUT; - } + firstError = CM_ERROR_ALLOFFLINE; + else if (allBusy) + firstError = CM_ERROR_ALLBUSY; + else + firstError = CM_ERROR_TIMEDOUT; + } - osi_Log1(afsd_logp, "cm_ConnByMServers returning %x", firstError); + osi_Log1(afsd_logp, "cm_ConnByMServers returning %x", firstError); return firstError; } diff --git a/src/WINNT/afsd/cm_freelance.c b/src/WINNT/afsd/cm_freelance.c index 2933c0f50..0894791a1 100644 --- a/src/WINNT/afsd/cm_freelance.c +++ b/src/WINNT/afsd/cm_freelance.c @@ -73,6 +73,45 @@ void cm_FreelanceChangeNotifier(void * parmp) { } } } + +void cm_FreelanceSymlinkChangeNotifier(void * parmp) { + HANDLE hFreelanceSymlinkChangeEvent = 0; + HKEY hkFreelance = 0; + + if (RegOpenKeyEx( HKEY_LOCAL_MACHINE, + "SOFTWARE\\OpenAFS\\Client\\Freelance\\Symlinks", + 0, + KEY_NOTIFY, + &hkFreelance) == ERROR_SUCCESS) { + + hFreelanceSymlinkChangeEvent = CreateEvent(NULL, FALSE, FALSE, NULL); + if (hFreelanceSymlinkChangeEvent == NULL) { + RegCloseKey(hkFreelance); + return; + } + } + + while ( TRUE ) { + /* check hFreelanceSymlinkChangeEvent to see if it is set. + * if so, call cm_noteLocalMountPointSymlinkChange() + */ + if (RegNotifyChangeKeyValue( hkFreelance, /* hKey */ + FALSE, /* bWatchSubtree */ + REG_NOTIFY_CHANGE_LAST_SET, /* dwNotifyFilter */ + hFreelanceSymlinkChangeEvent, /* hEvent */ + TRUE /* fAsynchronous */ + ) != ERROR_SUCCESS) { + RegCloseKey(hkFreelance); + CloseHandle(hFreelanceSymlinkChangeEvent); + return; + } + + if (WaitForSingleObject(hFreelanceSymlinkChangeEvent, INFINITE) == WAIT_OBJECT_0) + { + cm_noteLocalMountPointChange(); + } + } +} #endif void cm_InitFreelance() { @@ -98,13 +137,17 @@ void cm_InitFreelance() { NULL, 0, &lpid, "cm_FreelanceChangeNotifier"); osi_assert(phandle != NULL); thrd_CloseHandle(phandle); + + phandle = thrd_Create(NULL, 65536, (ThreadFunc) cm_FreelanceSymlinkChangeNotifier, + NULL, 0, &lpid, "cm_FreelanceSymlinkChangeNotifier"); + osi_assert(phandle != NULL); + thrd_CloseHandle(phandle); #endif } /* yj: Initialization of the fake root directory */ /* to be called while holding freelance lock unless during init. */ void cm_InitFakeRootDir() { - int i, t1, t2; char* currentPos; int noChunks; @@ -398,12 +441,12 @@ long cm_InitLocalMountPoints() { long code; char rootCellName[256]; #if !defined(DJGPP) - HKEY hkFreelance = 0; + HKEY hkFreelance = 0, hkFreelanceSymlinks = 0; DWORD dwType, dwSize; - DWORD dwMountPoints; + DWORD dwMountPoints = 0; DWORD dwIndex; + DWORD dwSymlinks = 0; FILETIME ftLastWriteTime; - afs_uint32 unixTime; #endif #if !defined(DJGPP) @@ -440,9 +483,34 @@ long cm_InitLocalMountPoints() { dwMountPoints = 2; } + if (RegCreateKeyEx( HKEY_LOCAL_MACHINE, + "SOFTWARE\\OpenAFS\\Client\\Freelance\\Symlinks", + 0, + NULL, + REG_OPTION_NON_VOLATILE, + KEY_READ|KEY_WRITE|KEY_QUERY_VALUE, + NULL, + &hkFreelanceSymlinks, + NULL) == ERROR_SUCCESS) { + + RegQueryInfoKey( hkFreelanceSymlinks, + NULL, /* lpClass */ + NULL, /* lpcClass */ + NULL, /* lpReserved */ + NULL, /* lpcSubKeys */ + NULL, /* lpcMaxSubKeyLen */ + NULL, /* lpcMaxClassLen */ + &dwSymlinks, /* lpcValues */ + NULL, /* lpcMaxValueNameLen */ + NULL, /* lpcMaxValueLen */ + NULL, /* lpcbSecurityDescriptor */ + NULL /* lpftLastWriteTime */ + ); + } + // get the number of entries there are from the first line // that we read - cm_noLocalMountPoints = dwMountPoints; + cm_noLocalMountPoints = dwMountPoints + dwSymlinks; // create space to store the local mount points cm_localMountPoints = malloc(sizeof(cm_localMountPoint_t) * cm_noLocalMountPoints); @@ -478,14 +546,16 @@ long cm_InitLocalMountPoints() { cm_noLocalMountPoints--; continue; } + + aLocalMountPoint->fileType = CM_SCACHETYPE_MOUNTPOINT; aLocalMountPoint->namep=malloc(t-line+1); strncpy(aLocalMountPoint->namep, line, t-line); aLocalMountPoint->namep[t-line] = '\0'; - /* copy the mount point string without the trailing dot */ + /* copy the mount point string */ aLocalMountPoint->mountPointStringp=malloc(strlen(t)); - strncpy(aLocalMountPoint->mountPointStringp, t, strlen(t)-1); - aLocalMountPoint->mountPointStringp[strlen(t)-1] = '\0'; + strncpy(aLocalMountPoint->mountPointStringp, t, strlen(t)-1); + aLocalMountPoint->mountPointStringp[strlen(t)-1] = '\0'; osi_Log2(afsd_logp,"found mount point: name %s, string %s", osi_LogSaveString(afsd_logp,aLocalMountPoint->namep), @@ -494,6 +564,48 @@ long cm_InitLocalMountPoints() { aLocalMountPoint++; } + for ( dwIndex = 0 ; dwIndex < dwSymlinks; dwIndex++ ) { + TCHAR szValueName[16]; + DWORD dwValueSize = 16; + dwSize = sizeof(line); + RegEnumValue( hkFreelanceSymlinks, dwIndex, szValueName, &dwValueSize, NULL, + &dwType, line, &dwSize); + + /* find the trailing dot; null terminate after it */ + t2 = strrchr(line, '.'); + if (t2) + *(t2+1) = '\0'; + + // line is not empty, so let's parse it + t = strchr(line, ':'); + + // make sure that there is a ':' separator in the line + if (!t) { + afsi_log("error occurred while parsing symlink entry: no ':' separator in line %d", dwIndex); + fprintf(stderr, "error occurred while parsing symlink entry: no ':' separator in line %d", dwIndex); + cm_noLocalMountPoints--; + continue; + } + + aLocalMountPoint->fileType = CM_SCACHETYPE_SYMLINK; + aLocalMountPoint->namep=malloc(t-line+1); + strncpy(aLocalMountPoint->namep, line, t-line); + aLocalMountPoint->namep[t-line] = '\0'; + + /* copy the symlink string */ + aLocalMountPoint->mountPointStringp=malloc(strlen(t)-1); + strncpy(aLocalMountPoint->mountPointStringp, t+1, strlen(t)-2); + aLocalMountPoint->mountPointStringp[strlen(t)-2] = '\0'; + + osi_Log2(afsd_logp,"found symlink: name %s, string %s", + osi_LogSaveString(afsd_logp,aLocalMountPoint->namep), + osi_LogSaveString(afsd_logp,aLocalMountPoint->mountPointStringp)); + + aLocalMountPoint++; + } + + if ( hkFreelanceSymlinks ) + RegCloseKey( hkFreelanceSymlinks ); RegCloseKey(hkFreelance); return 0; } @@ -625,10 +737,6 @@ int cm_getNoLocalMountPoints() { return cm_noLocalMountPoints; } -cm_localMountPoint_t* cm_getLocalMountPoint(int vnode) { - return 0; -} - long cm_FreelanceAddMount(char *filename, char *cellname, char *volume, int rw, cm_fid_t *fidp) { FILE *fp; @@ -688,22 +796,35 @@ long cm_FreelanceAddMount(char *filename, char *cellname, char *volume, int rw, ); if (rw) - sprintf(line, "%s%%%s:%s\n", filename, fullname, volume); + sprintf(line, "%s%%%s:%s", filename, fullname, volume); else - sprintf(line, "%s#%s:%s\n", filename, fullname, volume); + sprintf(line, "%s#%s:%s", filename, fullname, volume); /* If we are adding a new value, there must be an unused name * within the range 0 to dwMountPoints */ for ( dwIndex = 0; dwIndex <= dwMountPoints; dwIndex++ ) { char szIndex[16]; + char szMount[1024]; + + dwSize = sizeof(szMount); sprintf(szIndex, "%d", dwIndex); - if (RegQueryValueEx( hkFreelance, szIndex, 0, &dwType, NULL, &dwSize) != ERROR_SUCCESS) { + if (RegQueryValueEx( hkFreelance, szIndex, 0, &dwType, szMount, &dwSize) != ERROR_SUCCESS) { /* found an unused value */ dwType = REG_SZ; dwSize = strlen(line) + 1; 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] == '#')) { + /* Replace the existing value */ + dwType = REG_SZ; + dwSize = strlen(line) + 1; + RegSetValueEx( hkFreelance, szIndex, 0, dwType, line, dwSize); + break; + } } } RegCloseKey(hkFreelance); @@ -847,4 +968,160 @@ long cm_FreelanceRemoveMount(char *toremove) return 0; } +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; + DWORD dwType, dwSize; + DWORD dwSymlinks; + 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? */ + osi_Log2(afsd_logp,"Freelance Add Symlink request: filename=%s destination=%s", + osi_LogSaveString(afsd_logp,filename), + osi_LogSaveString(afsd_logp,destination)); + + lock_ObtainMutex(&cm_Freelance_Lock); + +#if !defined(DJGPP) + if (RegCreateKeyEx( HKEY_LOCAL_MACHINE, + "SOFTWARE\\OpenAFS\\Client\\Freelance\\Symlinks", + 0, + NULL, + REG_OPTION_NON_VOLATILE, + KEY_READ|KEY_WRITE|KEY_QUERY_VALUE, + NULL, + &hkFreelanceSymlinks, + NULL) == ERROR_SUCCESS) { + + RegQueryInfoKey( hkFreelanceSymlinks, + NULL, /* lpClass */ + NULL, /* lpcClass */ + NULL, /* lpReserved */ + NULL, /* lpcSubKeys */ + NULL, /* lpcMaxSubKeyLen */ + NULL, /* lpcMaxClassLen */ + &dwSymlinks, /* lpcValues */ + NULL, /* lpcMaxValueNameLen */ + NULL, /* lpcMaxValueLen */ + NULL, /* lpcbSecurityDescriptor */ + NULL /* lpftLastWriteTime */ + ); + + sprintf(line, "%s:%s.", filename, destination); + + /* If we are adding a new value, there must be an unused name + * within the range 0 to dwSymlinks + */ + for ( dwIndex = 0; dwIndex <= dwSymlinks; dwIndex++ ) { + char szIndex[16]; + char szLink[1024]; + + dwSize = sizeof(szLink); + sprintf(szIndex, "%d", dwIndex); + if (RegQueryValueEx( hkFreelanceSymlinks, szIndex, 0, &dwType, szLink, &dwSize) != ERROR_SUCCESS) { + /* found an unused value */ + dwType = REG_SZ; + dwSize = strlen(line) + 1; + RegSetValueEx( hkFreelanceSymlinks, szIndex, 0, dwType, line, dwSize); + break; + } else { + 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; + RegSetValueEx( hkFreelanceSymlinks, szIndex, 0, dwType, line, dwSize); + break; + } + } + } + RegCloseKey(hkFreelanceSymlinks); + } +#endif + lock_ReleaseMutex(&cm_Freelance_Lock); + + /* cm_reInitLocalMountPoints(); */ + if (fidp) { + fidp->unique = 1; + fidp->vnode = cm_noLocalMountPoints + 1; /* vnode value of last mt pt */ + } + cm_noteLocalMountPointChange(); + return 0; +} + +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; + DWORD dwType, dwSize; + DWORD dwSymlinks; + DWORD dwIndex; +#endif + + lock_ObtainMutex(&cm_Freelance_Lock); + + +#if !defined(DJGPP) + if (RegOpenKeyEx( HKEY_LOCAL_MACHINE, + "SOFTWARE\\OpenAFS\\Client\\Freelance\\Symlinks", + 0, + KEY_READ|KEY_WRITE|KEY_QUERY_VALUE, + &hkFreelanceSymlinks) == ERROR_SUCCESS) { + + RegQueryInfoKey( hkFreelanceSymlinks, + 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( hkFreelanceSymlinks, dwIndex, szValueName, &dwValueSize, NULL, + &dwType, line, &dwSize); + + cp=strchr(line, ':'); + memcpy(shortname, line, cp-line); + shortname[cp-line]=0; + + if (!strcmp(shortname, toremove)) { + RegDeleteValue( hkFreelanceSymlinks, szValueName ); + break; + } + } + RegCloseKey(hkFreelanceSymlinks); + } +#endif + + lock_ReleaseMutex(&cm_Freelance_Lock); + cm_noteLocalMountPointChange(); + return 0; +} #endif /* AFS_FREELANCE_CLIENT */ diff --git a/src/WINNT/afsd/cm_freelance.h b/src/WINNT/afsd/cm_freelance.h index 3d02b9e09..effeb9ee6 100644 --- a/src/WINNT/afsd/cm_freelance.h +++ b/src/WINNT/afsd/cm_freelance.h @@ -3,19 +3,21 @@ typedef struct cm_localMountPoint { - char* namep; - char* mountPointStringp; - struct cm_localMountPoint* next; + char* namep; + char* mountPointStringp; + unsigned int fileType; + struct cm_localMountPoint* next; } cm_localMountPoint_t; extern int cm_getNoLocalMountPoints(); extern long cm_InitLocalMountPoints(); extern int cm_getLocalMountPointChange(); extern int cm_reInitLocalMountPoints(); -extern cm_localMountPoint_t* cm_getLocalMountPoint(int vnode); extern void cm_InitFreelance(); 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); +extern long cm_FreelanceAddSymlink(char *filename, char *destination, cm_fid_t *fidp); extern int cm_clearLocalMountPointChange(); extern int cm_FakeRootFid(cm_fid_t *fidp); diff --git a/src/WINNT/afsd/cm_ioctl.c b/src/WINNT/afsd/cm_ioctl.c index 13bd7a48f..bb60b77e6 100644 --- a/src/WINNT/afsd/cm_ioctl.c +++ b/src/WINNT/afsd/cm_ioctl.c @@ -458,13 +458,26 @@ long cm_IoctlGetFileCellName(struct smb_ioctl *ioctlp, struct cm_user *userp) code = cm_ParseIoctlPath(ioctlp, userp, &req, &scp); if (code) return code; - cellp = cm_FindCellByID(scp->fid.cell); - if (cellp) { - strcpy(ioctlp->outDatap, cellp->namep); +#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 ) { + strcpy(ioctlp->outDatap, "Freelance.Local.Root"); ioctlp->outDatap += strlen(ioctlp->outDatap) + 1; code = 0; + } else +#endif /* AFS_FREELANCE_CLIENT */ + { + cellp = cm_FindCellByID(scp->fid.cell); + if (cellp) { + strcpy(ioctlp->outDatap, cellp->namep); + ioctlp->outDatap += strlen(ioctlp->outDatap) + 1; + code = 0; + } + else + code = CM_ERROR_NOSUCHCELL; } - else code = CM_ERROR_NOSUCHCELL; cm_ReleaseSCache(scp); return code; @@ -983,6 +996,7 @@ long cm_IoctlTraceControl(struct smb_ioctl *ioctlp, struct cm_user *userp) /* print trace */ if (inValue & 8) { afsd_ForceTrace(FALSE); + buf_ForceTrace(FALSE); } if (inValue & 2) { @@ -1213,6 +1227,7 @@ long cm_IoctlSysName(struct smb_ioctl *ioctlp, struct cm_user *userp) * 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); if (setSysName > 1) { /* ... or list */ cp = ioctlp->inDatap; for (count = 1; count < setSysName; ++count) { @@ -1220,7 +1235,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); - memcpy(cm_sysNameList[count], cp, t + 1); /* include null */ + strcpy(cm_sysNameList[count], cp); cp += t + 1; } } @@ -1509,6 +1524,26 @@ long cm_IoctlSymlink(struct smb_ioctl *ioctlp, struct cm_user *userp) cp = ioctlp->inDatap; /* contents of link */ +#ifdef AFS_FREELANCE_CLIENT + if (cm_freelanceEnabled && dscp == cm_rootSCachep) { + /* we are adding the symlink to the root dir., so call + * the freelance code to do the add. */ + if (cp[0] == cp[1] && cp[1] == '\\' && + !_strnicmp(cm_NetbiosName,cp+2,strlen(cm_NetbiosName))) + { + /* skip \\AFS\ or \\AFS\all\ */ + char * p; + p = cp + 2 + strlen(cm_NetbiosName) + 1; + if ( !_strnicmp("all", p, 3) ) + p += 4; + cp = p; + } + osi_Log0(afsd_logp,"IoctlCreateSymlink within Freelance root dir"); + code = cm_FreelanceAddSymlink(leaf, cp, NULL); + return code; + } +#endif + /* Create symlink with mode 0755. */ tattr.mask = CM_ATTRMASK_UNIXMODEBITS; tattr.unixModeBits = 0755; @@ -1618,6 +1653,16 @@ long cm_IoctlDeletelink(struct smb_ioctl *ioctlp, struct cm_user *userp) cp = ioctlp->inDatap; +#ifdef AFS_FREELANCE_CLIENT + if (cm_freelanceEnabled && dscp == cm_rootSCachep) { + /* we are adding the mount point to the root dir., so call + * the freelance code to do the add. */ + osi_Log0(afsd_logp,"IoctlDeletelink from Freelance root dir"); + code = cm_FreelanceRemoveSymlink(cp); + return code; + } +#endif + code = cm_Lookup(dscp, cp, CM_FLAG_NOMOUNTCHASE, userp, &req, &scp); /* if something went wrong, bail out now */ diff --git a/src/WINNT/afsd/cm_scache.c b/src/WINNT/afsd/cm_scache.c index b1d29854c..b5e2a7626 100644 --- a/src/WINNT/afsd/cm_scache.c +++ b/src/WINNT/afsd/cm_scache.c @@ -52,10 +52,10 @@ extern osi_mutex_t cm_Freelance_Lock; /* must be called with cm_scacheLock write-locked! */ void cm_AdjustLRU(cm_scache_t *scp) { - if (scp == cm_scacheLRULastp) - cm_scacheLRULastp = (cm_scache_t *) osi_QPrev(&scp->q); - osi_QRemove((osi_queue_t **) &cm_scacheLRUFirstp, &scp->q); - osi_QAdd((osi_queue_t **) &cm_scacheLRUFirstp, &scp->q); + if (scp == cm_scacheLRULastp) + cm_scacheLRULastp = (cm_scache_t *) osi_QPrev(&scp->q); + osi_QRemove((osi_queue_t **) &cm_scacheLRUFirstp, &scp->q); + osi_QAdd((osi_queue_t **) &cm_scacheLRUFirstp, &scp->q); if (!cm_scacheLRULastp) cm_scacheLRULastp = scp; } @@ -65,118 +65,118 @@ void cm_AdjustLRU(cm_scache_t *scp) */ cm_scache_t *cm_GetNewSCache(void) { - cm_scache_t *scp; - int i; - cm_scache_t **lscpp; - cm_scache_t *tscp; - - if (cm_currentSCaches >= cm_maxSCaches) { - for (scp = cm_scacheLRULastp; - scp; - scp = (cm_scache_t *) osi_QPrev(&scp->q)) { + cm_scache_t *scp; + int i; + cm_scache_t **lscpp; + cm_scache_t *tscp; + + if (cm_currentSCaches >= cm_maxSCaches) { + for (scp = cm_scacheLRULastp; + scp; + scp = (cm_scache_t *) osi_QPrev(&scp->q)) { if (scp->refCount == 0) break; - } + } - if (scp) { - /* we found an entry, so return it */ - if (scp->flags & CM_SCACHEFLAG_INHASH) { - /* hash it out first */ - i = CM_SCACHE_HASH(&scp->fid); - lscpp = &cm_hashTablep[i]; - for (tscp = *lscpp; - tscp; - lscpp = &tscp->nextp, tscp = *lscpp) { + if (scp) { + /* we found an entry, so return it */ + if (scp->flags & CM_SCACHEFLAG_INHASH) { + /* hash it out first */ + i = CM_SCACHE_HASH(&scp->fid); + lscpp = &cm_hashTablep[i]; + for (tscp = *lscpp; + tscp; + lscpp = &tscp->nextp, tscp = *lscpp) { if (tscp == scp) break; - } - osi_assertx(tscp, "afsd: scache hash screwup"); - *lscpp = scp->nextp; - scp->flags &= ~CM_SCACHEFLAG_INHASH; - } - - /* look for things that shouldn't still be set */ - osi_assert(scp->bufWritesp == NULL); - osi_assert(scp->bufReadsp == NULL); - - /* invalidate so next merge works fine; - * also initialize some flags */ - scp->flags &= ~(CM_SCACHEFLAG_STATD - | CM_SCACHEFLAG_RO - | CM_SCACHEFLAG_PURERO - | CM_SCACHEFLAG_OVERQUOTA - | CM_SCACHEFLAG_OUTOFSPACE); - scp->serverModTime = 0; - scp->dataVersion = 0; - scp->bulkStatProgress = hzero; - - /* discard callback */ + } + osi_assertx(tscp, "afsd: scache hash screwup"); + *lscpp = scp->nextp; + scp->flags &= ~CM_SCACHEFLAG_INHASH; + } + + /* look for things that shouldn't still be set */ + osi_assert(scp->bufWritesp == NULL); + osi_assert(scp->bufReadsp == NULL); + + /* invalidate so next merge works fine; + * also initialize some flags */ + scp->flags &= ~(CM_SCACHEFLAG_STATD + | CM_SCACHEFLAG_RO + | CM_SCACHEFLAG_PURERO + | CM_SCACHEFLAG_OVERQUOTA + | CM_SCACHEFLAG_OUTOFSPACE); + scp->serverModTime = 0; + scp->dataVersion = 0; + scp->bulkStatProgress = hzero; + + /* discard callback */ if (scp->cbServerp) { cm_PutServer(scp->cbServerp); - scp->cbServerp = NULL; + scp->cbServerp = NULL; } - scp->cbExpires = 0; - - /* remove from dnlc */ - cm_dnlcPurgedp(scp); - cm_dnlcPurgevp(scp); - - /* discard cached status; if non-zero, Close - * tried to store this to server but failed */ - scp->mask = 0; - - /* drop held volume ref */ - if (scp->volp) { - cm_PutVolume(scp->volp); - scp->volp = NULL; - } - - /* discard symlink info */ - if (scp->mountPointStringp) { - free(scp->mountPointStringp); - scp->mountPointStringp = NULL; - } - if (scp->mountRootFidp) { - free(scp->mountRootFidp); - scp->mountRootFidp = NULL; - } - if (scp->dotdotFidp) { - free(scp->dotdotFidp); - scp->dotdotFidp = NULL; - } - - /* not locked, but there can be no references to this guy - * while we hold the global refcount lock. - */ - cm_FreeAllACLEnts(scp); - - /* now remove from the LRU queue and put it back at the - * head of the LRU queue. - */ - cm_AdjustLRU(scp); - - /* and we're done */ - return scp; - } - } + scp->cbExpires = 0; + + /* remove from dnlc */ + cm_dnlcPurgedp(scp); + cm_dnlcPurgevp(scp); + + /* discard cached status; if non-zero, Close + * tried to store this to server but failed */ + scp->mask = 0; + + /* drop held volume ref */ + if (scp->volp) { + cm_PutVolume(scp->volp); + scp->volp = NULL; + } + + /* discard symlink info */ + if (scp->mountPointStringp) { + free(scp->mountPointStringp); + scp->mountPointStringp = NULL; + } + if (scp->mountRootFidp) { + free(scp->mountRootFidp); + scp->mountRootFidp = NULL; + } + if (scp->dotdotFidp) { + free(scp->dotdotFidp); + scp->dotdotFidp = NULL; + } + + /* not locked, but there can be no references to this guy + * while we hold the global refcount lock. + */ + cm_FreeAllACLEnts(scp); + + /* now remove from the LRU queue and put it back at the + * head of the LRU queue. + */ + cm_AdjustLRU(scp); + + /* and we're done */ + return scp; + } + } - /* if we get here, we should allocate a new scache entry. We either are below - * quota or we have a leak and need to allocate a new one to avoid panicing. - */ - scp = malloc(sizeof(*scp)); - memset(scp, 0, sizeof(*scp)); - lock_InitializeMutex(&scp->mx, "cm_scache_t mutex"); - lock_InitializeRWLock(&scp->bufCreateLock, "cm_scache_t bufCreateLock"); - - /* and put it in the LRU queue */ - osi_QAdd((osi_queue_t **) &cm_scacheLRUFirstp, &scp->q); + /* if we get here, we should allocate a new scache entry. We either are below + * quota or we have a leak and need to allocate a new one to avoid panicing. + */ + scp = malloc(sizeof(*scp)); + memset(scp, 0, sizeof(*scp)); + lock_InitializeMutex(&scp->mx, "cm_scache_t mutex"); + lock_InitializeRWLock(&scp->bufCreateLock, "cm_scache_t bufCreateLock"); + + /* and put it in the LRU queue */ + osi_QAdd((osi_queue_t **) &cm_scacheLRUFirstp, &scp->q); if (!cm_scacheLRULastp) cm_scacheLRULastp = scp; - cm_currentSCaches++; - cm_dnlcPurgedp(scp); /* make doubly sure that this is not in dnlc */ - cm_dnlcPurgevp(scp); - return scp; -} + cm_currentSCaches++; + cm_dnlcPurgedp(scp); /* make doubly sure that this is not in dnlc */ + cm_dnlcPurgevp(scp); + return scp; +} /* like strcmp, only for fids */ int cm_FidCmp(cm_fid_t *ap, cm_fid_t *bp) @@ -189,78 +189,78 @@ int cm_FidCmp(cm_fid_t *ap, cm_fid_t *bp) return 1; if (ap->cell != bp->cell) return 1; - return 0; + return 0; } void cm_fakeSCacheInit() { - memset(&cm_fakeSCache, 0, sizeof(cm_fakeSCache)); - lock_InitializeMutex(&cm_fakeSCache.mx, "cm_scache_t mutex"); - cm_fakeSCache.cbServerp = (struct cm_server *)(-1); - /* can leave clientModTime at 0 */ - cm_fakeSCache.fileType = CM_SCACHETYPE_FILE; - cm_fakeSCache.unixModeBits = 0777; - cm_fakeSCache.length.LowPart = 1000; - cm_fakeSCache.linkCount = 1; -} + memset(&cm_fakeSCache, 0, sizeof(cm_fakeSCache)); + lock_InitializeMutex(&cm_fakeSCache.mx, "cm_scache_t mutex"); + cm_fakeSCache.cbServerp = (struct cm_server *)(-1); + /* can leave clientModTime at 0 */ + cm_fakeSCache.fileType = CM_SCACHETYPE_FILE; + cm_fakeSCache.unixModeBits = 0777; + cm_fakeSCache.length.LowPart = 1000; + cm_fakeSCache.linkCount = 1; +} void cm_InitSCache(long maxSCaches) { - static osi_once_t once; + static osi_once_t once; - if (osi_Once(&once)) { - lock_InitializeRWLock(&cm_scacheLock, "cm_scacheLock"); - cm_hashTableSize = maxSCaches / 2; - cm_hashTablep = malloc(sizeof(cm_scache_t *) * cm_hashTableSize); - memset(cm_hashTablep, 0, sizeof(cm_scache_t *) * cm_hashTableSize); - cm_allFileLocks = NULL; - cm_currentSCaches = 0; - cm_maxSCaches = maxSCaches; - cm_fakeSCacheInit(); - cm_dnlcInit(); - osi_EndOnce(&once); - } + if (osi_Once(&once)) { + lock_InitializeRWLock(&cm_scacheLock, "cm_scacheLock"); + cm_hashTableSize = maxSCaches / 2; + cm_hashTablep = malloc(sizeof(cm_scache_t *) * cm_hashTableSize); + memset(cm_hashTablep, 0, sizeof(cm_scache_t *) * cm_hashTableSize); + cm_allFileLocks = NULL; + cm_currentSCaches = 0; + cm_maxSCaches = maxSCaches; + cm_fakeSCacheInit(); + cm_dnlcInit(); + osi_EndOnce(&once); + } } /* version that doesn't bother creating the entry if we don't find it */ cm_scache_t *cm_FindSCache(cm_fid_t *fidp) { - long hash; - cm_scache_t *scp; - - hash = CM_SCACHE_HASH(fidp); + long hash; + cm_scache_t *scp; + + hash = CM_SCACHE_HASH(fidp); - osi_assert(fidp->cell != 0); + osi_assert(fidp->cell != 0); - lock_ObtainWrite(&cm_scacheLock); - for(scp=cm_hashTablep[hash]; scp; scp=scp->nextp) { - if (cm_FidCmp(fidp, &scp->fid) == 0) { - scp->refCount++; - cm_AdjustLRU(scp); - lock_ReleaseWrite(&cm_scacheLock); - return scp; - } + lock_ObtainWrite(&cm_scacheLock); + for(scp=cm_hashTablep[hash]; scp; scp=scp->nextp) { + if (cm_FidCmp(fidp, &scp->fid) == 0) { + scp->refCount++; + cm_AdjustLRU(scp); + lock_ReleaseWrite(&cm_scacheLock); + return scp; } - lock_ReleaseWrite(&cm_scacheLock); - return NULL; + } + lock_ReleaseWrite(&cm_scacheLock); + return NULL; } long cm_GetSCache(cm_fid_t *fidp, cm_scache_t **outScpp, cm_user_t *userp, - cm_req_t *reqp) + cm_req_t *reqp) { - long hash; + long hash; cm_scache_t *scp; long code; cm_volume_t *volp = 0; cm_cell_t *cellp; char* mp = 0; - int special; // yj: boolean variable to test if file is on root.afs - int isRoot; + int special; // yj: boolean variable to test if file is on root.afs + int isRoot; extern cm_fid_t cm_rootFid; hash = CM_SCACHE_HASH(fidp); - osi_assert(fidp->cell != 0); + osi_assert(fidp->cell != 0); if (fidp->cell== cm_rootFid.cell && fidp->volume==cm_rootFid.volume && @@ -269,92 +269,92 @@ long cm_GetSCache(cm_fid_t *fidp, cm_scache_t **outScpp, cm_user_t *userp, osi_Log0(afsd_logp,"cm_getSCache called with root cell/volume and vnode=0 and unique=0"); } - // yj: check if we have the scp, if so, we don't need - // to do anything else + // 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) { - if (cm_FidCmp(fidp, &scp->fid) == 0) { - scp->refCount++; + for(scp=cm_hashTablep[hash]; scp; scp=scp->nextp) { + if (cm_FidCmp(fidp, &scp->fid) == 0) { + scp->refCount++; *outScpp = scp; cm_AdjustLRU(scp); lock_ReleaseWrite(&cm_scacheLock); - return 0; + return 0; } } - // yj: when we get here, it means we don't have an scp - // so we need to either load it or fake it, depending - // on whether the file is "special", see below. - - // yj: if we're trying to get an scp for a file that's - // on root.afs of homecell, we want to handle it specially - // because we have to fill in the status stuff 'coz we - // don't want trybulkstat to fill it in for us + // yj: when we get here, it means we don't have an scp + // so we need to either load it or fake it, depending + // on whether the file is "special", see below. + + // yj: if we're trying to get an scp for a file that's + // on root.afs of homecell, we want to handle it specially + // because we have to fill in the status stuff 'coz we + // don't want trybulkstat to fill it in for us #ifdef AFS_FREELANCE_CLIENT - special = (fidp->cell==AFS_FAKE_ROOT_CELL_ID && + special = (fidp->cell==AFS_FAKE_ROOT_CELL_ID && fidp->volume==AFS_FAKE_ROOT_VOL_ID && - !(fidp->vnode==0x1 && fidp->unique==0x1)); - isRoot = (fidp->cell==AFS_FAKE_ROOT_CELL_ID && + !(fidp->vnode==0x1 && fidp->unique==0x1)); + isRoot = (fidp->cell==AFS_FAKE_ROOT_CELL_ID && fidp->volume==AFS_FAKE_ROOT_VOL_ID && - fidp->vnode==0x1 && fidp->unique==0x1); - if (cm_freelanceEnabled && isRoot) { - osi_Log0(afsd_logp,"cm_getSCache Freelance and isRoot"); - /* freelance: if we are trying to get the root scp for the first + fidp->vnode==0x1 && fidp->unique==0x1); + if (cm_freelanceEnabled && isRoot) { + osi_Log0(afsd_logp,"cm_getSCache Freelance and isRoot"); + /* freelance: if we are trying to get the root scp for the first * time, we will just put in a place holder entry. */ - volp = NULL; - } + volp = NULL; + } - if (cm_freelanceEnabled && special) { - osi_Log0(afsd_logp,"cm_getSCache Freelance and special"); + if (cm_freelanceEnabled && special) { + osi_Log0(afsd_logp,"cm_getSCache Freelance and special"); if (fidp->vnode > 1) { lock_ObtainMutex(&cm_Freelance_Lock); - mp =(cm_localMountPoints+fidp->vnode-2)->mountPointStringp; - lock_ReleaseMutex(&cm_Freelance_Lock); + mp =(cm_localMountPoints+fidp->vnode-2)->mountPointStringp; + lock_ReleaseMutex(&cm_Freelance_Lock); } else { mp = ""; } - scp = cm_GetNewSCache(); + scp = cm_GetNewSCache(); - scp->fid = *fidp; - scp->volp = cm_rootSCachep->volp; - if (scp->dotdotFidp == (cm_fid_t *) NULL) - scp->dotdotFidp = (cm_fid_t *) malloc (sizeof(cm_fid_t)); - scp->dotdotFidp->cell=AFS_FAKE_ROOT_CELL_ID; - scp->dotdotFidp->volume=AFS_FAKE_ROOT_VOL_ID; - scp->dotdotFidp->unique=1; - scp->dotdotFidp->vnode=1; - scp->flags |= (CM_SCACHEFLAG_PURERO | CM_SCACHEFLAG_RO); - scp->nextp=cm_hashTablep[hash]; - cm_hashTablep[hash]=scp; - scp->flags |= CM_SCACHEFLAG_INHASH; - scp->refCount = 1; - scp->fileType = CM_SCACHETYPE_MOUNTPOINT; - - lock_ObtainMutex(&cm_Freelance_Lock); - scp->length.LowPart = strlen(mp)+4; - scp->mountPointStringp=malloc(strlen(mp)+1); - strcpy(scp->mountPointStringp,mp); - lock_ReleaseMutex(&cm_Freelance_Lock); - - scp->owner=0x0; - scp->unixModeBits=0x1ff; - scp->clientModTime=FakeFreelanceModTime; - scp->serverModTime=FakeFreelanceModTime; - scp->parentUnique = 0x1; - scp->parentVnode=0x1; - scp->group=0; - scp->dataVersion=0x8; - *outScpp = scp; - lock_ReleaseWrite(&cm_scacheLock); - /*afsi_log(" getscache done");*/ - return 0; - } - // end of yj code + scp->fid = *fidp; + scp->volp = cm_rootSCachep->volp; + if (scp->dotdotFidp == (cm_fid_t *) NULL) + scp->dotdotFidp = (cm_fid_t *) malloc (sizeof(cm_fid_t)); + scp->dotdotFidp->cell=AFS_FAKE_ROOT_CELL_ID; + scp->dotdotFidp->volume=AFS_FAKE_ROOT_VOL_ID; + scp->dotdotFidp->unique=1; + scp->dotdotFidp->vnode=1; + scp->flags |= (CM_SCACHEFLAG_PURERO | CM_SCACHEFLAG_RO); + scp->nextp=cm_hashTablep[hash]; + cm_hashTablep[hash]=scp; + scp->flags |= CM_SCACHEFLAG_INHASH; + scp->refCount = 1; + scp->fileType = (cm_localMountPoints+fidp->vnode-2)->fileType; + + lock_ObtainMutex(&cm_Freelance_Lock); + scp->length.LowPart = strlen(mp)+4; + scp->mountPointStringp=malloc(strlen(mp)+1); + strcpy(scp->mountPointStringp,mp); + lock_ReleaseMutex(&cm_Freelance_Lock); + + scp->owner=0x0; + scp->unixModeBits=0x1ff; + scp->clientModTime=FakeFreelanceModTime; + scp->serverModTime=FakeFreelanceModTime; + scp->parentUnique = 0x1; + scp->parentVnode=0x1; + scp->group=0; + scp->dataVersion=0x8; + *outScpp = scp; + lock_ReleaseWrite(&cm_scacheLock); + /*afsi_log(" getscache done");*/ + return 0; + } + // end of yj code #endif /* AFS_FREELANCE_CLIENT */ /* otherwise, we need to find the volume */ - if (!cm_freelanceEnabled || !isRoot) { + if (!cm_freelanceEnabled || !isRoot) { lock_ReleaseWrite(&cm_scacheLock); /* for perf. reasons */ cellp = cm_FindCellByID(fidp->cell); if (!cellp) @@ -364,56 +364,56 @@ long cm_GetSCache(cm_fid_t *fidp, cm_scache_t **outScpp, cm_user_t *userp, if (code) return code; lock_ObtainWrite(&cm_scacheLock); - } + } - /* otherwise, we have the volume, now reverify that the scp doesn't - * exist, and proceed. - */ - for(scp=cm_hashTablep[hash]; scp; scp=scp->nextp) { - if (cm_FidCmp(fidp, &scp->fid) == 0) { - scp->refCount++; + /* otherwise, we have the volume, now reverify that the scp doesn't + * exist, and proceed. + */ + for(scp=cm_hashTablep[hash]; scp; scp=scp->nextp) { + if (cm_FidCmp(fidp, &scp->fid) == 0) { + scp->refCount++; cm_AdjustLRU(scp); lock_ReleaseWrite(&cm_scacheLock); if (volp) - cm_PutVolume(volp); + cm_PutVolume(volp); *outScpp = scp; - return 0; + return 0; } } /* now, if we don't have the fid, recycle something */ - scp = cm_GetNewSCache(); - osi_assert(!(scp->flags & CM_SCACHEFLAG_INHASH)); - scp->fid = *fidp; - scp->volp = volp; /* a held reference */ - - if (!cm_freelanceEnabled || !isRoot) { - /* if this scache entry represents a volume root then we need - * to copy the dotdotFipd from the volume structure where the - * "master" copy is stored (defect 11489) - */ - if(scp->fid.vnode == 1 && scp->fid.unique == 1 && volp->dotdotFidp) { + scp = cm_GetNewSCache(); + osi_assert(!(scp->flags & CM_SCACHEFLAG_INHASH)); + scp->fid = *fidp; + scp->volp = volp; /* a held reference */ + + if (!cm_freelanceEnabled || !isRoot) { + /* if this scache entry represents a volume root then we need + * to copy the dotdotFipd from the volume structure where the + * "master" copy is stored (defect 11489) + */ + if (scp->fid.vnode == 1 && scp->fid.unique == 1 && volp->dotdotFidp) { if (scp->dotdotFidp == (cm_fid_t *) NULL) - scp->dotdotFidp = (cm_fid_t *) malloc(sizeof(cm_fid_t)); + scp->dotdotFidp = (cm_fid_t *) malloc(sizeof(cm_fid_t)); *(scp->dotdotFidp) = *volp->dotdotFidp; - } + } - if (volp->roID == fidp->volume) + if (volp->roID == fidp->volume) scp->flags |= (CM_SCACHEFLAG_PURERO | CM_SCACHEFLAG_RO); - else if (volp->bkID == fidp->volume) + else if (volp->bkID == fidp->volume) scp->flags |= CM_SCACHEFLAG_RO; - } - scp->nextp = cm_hashTablep[hash]; - cm_hashTablep[hash] = scp; + } + scp->nextp = cm_hashTablep[hash]; + cm_hashTablep[hash] = scp; scp->flags |= CM_SCACHEFLAG_INHASH; - scp->refCount = 1; - - /* XXX - The following fields in the cm_scache are - * uninitialized: - * fileType - * parentVnode - * parentUnique - */ + scp->refCount = 1; + + /* XXX - The following fields in the cm_scache are + * uninitialized: + * fileType + * parentVnode + * parentUnique + */ lock_ReleaseWrite(&cm_scacheLock); /* now we have a held scache entry; just return it */ @@ -477,278 +477,278 @@ long cm_GetSCache(cm_fid_t *fidp, cm_scache_t **outScpp, cm_user_t *userp, * CM_SCACHESYNC_STOREDATA_EXCL and CM_SCACHEFLAG_DATASTORING. */ long cm_SyncOp(cm_scache_t *scp, cm_buf_t *bufp, cm_user_t *up, cm_req_t *reqp, - long rights, long flags) + long rights, long flags) { - osi_queueData_t *qdp; - long code; - cm_buf_t *tbufp; - long outRights; - int bufLocked; - - /* lookup this first */ - bufLocked = flags & CM_SCACHESYNC_BUFLOCKED; - - /* some minor assertions */ - if (flags & (CM_SCACHESYNC_STOREDATA | CM_SCACHESYNC_FETCHDATA - | CM_SCACHESYNC_READ | CM_SCACHESYNC_WRITE - | CM_SCACHESYNC_SETSIZE)) { - if (bufp) { - osi_assert(bufp->refCount > 0); - /* - osi_assert(cm_FidCmp(&bufp->fid, &scp->fid) == 0); - */ - } - } - else osi_assert(bufp == NULL); - - /* Do the access check. Now we don't really do the access check - * atomically, since the caller doesn't expect the parent dir to be - * returned locked, and that is what we'd have to do to prevent a - * callback breaking message on the parent due to a setacl call from - * being processed while we're running. So, instead, we check things - * here, and if things look fine with the access, we proceed to finish - * the rest of this check. Sort of a hack, but probably good enough. - */ + osi_queueData_t *qdp; + long code; + cm_buf_t *tbufp; + long outRights; + int bufLocked; + + /* lookup this first */ + bufLocked = flags & CM_SCACHESYNC_BUFLOCKED; + + /* some minor assertions */ + if (flags & (CM_SCACHESYNC_STOREDATA | CM_SCACHESYNC_FETCHDATA + | CM_SCACHESYNC_READ | CM_SCACHESYNC_WRITE + | CM_SCACHESYNC_SETSIZE)) { + if (bufp) { + osi_assert(bufp->refCount > 0); + /* + osi_assert(cm_FidCmp(&bufp->fid, &scp->fid) == 0); + */ + } + } + else osi_assert(bufp == NULL); + + /* Do the access check. Now we don't really do the access check + * atomically, since the caller doesn't expect the parent dir to be + * returned locked, and that is what we'd have to do to prevent a + * callback breaking message on the parent due to a setacl call from + * being processed while we're running. So, instead, we check things + * here, and if things look fine with the access, we proceed to finish + * the rest of this check. Sort of a hack, but probably good enough. + */ + + while (1) { + if (flags & CM_SCACHESYNC_FETCHSTATUS) { + /* if we're bringing in a new status block, ensure that + * we aren't already doing so, and that no one is + * changing the status concurrently, either. We need + * to do this, even if the status is of a different + * type, since we don't have the ability to figure out, + * in the AFS 3 protocols, which status-changing + * operation ran first, or even which order a read and + * a write occurred in. + */ + if (scp->flags & (CM_SCACHEFLAG_FETCHING | CM_SCACHEFLAG_STORING + | CM_SCACHEFLAG_SIZESTORING | CM_SCACHEFLAG_GETCALLBACK)) + goto sleep; + } + if (flags & (CM_SCACHESYNC_STORESIZE | CM_SCACHESYNC_STORESTATUS + | CM_SCACHESYNC_SETSIZE | CM_SCACHESYNC_GETCALLBACK)) { + /* if we're going to make an RPC to change the status, make sure + * that no one is bringing in or sending out the status. + */ + if (scp->flags & (CM_SCACHEFLAG_FETCHING | CM_SCACHEFLAG_STORING + | CM_SCACHEFLAG_SIZESTORING | CM_SCACHEFLAG_GETCALLBACK)) + goto sleep; + if (scp->bufReadsp || scp->bufWritesp) goto sleep; + } + if (flags & CM_SCACHESYNC_FETCHDATA) { + /* if we're bringing in a new chunk of data, make sure that + * nothing is happening to that chunk, and that we aren't + * changing the basic file status info, either. + */ + if (scp->flags & (CM_SCACHEFLAG_FETCHING | CM_SCACHEFLAG_STORING + | CM_SCACHEFLAG_SIZESTORING | CM_SCACHEFLAG_GETCALLBACK)) + goto sleep; + if (bufp && (bufp->cmFlags & (CM_BUF_CMFETCHING | CM_BUF_CMSTORING))) + goto sleep; + } + if (flags & CM_SCACHESYNC_STOREDATA) { + /* same as fetch data */ + if (scp->flags & (CM_SCACHEFLAG_FETCHING | CM_SCACHEFLAG_STORING + | CM_SCACHEFLAG_SIZESTORING | CM_SCACHEFLAG_GETCALLBACK)) + goto sleep; + if (bufp && (bufp->cmFlags & (CM_BUF_CMFETCHING | CM_BUF_CMSTORING))) + goto sleep; + } - while (1) { - if (flags & CM_SCACHESYNC_FETCHSTATUS) { - /* if we're bringing in a new status block, ensure that - * we aren't already doing so, and that no one is - * changing the status concurrently, either. We need - * to do this, even if the status is of a different - * type, since we don't have the ability to figure out, - * in the AFS 3 protocols, which status-changing - * operation ran first, or even which order a read and - * a write occurred in. - */ - if (scp->flags & (CM_SCACHEFLAG_FETCHING | CM_SCACHEFLAG_STORING - | CM_SCACHEFLAG_SIZESTORING | CM_SCACHEFLAG_GETCALLBACK)) - goto sleep; - } - if (flags & (CM_SCACHESYNC_STORESIZE | CM_SCACHESYNC_STORESTATUS - | CM_SCACHESYNC_SETSIZE | CM_SCACHESYNC_GETCALLBACK)) { - /* if we're going to make an RPC to change the status, make sure - * that no one is bringing in or sending out the status. - */ - if (scp->flags & (CM_SCACHEFLAG_FETCHING | CM_SCACHEFLAG_STORING - | CM_SCACHEFLAG_SIZESTORING | CM_SCACHEFLAG_GETCALLBACK)) - goto sleep; - if (scp->bufReadsp || scp->bufWritesp) goto sleep; - } - if (flags & CM_SCACHESYNC_FETCHDATA) { - /* if we're bringing in a new chunk of data, make sure that - * nothing is happening to that chunk, and that we aren't - * changing the basic file status info, either. - */ - if (scp->flags & (CM_SCACHEFLAG_FETCHING | CM_SCACHEFLAG_STORING - | CM_SCACHEFLAG_SIZESTORING | CM_SCACHEFLAG_GETCALLBACK)) - goto sleep; - if (bufp && (bufp->cmFlags & (CM_BUF_CMFETCHING | CM_BUF_CMSTORING))) - goto sleep; - } - if (flags & CM_SCACHESYNC_STOREDATA) { - /* same as fetch data */ - if (scp->flags & (CM_SCACHEFLAG_FETCHING | CM_SCACHEFLAG_STORING - | CM_SCACHEFLAG_SIZESTORING | CM_SCACHEFLAG_GETCALLBACK)) - goto sleep; - if (bufp && (bufp->cmFlags & (CM_BUF_CMFETCHING | CM_BUF_CMSTORING))) - goto sleep; - } + if (flags & CM_SCACHESYNC_STOREDATA_EXCL) { + /* Don't allow concurrent StoreData RPC's */ + if (scp->flags & CM_SCACHEFLAG_DATASTORING) + goto sleep; + } - if (flags & CM_SCACHESYNC_STOREDATA_EXCL) { - /* Don't allow concurrent StoreData RPC's */ - if (scp->flags & CM_SCACHEFLAG_DATASTORING) - goto sleep; - } - - if (flags & CM_SCACHESYNC_ASYNCSTORE) { - /* Don't allow more than one BKG store request */ - if (scp->flags & CM_SCACHEFLAG_ASYNCSTORING) - goto sleep; - } - - if (flags & CM_SCACHESYNC_LOCK) { - /* Don't allow concurrent fiddling with lock lists */ - if (scp->flags & CM_SCACHEFLAG_LOCKING) - goto sleep; - } - - /* now the operations that don't correspond to making RPCs */ - if (flags & CM_SCACHESYNC_GETSTATUS) { - /* we can use the status that's here, if we're not - * bringing in new status. - */ - if (scp->flags & (CM_SCACHEFLAG_FETCHING)) - goto sleep; - } - if (flags & CM_SCACHESYNC_SETSTATUS) { - /* we can make a change to the local status, as long as - * the status isn't changing now. - * - * If we're fetching or storing a chunk of data, we can - * change the status locally, since the fetch/store - * operations don't change any of the data that we're - * changing here. - */ - if (scp->flags & (CM_SCACHEFLAG_FETCHING | CM_SCACHEFLAG_STORING - | CM_SCACHEFLAG_SIZESTORING)) - goto sleep; - } - if (flags & CM_SCACHESYNC_READ) { - /* we're going to read the data, make sure that the - * status is available, and that the data is here. It - * is OK to read while storing the data back. - */ - if (scp->flags & CM_SCACHEFLAG_FETCHING) - goto sleep; - if (bufp && ((bufp->cmFlags - & (CM_BUF_CMFETCHING - | CM_BUF_CMFULLYFETCHED)) - == CM_BUF_CMFETCHING)) - goto sleep; - } - if (flags & CM_SCACHESYNC_WRITE) { - /* don't write unless the status is stable and the chunk - * is stable. - */ - if (scp->flags & (CM_SCACHEFLAG_FETCHING | CM_SCACHEFLAG_STORING - | CM_SCACHEFLAG_SIZESTORING)) - goto sleep; - if (bufp && (bufp->cmFlags & (CM_BUF_CMFETCHING | CM_BUF_CMSTORING))) - goto sleep; - } + if (flags & CM_SCACHESYNC_ASYNCSTORE) { + /* Don't allow more than one BKG store request */ + if (scp->flags & CM_SCACHEFLAG_ASYNCSTORING) + goto sleep; + } + + if (flags & CM_SCACHESYNC_LOCK) { + /* Don't allow concurrent fiddling with lock lists */ + if (scp->flags & CM_SCACHEFLAG_LOCKING) + goto sleep; + } - // yj: modified this so that callback only checked if we're - // not checking something on /afs + /* now the operations that don't correspond to making RPCs */ + if (flags & CM_SCACHESYNC_GETSTATUS) { + /* we can use the status that's here, if we're not + * bringing in new status. + */ + if (scp->flags & (CM_SCACHEFLAG_FETCHING)) + goto sleep; + } + if (flags & CM_SCACHESYNC_SETSTATUS) { + /* we can make a change to the local status, as long as + * the status isn't changing now. + * + * If we're fetching or storing a chunk of data, we can + * change the status locally, since the fetch/store + * operations don't change any of the data that we're + * changing here. + */ + if (scp->flags & (CM_SCACHEFLAG_FETCHING | CM_SCACHEFLAG_STORING + | CM_SCACHEFLAG_SIZESTORING)) + goto sleep; + } + if (flags & CM_SCACHESYNC_READ) { + /* we're going to read the data, make sure that the + * status is available, and that the data is here. It + * is OK to read while storing the data back. + */ + if (scp->flags & CM_SCACHEFLAG_FETCHING) + goto sleep; + if (bufp && ((bufp->cmFlags + & (CM_BUF_CMFETCHING + | CM_BUF_CMFULLYFETCHED)) + == CM_BUF_CMFETCHING)) + goto sleep; + } + if (flags & CM_SCACHESYNC_WRITE) { + /* don't write unless the status is stable and the chunk + * is stable. + */ + if (scp->flags & (CM_SCACHEFLAG_FETCHING | CM_SCACHEFLAG_STORING + | CM_SCACHEFLAG_SIZESTORING)) + goto sleep; + if (bufp && (bufp->cmFlags & (CM_BUF_CMFETCHING | CM_BUF_CMSTORING))) + goto sleep; + } + + // yj: modified this so that callback only checked if we're + // not checking something on /afs /* fix the conditional to match the one in cm_HaveCallback */ - if ( (flags & CM_SCACHESYNC_NEEDCALLBACK) + if ( (flags & CM_SCACHESYNC_NEEDCALLBACK) #ifdef AFS_FREELANCE_CLIENT && (!cm_freelanceEnabled || !(scp->fid.vnode==0x1 && scp->fid.unique==0x1) || scp->fid.cell!=AFS_FAKE_ROOT_CELL_ID || scp->fid.volume!=AFS_FAKE_ROOT_VOL_ID || - cm_fakeDirCallback < 2) + cm_fakeDirCallback < 2) #endif /* AFS_FREELANCE_CLIENT */ - ) { - if (!cm_HaveCallback(scp)) { - osi_Log1(afsd_logp, "CM SyncOp getting callback on scp %x", - (long) scp); - if (bufLocked) lock_ReleaseMutex(&bufp->mx); - code = cm_GetCallback(scp, up, reqp, 0); - if (bufLocked) { - lock_ReleaseMutex(&scp->mx); - lock_ObtainMutex(&bufp->mx); - lock_ObtainMutex(&scp->mx); - } - if (code) return code; - continue; - } + ) { + if (!cm_HaveCallback(scp)) { + osi_Log1(afsd_logp, "CM SyncOp getting callback on scp %x", + (long) scp); + if (bufLocked) lock_ReleaseMutex(&bufp->mx); + code = cm_GetCallback(scp, up, reqp, 0); + if (bufLocked) { + lock_ReleaseMutex(&scp->mx); + lock_ObtainMutex(&bufp->mx); + lock_ObtainMutex(&scp->mx); } - - if (rights) { - /* can't check access rights without a callback */ - osi_assert(flags & CM_SCACHESYNC_NEEDCALLBACK); - - if ((rights & PRSFS_WRITE) && (scp->flags & CM_SCACHEFLAG_RO)) - return CM_ERROR_READONLY; - - if (cm_HaveAccessRights(scp, up, rights, &outRights)) { - if (~outRights & rights) return CM_ERROR_NOACCESS; - } - else { - /* we don't know the required access rights */ - if (bufLocked) lock_ReleaseMutex(&bufp->mx); - code = cm_GetAccessRights(scp, up, reqp); - if (code) return code; - if (bufLocked) { - lock_ReleaseMutex(&scp->mx); - lock_ObtainMutex(&bufp->mx); - lock_ObtainMutex(&scp->mx); - } - continue; - } + if (code) return code; + continue; + } + } + + if (rights) { + /* can't check access rights without a callback */ + osi_assert(flags & CM_SCACHESYNC_NEEDCALLBACK); + + if ((rights & PRSFS_WRITE) && (scp->flags & CM_SCACHEFLAG_RO)) + return CM_ERROR_READONLY; + + if (cm_HaveAccessRights(scp, up, rights, &outRights)) { + if (~outRights & rights) return CM_ERROR_NOACCESS; + } + else { + /* we don't know the required access rights */ + if (bufLocked) lock_ReleaseMutex(&bufp->mx); + code = cm_GetAccessRights(scp, up, reqp); + if (code) return code; + if (bufLocked) { + lock_ReleaseMutex(&scp->mx); + lock_ObtainMutex(&bufp->mx); + lock_ObtainMutex(&scp->mx); } + continue; + } + } - /* if we get here, we're happy */ - break; + /* if we get here, we're happy */ + break; -sleep: - /* first check if we're not supposed to wait: fail - * in this case, returning with everything still locked. - */ - if (flags & CM_SCACHESYNC_NOWAIT) return CM_ERROR_WOULDBLOCK; + sleep: + /* first check if we're not supposed to wait: fail + * in this case, returning with everything still locked. + */ + if (flags & CM_SCACHESYNC_NOWAIT) return CM_ERROR_WOULDBLOCK; - /* wait here, then try again */ - osi_Log1(afsd_logp, "CM SyncOp sleeping scp %x", (long) scp); + /* wait here, then try again */ + osi_Log1(afsd_logp, "CM SyncOp sleeping scp %x", (long) scp); if ( scp->flags & CM_SCACHEFLAG_WAITING ) osi_Log1(afsd_logp, "CM SyncOp CM_SCACHEFLAG_WAITING already set for 0x%x", scp); else osi_Log1(afsd_logp, "CM SyncOp CM_SCACHEFLAG_WAITING set for 0x%x", scp); - scp->flags |= CM_SCACHEFLAG_WAITING; - if (bufLocked) lock_ReleaseMutex(&bufp->mx); + scp->flags |= CM_SCACHEFLAG_WAITING; + if (bufLocked) lock_ReleaseMutex(&bufp->mx); osi_SleepM((long) &scp->flags, &scp->mx); osi_Log0(afsd_logp, "CM SyncOp woke!"); if (bufLocked) lock_ObtainMutex(&bufp->mx); lock_ObtainMutex(&scp->mx); - } /* big while loop */ + } /* big while loop */ - /* now, update the recorded state for RPC-type calls */ - if (flags & CM_SCACHESYNC_FETCHSTATUS) - scp->flags |= CM_SCACHEFLAG_FETCHING; - if (flags & CM_SCACHESYNC_STORESTATUS) - scp->flags |= CM_SCACHEFLAG_STORING; - if (flags & CM_SCACHESYNC_STORESIZE) - scp->flags |= CM_SCACHEFLAG_SIZESTORING; - if (flags & CM_SCACHESYNC_GETCALLBACK) - scp->flags |= CM_SCACHEFLAG_GETCALLBACK; - if (flags & CM_SCACHESYNC_STOREDATA_EXCL) - scp->flags |= CM_SCACHEFLAG_DATASTORING; - if (flags & CM_SCACHESYNC_ASYNCSTORE) - scp->flags |= CM_SCACHEFLAG_ASYNCSTORING; - if (flags & CM_SCACHESYNC_LOCK) - scp->flags |= CM_SCACHEFLAG_LOCKING; - - /* now update the buffer pointer */ - if (flags & CM_SCACHESYNC_FETCHDATA) { - /* ensure that the buffer isn't already in the I/O list */ - if (bufp) { - for(qdp = scp->bufReadsp; qdp; qdp = (osi_queueData_t *) osi_QNext(&qdp->q)) { - tbufp = osi_GetQData(qdp); - osi_assert(tbufp != bufp); - } - } - - /* queue a held reference to the buffer in the "reading" I/O list */ - qdp = osi_QDAlloc(); - osi_SetQData(qdp, bufp); - if (bufp) { - buf_Hold(bufp); - bufp->cmFlags |= CM_BUF_CMFETCHING; - } - osi_QAdd((osi_queue_t **) &scp->bufReadsp, &qdp->q); + /* now, update the recorded state for RPC-type calls */ + if (flags & CM_SCACHESYNC_FETCHSTATUS) + scp->flags |= CM_SCACHEFLAG_FETCHING; + if (flags & CM_SCACHESYNC_STORESTATUS) + scp->flags |= CM_SCACHEFLAG_STORING; + if (flags & CM_SCACHESYNC_STORESIZE) + scp->flags |= CM_SCACHEFLAG_SIZESTORING; + if (flags & CM_SCACHESYNC_GETCALLBACK) + scp->flags |= CM_SCACHEFLAG_GETCALLBACK; + if (flags & CM_SCACHESYNC_STOREDATA_EXCL) + scp->flags |= CM_SCACHEFLAG_DATASTORING; + if (flags & CM_SCACHESYNC_ASYNCSTORE) + scp->flags |= CM_SCACHEFLAG_ASYNCSTORING; + if (flags & CM_SCACHESYNC_LOCK) + scp->flags |= CM_SCACHEFLAG_LOCKING; + + /* now update the buffer pointer */ + if (flags & CM_SCACHESYNC_FETCHDATA) { + /* ensure that the buffer isn't already in the I/O list */ + if (bufp) { + for(qdp = scp->bufReadsp; qdp; qdp = (osi_queueData_t *) osi_QNext(&qdp->q)) { + tbufp = osi_GetQData(qdp); + osi_assert(tbufp != bufp); + } } - if (flags & CM_SCACHESYNC_STOREDATA) { - /* ensure that the buffer isn't already in the I/O list */ - if (bufp) { - for(qdp = scp->bufWritesp; qdp; qdp = (osi_queueData_t *) osi_QNext(&qdp->q)) { - tbufp = osi_GetQData(qdp); - osi_assert(tbufp != bufp); - } - } - - /* queue a held reference to the buffer in the "writing" I/O list */ - qdp = osi_QDAlloc(); - osi_SetQData(qdp, bufp); - if (bufp) { - buf_Hold(bufp); - bufp->cmFlags |= CM_BUF_CMSTORING; - } - osi_QAdd((osi_queue_t **) &scp->bufWritesp, &qdp->q); + /* queue a held reference to the buffer in the "reading" I/O list */ + qdp = osi_QDAlloc(); + osi_SetQData(qdp, bufp); + if (bufp) { + buf_Hold(bufp); + bufp->cmFlags |= CM_BUF_CMFETCHING; } - - return 0; + osi_QAdd((osi_queue_t **) &scp->bufReadsp, &qdp->q); + } + + if (flags & CM_SCACHESYNC_STOREDATA) { + /* ensure that the buffer isn't already in the I/O list */ + if (bufp) { + for(qdp = scp->bufWritesp; qdp; qdp = (osi_queueData_t *) osi_QNext(&qdp->q)) { + tbufp = osi_GetQData(qdp); + osi_assert(tbufp != bufp); + } + } + + /* queue a held reference to the buffer in the "writing" I/O list */ + qdp = osi_QDAlloc(); + osi_SetQData(qdp, bufp); + if (bufp) { + buf_Hold(bufp); + bufp->cmFlags |= CM_BUF_CMSTORING; + } + osi_QAdd((osi_queue_t **) &scp->bufWritesp, &qdp->q); + } + + return 0; } /* for those syncops that setup for RPCs. @@ -756,67 +756,67 @@ sleep: */ void cm_SyncOpDone(cm_scache_t *scp, cm_buf_t *bufp, long flags) { - osi_queueData_t *qdp; - cm_buf_t *tbufp; - - /* now, update the recorded state for RPC-type calls */ - if (flags & CM_SCACHESYNC_FETCHSTATUS) - scp->flags &= ~CM_SCACHEFLAG_FETCHING; - if (flags & CM_SCACHESYNC_STORESTATUS) - scp->flags &= ~CM_SCACHEFLAG_STORING; - if (flags & CM_SCACHESYNC_STORESIZE) - scp->flags &= ~CM_SCACHEFLAG_SIZESTORING; - if (flags & CM_SCACHESYNC_GETCALLBACK) - scp->flags &= ~CM_SCACHEFLAG_GETCALLBACK; - if (flags & CM_SCACHESYNC_STOREDATA_EXCL) - scp->flags &= ~CM_SCACHEFLAG_DATASTORING; - if (flags & CM_SCACHESYNC_ASYNCSTORE) - scp->flags &= ~CM_SCACHEFLAG_ASYNCSTORING; - if (flags & CM_SCACHESYNC_LOCK) - scp->flags &= ~CM_SCACHEFLAG_LOCKING; - - /* now update the buffer pointer */ - if (flags & CM_SCACHESYNC_FETCHDATA) { - /* ensure that the buffer isn't already in the I/O list */ - for(qdp = scp->bufReadsp; qdp; qdp = (osi_queueData_t *) osi_QNext(&qdp->q)) { - tbufp = osi_GetQData(qdp); - if (tbufp == bufp) break; - } - osi_assert(qdp != NULL); - osi_assert(osi_GetQData(qdp) == bufp); - osi_QRemove((osi_queue_t **) &scp->bufReadsp, &qdp->q); - osi_QDFree(qdp); - if (bufp) { - bufp->cmFlags &= - ~(CM_BUF_CMFETCHING | CM_BUF_CMFULLYFETCHED); - buf_Release(bufp); - } + osi_queueData_t *qdp; + cm_buf_t *tbufp; + + /* now, update the recorded state for RPC-type calls */ + if (flags & CM_SCACHESYNC_FETCHSTATUS) + scp->flags &= ~CM_SCACHEFLAG_FETCHING; + if (flags & CM_SCACHESYNC_STORESTATUS) + scp->flags &= ~CM_SCACHEFLAG_STORING; + if (flags & CM_SCACHESYNC_STORESIZE) + scp->flags &= ~CM_SCACHEFLAG_SIZESTORING; + if (flags & CM_SCACHESYNC_GETCALLBACK) + scp->flags &= ~CM_SCACHEFLAG_GETCALLBACK; + if (flags & CM_SCACHESYNC_STOREDATA_EXCL) + scp->flags &= ~CM_SCACHEFLAG_DATASTORING; + if (flags & CM_SCACHESYNC_ASYNCSTORE) + scp->flags &= ~CM_SCACHEFLAG_ASYNCSTORING; + if (flags & CM_SCACHESYNC_LOCK) + scp->flags &= ~CM_SCACHEFLAG_LOCKING; + + /* now update the buffer pointer */ + if (flags & CM_SCACHESYNC_FETCHDATA) { + /* ensure that the buffer isn't already in the I/O list */ + for(qdp = scp->bufReadsp; qdp; qdp = (osi_queueData_t *) osi_QNext(&qdp->q)) { + tbufp = osi_GetQData(qdp); + if (tbufp == bufp) break; + } + osi_assert(qdp != NULL); + osi_assert(osi_GetQData(qdp) == bufp); + osi_QRemove((osi_queue_t **) &scp->bufReadsp, &qdp->q); + osi_QDFree(qdp); + if (bufp) { + bufp->cmFlags &= + ~(CM_BUF_CMFETCHING | CM_BUF_CMFULLYFETCHED); + buf_Release(bufp); } + } - /* now update the buffer pointer */ - if (flags & CM_SCACHESYNC_STOREDATA) { - /* ensure that the buffer isn't already in the I/O list */ - for(qdp = scp->bufWritesp; qdp; qdp = (osi_queueData_t *) osi_QNext(&qdp->q)) { - tbufp = osi_GetQData(qdp); - if (tbufp == bufp) break; - } - osi_assert(qdp != NULL); - osi_assert(osi_GetQData(qdp) == bufp); - osi_QRemove((osi_queue_t **) &scp->bufWritesp, &qdp->q); - osi_QDFree(qdp); - if (bufp) { - bufp->cmFlags &= ~CM_BUF_CMSTORING; - buf_Release(bufp); - } + /* now update the buffer pointer */ + if (flags & CM_SCACHESYNC_STOREDATA) { + /* ensure that the buffer isn't already in the I/O list */ + for(qdp = scp->bufWritesp; qdp; qdp = (osi_queueData_t *) osi_QNext(&qdp->q)) { + tbufp = osi_GetQData(qdp); + if (tbufp == bufp) break; } - - /* and wakeup anyone who is waiting */ - if (scp->flags & CM_SCACHEFLAG_WAITING) { - osi_Log1(afsd_logp, "CM SyncOp CM_SCACHEFLAG_WAITING reset for 0x%x", scp); - scp->flags &= ~CM_SCACHEFLAG_WAITING; - osi_Wakeup((long) &scp->flags); + osi_assert(qdp != NULL); + osi_assert(osi_GetQData(qdp) == bufp); + osi_QRemove((osi_queue_t **) &scp->bufWritesp, &qdp->q); + osi_QDFree(qdp); + if (bufp) { + bufp->cmFlags &= ~CM_BUF_CMSTORING; + buf_Release(bufp); } -} + } + + /* and wakeup anyone who is waiting */ + if (scp->flags & CM_SCACHEFLAG_WAITING) { + osi_Log1(afsd_logp, "CM SyncOp CM_SCACHEFLAG_WAITING reset for 0x%x", scp); + scp->flags &= ~CM_SCACHEFLAG_WAITING; + osi_Wakeup((long) &scp->flags); + } +} /* merge in a response from an RPC. The scp must be locked, and the callback * is optional. @@ -832,123 +832,123 @@ void cm_SyncOpDone(cm_scache_t *scp, cm_buf_t *bufp, long flags) * started before that, can cause old info to be merged from the first call. */ void cm_MergeStatus(cm_scache_t *scp, AFSFetchStatus *statusp, AFSVolSync *volp, - cm_user_t *userp, int flags) + cm_user_t *userp, int flags) { - // yj: i want to create some fake status for the /afs directory and the - // entries under that directory + // yj: i want to create some fake status for the /afs directory and the + // entries under that directory #ifdef AFS_FREELANCE_CLIENT - if (cm_freelanceEnabled && scp == cm_rootSCachep) { - osi_Log0(afsd_logp,"cm_MergeStatus Freelance cm_rootSCachep"); - statusp->InterfaceVersion = 0x1; + if (cm_freelanceEnabled && scp == cm_rootSCachep) { + osi_Log0(afsd_logp,"cm_MergeStatus Freelance cm_rootSCachep"); + statusp->InterfaceVersion = 0x1; statusp->FileType = CM_SCACHETYPE_DIRECTORY; - statusp->LinkCount = scp->linkCount; - statusp->Length = cm_fakeDirSize; - statusp->DataVersion = cm_fakeDirVersion; - statusp->Author = 0x1; - statusp->Owner = 0x0; - statusp->CallerAccess = 0x9; - statusp->AnonymousAccess = 0x9; - statusp->UnixModeBits = 0x1ff; - statusp->ParentVnode = 0x1; - statusp->ParentUnique = 0x1; - statusp->ResidencyMask = 0; - statusp->ClientModTime = FakeFreelanceModTime; - statusp->ServerModTime = FakeFreelanceModTime; - statusp->Group = 0; - statusp->SyncCounter = 0; - statusp->dataVersionHigh = 0; - } + statusp->LinkCount = scp->linkCount; + statusp->Length = cm_fakeDirSize; + statusp->DataVersion = cm_fakeDirVersion; + statusp->Author = 0x1; + statusp->Owner = 0x0; + statusp->CallerAccess = 0x9; + statusp->AnonymousAccess = 0x9; + statusp->UnixModeBits = 0x1ff; + statusp->ParentVnode = 0x1; + statusp->ParentUnique = 0x1; + statusp->ResidencyMask = 0; + statusp->ClientModTime = FakeFreelanceModTime; + statusp->ServerModTime = FakeFreelanceModTime; + statusp->Group = 0; + statusp->SyncCounter = 0; + statusp->dataVersionHigh = 0; + } #endif /* AFS_FREELANCE_CLIENT */ - if (!(flags & CM_MERGEFLAG_FORCE) - && statusp->DataVersion < (unsigned long) scp->dataVersion) { - struct cm_cell *cellp; - struct cm_volume *volp; - - cellp = cm_FindCellByID(scp->fid.cell); - cm_GetVolumeByID(cellp, scp->fid.volume, userp, - (cm_req_t *) NULL, &volp); - if (scp->cbServerp) - osi_Log2(afsd_logp, "old data from server %x volume %s", - scp->cbServerp->addr.sin_addr.s_addr, - volp->namep); - osi_Log3(afsd_logp, "Bad merge, scp %x, scp dv %d, RPC dv %d", - scp, scp->dataVersion, statusp->DataVersion); - /* we have a number of data fetch/store operations running - * concurrently, and we can tell which one executed last at the - * server by its mtime. - * Choose the one with the largest mtime, and ignore the rest. - * - * These concurrent calls are incompatible with setting the - * mtime, so we won't have a locally changed mtime here. - * - * We could also have ACL info for a different user than usual, - * in which case we have to do that part of the merge, anyway. - * We won't have to worry about the info being old, since we - * won't have concurrent calls - * that change file status running from this machine. - * - * Added 3/17/98: if we see data version regression on an RO - * file, it's probably due to a server holding an out-of-date - * replica, rather than to concurrent RPC's. Failures to - * release replicas are now flagged by the volserver, but only - * since AFS 3.4 5.22, so there are plenty of clients getting - * out-of-date replicas out there. - * - * If we discover an out-of-date replica, by this time it's too - * late to go to another server and retry. Also, we can't - * reject the merge, because then there is no way for - * GetAccess to do its work, and the caller gets into an - * infinite loop. So we just grin and bear it. - */ - if (!(scp->flags & CM_SCACHEFLAG_RO)) - return; - } - scp->serverModTime = statusp->ServerModTime; - - if (!(scp->mask & CM_SCACHEMASK_CLIENTMODTIME)) { - scp->clientModTime = statusp->ClientModTime; - } - if (!(scp->mask & CM_SCACHEMASK_LENGTH)) { - scp->length.LowPart = statusp->Length; - scp->length.HighPart = 0; - } - - scp->serverLength.LowPart = statusp->Length; - scp->serverLength.HighPart = 0; - - scp->linkCount = statusp->LinkCount; - scp->dataVersion = statusp->DataVersion; - scp->owner = statusp->Owner; - scp->group = statusp->Group; - scp->unixModeBits = statusp->UnixModeBits & 07777; - - if (statusp->FileType == File) - scp->fileType = CM_SCACHETYPE_FILE; - else if (statusp->FileType == Directory) - scp->fileType = CM_SCACHETYPE_DIRECTORY; - else if (statusp->FileType == SymbolicLink) { - if ((scp->unixModeBits & 0111) == 0) - scp->fileType = CM_SCACHETYPE_MOUNTPOINT; - else - scp->fileType = CM_SCACHETYPE_SYMLINK; - } + if (!(flags & CM_MERGEFLAG_FORCE) + && statusp->DataVersion < (unsigned long) scp->dataVersion) { + struct cm_cell *cellp; + struct cm_volume *volp; + + cellp = cm_FindCellByID(scp->fid.cell); + cm_GetVolumeByID(cellp, scp->fid.volume, userp, + (cm_req_t *) NULL, &volp); + if (scp->cbServerp) + osi_Log2(afsd_logp, "old data from server %x volume %s", + scp->cbServerp->addr.sin_addr.s_addr, + volp->namep); + osi_Log3(afsd_logp, "Bad merge, scp %x, scp dv %d, RPC dv %d", + scp, scp->dataVersion, statusp->DataVersion); + /* we have a number of data fetch/store operations running + * concurrently, and we can tell which one executed last at the + * server by its mtime. + * Choose the one with the largest mtime, and ignore the rest. + * + * These concurrent calls are incompatible with setting the + * mtime, so we won't have a locally changed mtime here. + * + * We could also have ACL info for a different user than usual, + * in which case we have to do that part of the merge, anyway. + * We won't have to worry about the info being old, since we + * won't have concurrent calls + * that change file status running from this machine. + * + * Added 3/17/98: if we see data version regression on an RO + * file, it's probably due to a server holding an out-of-date + * replica, rather than to concurrent RPC's. Failures to + * release replicas are now flagged by the volserver, but only + * since AFS 3.4 5.22, so there are plenty of clients getting + * out-of-date replicas out there. + * + * If we discover an out-of-date replica, by this time it's too + * late to go to another server and retry. Also, we can't + * reject the merge, because then there is no way for + * GetAccess to do its work, and the caller gets into an + * infinite loop. So we just grin and bear it. + */ + if (!(scp->flags & CM_SCACHEFLAG_RO)) + return; + } + scp->serverModTime = statusp->ServerModTime; + + if (!(scp->mask & CM_SCACHEMASK_CLIENTMODTIME)) { + scp->clientModTime = statusp->ClientModTime; + } + if (!(scp->mask & CM_SCACHEMASK_LENGTH)) { + scp->length.LowPart = statusp->Length; + scp->length.HighPart = 0; + } + + scp->serverLength.LowPart = statusp->Length; + scp->serverLength.HighPart = 0; + + scp->linkCount = statusp->LinkCount; + scp->dataVersion = statusp->DataVersion; + scp->owner = statusp->Owner; + scp->group = statusp->Group; + scp->unixModeBits = statusp->UnixModeBits & 07777; + + if (statusp->FileType == File) + scp->fileType = CM_SCACHETYPE_FILE; + else if (statusp->FileType == Directory) + scp->fileType = CM_SCACHETYPE_DIRECTORY; + else if (statusp->FileType == SymbolicLink) { + if ((scp->unixModeBits & 0111) == 0) + scp->fileType = CM_SCACHETYPE_MOUNTPOINT; + else + scp->fileType = CM_SCACHETYPE_SYMLINK; + } else { osi_Log1(afsd_logp, "Merge, Invalid File Type, scp %x", scp); scp->fileType = 0; /* invalid */ } - /* and other stuff */ - scp->parentVnode = statusp->ParentVnode; - scp->parentUnique = statusp->ParentUnique; + /* and other stuff */ + scp->parentVnode = statusp->ParentVnode; + scp->parentUnique = statusp->ParentUnique; - /* and merge in the private acl cache info, if this is more than the public - * info; merge in the public stuff in any case. - */ - scp->anyAccess = statusp->AnonymousAccess; + /* and merge in the private acl cache info, if this is more than the public + * info; merge in the public stuff in any case. + */ + scp->anyAccess = statusp->AnonymousAccess; - if (userp != NULL) { - cm_AddACLCache(scp, userp, statusp->CallerAccess); - } + if (userp != NULL) { + cm_AddACLCache(scp, userp, statusp->CallerAccess); + } } /* note that our stat cache info is incorrect, so force us eventually @@ -961,60 +961,58 @@ void cm_MergeStatus(cm_scache_t *scp, AFSFetchStatus *statusp, AFSVolSync *volp, */ void cm_DiscardSCache(cm_scache_t *scp) { - lock_AssertMutex(&scp->mx); + lock_AssertMutex(&scp->mx); if (scp->cbServerp) { cm_PutServer(scp->cbServerp); scp->cbServerp = NULL; } - scp->cbExpires = 0; - cm_dnlcPurgedp(scp); - cm_FreeAllACLEnts(scp); + scp->cbExpires = 0; + cm_dnlcPurgedp(scp); + cm_FreeAllACLEnts(scp); } void cm_AFSFidFromFid(AFSFid *afsFidp, cm_fid_t *fidp) { - afsFidp->Volume = fidp->volume; - afsFidp->Vnode = fidp->vnode; - afsFidp->Unique = fidp->unique; -} + afsFidp->Volume = fidp->volume; + afsFidp->Vnode = fidp->vnode; + afsFidp->Unique = fidp->unique; +} void cm_HoldSCache(cm_scache_t *scp) { - lock_ObtainWrite(&cm_scacheLock); - osi_assert(scp->refCount > 0); - scp->refCount++; - lock_ReleaseWrite(&cm_scacheLock); + lock_ObtainWrite(&cm_scacheLock); + osi_assert(scp->refCount > 0); + scp->refCount++; + lock_ReleaseWrite(&cm_scacheLock); } void cm_ReleaseSCache(cm_scache_t *scp) { - lock_ObtainWrite(&cm_scacheLock); - osi_assert(scp->refCount-- > 0); - lock_ReleaseWrite(&cm_scacheLock); + lock_ObtainWrite(&cm_scacheLock); + osi_assert(scp->refCount-- > 0); + lock_ReleaseWrite(&cm_scacheLock); } /* just look for the scp entry to get filetype */ /* doesn't need to be perfectly accurate, so locking doesn't matter too much */ int cm_FindFileType(cm_fid_t *fidp) { - long hash; - cm_scache_t *scp; + long hash; + cm_scache_t *scp; - hash = CM_SCACHE_HASH(fidp); + hash = CM_SCACHE_HASH(fidp); - osi_assert(fidp->cell != 0); + osi_assert(fidp->cell != 0); - lock_ObtainWrite(&cm_scacheLock); - for(scp=cm_hashTablep[hash]; scp; scp=scp->nextp) { - if (cm_FidCmp(fidp, &scp->fid) == 0) { - /*scp->refCount++;*/ - /*cm_AdjustLRU(scp);*/ - lock_ReleaseWrite(&cm_scacheLock); - return scp->fileType; - } + lock_ObtainWrite(&cm_scacheLock); + for (scp=cm_hashTablep[hash]; scp; scp=scp->nextp) { + if (cm_FidCmp(fidp, &scp->fid) == 0) { + lock_ReleaseWrite(&cm_scacheLock); + return scp->fileType; } - lock_ReleaseWrite(&cm_scacheLock); - return 0; + } + lock_ReleaseWrite(&cm_scacheLock); + return 0; } /* dump all scp's that have reference count > 0 to a file. diff --git a/src/WINNT/afsd/cm_scache.h b/src/WINNT/afsd/cm_scache.h index 18b345033..3cf2bf33c 100644 --- a/src/WINNT/afsd/cm_scache.h +++ b/src/WINNT/afsd/cm_scache.h @@ -24,7 +24,7 @@ typedef struct cm_fid { typedef struct cm_accessCache { osi_queue_t q; /* queue header */ struct cm_user *userp; /* user having access rights */ - long rights; /* rights */ + unsigned long rights; /* rights */ } cm_accessCache_t; typedef struct cm_file_lock { @@ -50,7 +50,7 @@ typedef struct cm_scache { osi_queue_t q; /* lru queue; cm_scacheLock */ struct cm_scache *nextp; /* next in hash; cm_scacheLock */ cm_fid_t fid; - long flags; /* flags; locked by mx */ + unsigned long flags; /* flags; locked by mx */ /* synchronization stuff */ osi_mutex_t mx; /* mutex for this structure */ @@ -67,17 +67,17 @@ typedef struct cm_scache { long parentUnique; /* for ACL callbacks */ /* local modification stat */ - long mask; /* for clientModTime, length and + unsigned long mask; /* for clientModTime, length and * truncPos */ /* file status */ - int fileType; /* file type */ + unsigned int fileType; /* file type */ time_t clientModTime; /* mtime */ time_t serverModTime; /* at server, for concurrent call * comparisons */ osi_hyper_t length; /* file length */ cm_prefetch_t prefetch; /* prefetch info structure */ - int unixModeBits; /* unix protection mode bits */ + unsigned int unixModeBits; /* unix protection mode bits */ int linkCount; /* link count */ long dataVersion; /* data version */ long owner; /* file owner */ @@ -118,7 +118,7 @@ typedef struct cm_scache { osi_hyper_t bulkStatProgress; /* track bulk stats of large dirs */ /* open state */ - short openReads; /* opens for reading */ + short openReads; /* open for reading */ short openWrites; /* open for writing */ short openShares; /* open for read excl */ short openExcls; /* open for exclusives */ diff --git a/src/WINNT/afsd/cm_vnodeops.c b/src/WINNT/afsd/cm_vnodeops.c index 5397dcbdd..0455b40f7 100644 --- a/src/WINNT/afsd/cm_vnodeops.c +++ b/src/WINNT/afsd/cm_vnodeops.c @@ -427,6 +427,9 @@ long cm_CheckNTDelete(cm_scache_t *dscp, cm_scache_t *scp, cm_user_t *userp, * Iterate through all entries in a directory. * When the function funcp is called, the buffer is locked but the * directory vnode is not. + * + * If the retscp parameter is not NULL, the parmp must be a + * cm_lookupSearch_t object. */ long cm_ApplyDir(cm_scache_t *scp, cm_DirFuncp_t funcp, void *parmp, osi_hyper_t *startOffsetp, cm_user_t *userp, cm_req_t *reqp, @@ -465,17 +468,26 @@ long cm_ApplyDir(cm_scache_t *scp, cm_DirFuncp_t funcp, void *parmp, if (retscp) /* if this is a lookup call */ { cm_lookupSearch_t* sp = parmp; - int casefold = sp->caseFold; - - sp->caseFold = 0; /* we have a strong preference for exact matches */ - if ( *retscp = cm_dnlcLookup(scp, sp)) /* dnlc hit */ - { - sp->caseFold = casefold; - lock_ReleaseMutex(&scp->mx); - return 0; - } - sp->caseFold = casefold; +#ifdef AFS_FREELANCE_CLIENT + /* Freelance entries never end up in the DNLC because they + * do not have an associated cm_server_t + */ + if ( !(cm_freelanceEnabled && + sp->fid.cell==AFS_FAKE_ROOT_CELL_ID && + sp->fid.volume==AFS_FAKE_ROOT_VOL_ID ) ) +#endif /* AFS_FREELANCE_CLIENT */ + { + int casefold = sp->caseFold; + sp->caseFold = 0; /* we have a strong preference for exact matches */ + if ( *retscp = cm_dnlcLookup(scp, sp)) /* dnlc hit */ + { + sp->caseFold = casefold; + lock_ReleaseMutex(&scp->mx); + return 0; + } + sp->caseFold = casefold; + } } /* @@ -787,7 +799,8 @@ long cm_ReadMountPoint(cm_scache_t *scp, cm_user_t *userp, cm_req_t *reqp) } } /* locked, has callback, has valid data in buffer */ - if ((tlen = scp->length.LowPart) > 1000) return CM_ERROR_TOOBIG; + if ((tlen = scp->length.LowPart) > 1000) + return CM_ERROR_TOOBIG; if (tlen <= 0) { code = CM_ERROR_INVAL; goto done; @@ -1096,6 +1109,13 @@ long cm_Lookup(cm_scache_t *dscp, char *namep, long flags, cm_user_t *userp, int sysNameIndex = 0; cm_scache_t *scp = 0; + if ( stricmp(namep,SMB_IOCTL_FILENAME_NOSLASH) == 0 ) { + if (flags & CM_FLAG_CHECKPATH) + return CM_ERROR_NOSUCHPATH; + else + return CM_ERROR_NOSUCHFILE; + } + for ( sysNameIndex = 0; sysNameIndex < MAXNUMSYSNAMES; sysNameIndex++) { code = cm_ExpandSysName(namep, tname, sizeof(tname), sysNameIndex); if (code > 0) { @@ -1104,10 +1124,10 @@ long cm_Lookup(cm_scache_t *dscp, char *namep, long flags, cm_user_t *userp, *outpScpp = scp; return 0; } - if (scp) { - cm_ReleaseSCache(scp); - scp = 0; - } + if (scp) { + cm_ReleaseSCache(scp); + scp = 0; + } } else { return cm_LookupInternal(dscp, namep, flags, userp, reqp, outpScpp); } @@ -1405,12 +1425,12 @@ long cm_NameI(cm_scache_t *rootSCachep, char *pathp, long flags, if (tscp->fileType == CM_SCACHETYPE_SYMLINK) { /* this is a symlink; assemble a new buffer */ lock_ReleaseMutex(&tscp->mx); - if (symlinkCount++ >= 16) { + if (symlinkCount++ >= MAX_SYMLINK_COUNT) { cm_ReleaseSCache(tscp); cm_ReleaseSCache(dirScp); if (psp) cm_FreeSpace(psp); - return CM_ERROR_TOOBIG; + return CM_ERROR_TOO_MANY_SYMLINKS; } if (tc == 0) restp = ""; @@ -1659,9 +1679,10 @@ void cm_TryBulkStat(cm_scache_t *dscp, osi_hyper_t *offsetp, cm_user_t *userp, bb.counter = 0; bb.bufOffset = *offsetp; + lock_ReleaseMutex(&dscp->mx); /* first, assemble the file IDs we need to stat */ - code = cm_ApplyDir(dscp, cm_TryBulkProc, (void *) &bb, offsetp, userp, - reqp, NULL); + code = cm_ApplyDir(dscp, cm_TryBulkProc, (void *) &bb, offsetp, userp, reqp, NULL); + lock_ObtainMutex(&dscp->mx); /* if we failed, bail out early */ if (code && code != CM_ERROR_STOPNOW) return; @@ -1671,7 +1692,7 @@ void cm_TryBulkStat(cm_scache_t *dscp, osi_hyper_t *offsetp, cm_user_t *userp, * time. */ filex = 0; - while(filex < bb.counter) { + while (filex < bb.counter) { filesThisCall = bb.counter - filex; if (filesThisCall > AFSCBMAX) filesThisCall = AFSCBMAX; diff --git a/src/WINNT/afsd/cm_vnodeops.h b/src/WINNT/afsd/cm_vnodeops.h index 9f2a7a641..fc5a5e57c 100644 --- a/src/WINNT/afsd/cm_vnodeops.h +++ b/src/WINNT/afsd/cm_vnodeops.h @@ -154,4 +154,5 @@ extern void cm_CheckLocks(); extern long cm_RetryLock(cm_file_lock_t *oldFileLock, int vcp_is_dead); +#define MAX_SYMLINK_COUNT 16 #endif /* __CM_VNODEOPS_H_ENV__ */ diff --git a/src/WINNT/afsd/smb.c b/src/WINNT/afsd/smb.c index fb3e1aefd..ebea271a7 100644 --- a/src/WINNT/afsd/smb.c +++ b/src/WINNT/afsd/smb.c @@ -387,10 +387,21 @@ unsigned int smb_Attributes(cm_scache_t *scp) { unsigned int attrs; - if (scp->fileType == CM_SCACHETYPE_DIRECTORY - || scp->fileType == CM_SCACHETYPE_MOUNTPOINT) + if ( scp->fileType == CM_SCACHETYPE_DIRECTORY || + scp->fileType == CM_SCACHETYPE_MOUNTPOINT) + { attrs = SMB_ATTR_DIRECTORY; - else +#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 */ +#endif /* SPECIAL_FOLDERS */ + } else attrs = 0; /* @@ -1300,7 +1311,7 @@ long smb_FindShareProc(cm_scache_t *scp, cm_dirEntry_t *dep, void *rockp, { int matchType = 0; smb_findShare_rock_t * vrock = (smb_findShare_rock_t *) rockp; - if(!strnicmp(dep->name, vrock->shareName, 12)) { + if (!strnicmp(dep->name, vrock->shareName, 12)) { if(!stricmp(dep->name, vrock->shareName)) matchType = SMB_FINDSHARE_EXACT_MATCH; else @@ -1464,7 +1475,7 @@ int smb_FindShare(smb_vc_t *vcp, smb_user_t *uidp, char *shareName, (uidp? (uidp->unp ? uidp->unp->userp : NULL) : NULL), &req, NULL); cm_ReleaseSCache(cm_rootSCachep); - if(vrock.matchType) { + if (vrock.matchType) { sprintf(pathName,"/%s/",vrock.match); *pathNamep = strdup(strlwr(pathName)); free(vrock.match); @@ -1546,11 +1557,11 @@ int smb_FindShareCSCPolicy(char *shareName) /* find a dir search structure by cookie value, and return it held. * Must be called with smb_globalLock held. */ -smb_dirSearch_t *smb_FindDirSearchNL(long cookie) +smb_dirSearch_t *smb_FindDirSearchNoLock(long cookie) { smb_dirSearch_t *dsp; - for(dsp = smb_firstDirSearchp; dsp; dsp = (smb_dirSearch_t *) osi_QNext(&dsp->q)) { + for (dsp = smb_firstDirSearchp; dsp; dsp = (smb_dirSearch_t *) osi_QNext(&dsp->q)) { if (dsp->cookie == cookie) { if (dsp != smb_firstDirSearchp) { /* move to head of LRU queue, too, if we're not already there */ @@ -1562,7 +1573,9 @@ smb_dirSearch_t *smb_FindDirSearchNL(long cookie) if (!smb_lastDirSearchp) smb_lastDirSearchp = (smb_dirSearch_t *) &dsp->q; } + lock_ObtainMutex(&dsp->mx); dsp->refCount++; + lock_ReleaseMutex(&dsp->mx); break; } } @@ -1572,10 +1585,9 @@ smb_dirSearch_t *smb_FindDirSearchNL(long cookie) void smb_DeleteDirSearch(smb_dirSearch_t *dsp) { lock_ObtainWrite(&smb_globalLock); - dsp->flags |= SMB_DIRSEARCH_DELETE; - lock_ReleaseWrite(&smb_globalLock); lock_ObtainMutex(&dsp->mx); - if(dsp->scp != NULL) { + dsp->flags |= SMB_DIRSEARCH_DELETE; + if (dsp->scp != NULL) { lock_ObtainMutex(&dsp->scp->mx); if (dsp->flags & SMB_DIRSEARCH_BULKST) { dsp->flags &= ~SMB_DIRSEARCH_BULKST; @@ -1585,37 +1597,47 @@ void smb_DeleteDirSearch(smb_dirSearch_t *dsp) lock_ReleaseMutex(&dsp->scp->mx); } lock_ReleaseMutex(&dsp->mx); + lock_ReleaseWrite(&smb_globalLock); } -void smb_ReleaseDirSearch(smb_dirSearch_t *dsp) +/* Must be called with the smb_globalLock held */ +void smb_ReleaseDirSearchNoLock(smb_dirSearch_t *dsp) { cm_scache_t *scp; scp = NULL; - lock_ObtainWrite(&smb_globalLock); + lock_ObtainMutex(&dsp->mx); osi_assert(dsp->refCount-- > 0); if (dsp->refCount == 0 && (dsp->flags & SMB_DIRSEARCH_DELETE)) { if (&dsp->q == (osi_queue_t *) smb_lastDirSearchp) smb_lastDirSearchp = (smb_dirSearch_t *) osi_QPrev(&smb_lastDirSearchp->q); osi_QRemove((osi_queue_t **) &smb_firstDirSearchp, &dsp->q); + lock_ReleaseMutex(&dsp->mx); lock_FinalizeMutex(&dsp->mx); scp = dsp->scp; free(dsp); + } else { + lock_ReleaseMutex(&dsp->mx); } - lock_ReleaseWrite(&smb_globalLock); - /* do this now to avoid spurious locking hierarchy creation */ if (scp) cm_ReleaseSCache(scp); } +void smb_ReleaseDirSearch(smb_dirSearch_t *dsp) +{ + lock_ObtainWrite(&smb_globalLock); + smb_ReleaseDirSearchNoLock(dsp); + lock_ReleaseWrite(&smb_globalLock); +} + /* find a dir search structure by cookie value, and return it held */ smb_dirSearch_t *smb_FindDirSearch(long cookie) { smb_dirSearch_t *dsp; lock_ObtainWrite(&smb_globalLock); - dsp = smb_FindDirSearchNL(cookie); + dsp = smb_FindDirSearchNoLock(cookie); lock_ReleaseWrite(&smb_globalLock); return dsp; } @@ -1650,15 +1672,14 @@ void smb_GCDirSearches(int isV3) } /* don't do more than this */ - if (victimCount >= SMB_DIRSEARCH_GCMAX) break; + if (victimCount >= SMB_DIRSEARCH_GCMAX) + break; } /* now release them */ - lock_ReleaseWrite(&smb_globalLock); - for(i = 0; i < victimCount; i++) { - smb_ReleaseDirSearch(victimsp[i]); + for (i = 0; i < victimCount; i++) { + smb_ReleaseDirSearchNoLock(victimsp[i]); } - lock_ObtainWrite(&smb_globalLock); } /* function for allocating a dir search entry. We need these to remember enough context @@ -1677,25 +1698,27 @@ smb_dirSearch_t *smb_NewDirSearch(int isV3) counter = 0; /* what's the biggest ID allowed in this version of the protocol */ - if (isV3) maxAllowed = 65535; - else maxAllowed = 255; + maxAllowed = isV3 ? 65535 : 255; - while(1) { + while (1) { /* twice so we have enough tries to find guys we GC after one pass; * 10 extra is just in case I mis-counted. */ - if (++counter > 2*maxAllowed+10) osi_panic("afsd: dir search cookie leak", - __FILE__, __LINE__); + if (++counter > 2*maxAllowed+10) + osi_panic("afsd: dir search cookie leak", __FILE__, __LINE__); + if (smb_dirSearchCounter > maxAllowed) { smb_dirSearchCounter = 1; - smb_GCDirSearches(isV3); /* GC some (drops global lock) */ + smb_GCDirSearches(isV3); /* GC some */ } - dsp = smb_FindDirSearchNL(smb_dirSearchCounter); + dsp = smb_FindDirSearchNoLock(smb_dirSearchCounter); if (dsp) { /* don't need to watch for refcount zero and deleted, since * we haven't dropped the global lock. */ + lock_ObtainMutex(&dsp->mx); dsp->refCount--; + lock_ReleaseMutex(&dsp->mx); ++smb_dirSearchCounter; continue; } @@ -1703,7 +1726,8 @@ smb_dirSearch_t *smb_NewDirSearch(int isV3) dsp = malloc(sizeof(*dsp)); memset(dsp, 0, sizeof(*dsp)); osi_QAdd((osi_queue_t **) &smb_firstDirSearchp, &dsp->q); - if (!smb_lastDirSearchp) smb_lastDirSearchp = (smb_dirSearch_t *) &dsp->q; + if (!smb_lastDirSearchp) + smb_lastDirSearchp = (smb_dirSearch_t *) &dsp->q; dsp->cookie = smb_dirSearchCounter; ++smb_dirSearchCounter; dsp->refCount = 1; @@ -2275,6 +2299,13 @@ void smb_MapNTError(long code, unsigned long *NTStatusp) else if (code == CM_ERROR_GSSCONTINUE) { NTStatus = 0xC0000016L; /* more processing required */ } + else if (code == CM_ERROR_TOO_MANY_SYMLINKS) { +#ifdef COMMENT + NTStatus = 0xC0000280L; /* reparse point not resolved */ +#else + NTStatus = 0xC0000022L; /* Access Denied */ +#endif + } else { NTStatus = 0xC0982001L; /* SMB non-specific error */ } @@ -3402,7 +3433,6 @@ long smb_ReceiveCoreSearchDir(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *ou else { spacep = inp->spacep; smb_StripLastComponent(spacep->data, NULL, pathp); - lock_ReleaseMutex(&dsp->mx); code = smb_LookupTIDPath(vcp, ((smb_t *)inp)->tid, &tidPathp); if (code) { lock_ReleaseMutex(&dsp->mx); @@ -3413,9 +3443,9 @@ long smb_ReceiveCoreSearchDir(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *ou } code = cm_NameI(cm_rootSCachep, spacep->data, caseFold | CM_FLAG_FOLLOW, userp, tidPathp, &req, &scp); - lock_ObtainMutex(&dsp->mx); if (code == 0) { - if (dsp->scp != 0) cm_ReleaseSCache(dsp->scp); + if (dsp->scp != 0) + cm_ReleaseSCache(dsp->scp); dsp->scp = scp; /* we need one hold for the entry we just stored into, * and one for our own processing. When we're done with this @@ -3520,13 +3550,14 @@ long smb_ReceiveCoreSearchDir(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *ou lock_ObtainRead(&scp->bufCreateLock); code = buf_Get(scp, &thyper, &bufferp); lock_ReleaseRead(&scp->bufCreateLock); + lock_ObtainMutex(&dsp->mx); /* now, if we're doing a star match, do bulk fetching of all of * the status info for files in the dir. */ if (starPattern) { - smb_ApplyDirListPatches(&dirListPatchesp, userp, - &req); + smb_ApplyDirListPatches(&dirListPatchesp, userp, &req); + lock_ObtainMutex(&scp->mx); if ((dsp->flags & SMB_DIRSEARCH_BULKST) && LargeIntegerGreaterThanOrEqualTo(thyper, scp->bulkStatProgress)) { @@ -3539,11 +3570,13 @@ long smb_ReceiveCoreSearchDir(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *ou } else cm_TryBulkStat(scp, &thyper, userp, &req); } + } else { + lock_ObtainMutex(&scp->mx); } - - lock_ObtainMutex(&scp->mx); + lock_ReleaseMutex(&dsp->mx); if (code) break; + bufferOffset = thyper; /* now get the data in the cache */ @@ -4917,8 +4950,7 @@ void smb_FullName(cm_scache_t *dscp, cm_scache_t *scp, char *pathp, rock.name = pathp; rock.vnode = scp; - code = cm_ApplyDir(dscp, smb_FullNameProc, &rock, NULL, - userp, reqp, NULL); + code = cm_ApplyDir(dscp, smb_FullNameProc, &rock, NULL, userp, reqp, NULL); if (code == CM_ERROR_STOPNOW) *newPathp = rock.fullName; else @@ -6932,6 +6964,7 @@ DWORD smb_ServerExceptionFilter(void) { } afsd_ForceTrace(TRUE); + buf_ForceTrace(TRUE); return EXCEPTION_CONTINUE_SEARCH; } #endif diff --git a/src/WINNT/afsd/smb3.c b/src/WINNT/afsd/smb3.c index 9c8691f64..980da2c5a 100644 --- a/src/WINNT/afsd/smb3.c +++ b/src/WINNT/afsd/smb3.c @@ -72,9 +72,20 @@ unsigned long smb_ExtAttributes(cm_scache_t *scp) unsigned long attrs; if (scp->fileType == CM_SCACHETYPE_DIRECTORY || - scp->fileType == CM_SCACHETYPE_MOUNTPOINT) + scp->fileType == CM_SCACHETYPE_MOUNTPOINT) + { attrs = SMB_ATTR_DIRECTORY; - else +#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 */ +#endif /* SPECIAL_FOLDERS */ + } else attrs = 0; /* * We used to mark a file RO if it was in an RO volume, but that @@ -2477,8 +2488,7 @@ long cm_GetShortName(char *pathp, cm_user_t *userp, cm_req_t *reqp, rock.shortName = shortName; rock.vnode = vnode; rock.maskp = lastNamep; - code = cm_ApplyDir(dscp, cm_GetShortNameProc, &rock, &thyper, userp, - reqp, NULL); + code = cm_ApplyDir(dscp, cm_GetShortNameProc, &rock, &thyper, userp, reqp, NULL); cm_ReleaseSCache(dscp); @@ -3575,8 +3585,10 @@ long smb_ReceiveTran2SearchDir(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t pathp = ((char *) p->parmsp) + 12; /* points to path */ nextCookie = 0; maskp = strrchr(pathp, '\\'); - if (maskp == NULL) maskp = pathp; - else maskp++; /* skip over backslash */ + if (maskp == NULL) + maskp = pathp; + else + maskp++; /* skip over backslash */ strcpy(dsp->mask, maskp); /* and save mask */ /* track if this is likely to match a lot of entries */ starPattern = smb_V3IsStarMask(maskp); @@ -3585,7 +3597,8 @@ long smb_ReceiveTran2SearchDir(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t osi_assert(p->opcode == 2); /* find next; obtain basic parameters from request or open dir file */ dsp = smb_FindDirSearch(p->parmsp[0]); - if (!dsp) return CM_ERROR_BADFD; + if (!dsp) + return CM_ERROR_BADFD; attribute = dsp->attribute; maxCount = p->parmsp[1]; infoLevel = p->parmsp[2]; @@ -3653,10 +3666,9 @@ long smb_ReceiveTran2SearchDir(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t else { spacep = cm_GetSpace(); smb_StripLastComponent(spacep->data, NULL, pathp); - lock_ReleaseMutex(&dsp->mx); - code = smb_LookupTIDPath(vcp, p->tid, &tidPathp); if (code) { + lock_ReleaseMutex(&dsp->mx); cm_ReleaseUser(userp); smb_SendTran2Error(vcp, p, opx, CM_ERROR_NOFILES); smb_FreeTran2Packet(outp); @@ -3669,9 +3681,9 @@ long smb_ReceiveTran2SearchDir(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t userp, tidPathp, &req, &scp); cm_FreeSpace(spacep); - lock_ObtainMutex(&dsp->mx); if (code == 0) { - if (dsp->scp != 0) cm_ReleaseSCache(dsp->scp); + if (dsp->scp != 0) + cm_ReleaseSCache(dsp->scp); dsp->scp = scp; /* we need one hold for the entry we just stored into, * and one for our own processing. When we're done @@ -3784,6 +3796,7 @@ long smb_ReceiveTran2SearchDir(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t lock_ObtainRead(&scp->bufCreateLock); code = buf_Get(scp, &thyper, &bufferp); lock_ReleaseRead(&scp->bufCreateLock); + lock_ObtainMutex(&dsp->mx); /* now, if we're doing a star match, do bulk fetching * of all of the status info for files in the dir. @@ -3792,6 +3805,7 @@ long smb_ReceiveTran2SearchDir(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t smb_ApplyV3DirListPatches(scp, &dirListPatchesp, infoLevel, userp, &req); + lock_ObtainMutex(&scp->mx); if ((dsp->flags & SMB_DIRSEARCH_BULKST) && LargeIntegerGreaterThanOrEqualTo(thyper, scp->bulkStatProgress)) { /* Don't bulk stat if risking timeout */ @@ -3803,10 +3817,13 @@ long smb_ReceiveTran2SearchDir(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t } else cm_TryBulkStat(scp, &thyper, userp, &req); } + } else { + lock_ObtainMutex(&scp->mx); } + lock_ReleaseMutex(&dsp->mx); + if (code) + break; - lock_ObtainMutex(&scp->mx); - if (code) break; bufferOffset = thyper; /* now get the data in the cache */ diff --git a/src/WINNT/afsd/symlink.c b/src/WINNT/afsd/symlink.c index 69fe625fd..0b7322ae1 100644 --- a/src/WINNT/afsd/symlink.c +++ b/src/WINNT/afsd/symlink.c @@ -22,8 +22,6 @@ #include #include -typedef long afs_int32; - #include "fs_utils.h" #include "cmd.h" @@ -243,6 +241,11 @@ register struct cmd_syndesc *as; { /* create symlink with a special pioctl for Windows NT, since it doesn't * have a symlink system call. */ + + /* TODO: Code needs to go here to prevent the creation of symlinks + * in \\AFS\all when not in the "AFS Client Admins" group. + */ + blob.out_size = 0; blob.in_size = 1 + strlen(space); blob.in = space; diff --git a/src/WINNT/afssvrcfg/NTMakefile b/src/WINNT/afssvrcfg/NTMakefile index 257130f24..d74932b89 100644 --- a/src/WINNT/afssvrcfg/NTMakefile +++ b/src/WINNT/afssvrcfg/NTMakefile @@ -90,6 +90,9 @@ lang:: # Local clean target; augments predefined clean target clean:: + $(CD) lang + for /f %l in ('dir /B ??_??') do @$(NTLANG) %l $(MAKECMD) /nologo /f NTMakefile clean + $(CD) .. mkdir: -mkdir $(OUT)\lang diff --git a/src/WINNT/afssvrcpa/NTMakefile b/src/WINNT/afssvrcpa/NTMakefile index 487e7b215..c9dfd8205 100644 --- a/src/WINNT/afssvrcpa/NTMakefile +++ b/src/WINNT/afssvrcpa/NTMakefile @@ -55,7 +55,9 @@ lang:: # Local clean target; augments predefined clean target clean:: - + $(CD) lang + for /f %l in ('dir /B ??_??') do @$(NTLANG) %l $(MAKECMD) /nologo /f NTMakefile clean + $(CD) .. mkdir: -mkdir $(OUT)\lang diff --git a/src/WINNT/afssvrmgr/NTMakefile b/src/WINNT/afssvrmgr/NTMakefile index 97619e3e5..0526ac91a 100644 --- a/src/WINNT/afssvrmgr/NTMakefile +++ b/src/WINNT/afssvrmgr/NTMakefile @@ -116,9 +116,14 @@ install : $(EXEFILE) lang $(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 + $(CD) .. + mkdir: -mkdir $(OUT)\lang cd lang nmake /nologo /f ntmakefile SRC=$(SRC) OBJ=$(OBJ) mkdir cd .. - + diff --git a/src/WINNT/afsusrmgr/NTMakefile b/src/WINNT/afsusrmgr/NTMakefile index 422c47816..3514cc0d5 100644 --- a/src/WINNT/afsusrmgr/NTMakefile +++ b/src/WINNT/afsusrmgr/NTMakefile @@ -93,6 +93,11 @@ install : $(EXEFILE) lang $(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 + $(CD) .. + mkdir: -mkdir $(OUT)\lang cd lang diff --git a/src/WINNT/client_config/config.cpp b/src/WINNT/client_config/config.cpp index d39f24fc3..f3ea6628f 100644 --- a/src/WINNT/client_config/config.cpp +++ b/src/WINNT/client_config/config.cpp @@ -671,51 +671,67 @@ BOOL Config_SetNumDaemons (ULONG cDaemons, ULONG *pStatus) void Config_GetSysName (LPTSTR pszName) { - if (!Config_ReadGlobalString (TEXT("SysName"), pszName, MAX_PATH)) - lstrcpy (pszName, TEXT("i386_nt40")); + if (!Config_ReadGlobalString (TEXT("SysName"), pszName, MAX_PATH)) + lstrcpy (pszName, TEXT("i386_nt40")); } BOOL Config_SetSysName (LPCTSTR pszName, ULONG *pStatus) { - BOOL rc = TRUE; - ULONG status = 0; - - if (Config_GetServiceState() == SERVICE_RUNNING) - { - struct { - ULONG cbData; - TCHAR szData[ PIOCTL_MAXSIZE ]; - } InData; - memset (&InData, 0x00, sizeof(InData)); - InData.cbData = lstrlen(pszName); - lstrcpy (InData.szData, pszName); - - BYTE OutData[ PIOCTL_MAXSIZE ]; - memset (OutData, 0x00, sizeof(OutData)); - - struct ViceIoctl IOInfo; - IOInfo.in_size = sizeof(ULONG) +lstrlen(pszName) +1; - IOInfo.in = (char *)&InData; - IOInfo.out = (char *)OutData; - IOInfo.out_size = PIOCTL_MAXSIZE; - - if ((status = pioctl (0, VIOC_AFS_SYSNAME, &IOInfo, 1)) != 0) - { - rc = FALSE; - } - } - - if (rc) - { - Config_WriteGlobalString (TEXT("SysName"), pszName); - } - - if (pStatus && !rc) - *pStatus = status; - if (!rc) - Message (MB_ICONHAND, GetErrorTitle(), IDS_FAILCONFIG_SYSNAME, TEXT("%ld"), status); - return rc; + BOOL rc = TRUE; + ULONG status = 0; + + if (Config_GetServiceState() == SERVICE_RUNNING) + { + struct { + ULONG cbData; + TCHAR szData[ PIOCTL_MAXSIZE ]; + } InData; + memset (&InData, 0x00, sizeof(InData)); + USHORT i=0, j=0, len=lstrlen(pszName); + + if ( len == 0 ) { + Message (MB_ICONHAND, GetErrorTitle(), IDS_FAILCONFIG_SYSNAME, TEXT("A sysname must be specified")); + return(-1); + } + + while ( pszName[i] ) { + if ( !isspace(pszName[i]) ) { + InData.szData[j++] = pszName[i]; + } else if (InData.szData[j-1] != '\0') { + InData.szData[j++] = '\0'; + InData.cbData++; + } + i++; + } + InData.szData[j++] = '\0'; + InData.cbData++; /* one word */ + + BYTE OutData[ PIOCTL_MAXSIZE ]; + memset (OutData, 0x00, sizeof(OutData)); + + struct ViceIoctl IOInfo; + IOInfo.in_size = sizeof(ULONG) + j; + IOInfo.in = (char *)&InData; + IOInfo.out = (char *)OutData; + IOInfo.out_size = PIOCTL_MAXSIZE; + + if ((status = pioctl (0, VIOC_AFS_SYSNAME, &IOInfo, 1)) != 0) + { + rc = FALSE; + } + } + + if (rc) + { + Config_WriteGlobalString (TEXT("SysName"), pszName); + } + + if (pStatus && !rc) + *pStatus = status; + if (!rc) + Message (MB_ICONHAND, GetErrorTitle(), IDS_FAILCONFIG_SYSNAME, TEXT("%ld"), status); + return rc; } diff --git a/src/WINNT/client_creds/NTMakefile b/src/WINNT/client_creds/NTMakefile index f577152aa..b58c51e07 100644 --- a/src/WINNT/client_creds/NTMakefile +++ b/src/WINNT/client_creds/NTMakefile @@ -127,6 +127,11 @@ lang :: $(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 + $(CD) .. + mkdir: -mkdir $(OUT)\lang cd lang diff --git a/src/WINNT/client_exp/lang/en_US/afs_shl_ext.rc b/src/WINNT/client_exp/lang/en_US/afs_shl_ext.rc index 0933ba43a..75edee5af 100644 --- a/src/WINNT/client_exp/lang/en_US/afs_shl_ext.rc +++ b/src/WINNT/client_exp/lang/en_US/afs_shl_ext.rc @@ -429,7 +429,21 @@ BEGIN PUSHBUTTON "OK",IDOK,22,53,45,14 PUSHBUTTON "Cancel",IDCANCEL,92,53,45,14 PUSHBUTTON "Help",9,167,53,45,14 - LTEXT "Share Name:",IDC_STATIC,18,10,29,8 + LTEXT "Submount Name:",IDC_STATIC,18,10,29,8 + LTEXT "Path Name:",IDC_STATIC,19,25,28,8 +END + +IDD_SYMBOLICLINK_ADD DIALOG DISCARDABLE 0, 0, 235, 79 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Add Symbolic Link" +FONT 8, "MS Sans Serif" +BEGIN + EDITTEXT IDC_NAME,62,8,163,12,ES_AUTOHSCROLL + EDITTEXT IDC_DIR,62,23,163,12,ES_AUTOHSCROLL + PUSHBUTTON "OK",IDOK,22,53,45,14 + PUSHBUTTON "Cancel",IDCANCEL,92,53,45,14 + PUSHBUTTON "Help",9,167,53,45,14 + LTEXT "Link Name:",IDC_STATIC,18,10,29,8 LTEXT "Path Name:",IDC_STATIC,19,25,28,8 END diff --git a/src/WINNT/client_exp/make_symbolic_link_dlg.cpp b/src/WINNT/client_exp/make_symbolic_link_dlg.cpp index d1889fbc1..ff3a29de5 100644 --- a/src/WINNT/client_exp/make_symbolic_link_dlg.cpp +++ b/src/WINNT/client_exp/make_symbolic_link_dlg.cpp @@ -51,7 +51,7 @@ void CMakeSymbolicLinkDlg::DoDataExchange(CDataExchange* pDX) DDX_Text(pDX, IDC_NAME, m_strName); DDV_MaxChars(pDX, m_strName, 63); DDX_Text(pDX, IDC_DIR, m_strDir); - DDV_MaxChars(pDX, m_strDir, 63); + DDV_MaxChars(pDX, m_strDir, 255); //}}AFX_DATA_MAP } diff --git a/src/WINNT/install/wix/NTMakefile b/src/WINNT/install/wix/NTMakefile index 8ea9570bf..b335a430c 100644 --- a/src/WINNT/install/wix/NTMakefile +++ b/src/WINNT/install/wix/NTMakefile @@ -62,9 +62,8 @@ $(WIXOBJ): openafs.wxs $(WIXINCLUDES) # Cleanup clean:: - for %l in ( $(LANGUAGES) ) do ( + for %l in ( $(LANGUAGES) ) do \ $(MAKE) /f NTMakefile /nologo LANG=%l lang_clean - ) $(CD) custom $(MAKE) /f NTMakefile /nologo clean $(CD) .. diff --git a/src/WINNT/install/wix/config.wxi b/src/WINNT/install/wix/config.wxi index e4702b09d..bd7af64ed 100644 --- a/src/WINNT/install/wix/config.wxi +++ b/src/WINNT/install/wix/config.wxi @@ -103,6 +103,19 @@ + + + + + + + + + + + + + @@ -150,4 +163,6 @@ + + diff --git a/src/WINNT/install/wix/feature.wxi b/src/WINNT/install/wix/feature.wxi index 273b9042c..d786b2d75 100644 --- a/src/WINNT/install/wix/feature.wxi +++ b/src/WINNT/install/wix/feature.wxi @@ -1,42 +1,29 @@  - - - - - - - - - - - - - + InstallDefault="followParent" Level="30" Title="$(loc.StrAFSClientDesc)"> - + - + VersionNT = 500 And ServicePackLevel < 3 - + CREDSSTARTUP = 0 + InstallDefault="$(var.DebugSymInstallDefault)" Level="$(var.DebugSymLowLevel)" Title="$(loc.StrAFSClientDebugDesc)"> @@ -98,7 +85,7 @@ + InstallDefault="followParent" Level="130" Title="$(loc.StrAFSServerDesc)"> @@ -147,7 +134,7 @@ + InstallDefault="$(var.DebugSymInstallDefault)" Level="$(var.DebugSymHighLevel)" Title="$(loc.StrAFSServerDebugDesc)"> @@ -159,7 +146,7 @@ + Display="expand" InstallDefault="followParent" Level="130" Title="$(loc.StrAFSCCDesc)"> @@ -197,7 +184,7 @@ + Display="expand" InstallDefault="$(var.DebugSymInstallDefault)" Level="$(var.DebugSymHighLevel)" Title="$(loc.StrAFSCCDebugDesc)"> @@ -212,7 +199,7 @@ + InstallDefault="followParent" Level="130" Title="$(loc.StrAFSSDKDesc)"> @@ -227,7 +214,7 @@ + InstallDefault="$(var.DebugSymInstallDefault)" Level="$(var.DebugSymHighLevel)" Title="$(loc.StrAFSSDKDebugDesc)"> @@ -236,7 +223,7 @@ + Display="expand" InstallDefault="followParent" Level="130" Title="$(loc.StrAFSDocDesc)"> diff --git a/src/WINNT/install/wix/files.wxi b/src/WINNT/install/wix/files.wxi index 0a61cca5d..b2bf6a7c1 100644 --- a/src/WINNT/install/wix/files.wxi +++ b/src/WINNT/install/wix/files.wxi @@ -1,6 +1,6 @@ - + @@ -19,7 +19,7 @@ - + @@ -119,7 +119,7 @@ - + @@ -362,8 +362,8 @@ - - + + @@ -380,7 +380,7 @@ - + @@ -668,7 +668,7 @@ - + @@ -715,7 +715,7 @@ - + @@ -730,7 +730,7 @@ - + OLDCELLSERVDB = "" @@ -740,7 +740,7 @@ OLDCELLSERVDB <> "" - + @@ -860,12 +860,12 @@ - + - + @@ -898,7 +898,7 @@ - + @@ -1034,7 +1034,7 @@ - + @@ -1063,7 +1063,7 @@ - + @@ -1115,7 +1115,7 @@ - + @@ -1134,7 +1134,7 @@ - + @@ -1178,10 +1178,10 @@ - - - - + + + + @@ -1284,7 +1284,7 @@ - + diff --git a/src/WINNT/install/wix/openafs.wxs b/src/WINNT/install/wix/openafs.wxs index 2ca393c78..d0c493b29 100644 --- a/src/WINNT/install/wix/openafs.wxs +++ b/src/WINNT/install/wix/openafs.wxs @@ -153,7 +153,7 @@ BinaryKey="BIN_afsCustom" DllEntry="UninstallNsisInstallation" Execute="immediate" /> - event = CreateEvent((LPSECURITY_ATTRIBUTES) 0, FALSE, - FALSE, (LPCTSTR) eventName); + new->event = CreateEvent((LPSECURITY_ATTRIBUTES) 0, FALSE, + FALSE, (LPCTSTR) 0); if (new->event == NULL) { free(new); new = NULL; diff --git a/src/afs/FBSD/osi_module.c b/src/afs/FBSD/osi_module.c index a562ee251..153763882 100644 --- a/src/afs/FBSD/osi_module.c +++ b/src/afs/FBSD/osi_module.c @@ -12,7 +12,7 @@ #include RCSID - ("$Header: /cvs/openafs/src/afs/FBSD/osi_module.c,v 1.5 2004/03/10 23:01:51 rees Exp $"); + ("$Header: /cvs/openafs/src/afs/FBSD/osi_module.c,v 1.5.2.1 2004/11/09 17:11:34 shadow Exp $"); #include #include @@ -43,21 +43,25 @@ afs_module_handler(module_t mod, int what, void *arg) case MOD_LOAD: if (inited) { printf("afs cannot be MOD_LOAD'd more than once\n"); - error = -1; + error = EBUSY; break; } if (sysent[AFS_SYSCALL].sy_call != nosys && sysent[AFS_SYSCALL].sy_call != lkmnosys) { printf("AFS_SYSCALL in use. aborting\n"); - error = -1; + error = EBUSY; break; } memset(&afs_vfsconf, 0, sizeof(struct vfsconf)); +#ifdef AFS_FBSD53_ENV + afs_vfsconf.vfc_version = VFS_VERSION; +#endif strcpy(afs_vfsconf.vfc_name, "AFS"); afs_vfsconf.vfc_vfsops = &afs_vfsops; afs_vfsconf.vfc_typenum = -1; /* set by vfs_register */ afs_vfsconf.vfc_flags = VFCF_NETWORK; - vfs_register(&afs_vfsconf); /* doesn't fail */ + if ((error = vfs_register(&afs_vfsconf)) != 0) + break; vfs_add_vnodeops(&afs_vnodeop_opv_desc); osi_Init(); #if 0 @@ -80,11 +84,10 @@ afs_module_handler(module_t mod, int what, void *arg) break; } if (afs_globalVFS) { - error = -1; + error = EBUSY; break; } - if (vfs_unregister(&afs_vfsconf)) { - error = -1; + if ((error = vfs_unregister(&afs_vfsconf)) != 0) { break; } vfs_rm_vnodeops(&afs_vnodeop_opv_desc); diff --git a/src/afs/FBSD/osi_vfsops.c b/src/afs/FBSD/osi_vfsops.c index fdec53501..08a850e21 100644 --- a/src/afs/FBSD/osi_vfsops.c +++ b/src/afs/FBSD/osi_vfsops.c @@ -2,7 +2,7 @@ #include RCSID - ("$Header: /cvs/openafs/src/afs/FBSD/osi_vfsops.c,v 1.16 2004/07/27 16:24:40 rees Exp $"); + ("$Header: /cvs/openafs/src/afs/FBSD/osi_vfsops.c,v 1.16.2.1 2004/11/09 17:11:34 shadow Exp $"); #include /* Standard vendor system headers */ #include /* Afs-based standard headers */ @@ -12,8 +12,8 @@ RCSID #include #include -struct vcache *afs_globalVp = 0; -struct mount *afs_globalVFS = 0; +struct vcache *afs_globalVp = NULL; +struct mount *afs_globalVFS = NULL; int afs_pbuf_freecnt = -1; #ifdef AFS_FBSD50_ENV @@ -29,9 +29,23 @@ afs_start(struct mount *mp, int flags, THREAD_OR_PROC) return (0); /* nothing to do. ? */ } +#ifdef AFS_FBSD53_ENV +int +afs_mount(struct mount *mp, struct thread *td) +{ + int afs_omount(struct mount *mp, char *path, caddr_t data, struct thread *p); + + return afs_omount(mp, NULL, NULL, td); +} +#endif + int -afs_mount(struct mount *mp, char *path, caddr_t data, struct nameidata *ndp, +#ifdef AFS_FBSD53_ENV +afs_omount(struct mount *mp, char *path, caddr_t data, struct thread *p) +#else +afs_omount(struct mount *mp, char *path, caddr_t data, struct nameidata *ndp, THREAD_OR_PROC) +#endif { /* ndp contains the mounted-from device. Just ignore it. * we also don't care about our proc struct. */ @@ -45,7 +59,7 @@ afs_mount(struct mount *mp, char *path, caddr_t data, struct nameidata *ndp, if (afs_globalVFS) { /* Don't allow remounts. */ AFS_GUNLOCK(); - return (EBUSY); + return EBUSY; } afs_globalVFS = mp; @@ -53,7 +67,8 @@ afs_mount(struct mount *mp, char *path, caddr_t data, struct nameidata *ndp, vfs_getnewfsid(mp); mp->mnt_stat.f_iosize = 8192; - (void)copyinstr(path, mp->mnt_stat.f_mntonname, MNAMELEN - 1, &size); + if (path) + (void) copyinstr(path, mp->mnt_stat.f_mntonname, MNAMELEN - 1, &size); memset(mp->mnt_stat.f_mntonname + size, 0, MNAMELEN - size); memset(mp->mnt_stat.f_mntfromname, 0, MNAMELEN); strcpy(mp->mnt_stat.f_mntfromname, "AFS"); @@ -89,13 +104,19 @@ afs_unmount(struct mount *mp, int flags, THREAD_OR_PROC) } int +#ifdef AFS_FBSD53_ENV +afs_root(struct mount *mp, struct vnode **vpp, struct thread *td) +#else afs_root(struct mount *mp, struct vnode **vpp) +#endif { int error; struct vrequest treq; register struct vcache *tvp = 0; #ifdef AFS_FBSD50_ENV +#ifndef AFS_FBSD53_ENV struct thread *td = curthread; +#endif struct ucred *cr = td->td_ucred; #else struct proc *p = curproc; @@ -202,7 +223,10 @@ afs_init(struct vfsconf *vfc) } struct vfsops afs_vfsops = { +#ifdef AFS_FBSD53_ENV afs_mount, +#endif + afs_omount, afs_start, afs_unmount, afs_root, @@ -217,6 +241,6 @@ struct vfsops afs_vfsops = { vfs_stduninit, vfs_stdextattrctl, #ifdef AFS_FBSD50_ENV - NULL, + vfs_stdsysctl, #endif }; diff --git a/src/afs/IRIX/osi_vnodeops.c b/src/afs/IRIX/osi_vnodeops.c index 373012495..5c71785a8 100644 --- a/src/afs/IRIX/osi_vnodeops.c +++ b/src/afs/IRIX/osi_vnodeops.c @@ -14,7 +14,7 @@ #include "afs/param.h" RCSID - ("$Header: /cvs/openafs/src/afs/IRIX/osi_vnodeops.c,v 1.14.2.1 2004/08/25 07:09:34 shadow Exp $"); + ("$Header: /cvs/openafs/src/afs/IRIX/osi_vnodeops.c,v 1.14.2.2 2004/11/09 17:13:17 shadow Exp $"); #ifdef AFS_SGI62_ENV #include "afs/sysincludes.h" /* Standard vendor system headers */ @@ -354,9 +354,9 @@ afsrwvp(register struct vcache *avc, register struct uio *uio, enum uio_rw rw, register struct vnode *vp = AFSTOV(avc); struct buf *bp; daddr_t bn; - size_t acnt, cnt; - int off, newoff; - ssize_t bsize, rem, len; + off_t acnt, cnt; + off_t off, newoff; + off_t bsize, rem, len; int error; struct bmapval bmv[2]; int nmaps, didFakeOpen = 0; @@ -372,7 +372,7 @@ afsrwvp(register struct vcache *avc, register struct uio *uio, enum uio_rw rw, if (uio->uio_resid <= 0) { return (0); } - if (uio->uio_offset < 0 || (signed long)newoff < 0) { + if (uio->uio_offset < 0 || newoff < 0) { return (EINVAL); } if (ioflag & IO_DIRECT) @@ -473,7 +473,7 @@ afsrwvp(register struct vcache *avc, register struct uio *uio, enum uio_rw rw, /* * read/paging in a normal file */ - rem = avc->m.Length - (afs_int32) uio->uio_offset; + rem = avc->m.Length - uio->uio_offset; if (rem <= 0) /* EOF */ break; @@ -604,7 +604,7 @@ afsrwvp(register struct vcache *avc, register struct uio *uio, enum uio_rw rw, if (bp->b_flags & B_ERROR) { /* * Since we compile -signed, b_error is a signed - * char when it should ba an unsigned char. + * char when it should be an unsigned char. * This can cause some errors codes to be interpreted * as negative #s */ @@ -638,7 +638,7 @@ afsrwvp(register struct vcache *avc, register struct uio *uio, enum uio_rw rw, * Make sure it is at least as high as the last byte we just wrote * into the buffer. */ - if (avc->m.Length < (afs_int32) uio->uio_offset) { + if (avc->m.Length < uio->uio_offset) { AFS_GLOCK(); ObtainWriteLock(&avc->lock, 235); avc->m.Length = uio->uio_offset; diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c index fda7e6a3e..b843665bf 100644 --- a/src/afs/LINUX/osi_vnodeops.c +++ b/src/afs/LINUX/osi_vnodeops.c @@ -22,7 +22,7 @@ #include "afs/param.h" RCSID - ("$Header: /cvs/openafs/src/afs/LINUX/osi_vnodeops.c,v 1.81.2.3 2004/10/18 17:43:51 shadow Exp $"); + ("$Header: /cvs/openafs/src/afs/LINUX/osi_vnodeops.c,v 1.81.2.4 2004/11/09 17:15:02 shadow Exp $"); #include "afs/sysincludes.h" #include "afsincludes.h" @@ -333,11 +333,11 @@ afs_linux_readdir(struct file *fp, void *dirbuf, filldir_t filldir) code = 0; offset = (int) fp->f_pos; while (1) { - dirpos = BlobScan(&tdc->f, offset); + dirpos = BlobScan(tdc, offset); if (!dirpos) break; - de = afs_dir_GetBlob(&tdc->f, dirpos); + de = afs_dir_GetBlob(tdc, dirpos); if (!de) break; diff --git a/src/afs/VNOPS/afs_vnop_attrs.c b/src/afs/VNOPS/afs_vnop_attrs.c index aa154054a..90dc9aef2 100644 --- a/src/afs/VNOPS/afs_vnop_attrs.c +++ b/src/afs/VNOPS/afs_vnop_attrs.c @@ -24,7 +24,7 @@ #include "afs/param.h" RCSID - ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_attrs.c,v 1.27.2.1 2004/08/25 07:09:35 shadow Exp $"); + ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_attrs.c,v 1.27.2.2 2004/11/09 17:17:25 shadow Exp $"); #include "afs/sysincludes.h" /* Standard vendor system headers */ #include "afsincludes.h" /* Afs-based standard headers */ @@ -317,6 +317,14 @@ afs_getattr(OSI_VC_DECL(avc), struct vattr *attrs, struct AFS_UCRED *acred) CMB_ALLOW_EXEC_AS_READ)) { return EACCES; } +#if 0 +/* The effect of the following is to force the NFS client to refetch the + * volume root every time, since the mtime changes. For Solaris 9 NFSv3 + * clients, this means looping forever, since for some reason (related + * to caching?) it wants the mtime to be consistent two reads in a row. + * Why are volume roots special??? + * --jhutz 2-May-2004 + */ if (avc->mvstat == 2) { #if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_AIX41_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) attrs->va_mtime.tv_nsec += ((++avc->xlatordv) * 1000); @@ -324,6 +332,7 @@ afs_getattr(OSI_VC_DECL(avc), struct vattr *attrs, struct AFS_UCRED *acred) attrs->va_mtime.tv_usec += ++avc->xlatordv; #endif } +#endif } if ((au = afs_FindUser(treq.uid, -1, READ_LOCK))) { register struct afs_exporter *exporter = au->exporter; diff --git a/src/afs/VNOPS/afs_vnop_create.c b/src/afs/VNOPS/afs_vnop_create.c index 73705c288..d69d9966a 100644 --- a/src/afs/VNOPS/afs_vnop_create.c +++ b/src/afs/VNOPS/afs_vnop_create.c @@ -17,7 +17,7 @@ #include "afs/param.h" RCSID - ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_create.c,v 1.16.2.2 2004/10/18 17:43:51 shadow Exp $"); + ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_create.c,v 1.16.2.3 2004/11/09 17:15:04 shadow Exp $"); #include "afs/sysincludes.h" /* Standard vendor system headers */ #include "afsincludes.h" /* Afs-based standard headers */ @@ -154,7 +154,7 @@ afs_create(OSI_VC_DECL(adp), char *aname, struct vattr *attrs, if (tdc) { /* see if file already exists. If it does, we only set * the size attributes (to handle O_TRUNC) */ - code = afs_dir_Lookup(&tdc->f, aname, &newFid.Fid); /* use dnlc first xxx */ + code = afs_dir_Lookup(tdc, aname, &newFid.Fid); /* use dnlc first xxx */ if (code == 0) { ReleaseSharedLock(&tdc->lock); afs_PutDCache(tdc); @@ -368,10 +368,10 @@ afs_create(OSI_VC_DECL(adp), char *aname, struct vattr *attrs, UpgradeSToWLock(&tdc->lock, 631); if (afs_LocalHero(adp, tdc, &OutDirStatus, 1)) { /* we can do it locally */ - code = afs_dir_Create(&tdc->f, aname, &newFid.Fid); + code = afs_dir_Create(tdc, aname, &newFid.Fid); if (code) { ZapDCE(tdc); - DZap(&tdc->f); + DZap(tdc); } } if (tdc) { @@ -531,7 +531,7 @@ afs_LocalHero(register struct vcache *avc, register struct dcache *adc, } else { if (adc) { ZapDCE(adc); - DZap(&adc->f); + DZap(adc); } if (avc->states & CStatd) { osi_dnlc_purgedp(avc); diff --git a/src/afs/VNOPS/afs_vnop_dirops.c b/src/afs/VNOPS/afs_vnop_dirops.c index d7e2028e6..46c5778e3 100644 --- a/src/afs/VNOPS/afs_vnop_dirops.c +++ b/src/afs/VNOPS/afs_vnop_dirops.c @@ -21,7 +21,7 @@ #include "afs/param.h" RCSID - ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_dirops.c,v 1.14.2.2 2004/10/18 17:43:51 shadow Exp $"); + ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_dirops.c,v 1.14.2.3 2004/11/09 17:15:04 shadow Exp $"); #include "afs/sysincludes.h" /* Standard vendor system headers */ #include "afsincludes.h" /* Afs-based standard headers */ @@ -147,10 +147,10 @@ afs_mkdir(OSI_VC_ARG(adp), aname, attrs, avcp, acred) ObtainWriteLock(&tdc->lock, 632); if (afs_LocalHero(adp, tdc, &OutDirStatus, 1)) { /* we can do it locally */ - code = afs_dir_Create(&tdc->f, aname, &newFid.Fid); + code = afs_dir_Create(tdc, aname, &newFid.Fid); if (code) { ZapDCE(tdc); /* surprise error -- use invalid value */ - DZap(&tdc->f); + DZap(tdc); } } if (tdc) { @@ -250,7 +250,7 @@ afs_rmdir(adp, aname, acred) struct VenusFid unlinkFid; unlinkFid.Fid.Vnode = 0; - code = afs_dir_Lookup(&tdc->f, aname, &unlinkFid.Fid); + code = afs_dir_Lookup(tdc, aname, &unlinkFid.Fid); if (code == 0) { afs_int32 cached = 0; @@ -304,10 +304,10 @@ afs_rmdir(adp, aname, acred) UpgradeSToWLock(&tdc->lock, 634); if (afs_LocalHero(adp, tdc, &OutDirStatus, 1)) { /* we can do it locally */ - code = afs_dir_Delete(&tdc->f, aname); + code = afs_dir_Delete(tdc, aname); if (code) { ZapDCE(tdc); /* surprise error -- invalid value */ - DZap(&tdc->f); + DZap(tdc); } } if (tdc) { diff --git a/src/afs/VNOPS/afs_vnop_link.c b/src/afs/VNOPS/afs_vnop_link.c index a8621422f..b16de16ee 100644 --- a/src/afs/VNOPS/afs_vnop_link.c +++ b/src/afs/VNOPS/afs_vnop_link.c @@ -17,7 +17,7 @@ #include "afs/param.h" RCSID - ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_link.c,v 1.15.2.2 2004/10/18 17:43:51 shadow Exp $"); + ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_link.c,v 1.15.2.3 2004/11/09 17:15:04 shadow Exp $"); #include "afs/sysincludes.h" /* Standard vendor system headers */ #include "afsincludes.h" /* Afs-based standard headers */ @@ -137,10 +137,10 @@ afs_link(avc, OSI_VC_ARG(adp), aname, acred) ObtainWriteLock(&tdc->lock, 635); if (afs_LocalHero(adp, tdc, &OutDirStatus, 1)) { /* we can do it locally */ - code = afs_dir_Create(&tdc->f, aname, &avc->fid.Fid); + code = afs_dir_Create(tdc, aname, &avc->fid.Fid); if (code) { ZapDCE(tdc); /* surprise error -- invalid value */ - DZap(&tdc->f); + DZap(tdc); } } if (tdc) { diff --git a/src/afs/VNOPS/afs_vnop_lookup.c b/src/afs/VNOPS/afs_vnop_lookup.c index 874395788..99d0de3a2 100644 --- a/src/afs/VNOPS/afs_vnop_lookup.c +++ b/src/afs/VNOPS/afs_vnop_lookup.c @@ -18,7 +18,7 @@ #include "afs/param.h" RCSID - ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_lookup.c,v 1.50.2.3 2004/10/18 17:43:51 shadow Exp $"); + ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_lookup.c,v 1.50.2.4 2004/11/09 17:15:04 shadow Exp $"); #include "afs/sysincludes.h" /* Standard vendor system headers */ #include "afsincludes.h" /* Afs-based standard headers */ @@ -507,21 +507,7 @@ Next_AtSys(register struct vcache *avc, struct vrequest *areq, return 1; } -#if (defined(AFS_SGI62_ENV) || defined(AFS_SUN57_64BIT_ENV)) -extern int BlobScan(ino64_t * afile, afs_int32 ablob); -#else -#if defined(AFS_HPUX1123_ENV) -/* DEE should use the new afs_inode_t for all */ -extern int BlobScan(ino_t * afile, afs_int32 ablob); -#else -#if defined AFS_LINUX_64BIT_KERNEL -extern int BlobScan(long *afile, afs_int32 ablob); -#else -extern int BlobScan(afs_int32 * afile, afs_int32 ablob); -#endif -#endif -#endif - +extern int BlobScan(struct dcache * afile, afs_int32 ablob); /* called with an unlocked directory and directory cookie. Areqp * describes who is making the call. @@ -674,7 +660,7 @@ afs_DoBulkStat(struct vcache *adp, long dirCookie, struct vrequest *areqp) /* look for first safe entry to examine in the directory. BlobScan * looks for a the 1st allocated dir after the dirCookie slot. */ - newIndex = BlobScan(&dcp->f, (dirCookie >> 5)); + newIndex = BlobScan(dcp, (dirCookie >> 5)); if (newIndex == 0) break; @@ -683,7 +669,7 @@ afs_DoBulkStat(struct vcache *adp, long dirCookie, struct vrequest *areqp) /* get a ptr to the dir entry */ dirEntryp = - (struct DirEntry *)afs_dir_GetBlob(&dcp->f, newIndex); + (struct DirEntry *)afs_dir_GetBlob(dcp, newIndex); if (!dirEntryp) break; @@ -1293,7 +1279,6 @@ afs_lookup(adp, aname, avcp, acred) { /* sub-block just to reduce stack usage */ register struct dcache *tdc; afs_size_t dirOffset, dirLen; - struct fcache *theDir; struct VenusFid tfid; /* now we have to lookup the next fid */ @@ -1351,15 +1336,14 @@ afs_lookup(adp, aname, avcp, acred) /* lookup the name in the appropriate dir, and return a cache entry * on the resulting fid */ - theDir = &tdc->f; code = - afs_dir_LookupOffset(theDir, sysState.name, &tfid.Fid, + afs_dir_LookupOffset(tdc, sysState.name, &tfid.Fid, &dirCookie); /* If the first lookup doesn't succeed, maybe it's got @sys in the name */ while (code == ENOENT && Next_AtSys(adp, &treq, &sysState)) code = - afs_dir_LookupOffset(theDir, sysState.name, &tfid.Fid, + afs_dir_LookupOffset(tdc, sysState.name, &tfid.Fid, &dirCookie); tname = sysState.name; diff --git a/src/afs/VNOPS/afs_vnop_readdir.c b/src/afs/VNOPS/afs_vnop_readdir.c index 0eb41e088..eae187795 100644 --- a/src/afs/VNOPS/afs_vnop_readdir.c +++ b/src/afs/VNOPS/afs_vnop_readdir.c @@ -23,7 +23,7 @@ #include "afs/param.h" RCSID - ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_readdir.c,v 1.24.2.2 2004/10/18 17:43:53 shadow Exp $"); + ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_readdir.c,v 1.24.2.4 2004/11/09 17:19:16 shadow Exp $"); #include "afs/sysincludes.h" /* Standard vendor system headers */ #include "afsincludes.h" /* Afs-based standard headers */ @@ -67,7 +67,7 @@ extern struct DirEntry *afs_dir_GetBlob(); become static. */ int -BlobScan(struct fcache * afile, afs_int32 ablob) +BlobScan(struct dcache * afile, afs_int32 ablob) { register afs_int32 relativeBlob; afs_int32 pageBlob; @@ -292,6 +292,9 @@ afs_readdir_move(de, vc, auio, slen, rlen, off) afs_size_t off; { int code = 0; + struct volume *tvp; + afs_uint32 Volume = vc->fid.Fid.Volume; + afs_uint32 Vnode = de->fid.vnode; #if defined(AFS_SUN56_ENV) struct dirent64 *direntp; #else @@ -304,6 +307,79 @@ afs_readdir_move(de, vc, auio, slen, rlen, off) #endif /* AFS_SGI53_ENV */ AFS_STATCNT(afs_readdir_move); + +#define READDIR_CORRECT_INUMS +#ifdef READDIR_CORRECT_INUMS + if (de->name[0] == '.' && !de->name[1]) { + /* This is the '.' entry; if we are a volume root, we need to + * ignore the directory and use the inum for the mount point. + */ + if (!FidCmp(&afs_rootFid, &vc->fid)) { + Volume = 0; + Vnode = 2; + } else if (vc->mvstat == 2) { + tvp = afs_GetVolume(&vc->fid, 0, READ_LOCK); + if (tvp) { + Volume = tvp->mtpoint.Fid.Volume; + Vnode = tvp->mtpoint.Fid.Vnode; + afs_PutVolume(tvp, READ_LOCK); + } + } + } + else if (de->name[0] == '.' && de->name[1] == '.' && !de->name[2]) { + /* This is the '..' entry. Getting this right is very tricky, + * because we might be a volume root (so our parent is in a + * different volume), or our parent might be a volume root + * (so we actually want the mount point) or BOTH! */ + if (!FidCmp(&afs_rootFid, &vc->fid)) { + /* We are the root of the AFS root, and thus our own parent */ + Volume = 0; + Vnode = 2; + } else if (vc->mvstat == 2) { + /* We are a volume root, which means our parent is in another + * volume. Luckily, we should have his fid cached... */ + if (vc->mvid) { + if (!FidCmp(&afs_rootFid, vc->mvid)) { + /* Parent directory is the root of the AFS root */ + Volume = 0; + Vnode = 2; + } else if (vc->mvid->Fid.Vnode == 1 + && vc->mvid->Fid.Unique == 1) { + /* XXX The above test is evil and probably breaks DFS */ + /* Parent directory is the target of a mount point */ + tvp = afs_GetVolume(vc->mvid, 0, READ_LOCK); + if (tvp) { + Volume = tvp->mtpoint.Fid.Volume; + Vnode = tvp->mtpoint.Fid.Vnode; + afs_PutVolume(tvp, READ_LOCK); + } + } else { + /* Parent directory is not a volume root */ + Volume = vc->mvid->Fid.Volume; + Vnode = vc->mvid->Fid.Vnode; + } + } + } else if (de->fid.vnode == 1 && de->fid.vunique == 1) { + /* XXX The above test is evil and probably breaks DFS */ + /* Parent directory is a volume root; use the right inum */ + tvp = afs_GetVolume(&vc->fid, 0, READ_LOCK); + if (tvp) { + if (tvp->cell == afs_rootFid.Cell + && tvp->volume == afs_rootFid.Fid.Volume) { + /* Parent directory is the root of the AFS root */ + Volume = 0; + Vnode = 2; + } else { + /* Parent directory is the target of a mount point */ + Volume = tvp->mtpoint.Fid.Volume; + Vnode = tvp->mtpoint.Fid.Vnode; + } + afs_PutVolume(tvp, READ_LOCK); + } + } + } +#endif + #ifdef AFS_SGI53_ENV { afs_int32 use64BitDirent; @@ -328,8 +404,7 @@ afs_readdir_move(de, vc, auio, slen, rlen, off) if (use64BitDirent) { struct min_dirent sdirEntry; - sdirEntry.d_fileno = - (vc->fid.Fid.Volume << 16) + ntohl(de->fid.vnode); + sdirEntry.d_fileno = (Volume << 16) + ntohl(Vnode); FIXUPSTUPIDINODE(sdirEntry.d_fileno); sdirEntry.d_reclen = rlen; sdirEntry.d_off = (off_t) off; @@ -352,8 +427,7 @@ afs_readdir_move(de, vc, auio, slen, rlen, off) } } else { struct irix5_min_dirent sdirEntry; - sdirEntry.d_fileno = - (vc->fid.Fid.Volume << 16) + ntohl(de->fid.vnode); + sdirEntry.d_fileno = (Volume << 16) + ntohl(Vnode); FIXUPSTUPIDINODE(sdirEntry.d_fileno); sdirEntry.d_reclen = rlen; sdirEntry.d_off = (afs_int32) off; @@ -384,7 +458,7 @@ afs_readdir_move(de, vc, auio, slen, rlen, off) #else direntp = (struct dirent *)osi_AllocLargeSpace(AFS_LRALLOCSIZ); #endif - direntp->d_ino = (vc->fid.Fid.Volume << 16) + ntohl(de->fid.vnode); + direntp->d_ino = (Volume << 16) + ntohl(Vnode); FIXUPSTUPIDINODE(direntp->d_ino); #if defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL) direntp->d_offset = off; @@ -398,7 +472,7 @@ afs_readdir_move(de, vc, auio, slen, rlen, off) osi_FreeLargeSpace((char *)direntp); #else /* AFS_SUN5_ENV */ /* Note the odd mechanism for building the inode number */ - sdirEntry.d_fileno = (vc->fid.Fid.Volume << 16) + ntohl(de->fid.vnode); + sdirEntry.d_fileno = (Volume << 16) + ntohl(Vnode); FIXUPSTUPIDINODE(sdirEntry.d_fileno); sdirEntry.d_reclen = rlen; #if !defined(AFS_SGI_ENV) @@ -641,8 +715,8 @@ afs_readdir(OSI_VC_ARG(avc), auio, acred) origOffset = auio->afsio_offset; /* scan for the next interesting entry scan for in-use blob otherwise up point at * this blob note that ode, if non-zero, also represents a held dir page */ - if (!(us = BlobScan(&tdc->f, (origOffset >> 5))) - || !(nde = (struct DirEntry *)afs_dir_GetBlob(&tdc->f, us))) { + if (!(us = BlobScan(tdc, (origOffset >> 5))) + || !(nde = (struct DirEntry *)afs_dir_GetBlob(tdc, us))) { /* failed to setup nde, return what we've got, and release ode */ if (len) { /* something to hand over. */ @@ -932,8 +1006,8 @@ afs1_readdir(avc, auio, acred) /* scan for the next interesting entry scan for in-use blob otherwise up point at * this blob note that ode, if non-zero, also represents a held dir page */ - if (!(us = BlobScan(&tdc->f, (origOffset >> 5))) - || !(nde = (struct DirEntry *)afs_dir_GetBlob(&tdc->f, us))) { + if (!(us = BlobScan(tdc, (origOffset >> 5))) + || !(nde = (struct DirEntry *)afs_dir_GetBlob(tdc, us))) { /* failed to setup nde, return what we've got, and release ode */ if (len) { /* something to hand over. */ diff --git a/src/afs/VNOPS/afs_vnop_remove.c b/src/afs/VNOPS/afs_vnop_remove.c index 70521a5ae..409bd8b04 100644 --- a/src/afs/VNOPS/afs_vnop_remove.c +++ b/src/afs/VNOPS/afs_vnop_remove.c @@ -23,7 +23,7 @@ #include "afs/param.h" RCSID - ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_remove.c,v 1.31.2.2 2004/10/18 17:43:53 shadow Exp $"); + ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_remove.c,v 1.31.2.3 2004/11/09 17:15:04 shadow Exp $"); #include "afs/sysincludes.h" /* Standard vendor system headers */ #include "afsincludes.h" /* Afs-based standard headers */ @@ -154,10 +154,10 @@ afsremove(register struct vcache *adp, register struct dcache *tdc, UpgradeSToWLock(&tdc->lock, 637); if (afs_LocalHero(adp, tdc, &OutDirStatus, 1)) { /* we can do it locally */ - code = afs_dir_Delete(&tdc->f, aname); + code = afs_dir_Delete(tdc, aname); if (code) { ZapDCE(tdc); /* surprise error -- invalid value */ - DZap(&tdc->f); + DZap(tdc); } } if (tdc) { @@ -357,7 +357,7 @@ afs_remove(OSI_VC_ARG(adp), aname, acred) * done the work */ if (!tvc) if (tdc) { - code = afs_dir_Lookup(&tdc->f, aname, &unlinkFid.Fid); + code = afs_dir_Lookup(tdc, aname, &unlinkFid.Fid); if (code == 0) { afs_int32 cached = 0; diff --git a/src/afs/VNOPS/afs_vnop_rename.c b/src/afs/VNOPS/afs_vnop_rename.c index b23fc3eeb..2fa7af9af 100644 --- a/src/afs/VNOPS/afs_vnop_rename.c +++ b/src/afs/VNOPS/afs_vnop_rename.c @@ -18,7 +18,7 @@ #include "afs/param.h" RCSID - ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_rename.c,v 1.16.2.2 2004/10/18 17:43:53 shadow Exp $"); + ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_rename.c,v 1.16.2.3 2004/11/09 17:15:04 shadow Exp $"); #include "afs/sysincludes.h" /* Standard vendor system headers */ #include "afsincludes.h" /* Afs-based standard headers */ @@ -146,7 +146,7 @@ afsrename(struct vcache *aodp, char *aname1, struct vcache *andp, } if (code == 0) - code = afs_dir_Lookup(&tdc1->f, aname1, &fileFid.Fid); + code = afs_dir_Lookup(tdc1, aname1, &fileFid.Fid); if (code) { if (tdc1) { ReleaseWriteLock(&tdc1->lock); @@ -205,38 +205,38 @@ afsrename(struct vcache *aodp, char *aname1, struct vcache *andp, if (!doLocally) { if (tdc1) { ZapDCE(tdc1); - DZap(&tdc1->f); + DZap(tdc1); } if (tdc2) { ZapDCE(tdc2); - DZap(&tdc2->f); + DZap(tdc2); } } } /* now really do the work */ if (doLocally) { /* first lookup the fid of the dude we're moving */ - code = afs_dir_Lookup(&tdc1->f, aname1, &fileFid.Fid); + code = afs_dir_Lookup(tdc1, aname1, &fileFid.Fid); if (code == 0) { /* delete the source */ - code = afs_dir_Delete(&tdc1->f, aname1); + code = afs_dir_Delete(tdc1, aname1); } /* first see if target is there */ if (code == 0 - && afs_dir_Lookup(&tdc2->f, aname2, + && afs_dir_Lookup(tdc2, aname2, &unlinkFid.Fid) == 0) { /* target already exists, and will be unlinked by server */ - code = afs_dir_Delete(&tdc2->f, aname2); + code = afs_dir_Delete(tdc2, aname2); } if (code == 0) { - code = afs_dir_Create(&tdc2->f, aname2, &fileFid.Fid); + code = afs_dir_Create(tdc2, aname2, &fileFid.Fid); } if (code != 0) { ZapDCE(tdc1); - DZap(&tdc1->f); + DZap(tdc1); if (!oneDir) { ZapDCE(tdc2); - DZap(&tdc2->f); + DZap(tdc2); } } } @@ -339,7 +339,7 @@ afsrename(struct vcache *aodp, char *aname1, struct vcache *andp, if (tdc1) { ObtainWriteLock(&tdc1->lock, 648); ZapDCE(tdc1); /* mark as unknown */ - DZap(&tdc1->f); + DZap(tdc1); ReleaseWriteLock(&tdc1->lock); afs_PutDCache(tdc1); /* put it back */ } diff --git a/src/afs/VNOPS/afs_vnop_symlink.c b/src/afs/VNOPS/afs_vnop_symlink.c index 1710bc4e0..d0adc8b57 100644 --- a/src/afs/VNOPS/afs_vnop_symlink.c +++ b/src/afs/VNOPS/afs_vnop_symlink.c @@ -22,7 +22,7 @@ #include "afs/param.h" RCSID - ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_symlink.c,v 1.19.2.2 2004/10/18 17:43:53 shadow Exp $"); + ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_symlink.c,v 1.19.2.3 2004/11/09 17:15:04 shadow Exp $"); #include "afs/sysincludes.h" /* Standard vendor system headers */ #include "afsincludes.h" /* Afs-based standard headers */ @@ -184,10 +184,10 @@ int afs_symlink /* otherwise, we should see if we can make the change to the dir locally */ if (afs_LocalHero(adp, tdc, &OutDirStatus, 1)) { /* we can do it locally */ - code = afs_dir_Create(&tdc->f, aname, &newFid.Fid); + code = afs_dir_Create(tdc, aname, &newFid.Fid); if (code) { ZapDCE(tdc); /* surprise error -- use invalid value */ - DZap(&tdc->f); + DZap(tdc); } } if (tdc) { diff --git a/src/afs/afs.h b/src/afs/afs.h index 334277dd4..c5105aac8 100644 --- a/src/afs/afs.h +++ b/src/afs/afs.h @@ -1195,7 +1195,7 @@ struct afs_fakestat_state { extern int afs_fakestat_enable; struct buffer { - struct fcache *fid; + struct dcache *fid; afs_int32 page; afs_int32 accesstime; struct buffer *hashNext; diff --git a/src/afs/afs_buffer.c b/src/afs/afs_buffer.c index fdf1e5cf3..c193fe2e1 100644 --- a/src/afs/afs_buffer.c +++ b/src/afs/afs_buffer.c @@ -11,7 +11,7 @@ #include "afs/param.h" RCSID - ("$Header: /cvs/openafs/src/afs/afs_buffer.c,v 1.16.2.1 2004/10/18 07:11:45 shadow Exp $"); + ("$Header: /cvs/openafs/src/afs/afs_buffer.c,v 1.16.2.2 2004/11/09 17:14:57 shadow Exp $"); #include "afs/sysincludes.h" #include "afsincludes.h" @@ -63,7 +63,7 @@ RCSID /* page hash table size - this is pretty intertwined with pHash */ #define PHSIZE (PHPAGEMASK + PHFIDMASK + 1) /* the pHash macro */ -#define pHash(fid,page) ((((afs_int32)((fid)->inode)) & PHFIDMASK) \ +#define pHash(fid,page) ((((afs_int32)((fid)->f.inode)) & PHFIDMASK) \ | (page & PHPAGEMASK)) #ifdef dirty @@ -88,7 +88,7 @@ static int nbuffers; static afs_int32 timecounter; /* Prototypes for static routines */ -static struct buffer *afs_newslot(struct fcache * afid, afs_int32 apage, +static struct buffer *afs_newslot(struct dcache * afid, afs_int32 apage, register struct buffer *lp); static int dinit_flag = 0; @@ -150,7 +150,7 @@ DInit(int abuffers) } void * -DRead(register struct fcache * fid, register int page) +DRead(register struct dcache * fid, register int page) { /* Read a page from the disk. */ register struct buffer *tb, *tb2; @@ -224,13 +224,13 @@ DRead(register struct fcache * fid, register int page) MObtainWriteLock(&tb->lock, 260); MReleaseWriteLock(&afs_bufferLock); tb->lockers++; - if (page * AFS_BUFFER_PAGESIZE >= fid->chunkBytes) { + if (page * AFS_BUFFER_PAGESIZE >= fid->f.chunkBytes) { dirp_Zap(tb->fid); tb->lockers--; MReleaseWriteLock(&tb->lock); return NULL; } - tfile = afs_CFileOpen(fid->inode); + tfile = afs_CFileOpen(fid->f.inode); code = afs_CFileRead(tfile, tb->page * AFS_BUFFER_PAGESIZE, tb->data, AFS_BUFFER_PAGESIZE); @@ -273,7 +273,7 @@ FixupBucket(register struct buffer *ap) /* lp is pointer to a fairly-old buffer */ static struct buffer * -afs_newslot(struct fcache * afid, afs_int32 apage, register struct buffer *lp) +afs_newslot(struct dcache * afid, afs_int32 apage, register struct buffer *lp) { /* Find a usable buffer slot */ register afs_int32 i; @@ -340,7 +340,7 @@ afs_newslot(struct fcache * afid, afs_int32 apage, register struct buffer *lp) } if (lp->dirty) { - tfile = afs_CFileOpen(lp->fid->inode); + tfile = afs_CFileOpen(lp->fid->f.inode); afs_CFileWrite(tfile, lp->page * AFS_BUFFER_PAGESIZE, lp->data, AFS_BUFFER_PAGESIZE); lp->dirty = 0; @@ -432,7 +432,7 @@ DVOffset(register void *ap) * method of DRead... */ void -DZap(struct fcache * fid) +DZap(struct dcache * fid) { register int i; /* Destroy all buffers pertaining to a particular fid. */ @@ -469,7 +469,7 @@ DFlush(void) tb->lockers++; MReleaseReadLock(&afs_bufferLock); if (tb->dirty) { - tfile = afs_CFileOpen(tb->fid->inode); + tfile = afs_CFileOpen(tb->fid->f.inode); afs_CFileWrite(tfile, tb->page * AFS_BUFFER_PAGESIZE, tb->data, AFS_BUFFER_PAGESIZE); tb->dirty = 0; /* Clear the dirty flag */ @@ -484,7 +484,7 @@ DFlush(void) } void * -DNew(register struct fcache * fid, register int page) +DNew(register struct dcache * fid, register int page) { /* Same as read, only do *not* even try to read the page, since it probably doesn't exist. */ register struct buffer *tb; @@ -494,6 +494,11 @@ DNew(register struct fcache * fid, register int page) MReleaseWriteLock(&afs_bufferLock); return 0; } + /* extend the chunk, if needed */ + if ((page + 1) * AFS_BUFFER_PAGESIZE > fid->f.chunkBytes) { + afs_AdjustSize(fid, (page + 1) * AFS_BUFFER_PAGESIZE); + afs_WriteDCache(fid, 1); + } MObtainWriteLock(&tb->lock, 265); MReleaseWriteLock(&afs_bufferLock); tb->lockers++; diff --git a/src/afs/afs_dcache.c b/src/afs/afs_dcache.c index 858bdea7e..c6605e4cf 100644 --- a/src/afs/afs_dcache.c +++ b/src/afs/afs_dcache.c @@ -14,7 +14,7 @@ #include "afs/param.h" RCSID - ("$Header: /cvs/openafs/src/afs/afs_dcache.c,v 1.42.2.2 2004/10/18 17:43:49 shadow Exp $"); + ("$Header: /cvs/openafs/src/afs/afs_dcache.c,v 1.42.2.3 2004/11/09 17:14:57 shadow Exp $"); #include "afs/sysincludes.h" /*Standard vendor system headers */ #include "afsincludes.h" /*AFS-based standard headers */ @@ -686,7 +686,7 @@ afs_HashOutDCache(struct dcache *adc) AFS_STATCNT(afs_glink); #endif /* we know this guy's in the LRUQ. We'll move dude into DCQ below */ - DZap(&adc->f); + DZap(adc); /* if this guy is in the hash table, pull him out */ if (adc->f.fid.Fid.Volume != 0) { /* remove entry from first hash chains */ @@ -2038,7 +2038,7 @@ afs_GetDCache(register struct vcache *avc, afs_size_t abyte, * Right now, we only have one tool, and it's a hammer. So, we * fetch the whole file. */ - DZap(&tdc->f); /* pages in cache may be old */ + DZap(tdc); /* pages in cache may be old */ #ifdef IHINT if (file = tdc->ihint) { if (tdc->f.inode == file->inum) @@ -2415,7 +2415,7 @@ afs_GetDCache(register struct vcache *avc, afs_size_t abyte, afs_CFileClose(file); ZapDCE(tdc); /* sets DFEntryMod */ if (vType(avc) == VDIR) { - DZap(&tdc->f); + DZap(tdc); } ReleaseWriteLock(&tdc->lock); afs_PutDCache(tdc); diff --git a/src/afs/afs_nfsdisp.c b/src/afs/afs_nfsdisp.c index b4e93b47b..a90a41ab2 100644 --- a/src/afs/afs_nfsdisp.c +++ b/src/afs/afs_nfsdisp.c @@ -11,7 +11,7 @@ #include "afs/param.h" RCSID - ("$Header: /cvs/openafs/src/afs/afs_nfsdisp.c,v 1.18 2003/07/15 23:14:12 shadow Exp $"); + ("$Header: /cvs/openafs/src/afs/afs_nfsdisp.c,v 1.18.2.1 2004/11/09 17:18:18 shadow Exp $"); /* Ugly Ugly Ugly but precludes conflicting XDR macros; We want kernel xdr */ #define __XDR_INCLUDE__ @@ -747,6 +747,13 @@ afs_nfs3_noaccess(struct afs_nfs3_resp *resp) resp->flags = FALSE; } +void +afs_nfs3_notsupp(struct afs_nfs3_resp *resp) +{ + resp->status = NFS3ERR_NOTSUPP; + resp->flags = FALSE; +} + afs_int32 nfs3_to_afs_call(int which, caddr_t * args, nfs_fh3 ** fhpp, nfs_fh3 ** fh2pp) { @@ -1370,6 +1377,8 @@ afs_nfs3_readdirplus(char *args, char *xp, char *exp, char *rp, char *crp) crp); if (call > 1) afs_nfs3_noaccess((struct afs_nfs3_resp *)xp); + else if (call == 1) + afs_nfs3_notsupp((struct afs_nfs3_resp *)xp); else (*afs_rfs3_disp_tbl[NFSPROC3_READDIRPLUS].orig_proc) (args, xp, exp, rp, crp); diff --git a/src/afs/afs_osi_pag.c b/src/afs/afs_osi_pag.c index 6760c824d..b978da154 100644 --- a/src/afs/afs_osi_pag.c +++ b/src/afs/afs_osi_pag.c @@ -23,7 +23,7 @@ #include "afs/param.h" RCSID - ("$Header: /cvs/openafs/src/afs/afs_osi_pag.c,v 1.21.2.1 2004/10/18 07:11:45 shadow Exp $"); + ("$Header: /cvs/openafs/src/afs/afs_osi_pag.c,v 1.21.2.2 2004/11/09 17:09:39 shadow Exp $"); #include "afs/sysincludes.h" /* Standard vendor system headers */ #include "afsincludes.h" /* Afs-based standard headers */ @@ -160,7 +160,7 @@ afs_pag_wait(struct AFS_UCRED **acred) if(afs_pag_sleep(acred)) { if(!afs_pag_sleepcnt) { printf("%s() PAG throttling triggered, pid %d... sleeping. sleepcnt %d\n", - __func__, getpid(), afs_pag_sleepcnt); + "afs_pag_wait", getpid(), afs_pag_sleepcnt); } afs_pag_sleepcnt++; diff --git a/src/afs/afs_pioctl.c b/src/afs/afs_pioctl.c index ab8fb38ca..6b98bca28 100644 --- a/src/afs/afs_pioctl.c +++ b/src/afs/afs_pioctl.c @@ -11,7 +11,7 @@ #include "afs/param.h" RCSID - ("$Header: /cvs/openafs/src/afs/afs_pioctl.c,v 1.81.2.2 2004/10/18 17:43:49 shadow Exp $"); + ("$Header: /cvs/openafs/src/afs/afs_pioctl.c,v 1.81.2.3 2004/11/09 17:14:57 shadow Exp $"); #include "afs/sysincludes.h" /* Standard vendor system headers */ #ifdef AFS_OBSD_ENV @@ -1717,7 +1717,7 @@ DECL_PIOCTL(PNewStatMount) Check_AtSys(avc, ain, &sysState, areq); ObtainReadLock(&tdc->lock); do { - code = afs_dir_Lookup(&tdc->f, sysState.name, &tfid.Fid); + code = afs_dir_Lookup(tdc, sysState.name, &tfid.Fid); } while (code == ENOENT && Next_AtSys(avc, areq, &sysState)); ReleaseReadLock(&tdc->lock); afs_PutDCache(tdc); /* we're done with the data */ @@ -2397,7 +2397,7 @@ DECL_PIOCTL(PRemoveMount) Check_AtSys(avc, ain, &sysState, areq); ObtainReadLock(&tdc->lock); do { - code = afs_dir_Lookup(&tdc->f, sysState.name, &tfid.Fid); + code = afs_dir_Lookup(tdc, sysState.name, &tfid.Fid); } while (code == ENOENT && Next_AtSys(avc, areq, &sysState)); ReleaseReadLock(&tdc->lock); bufp = sysState.name; @@ -2468,10 +2468,10 @@ DECL_PIOCTL(PRemoveMount) ObtainWriteLock(&tdc->lock, 661); if (afs_LocalHero(avc, tdc, &OutDirStatus, 1)) { /* we can do it locally */ - code = afs_dir_Delete(&tdc->f, bufp); + code = afs_dir_Delete(tdc, bufp); if (code) { ZapDCE(tdc); /* surprise error -- invalid value */ - DZap(&tdc->f); + DZap(tdc); } } ReleaseWriteLock(&tdc->lock); @@ -3503,7 +3503,7 @@ DECL_PIOCTL(PFlushMount) Check_AtSys(avc, ain, &sysState, areq); ObtainReadLock(&tdc->lock); do { - code = afs_dir_Lookup(&tdc->f, sysState.name, &tfid.Fid); + code = afs_dir_Lookup(tdc, sysState.name, &tfid.Fid); } while (code == ENOENT && Next_AtSys(avc, areq, &sysState)); ReleaseReadLock(&tdc->lock); afs_PutDCache(tdc); /* we're done with the data */ diff --git a/src/afs/afs_prototypes.h b/src/afs/afs_prototypes.h index a185eaf4e..33464593c 100644 --- a/src/afs/afs_prototypes.h +++ b/src/afs/afs_prototypes.h @@ -31,12 +31,12 @@ extern void afs_FreeAllAxs(struct axscache **headp); /* afs_buffer.c */ extern void DInit(int abuffers); -extern void *DRead(register struct fcache * fid, register int page); +extern void *DRead(register struct dcache * fid, register int page); extern void DRelease(register struct buffer *bp, int flag); extern int DVOffset(register void *ap); -extern void DZap(struct fcache * fid); +extern void DZap(struct dcache * fid); extern void DFlush(void); -extern void *DNew(register struct fcache * fid, register int page); +extern void *DNew(register struct dcache * fid, register int page); extern void shutdown_bufferpackage(void); /* afs_call.c */ diff --git a/src/afs/afs_segments.c b/src/afs/afs_segments.c index b759abbc0..a76b229a0 100644 --- a/src/afs/afs_segments.c +++ b/src/afs/afs_segments.c @@ -14,7 +14,7 @@ #include "afs/param.h" RCSID - ("$Header: /cvs/openafs/src/afs/afs_segments.c,v 1.16.2.2 2004/10/18 17:43:50 shadow Exp $"); + ("$Header: /cvs/openafs/src/afs/afs_segments.c,v 1.16.2.3 2004/11/09 17:14:57 shadow Exp $"); #include "afs/sysincludes.h" /*Standard vendor system headers */ #include "afsincludes.h" /*AFS-based standard headers */ @@ -898,7 +898,7 @@ afs_InvalidateAllSegments(struct vcache *avc) ObtainWriteLock(&tdc->lock, 679); ZapDCE(tdc); if (vType(avc) == VDIR) - DZap(&tdc->f); + DZap(tdc); ReleaseWriteLock(&tdc->lock); afs_PutDCache(tdc); } diff --git a/src/cf/osconf.m4 b/src/cf/osconf.m4 index 5712e488c..24fcf675f 100644 --- a/src/cf/osconf.m4 +++ b/src/cf/osconf.m4 @@ -255,6 +255,19 @@ case $AFS_SYSNAME in SHLIB_LINKER="${MT_CC} -shared" ;; + ppc64_linux26) + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + PAM_CFLAGS="-g -O2 -Dlinux -DLINUX_PAM -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-g -O2 -D_LARGEFILE64_SOURCE" + YACC="bison -y" + SHLIB_LINKER="${MT_CC} -shared" + ;; + i386_umlinux22) CC="gcc -pipe" CCOBJ="gcc -pipe" diff --git a/src/config/NTMakefile.i386_nt40 b/src/config/NTMakefile.i386_nt40 index feae26095..59897addc 100644 --- a/src/config/NTMakefile.i386_nt40 +++ b/src/config/NTMakefile.i386_nt40 @@ -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=7200 +AFSPRODUCT_VER_PATCH=7400 AFSPRODUCT_VER_BUILD=0 # For MSI installer, each major release should have a different GUID diff --git a/src/config/afs_sysnames.h b/src/config/afs_sysnames.h index ac6d74cf1..26157d671 100644 --- a/src/config/afs_sysnames.h +++ b/src/config/afs_sysnames.h @@ -138,6 +138,7 @@ #define SYS_NAME_ID_ppc_linux2 1600 #define SYS_NAME_ID_ppc_linux22 1601 #define SYS_NAME_ID_ppc_linux24 1602 +#define SYS_NAME_ID_ppc_linux26 1603 #define SYS_NAME_ID_sparc_linux2 1700 #define SYS_NAME_ID_sparc_linux22 1701 diff --git a/src/config/param.ppc_linux26.h b/src/config/param.ppc_linux26.h new file mode 100644 index 000000000..fd32b6a0b --- /dev/null +++ b/src/config/param.ppc_linux26.h @@ -0,0 +1,140 @@ +#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 ppc 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_PPC_LINUX20_ENV 1 +#define AFS_PPC_LINUX22_ENV 1 +#define AFS_PPC_LINUX24_ENV 1 +#define AFS_PPC_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_ENV 1 +#define AFS_64BIT_CLIENT 1 +#define AFS_64BIT_IOPS_ENV 1 +#define AFS_NAMEI_ENV 1 /* User space interface to file system */ + +#if defined(__KERNEL__) && !defined(KDUMP_KERNEL) +#include + +#include +#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 __SMP__ +#define __SMP__ +#endif +#define AFS_GLOBAL_SUNLOCK +#endif + +#endif /* __KERNEL__ && !DUMP_KERNEL */ + +#include + +#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 "ppc_linux26" +#define SYS_NAME_ID SYS_NAME_ID_ppc_linux26 +#define AFSBIG_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 */ + +#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 ppc 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 + +#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 "ppc_linux26" +#define SYS_NAME_ID SYS_NAME_ID_ppc_linux26 +#define AFSBIG_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/packaging/MacOS/OpenAFS.Info.plist b/src/packaging/MacOS/OpenAFS.Info.plist index c50b1987d..2c1fab3f7 100644 --- a/src/packaging/MacOS/OpenAFS.Info.plist +++ b/src/packaging/MacOS/OpenAFS.Info.plist @@ -3,17 +3,17 @@ CFBundleGetInfoString - OpenAFS 1.2.10 + OpenAFS 1.3.74 CFBundleIdentifier org.openafs.OpenAFS.pkg CFBundleName OpenAFS CFBundleShortVersionString - 1.2.10 + 1.3.74 IFMajorVersion 1 IFMinorVersion - 2 + 3 IFPkgFlagAllowBackRev IFPkgFlagAuthorizationAction diff --git a/src/packaging/MacOS/OpenAFS.info b/src/packaging/MacOS/OpenAFS.info index f587cac92..805366ae0 100644 --- a/src/packaging/MacOS/OpenAFS.info +++ b/src/packaging/MacOS/OpenAFS.info @@ -1,5 +1,5 @@ Title OpenAFS -Version 1.2.6 +Version 1.3.74 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) diff --git a/src/rx/rx_getaddr.c b/src/rx/rx_getaddr.c index 08a7ac7eb..82b4c6c39 100644 --- a/src/rx/rx_getaddr.c +++ b/src/rx/rx_getaddr.c @@ -11,7 +11,7 @@ #include RCSID - ("$Header: /cvs/openafs/src/rx/rx_getaddr.c,v 1.15.2.1 2004/10/18 07:12:06 shadow Exp $"); + ("$Header: /cvs/openafs/src/rx/rx_getaddr.c,v 1.15.2.2 2004/11/09 17:16:12 shadow Exp $"); #ifndef AFS_DJGPP_ENV #ifndef KERNEL @@ -342,18 +342,22 @@ rx_getAllAddr_internal(afs_int32 buffer[], int maxSize, int loopbacks) for (cp = (char *)ifc.ifc_buf, cplim = ifc.ifc_buf + ifc.ifc_len; cp < cplim; #if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) - cp += _SIZEOF_ADDR_IFREQ(*ifr)) + cp += _SIZEOF_ADDR_IFREQ(*ifr) #else #ifdef AFS_AIX51_ENV - cp = cpnext) + cp = cpnext #else - cp += sizeof(ifr->ifr_name) + MAX(a->sin_len, sizeof(*a))) + cp += sizeof(ifr->ifr_name) + MAX(a->sin_len, sizeof(*a)) #endif +#endif + ) +#else + for (i = 0; i < len; ++i) #endif { +#if defined(AFS_AIX41_ENV) || defined (AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) ifr = (struct ifreq *)cp; #else - for (i = 0; i < len; ++i) { ifr = &ifs[i]; #endif a = (struct sockaddr_in *)&ifr->ifr_addr; @@ -367,8 +371,12 @@ rx_getAllAddr_internal(afs_int32 buffer[], int maxSize, int loopbacks) continue; /* ignore this address */ } if (a->sin_addr.s_addr != 0) { - if (!loopbacks && (ifr->ifr_flags & IFF_LOOPBACK)) { - continue; /* skip aliased loopbacks as well. */ + if (!loopbacks) { + if (a->sin_addr.s_addr == htonl(0x7f000001)) + continue; /* skip loopback address as well. */ + } else { + if (ifr->ifr_flags & IFF_LOOPBACK) + continue; /* skip aliased loopbacks as well. */ } if (count >= maxSize) /* no more space */ printf("Too many interfaces..ignoring 0x%x\n", diff --git a/src/sys/pioctl_nt.c b/src/sys/pioctl_nt.c index 7fcceb320..f4bbbc03a 100644 --- a/src/sys/pioctl_nt.c +++ b/src/sys/pioctl_nt.c @@ -11,7 +11,7 @@ #include RCSID - ("$Header: /cvs/openafs/src/sys/pioctl_nt.c,v 1.18.2.2 2004/10/18 17:44:02 shadow Exp $"); + ("$Header: /cvs/openafs/src/sys/pioctl_nt.c,v 1.18.2.3 2004/11/05 19:21:58 jaltman Exp $"); #include #include @@ -530,7 +530,7 @@ pioctl(char *pathp, long opcode, struct ViceIoctl *blobp, int follow) CloseHandle(reqHandle); errno = CMtoUNIXerror(temp); if ( IoctlDebug() ) - fprintf(stderr, "pioctl temp != 0: %d\r\n",temp); + fprintf(stderr, "pioctl temp != 0: 0x%X\r\n",temp); return -1; } diff --git a/src/ubik/ubik.p.h b/src/ubik/ubik.p.h index b69a66fe4..3999b7014 100644 --- a/src/ubik/ubik.p.h +++ b/src/ubik/ubik.p.h @@ -366,7 +366,7 @@ extern afs_int32 ugen_ClientInit(int noAuthFlag, char *confDir, char *cellName, struct ubik_client **uclientp, int (*secproc) (), char *funcName, afs_int32 gen_rxkad_level, - afs_int32 maxservers, afs_int32 serviceid, + afs_int32 maxservers, char *serviceid, afs_int32 deadtime, afs_uint32 server, afs_uint32 port, afs_int32 usrvid); diff --git a/src/ubik/uinit.c b/src/ubik/uinit.c index dd53bc95e..7e91bbb49 100644 --- a/src/ubik/uinit.c +++ b/src/ubik/uinit.c @@ -11,7 +11,7 @@ #include RCSID - ("$Header: /cvs/openafs/src/ubik/uinit.c,v 1.6.2.1 2004/10/18 07:12:16 shadow Exp $"); + ("$Header: /cvs/openafs/src/ubik/uinit.c,v 1.6.2.2 2004/11/09 17:09:41 shadow Exp $"); #include #ifdef AFS_NT40_ENV @@ -57,7 +57,7 @@ afs_int32 ugen_ClientInit(int noAuthFlag, char *confDir, char *cellName, afs_int32 sauth, struct ubik_client **uclientp, int (*secproc) (), char *funcName, afs_int32 gen_rxkad_level, - afs_int32 maxservers, afs_int32 serviceid, afs_int32 deadtime, + afs_int32 maxservers, char *serviceid, afs_int32 deadtime, afs_uint32 server, afs_uint32 port, afs_int32 usrvid) { afs_int32 code, scIndex, i; diff --git a/src/util/Makefile.in b/src/util/Makefile.in index 4ce6b9004..58ca05e0a 100644 --- a/src/util/Makefile.in +++ b/src/util/Makefile.in @@ -68,46 +68,46 @@ casestrcpy.o: ${srcdir}/casestrcpy.c ${includes} ${CCOBJ} ${CFLAGS} -c ${srcdir}/casestrcpy.c hputil.o: ${srcdir}/hputil.c ${includes} - ${CC} ${CFLAGS} -c ${srcdir}/hputil.c + ${CCOBJ} ${CFLAGS} -c ${srcdir}/hputil.c flipbase64.o: ${srcdir}/flipbase64.c ${includes} - ${CC} ${CFLAGS} -c ${srcdir}/flipbase64.c + ${CCOBJ} ${CFLAGS} -c ${srcdir}/flipbase64.c volparse.o: ${srcdir}/volparse.c ${includes} - ${CC} ${CFLAGS} -c ${srcdir}/volparse.c + ${CCOBJ} ${CFLAGS} -c ${srcdir}/volparse.c snprintf.o: ${srcdir}/snprintf.c ${includes} - ${CC} ${CFLAGS} -c ${srcdir}/snprintf.c + ${CCOBJ} ${CFLAGS} -c ${srcdir}/snprintf.c base64.o: ${srcdir}/base64.c ${includes} - ${CC} ${CFLAGS} -c ${srcdir}/base64.c + ${CCOBJ} ${CFLAGS} -c ${srcdir}/base64.c hostparse.o: ${srcdir}/hostparse.c ${includes} - ${CC} ${CFLAGS} -c ${srcdir}/hostparse.c + ${CCOBJ} ${CFLAGS} -c ${srcdir}/hostparse.c ktime.o: ${srcdir}/ktime.c ${includes} - ${CC} ${CFLAGS} -c ${srcdir}/ktime.c + ${CCOBJ} ${CFLAGS} -c ${srcdir}/ktime.c kreltime.o: ${srcdir}/kreltime.c ${includes} - ${CC} ${CFLAGS} -c ${srcdir}/kreltime.c + ${CCOBJ} ${CFLAGS} -c ${srcdir}/kreltime.c get_krbrlm.o: ${srcdir}/get_krbrlm.c ${includes} - ${CC} ${CFLAGS} -c ${srcdir}/get_krbrlm.c + ${CCOBJ} ${CFLAGS} -c ${srcdir}/get_krbrlm.c uuid.o: ${srcdir}/uuid.c ${includes} - ${CC} ${CFLAGS} -c ${srcdir}/uuid.c + ${CCOBJ} ${CFLAGS} -c ${srcdir}/uuid.c sys.o: ${srcdir}/sys.c AFS_component_version_number.c ${includes} - ${CC} ${CFLAGS} -c ${srcdir}/sys.c + ${CCOBJ} ${CFLAGS} -c ${srcdir}/sys.c sys: sys.o ${CC} ${LDFLAGS} -o sys sys.o isathing.o: ${srcdir}/isathing.c ${includes} - ${CC} ${CFLAGS} -c ${srcdir}/isathing.c + ${CCOBJ} ${CFLAGS} -c ${srcdir}/isathing.c serverLog.o: ${srcdir}/serverLog.c ${includes} - ${CC} ${CFLAGS} -c ${srcdir}/serverLog.c + ${CCOBJ} ${CFLAGS} -c ${srcdir}/serverLog.c dirpath.o: ${srcdir}/dirpath.c ${includes} ${CCOBJ} ${CFLAGS} -c ${srcdir}/dirpath.c @@ -116,19 +116,19 @@ fileutil.o: ${srcdir}/fileutil.c ${includes} ${CCOBJ} ${CFLAGS} -c ${srcdir}/fileutil.c netutils.o: ${srcdir}/netutils.c ${includes} - ${CC} ${CFLAGS} -c ${srcdir}/netutils.c + ${CCOBJ} ${CFLAGS} -c ${srcdir}/netutils.c afs_atomlist.o: ${srcdir}/afs_atomlist.c ${includes} - ${CC} ${CFLAGS} -c ${srcdir}/afs_atomlist.c + ${CCOBJ} ${CFLAGS} -c ${srcdir}/afs_atomlist.c afs_lhash.o: ${srcdir}/afs_lhash.c ${includes} - ${CC} ${CFLAGS} -c ${srcdir}/afs_lhash.c + ${CCOBJ} ${CFLAGS} -c ${srcdir}/afs_lhash.c strlcat.o: ${srcdir}/strlcat.c ${includes} - ${CC} ${CFLAGS} -c ${srcdir}/strlcat.c + ${CCOBJ} ${CFLAGS} -c ${srcdir}/strlcat.c strlcpy.o: ${srcdir}/strlcpy.c ${includes} - ${CC} ${CFLAGS} -c ${srcdir}/strlcpy.c + ${CCOBJ} ${CFLAGS} -c ${srcdir}/strlcpy.c # # Install targets diff --git a/src/vfsck/fsck.h b/src/vfsck/fsck.h index b6427a388..52479c24a 100644 --- a/src/vfsck/fsck.h +++ b/src/vfsck/fsck.h @@ -325,3 +325,9 @@ daddr_t n_cont; /* number of continuation inodes seen */ #define fs_link fs_unused[0] #define fs_rlink fs_unused[1] #endif /* AFS_HPUX110_ENV */ + +#ifdef AFS_SUN59_ENV +/* diskaddr_t is longlong */ +int bread(int fd, char *buf, diskaddr_t blk, long size); +int bwrite(int fd, char *buf, diskaddr_t blk, long size); +#endif diff --git a/src/vfsck/utilities.c b/src/vfsck/utilities.c index 19a73a248..7770910d2 100644 --- a/src/vfsck/utilities.c +++ b/src/vfsck/utilities.c @@ -19,7 +19,7 @@ #include RCSID - ("$Header: /cvs/openafs/src/vfsck/utilities.c,v 1.5 2003/07/15 23:17:27 shadow Exp $"); + ("$Header: /cvs/openafs/src/vfsck/utilities.c,v 1.5.2.1 2004/11/09 17:18:48 shadow Exp $"); #include #define VICE /* allow us to put our changes in at will */ @@ -388,7 +388,11 @@ ckfini() bread(fd, buf, blk, size) int fd; char *buf; +#ifdef AFS_SUN59_ENV + diskaddr_t blk; +#else daddr_t blk; +#endif long size; { char *cp; @@ -451,7 +455,11 @@ bread(fd, buf, blk, size) bwrite(fd, buf, blk, size) int fd; char *buf; +#ifdef AFS_SUN59_ENV + diskaddr_t blk; +#else daddr_t blk; +#endif long size; { int i, n; diff --git a/src/viced/afsfileprocs.c b/src/viced/afsfileprocs.c index 9b9dec575..ee5b2a450 100644 --- a/src/viced/afsfileprocs.c +++ b/src/viced/afsfileprocs.c @@ -29,7 +29,7 @@ #include RCSID - ("$Header: /cvs/openafs/src/viced/afsfileprocs.c,v 1.81 2004/06/02 08:23:39 shadow Exp $"); + ("$Header: /cvs/openafs/src/viced/afsfileprocs.c,v 1.81.2.1 2004/10/28 20:47:23 shadow Exp $"); #include #include @@ -2732,6 +2732,7 @@ SRXAFS_InlineBulkStatus(struct rx_call * acall, struct AFSCBFids * Fids, &rights, &anyrights))) { tstatus = &OutStats->AFSBulkStats_val[i]; tstatus->errorCode = errorCode; + PutVolumePackage(parentwhentargetnotdir, targetptr, (Vnode *) 0, volptr); parentwhentargetnotdir = (Vnode *) 0; targetptr = (Vnode *) 0; volptr = (Volume *) 0; diff --git a/src/viced/callback.c b/src/viced/callback.c index e28fca63d..585f8aa04 100644 --- a/src/viced/callback.c +++ b/src/viced/callback.c @@ -83,7 +83,7 @@ #include RCSID - ("$Header: /cvs/openafs/src/viced/callback.c,v 1.55.2.1 2004/10/18 07:12:22 shadow Exp $"); + ("$Header: /cvs/openafs/src/viced/callback.c,v 1.55.2.4 2004/11/09 17:17:49 shadow Exp $"); #include #include /* for malloc() */ @@ -572,6 +572,7 @@ XCallBackBulk_r(struct host * ahost, struct AFSFid * fids, afs_int32 nfids) struct AFSCBs tc; int code; int j; + struct rx_connection *cb_conn = NULL; #ifdef ADAPT_MTU rx_SetConnDeadTime(ahost->callback_rxcon, 4); @@ -594,8 +595,12 @@ XCallBackBulk_r(struct host * ahost, struct AFSFid * fids, afs_int32 nfids) tc.AFSCBs_len = i; tc.AFSCBs_val = tcbs; + cb_conn = ahost->callback_rxcon; + rx_GetConnection(cb_conn); H_UNLOCK; - code |= RXAFSCB_CallBack(ahost->callback_rxcon, &tf, &tc); + code |= RXAFSCB_CallBack(cb_conn, &tf, &tc); + rx_PutConnection(cb_conn); + cb_conn = NULL; H_LOCK; } @@ -855,11 +860,20 @@ MultiBreakCallBack_r(struct cbstruct cba[], int ncbas, struct host *hp; hp = cba[i].hp; if (hp && xhost != hp) { - rx_PutConnection(hp->callback_rxcon); h_Release_r(hp); } } + /* H_UNLOCK around this so h_FreeConnection does not deadlock. + h_FreeConnection should *never* be called on a callback connection, + but on 10/27/04 a deadlock occurred where it was, when we know why, + this should be reverted. -- shadow */ + H_UNLOCK; + for (i = 0; i < j; i++) { + rx_PutConnection(conns[i]); + } + H_LOCK; + return; } @@ -1076,21 +1090,24 @@ BreakDelayedCallBacks_r(struct host *host) struct CallBack *cb; int code; char hoststr[16]; + struct rx_connection *cb_conn; cbstuff.nbreakers++; if (!(host->hostFlags & RESETDONE) && !(host->hostFlags & HOSTDELETED)) { host->hostFlags &= ~ALTADDR; /* alterrnate addresses are invalid */ + cb_conn = host->callback_rxcon; + rx_GetConnection(cb_conn); if (host->interface) { H_UNLOCK; code = - RXAFSCB_InitCallBackState3(host->callback_rxcon, - &FS_HostUUID); - H_LOCK; + RXAFSCB_InitCallBackState3(cb_conn, &FS_HostUUID); } else { H_UNLOCK; - code = RXAFSCB_InitCallBackState(host->callback_rxcon); - H_LOCK; + code = RXAFSCB_InitCallBackState(cb_conn); } + rx_PutConnection(cb_conn); + cb_conn = NULL; + H_LOCK; host->hostFlags |= ALTADDR; /* alternate addresses are valid */ if (code) { if (ShowProblems) { @@ -1626,6 +1643,7 @@ ClearHostCallbacks_r(struct host *hp, int locked) int code; int held = 0; char hoststr[16]; + struct rx_connection *cb_conn = NULL; ViceLog(5, ("GSS: Delete longest inactive host %s\n", @@ -1661,16 +1679,19 @@ ClearHostCallbacks_r(struct host *hp, int locked) } else { /* host is up, try a call */ hp->hostFlags &= ~ALTADDR; /* alternate addresses are invalid */ + cb_conn = hp->callback_rxcon; + rx_GetConnection(hp->callback_rxcon); if (hp->interface) { H_UNLOCK; code = - RXAFSCB_InitCallBackState3(hp->callback_rxcon, &FS_HostUUID); - H_LOCK; + RXAFSCB_InitCallBackState3(cb_conn, &FS_HostUUID); } else { H_UNLOCK; - code = RXAFSCB_InitCallBackState(hp->callback_rxcon); - H_LOCK; + code = RXAFSCB_InitCallBackState(cb_conn); } + rx_PutConnection(cb_conn); + cb_conn = NULL; + H_LOCK; hp->hostFlags |= ALTADDR; /* alternate addresses are valid */ if (code) { /* failed, mark host down and need reset */ diff --git a/src/viced/host.c b/src/viced/host.c index 8e4fc8220..ed15b32c6 100644 --- a/src/viced/host.c +++ b/src/viced/host.c @@ -11,7 +11,7 @@ #include RCSID - ("$Header: /cvs/openafs/src/viced/host.c,v 1.57.2.1 2004/10/18 07:12:22 shadow Exp $"); + ("$Header: /cvs/openafs/src/viced/host.c,v 1.57.2.2 2004/11/09 17:17:49 shadow Exp $"); #include #include @@ -947,6 +947,7 @@ h_GetHost_r(struct rx_connection *tcon) afs_int32 hport; char hoststr[16], hoststr2[16]; Capabilities caps; + struct rx_connection *cb_conn = NULL; caps.Capabilities_val = NULL; @@ -979,11 +980,15 @@ h_GetHost_r(struct rx_connection *tcon) goto retry; } host->hostFlags &= ~ALTADDR; + cb_conn = host->callback_rxcon; + rx_GetConnection(cb_conn); H_UNLOCK; code = - RXAFSCB_TellMeAboutYourself(host->callback_rxcon, &interf, &caps); + RXAFSCB_TellMeAboutYourself(cb_conn, &interf, &caps); if (code == RXGEN_OPCODE) - code = RXAFSCB_WhoAreYou(host->callback_rxcon, &interf); + code = RXAFSCB_WhoAreYou(cb_conn, &interf); + rx_PutConnection(cb_conn); + cb_conn=NULL; H_LOCK; if (code == RXGEN_OPCODE) { identP = (struct Identity *)malloc(sizeof(struct Identity)); @@ -1098,12 +1103,15 @@ h_GetHost_r(struct rx_connection *tcon) h_gethostcps_r(host, FT_ApproxTime()); if (!(host->Console & 1)) { int pident = 0; + cb_conn = host->callback_rxcon; + rx_GetConnection(cb_conn); H_UNLOCK; code = - RXAFSCB_TellMeAboutYourself(host->callback_rxcon, &interf, - &caps); + RXAFSCB_TellMeAboutYourself(cb_conn, &interf, &caps); if (code == RXGEN_OPCODE) - code = RXAFSCB_WhoAreYou(host->callback_rxcon, &interf); + code = RXAFSCB_WhoAreYou(cb_conn, &interf); + rx_PutConnection(cb_conn); + cb_conn=NULL; H_LOCK; if (code == RXGEN_OPCODE) { if (!identP) @@ -1146,8 +1154,12 @@ h_GetHost_r(struct rx_connection *tcon) ntohs(host->port))); } if (code == 0 && !identP->valid) { + cb_conn = host->callback_rxcon; + rx_GetConnection(cb_conn); H_UNLOCK; - code = RXAFSCB_InitCallBackState(host->callback_rxcon); + code = RXAFSCB_InitCallBackState(cb_conn); + rx_PutConnection(cb_conn); + cb_conn=NULL; H_LOCK; } else if (code == 0) { oldHost = h_LookupUuid_r(&identP->uuid); @@ -1172,10 +1184,14 @@ h_GetHost_r(struct rx_connection *tcon) } else { /* This really is a new host */ hashInsertUuid_r(&identP->uuid, host); + cb_conn = host->callback_rxcon; + rx_GetConnection(cb_conn); H_UNLOCK; code = - RXAFSCB_InitCallBackState3(host->callback_rxcon, + RXAFSCB_InitCallBackState3(cb_conn, &FS_HostUUID); + rx_PutConnection(cb_conn); + cb_conn=NULL; H_LOCK; if (code == 0) { ViceLog(25, @@ -2043,6 +2059,7 @@ int CheckHost(register struct host *host, int held) { register struct client *client; + struct rx_connection *cb_conn = NULL; int code; /* Host is held by h_Enumerate */ @@ -2055,6 +2072,8 @@ CheckHost(register struct host *host, int held) } if (host->LastCall < checktime) { h_Lock_r(host); + cb_conn = host->callback_rxcon; + rx_GetConnection(cb_conn); if (!(host->hostFlags & HOSTDELETED)) { if (host->LastCall < clientdeletetime) { host->hostFlags |= HOSTDELETED; @@ -2063,13 +2082,13 @@ CheckHost(register struct host *host, int held) if (host->interface) { H_UNLOCK; code = - RXAFSCB_InitCallBackState3(host->callback_rxcon, + RXAFSCB_InitCallBackState3(cb_conn, &FS_HostUUID); H_LOCK; } else { H_UNLOCK; code = - RXAFSCB_InitCallBackState(host->callback_rxcon); + RXAFSCB_InitCallBackState(cb_conn); H_LOCK; } host->hostFlags |= ALTADDR; /* alternate addresses valid */ @@ -2093,7 +2112,7 @@ CheckHost(register struct host *host, int held) if (host->interface) { afsUUID uuid = host->interface->uuid; H_UNLOCK; - code = RXAFSCB_ProbeUuid(host->callback_rxcon, &uuid); + code = RXAFSCB_ProbeUuid(cb_conn, &uuid); H_LOCK; if (code) { if (MultiProbeAlternateAddress_r(host)) { @@ -2107,7 +2126,7 @@ CheckHost(register struct host *host, int held) } } else { H_UNLOCK; - code = RXAFSCB_Probe(host->callback_rxcon); + code = RXAFSCB_Probe(cb_conn); H_LOCK; if (code) { char hoststr[16]; @@ -2121,6 +2140,10 @@ CheckHost(register struct host *host, int held) } } } + H_UNLOCK; + rx_PutConnection(cb_conn); + cb_conn=NULL; + H_LOCK; h_Unlock_r(host); } H_UNLOCK; diff --git a/src/vol/namei_ops.c b/src/vol/namei_ops.c index 7b7a9c191..418eba779 100644 --- a/src/vol/namei_ops.c +++ b/src/vol/namei_ops.c @@ -13,7 +13,7 @@ #include RCSID - ("$Header: /cvs/openafs/src/vol/namei_ops.c,v 1.21.2.2 2004/10/18 17:44:06 shadow Exp $"); + ("$Header: /cvs/openafs/src/vol/namei_ops.c,v 1.21.2.3 2004/11/09 17:16:40 shadow Exp $"); #ifdef AFS_NAMEI_ENV #include @@ -229,7 +229,8 @@ namei_HandleToName(namei_t * name, IHandle_t * ih) * name space. */ #define VICE_README "These files and directories are a part of the AFS \ -namespace. Modifying them\nin any way will result in loss of AFS data.\n" +namespace. Modifying them\nin any way will result in loss of AFS data,\n\ +ownership and permissions included.\n" int namei_ViceREADME(char *partition) { diff --git a/src/vol/vol-salvage.c b/src/vol/vol-salvage.c index f5f65926e..3066720c6 100644 --- a/src/vol/vol-salvage.c +++ b/src/vol/vol-salvage.c @@ -92,7 +92,7 @@ Vnodes with 0 inode pointers in RW volumes are now deleted. #include RCSID - ("$Header: /cvs/openafs/src/vol/vol-salvage.c,v 1.41.2.2 2004/10/18 17:44:06 shadow Exp $"); + ("$Header: /cvs/openafs/src/vol/vol-salvage.c,v 1.41.2.3 2004/11/09 17:20:26 shadow Exp $"); #include #include @@ -1589,7 +1589,8 @@ GetInodeSummary(char *path, VolumeId singleVolumeNumber) } if (!canfork || debug || Fork() == 0) { int nInodes; - nInodes = status.st_size / sizeof(struct ViceInodeInfo); + unsigned long st_size=(unsigned long) status.st_size; + nInodes = st_size / sizeof(struct ViceInodeInfo); if (nInodes == 0) { fclose(summaryFile); close(inodeFd); @@ -1598,7 +1599,7 @@ GetInodeSummary(char *path, VolumeId singleVolumeNumber) RemoveTheForce(fileSysPath); else { struct VolumeSummary *vsp; - int i, j; + int i; GetVolumeSummary(singleVolumeNumber); @@ -1611,7 +1612,7 @@ GetInodeSummary(char *path, VolumeId singleVolumeNumber) singleVolumeNumber ? "No applicable" : "No", dev); return -1; } - ip = (struct ViceInodeInfo *)malloc(status.st_size); + ip = (struct ViceInodeInfo *)malloc(nInodes*sizeof(struct ViceInodeInfo)); if (ip == NULL) { fclose(summaryFile); close(inodeFd); @@ -1621,7 +1622,7 @@ GetInodeSummary(char *path, VolumeId singleVolumeNumber) ("Unable to allocate enough space to read inode table; %s not salvaged\n", dev); } - if (read(inodeFd, ip, status.st_size) != status.st_size) { + if (read(inodeFd, ip, st_size) != st_size) { fclose(summaryFile); close(inodeFd); unlink(path); @@ -1630,7 +1631,7 @@ GetInodeSummary(char *path, VolumeId singleVolumeNumber) } qsort(ip, nInodes, sizeof(struct ViceInodeInfo), CompareInodes); if (afs_lseek(inodeFd, 0, SEEK_SET) == -1 - || write(inodeFd, ip, status.st_size) != status.st_size) { + || write(inodeFd, ip, st_size) != st_size) { fclose(summaryFile); close(inodeFd); unlink(path); @@ -1673,14 +1674,16 @@ GetInodeSummary(char *path, VolumeId singleVolumeNumber) assert(afs_fstat(fileno(summaryFile), &status) != -1); if (status.st_size != 0) { int ret; - inodeSummary = (struct InodeSummary *)malloc(status.st_size); + unsigned long st_status=(unsigned long)status.st_size; + inodeSummary = (struct InodeSummary *)malloc(st_status); assert(inodeSummary != NULL); /* For GNU we need to do lseek to get the file pointer moved. */ assert(afs_lseek(fileno(summaryFile), 0, SEEK_SET) == 0); - ret = read(fileno(summaryFile), inodeSummary, status.st_size); - assert(ret == status.st_size); + ret = read(fileno(summaryFile), inodeSummary, st_status); + assert(ret == st_status); } - nVolumesInInodeFile = status.st_size / sizeof(struct InodeSummary); + nVolumesInInodeFile =(unsigned long)(status.st_size) / sizeof(struct InodeSummary); + Log("%d nVolumesInInodeFile %d \n",nVolumesInInodeFile,(unsigned long)(status.st_size)); fclose(summaryFile); close(inodeFd); unlink(summaryFileName); @@ -2026,6 +2029,7 @@ DoSalvageVolumeGroup(register struct InodeSummary *isp, int nVols) /* Fix actual inode counts */ if (!Showmode) { + Log("totalInodes %d\n",totalInodes); for (ip = inodes; totalInodes; ip++, totalInodes--) { static int TraceBadLinkCounts = 0; #ifdef AFS_NAMEI_ENV @@ -2061,6 +2065,8 @@ DoSalvageVolumeGroup(register struct InodeSummary *isp, int nVols) } ip->linkCount++; } + + Log("%d inodes to process\n",totalInodes); } #ifdef AFS_NAMEI_ENV while (dec_VGLinkH > 0) { diff --git a/src/volser/volprocs.c b/src/volser/volprocs.c index 796d31cf4..ad7b52a87 100644 --- a/src/volser/volprocs.c +++ b/src/volser/volprocs.c @@ -11,7 +11,7 @@ #include RCSID - ("$Header: /cvs/openafs/src/volser/volprocs.c,v 1.34.2.1 2004/10/18 07:12:29 shadow Exp $"); + ("$Header: /cvs/openafs/src/volser/volprocs.c,v 1.34.2.2 2004/11/09 17:13:45 shadow Exp $"); #include #include @@ -1540,6 +1540,10 @@ VolSetInfo(struct rx_call *acid, afs_int32 atrans, td->maxquota = astatus->maxquota; if (astatus->dayUse != -1) td->dayUse = astatus->dayUse; + if (astatus->creationDate != -1) + td->creationDate = astatus->creationDate; + if (astatus->updateDate != -1) + td->updateDate = astatus->updateDate; VUpdateVolume(&error, tv); tt->rxCallPtr = (struct rx_call *)0; if (TRELE(tt)) diff --git a/src/volser/volser_prototypes.h b/src/volser/volser_prototypes.h index 6d2de8843..07c49c8a9 100644 --- a/src/volser/volser_prototypes.h +++ b/src/volser/volser_prototypes.h @@ -17,6 +17,7 @@ struct nvldbentry; extern void MapPartIdIntoName(afs_int32 partId, char *partName); extern int yesprompt(char *str); extern int PrintError(char *msg, afs_int32 errcode); +extern void init_volintInfo(struct volintInfo *vinfo); extern int UV_SetSecurity(register struct rx_securityClass *as, afs_int32 aindex); extern struct rx_connection *UV_Bind(afs_int32 aserver, afs_int32 port); diff --git a/src/volser/vos.c b/src/volser/vos.c index 1213db1b2..02f367e93 100644 --- a/src/volser/vos.c +++ b/src/volser/vos.c @@ -11,7 +11,7 @@ #include RCSID - ("$Header: /cvs/openafs/src/volser/vos.c,v 1.40.2.1 2004/08/17 04:28:45 jaltman Exp $"); + ("$Header: /cvs/openafs/src/volser/vos.c,v 1.40.2.2 2004/11/09 17:13:45 shadow Exp $"); #include #ifdef AFS_NT40_ENV @@ -499,11 +499,15 @@ DisplayFormat(pntr, server, part, totalOK, totalNotOK, totalBusy, fast, fprintf(STDOUT, " Last Access %s", ctime((time_t *) & pntr->accessDate)); #endif - fprintf(STDOUT, " Last Update %s", - ctime((time_t *) & pntr->updateDate)); - fprintf(STDOUT, - " %d accesses in the past day (i.e., vnode references)\n", - pntr->dayUse); + if (!pntr->updateDate) + fprintf(STDOUT, " Last Update Never\n"); + else { + fprintf(STDOUT, " Last Update %s", + ctime((time_t *) & pntr->updateDate)); + fprintf(STDOUT, + " %d accesses in the past day (i.e., vnode references)\n", + pntr->dayUse); + } } else if (pntr->status == VBUSY) { *totalBusy += 1; qPut(&busyHead, pntr->volid); @@ -652,11 +656,15 @@ XDisplayFormat(a_xInfoP, a_servID, a_partID, a_totalOKP, a_totalNotOKP, fprintf(STDOUT, " Last Access %s", ctime((time_t *) & a_xInfoP->accessDate)); #endif - fprintf(STDOUT, " Last Update %s", - ctime((time_t *) & a_xInfoP->updateDate)); - fprintf(STDOUT, - " %d accesses in the past day (i.e., vnode references)\n", - a_xInfoP->dayUse); + if (!a_xInfoP->updateDate) + fprintf(STDOUT, " Last Update Never\n"); + else { + fprintf(STDOUT, " Last Update %s", + ctime((time_t *) & a_xInfoP->updateDate)); + fprintf(STDOUT, + " %d accesses in the past day (i.e., vnode references)\n", + a_xInfoP->dayUse); + } /* * Print all the read/write and authorship stats. @@ -1388,16 +1396,9 @@ SetFields(as) return (ENOENT); } - memset(&info, 0, sizeof(info)); + init_volintInfo(&info); info.volid = volid; info.type = RWVOL; - info.dayUse = -1; - info.maxquota = -1; - info.flags = -1; - info.spare0 = -1; - info.spare1 = -1; - info.spare2 = -1; - info.spare3 = -1; if (as->parms[1].items) { /* -max */ diff --git a/src/volser/vsprocs.c b/src/volser/vsprocs.c index 5ae87bc15..907458333 100644 --- a/src/volser/vsprocs.c +++ b/src/volser/vsprocs.c @@ -11,7 +11,7 @@ #include RCSID - ("$Header: /cvs/openafs/src/volser/vsprocs.c,v 1.33 2004/07/29 03:44:08 shadow Exp $"); + ("$Header: /cvs/openafs/src/volser/vsprocs.c,v 1.33.2.1 2004/11/09 17:13:45 shadow Exp $"); #include #include @@ -406,6 +406,19 @@ PrintError(char *msg, afs_int32 errcode) return 0; } +void init_volintInfo(struct volintInfo *vinfo) { + memset(vinfo, 0, sizeof(struct volintInfo)); + + vinfo->maxquota = -1; + vinfo->dayUse = -1; + vinfo->creationDate = -1; + vinfo->updateDate = -1; + vinfo->flags = -1; + vinfo->spare0 = -1; + vinfo->spare1 = -1; + vinfo->spare2 = -1; + vinfo->spare3 = -1; +} static struct rx_securityClass *uvclass = 0; static int uvindex = -1; @@ -624,8 +637,8 @@ UV_CreateVolume2(afs_int32 aserver, afs_int32 apart, char *aname, tid = 0; aconn = (struct rx_connection *)0; error = 0; - memset(&tstatus, 0, sizeof(struct volintInfo)); - tstatus.dayUse = -1; + + init_volintInfo(&tstatus); tstatus.maxquota = aquota; aconn = UV_Bind(aserver, AFSCONF_VOLUMEPORT); @@ -1338,6 +1351,8 @@ UV_MoveVolume2(afs_int32 afromvol, afs_int32 afromserver, afs_int32 afrompart, infop = (volintInfo *) volumeInfo.volEntries_val; infop->maxquota = -1; /* Else it will replace the default quota */ + infop->creationDate = -1; /* Else it will use the source creation date */ + infop->updateDate = -1; /* Else it will use the source update date */ #endif /* create a volume on the target machine */ @@ -4237,9 +4252,7 @@ UV_RestoreVolume(afs_int32 toserver, afs_int32 topart, afs_int32 tovolid, goto refail; } - memset(&vinfo, 0, sizeof(struct volintInfo)); - vinfo.dayUse = -1; - vinfo.maxquota = -1; + init_volintInfo(&vinfo); vinfo.creationDate = newCreateDate; vinfo.updateDate = newUpdateDate; code = AFSVolSetInfo(toconn, totid, &vinfo);