]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Merge changes for openafs 1.2.8
authorSam Hartman <hartmans@debian.org>
Wed, 11 Dec 2002 03:00:40 +0000 (03:00 +0000)
committerSam Hartman <hartmans@debian.org>
Wed, 11 Dec 2002 03:00:40 +0000 (03:00 +0000)
NEWS
src/WINNT/afs_setup_utils/lang/zh_CN/afs_setup_utils.rc [deleted file]
src/afs/LINUX/osi_module.c
src/afs/LINUX/osi_vnodeops.c
src/afs/VNOPS/afs_vnop_lookup.c
src/afs/VNOPS/afs_vnop_readdir.c
src/libafs/MakefileProto.LINUX.in
src/rx/rx.c
src/viced/afsfileprocs.c

diff --git a/NEWS b/NEWS
index 9981852192dfb2c05acbae34dedcc8c428b90d9a..4246519ee2bb3aa37cf1fda8edd6ca2366a1cd92 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,21 @@
-OpenAFS News -- history of user-visible changes.  September 25, 2002.
+OpenAFS News -- history of user-visible changes.  December 9, 2002.
+
+* Changes incorporated in OpenAFS 1.2.8
+
+** Mountpoint directory information is now only faked for cross-cell
+   mountpoits when using the -fakestat flag (e.g. for the directories
+   under /afs, but not for most other volumes mounted inside the cell).
+   The -fakestat-all switch can be used to fake information for all
+   mountpoints.
+
+** HPUX 11.0 is now supported.
+
+** It is now possible for AFS to use Kerberos 5 directly, via rxkad 2b.
+   See the OpenAFS 1.2.8 Release Notes for more information on using this
+   capability.
+
+** An NFS translator kernel module is now included and compiled by default
+   for Solaris only.
 
 * Changes incorporated in OpenAFS 1.2.7
 
diff --git a/src/WINNT/afs_setup_utils/lang/zh_CN/afs_setup_utils.rc b/src/WINNT/afs_setup_utils/lang/zh_CN/afs_setup_utils.rc
deleted file mode 100644 (file)
index 7d6d443..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Copyright 2000, International Business Machines Corporation and others.
- * All Rights Reserved.
- * 
- * This software has been released under the terms of the IBM Public
- * License.  For details, see the LICENSE file in the top-level source
- * directory or online at http://www.openafs.org/dl/license10.html
- */
-
-#include <resource.h>
-
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 2 resource.
-//
-#include <windows.h>
-#define  AFS_VERINFO_FILE_DESCRIPTION "AFS °²×°ÊµÓóÌÐò DLL"
-#include "AFS_component_version_number.h"
-#include "..\..\..\..\config\NTVersioninfo.rc"
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// String Table
-//
-STRINGTABLE DISCARDABLE 
-BEGIN
-    IDS_INSTALLATION_FAILURE "·¢ÉúÒ»¸ö´íÎó£º%s (%ld)¡£"
-    IDS_SCM_OPEN_FAILED     "´ò¿ª¡°·þÎñ¿ØÖƹÜÀíÆ÷¡±Ê§°Ü"
-    IDS_SERVICE_CREATE_FAILED "´´½¨·þÎñʧ°Ü"
-    IDS_SERVICE_OPEN_FAILED "´ò¿ª·þÎñʧ°Ü"
-    IDS_SERVICE_QUERY_FAILED "²éѯ·þÎñ״̬ʧ°Ü"
-    IDS_SERVICE_STOP_FAILED "Í£Ö¹·þÎñʧ°Ü"
-    IDS_SERVICE_DELETE_FAILED "ɾ³ý·þÎñʧ°Ü"
-    IDS_REG_DELETE_VALUE_ERROR "ɾ³ý×¢²á±íÌõĿʧ°Ü"
-    IDS_SERVICE_ENABLE_FAILED "ÆôÓ÷þÎñʧ°Ü"
-    IDS_OLE_DLL_INSTALL_FAILED "°²×° OLE DLL Ê§°Ü"
-    IDS_OLE_DLL_UNINSTALL_FAILED "жװ OLE DLL Ê§°Ü"
-    IDS_EXTENSION_DLL_UNINSTALL_FAILED 
-                            "жװÎļþ¼¯°²×°/жװ shell À©Õ¹Ê§°Ü"
-    IDS_EXTENSION_DLL_INSTALL_FAILED 
-                            "°²×°Îļþ¼¯°²×°/жװ shell À©Õ¹Ê§°Ü"
-    IDS_CANT_DETERMINE_PRODUCT 
-                            "ÎÞ·¨È·¶¨ÒªÐ¶×°µÄ AFS ²úÆ·"
-    IDS_TITLE               "AFS(R) Windows °æ"
-    IDS_CANT_DETERMINE_APP_PATH 
-                            "È·¶¨Ó¦ÓóÌÐò°²×°Ä¿Â¼Ê§°Ü"
-    IDS_CLIENT_APP_NAME     "AFS ¿Í»§»ú"
-    IDS_SERVER_APP_NAME     "AFS ·þÎñÆ÷"
-    IDS_CC_APP_NAME         "AFS ¿ØÖÆÖÐÐÄ"
-    IDS_CANT_LOAD_RESOURCES "ÎÞ·¨Ð¶×°´Ë²úÆ·£º×°Èëжװ×ÊÔ´ÒÑʧ°Ü¡£"
-    IDS_CANT_UNINSTALL_AFSCREDS "È¡Ïû AFS ¿Í»§»úµÄÅäÖÃʧ°Ü¡£"
-    IDS_MUST_STOP_SERVER    "AFS ·þÎñÆ÷±ØÐëÔÚжװ¿É¼ÌÐøÖ®Ç°Í£Ö¹¡£Õâ¿ÉÄÜÊÇÒ»¸öºÜ³¤µÄ¹ý³Ì¡£ÏÖÔÚҪֹͣ·þÎñÆ÷Âð?"
-    IDS_MUST_STOP_CLIENT    "AFS ¿Í»§»ú±ØÐëÔÚжװ¿É¼ÌÐøÖ®Ç°Í£Ö¹¡£ÏÖÔÚҪֹͣ¿Í»§»úÂð?"
-    IDS_LIGHT_CLIENT_APP_NAME "AFS Light"
-    IDS_WAITING_FOR_CLIENT_TO_STOP "ÕýÔÚÍ£Ö¹ AFS ¿Í»§»ú¡£ÇëµÈ´ý..."
-    IDS_WAITING_FOR_SERVER_TO_STOP "ÕýÔÚÍ£Ö¹ AFS ·þÎñÆ÷¡£ÇëµÈ´ý..."
-    IDS_CLIENT_NEEDED_BY_SERVER "жװ AFS ¿Í»§»ú»áʹ AFS ·þÎñÆ÷²»ÄÜÕý³£¹¤×÷¡£Òª¼ÌÐøÐ¶×°Âð?"
-    IDS_PRESERVE_CLIENT_CONFIG_INFO "ÄúÏ£Íû±£Áô¿Í»§»úµÄÅäÖÃÐÅÏ¢Âð? Äú¿ÉÄÜ»áÔÚÉý¼¶»òÖØÐ°²×°Ê±ÕâÑù×ö¡£"
-    IDS_PRESERVE_SERVER_CONFIG_INFO "ÄúÏ£Íû±£Áô·þÎñÆ÷µÄÅäÖÃÐÅÏ¢Âð? Äú¿ÉÄÜ»áÔÚÉý¼¶»òÖØÐ°²×°Ê±ÕâÑù×ö¡£"
-    IDS_RESTORE_OF_PREVIOUS_CONFIG_FAILED "»Ö¸´ÒÔǰµÄÅäÖÃÐÅϢʧ°Ü"
-    IDS_SAVE_OF_CONFIG_INFO_FAILED  "±£´æÅäÖÃÐÅϢʧ°Ü¡£Òª¼ÌÐøÐ¶×°Âð?"
-    IDS_PRESERVE_LIGHT_CLIENT_CONFIG_INFO   "ÄúÏ£Íû±£Áô AFS Light µÄÅäÖÃÐÅÏ¢Âð? Äú¿ÉÄÜ»áÔÚÉý¼¶»òÖØÐ°²×°Ê±ÕâÑù×ö¡£"
-    IDS_PRESERVE_CC_CONFIG_INFO "ÄúÏ£Íû±£Áô¿ØÖÆÖÐÐĵÄÅäÖÃÐÅÏ¢Âð? Äú¿ÉÄÜ»áÔÚÉý¼¶»òÖØÐ°²×°Ê±ÕâÑù×ö¡£"
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Dialog Boxes
-//
-IDD_PROGRESS DIALOGEX 0, 0, 226, 52
-STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | DS_CENTER
-EXSTYLE WS_EX_TOOLWINDOW
-CAPTION "AFS(R) Windows °æ"
-FONT 9, "ËÎÌå"
-BEGIN
-    ICON            "",IDC_LOGO,17,16,21,20
-    LTEXT           "ÕýÔÚÍ£Ö¹ AFS ·þÎñÆ÷¡£ÇëµÈ´ý...",IDC_MSG,50,23,
-                    163,10
-    GROUPBOX        "",IDC_STATIC,7,4,212,40
-END
-
-IDD_LICENSE DIALOGEX 0, 0, 315, 204
-STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "Ðí¿É֤ЭÒé"
-FONT 9, "ËÎÌå", 0, 0, 0x1
-BEGIN
-    DEFPUSHBUTTON   "ÎÒͬÒâ(&A)",IDOK,197,185,50,14
-    PUSHBUTTON      "È¡Ïû",IDC_STATIC,255,185,50,14,WS_DISABLED
-    CONTROL         "",IDC_TEXT,"RichEdit20A",ES_MULTILINE | ES_AUTOVSCROLL | 
-                    ES_READONLY | WS_VSCROLL,10,10,295,161,WS_EX_STATICEDGE
-    PUSHBUTTON      "´òÓ¡(&P)",IDC_PRINT,10,185,50,14
-    PUSHBUTTON      "ÎÒ²»Í¬Òâ(&D)",IDCANCEL,147,185,50,14
-    CONTROL         "",IDC_STATIC,"Static",SS_ETCHEDHORZ,10,178,296,1
-END
-
-
-//////////////////////////////////////////////////////////////////////////
-//
-// Icon
-//
-
-// Icon with lowest ID value placed first to ensure application icon
-// remains consistent on all systems.
-IDI_SPIN1               ICON    DISCARDABLE     "..\\..\\..\\afsapplib\\resource\\spin1.ico"
-IDI_SPIN2               ICON    DISCARDABLE     "..\\..\\..\\afsapplib\\resource\\spin2.ico"
-IDI_SPIN3               ICON    DISCARDABLE     "..\\..\\..\\afsapplib\\resource\\spin3.ico"
-IDI_SPIN4               ICON    DISCARDABLE     "..\\..\\..\\afsapplib\\resource\\spin4.ico"
-IDI_SPIN5               ICON    DISCARDABLE     "..\\..\\..\\afsapplib\\resource\\spin5.ico"
-IDI_SPIN6               ICON    DISCARDABLE     "..\\..\\..\\afsapplib\\resource\\spin6.ico"
-IDI_SPIN7               ICON    DISCARDABLE     "..\\..\\..\\afsapplib\\resource\\spin7.ico"
-IDI_SPIN8               ICON    DISCARDABLE     "..\\..\\..\\afsapplib\\resource\\spin8.ico"
-IDI_SPINSTOP            ICON    DISCARDABLE     "..\\..\\..\\afsapplib\\resource\\spinstop.ico"
-
-
index dc7f239f71373a2fb8fc6eb6f65e290ed3d4d56f..2dbf0c9f8c55c1e503a9cf6e66d3bd57e60f2e9d 100644 (file)
@@ -14,7 +14,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_module.c,v 1.9 2002/05/12 05:50:42 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_module.c,v 1.10 2002/12/11 03:00:39 hartmans Exp $");
 
 #include "../afs/sysincludes.h"
 #include "../afs/afsincludes.h"
@@ -26,6 +26,10 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_module.c,v 1.9 2002/05/12
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
 #include <linux/init.h>
 #endif
+#ifndef EXPORTED_SYS_CALL_TABLE
+#include <linux/sched.h>
+#include <linux/syscall.h>
+#endif
 
 
 
@@ -40,11 +44,19 @@ asmlinkage int (*sys_socketcallp)(int call, long *args);
 asmlinkage int (*sys_killp)(int pid, int signal);
 asmlinkage long (*sys_setgroupsp)(int gidsetsize, gid_t *grouplist);
 
+#ifdef EXPORTED_SYS_CALL_TABLE
 #ifdef AFS_SPARC64_LINUX20_ENV
 extern unsigned int sys_call_table[];  /* changed to uint because SPARC64 has syscaltable of 32bit items */
 #else
 extern void * sys_call_table[]; /* safer for other linuces */
 #endif
+#else /* EXPORTED_SYS_CALL_TABLE */
+#ifdef AFS_SPARC64_LINUX20_ENV
+static unsigned int *sys_call_table;  /* changed to uint because SPARC64 has syscaltable of 32bit items */
+#else
+static void ** sys_call_table; /* safer for other linuces */
+#endif
+#endif
 extern struct file_system_type afs_file_system;
 
 static long get_page_offset(void);
@@ -72,7 +84,11 @@ asmlinkage int (*sys32_setgroupsp)(int gidsetsize, __kernel_gid_t32 *grouplist);
 #if defined(__NR_setgroups32)
 asmlinkage int (*sys32_setgroups32p)(int gidsetsize, __kernel_gid_t32 *grouplist);
 #endif
+#ifdef EXPORTED_SYS_CALL_TABLE
 extern unsigned int sys_call_table32[];
+#else
+static unsigned int *sys_call_table32;
+#endif
 
 asmlinkage int afs_syscall32(long syscall, long parm1, long parm2, long parm3,
                             long parm4, long parm5)
@@ -200,7 +216,24 @@ int init_module(void)
 #endif
 #endif
 
+#ifndef EXPORTED_SYS_CALL_TABLE
+    unsigned long *ptr;
+    unsigned long offset;
+    unsigned long datalen;
+    int ret;
+    unsigned long token;
+    char      *mod_name;
+    unsigned long    mod_start;
+    unsigned long    mod_end;
+    char      *sec_name;
+    unsigned long    sec_start;
+    unsigned long    sec_end;
+    char      *sym_name;
+    unsigned long    sym_start;
+    unsigned long    sym_end;
+#endif
 
+    RWLOCK_INIT(&afs_xosi, "afs_xosi");
 
     /* obtain PAGE_OFFSET value */
     afs_linux_page_offset = get_page_offset();
@@ -213,6 +246,74 @@ int init_module(void)
     }
 #endif
 
+#ifndef EXPORTED_SYS_CALL_TABLE
+    sys_call_table=0;
+#ifdef EXPORTED_KALLSYMS_SYMBOL
+    ret=1;
+    token=0;
+    while (ret) {
+      sym_start=0;
+      ret=kallsyms_symbol_to_address("sys_call_table", &token, &mod_name,
+                    &mod_start, &mod_end, &sec_name, &sec_start, &sec_end,
+                    &sym_name, &sym_start, &sym_end);
+      if (ret && !strcmp(mod_name, "kernel"))
+             break;
+    }
+    if (ret && sym_start) {
+           sys_call_table=sym_start;
+    }
+#else
+#ifdef EXPORTED_KALLSYMS_ADDRESS
+    ret=kallsyms_address_to_symbol((unsigned long)&init_mm, &mod_name,
+                  &mod_start, &mod_end, &sec_name, &sec_start, &sec_end,
+                  &sym_name, &sym_start, &sym_end);
+    ptr=(unsigned long *)sec_start;
+    datalen=(sec_end-sec_start)/sizeof(unsigned long);
+#else
+#if defined(AFS_IA64_LINUX20_ENV)
+    ptr = (unsigned long *) (&sys_close - 0x180000);
+    datalen=0x180000/sizeof(ptr);
+#else
+    ptr=(unsigned long *)&init_mm;
+    datalen=16384;
+#endif
+#endif
+    for (offset=0;offset <datalen;ptr++,offset++) {
+#if defined(AFS_IA64_LINUX20_ENV)
+       unsigned long close_ip=(unsigned long) ((struct fptr *)&sys_close)->ip;
+       unsigned long chdir_ip=(unsigned long) ((struct fptr *)&sys_chdir)->ip;
+       unsigned long write_ip=(unsigned long) ((struct fptr *)&sys_write)->ip;
+       if (ptr[0] == close_ip &&
+           ptr[__NR_chdir - __NR_close] == chdir_ip &&
+           ptr[__NR_write - __NR_close] == write_ip) {
+           sys_call_table=(void *) &(ptr[ -1 * (__NR_close-1024)]);
+           break;
+       }
+#else
+        if (ptr[0] == (unsigned long)&sys_exit &&
+           ptr[__NR_open - __NR_exit] == (unsigned long)&sys_open) {
+           sys_call_table=ptr - __NR_exit;
+           break;
+       }
+#endif
+    }
+#ifdef EXPORTED_KALLSYMS_ADDRESS
+    ret=kallsyms_address_to_symbol((unsigned long)sys_call_table, &mod_name,
+                  &mod_start, &mod_end, &sec_name, &sec_start, &sec_end,
+                  &sym_name, &sym_start, &sym_end);
+    if (ret && strcmp(sym_name, "sys_call_table"))
+            sys_call_table=0;
+#endif
+#endif
+    if (!sys_call_table) {
+         printf("Failed to find address of sys_call_table\n");
+        return -EIO;
+    }
+# ifdef AFS_SPARC64_LINUX20_ENV
+error cant support this yet.
+#endif
+#endif /* SYS_CALL_TABLE */
+
     /* Initialize pointers to kernel syscalls. */
 #if defined(AFS_IA64_LINUX20_ENV)
     kernel_gp = ((struct fptr *)printk)->gp;
@@ -247,7 +348,6 @@ int init_module(void)
        return -EBUSY;
     }
 
-
 #if defined(AFS_IA64_LINUX20_ENV)
     afs_ni_syscall = sys_call_table[__NR_afs_syscall - 1024];
     sys_call_table[__NR_afs_syscall - 1024] = POINTER2SYSCALL ((struct fptr *)afs_syscall_stub)->ip;
index 52dbf2de39b722269d22fb0be5e8289205b3ad9c..d75e8cc71ca2bc062f72db4f0105f82ff60f2f87 100644 (file)
@@ -23,7 +23,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_vnodeops.c,v 1.13 2002/08/02 04:57:38 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_vnodeops.c,v 1.14 2002/12/11 03:00:39 hartmans Exp $");
 
 #include "../afs/sysincludes.h"
 #include "../afs/afsincludes.h"
@@ -540,6 +540,16 @@ static int afs_linux_lock(struct file *fp, int cmd, struct file_lock *flp)
     flock.l_start = flp->fl_start;
     flock.l_len = flp->fl_end - flp->fl_start;
 
+    /* Safe because there are no large files, yet */
+#if defined(F_GETLK64) && (F_GETLK != F_GETLK64)
+    if (cmd = F_GETLK64)
+       cmd = F_GETLK;
+    else if (cmd = F_SETLK64)
+       cmd = F_SETLK;
+    else if (cmd = F_SETLKW64)
+       cmd = F_SETLKW;
+#endif /* F_GETLK64 && F_GETLK != F_GETLK64 */
+
     AFS_GLOCK();
     code = afs_lockctl(vcp, &flock, cmd, credp);
     AFS_GUNLOCK();
index d17ef1e8aa9e719b1be2c61ef4584e57f68d53d1..6e32ee702a6bf6971269353cc86b986bedb40535 100644 (file)
@@ -22,7 +22,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_lookup.c,v 1.12 2002/09/26 19:18:06 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_lookup.c,v 1.13 2002/12/11 03:00:39 hartmans Exp $");
 
 #include "../afs/sysincludes.h"        /* Standard vendor system headers */
 #include "../afs/afsincludes.h"        /* Afs-based standard headers */
@@ -54,7 +54,7 @@ extern struct inode_operations afs_symlink_iops, afs_dir_iops;
 
 afs_int32 afs_bulkStatsDone;
 static int bulkStatCounter = 0;        /* counter for bulk stat seq. numbers */
-int afs_fakestat_enable = 0;
+int afs_fakestat_enable = 0;   /* 1: fakestat-all, 2: fakestat-crosscell */
 
 
 /* this would be faster if it did comparison as int32word, but would be 
@@ -268,12 +268,8 @@ afs_InitFakeStat(state)
  *
  * Only issues RPCs if canblock is non-zero.
  */
-static int
-afs_EvalFakeStat_int(avcp, state, areq, canblock)
-    struct vcache **avcp;
-    struct afs_fakestat_state *state;
-    struct vrequest *areq;
-    int canblock;
+int afs_EvalFakeStat_int(struct vcache **avcp, struct afs_fakestat_state *state,
+       struct vrequest *areq, int canblock)
 {
     struct vcache *tvc, *root_vp;
     struct volume *tvolp = NULL;
@@ -1400,17 +1396,34 @@ afs_lookup(adp, aname, avcp, acred)
     } /* sub-block just to reduce stack usage */
 
     if (tvc) {
-       if (adp->states & CForeign)
+       int force_eval = afs_fakestat_enable ? 0 : 1;
+
+       if (adp->states & CForeign)
           tvc->states |= CForeign;
        tvc->parentVnode = adp->fid.Fid.Vnode;
        tvc->parentUnique = adp->fid.Fid.Unique;
        tvc->states &= ~CBulkStat;
 
+       if (afs_fakestat_enable == 2 && tvc->mvstat == 1) {
+           ObtainSharedLock(&tvc->lock, 680);
+           if (!tvc->linkData) {
+               UpgradeSToWLock(&tvc->lock, 681);
+               code = afs_HandleLink(tvc, &treq);
+               ConvertWToRLock(&tvc->lock);
+           } else {
+               ConvertSToRLock(&tvc->lock);
+               code = 0;
+           }
+           if (!code && !afs_strchr(tvc->linkData, ':'))
+               force_eval = 1;
+           ReleaseReadLock(&tvc->lock);
+       }
+
 #if defined(UKERNEL) && defined(AFS_WEB_ENHANCEMENTS)
         if (!(flags & AFS_LOOKUP_NOEVAL))
           /* don't eval mount points */
 #endif /* UKERNEL && AFS_WEB_ENHANCEMENTS */
-       if (!afs_fakestat_enable && tvc->mvstat == 1) {
+       if (tvc->mvstat == 1 && force_eval) {
            /* a mt point, possibly unevaluated */
            struct volume *tvolp;
 
index 8f7af7f67f31dc74d69b09f6e35fade390e955a5..ea68ed4788e3fbf6aea85bfaca4a77a86b0764ac 100644 (file)
@@ -22,7 +22,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_readdir.c,v 1.9 2002/09/26 19:18:06 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_readdir.c,v 1.10 2002/12/11 03:00:39 hartmans Exp $");
 
 #include "../afs/sysincludes.h"        /* Standard vendor system headers */
 #include "../afs/afsincludes.h"        /* Afs-based standard headers */
@@ -783,7 +783,7 @@ afs1_readdir(avc, auio, acred, eofp)
 #else
 afs1_readdir(avc, auio, acred)
 #endif
-    register struct vcache *avc;
+    struct vcache *avc;
     struct uio *auio;
     struct AFS_UCRED *acred; {
     struct vrequest treq;
index f983e12b0bec9cfafd8e3c62ae6a3ad10bbdf3bd..616329223afcfd64714643271394b198c78aa4d5 100644 (file)
@@ -52,44 +52,41 @@ AFS_OS_NONFSOBJS =
 # System specific build commands and flags
 CC = gcc
 LD = ld
+GCC_KOPTS=@LINUX_GCC_KOPTS@
 # -Wall
 <i386_linux22 i386_linux24>
-CCFLAGS =  $(KDEBUG) -O2 $(FOMIT) \
-       -fno-strength-reduce -pipe -march=i486 -malign-loops=2 -malign-jumps=2 \
-       -malign-functions=2
+P5PLUS=@P5PLUS_KOPTS@
+CCFLAGS =  $(KDEBUG) -O2 $(FOMIT) $(GCC_KOPTS) -pipe $(P5PLUS)
 DEFINES = -D__KERNEL__  -DCPU=586 -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF} ${KDEFINES}
 <alpha_linux_22 alpha_linux_24>
-CCFLAGS = $(KDEBUG) -O2 $(FOMIT) -fno-strength-reduce -pipe -mno-fp-regs -ffixed-8
+CCFLAGS = $(KDEBUG) -O2 $(FOMIT) $(GCC_KOPTS) -pipe -mno-fp-regs -ffixed-8
 DEFINES = -D__KERNEL__ -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
 <s390_linux22 s390_linux24>
-CCFLAGS =   -O $(FOMIT) -fno-strength-reduce \
-       -fno-strict-aliasing -fsigned-char 
+CCFLAGS =   -O $(FOMIT) $(GCC_KOPTS) -fsigned-char 
 DEFINES = -D__KERNEL__  -D__s390__ -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
 <sparc_linux22 sparc_linux24>
 LD = ld -m elf32_sparc
-CCFLAGS =   $(KDEBUG) -O2 $(FOMIT) \
-       -fno-strength-reduce -pipe -mcpu=v8 -mno-fpu -fcall-used-g5 -fcall-used-g7
+CCFLAGS =   $(KDEBUG) -O2 $(FOMIT) $(GCC_KOPTS) \
+       -pipe -mcpu=v8 -mno-fpu -fcall-used-g5 -fcall-used-g7
 DEFINES = -D__KERNEL__  -DCPU=sparc -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
 <sparc64_linux22 sparc64_linux24>
 CC = sparc64-linux-gcc
 LD = ld -m elf64_sparc
-CCFLAGS =   $(KDEBUG) -O2 $(FOMIT) \
-       -fno-strength-reduce -pipe -mcpu=ultrasparc -m64 -mno-fpu -mcmodel=medlow -ffixed-g4 -fcall-used-g5 -fcall-used-g7 -Wno-sign-compare
+CCFLAGS =   $(KDEBUG) -O2 $(FOMIT) $(GCC_KOPTS) \
+       -pipe -mcpu=ultrasparc -m64 -mno-fpu -mcmodel=medlow -ffixed-g4 -fcall-used-g5 -fcall-used-g7 -Wno-sign-compare
 DEFINES = -D__KERNEL__  -DCPU=sparc64 -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
 <ppc_linux22 ppc_linux24>
-CCFLAGS =   $(KDEBUG) -O2 $(FOMIT) -fno-strength-reduce \
-       -fno-strict-aliasing -fsigned-char -msoft-float -pipe \
+CCFLAGS =   $(KDEBUG) -O2 $(FOMIT) $(GCC_KOPTS) -fsigned-char -msoft-float -pipe \
        -fno-builtin -ffixed-r2
 DEFINES = -D__KERNEL__  -D__powerpc__ -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
 <parisc_linux24>
-CCFLAGS =   $(KDEBUG) -O2 $(FOMIT) \
-       -fno-strict-aliasing -fno-common -fno-strength-reduce \
-        -fno-strict-aliasing -fsigned-char -mno-space-regs -mfast-indirect-calls \
-        -mdisable-fpregs -ffunction-sections -march=1.1 -mschedule=7100
+CCFLAGS =   $(KDEBUG) -O2 $(FOMIT) $(GCC_KOPTS) -fsigned-char -mno-space-regs \
+       -mfast-indirect-calls -mdisable-fpregs -ffunction-sections \
+       -march=1.1 -mschedule=7100
 DEFINES = -D__KERNEL__  -D__linux__ -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
 <ia64_linux24>
-CCFLAGS =   $(KDEBUG) -O2 $(FOMIT) -fno-strict-aliasing -fno-common -pipe \
-       -ffixed-r13 -mfixed-range=f10-f15,f32-f127 -falign-functions=32 -mb-step
+CCFLAGS =   $(KDEBUG) -O2 $(FOMIT) $(GCC_KOPTS) -pipe -ffixed-r13 \
+        -mfixed-range=f10-f15,f32-f127 -falign-functions=32 -mb-step
 DEFINES = -D__KERNEL__ -DKERNEL -D_KERNEL ${SMP_DEF} -DMODULE
 <all>
 INCLUDES = -I. -I../ -I${TOP_SRCDIR}/config
index cbb45e6932edb29cde277262663272ee0f8401ae..718af16c70c1e6f225451532ac27bfa07d025239 100644 (file)
@@ -16,7 +16,7 @@
 #include <afs/param.h>
 #endif
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rx.c,v 1.12 2002/09/26 19:18:08 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rx.c,v 1.13 2002/12/11 03:00:40 hartmans Exp $");
 
 #ifdef KERNEL
 #include "../afs/sysincludes.h"
@@ -1796,6 +1796,16 @@ afs_int32 rx_EndCall(call, rc)
         || (call->mode == RX_MODE_RECEIVING && call->rnext == 1)) {
            (void) rxi_ReadProc(call, &dummy, 1);
        }
+
+       /* If we had an outstanding delayed ack, be nice to the server
+        * and force-send it now.
+        */
+       if (call->delayedAckEvent) {
+           rxevent_Cancel(call->delayedAckEvent, call, RX_CALL_REFCOUNT_DELAY);
+           call->delayedAckEvent = NULL;
+           rxi_SendDelayedAck(NULL, call, NULL);
+       }
+
        /* We need to release the call lock since it's lower than the
         * conn_call_lock and we don't want to hold the conn_call_lock
         * over the rx_ReadProc call. The conn_call_lock needs to be held
@@ -2247,7 +2257,6 @@ rxi_FindConnection(socket, host, port, serviceId, cid,
 {
     int hashindex, flag;
     register struct rx_connection *conn;
-    struct rx_peer *peer;
     hashindex = CONN_HASH(host, port, cid, epoch, type);
     MUTEX_ENTER(&rx_connHashTable_lock);
     rxLastConn ? (conn = rxLastConn, flag = 0) :
@@ -2264,13 +2273,12 @@ rxi_FindConnection(socket, host, port, serviceId, cid,
            MUTEX_EXIT(&rx_connHashTable_lock);
            return (struct rx_connection *) 0;
        }
-       /* epoch's high order bits mean route for security reasons only on
-        * the cid, not the host and port fields.
-        */
-       if (conn->epoch & 0x80000000) break;
-       if (((type == RX_CLIENT_CONNECTION) 
-            || (pp->host == host)) && (pp->port == port))
-         break;
+       if (pp->host == host && pp->port == port)
+           break;
+       if (type == RX_CLIENT_CONNECTION && pp->port == port)
+           break;
+       if (type == RX_CLIENT_CONNECTION && (conn->epoch & 0x80000000))
+           break;
       }
       if ( !flag )
       {
@@ -2302,7 +2310,7 @@ rxi_FindConnection(socket, host, port, serviceId, cid,
        CV_INIT(&conn->conn_call_cv, "conn call cv", CV_DEFAULT, 0);
        conn->next = rx_connHashTable[hashindex];
        rx_connHashTable[hashindex] = conn;
-       peer = conn->peer = rxi_FindPeer(host, port, 0, 1);
+       conn->peer = rxi_FindPeer(host, port, 0, 1);
        conn->type = RX_SERVER_CONNECTION;
        conn->lastSendTime = clock_Sec();   /* don't GC immediately */
        conn->epoch = epoch;
@@ -2325,27 +2333,9 @@ rxi_FindConnection(socket, host, port, serviceId, cid,
        rx_stats.nServerConns++;
        MUTEX_EXIT(&rx_stats_mutex);
     }
-    else
-    {
-    /* Ensure that the peer structure is set up in such a way that
-    ** replies in this connection go back to that remote interface
-    ** from which the last packet was sent out. In case, this packet's
-    ** source IP address does not match the peer struct for this conn,
-    ** then drop the refCount on conn->peer and get a new peer structure.
-    ** We can check the host,port field in the peer structure without the
-    ** rx_peerHashTable_lock because the peer structure has its refCount
-    ** incremented and the only time the host,port in the peer struct gets
-    ** updated is when the peer structure is created.
-    */
-       if (conn->peer->host == host )
-               peer = conn->peer; /* no change to the peer structure */
-       else
-               peer = rxi_FindPeer(host, port, conn->peer, 1);
-    }
 
     MUTEX_ENTER(&conn->conn_data_lock);
     conn->refCount++;
-    conn->peer = peer;
     MUTEX_EXIT(&conn->conn_data_lock);
 
     rxLastConn = conn; /* store this connection as the last conn used */
@@ -2772,8 +2762,11 @@ struct rx_packet *rxi_ReceivePacket(np, socket, host, port, tnop, newcallp)
            /* Respond immediately to ack packets requesting acknowledgement
              * (ping packets) */
            if (np->header.flags & RX_REQUEST_ACK) {
-               if (call->error) (void) rxi_SendCallAbort(call, 0, 1, 0);
-               else (void) rxi_SendAck(call, 0, 0, 0, 0, RX_ACK_PING_RESPONSE, 1);
+               if (call->error)
+                   (void) rxi_SendCallAbort(call, 0, 1, 0);
+               else
+                   (void) rxi_SendAck(call, 0, 0, np->header.serial, 0,
+                                      RX_ACK_PING_RESPONSE, 1);
            }
            np = rxi_ReceiveAckPacket(call, np, 1);
            break;
@@ -3372,6 +3365,27 @@ static void rxi_UpdatePeerReach(conn, acall)
        MUTEX_EXIT(&conn->conn_data_lock);
 }
 
+/* rxi_ComputePeerNetStats
+ *
+ * Called exclusively by rxi_ReceiveAckPacket to compute network link
+ * estimates (like RTT and throughput) based on ack packets.  Caller
+ * must ensure that the packet in question is the right one (i.e.
+ * serial number matches).
+ */
+static void
+rxi_ComputePeerNetStats(struct rx_call *call, struct rx_packet *p,
+       struct rx_ackPacket *ap, struct rx_packet *np)
+{
+    struct rx_peer *peer = call->conn->peer;
+
+    /* Use RTT if not delayed by client. */
+    if (ap->reason != RX_ACK_DELAY)
+       rxi_ComputeRoundTripTime(p, &p->timeSent, peer);
+#ifdef ADAPT_WINDOW
+    rxi_ComputeRate(peer, call, p, np, ap->reason);
+#endif
+}
+
 /* The real smarts of the whole thing.  */
 struct rx_packet *rxi_ReceiveAckPacket(call, np, istack)
     register struct rx_call *call;
@@ -3439,15 +3453,6 @@ struct rx_packet *rxi_ReceiveAckPacket(call, np, istack)
     }
 #endif
 
-    /* if a server connection has been re-created, it doesn't remember what
-       serial # it was up to.  An ack will tell us, since the serial field
-       contains the largest serial received by the other side */
-    MUTEX_ENTER(&conn->conn_data_lock);
-    if ((conn->type == RX_SERVER_CONNECTION) && (conn->serial < serial)) {
-       conn->serial = serial+1;
-    }
-    MUTEX_EXIT(&conn->conn_data_lock);
-
     /* Update the outgoing packet skew value to the latest value of
      * the peer's incoming packet skew value.  The ack packet, of
      * course, could arrive out of order, but that won't affect things
@@ -3463,22 +3468,9 @@ struct rx_packet *rxi_ReceiveAckPacket(call, np, istack)
     for (queue_Scan(&call->tq, tp, nxp, rx_packet)) {
        if (tp->header.seq >= first) break;
        call->tfirst = tp->header.seq + 1;
-       if (tp->header.serial == serial) {
-         /* Use RTT if not delayed by client. */
-         if (ap->reason != RX_ACK_DELAY)
-             rxi_ComputeRoundTripTime(tp, &tp->timeSent, peer);
-#ifdef ADAPT_WINDOW
-         rxi_ComputeRate(peer, call, tp, np, ap->reason);
-#endif
-       }
-       else if (tp->firstSerial == serial) {
-           /* Use RTT if not delayed by client. */
-           if (ap->reason != RX_ACK_DELAY)
-               rxi_ComputeRoundTripTime(tp, &tp->firstSent, peer);
-#ifdef ADAPT_WINDOW
-         rxi_ComputeRate(peer, call, tp, np, ap->reason);
-#endif
-       }
+       if (serial && (tp->header.serial == serial ||
+                      tp->firstSerial == serial))
+           rxi_ComputePeerNetStats(call, tp, ap, np);
 #ifdef AFS_GLOBAL_RXLOCK_KERNEL
     /* XXX Hack. Because we have to release the global rx lock when sending
      * packets (osi_NetSend) we drop all acks while we're traversing the tq
@@ -3531,30 +3523,12 @@ struct rx_packet *rxi_ReceiveAckPacket(call, np, istack)
          * of this packet */
 #ifdef AFS_GLOBAL_RXLOCK_KERNEL
 #ifdef RX_ENABLE_LOCKS
-       if (tp->header.seq >= first) {
-#endif /* RX_ENABLE_LOCKS */
-#endif /* AFS_GLOBAL_RXLOCK_KERNEL */
-       if (tp->header.serial == serial) {
-           /* Use RTT if not delayed by client. */
-           if (ap->reason != RX_ACK_DELAY)
-               rxi_ComputeRoundTripTime(tp, &tp->timeSent, peer);
-#ifdef ADAPT_WINDOW
-         rxi_ComputeRate(peer, call, tp, np, ap->reason);
-#endif
-       }
-       else if ((tp->firstSerial == serial)) {
-           /* Use RTT if not delayed by client. */
-           if (ap->reason != RX_ACK_DELAY)
-               rxi_ComputeRoundTripTime(tp, &tp->firstSent, peer);
-#ifdef ADAPT_WINDOW
-         rxi_ComputeRate(peer, call, tp, np, ap->reason);
-#endif
-       }
-#ifdef AFS_GLOBAL_RXLOCK_KERNEL
-#ifdef RX_ENABLE_LOCKS
-       }
+       if (tp->header.seq >= first)
 #endif /* RX_ENABLE_LOCKS */
 #endif /* AFS_GLOBAL_RXLOCK_KERNEL */
+           if (serial && (tp->header.serial == serial ||
+                          tp->firstSerial == serial))
+               rxi_ComputePeerNetStats(call, tp, ap, np);
 
        /* Set the acknowledge flag per packet based on the
          * information in the ack packet. An acknowlegded packet can
@@ -4563,7 +4537,7 @@ struct rx_packet *rxi_SendAck(call, optionalPacket, seq, serial, pflags, reason,
 
     /* The skew computation used to be bogus, I think it's better now. */
     /* We should start paying attention to skew.    XXX  */
-    ap->serial = htonl(call->conn->maxSerial);
+    ap->serial = htonl(serial);
     ap->maxSkew        = 0;    /* used to be peer->inPacketSkew */
 
     ap->firstPacket = htonl(call->rnext); /* First packet not yet forwarded to reader */
index e2f3fbdc9e187f5bf3b3edb6538beb36b45d6458..1e7de7f03fef7e0752b43fb4744f3387edbcf7b7 100644 (file)
@@ -28,7 +28,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/viced/afsfileprocs.c,v 1.10 2002/09/26 19:18:09 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/viced/afsfileprocs.c,v 1.11 2002/12/11 03:00:40 hartmans Exp $");
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -5014,7 +5014,7 @@ afs_int32 *a_bytesFetchedP;
     struct iovec tiov[RX_MAXIOVECS];
     int tnio;
 #endif /* AFS_NT40_ENV */
-    int tlen;
+    afs_int32 tlen;
     afs_int32 optSize;
     struct stat tstat;
 #ifdef AFS_AIX_ENV
@@ -5212,12 +5212,12 @@ StoreData_RXStyle(volptr, targetptr, Fid, client, Call, Pos, Length,
     afs_int32 optSize;                 /* optimal transfer size */
     int DataLength;                    /* size of inode */
     afs_int32 TruncatedLength;         /* size after ftruncate */
-    afs_int32 NewLength;                       /* size after this store completes */
-    afs_int32 adjustSize;                      /* bytes to call VAdjust... with */
+    afs_uint32 NewLength;              /* size after this store completes */
+    afs_int32 adjustSize;              /* bytes to call VAdjust... with */
     int linkCount;                     /* link count on inode */
     int code;
     FdHandle_t *fdP;
-    struct in_addr logHostAddr;             /* host ip holder for inet_ntoa */
+    struct in_addr logHostAddr;                /* host ip holder for inet_ntoa */
 
 #if FS_STATS_DETAILED
     /*
@@ -5259,7 +5259,7 @@ StoreData_RXStyle(volptr, targetptr, Fid, client, Call, Pos, Length,
        }
        
        if (linkCount != 1) {
-           int size;
+           afs_uint32 size;
            ViceLog(25, ("StoreData_RXStyle : inode %s has more than onelink\n",
                         PrintInode(NULL, VN_GET_INO(targetptr))));
            /* other volumes share this data, better copy it first */
@@ -5843,7 +5843,7 @@ Update_ParentVnodeStatus(parentptr, volptr, dir, author, linkcount)
 #endif /* FS_STATS_DETAILED */
 
 {
-    int        newlength;          /* Holds new directory length */
+    afs_uint32 newlength;      /* Holds new directory length */
     int errorCode;
 #if FS_STATS_DETAILED
     Date currDate;             /*Current date*/
@@ -6606,7 +6606,11 @@ int CopyOnWrite(targetptr, volptr)
                    ViceLog(0,("CopyOnWrite failed: volume %u in partition %s  (tried reading %u, read %u, wrote %u, errno %u) volume needs salvage\n",
                               V_id(volptr), volptr->partition->name, length,
                               rdlen, wrlen, errno));
-                   assert(0);
+#ifdef FAST_RESTART /* if running in no-salvage, don't core the server */
+                   ViceLog(0,("CopyOnWrite failed: taking volume offline\n"));
+#else /* Avoid further corruption and try to get a core. */
+                   assert(0); 
+#endif
                     /* Decrement this inode so salvager doesn't find it. */
                    FDH_REALLYCLOSE(newFdP);
                    IH_RELEASE(newH);