Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 133605
b: refs/heads/master
c: 9e80d40
h: refs/heads/master
i:
  133603: 53c243c
v: v3
  • Loading branch information
Jan Kara authored and Linus Torvalds committed Mar 26, 2009
1 parent 875bbb0 commit ef59b0b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 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: 0384e2959127a56d0640505d004d8dd92f9c29f5
refs/heads/master: 9e80d407736161d9b8b0c5a0d44f786e44c322ea
18 changes: 13 additions & 5 deletions trunk/fs/ext3/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1435,6 +1435,10 @@ static int journal_dirty_data_fn(handle_t *handle, struct buffer_head *bh)
return 0;
}

static int buffer_unmapped(handle_t *handle, struct buffer_head *bh)
{
return !buffer_mapped(bh);
}
/*
* Note that we always start a transaction even if we're not journalling
* data. This is to preserve ordering: any hole instantiation within
Expand Down Expand Up @@ -1505,18 +1509,22 @@ static int ext3_ordered_writepage(struct page *page,
if (ext3_journal_current_handle())
goto out_fail;

if (!page_has_buffers(page)) {
create_empty_buffers(page, inode->i_sb->s_blocksize,
(1 << BH_Dirty)|(1 << BH_Uptodate));
} else if (!walk_page_buffers(NULL, page_buffers(page), 0, PAGE_CACHE_SIZE, NULL, buffer_unmapped)) {
/* Provide NULL instead of get_block so that we catch bugs if buffers weren't really mapped */
return block_write_full_page(page, NULL, wbc);
}
page_bufs = page_buffers(page);

handle = ext3_journal_start(inode, ext3_writepage_trans_blocks(inode));

if (IS_ERR(handle)) {
ret = PTR_ERR(handle);
goto out_fail;
}

if (!page_has_buffers(page)) {
create_empty_buffers(page, inode->i_sb->s_blocksize,
(1 << BH_Dirty)|(1 << BH_Uptodate));
}
page_bufs = page_buffers(page);
walk_page_buffers(handle, page_bufs, 0,
PAGE_CACHE_SIZE, NULL, bget_one);

Expand Down

0 comments on commit ef59b0b

Please sign in to comment.