Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 139463
b: refs/heads/master
c: 7f366cf
h: refs/heads/master
i:
  139461: e08eddb
  139459: d7cbfdb
  139455: c7549e2
v: v3
  • Loading branch information
Chris Mason committed Mar 24, 2009
1 parent 8d4d8ac commit 3b1c193
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 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: b7ec40d7845bffca8bb3af2ea3f192d6257bbe21
refs/heads/master: 7f366cfecfc126731f8ac505d72026d691dac79a
15 changes: 7 additions & 8 deletions trunk/fs/btrfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ static noinline int insert_inline_extent(struct btrfs_trans_handle *trans,
* does the checks required to make sure the data is small enough
* to fit as an inline extent.
*/
static int cow_file_range_inline(struct btrfs_trans_handle *trans,
static noinline int cow_file_range_inline(struct btrfs_trans_handle *trans,
struct btrfs_root *root,
struct inode *inode, u64 start, u64 end,
size_t compressed_size,
Expand Down Expand Up @@ -854,11 +854,6 @@ static int cow_file_range_async(struct inode *inode, struct page *locked_page,
u64 cur_end;
int limit = 10 * 1024 * 1042;

if (!btrfs_test_opt(root, COMPRESS)) {
return cow_file_range(inode, locked_page, start, end,
page_started, nr_written, 1);
}

clear_extent_bit(&BTRFS_I(inode)->io_tree, start, end, EXTENT_LOCKED |
EXTENT_DELALLOC, 1, 0, GFP_NOFS);
while (start < end) {
Expand Down Expand Up @@ -935,7 +930,8 @@ static noinline int csum_exist_in_range(struct btrfs_root *root,
* If no cow copies or snapshots exist, we write directly to the existing
* blocks on disk
*/
static int run_delalloc_nocow(struct inode *inode, struct page *locked_page,
static noinline int run_delalloc_nocow(struct inode *inode,
struct page *locked_page,
u64 start, u64 end, int *page_started, int force,
unsigned long *nr_written)
{
Expand Down Expand Up @@ -1133,17 +1129,20 @@ static int run_delalloc_range(struct inode *inode, struct page *locked_page,
unsigned long *nr_written)
{
int ret;
struct btrfs_root *root = BTRFS_I(inode)->root;

if (btrfs_test_flag(inode, NODATACOW))
ret = run_delalloc_nocow(inode, locked_page, start, end,
page_started, 1, nr_written);
else if (btrfs_test_flag(inode, PREALLOC))
ret = run_delalloc_nocow(inode, locked_page, start, end,
page_started, 0, nr_written);
else if (!btrfs_test_opt(root, COMPRESS))
ret = cow_file_range(inode, locked_page, start, end,
page_started, nr_written, 1);
else
ret = cow_file_range_async(inode, locked_page, start, end,
page_started, nr_written);

return ret;
}

Expand Down

0 comments on commit 3b1c193

Please sign in to comment.