Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 65324
b: refs/heads/master
c: e46dc1d
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed Oct 8, 2007
1 parent 95155bb commit 1fb9315
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 8 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: bf0b48dfc368c07c42b5a3a5658c8ee81b4283ac
refs/heads/master: e46dc1dab969550d4136e9be0e7919ca09e49573
2 changes: 1 addition & 1 deletion trunk/fs/aio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1562,6 +1562,7 @@ int fastcall io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb,
fput(file);
return -EAGAIN;
}
req->ki_filp = file;
if (iocb->aio_flags & IOCB_FLAG_RESFD) {
/*
* If the IOCB_FLAG_RESFD flag of aio_flags is set, get an
Expand All @@ -1576,7 +1577,6 @@ int fastcall io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb,
}
}

req->ki_filp = file;
ret = put_user(req->ki_key, &user_iocb->aio_key);
if (unlikely(ret)) {
dprintk("EFAULT: aio_key\n");
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/linux/writeback.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ int sync_page_range(struct inode *inode, struct address_space *mapping,
loff_t pos, loff_t count);
int sync_page_range_nolock(struct inode *inode, struct address_space *mapping,
loff_t pos, loff_t count);
void set_page_dirty_balance(struct page *page);
void set_page_dirty_balance(struct page *page, int page_mkwrite);
void writeback_set_ratelimit(void);

/* pdflush.c */
Expand Down
1 change: 1 addition & 0 deletions trunk/mm/filemap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1388,6 +1388,7 @@ int filemap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
size = (i_size_read(inode) + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
if (unlikely(vmf->pgoff >= size)) {
unlock_page(page);
page_cache_release(page);
goto outside_data_content;
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/mm/fremap.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ asmlinkage long sys_remap_file_pages(unsigned long start, unsigned long size,
if (vma->vm_private_data && !(vma->vm_flags & VM_NONLINEAR))
goto out;

if (!vma->vm_flags & VM_CAN_NONLINEAR)
if (!(vma->vm_flags & VM_CAN_NONLINEAR))
goto out;

if (end <= start || start < vma->vm_start || end > vma->vm_end)
Expand Down
9 changes: 7 additions & 2 deletions trunk/mm/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -1639,6 +1639,7 @@ static int do_wp_page(struct mm_struct *mm, struct vm_area_struct *vma,
struct page *old_page, *new_page;
pte_t entry;
int reuse = 0, ret = 0;
int page_mkwrite = 0;
struct page *dirty_page = NULL;

old_page = vm_normal_page(vma, address, orig_pte);
Expand Down Expand Up @@ -1687,6 +1688,8 @@ static int do_wp_page(struct mm_struct *mm, struct vm_area_struct *vma,
page_cache_release(old_page);
if (!pte_same(*page_table, orig_pte))
goto unlock;

page_mkwrite = 1;
}
dirty_page = old_page;
get_page(dirty_page);
Expand Down Expand Up @@ -1774,7 +1777,7 @@ static int do_wp_page(struct mm_struct *mm, struct vm_area_struct *vma,
* do_no_page is protected similarly.
*/
wait_on_page_locked(dirty_page);
set_page_dirty_balance(dirty_page);
set_page_dirty_balance(dirty_page, page_mkwrite);
put_page(dirty_page);
}
return ret;
Expand Down Expand Up @@ -2322,6 +2325,7 @@ static int __do_fault(struct mm_struct *mm, struct vm_area_struct *vma,
struct page *dirty_page = NULL;
struct vm_fault vmf;
int ret;
int page_mkwrite = 0;

vmf.virtual_address = (void __user *)(address & PAGE_MASK);
vmf.pgoff = pgoff;
Expand Down Expand Up @@ -2398,6 +2402,7 @@ static int __do_fault(struct mm_struct *mm, struct vm_area_struct *vma,
anon = 1; /* no anon but release vmf.page */
goto out;
}
page_mkwrite = 1;
}
}

Expand Down Expand Up @@ -2453,7 +2458,7 @@ static int __do_fault(struct mm_struct *mm, struct vm_area_struct *vma,
if (anon)
page_cache_release(vmf.page);
else if (dirty_page) {
set_page_dirty_balance(dirty_page);
set_page_dirty_balance(dirty_page, page_mkwrite);
put_page(dirty_page);
}

Expand Down
4 changes: 2 additions & 2 deletions trunk/mm/page-writeback.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,9 @@ static void balance_dirty_pages(struct address_space *mapping)
pdflush_operation(background_writeout, 0);
}

void set_page_dirty_balance(struct page *page)
void set_page_dirty_balance(struct page *page, int page_mkwrite)
{
if (set_page_dirty(page)) {
if (set_page_dirty(page) || page_mkwrite) {
struct address_space *mapping = page_mapping(page);

if (mapping)
Expand Down

0 comments on commit 1fb9315

Please sign in to comment.