Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/vmblock-only/linux/inode.c b/vmblock-only/linux/inode.c
- index 5991f3d..987b50d 100644
- --- a/vmblock-only/linux/inode.c
- +++ b/vmblock-only/linux/inode.c
- @@ -44,7 +44,9 @@ static struct dentry *InodeOpLookup(struct inode *, struct dentry *, unsigned in
- static int InodeOpReadlink(struct dentry *, char __user *, int);
- #endif
- -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 99)
- +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 99)
- +static const char *InodeOpFollowlink(struct dentry *dentry, struct inode *inode, struct delayed_call *delayed_call);
- +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 99)
- static const char *InodeOpFollowlink(struct dentry *dentry, struct inode *inode, void **cookie);
- #elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 99)
- static const char *InodeOpFollowlink(struct dentry *dentry, void **cookie);
- @@ -240,7 +242,9 @@ InodeOpFollowlink(struct dentry *dentry, // IN : dentry of symlink
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 99)
- struct inode *inode,
- #endif
- -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 99)
- +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 99)
- + struct delayed_call *delayed_call) // OUT:
- +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 99)
- void **cookie) // OUT: stores opaque pointer
- #else
- struct nameidata *nd) // OUT: stores result
- @@ -269,7 +273,9 @@ InodeOpFollowlink(struct dentry *dentry, // IN : dentry of symlink
- goto out;
- }
- -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 99)
- +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 99)
- + return iinfo->name;
- +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 99)
- return *cookie = iinfo->name;
- #else
- nd_set_link(nd, iinfo->name);
- diff --git a/vmci-only/linux/driver.c b/vmci-only/linux/driver.c
- index 759b28a..edc72d4 100644
- --- a/vmci-only/linux/driver.c
- +++ b/vmci-only/linux/driver.c
- @@ -1468,8 +1468,13 @@ VMCIUserVALockPage(VA addr) // IN:
- int retval;
- down_read(¤t->mm->mmap_sem);
- +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 99)
- + retval = get_user_pages(addr,
- + 1, 1, 0, &page, NULL);
- +#else
- retval = get_user_pages(current, current->mm, addr,
- 1, 1, 0, &page, NULL);
- +#endif
- up_read(¤t->mm->mmap_sem);
- if (retval != 1) {
- diff --git a/vmci-only/linux/vmciKernelIf.c b/vmci-only/linux/vmciKernelIf.c
- index a8512ed..e119f4e 100644
- --- a/vmci-only/linux/vmciKernelIf.c
- +++ b/vmci-only/linux/vmciKernelIf.c
- @@ -1835,7 +1835,11 @@ VMCIReleasePages(struct page **pages, // IN
- if (dirty) {
- set_page_dirty(pages[i]);
- }
- +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 99)
- + put_page(pages[i]);
- +#else
- page_cache_release(pages[i]);
- +#endif
- pages[i] = NULL;
- }
- }
- @@ -2049,6 +2053,13 @@ VMCIHost_GetUserMemory(VA64 produceUVA, // IN
- int err = VMCI_SUCCESS;
- down_write(¤t->mm->mmap_sem);
- +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 99)
- + retval = get_user_pages((VA)produceUVA,
- + produceQ->kernelIf->numPages,
- + 1, 0,
- + produceQ->kernelIf->u.h.headerPage,
- + NULL);
- +#else
- retval = get_user_pages(current,
- current->mm,
- (VA)produceUVA,
- @@ -2056,6 +2067,7 @@ VMCIHost_GetUserMemory(VA64 produceUVA, // IN
- 1, 0,
- produceQ->kernelIf->u.h.headerPage,
- NULL);
- +#endif
- if (retval < produceQ->kernelIf->numPages) {
- Log("get_user_pages(produce) failed (retval=%d)\n", retval);
- VMCIReleasePages(produceQ->kernelIf->u.h.headerPage, retval, FALSE);
- @@ -2063,6 +2075,13 @@ VMCIHost_GetUserMemory(VA64 produceUVA, // IN
- goto out;
- }
- +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 99)
- + retval = get_user_pages((VA)consumeUVA,
- + consumeQ->kernelIf->numPages,
- + 1, 0,
- + consumeQ->kernelIf->u.h.headerPage,
- + NULL);
- +#else
- retval = get_user_pages(current,
- current->mm,
- (VA)consumeUVA,
- @@ -2070,6 +2089,7 @@ VMCIHost_GetUserMemory(VA64 produceUVA, // IN
- 1, 0,
- consumeQ->kernelIf->u.h.headerPage,
- NULL);
- +#endif
- if (retval < consumeQ->kernelIf->numPages) {
- Log("get_user_pages(consume) failed (retval=%d)\n", retval);
- VMCIReleasePages(consumeQ->kernelIf->u.h.headerPage, retval, FALSE);
- diff --git a/vmmon-only/linux/hostif.c b/vmmon-only/linux/hostif.c
- index 918e8ce..20f450c 100644
- --- a/vmmon-only/linux/hostif.c
- +++ b/vmmon-only/linux/hostif.c
- @@ -1163,8 +1163,13 @@ HostIFGetUserPages(void *uvAddr, // IN
- int retval;
- down_read(¤t->mm->mmap_sem);
- +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 99)
- + retval = get_user_pages((unsigned long)uvAddr,
- + numPages, 0, 0, ppages, NULL);
- +#else
- retval = get_user_pages(current, current->mm, (unsigned long)uvAddr,
- numPages, 0, 0, ppages, NULL);
- +#endif
- up_read(¤t->mm->mmap_sem);
- return retval != numPages;
- diff --git a/vmnet-only/userif.c b/vmnet-only/userif.c
- index 4e457ba..b2b8059 100644
- --- a/vmnet-only/userif.c
- +++ b/vmnet-only/userif.c
- @@ -113,8 +113,13 @@ UserifLockPage(VA addr) // IN
- int retval;
- down_read(¤t->mm->mmap_sem);
- +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 99)
- + retval = get_user_pages(addr,
- + 1, 1, 0, &page, NULL);
- +#else
- retval = get_user_pages(current, current->mm, addr,
- 1, 1, 0, &page, NULL);
- +#endif
- up_read(¤t->mm->mmap_sem);
- if (retval != 1) {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement