]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/jfs/jfs_xtree.c
Merge master.kernel.org:/pub/scm/linux/kernel/git/davej/agpgart
[linux-2.6-omap-h63xx.git] / fs / jfs / jfs_xtree.c
index a7fe2f2b969f845d8eba7ed1aca824e2cecf64b9..e72f4ebb6e9cd8058f0be8a656cb04d584feb238 100644 (file)
@@ -3516,16 +3516,10 @@ s64 xtTruncate(tid_t tid, struct inode *ip, s64 newsize, int flag)
        /* process entries backward from last index */
        index = le16_to_cpu(p->header.nextindex) - 1;
 
-       if (p->header.flag & BT_INTERNAL)
-               goto getChild;
-
-       /*
-        *      leaf page
-        */
 
-       /* Since this is the rightmost leaf, and we may have already freed
-        * a page that was formerly to the right, let's make sure that the
-        * next pointer is zero.
+       /* Since this is the rightmost page at this level, and we may have
+        * already freed a page that was formerly to the right, let's make
+        * sure that the next pointer is zero.
         */
        if (p->header.next) {
                if (log)
@@ -3539,6 +3533,12 @@ s64 xtTruncate(tid_t tid, struct inode *ip, s64 newsize, int flag)
                p->header.next = 0;
        }
 
+       if (p->header.flag & BT_INTERNAL)
+               goto getChild;
+
+       /*
+        *      leaf page
+        */
        freed = 0;
 
        /* does region covered by leaf page precede Teof ? */