lkml.org 
[lkml]   [2001]   [Aug]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patches in this message
/
Date
From
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/
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>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[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2005-03-22 12:57    [W:0.054 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site