Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 376275
b: refs/heads/master
c: 136e877
h: refs/heads/master
i:
  376273: 4bfbf74
  376271: aec6b36
v: v3
  • Loading branch information
Ryusuke Konishi authored and Linus Torvalds committed May 24, 2013
1 parent e1cdb93 commit 37d9176
Show file tree
Hide file tree
Showing 2 changed files with 24 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: dfd20b2b174d3a9b258ea3b7a35ead33576587b1
refs/heads/master: 136e8770cd5d1fe38b3c613100dd6dc4db6d4fa6
27 changes: 23 additions & 4 deletions trunk/fs/nilfs2/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,13 +219,32 @@ static int nilfs_writepage(struct page *page, struct writeback_control *wbc)

static int nilfs_set_page_dirty(struct page *page)
{
int ret = __set_page_dirty_buffers(page);
int ret = __set_page_dirty_nobuffers(page);

if (ret) {
if (page_has_buffers(page)) {
struct inode *inode = page->mapping->host;
unsigned nr_dirty = 1 << (PAGE_SHIFT - inode->i_blkbits);
unsigned nr_dirty = 0;
struct buffer_head *bh, *head;

nilfs_set_file_dirty(inode, nr_dirty);
/*
* This page is locked by callers, and no other thread
* concurrently marks its buffers dirty since they are
* only dirtied through routines in fs/buffer.c in
* which call sites of mark_buffer_dirty are protected
* by page lock.
*/
bh = head = page_buffers(page);
do {
/* Do not mark hole blocks dirty */
if (buffer_dirty(bh) || !buffer_mapped(bh))
continue;

set_buffer_dirty(bh);
nr_dirty++;
} while (bh = bh->b_this_page, bh != head);

if (nr_dirty)
nilfs_set_file_dirty(inode, nr_dirty);
}
return ret;
}
Expand Down

0 comments on commit 37d9176

Please sign in to comment.