summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/file.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2011-07-27 16:13:10 -0400
committerChris Mason <chris.mason@oracle.com>2011-07-27 16:18:13 -0400
commitff95acb6733d41a8d45feb0e18b96df25e610e78 (patch)
treee20983c579c9095970aefa9cb176a9df0654d1e4 /fs/btrfs/file.c
parent02f8c6aee8df3cdc935e9bdd4f2d020306035dbe (diff)
parent75c195a2cac2c3c8366c0b87de2d6814c4f4d638 (diff)
Merge branch 'integration' into for-linus
Diffstat (limited to 'fs/btrfs/file.c')
-rw-r--r--fs/btrfs/file.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index fa4ef18b66b..6e56a468d1f 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -1081,7 +1081,8 @@ static noinline int prepare_pages(struct btrfs_root *root, struct file *file,
again:
for (i = 0; i < num_pages; i++) {
- pages[i] = grab_cache_page(inode->i_mapping, index + i);
+ pages[i] = find_or_create_page(inode->i_mapping, index + i,
+ GFP_NOFS);
if (!pages[i]) {
faili = i - 1;
err = -ENOMEM;
@@ -1238,9 +1239,11 @@ static noinline ssize_t __btrfs_buffered_write(struct file *file,
* managed to copy.
*/
if (num_pages > dirty_pages) {
- if (copied > 0)
- atomic_inc(
- &BTRFS_I(inode)->outstanding_extents);
+ if (copied > 0) {
+ spin_lock(&BTRFS_I(inode)->lock);
+ BTRFS_I(inode)->outstanding_extents++;
+ spin_unlock(&BTRFS_I(inode)->lock);
+ }
btrfs_delalloc_release_space(inode,
(num_pages - dirty_pages) <<
PAGE_CACHE_SHIFT);