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.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/fs/ocfs2/suballoc.c b/fs/ocfs2/suballoc.c
index f1871ca83815..8d3947e94a2e 100644
--- a/fs/ocfs2/suballoc.c
+++ b/fs/ocfs2/suballoc.c
@@ -1914,12 +1914,11 @@ static inline void ocfs2_debug_suballoc_inode(struct ocfs2_dinode *fe)
1914 * File systems which don't support holes call this from 1914 * File systems which don't support holes call this from
1915 * ocfs2_extend_allocation(). 1915 * ocfs2_extend_allocation().
1916 */ 1916 */
1917int ocfs2_lock_allocators(struct inode *inode, struct buffer_head *root_bh, 1917int ocfs2_lock_allocators(struct inode *inode,
1918 struct ocfs2_extent_list *root_el, 1918 struct ocfs2_extent_tree *et,
1919 u32 clusters_to_add, u32 extents_to_split, 1919 u32 clusters_to_add, u32 extents_to_split,
1920 struct ocfs2_alloc_context **data_ac, 1920 struct ocfs2_alloc_context **data_ac,
1921 struct ocfs2_alloc_context **meta_ac, 1921 struct ocfs2_alloc_context **meta_ac)
1922 enum ocfs2_extent_tree_type type, void *private)
1923{ 1922{
1924 int ret = 0, num_free_extents; 1923 int ret = 0, num_free_extents;
1925 unsigned int max_recs_needed = clusters_to_add + 2 * extents_to_split; 1924 unsigned int max_recs_needed = clusters_to_add + 2 * extents_to_split;
@@ -1931,8 +1930,7 @@ int ocfs2_lock_allocators(struct inode *inode, struct buffer_head *root_bh,
1931 1930
1932 BUG_ON(clusters_to_add != 0 && data_ac == NULL); 1931 BUG_ON(clusters_to_add != 0 && data_ac == NULL);
1933 1932
1934 num_free_extents = ocfs2_num_free_extents(osb, inode, root_bh, 1933 num_free_extents = ocfs2_num_free_extents(osb, inode, et);
1935 type, private);
1936 if (num_free_extents < 0) { 1934 if (num_free_extents < 0) {
1937 ret = num_free_extents; 1935 ret = num_free_extents;
1938 mlog_errno(ret); 1936 mlog_errno(ret);
@@ -1954,7 +1952,7 @@ int ocfs2_lock_allocators(struct inode *inode, struct buffer_head *root_bh,
1954 */ 1952 */
1955 if (!num_free_extents || 1953 if (!num_free_extents ||
1956 (ocfs2_sparse_alloc(osb) && num_free_extents < max_recs_needed)) { 1954 (ocfs2_sparse_alloc(osb) && num_free_extents < max_recs_needed)) {
1957 ret = ocfs2_reserve_new_metadata(osb, root_el, meta_ac); 1955 ret = ocfs2_reserve_new_metadata(osb, et->et_root_el, meta_ac);
1958 if (ret < 0) { 1956 if (ret < 0) {
1959 if (ret != -ENOSPC) 1957 if (ret != -ENOSPC)
1960 mlog_errno(ret); 1958 mlog_errno(ret);