Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 83452
b: refs/heads/master
c: a1e0961
h: refs/heads/master
v: v3
  • Loading branch information
Nick Piggin authored and Linus Torvalds committed Feb 6, 2008
1 parent 481d08a commit 8fe98a8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f2df3f65d0b4337cfb5b19eab3ee28b177427c49
refs/heads/master: a1e096129bff79ae551592539bef19bfb5c9efa1
24 changes: 9 additions & 15 deletions trunk/kernel/relay.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,37 +37,31 @@ static void relay_file_mmap_close(struct vm_area_struct *vma)
}

/*
* nopage() vm_op implementation for relay file mapping.
* fault() vm_op implementation for relay file mapping.
*/
static struct page *relay_buf_nopage(struct vm_area_struct *vma,
unsigned long address,
int *type)
static int relay_buf_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
{
struct page *page;
struct rchan_buf *buf = vma->vm_private_data;
unsigned long offset = address - vma->vm_start;
pgoff_t pgoff = vmf->pgoff;

if (address > vma->vm_end)
return NOPAGE_SIGBUS; /* Disallow mremap */
if (!buf)
return NOPAGE_OOM;
return VM_FAULT_OOM;

page = vmalloc_to_page(buf->start + offset);
page = vmalloc_to_page(buf->start + (pgoff << PAGE_SHIFT));
if (!page)
return NOPAGE_OOM;
return VM_FAULT_SIGBUS;
get_page(page);
vmf->page = page;

if (type)
*type = VM_FAULT_MINOR;

return page;
return 0;
}

/*
* vm_ops for relay file mappings.
*/
static struct vm_operations_struct relay_file_mmap_ops = {
.nopage = relay_buf_nopage,
.fault = relay_buf_fault,
.close = relay_file_mmap_close,
};

Expand Down

0 comments on commit 8fe98a8

Please sign in to comment.