aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Piggin <npiggin@suse.de>2007-12-13 18:58:57 -0500
committerRoland Dreier <rolandd@cisco.com>2008-01-25 17:15:29 -0500
commit3c8450860ba9d6279dbc969633eacf99161860d9 (patch)
tree54f456c7987485009b4f4786e31de62a87939b2e
parenta2f76cd69f4913079cad10670f8520ffe07f4067 (diff)
IB/ipath: Convert from .nopage to .fault
Signed-off-by: Nick Piggin <npiggin@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Roland Dreier <rolandd@cisco.com>
-rw-r--r--drivers/infiniband/hw/ipath/ipath_debug.h4
-rw-r--r--drivers/infiniband/hw/ipath/ipath_file_ops.c29
2 files changed, 12 insertions, 21 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_debug.h b/drivers/infiniband/hw/ipath/ipath_debug.h
index 19c56e6491eb..d6f69532d83f 100644
--- a/drivers/infiniband/hw/ipath/ipath_debug.h
+++ b/drivers/infiniband/hw/ipath/ipath_debug.h
@@ -55,7 +55,7 @@
55#define __IPATH_PKTDBG 0x80 /* print packet data */ 55#define __IPATH_PKTDBG 0x80 /* print packet data */
56/* print process startup (init)/exit messages */ 56/* print process startup (init)/exit messages */
57#define __IPATH_PROCDBG 0x100 57#define __IPATH_PROCDBG 0x100
58/* print mmap/nopage stuff, not using VDBG any more */ 58/* print mmap/fault stuff, not using VDBG any more */
59#define __IPATH_MMDBG 0x200 59#define __IPATH_MMDBG 0x200
60#define __IPATH_ERRPKTDBG 0x400 60#define __IPATH_ERRPKTDBG 0x400
61#define __IPATH_USER_SEND 0x1000 /* use user mode send */ 61#define __IPATH_USER_SEND 0x1000 /* use user mode send */
@@ -81,7 +81,7 @@
81#define __IPATH_VERBDBG 0x0 /* very verbose debug */ 81#define __IPATH_VERBDBG 0x0 /* very verbose debug */
82#define __IPATH_PKTDBG 0x0 /* print packet data */ 82#define __IPATH_PKTDBG 0x0 /* print packet data */
83#define __IPATH_PROCDBG 0x0 /* process startup (init)/exit messages */ 83#define __IPATH_PROCDBG 0x0 /* process startup (init)/exit messages */
84/* print mmap/nopage stuff, not using VDBG any more */ 84/* print mmap/fault stuff, not using VDBG any more */
85#define __IPATH_MMDBG 0x0 85#define __IPATH_MMDBG 0x0
86#define __IPATH_EPKTDBG 0x0 /* print ethernet packet data */ 86#define __IPATH_EPKTDBG 0x0 /* print ethernet packet data */
87#define __IPATH_IPATHDBG 0x0 /* Ethernet (IPATH) table dump on */ 87#define __IPATH_IPATHDBG 0x0 /* Ethernet (IPATH) table dump on */
diff --git a/drivers/infiniband/hw/ipath/ipath_file_ops.c b/drivers/infiniband/hw/ipath/ipath_file_ops.c
index 92dae6f5b395..e7fbb31a48a0 100644
--- a/drivers/infiniband/hw/ipath/ipath_file_ops.c
+++ b/drivers/infiniband/hw/ipath/ipath_file_ops.c
@@ -1120,33 +1120,24 @@ bail:
1120} 1120}
1121 1121
1122/* 1122/*
1123 * ipath_file_vma_nopage - handle a VMA page fault. 1123 * ipath_file_vma_fault - handle a VMA page fault.
1124 */ 1124 */
1125static struct page *ipath_file_vma_nopage(struct vm_area_struct *vma, 1125static int ipath_file_vma_fault(struct vm_area_struct *vma,
1126 unsigned long address, int *type) 1126 struct vm_fault *vmf)
1127{ 1127{
1128 unsigned long offset = address - vma->vm_start; 1128 struct page *page;
1129 struct page *page = NOPAGE_SIGBUS;
1130 void *pageptr;
1131 1129
1132 /* 1130 page = vmalloc_to_page((void *)(vmf->pgoff << PAGE_SHIFT));
1133 * Convert the vmalloc address into a struct page.
1134 */
1135 pageptr = (void *)(offset + (vma->vm_pgoff << PAGE_SHIFT));
1136 page = vmalloc_to_page(pageptr);
1137 if (!page) 1131 if (!page)
1138 goto out; 1132 return VM_FAULT_SIGBUS;
1139
1140 /* Increment the reference count. */
1141 get_page(page); 1133 get_page(page);
1142 if (type) 1134 vmf->page = page;
1143 *type = VM_FAULT_MINOR; 1135
1144out: 1136 return 0;
1145 return page;
1146} 1137}
1147 1138
1148static struct vm_operations_struct ipath_file_vm_ops = { 1139static struct vm_operations_struct ipath_file_vm_ops = {
1149 .nopage = ipath_file_vma_nopage, 1140 .fault = ipath_file_vma_fault,
1150}; 1141};
1151 1142
1152static int mmap_kvaddr(struct vm_area_struct *vma, u64 pgaddr, 1143static int mmap_kvaddr(struct vm_area_struct *vma, u64 pgaddr,