m68k: Handle 68040 bus faults
[safe/jmp/linux-2.6] / fs / ufs / balloc.c
index b8fa34a..0d9ada1 100644 (file)
@@ -9,7 +9,6 @@
  */
 
 #include <linux/fs.h>
-#include <linux/ufs_fs.h>
 #include <linux/stat.h>
 #include <linux/time.h>
 #include <linux/string.h>
@@ -19,6 +18,8 @@
 #include <linux/bitops.h>
 #include <asm/byteorder.h>
 
+#include "ufs_fs.h"
+#include "ufs.h"
 #include "swab.h"
 #include "util.h"
 
@@ -276,7 +277,7 @@ static void ufs_change_blocknr(struct inode *inode, sector_t beg,
                        if (!page)/* it was truncated */
                                continue;
                        if (IS_ERR(page)) {/* or EIO */
-                               ufs_error(inode->i_sb, __FUNCTION__,
+                               ufs_error(inode->i_sb, __func__,
                                          "read of page %llu failed\n",
                                          (unsigned long long)index);
                                continue;
@@ -307,15 +308,15 @@ static void ufs_change_blocknr(struct inode *inode, sector_t beg,
                                ll_rw_block(READ, 1, &bh);
                                wait_on_buffer(bh);
                                if (!buffer_uptodate(bh)) {
-                                       ufs_error(inode->i_sb, __FUNCTION__,
+                                       ufs_error(inode->i_sb, __func__,
                                                  "read of block failed\n");
                                        break;
                                }
                        }
 
                        UFSD(" change from %llu to %llu, pos %u\n",
-                            (unsigned long long)pos + oldb,
-                            (unsigned long long)pos + newb, pos);
+                            (unsigned long long)(pos + oldb),
+                            (unsigned long long)(pos + newb), pos);
 
                        bh->b_blocknr = newb + pos;
                        unmap_underlying_metadata(bh->b_bdev,
@@ -482,8 +483,9 @@ u64 ufs_new_fragments(struct inode *inode, void *p, u64 fragment,
        if (result) {
                ufs_clear_frags(inode, result + oldcount, newcount - oldcount,
                                locked_page != NULL);
-               ufs_change_blocknr(inode, fragment - oldcount, oldcount, tmp,
-                                  result, locked_page);
+               ufs_change_blocknr(inode, fragment - oldcount, oldcount,
+                                  uspi->s_sbbase + tmp,
+                                  uspi->s_sbbase + result, locked_page);
                ufs_cpu_to_data_ptr(sb, p, result);
                *err = 0;
                UFS_I(inode)->i_lastfrag = max_t(u32, UFS_I(inode)->i_lastfrag, fragment + count);