提交 45f4910b 编写于 作者: R Ryusuke Konishi

nilfs2: use nilfs_btnode_create_block function

This displaces nilfs_btnode_get() use to create new btree node block
with nilfs_btnode_create_block.
Signed-off-by: NRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
上级 d501d736
无相关合并请求
...@@ -270,12 +270,13 @@ int nilfs_btnode_prepare_change_key(struct address_space *btnc, ...@@ -270,12 +270,13 @@ int nilfs_btnode_prepare_change_key(struct address_space *btnc,
unlock_page(obh->b_page); unlock_page(obh->b_page);
} }
err = nilfs_btnode_get(btnc, newkey, 0, &nbh, 1); nbh = nilfs_btnode_create_block(btnc, newkey);
if (likely(!err)) { if (!nbh)
BUG_ON(nbh == obh); return -ENOMEM;
ctxt->newbh = nbh;
} BUG_ON(nbh == obh);
return err; ctxt->newbh = nbh;
return 0;
failed_unlock: failed_unlock:
unlock_page(obh->b_page); unlock_page(obh->b_page);
......
...@@ -122,12 +122,15 @@ static int nilfs_btree_get_new_block(const struct nilfs_btree *btree, ...@@ -122,12 +122,15 @@ static int nilfs_btree_get_new_block(const struct nilfs_btree *btree,
{ {
struct address_space *btnc = struct address_space *btnc =
&NILFS_BMAP_I((struct nilfs_bmap *)btree)->i_btnode_cache; &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); bh = nilfs_btnode_create_block(btnc, ptr);
if (!ret) if (!bh)
set_buffer_nilfs_volatile(*bhp); return -ENOMEM;
return ret;
set_buffer_nilfs_volatile(bh);
*bhp = bh;
return 0;
} }
static inline int static inline int
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
反馈
建议
客服 返回
顶部