Log binding ip address and port during startup
[openafs.git] / src / afs / afs_call.c
index 3ab1527..6c961d2 100644 (file)
@@ -41,7 +41,7 @@
 #define        AFS_MINBUFFERS  50
 #endif
 
-#if (defined(AFS_SUN5_ENV) || (defined(AFS_LINUX24_ENV) && defined(HAVE_LINUX_COMPLETION_H)) || defined(AFS_DARWIN80_ENV)) && !defined(UKERNEL)
+#if (defined(AFS_SUN5_ENV) || defined(AFS_LINUX26_ENV) || defined(AFS_DARWIN80_ENV)) && !defined(UKERNEL)
 /* If AFS_DAEMONOP_ENV is defined, it indicates we run "daemon" AFS syscalls by
  * spawning a kernel thread to do the work, instead of running them in the
  * calling process. */
@@ -87,9 +87,10 @@ afs_int32 afs_rx_idledead_rep = AFS_IDLEDEADTIME_REP;
 
 static int afscall_set_rxpck_received = 0;
 
-#if defined(AFS_HPUX_ENV)
-extern int afs_vfs_mount();
-#endif /* defined(AFS_HPUX_ENV) */
+extern afs_int32 afs_volume_ttl;
+
+/* From afs_util.c */
+extern afs_int32 afs_md5inum;
 
 /* This is code which needs to be called once when the first daemon enters
  * the client. A non-zero return means an error and AFS should not start.
@@ -98,6 +99,7 @@ static int
 afs_InitSetup(int preallocs)
 {
     int code;
+    afs_uint32 host;
 
     if (afs_InitSetup_done)
        return EAGAIN;
@@ -126,6 +128,14 @@ afs_InitSetup(int preallocs)
     /* start RX */
     if(!afscall_set_rxpck_received)
     rx_extraPackets = AFS_NRXPACKETS;  /* smaller # of packets */
+
+    host = ntohl(rx_bindhost);
+    afs_warn("afs: Binding rx to %d.%d.%d.%d:%d\n",
+             (host >> 24),
+             (host >> 16) & 0xff,
+             (host >>  8) & 0xff,
+             (host)       & 0xff,
+             7001);
     code = rx_InitHost(rx_bindhost, htons(7001));
     if (code) {
        afs_warn("AFS: RX failed to initialize %d).\n", code);
@@ -280,9 +290,9 @@ afs_DaemonOp(long parm, long parm2, long parm3, long parm4, long parm5,
 #endif
 
 
-#if defined(AFS_LINUX24_ENV) && defined(HAVE_LINUX_COMPLETION_H)
+#if defined(AFS_LINUX26_ENV)
 struct afsd_thread_info {
-# if defined(AFS_LINUX26_ENV) && !defined(INIT_WORK_HAS_DATA)
+# if !defined(INIT_WORK_HAS_DATA)
     struct work_struct tq;
 # endif
     unsigned long parm;
@@ -915,12 +925,6 @@ afs_syscall_call(long parm, long parm2, long parm3,
        osi_Assert(tbuffer1 != NULL);
        code = afs_InitDynroot();
        if (!code) {
-#if 0
-           /* wait for basic init - XXX can't find any reason we need this? */
-           while (afs_initState < AFSOP_START_BKG)
-               afs_osi_Sleep(&afs_initState);
-#endif
-
            AFS_COPYIN(AFSKPTR(parm2), (caddr_t)tcell->hosts, sizeof(tcell->hosts),
                       code);
        }
@@ -1229,22 +1233,6 @@ afs_syscall_call(long parm, long parm2, long parm3,
        if (!code)
            AFS_COPYOUT((caddr_t) & mtu, AFSKPTR(parm3),
                        sizeof(afs_int32), code);
-#ifdef AFS_AIX32_ENV
-/* this is disabled for now because I can't figure out how to get access
- * to these kernel variables.  It's only for supporting user-mode rx
- * programs -- it makes a huge difference on the 220's in my testbed,
- * though I don't know why. The bosserver does this with /etc/no, so it's
- * being handled a different way for the servers right now.  */
-/*      {
-       static adjusted = 0;
-       extern u_long sb_max_dflt;
-       if (!adjusted) {
-         adjusted = 1;
-         if (sb_max_dflt < 131072) sb_max_dflt = 131072;
-         if (sb_max < 131072) sb_max = 131072;
-       }
-      } */
-#endif /* AFS_AIX32_ENV */
     } else if (parm == AFSOP_GETMASK) {        /* parm2 == addr in net order */
        afs_uint32 mask = 0;
 #if    !defined(AFS_SUN5_ENV)
@@ -1327,6 +1315,26 @@ afs_syscall_call(long parm, long parm2, long parm3,
            afs_osi_Free(seedbuf, parm3);
        }
 #endif
+    } else if (parm == AFSOP_SET_INUMCALC) {
+       switch (parm2) {
+       case AFS_INUMCALC_COMPAT:
+           afs_md5inum = 0;
+           code = 0;
+           break;
+       case AFS_INUMCALC_MD5:
+           afs_md5inum = 1;
+           code = 0;
+           break;
+       default:
+           code = EINVAL;
+       }
+    } else if (parm == AFSOP_SET_VOLUME_TTL) {
+       if ((parm2 < AFS_MIN_VOLUME_TTL) || (parm2 > AFS_MAX_VOLUME_TTL)) {
+           code = EFAULT;
+       } else {
+           afs_volume_ttl = parm2;
+           code = 0;
+       }
     } else {
        code = EINVAL;
     }
@@ -1469,6 +1477,7 @@ afs_shutdown(void)
     afs_warn("NetIfPoller... ");
     osi_StopNetIfPoller();
 #endif
+    rxi_FreeAllPackets();
 
     afs_termState = AFSOP_STOP_COMPLETE;