diff options
Diffstat (limited to 'fs/ocfs2/suballoc.c')
-rw-r--r-- | fs/ocfs2/suballoc.c | 46 |
1 files changed, 6 insertions, 40 deletions
diff --git a/fs/ocfs2/suballoc.c b/fs/ocfs2/suballoc.c index e3437626d183..d9c5c9fcb30f 100644 --- a/fs/ocfs2/suballoc.c +++ b/fs/ocfs2/suballoc.c | |||
@@ -98,14 +98,6 @@ static int ocfs2_relink_block_group(handle_t *handle, | |||
98 | u16 chain); | 98 | u16 chain); |
99 | static inline int ocfs2_block_group_reasonably_empty(struct ocfs2_group_desc *bg, | 99 | static inline int ocfs2_block_group_reasonably_empty(struct ocfs2_group_desc *bg, |
100 | u32 wanted); | 100 | u32 wanted); |
101 | static int ocfs2_free_suballoc_bits(handle_t *handle, | ||
102 | struct inode *alloc_inode, | ||
103 | struct buffer_head *alloc_bh, | ||
104 | unsigned int start_bit, | ||
105 | u64 bg_blkno, | ||
106 | unsigned int count); | ||
107 | static inline u64 ocfs2_which_suballoc_group(u64 block, | ||
108 | unsigned int bit); | ||
109 | static inline u32 ocfs2_desc_bitmap_to_cluster_off(struct inode *inode, | 101 | static inline u32 ocfs2_desc_bitmap_to_cluster_off(struct inode *inode, |
110 | u64 bg_blkno, | 102 | u64 bg_blkno, |
111 | u16 bg_bit_off); | 103 | u16 bg_bit_off); |
@@ -496,13 +488,7 @@ int ocfs2_reserve_new_metadata(struct ocfs2_super *osb, | |||
496 | 488 | ||
497 | (*ac)->ac_bits_wanted = ocfs2_extend_meta_needed(fe); | 489 | (*ac)->ac_bits_wanted = ocfs2_extend_meta_needed(fe); |
498 | (*ac)->ac_which = OCFS2_AC_USE_META; | 490 | (*ac)->ac_which = OCFS2_AC_USE_META; |
499 | |||
500 | #ifndef OCFS2_USE_ALL_METADATA_SUBALLOCATORS | ||
501 | slot = 0; | ||
502 | #else | ||
503 | slot = osb->slot_num; | 491 | slot = osb->slot_num; |
504 | #endif | ||
505 | |||
506 | (*ac)->ac_group_search = ocfs2_block_group_search; | 492 | (*ac)->ac_group_search = ocfs2_block_group_search; |
507 | 493 | ||
508 | status = ocfs2_reserve_suballoc_bits(osb, (*ac), | 494 | status = ocfs2_reserve_suballoc_bits(osb, (*ac), |
@@ -1626,12 +1612,12 @@ bail: | |||
1626 | /* | 1612 | /* |
1627 | * expects the suballoc inode to already be locked. | 1613 | * expects the suballoc inode to already be locked. |
1628 | */ | 1614 | */ |
1629 | static int ocfs2_free_suballoc_bits(handle_t *handle, | 1615 | int ocfs2_free_suballoc_bits(handle_t *handle, |
1630 | struct inode *alloc_inode, | 1616 | struct inode *alloc_inode, |
1631 | struct buffer_head *alloc_bh, | 1617 | struct buffer_head *alloc_bh, |
1632 | unsigned int start_bit, | 1618 | unsigned int start_bit, |
1633 | u64 bg_blkno, | 1619 | u64 bg_blkno, |
1634 | unsigned int count) | 1620 | unsigned int count) |
1635 | { | 1621 | { |
1636 | int status = 0; | 1622 | int status = 0; |
1637 | u32 tmp_used; | 1623 | u32 tmp_used; |
@@ -1703,13 +1689,6 @@ bail: | |||
1703 | return status; | 1689 | return status; |
1704 | } | 1690 | } |
1705 | 1691 | ||
1706 | static inline u64 ocfs2_which_suballoc_group(u64 block, unsigned int bit) | ||
1707 | { | ||
1708 | u64 group = block - (u64) bit; | ||
1709 | |||
1710 | return group; | ||
1711 | } | ||
1712 | |||
1713 | int ocfs2_free_dinode(handle_t *handle, | 1692 | int ocfs2_free_dinode(handle_t *handle, |
1714 | struct inode *inode_alloc_inode, | 1693 | struct inode *inode_alloc_inode, |
1715 | struct buffer_head *inode_alloc_bh, | 1694 | struct buffer_head *inode_alloc_bh, |
@@ -1723,19 +1702,6 @@ int ocfs2_free_dinode(handle_t *handle, | |||
1723 | inode_alloc_bh, bit, bg_blkno, 1); | 1702 | inode_alloc_bh, bit, bg_blkno, 1); |
1724 | } | 1703 | } |
1725 | 1704 | ||
1726 | int ocfs2_free_extent_block(handle_t *handle, | ||
1727 | struct inode *eb_alloc_inode, | ||
1728 | struct buffer_head *eb_alloc_bh, | ||
1729 | struct ocfs2_extent_block *eb) | ||
1730 | { | ||
1731 | u64 blk = le64_to_cpu(eb->h_blkno); | ||
1732 | u16 bit = le16_to_cpu(eb->h_suballoc_bit); | ||
1733 | u64 bg_blkno = ocfs2_which_suballoc_group(blk, bit); | ||
1734 | |||
1735 | return ocfs2_free_suballoc_bits(handle, eb_alloc_inode, eb_alloc_bh, | ||
1736 | bit, bg_blkno, 1); | ||
1737 | } | ||
1738 | |||
1739 | int ocfs2_free_clusters(handle_t *handle, | 1705 | int ocfs2_free_clusters(handle_t *handle, |
1740 | struct inode *bitmap_inode, | 1706 | struct inode *bitmap_inode, |
1741 | struct buffer_head *bitmap_bh, | 1707 | struct buffer_head *bitmap_bh, |