All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Thomas <jason@topic.com.au>
To: linux-kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH] patch's for vmware 2.0.4 for use with linux-2.4.8 kernel
Date: Thu, 16 Aug 2001 18:49:38 +1000	[thread overview]
Message-ID: <20010816184937.E742@topic.com.au> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 466 bytes --]

attached are two very small patches for those that want them. they make
vmware's kernel modules compile with 2.4.8.  Its not all my work, its a
combination of what was posted a while back and my work.

-- 
Jason Thomas                           Phone:  +61 2 6257 7111
System Administrator  -  UID 0         Fax:    +61 2 6257 7311
tSA Consulting Group Pty. Ltd.         Mobile: 0418 29 66 81
1 Hall Street Lyneham ACT 2602         http://www.topic.com.au/

[-- Attachment #1.2: vmnet-only-2.4.8.patch --]
[-- Type: text/plain, Size: 4633 bytes --]

diff -ru vmnet-only.orig/bridge.c vmnet-only/bridge.c
--- vmnet-only.orig/bridge.c	Thu May 10 11:33:58 2001
+++ vmnet-only/bridge.c	Thu Aug 16 17:33:07 2001
@@ -19,7 +19,7 @@
 #include <linux/kernel.h>
 #include <linux/version.h>
 #include <linux/sched.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #ifdef KERNEL_2_1
 #include <linux/poll.h>
 #include <asm/uaccess.h>
@@ -44,7 +44,7 @@
 #include "vnetInt.h"
 
 
-#define VNET_BRIDGE_HISTORY    8
+#define VNET_BRIDGE_HISTORY    48
 
 typedef struct VNetBridge VNetBridge;
 
@@ -58,6 +58,7 @@
    Bool                     savedPromisc;
    struct sk_buff          *history[VNET_BRIDGE_HISTORY];
    VNetPort                 port;
+   spinlock_t		    historyLock;
 };
 
 
@@ -130,6 +131,7 @@
       goto out;
    }
    memset(bridge, 0, sizeof *bridge);
+   spin_lock_init(&bridge->historyLock);
    memcpy(bridge->name, devName, sizeof bridge->name);
 
    /*
@@ -391,6 +393,8 @@
 	 unsigned long flags;
 	 int i;
 	 SKB_INCREF(clone);
+	 
+	 spin_lock_irqsave(&bridge->historyLock, flags);
 	 // XXX need to lock history
 	 for (i = 0; i < VNET_BRIDGE_HISTORY; i++) {
 	    if (bridge->history[i] == NULL) {
@@ -417,11 +421,15 @@
 	    for (i = 0; i < VNET_BRIDGE_HISTORY; i++) {
 	       struct sk_buff *s = bridge->history[i];
 	       bridge->history[i] = NULL;
-	       KFREE_SKB(s, FREE_WRITE);
+	       if (s) {
+	       	  spin_unlock_irqrestore(&bridge->historyLock, flags);
+		  KFREE_SKB(s, FREE_WRITE);
+		  spin_lock_irqsave(&bridge->historyLock, flags);
+	       }
 	    }
 	    bridge->history[0] = clone;
 	 }
-         
+         spin_unlock_irqrestore(&bridge->historyLock, flags);
 	 clone->dev = dev;
 	 clone->protocol = eth_type_trans(clone, dev);
 	 save_flags(flags);
@@ -773,6 +781,7 @@
 {
    VNetBridge *bridge = *(VNetBridge**)&((struct sock *)pt->data)->protinfo;
    int i;
+   unsigned long flags;
 
    if (bridge->dev == NULL) {
       LOG(3, (KERN_DEBUG "bridge-%s: received %d closed\n",
@@ -782,11 +791,13 @@
    }
 
    // XXX need to lock history
+   spin_lock_irqsave(&bridge->historyLock, flags);
    for (i = 0; i < VNET_BRIDGE_HISTORY; i++) {
       struct sk_buff *s = bridge->history[i];
       if (s != NULL &&
 	  (s == skb || SKB_IS_CLONE_OF(skb, s))) {
 	 bridge->history[i] = NULL;
+	 spin_unlock_irqrestore(&bridge->historyLock, flags);
 	 KFREE_SKB(s, FREE_WRITE);
 	 LOG(3, (KERN_DEBUG "bridge-%s: receive %d self %d\n",
 		 bridge->name, (int) skb->len, i));
@@ -795,6 +806,7 @@
 	 return 0;
       }
    }
+   spin_unlock_irqrestore(&bridge->historyLock, flags);
 
 #  if LOGLEVEL >= 4
    {
diff -ru vmnet-only.orig/driver.c vmnet-only/driver.c
--- vmnet-only.orig/driver.c	Thu May 10 11:33:58 2001
+++ vmnet-only/driver.c	Thu Aug 16 17:33:13 2001
@@ -20,7 +20,7 @@
 #include <linux/module.h>
 #include <linux/version.h>
 #include <linux/sched.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #ifdef KERNEL_2_1
 #include <linux/poll.h>
 #include <asm/uaccess.h>
diff -ru vmnet-only.orig/hub.c vmnet-only/hub.c
--- vmnet-only.orig/hub.c	Thu May 10 11:33:58 2001
+++ vmnet-only/hub.c	Thu Aug 16 17:33:57 2001
@@ -19,7 +19,7 @@
 #include <linux/kernel.h>
 #include <linux/version.h>
 #include <linux/sched.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #ifdef KERNEL_2_1
 #include <linux/poll.h>
 #include <asm/uaccess.h>
diff -ru vmnet-only.orig/netif.c vmnet-only/netif.c
--- vmnet-only.orig/netif.c	Thu May 10 11:33:58 2001
+++ vmnet-only/netif.c	Thu Aug 16 17:33:21 2001
@@ -19,7 +19,7 @@
 #include <linux/kernel.h>
 #include <linux/version.h>
 #include <linux/sched.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #ifdef KERNEL_2_1
 #include <linux/poll.h>
 #include <asm/uaccess.h>
diff -ru vmnet-only.orig/procfs.c vmnet-only/procfs.c
--- vmnet-only.orig/procfs.c	Thu May 10 11:33:58 2001
+++ vmnet-only/procfs.c	Thu Aug 16 17:33:27 2001
@@ -19,7 +19,7 @@
 #include <linux/kernel.h>
 #include <linux/version.h>
 #include <linux/sched.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #ifdef KERNEL_2_1
 #include <linux/poll.h>
 #include <asm/uaccess.h>
diff -ru vmnet-only.orig/userif.c vmnet-only/userif.c
--- vmnet-only.orig/userif.c	Thu May 10 11:33:58 2001
+++ vmnet-only/userif.c	Thu Aug 16 17:33:33 2001
@@ -19,7 +19,7 @@
 #include <linux/kernel.h>
 #include <linux/version.h>
 #include <linux/sched.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #ifdef KERNEL_2_1
 #include <linux/poll.h>
 #include <asm/uaccess.h>

[-- Attachment #1.3: vmmon-only-2.4.8.patch --]
[-- Type: text/plain, Size: 1126 bytes --]

diff -ru vmmon-only.orig/linux/driver.c vmmon-only/linux/driver.c
--- vmmon-only.orig/linux/driver.c	Thu May 10 11:33:58 2001
+++ vmmon-only/linux/driver.c	Thu Aug 16 17:55:29 2001
@@ -9,6 +9,7 @@
 #endif 
 
 #include "driver-config.h"
+#include "hostif.h"
 
 #ifdef KERNEL_2_1
 #define EXPORT_SYMTAB
@@ -19,7 +20,7 @@
 #include <linux/module.h>
 #include <linux/version.h>
 #include <linux/sched.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 
 #ifdef __SMP__
 #include <linux/smp.h>
@@ -925,7 +926,7 @@
 	  current->fsuid == current->uid &&
           current->egid == current->gid &&
 	  current->fsgid == current->gid) {
-	 current->dumpable = 1;
+	 current->mm->dumpable = 1;
       }
       break;
 
diff -ru vmmon-only.orig/linux/hostif.c vmmon-only/linux/hostif.c
--- vmmon-only.orig/linux/hostif.c	Thu May 10 11:33:58 2001
+++ vmmon-only/linux/hostif.c	Thu Aug 16 17:35:37 2001
@@ -22,7 +22,7 @@
 #include <linux/binfmts.h>
 #include <linux/fs.h>
 #include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 
 #ifdef KERNEL_2_1
 #  ifdef KERNEL_2_3_25

[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]

             reply	other threads:[~2001-08-16  8:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-16  8:49 Jason Thomas [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-08-17 13:12 [PATCH] patch's for vmware 2.0.4 for use with linux-2.4.8 kernel Martin Knoblauch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010816184937.E742@topic.com.au \
    --to=jason@topic.com.au \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.