Skip to content

Commit 3c84508

Browse files
Nick PigginRoland Dreier
authored andcommitted
IB/ipath: Convert from .nopage to .fault
Signed-off-by: Nick Piggin <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Roland Dreier <[email protected]>
1 parent a2f76cd commit 3c84508

File tree

2 files changed

+12
-21
lines changed

2 files changed

+12
-21
lines changed

drivers/infiniband/hw/ipath/ipath_debug.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
#define __IPATH_PKTDBG 0x80 /* print packet data */
5656
/* print process startup (init)/exit messages */
5757
#define __IPATH_PROCDBG 0x100
58-
/* print mmap/nopage stuff, not using VDBG any more */
58+
/* print mmap/fault stuff, not using VDBG any more */
5959
#define __IPATH_MMDBG 0x200
6060
#define __IPATH_ERRPKTDBG 0x400
6161
#define __IPATH_USER_SEND 0x1000 /* use user mode send */
@@ -81,7 +81,7 @@
8181
#define __IPATH_VERBDBG 0x0 /* very verbose debug */
8282
#define __IPATH_PKTDBG 0x0 /* print packet data */
8383
#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 */
8585
#define __IPATH_MMDBG 0x0
8686
#define __IPATH_EPKTDBG 0x0 /* print ethernet packet data */
8787
#define __IPATH_IPATHDBG 0x0 /* Ethernet (IPATH) table dump on */

drivers/infiniband/hw/ipath/ipath_file_ops.c

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1120,33 +1120,24 @@ static int mmap_rcvegrbufs(struct vm_area_struct *vma,
11201120
}
11211121

11221122
/*
1123-
* ipath_file_vma_nopage - handle a VMA page fault.
1123+
* ipath_file_vma_fault - handle a VMA page fault.
11241124
*/
1125-
static struct page *ipath_file_vma_nopage(struct vm_area_struct *vma,
1126-
unsigned long address, int *type)
1125+
static int ipath_file_vma_fault(struct vm_area_struct *vma,
1126+
struct vm_fault *vmf)
11271127
{
1128-
unsigned long offset = address - vma->vm_start;
1129-
struct page *page = NOPAGE_SIGBUS;
1130-
void *pageptr;
1128+
struct page *page;
11311129

1132-
/*
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);
1130+
page = vmalloc_to_page((void *)(vmf->pgoff << PAGE_SHIFT));
11371131
if (!page)
1138-
goto out;
1139-
1140-
/* Increment the reference count. */
1132+
return VM_FAULT_SIGBUS;
11411133
get_page(page);
1142-
if (type)
1143-
*type = VM_FAULT_MINOR;
1144-
out:
1145-
return page;
1134+
vmf->page = page;
1135+
1136+
return 0;
11461137
}
11471138

11481139
static struct vm_operations_struct ipath_file_vm_ops = {
1149-
.nopage = ipath_file_vma_nopage,
1140+
.fault = ipath_file_vma_fault,
11501141
};
11511142

11521143
static int mmap_kvaddr(struct vm_area_struct *vma, u64 pgaddr,

0 commit comments

Comments
 (0)