- 论坛徽章:
- 0
|
diff -ur 1/vmblock-only/linux/dentry.c 2/vmblock-only/linux/dentry.c
--- 1/vmblock-only/linux/dentry.c 2007-05-02 12:08:22.000000000 +0800
+++ 2/vmblock-only/linux/dentry.c 2008-05-26 02:13:00.561731673 +0800
@@ -98,8 +98,8 @@
LOG(4, "DentryOpRevalidate: [%s] no longer exists\n", iinfo->name);
return 0;
}
- ret = actualNd.dentry && actualNd.dentry->d_inode;
- path_release(&actualNd);
+ ret = actualNd.path.dentry && actualNd.path.dentry->d_inode;
+ path_put(&actualNd.path);
LOG(8, "DentryOpRevalidate: [%s] %s revalidated\n",
iinfo->name, ret ? "" : "not");
diff -ur 1/vmblock-only/linux/filesystem.c 2/vmblock-only/linux/filesystem.c
--- 1/vmblock-only/linux/filesystem.c 2007-05-02 12:08:22.000000000 +0800
+++ 2/vmblock-only/linux/filesystem.c 2008-05-26 02:13:00.562731648 +0800
@@ -52,8 +52,7 @@
/* Utility */
-static void InodeCacheCtor(void *slabelem,
- compat_kmem_cache *cache, unsigned long flags);
+static void InodeCacheCtor(compat_kmem_cache *cache, void *slabelem);
/* Variables */
@@ -121,8 +120,7 @@
sizeof (VMBlockInodeInfo),
0,
SLAB_HWCACHE_ALIGN,
- InodeCacheCtor,
- NULL);
+ InodeCacheCtor);
if (!VMBlockInodeCache) {
Warning("VMBlockInitFileSystem: could not initialize inode cache\n");
return -ENOMEM;
@@ -261,10 +259,14 @@
ASSERT(sb);
- inode = iget(sb, ino);
+ inode = iget_locked(sb, ino);
if (!inode) {
return NULL;
}
+ if (inode->i_state & I_NEW) {
+ SuperOpReadInode(inode);
+ unlock_new_inode(inode);
+ }
iinfo = INODE_TO_IINFO(inode);
if (!iinfo) {
@@ -289,8 +291,8 @@
return inode;
}
- iinfo->actualDentry = actualNd.dentry;
- path_release(&actualNd);
+ iinfo->actualDentry = actualNd.path.dentry;
+ path_put(&actualNd.path);
return inode;
@@ -325,9 +327,7 @@
*/
static void
-InodeCacheCtor(void *slabElem, // IN: allocated slab item to initialize
- compat_kmem_cache *cache, // IN: cache slab is from
- unsigned long flags) // IN: flags associated with allocation
+InodeCacheCtor(compat_kmem_cache *cache, void *slabElem)
{
#ifdef VMW_EMBED_INODE
VMBlockInodeInfo *iinfo = (VMBlockInodeInfo *)slabElem;
diff -ur 1/vmblock-only/linux/filesystem.h 2/vmblock-only/linux/filesystem.h
--- 1/vmblock-only/linux/filesystem.h 2007-05-02 12:08:22.000000000 +0800
+++ 2/vmblock-only/linux/filesystem.h 2008-05-26 02:13:00.563731600 +0800
@@ -81,6 +81,7 @@
struct dentry *dentry, ino_t ino);
int MakeFullName(struct inode *dir, struct dentry *dentry,
char *bufOut, size_t bufOutSize);
+void SuperOpReadInode(struct inode *inode);
/* Variables */
extern compat_kmem_cache *VMBlockInodeCache;
diff -ur 1/vmblock-only/linux/os.h 2/vmblock-only/linux/os.h
--- 1/vmblock-only/linux/os.h 2007-05-02 12:08:22.000000000 +0800
+++ 2/vmblock-only/linux/os.h 2008-05-26 02:13:00.564731235 +0800
@@ -76,7 +76,7 @@
#define os_write_unlock(lock) write_unlock(lock)
#define os_kmem_cache_create(name, size, align, flags, ctor, dtor, data) \
- kmem_cache_create(name, size, align, flags, ctor, dtor)
+ kmem_cache_create(name, size, align, flags, ctor)
#define os_kmem_cache_destroy(cache) kmem_cache_destroy(cache)
#define os_kmem_cache_alloc(cache) kmem_cache_alloc(cache, GFP_KERNEL)
#define os_kmem_cache_free(cache, elem) kmem_cache_free(cache, elem)
diff -ur 1/vmblock-only/linux/super.c 2/vmblock-only/linux/super.c
--- 1/vmblock-only/linux/super.c 2007-05-02 12:08:22.000000000 +0800
+++ 2/vmblock-only/linux/super.c 2008-05-26 02:13:00.565731232 +0800
@@ -23,7 +23,7 @@
#else
static void SuperOpClearInode(struct inode *inode);
#endif
-static void SuperOpReadInode(struct inode *inode);
+void SuperOpReadInode(struct inode *inode);
#ifdef VMW_STATFS_2618
static int SuperOpStatfs(struct dentry *dentry, struct compat_kstatfs *stat);
#else
@@ -38,7 +38,6 @@
#else
.clear_inode = SuperOpClearInode,
#endif
- .read_inode = SuperOpReadInode,
.statfs = SuperOpStatfs,
};
@@ -124,7 +123,7 @@
*----------------------------------------------------------------------------
*/
-static void
+void
SuperOpReadInode(struct inode *inode) // IN: Inode to initialize
{
VMBlockInodeInfo *iinfo = INODE_TO_IINFO(inode);
diff -ur 1/vmblock-only/Makefile.kernel 2/vmblock-only/Makefile.kernel
--- 1/vmblock-only/Makefile.kernel 2007-05-02 12:08:22.000000000 +0800
+++ 2/vmblock-only/Makefile.kernel 2008-05-26 02:13:00.567731493 +0800
@@ -30,9 +30,9 @@
EXTRA_CFLAGS := $(CC_OPTS) $(INCLUDE)
-EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/autoconf/setnice.c, -DVMW_HAVE_SET_USER_NICE, )
-EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/autoconf/epoll.c, -DVMW_HAVE_EPOLL, )
-EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/autoconf/skas1.c, -DVMW_SKAS_MMAP, )
+EXTRA_CFLAGS += -DVMW_HAVE_SET_USER_NICE
+EXTRA_CFLAGS += -DVMW_HAVE_EPOLL
+EXTRA_CFLAGS += -DVMW_SKAS_MMAP
# Note: These tests are inverted.
EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/autoconf/getsb1.c, , -DVMW_GETSB_2618)
diff -ur 1/vmmon-only/include/compat_pgtable.h 2/vmmon-only/include/compat_pgtable.h
--- 1/vmmon-only/include/compat_pgtable.h 2007-05-02 12:08:21.000000000 +0800
+++ 2/vmmon-only/include/compat_pgtable.h 2008-05-26 02:13:00.571732296 +0800
@@ -72,11 +72,7 @@
#endif
-#ifdef pgd_offset_k
-# define compat_pgd_offset_k(mm, address) pgd_offset_k(address)
-#else
-# define compat_pgd_offset_k(mm, address) pgd_offset(mm, address)
-#endif
+#define compat_pgd_offset_k(mm, address) pgd_offset(mm, address)
/* Introduced somewhere in 2.6.0, + backported to some 2.4 RedHat kernels */
diff -ur 1/vmmon-only/include/vcpuset.h 2/vmmon-only/include/vcpuset.h
--- 1/vmmon-only/include/vcpuset.h 2007-05-02 12:08:21.000000000 +0800
+++ 2/vmmon-only/include/vcpuset.h 2008-05-26 02:13:00.573731862 +0800
@@ -71,7 +71,7 @@
#define ffs(x) ffs_x86_64(x)
#elif defined MODULE
- #include "asm/bitops.h"
+ #include "linux/bitops.h"
#elif defined __APPLE__ && defined KERNEL
/*
* XXXMACOS An ugly hack to resolve redefinition of PAGE_ defines
diff -ur 1/vmmon-only/include/x86cpuid.h 2/vmmon-only/include/x86cpuid.h
--- 1/vmmon-only/include/x86cpuid.h 2007-05-02 12:08:21.000000000 +0800
+++ 2/vmmon-only/include/x86cpuid.h 2008-05-26 02:13:00.574731435 +0800
@@ -378,12 +378,12 @@
* Note: The FEATURE/MASK definitions must use some gymnastics to get
* around a warning when shifting left by 32.
*/
-#define BIT_MASK(shift) (((1 (shift - 1)) 1) - 1)
+#define __BIT_MASK(shift) (((1 (shift - 1)) 1) - 1)
#define FIELDDEF(lvl, reg, vend, bitpos, size, name, m, v) \
CPUID_##vend##_ID##lvl##reg##_##name##_SHIFT = bitpos, \
CPUID_##vend##_ID##lvl##reg##_##name##_MASK = \
- BIT_MASK(size) bitpos, \
+ __BIT_MASK(size) bitpos, \
CPUID_FEATURE_##vend##_ID##lvl##reg##_##name = \
CPUID_##vend##_ID##lvl##reg##_##name##_MASK,
@@ -397,7 +397,7 @@
/* Define data for every CPUID field we have */
CPUID_FIELD_DATA
};
-#undef BIT_MASK
+#undef __BIT_MASK
#undef FIELDDEF
#undef FLAGDEF
#undef FIELDDEFA
diff -ur 1/vmmon-only/linux/driver.c 2/vmmon-only/linux/driver.c
--- 1/vmmon-only/linux/driver.c 2007-05-02 12:08:21.000000000 +0800
+++ 2/vmmon-only/linux/driver.c 2008-05-26 02:13:00.576732291 +0800
@@ -488,7 +488,7 @@
Vmx86_DestroyNUMAInfo();
}
-
+MODULE_LICENSE("GPL");
/*
@@ -1712,7 +1712,9 @@
current->egid == current->gid &&
current->fsgid == current->gid) {
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 7)
- current->mm->dumpable = 1;
+ set_bit(MMF_DUMPABLE, ¤t->mm->flags);
+ smp_wmb();
+ clear_bit(MMF_DUMP_SECURELY, ¤t->mm->flags);
#else
current->dumpable = 1;
#endif
diff -ur 1/vmmon-only/Makefile.kernel 2/vmmon-only/Makefile.kernel
--- 1/vmmon-only/Makefile.kernel 2007-05-02 12:08:21.000000000 +0800
+++ 2/vmmon-only/Makefile.kernel 2008-05-26 02:13:00.578731422 +0800
@@ -21,10 +21,10 @@
EXTRA_CFLAGS := $(CC_OPTS) $(INCLUDE)
-EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/autoconf/nopage1.c, -DVMW_NOPAGE_261, )
-EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/autoconf/skas1.c, -DVMW_SKAS_MMAP, )
-EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/autoconf/epoll.c, -DVMW_HAVE_EPOLL, )
-EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/autoconf/setnice.c, -DVMW_HAVE_SET_USER_NICE, )
+EXTRA_CFLAGS += -DVMW_NOPAGE_261
+EXTRA_CFLAGS += -DVMW_SKAS_MMAP
+EXTRA_CFLAGS += -DVMW_HAVE_EPOLL
+EXTRA_CFLAGS += -DVMW_HAVE_SET_USER_NICE
obj-m += $(DRIVER).o
diff -ur 1/vmnet-only/bridge.c 2/vmnet-only/bridge.c
--- 1/vmnet-only/bridge.c 2007-05-02 12:08:22.000000000 +0800
+++ 2/vmnet-only/bridge.c 2008-05-26 02:13:00.580731751 +0800
@@ -853,7 +853,7 @@
retval = -ENOMEM;
goto out;
}
- SET_SK_DEAD(bridge->sk, 1);
+ sock_set_flag(bridge->sk, SOCK_DEAD);
bridge->wirelessAdapter = VNetBridgeIsDeviceWireless(bridge->dev);
@@ -1083,12 +1083,13 @@
VNetBridgeComputeHeaderPos(struct sk_buff *skb) // IN: buffer to examine
{
/* Maybe some kernel gets it right... */
- if (skb->h.raw != skb->nh.raw) {
+ if (skb->transport_header != skb->network_header) {
return;
}
switch (be16_to_cpu(skb->protocol)) {
case ETH_P_IP:
- skb->h.raw = skb->nh.raw + (skb->nh.raw[0] & 0x0F) * 4;
+ skb_set_transport_header(skb, skb_network_offset(skb) +
+ (skb_network_header(skb)[0] & 0xFF) * 4);
return;
default:
LOG(3, (KERN_DEBUG "Unknown EII protocol %04X: csum at %d\n",
@@ -1370,7 +1371,7 @@
# endif
if (bridge->smac) {
- if (VNetCallSMACFunc(bridge->smac, &skb, skb->mac.raw,
+ if (VNetCallSMACFunc(bridge->smac, &skb, skb_mac_header(skb),
SMAC_CheckPacketFromHost) !=
PacketStatusForwardPacket) {
LOG(4, (KERN_NOTICE "bridge-%s: packet dropped .\n",
@@ -1392,7 +1393,7 @@
#endif
#endif
- skb_push(skb, skb->data - skb->mac.raw);
+ skb_push(skb, skb->data - skb_mac_header(skb));
LOG(3, (KERN_DEBUG "bridge-%s: receive %d\n",
bridge->name, (int) skb->len));
diff -ur 1/vmnet-only/driver.c 2/vmnet-only/driver.c
--- 1/vmnet-only/driver.c 2007-05-02 12:08:22.000000000 +0800
+++ 2/vmnet-only/driver.c 2008-05-26 02:13:00.581731402 +0800
@@ -525,10 +525,10 @@
void
cleanup_module(void)
{
- int retval;
+ int retval = 0;
unregister_ioctl32_handlers();
- retval = unregister_chrdev(VNET_MAJOR_NUMBER, "vmnet");
+ unregister_chrdev(VNET_MAJOR_NUMBER, "vmnet");
if (retval != 0 ) {
LOG(0, (KERN_WARNING "/dev/vmnet: could not unregister major device %d\n",
VNET_MAJOR_NUMBER));
diff -ur 1/vmnet-only/filter.c 2/vmnet-only/filter.c
--- 1/vmnet-only/filter.c 2007-05-02 12:08:22.000000000 +0800
+++ 2/vmnet-only/filter.c 2008-05-26 02:13:00.608731792 +0800
@@ -40,7 +40,7 @@
/* netfilter hooks for filtering. */
static unsigned int VNetFilterHookFn(unsigned int hooknum,
- struct sk_buff **pskb,
+ struct sk_buff *skb,
const struct net_device *in,
const struct net_device *out,
int (*okfn)(struct sk_buff *));
@@ -48,12 +48,12 @@
{ .hook = VNetFilterHookFn,
compat_nf_hook_owner
.pf = PF_INET,
- .hooknum = NF_IP_LOCAL_IN,
+ .hooknum = NF_INET_LOCAL_IN,
.priority = NF_IP_PRI_FILTER - 1, },
{ .hook = VNetFilterHookFn,
compat_nf_hook_owner
.pf = PF_INET,
- .hooknum = NF_IP_POST_ROUTING,
+ .hooknum = NF_INET_POST_ROUTING,
.priority = NF_IP_PRI_FILTER - 1, }
};
@@ -185,13 +185,12 @@
static unsigned int
VNetFilterHookFn(unsigned int hooknum, // IN:
- struct sk_buff **pskb, // IN:
+ struct sk_buff *skb, // IN:
const struct net_device *in, // IN:
const struct net_device *out, // IN:
int (*okfn)(struct sk_buff *)) // IN:
{
struct iphdr *ip;
- struct sk_buff *skb = *pskb;
uint32 remoteAddr;
uint16 localPort;
uint16 remotePort;
@@ -227,17 +226,17 @@
/* When the host transmits, hooknum is NF_IP_POST_ROUTING. */
/* When the host receives, hooknum is NF_IP_LOCAL_IN. */
- transmit = (hooknum == NF_IP_POST_ROUTING);
+ transmit = (hooknum == NF_INET_POST_ROUTING);
- ip = skb->nh.iph;
+ ip = ip_hdr(skb);
packetHeader = (uint8 *)ip;
if (transmit) {
/* skb all set up for us. */
- packet = skb->h.raw;
+ packet = skb_transport_header(skb);
} else {
/* skb hasn
编译前将linux-2.6.25/include/types.h中第40行注视掉
//typedef unsigned long uintptr_t;
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/42947/showart_706828.html |
|