Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 128590
b: refs/heads/master
c: 5b92ee7
h: refs/heads/master
v: v3
  • Loading branch information
Chris Mason committed Sep 25, 2008
1 parent ae2ec2e commit 15a4876
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 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: bd09835d9aad9c7b664cddc8435cc37b86077971
refs/heads/master: 5b92ee7204a5fb6542b204831202adbc1a7a851a
6 changes: 4 additions & 2 deletions trunk/fs/btrfs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@ static int noinline dirty_and_release_pages(struct btrfs_trans_handle *trans,
num_bytes = (write_bytes + pos - start_pos +
root->sectorsize - 1) & ~((u64)root->sectorsize - 1);

down_read(&BTRFS_I(inode)->root->snap_sem);
end_of_last_block = start_pos + num_bytes - 1;

lock_extent(em_tree, start_pos, end_of_last_block, GFP_NOFS);
Expand Down Expand Up @@ -356,7 +355,6 @@ static int noinline dirty_and_release_pages(struct btrfs_trans_handle *trans,
mutex_unlock(&root->fs_info->fs_mutex);
unlock_extent(em_tree, start_pos, end_of_last_block, GFP_NOFS);
free_extent_map(em);
up_read(&BTRFS_I(inode)->root->snap_sem);
return err;
}

Expand Down Expand Up @@ -726,6 +724,8 @@ static ssize_t btrfs_file_write(struct file *file, const char __user *buf,

pages = kmalloc(nrptrs * sizeof(struct page *), GFP_KERNEL);

down_read(&BTRFS_I(inode)->root->snap_sem);

mutex_lock(&inode->i_mutex);
first_index = pos >> PAGE_CACHE_SHIFT;
last_index = (pos + count) >> PAGE_CACHE_SHIFT;
Expand Down Expand Up @@ -804,6 +804,8 @@ static ssize_t btrfs_file_write(struct file *file, const char __user *buf,
}
out:
mutex_unlock(&inode->i_mutex);
up_read(&BTRFS_I(inode)->root->snap_sem);

out_nolock:
kfree(pages);
if (pinned[0])
Expand Down

0 comments on commit 15a4876

Please sign in to comment.