Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 5596
b: refs/heads/master
c: a68d2eb
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed Aug 3, 2005
1 parent f810d2c commit 7e84aa8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 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: f33ea7f404e592e4563b12101b7a4d17da6558d7
refs/heads/master: a68d2ebc1581a3aec57bd032651e013fa609f530
22 changes: 13 additions & 9 deletions trunk/mm/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -949,6 +949,8 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm,

cond_resched_lock(&mm->page_table_lock);
while (!(page = follow_page(mm, start, write_access))) {
int ret;

/*
* Shortcut for anonymous pages. We don't want
* to force the creation of pages tables for
Expand All @@ -961,16 +963,18 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
break;
}
spin_unlock(&mm->page_table_lock);
switch (__handle_mm_fault(mm, vma, start,
write_access)) {
case VM_FAULT_WRITE:
/*
* do_wp_page has broken COW when
* necessary, even if maybe_mkwrite
* decided not to set pte_write
*/
ret = __handle_mm_fault(mm, vma, start, write_access);

/*
* The VM_FAULT_WRITE bit tells us that do_wp_page has
* broken COW when necessary, even if maybe_mkwrite
* decided not to set pte_write. We can thus safely do
* subsequent page lookups as if they were reads.
*/
if (ret & VM_FAULT_WRITE)
write_access = 0;
/* FALLTHRU */

switch (ret & ~VM_FAULT_WRITE) {
case VM_FAULT_MINOR:
tsk->min_flt++;
break;
Expand Down

0 comments on commit 7e84aa8

Please sign in to comment.