diff options
Diffstat (limited to 'fs/ocfs2/suballoc.c')
-rw-r--r-- | fs/ocfs2/suballoc.c | 72 |
1 files changed, 39 insertions, 33 deletions
diff --git a/fs/ocfs2/suballoc.c b/fs/ocfs2/suballoc.c index c46c164aefbb..195523090c87 100644 --- a/fs/ocfs2/suballoc.c +++ b/fs/ocfs2/suballoc.c | |||
@@ -157,8 +157,9 @@ static int ocfs2_block_group_fill(struct ocfs2_journal_handle *handle, | |||
157 | mlog_entry_void(); | 157 | mlog_entry_void(); |
158 | 158 | ||
159 | if (((unsigned long long) bg_bh->b_blocknr) != group_blkno) { | 159 | if (((unsigned long long) bg_bh->b_blocknr) != group_blkno) { |
160 | ocfs2_error(alloc_inode->i_sb, "group block (%"MLFu64") " | 160 | ocfs2_error(alloc_inode->i_sb, "group block (%llu) != " |
161 | "!= b_blocknr (%llu)", group_blkno, | 161 | "b_blocknr (%llu)", |
162 | (unsigned long long)group_blkno, | ||
162 | (unsigned long long) bg_bh->b_blocknr); | 163 | (unsigned long long) bg_bh->b_blocknr); |
163 | status = -EIO; | 164 | status = -EIO; |
164 | goto bail; | 165 | goto bail; |
@@ -280,8 +281,8 @@ static int ocfs2_block_group_alloc(struct ocfs2_super *osb, | |||
280 | 281 | ||
281 | /* setup the group */ | 282 | /* setup the group */ |
282 | bg_blkno = ocfs2_clusters_to_blocks(osb->sb, bit_off); | 283 | bg_blkno = ocfs2_clusters_to_blocks(osb->sb, bit_off); |
283 | mlog(0, "new descriptor, record %u, at block %"MLFu64"\n", | 284 | mlog(0, "new descriptor, record %u, at block %llu\n", |
284 | alloc_rec, bg_blkno); | 285 | alloc_rec, (unsigned long long)bg_blkno); |
285 | 286 | ||
286 | bg_bh = sb_getblk(osb->sb, bg_blkno); | 287 | bg_bh = sb_getblk(osb->sb, bg_blkno); |
287 | if (!bg_bh) { | 288 | if (!bg_bh) { |
@@ -382,8 +383,8 @@ static int ocfs2_reserve_suballoc_bits(struct ocfs2_super *osb, | |||
382 | goto bail; | 383 | goto bail; |
383 | } | 384 | } |
384 | if (!(fe->i_flags & cpu_to_le32(OCFS2_CHAIN_FL))) { | 385 | if (!(fe->i_flags & cpu_to_le32(OCFS2_CHAIN_FL))) { |
385 | ocfs2_error(alloc_inode->i_sb, "Invalid chain allocator " | 386 | ocfs2_error(alloc_inode->i_sb, "Invalid chain allocator %llu", |
386 | "# %"MLFu64, le64_to_cpu(fe->i_blkno)); | 387 | (unsigned long long)le64_to_cpu(fe->i_blkno)); |
387 | status = -EIO; | 388 | status = -EIO; |
388 | goto bail; | 389 | goto bail; |
389 | } | 390 | } |
@@ -829,9 +830,10 @@ static int ocfs2_relink_block_group(struct ocfs2_journal_handle *handle, | |||
829 | goto out; | 830 | goto out; |
830 | } | 831 | } |
831 | 832 | ||
832 | mlog(0, "In suballoc %"MLFu64", chain %u, move group %"MLFu64" to " | 833 | mlog(0, "Suballoc %llu, chain %u, move group %llu to top, prev = %llu\n", |
833 | "top, prev = %"MLFu64"\n", | 834 | (unsigned long long)fe->i_blkno, chain, |
834 | fe->i_blkno, chain, bg->bg_blkno, prev_bg->bg_blkno); | 835 | (unsigned long long)bg->bg_blkno, |
836 | (unsigned long long)prev_bg->bg_blkno); | ||
835 | 837 | ||
836 | fe_ptr = le64_to_cpu(fe->id2.i_chain.cl_recs[chain].c_blkno); | 838 | fe_ptr = le64_to_cpu(fe->id2.i_chain.cl_recs[chain].c_blkno); |
837 | bg_ptr = le64_to_cpu(bg->bg_next_group); | 839 | bg_ptr = le64_to_cpu(bg->bg_next_group); |
@@ -974,8 +976,9 @@ static int ocfs2_search_chain(struct ocfs2_alloc_context *ac, | |||
974 | struct ocfs2_group_desc *bg; | 976 | struct ocfs2_group_desc *bg; |
975 | 977 | ||
976 | chain = ac->ac_chain; | 978 | chain = ac->ac_chain; |
977 | mlog(0, "trying to alloc %u bits from chain %u, inode %"MLFu64"\n", | 979 | mlog(0, "trying to alloc %u bits from chain %u, inode %llu\n", |
978 | bits_wanted, chain, OCFS2_I(alloc_inode)->ip_blkno); | 980 | bits_wanted, chain, |
981 | (unsigned long long)OCFS2_I(alloc_inode)->ip_blkno); | ||
979 | 982 | ||
980 | status = ocfs2_read_block(OCFS2_SB(alloc_inode->i_sb), | 983 | status = ocfs2_read_block(OCFS2_SB(alloc_inode->i_sb), |
981 | le64_to_cpu(cl->cl_recs[chain].c_blkno), | 984 | le64_to_cpu(cl->cl_recs[chain].c_blkno), |
@@ -1027,8 +1030,8 @@ static int ocfs2_search_chain(struct ocfs2_alloc_context *ac, | |||
1027 | goto bail; | 1030 | goto bail; |
1028 | } | 1031 | } |
1029 | 1032 | ||
1030 | mlog(0, "alloc succeeds: we give %u bits from block group %"MLFu64"\n", | 1033 | mlog(0, "alloc succeeds: we give %u bits from block group %llu\n", |
1031 | tmp_bits, bg->bg_blkno); | 1034 | tmp_bits, (unsigned long long)bg->bg_blkno); |
1032 | 1035 | ||
1033 | *num_bits = tmp_bits; | 1036 | *num_bits = tmp_bits; |
1034 | 1037 | ||
@@ -1092,8 +1095,8 @@ static int ocfs2_search_chain(struct ocfs2_alloc_context *ac, | |||
1092 | goto bail; | 1095 | goto bail; |
1093 | } | 1096 | } |
1094 | 1097 | ||
1095 | mlog(0, "Allocated %u bits from suballocator %"MLFu64"\n", | 1098 | mlog(0, "Allocated %u bits from suballocator %llu\n", *num_bits, |
1096 | *num_bits, fe->i_blkno); | 1099 | (unsigned long long)fe->i_blkno); |
1097 | 1100 | ||
1098 | *bg_blkno = le64_to_cpu(bg->bg_blkno); | 1101 | *bg_blkno = le64_to_cpu(bg->bg_blkno); |
1099 | bail: | 1102 | bail: |
@@ -1134,9 +1137,9 @@ static int ocfs2_claim_suballoc_bits(struct ocfs2_super *osb, | |||
1134 | } | 1137 | } |
1135 | if (le32_to_cpu(fe->id1.bitmap1.i_used) >= | 1138 | if (le32_to_cpu(fe->id1.bitmap1.i_used) >= |
1136 | le32_to_cpu(fe->id1.bitmap1.i_total)) { | 1139 | le32_to_cpu(fe->id1.bitmap1.i_total)) { |
1137 | ocfs2_error(osb->sb, "Chain allocator dinode %"MLFu64" has %u" | 1140 | ocfs2_error(osb->sb, "Chain allocator dinode %llu has %u used " |
1138 | "used bits but only %u total.", | 1141 | "bits but only %u total.", |
1139 | le64_to_cpu(fe->i_blkno), | 1142 | (unsigned long long)le64_to_cpu(fe->i_blkno), |
1140 | le32_to_cpu(fe->id1.bitmap1.i_used), | 1143 | le32_to_cpu(fe->id1.bitmap1.i_used), |
1141 | le32_to_cpu(fe->id1.bitmap1.i_total)); | 1144 | le32_to_cpu(fe->id1.bitmap1.i_total)); |
1142 | status = -EIO; | 1145 | status = -EIO; |
@@ -1479,10 +1482,9 @@ static int ocfs2_free_suballoc_bits(struct ocfs2_journal_handle *handle, | |||
1479 | } | 1482 | } |
1480 | BUG_ON((count + start_bit) > ocfs2_bits_per_group(cl)); | 1483 | BUG_ON((count + start_bit) > ocfs2_bits_per_group(cl)); |
1481 | 1484 | ||
1482 | mlog(0, "suballocator %"MLFu64": freeing %u bits from group %"MLFu64 | 1485 | mlog(0, "%llu: freeing %u bits from group %llu, starting at %u\n", |
1483 | ", starting at %u\n", | 1486 | (unsigned long long)OCFS2_I(alloc_inode)->ip_blkno, count, |
1484 | OCFS2_I(alloc_inode)->ip_blkno, count, bg_blkno, | 1487 | (unsigned long long)bg_blkno, start_bit); |
1485 | start_bit); | ||
1486 | 1488 | ||
1487 | status = ocfs2_read_block(osb, bg_blkno, &group_bh, OCFS2_BH_CACHED, | 1489 | status = ocfs2_read_block(osb, bg_blkno, &group_bh, OCFS2_BH_CACHED, |
1488 | alloc_inode); | 1490 | alloc_inode); |
@@ -1592,10 +1594,10 @@ int ocfs2_free_clusters(struct ocfs2_journal_handle *handle, | |||
1592 | ocfs2_block_to_cluster_group(bitmap_inode, start_blk, &bg_blkno, | 1594 | ocfs2_block_to_cluster_group(bitmap_inode, start_blk, &bg_blkno, |
1593 | &bg_start_bit); | 1595 | &bg_start_bit); |
1594 | 1596 | ||
1595 | mlog(0, "want to free %u clusters starting at block %"MLFu64"\n", | 1597 | mlog(0, "want to free %u clusters starting at block %llu\n", |
1596 | num_clusters, start_blk); | 1598 | num_clusters, (unsigned long long)start_blk); |
1597 | mlog(0, "bg_blkno = %"MLFu64", bg_start_bit = %u\n", | 1599 | mlog(0, "bg_blkno = %llu, bg_start_bit = %u\n", |
1598 | bg_blkno, bg_start_bit); | 1600 | (unsigned long long)bg_blkno, bg_start_bit); |
1599 | 1601 | ||
1600 | status = ocfs2_free_suballoc_bits(handle, bitmap_inode, bitmap_bh, | 1602 | status = ocfs2_free_suballoc_bits(handle, bitmap_inode, bitmap_bh, |
1601 | bg_start_bit, bg_blkno, | 1603 | bg_start_bit, bg_blkno, |
@@ -1616,18 +1618,22 @@ static inline void ocfs2_debug_bg(struct ocfs2_group_desc *bg) | |||
1616 | printk("bg_free_bits_count: %u\n", bg->bg_free_bits_count); | 1618 | printk("bg_free_bits_count: %u\n", bg->bg_free_bits_count); |
1617 | printk("bg_chain: %u\n", bg->bg_chain); | 1619 | printk("bg_chain: %u\n", bg->bg_chain); |
1618 | printk("bg_generation: %u\n", le32_to_cpu(bg->bg_generation)); | 1620 | printk("bg_generation: %u\n", le32_to_cpu(bg->bg_generation)); |
1619 | printk("bg_next_group: %"MLFu64"\n", bg->bg_next_group); | 1621 | printk("bg_next_group: %llu\n", |
1620 | printk("bg_parent_dinode: %"MLFu64"\n", bg->bg_parent_dinode); | 1622 | (unsigned long long)bg->bg_next_group); |
1621 | printk("bg_blkno: %"MLFu64"\n", bg->bg_blkno); | 1623 | printk("bg_parent_dinode: %llu\n", |
1624 | (unsigned long long)bg->bg_parent_dinode); | ||
1625 | printk("bg_blkno: %llu\n", | ||
1626 | (unsigned long long)bg->bg_blkno); | ||
1622 | } | 1627 | } |
1623 | 1628 | ||
1624 | static inline void ocfs2_debug_suballoc_inode(struct ocfs2_dinode *fe) | 1629 | static inline void ocfs2_debug_suballoc_inode(struct ocfs2_dinode *fe) |
1625 | { | 1630 | { |
1626 | int i; | 1631 | int i; |
1627 | 1632 | ||
1628 | printk("Suballoc Inode %"MLFu64":\n", fe->i_blkno); | 1633 | printk("Suballoc Inode %llu:\n", (unsigned long long)fe->i_blkno); |
1629 | printk("i_signature: %s\n", fe->i_signature); | 1634 | printk("i_signature: %s\n", fe->i_signature); |
1630 | printk("i_size: %"MLFu64"\n", fe->i_size); | 1635 | printk("i_size: %llu\n", |
1636 | (unsigned long long)fe->i_size); | ||
1631 | printk("i_clusters: %u\n", fe->i_clusters); | 1637 | printk("i_clusters: %u\n", fe->i_clusters); |
1632 | printk("i_generation: %u\n", | 1638 | printk("i_generation: %u\n", |
1633 | le32_to_cpu(fe->i_generation)); | 1639 | le32_to_cpu(fe->i_generation)); |
@@ -1645,7 +1651,7 @@ static inline void ocfs2_debug_suballoc_inode(struct ocfs2_dinode *fe) | |||
1645 | fe->id2.i_chain.cl_recs[i].c_free); | 1651 | fe->id2.i_chain.cl_recs[i].c_free); |
1646 | printk("fe->id2.i_chain.cl_recs[%d].c_total: %u\n", i, | 1652 | printk("fe->id2.i_chain.cl_recs[%d].c_total: %u\n", i, |
1647 | fe->id2.i_chain.cl_recs[i].c_total); | 1653 | fe->id2.i_chain.cl_recs[i].c_total); |
1648 | printk("fe->id2.i_chain.cl_recs[%d].c_blkno: %"MLFu64"\n", i, | 1654 | printk("fe->id2.i_chain.cl_recs[%d].c_blkno: %llu\n", i, |
1649 | fe->id2.i_chain.cl_recs[i].c_blkno); | 1655 | (unsigned long long)fe->id2.i_chain.cl_recs[i].c_blkno); |
1650 | } | 1656 | } |
1651 | } | 1657 | } |