]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/xfs/xfs_dir2_block.c
Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-omap-h63xx.git] / fs / xfs / xfs_dir2_block.c
index c171767e242ad3b3d19c8c93ea4651f0e30146ea..fb5a556725b344904090769fb37c78f6e970179a 100644 (file)
@@ -271,7 +271,7 @@ xfs_dir2_block_addname(
                }
                lfloglow = toidx + 1 - (be32_to_cpu(btp->stale) - 1);
                lfloghigh -= be32_to_cpu(btp->stale) - 1;
-               be32_add(&btp->count, -(be32_to_cpu(btp->stale) - 1));
+               be32_add_cpu(&btp->count, -(be32_to_cpu(btp->stale) - 1));
                xfs_dir2_data_make_free(tp, bp,
                        (xfs_dir2_data_aoff_t)((char *)blp - (char *)block),
                        (xfs_dir2_data_aoff_t)((be32_to_cpu(btp->stale) - 1) * sizeof(*blp)),
@@ -326,7 +326,7 @@ xfs_dir2_block_addname(
                /*
                 * Update the tail (entry count).
                 */
-               be32_add(&btp->count, 1);
+               be32_add_cpu(&btp->count, 1);
                /*
                 * If we now need to rebuild the bestfree map, do so.
                 * This needs to happen before the next call to use_free.
@@ -387,7 +387,7 @@ xfs_dir2_block_addname(
                        lfloglow = MIN(mid, lfloglow);
                        lfloghigh = MAX(highstale, lfloghigh);
                }
-               be32_add(&btp->stale, -1);
+               be32_add_cpu(&btp->stale, -1);
        }
        /*
         * Point to the new data entry.
@@ -508,7 +508,7 @@ xfs_dir2_block_getdents(
                        continue;
 
                cook = xfs_dir2_db_off_to_dataptr(mp, mp->m_dirdatablk,
-                                                   ptr - (char *)block);
+                                           (char *)dep - (char *)block);
                ino = be64_to_cpu(dep->inumber);
 #if XFS_BIG_INUMS
                ino += mp->m_inoadd;
@@ -519,9 +519,7 @@ xfs_dir2_block_getdents(
                 */
                if (filldir(dirent, dep->name, dep->namelen, cook,
                            ino, DT_UNKNOWN)) {
-                       *offset = xfs_dir2_db_off_to_dataptr(mp,
-                                       mp->m_dirdatablk,
-                                       (char *)dep - (char *)block);
+                       *offset = cook;
                        xfs_da_brelse(NULL, bp);
                        return 0;
                }
@@ -769,7 +767,7 @@ xfs_dir2_block_removename(
        /*
         * Fix up the block tail.
         */
-       be32_add(&btp->stale, 1);
+       be32_add_cpu(&btp->stale, 1);
        xfs_dir2_block_log_tail(tp, bp);
        /*
         * Remove the leaf entry by marking it stale.