diff options
author | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> | 2011-05-04 23:56:51 -0400 |
---|---|---|
committer | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> | 2011-05-10 09:21:57 -0400 |
commit | 5fc7b14177b1a1c2f2511aed62a4ca870d0332e7 (patch) | |
tree | f64f2b0f424e7506dd6bb07c133348a9796b2212 /fs/nilfs2/btree.c | |
parent | aa405b1f4238401616e7d98620170b424b2dbefc (diff) |
nilfs2: use mark_buffer_dirty to mark btnode or meta data dirty
This replaces nilfs_mdt_mark_buffer_dirty and nilfs_btnode_mark_dirty
macros with mark_buffer_dirty and gets rid of nilfs_mark_buffer_dirty,
an own mark buffer dirty function.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Diffstat (limited to 'fs/nilfs2/btree.c')
-rw-r--r-- | fs/nilfs2/btree.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/fs/nilfs2/btree.c b/fs/nilfs2/btree.c index d451ae0e0bf3..7eafe468a29c 100644 --- a/fs/nilfs2/btree.c +++ b/fs/nilfs2/btree.c | |||
@@ -714,7 +714,7 @@ static void nilfs_btree_promote_key(struct nilfs_bmap *btree, | |||
714 | nilfs_btree_get_nonroot_node(path, level), | 714 | nilfs_btree_get_nonroot_node(path, level), |
715 | path[level].bp_index, key); | 715 | path[level].bp_index, key); |
716 | if (!buffer_dirty(path[level].bp_bh)) | 716 | if (!buffer_dirty(path[level].bp_bh)) |
717 | nilfs_btnode_mark_dirty(path[level].bp_bh); | 717 | mark_buffer_dirty(path[level].bp_bh); |
718 | } while ((path[level].bp_index == 0) && | 718 | } while ((path[level].bp_index == 0) && |
719 | (++level < nilfs_btree_height(btree) - 1)); | 719 | (++level < nilfs_btree_height(btree) - 1)); |
720 | } | 720 | } |
@@ -739,7 +739,7 @@ static void nilfs_btree_do_insert(struct nilfs_bmap *btree, | |||
739 | nilfs_btree_node_insert(node, path[level].bp_index, | 739 | nilfs_btree_node_insert(node, path[level].bp_index, |
740 | *keyp, *ptrp, ncblk); | 740 | *keyp, *ptrp, ncblk); |
741 | if (!buffer_dirty(path[level].bp_bh)) | 741 | if (!buffer_dirty(path[level].bp_bh)) |
742 | nilfs_btnode_mark_dirty(path[level].bp_bh); | 742 | mark_buffer_dirty(path[level].bp_bh); |
743 | 743 | ||
744 | if (path[level].bp_index == 0) | 744 | if (path[level].bp_index == 0) |
745 | nilfs_btree_promote_key(btree, path, level + 1, | 745 | nilfs_btree_promote_key(btree, path, level + 1, |
@@ -777,9 +777,9 @@ static void nilfs_btree_carry_left(struct nilfs_bmap *btree, | |||
777 | nilfs_btree_node_move_left(left, node, n, ncblk, ncblk); | 777 | nilfs_btree_node_move_left(left, node, n, ncblk, ncblk); |
778 | 778 | ||
779 | if (!buffer_dirty(path[level].bp_bh)) | 779 | if (!buffer_dirty(path[level].bp_bh)) |
780 | nilfs_btnode_mark_dirty(path[level].bp_bh); | 780 | mark_buffer_dirty(path[level].bp_bh); |
781 | if (!buffer_dirty(path[level].bp_sib_bh)) | 781 | if (!buffer_dirty(path[level].bp_sib_bh)) |
782 | nilfs_btnode_mark_dirty(path[level].bp_sib_bh); | 782 | mark_buffer_dirty(path[level].bp_sib_bh); |
783 | 783 | ||
784 | nilfs_btree_promote_key(btree, path, level + 1, | 784 | nilfs_btree_promote_key(btree, path, level + 1, |
785 | nilfs_btree_node_get_key(node, 0)); | 785 | nilfs_btree_node_get_key(node, 0)); |
@@ -823,9 +823,9 @@ static void nilfs_btree_carry_right(struct nilfs_bmap *btree, | |||
823 | nilfs_btree_node_move_right(node, right, n, ncblk, ncblk); | 823 | nilfs_btree_node_move_right(node, right, n, ncblk, ncblk); |
824 | 824 | ||
825 | if (!buffer_dirty(path[level].bp_bh)) | 825 | if (!buffer_dirty(path[level].bp_bh)) |
826 | nilfs_btnode_mark_dirty(path[level].bp_bh); | 826 | mark_buffer_dirty(path[level].bp_bh); |
827 | if (!buffer_dirty(path[level].bp_sib_bh)) | 827 | if (!buffer_dirty(path[level].bp_sib_bh)) |
828 | nilfs_btnode_mark_dirty(path[level].bp_sib_bh); | 828 | mark_buffer_dirty(path[level].bp_sib_bh); |
829 | 829 | ||
830 | path[level + 1].bp_index++; | 830 | path[level + 1].bp_index++; |
831 | nilfs_btree_promote_key(btree, path, level + 1, | 831 | nilfs_btree_promote_key(btree, path, level + 1, |
@@ -870,9 +870,9 @@ static void nilfs_btree_split(struct nilfs_bmap *btree, | |||
870 | nilfs_btree_node_move_right(node, right, n, ncblk, ncblk); | 870 | nilfs_btree_node_move_right(node, right, n, ncblk, ncblk); |
871 | 871 | ||
872 | if (!buffer_dirty(path[level].bp_bh)) | 872 | if (!buffer_dirty(path[level].bp_bh)) |
873 | nilfs_btnode_mark_dirty(path[level].bp_bh); | 873 | mark_buffer_dirty(path[level].bp_bh); |
874 | if (!buffer_dirty(path[level].bp_sib_bh)) | 874 | if (!buffer_dirty(path[level].bp_sib_bh)) |
875 | nilfs_btnode_mark_dirty(path[level].bp_sib_bh); | 875 | mark_buffer_dirty(path[level].bp_sib_bh); |
876 | 876 | ||
877 | newkey = nilfs_btree_node_get_key(right, 0); | 877 | newkey = nilfs_btree_node_get_key(right, 0); |
878 | newptr = path[level].bp_newreq.bpr_ptr; | 878 | newptr = path[level].bp_newreq.bpr_ptr; |
@@ -919,7 +919,7 @@ static void nilfs_btree_grow(struct nilfs_bmap *btree, | |||
919 | nilfs_btree_node_set_level(root, level + 1); | 919 | nilfs_btree_node_set_level(root, level + 1); |
920 | 920 | ||
921 | if (!buffer_dirty(path[level].bp_sib_bh)) | 921 | if (!buffer_dirty(path[level].bp_sib_bh)) |
922 | nilfs_btnode_mark_dirty(path[level].bp_sib_bh); | 922 | mark_buffer_dirty(path[level].bp_sib_bh); |
923 | 923 | ||
924 | path[level].bp_bh = path[level].bp_sib_bh; | 924 | path[level].bp_bh = path[level].bp_sib_bh; |
925 | path[level].bp_sib_bh = NULL; | 925 | path[level].bp_sib_bh = NULL; |
@@ -1194,7 +1194,7 @@ static void nilfs_btree_do_delete(struct nilfs_bmap *btree, | |||
1194 | nilfs_btree_node_delete(node, path[level].bp_index, | 1194 | nilfs_btree_node_delete(node, path[level].bp_index, |
1195 | keyp, ptrp, ncblk); | 1195 | keyp, ptrp, ncblk); |
1196 | if (!buffer_dirty(path[level].bp_bh)) | 1196 | if (!buffer_dirty(path[level].bp_bh)) |
1197 | nilfs_btnode_mark_dirty(path[level].bp_bh); | 1197 | mark_buffer_dirty(path[level].bp_bh); |
1198 | if (path[level].bp_index == 0) | 1198 | if (path[level].bp_index == 0) |
1199 | nilfs_btree_promote_key(btree, path, level + 1, | 1199 | nilfs_btree_promote_key(btree, path, level + 1, |
1200 | nilfs_btree_node_get_key(node, 0)); | 1200 | nilfs_btree_node_get_key(node, 0)); |
@@ -1226,9 +1226,9 @@ static void nilfs_btree_borrow_left(struct nilfs_bmap *btree, | |||
1226 | nilfs_btree_node_move_right(left, node, n, ncblk, ncblk); | 1226 | nilfs_btree_node_move_right(left, node, n, ncblk, ncblk); |
1227 | 1227 | ||
1228 | if (!buffer_dirty(path[level].bp_bh)) | 1228 | if (!buffer_dirty(path[level].bp_bh)) |
1229 | nilfs_btnode_mark_dirty(path[level].bp_bh); | 1229 | mark_buffer_dirty(path[level].bp_bh); |
1230 | if (!buffer_dirty(path[level].bp_sib_bh)) | 1230 | if (!buffer_dirty(path[level].bp_sib_bh)) |
1231 | nilfs_btnode_mark_dirty(path[level].bp_sib_bh); | 1231 | mark_buffer_dirty(path[level].bp_sib_bh); |
1232 | 1232 | ||
1233 | nilfs_btree_promote_key(btree, path, level + 1, | 1233 | nilfs_btree_promote_key(btree, path, level + 1, |
1234 | nilfs_btree_node_get_key(node, 0)); | 1234 | nilfs_btree_node_get_key(node, 0)); |
@@ -1258,9 +1258,9 @@ static void nilfs_btree_borrow_right(struct nilfs_bmap *btree, | |||
1258 | nilfs_btree_node_move_left(node, right, n, ncblk, ncblk); | 1258 | nilfs_btree_node_move_left(node, right, n, ncblk, ncblk); |
1259 | 1259 | ||
1260 | if (!buffer_dirty(path[level].bp_bh)) | 1260 | if (!buffer_dirty(path[level].bp_bh)) |
1261 | nilfs_btnode_mark_dirty(path[level].bp_bh); | 1261 | mark_buffer_dirty(path[level].bp_bh); |
1262 | if (!buffer_dirty(path[level].bp_sib_bh)) | 1262 | if (!buffer_dirty(path[level].bp_sib_bh)) |
1263 | nilfs_btnode_mark_dirty(path[level].bp_sib_bh); | 1263 | mark_buffer_dirty(path[level].bp_sib_bh); |
1264 | 1264 | ||
1265 | path[level + 1].bp_index++; | 1265 | path[level + 1].bp_index++; |
1266 | nilfs_btree_promote_key(btree, path, level + 1, | 1266 | nilfs_btree_promote_key(btree, path, level + 1, |
@@ -1289,7 +1289,7 @@ static void nilfs_btree_concat_left(struct nilfs_bmap *btree, | |||
1289 | nilfs_btree_node_move_left(left, node, n, ncblk, ncblk); | 1289 | nilfs_btree_node_move_left(left, node, n, ncblk, ncblk); |
1290 | 1290 | ||
1291 | if (!buffer_dirty(path[level].bp_sib_bh)) | 1291 | if (!buffer_dirty(path[level].bp_sib_bh)) |
1292 | nilfs_btnode_mark_dirty(path[level].bp_sib_bh); | 1292 | mark_buffer_dirty(path[level].bp_sib_bh); |
1293 | 1293 | ||
1294 | nilfs_btnode_delete(path[level].bp_bh); | 1294 | nilfs_btnode_delete(path[level].bp_bh); |
1295 | path[level].bp_bh = path[level].bp_sib_bh; | 1295 | path[level].bp_bh = path[level].bp_sib_bh; |
@@ -1315,7 +1315,7 @@ static void nilfs_btree_concat_right(struct nilfs_bmap *btree, | |||
1315 | nilfs_btree_node_move_left(node, right, n, ncblk, ncblk); | 1315 | nilfs_btree_node_move_left(node, right, n, ncblk, ncblk); |
1316 | 1316 | ||
1317 | if (!buffer_dirty(path[level].bp_bh)) | 1317 | if (!buffer_dirty(path[level].bp_bh)) |
1318 | nilfs_btnode_mark_dirty(path[level].bp_bh); | 1318 | mark_buffer_dirty(path[level].bp_bh); |
1319 | 1319 | ||
1320 | nilfs_btnode_delete(path[level].bp_sib_bh); | 1320 | nilfs_btnode_delete(path[level].bp_sib_bh); |
1321 | path[level].bp_sib_bh = NULL; | 1321 | path[level].bp_sib_bh = NULL; |
@@ -1709,7 +1709,7 @@ nilfs_btree_commit_convert_and_insert(struct nilfs_bmap *btree, | |||
1709 | nilfs_btree_node_init(node, 0, 1, n, ncblk, keys, ptrs); | 1709 | nilfs_btree_node_init(node, 0, 1, n, ncblk, keys, ptrs); |
1710 | nilfs_btree_node_insert(node, n, key, dreq->bpr_ptr, ncblk); | 1710 | nilfs_btree_node_insert(node, n, key, dreq->bpr_ptr, ncblk); |
1711 | if (!buffer_dirty(bh)) | 1711 | if (!buffer_dirty(bh)) |
1712 | nilfs_btnode_mark_dirty(bh); | 1712 | mark_buffer_dirty(bh); |
1713 | if (!nilfs_bmap_dirty(btree)) | 1713 | if (!nilfs_bmap_dirty(btree)) |
1714 | nilfs_bmap_set_dirty(btree); | 1714 | nilfs_bmap_set_dirty(btree); |
1715 | 1715 | ||
@@ -1787,7 +1787,7 @@ static int nilfs_btree_propagate_p(struct nilfs_bmap *btree, | |||
1787 | { | 1787 | { |
1788 | while ((++level < nilfs_btree_height(btree) - 1) && | 1788 | while ((++level < nilfs_btree_height(btree) - 1) && |
1789 | !buffer_dirty(path[level].bp_bh)) | 1789 | !buffer_dirty(path[level].bp_bh)) |
1790 | nilfs_btnode_mark_dirty(path[level].bp_bh); | 1790 | mark_buffer_dirty(path[level].bp_bh); |
1791 | 1791 | ||
1792 | return 0; | 1792 | return 0; |
1793 | } | 1793 | } |
@@ -2229,7 +2229,7 @@ static int nilfs_btree_mark(struct nilfs_bmap *btree, __u64 key, int level) | |||
2229 | } | 2229 | } |
2230 | 2230 | ||
2231 | if (!buffer_dirty(bh)) | 2231 | if (!buffer_dirty(bh)) |
2232 | nilfs_btnode_mark_dirty(bh); | 2232 | mark_buffer_dirty(bh); |
2233 | brelse(bh); | 2233 | brelse(bh); |
2234 | if (!nilfs_bmap_dirty(btree)) | 2234 | if (!nilfs_bmap_dirty(btree)) |
2235 | nilfs_bmap_set_dirty(btree); | 2235 | nilfs_bmap_set_dirty(btree); |