aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/suballoc.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ocfs2/suballoc.c')
-rw-r--r--fs/ocfs2/suballoc.c29
1 files changed, 21 insertions, 8 deletions
diff --git a/fs/ocfs2/suballoc.c b/fs/ocfs2/suballoc.c
index d9c5c9fcb30f..8f09f5235e3a 100644
--- a/fs/ocfs2/suballoc.c
+++ b/fs/ocfs2/suballoc.c
@@ -1486,21 +1486,21 @@ static inline void ocfs2_block_to_cluster_group(struct inode *inode,
1486 * contig. allocation, set to '1' to indicate we can deal with extents 1486 * contig. allocation, set to '1' to indicate we can deal with extents
1487 * of any size. 1487 * of any size.
1488 */ 1488 */
1489int ocfs2_claim_clusters(struct ocfs2_super *osb, 1489int __ocfs2_claim_clusters(struct ocfs2_super *osb,
1490 handle_t *handle, 1490 handle_t *handle,
1491 struct ocfs2_alloc_context *ac, 1491 struct ocfs2_alloc_context *ac,
1492 u32 min_clusters, 1492 u32 min_clusters,
1493 u32 *cluster_start, 1493 u32 max_clusters,
1494 u32 *num_clusters) 1494 u32 *cluster_start,
1495 u32 *num_clusters)
1495{ 1496{
1496 int status; 1497 int status;
1497 unsigned int bits_wanted = ac->ac_bits_wanted - ac->ac_bits_given; 1498 unsigned int bits_wanted = max_clusters;
1498 u64 bg_blkno = 0; 1499 u64 bg_blkno = 0;
1499 u16 bg_bit_off; 1500 u16 bg_bit_off;
1500 1501
1501 mlog_entry_void(); 1502 mlog_entry_void();
1502 1503
1503 BUG_ON(!ac);
1504 BUG_ON(ac->ac_bits_given >= ac->ac_bits_wanted); 1504 BUG_ON(ac->ac_bits_given >= ac->ac_bits_wanted);
1505 1505
1506 BUG_ON(ac->ac_which != OCFS2_AC_USE_LOCAL 1506 BUG_ON(ac->ac_which != OCFS2_AC_USE_LOCAL
@@ -1557,6 +1557,19 @@ bail:
1557 return status; 1557 return status;
1558} 1558}
1559 1559
1560int ocfs2_claim_clusters(struct ocfs2_super *osb,
1561 handle_t *handle,
1562 struct ocfs2_alloc_context *ac,
1563 u32 min_clusters,
1564 u32 *cluster_start,
1565 u32 *num_clusters)
1566{
1567 unsigned int bits_wanted = ac->ac_bits_wanted - ac->ac_bits_given;
1568
1569 return __ocfs2_claim_clusters(osb, handle, ac, min_clusters,
1570 bits_wanted, cluster_start, num_clusters);
1571}
1572
1560static inline int ocfs2_block_group_clear_bits(handle_t *handle, 1573static inline int ocfs2_block_group_clear_bits(handle_t *handle,
1561 struct inode *alloc_inode, 1574 struct inode *alloc_inode,
1562 struct ocfs2_group_desc *bg, 1575 struct ocfs2_group_desc *bg,