diff options
author | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> | 2009-11-13 02:25:19 -0500 |
---|---|---|
committer | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> | 2009-11-19 20:05:49 -0500 |
commit | 45f4910bc0bb904bcf53aa04ee1b807abe1387a6 (patch) | |
tree | d40f556ef778f9d4c2b37b4978fae29835de150d /fs/nilfs2 | |
parent | d501d7368937740e8d06671a4bfe4e236ed25bd0 (diff) |
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: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Diffstat (limited to 'fs/nilfs2')
-rw-r--r-- | fs/nilfs2/btnode.c | 13 | ||||
-rw-r--r-- | fs/nilfs2/btree.c | 13 |
2 files changed, 15 insertions, 11 deletions
diff --git a/fs/nilfs2/btnode.c b/fs/nilfs2/btnode.c index fc3e4bdb62ae..7086a2a1f7fa 100644 --- a/fs/nilfs2/btnode.c +++ b/fs/nilfs2/btnode.c | |||
@@ -270,12 +270,13 @@ retry: | |||
270 | unlock_page(obh->b_page); | 270 | unlock_page(obh->b_page); |
271 | } | 271 | } |
272 | 272 | ||
273 | err = nilfs_btnode_get(btnc, newkey, 0, &nbh, 1); | 273 | nbh = nilfs_btnode_create_block(btnc, newkey); |
274 | if (likely(!err)) { | 274 | if (!nbh) |
275 | BUG_ON(nbh == obh); | 275 | return -ENOMEM; |
276 | ctxt->newbh = nbh; | 276 | |
277 | } | 277 | BUG_ON(nbh == obh); |
278 | return err; | 278 | ctxt->newbh = nbh; |
279 | return 0; | ||
279 | 280 | ||
280 | failed_unlock: | 281 | failed_unlock: |
281 | unlock_page(obh->b_page); | 282 | unlock_page(obh->b_page); |
diff --git a/fs/nilfs2/btree.c b/fs/nilfs2/btree.c index c9aab29ea1f6..7b0cc4fe9f0d 100644 --- a/fs/nilfs2/btree.c +++ b/fs/nilfs2/btree.c | |||
@@ -122,12 +122,15 @@ static int nilfs_btree_get_new_block(const struct nilfs_btree *btree, | |||
122 | { | 122 | { |
123 | struct address_space *btnc = | 123 | struct address_space *btnc = |
124 | &NILFS_BMAP_I((struct nilfs_bmap *)btree)->i_btnode_cache; | 124 | &NILFS_BMAP_I((struct nilfs_bmap *)btree)->i_btnode_cache; |
125 | int ret; | 125 | struct buffer_head *bh; |
126 | 126 | ||
127 | ret = nilfs_btnode_get(btnc, ptr, 0, bhp, 1); | 127 | bh = nilfs_btnode_create_block(btnc, ptr); |
128 | if (!ret) | 128 | if (!bh) |
129 | set_buffer_nilfs_volatile(*bhp); | 129 | return -ENOMEM; |
130 | return ret; | 130 | |
131 | set_buffer_nilfs_volatile(bh); | ||
132 | *bhp = bh; | ||
133 | return 0; | ||
131 | } | 134 | } |
132 | 135 | ||
133 | static inline int | 136 | static inline int |