diff options
author | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> | 2009-05-21 13:18:36 -0400 |
---|---|---|
committer | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> | 2009-06-10 10:41:10 -0400 |
commit | e473c1f265f429427e09531435ceaf0fdbb86d15 (patch) | |
tree | 2256e57a923beb7c570f67026b1fd177edb3b9db /fs | |
parent | f198dbb9cf580c09644ebdf46846115c6daff14e (diff) |
nilfs2: remove pointless NULL check of bpop_commit_alloc_ptr function
This indirect function is set to NULL only for gc cache inodes, but
the gc cache inodes never call this function.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nilfs2/btree.c | 15 | ||||
-rw-r--r-- | fs/nilfs2/direct.c | 4 |
2 files changed, 6 insertions, 13 deletions
diff --git a/fs/nilfs2/btree.c b/fs/nilfs2/btree.c index 63ee35080fbc..5b2606a0ac48 100644 --- a/fs/nilfs2/btree.c +++ b/fs/nilfs2/btree.c | |||
@@ -1067,10 +1067,8 @@ static void nilfs_btree_commit_insert(struct nilfs_btree *btree, | |||
1067 | btree->bt_ops->btop_set_target(btree, key, ptr); | 1067 | btree->bt_ops->btop_set_target(btree, key, ptr); |
1068 | 1068 | ||
1069 | for (level = NILFS_BTREE_LEVEL_NODE_MIN; level <= maxlevel; level++) { | 1069 | for (level = NILFS_BTREE_LEVEL_NODE_MIN; level <= maxlevel; level++) { |
1070 | if (btree->bt_bmap.b_pops->bpop_commit_alloc_ptr != NULL) { | 1070 | btree->bt_bmap.b_pops->bpop_commit_alloc_ptr( |
1071 | btree->bt_bmap.b_pops->bpop_commit_alloc_ptr( | 1071 | &btree->bt_bmap, &path[level - 1].bp_newreq); |
1072 | &btree->bt_bmap, &path[level - 1].bp_newreq); | ||
1073 | } | ||
1074 | path[level].bp_op(btree, path, level, &key, &ptr); | 1072 | path[level].bp_op(btree, path, level, &key, &ptr); |
1075 | } | 1073 | } |
1076 | 1074 | ||
@@ -1656,10 +1654,8 @@ nilfs_btree_commit_convert_and_insert(struct nilfs_bmap *bmap, | |||
1656 | btree = (struct nilfs_btree *)bmap; | 1654 | btree = (struct nilfs_btree *)bmap; |
1657 | nilfs_btree_init(bmap, low, high); | 1655 | nilfs_btree_init(bmap, low, high); |
1658 | if (nreq != NULL) { | 1656 | if (nreq != NULL) { |
1659 | if (bmap->b_pops->bpop_commit_alloc_ptr != NULL) { | 1657 | bmap->b_pops->bpop_commit_alloc_ptr(bmap, dreq); |
1660 | bmap->b_pops->bpop_commit_alloc_ptr(bmap, dreq); | 1658 | bmap->b_pops->bpop_commit_alloc_ptr(bmap, nreq); |
1661 | bmap->b_pops->bpop_commit_alloc_ptr(bmap, nreq); | ||
1662 | } | ||
1663 | 1659 | ||
1664 | /* create child node at level 1 */ | 1660 | /* create child node at level 1 */ |
1665 | lock_buffer(bh); | 1661 | lock_buffer(bh); |
@@ -1681,8 +1677,7 @@ nilfs_btree_commit_convert_and_insert(struct nilfs_bmap *bmap, | |||
1681 | nilfs_btree_node_init(btree, node, NILFS_BTREE_NODE_ROOT, | 1677 | nilfs_btree_node_init(btree, node, NILFS_BTREE_NODE_ROOT, |
1682 | 2, 1, &keys[0], &tmpptr); | 1678 | 2, 1, &keys[0], &tmpptr); |
1683 | } else { | 1679 | } else { |
1684 | if (bmap->b_pops->bpop_commit_alloc_ptr != NULL) | 1680 | bmap->b_pops->bpop_commit_alloc_ptr(bmap, dreq); |
1685 | bmap->b_pops->bpop_commit_alloc_ptr(bmap, dreq); | ||
1686 | 1681 | ||
1687 | /* create root node at level 1 */ | 1682 | /* create root node at level 1 */ |
1688 | node = nilfs_btree_get_root(btree); | 1683 | node = nilfs_btree_get_root(btree); |
diff --git a/fs/nilfs2/direct.c b/fs/nilfs2/direct.c index 5cbba8284bea..eaeccb068b5e 100644 --- a/fs/nilfs2/direct.c +++ b/fs/nilfs2/direct.c | |||
@@ -111,9 +111,7 @@ static void nilfs_direct_commit_insert(struct nilfs_direct *direct, | |||
111 | bh = (struct buffer_head *)((unsigned long)ptr); | 111 | bh = (struct buffer_head *)((unsigned long)ptr); |
112 | set_buffer_nilfs_volatile(bh); | 112 | set_buffer_nilfs_volatile(bh); |
113 | 113 | ||
114 | if (direct->d_bmap.b_pops->bpop_commit_alloc_ptr != NULL) | 114 | direct->d_bmap.b_pops->bpop_commit_alloc_ptr(&direct->d_bmap, req); |
115 | direct->d_bmap.b_pops->bpop_commit_alloc_ptr( | ||
116 | &direct->d_bmap, req); | ||
117 | nilfs_direct_set_ptr(direct, key, req->bpr_ptr); | 115 | nilfs_direct_set_ptr(direct, key, req->bpr_ptr); |
118 | 116 | ||
119 | if (!nilfs_bmap_dirty(&direct->d_bmap)) | 117 | if (!nilfs_bmap_dirty(&direct->d_bmap)) |