Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 206365
b: refs/heads/master
c: 4e13e66
h: refs/heads/master
i:
  206363: 517eacc
v: v3
  • Loading branch information
Ryusuke Konishi committed Jul 23, 2010
1 parent efe61a5 commit e8d822f
Show file tree
Hide file tree
Showing 4 changed files with 16 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: 464ece88630d0fb715ca942eabb1da825046a534
refs/heads/master: 4e13e66bee2d792c1aae21797f16c181024834eb
10 changes: 9 additions & 1 deletion trunk/fs/nilfs2/btree.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,8 +370,16 @@ static int nilfs_btree_node_broken(const struct nilfs_btree_node *node,

int nilfs_btree_broken_node_block(struct buffer_head *bh)
{
return nilfs_btree_node_broken((struct nilfs_btree_node *)bh->b_data,
int ret;

if (buffer_nilfs_checked(bh))
return 0;

ret = nilfs_btree_node_broken((struct nilfs_btree_node *)bh->b_data,
bh->b_size, bh->b_blocknr);
if (likely(!ret))
set_buffer_nilfs_checked(bh);
return ret;
}

static struct nilfs_btree_node *
Expand Down
5 changes: 4 additions & 1 deletion trunk/fs/nilfs2/page.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@

#define NILFS_BUFFER_INHERENT_BITS \
((1UL << BH_Uptodate) | (1UL << BH_Mapped) | (1UL << BH_NILFS_Node) | \
(1UL << BH_NILFS_Volatile) | (1UL << BH_NILFS_Allocated))
(1UL << BH_NILFS_Volatile) | (1UL << BH_NILFS_Allocated) | \
(1UL << BH_NILFS_Checked))

static struct buffer_head *
__nilfs_get_page_block(struct page *page, unsigned long block, pgoff_t index,
Expand Down Expand Up @@ -129,6 +130,7 @@ void nilfs_forget_buffer(struct buffer_head *bh)

lock_buffer(bh);
clear_buffer_nilfs_volatile(bh);
clear_buffer_nilfs_checked(bh);
clear_buffer_dirty(bh);
if (nilfs_page_buffers_clean(page))
__nilfs_clear_page_dirty(page);
Expand Down Expand Up @@ -480,6 +482,7 @@ void nilfs_clear_dirty_pages(struct address_space *mapping)
lock_buffer(bh);
clear_buffer_dirty(bh);
clear_buffer_nilfs_volatile(bh);
clear_buffer_nilfs_checked(bh);
clear_buffer_uptodate(bh);
clear_buffer_mapped(bh);
unlock_buffer(bh);
Expand Down
2 changes: 2 additions & 0 deletions trunk/fs/nilfs2/page.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,13 @@ enum {
BH_NILFS_Allocated = BH_PrivateStart,
BH_NILFS_Node,
BH_NILFS_Volatile,
BH_NILFS_Checked,
};

BUFFER_FNS(NILFS_Allocated, nilfs_allocated) /* nilfs private buffers */
BUFFER_FNS(NILFS_Node, nilfs_node) /* nilfs node buffers */
BUFFER_FNS(NILFS_Volatile, nilfs_volatile)
BUFFER_FNS(NILFS_Checked, nilfs_checked) /* buffer is verified */


void nilfs_mark_buffer_dirty(struct buffer_head *bh);
Expand Down

0 comments on commit e8d822f

Please sign in to comment.