]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/xfs/xfs_dir2_node.c
Input: aiptek - put sensible warnings in probe
[linux-2.6-omap-h63xx.git] / fs / xfs / xfs_dir2_node.c
index c0e8fcf5e13f1db0ab7d60bb0376c1db9b5e8d37..d083c38199343e0eacf91007c8e41180e79fcb54 100644 (file)
 #include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
-#include "xfs_dir.h"
 #include "xfs_dir2.h"
 #include "xfs_dmapi.h"
 #include "xfs_mount.h"
 #include "xfs_da_btree.h"
 #include "xfs_bmap_btree.h"
-#include "xfs_dir_sf.h"
 #include "xfs_dir2_sf.h"
 #include "xfs_attr_sf.h"
 #include "xfs_dinode.h"
@@ -505,7 +503,6 @@ xfs_dir2_leafn_lookup_int(
                                                        XFS_DATA_FORK))) {
                                                return error;
                                        }
-                                       curfdb = newfdb;
                                        free = curbp->data;
                                        ASSERT(be32_to_cpu(free->hdr.magic) ==
                                               XFS_DIR2_FREE_MAGIC);
@@ -527,8 +524,11 @@ xfs_dir2_leafn_lookup_int(
                                if (unlikely(be16_to_cpu(free->bests[fi]) == NULLDATAOFF)) {
                                        XFS_ERROR_REPORT("xfs_dir2_leafn_lookup_int",
                                                         XFS_ERRLEVEL_LOW, mp);
+                                       if (curfdb != newfdb)
+                                               xfs_da_brelse(tp, curbp);
                                        return XFS_ERROR(EFSCORRUPTED);
                                }
+                               curfdb = newfdb;
                                if (be16_to_cpu(free->bests[fi]) >= length) {
                                        *indexp = index;
                                        state->extravalid = 1;
@@ -904,7 +904,7 @@ xfs_dir2_leafn_remove(
         * Log the data block header if needed.
         */
        if (needscan)
-               xfs_dir2_data_freescan(mp, data, &needlog, NULL);
+               xfs_dir2_data_freescan(mp, data, &needlog);
        if (needlog)
                xfs_dir2_data_log_header(tp, dbp);
        xfs_dir2_data_check(dp, dbp);
@@ -970,7 +970,7 @@ xfs_dir2_leafn_remove(
                        /*
                         * One less used entry in the free table.
                         */
-                       free->hdr.nused = cpu_to_be32(-1);
+                       be32_add(&free->hdr.nused, -1);
                        xfs_dir2_free_log_header(tp, fbp);
                        /*
                         * If this was the last entry in the table, we can
@@ -1705,7 +1705,7 @@ xfs_dir2_node_addname_int(
         * Rescan the block for bestfree if needed.
         */
        if (needscan)
-               xfs_dir2_data_freescan(mp, data, &needlog, NULL);
+               xfs_dir2_data_freescan(mp, data, &needlog);
        /*
         * Log the data block header if needed.
         */