Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 132482
b: refs/heads/master
c: a8e7d49
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed Mar 19, 2009
1 parent 530ca23 commit 3511e7c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 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: 68df3755e383e6fecf2354a67b08f92f18536594
refs/heads/master: a8e7d49aa7be728c4ae241a75a2a124cdcabc0c5
23 changes: 11 additions & 12 deletions trunk/fs/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -760,15 +760,9 @@ EXPORT_SYMBOL(mark_buffer_dirty_inode);
* If warn is true, then emit a warning if the page is not uptodate and has
* not been truncated.
*/
static int __set_page_dirty(struct page *page,
static void __set_page_dirty(struct page *page,
struct address_space *mapping, int warn)
{
if (unlikely(!mapping))
return !TestSetPageDirty(page);

if (TestSetPageDirty(page))
return 0;

spin_lock_irq(&mapping->tree_lock);
if (page->mapping) { /* Race with truncate? */
WARN_ON_ONCE(warn && !PageUptodate(page));
Expand All @@ -785,8 +779,6 @@ static int __set_page_dirty(struct page *page,
}
spin_unlock_irq(&mapping->tree_lock);
__mark_inode_dirty(mapping->host, I_DIRTY_PAGES);

return 1;
}

/*
Expand Down Expand Up @@ -816,6 +808,7 @@ static int __set_page_dirty(struct page *page,
*/
int __set_page_dirty_buffers(struct page *page)
{
int newly_dirty;
struct address_space *mapping = page_mapping(page);

if (unlikely(!mapping))
Expand All @@ -831,9 +824,12 @@ int __set_page_dirty_buffers(struct page *page)
bh = bh->b_this_page;
} while (bh != head);
}
newly_dirty = !TestSetPageDirty(page);
spin_unlock(&mapping->private_lock);

return __set_page_dirty(page, mapping, 1);
if (newly_dirty)
__set_page_dirty(page, mapping, 1);
return newly_dirty;
}
EXPORT_SYMBOL(__set_page_dirty_buffers);

Expand Down Expand Up @@ -1262,8 +1258,11 @@ void mark_buffer_dirty(struct buffer_head *bh)
return;
}

if (!test_set_buffer_dirty(bh))
__set_page_dirty(bh->b_page, page_mapping(bh->b_page), 0);
if (!test_set_buffer_dirty(bh)) {
struct page *page = bh->b_page;
if (!TestSetPageDirty(page))
__set_page_dirty(page, page_mapping(page), 0);
}
}

/*
Expand Down

0 comments on commit 3511e7c

Please sign in to comment.