Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 243142
b: refs/heads/master
c: 4a64001
h: refs/heads/master
v: v3
  • Loading branch information
Josef Bacik committed Mar 17, 2011
1 parent e5d2275 commit 80472b5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 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: d0215f3e5ebb5803cd6ec067b10c5e00a3ad7cfc
refs/heads/master: 4a64001f0047956e283f7ada9843dfc3f3b5d8c8
9 changes: 5 additions & 4 deletions trunk/fs/btrfs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,6 @@ static noinline void btrfs_drop_pages(struct page **pages, size_t num_pages)
{
size_t i;
for (i = 0; i < num_pages; i++) {
if (!pages[i])
break;
/* page checked is some magic around finding pages that
* have been modified without going through btrfs_set_page_dirty
* clear it here
Expand Down Expand Up @@ -824,7 +822,6 @@ static noinline int prepare_pages(struct btrfs_root *root, struct file *file,
return err;
}

memset(pages, 0, num_pages * sizeof(struct page *));
again:
for (i = 0; i < num_pages; i++) {
pages[i] = grab_cache_page(inode->i_mapping, index + i);
Expand Down Expand Up @@ -930,7 +927,6 @@ static noinline ssize_t __btrfs_buffered_write(struct file *file,
size_t copied;

WARN_ON(num_pages > nrptrs);
memset(pages, 0, sizeof(struct page *) * nrptrs);

/*
* Fault pages before locking them in prepare_pages
Expand All @@ -946,6 +942,11 @@ static noinline ssize_t __btrfs_buffered_write(struct file *file,
if (ret)
break;

/*
* This is going to setup the pages array with the number of
* pages we want, so we don't really need to worry about the
* contents of pages from loop to loop
*/
ret = prepare_pages(root, file, pages, num_pages,
pos, first_index, last_index,
write_bytes);
Expand Down

0 comments on commit 80472b5

Please sign in to comment.