]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/ocfs2/alloc.c
Merge branch 'fixes' into for-linus
[linux-2.6-omap-h63xx.git] / fs / ocfs2 / alloc.c
index 41f84c92094fc114854f9dfd5ff98f4f470a3bec..29ff57ec5d1f97047549e69f97a5d426b3e60af2 100644 (file)
@@ -989,15 +989,6 @@ out:
        return ret;
 }
 
-/*
- * This is only valid for leaf nodes, which are the only ones that can
- * have empty extents anyway.
- */
-static inline int ocfs2_is_empty_extent(struct ocfs2_extent_rec *rec)
-{
-       return !rec->e_leaf_clusters;
-}
-
 /*
  * This function will discard the rightmost extent record.
  */
@@ -2788,7 +2779,7 @@ static int ocfs2_merge_rec_right(struct inode *inode,
        BUG_ON(index >= le16_to_cpu(el->l_next_free_rec));
        left_rec = &el->l_recs[index];
 
-       if (index == le16_to_cpu(el->l_next_free_rec - 1) &&
+       if (index == le16_to_cpu(el->l_next_free_rec) - 1 &&
            le16_to_cpu(el->l_next_free_rec) == le16_to_cpu(el->l_count)) {
                /* we meet with a cross extent block merge. */
                ret = ocfs2_get_right_path(inode, left_path, &right_path);
@@ -2802,7 +2793,7 @@ static int ocfs2_merge_rec_right(struct inode *inode,
                BUG_ON(next_free <= 0);
                right_rec = &right_el->l_recs[0];
                if (ocfs2_is_empty_extent(right_rec)) {
-                       BUG_ON(le16_to_cpu(next_free) <= 1);
+                       BUG_ON(next_free <= 1);
                        right_rec = &right_el->l_recs[1];
                }