Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 174701
b: refs/heads/master
c: 45f4910
h: refs/heads/master
i:
  174699: d44b7a8
v: v3
  • Loading branch information
Ryusuke Konishi committed Nov 20, 2009
1 parent 49f38f7 commit 454f7b9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 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: d501d7368937740e8d06671a4bfe4e236ed25bd0
refs/heads/master: 45f4910bc0bb904bcf53aa04ee1b807abe1387a6
13 changes: 7 additions & 6 deletions trunk/fs/nilfs2/btnode.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,12 +270,13 @@ int nilfs_btnode_prepare_change_key(struct address_space *btnc,
unlock_page(obh->b_page);
}

err = nilfs_btnode_get(btnc, newkey, 0, &nbh, 1);
if (likely(!err)) {
BUG_ON(nbh == obh);
ctxt->newbh = nbh;
}
return err;
nbh = nilfs_btnode_create_block(btnc, newkey);
if (!nbh)
return -ENOMEM;

BUG_ON(nbh == obh);
ctxt->newbh = nbh;
return 0;

failed_unlock:
unlock_page(obh->b_page);
Expand Down
13 changes: 8 additions & 5 deletions trunk/fs/nilfs2/btree.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,15 @@ static int nilfs_btree_get_new_block(const struct nilfs_btree *btree,
{
struct address_space *btnc =
&NILFS_BMAP_I((struct nilfs_bmap *)btree)->i_btnode_cache;
int ret;
struct buffer_head *bh;

ret = nilfs_btnode_get(btnc, ptr, 0, bhp, 1);
if (!ret)
set_buffer_nilfs_volatile(*bhp);
return ret;
bh = nilfs_btnode_create_block(btnc, ptr);
if (!bh)
return -ENOMEM;

set_buffer_nilfs_volatile(bh);
*bhp = bh;
return 0;
}

static inline int
Expand Down

0 comments on commit 454f7b9

Please sign in to comment.