]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - fs/xfs/xfs_iomap.c
[XFS] Add parameters to xfs_bmapi() and xfs_bunmapi() to have them report
[mv-sheeva.git] / fs / xfs / xfs_iomap.c
index 5ecf3e3e86aaa4feab769541b0a7a5c1802a73cd..d79055207fbfb810a9d8975b4072472bd1ebe99b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2005 Silicon Graphics, Inc.
+ * Copyright (c) 2000-2006 Silicon Graphics, Inc.
  * All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or
@@ -40,7 +40,6 @@
 #include "xfs_ialloc.h"
 #include "xfs_btree.h"
 #include "xfs_bmap.h"
-#include "xfs_bit.h"
 #include "xfs_rtalloc.h"
 #include "xfs_error.h"
 #include "xfs_itable.h"
@@ -77,7 +76,7 @@ xfs_iomap_enter_trace(
                (void *)((unsigned long)count),
                (void *)((unsigned long)((io->io_new_size >> 32) & 0xffffffff)),
                (void *)((unsigned long)(io->io_new_size & 0xffffffff)),
-               (void *)NULL,
+               (void *)((unsigned long)current_pid()),
                (void *)NULL,
                (void *)NULL,
                (void *)NULL,
@@ -253,7 +252,7 @@ xfs_iomap(
        error = XFS_BMAPI(mp, NULL, io, offset_fsb,
                        (xfs_filblks_t)(end_fsb - offset_fsb),
                        bmapi_flags,  NULL, 0, &imap,
-                       &nimaps, NULL);
+                       &nimaps, NULL, NULL);
 
        if (error)
                goto out;
@@ -520,8 +519,8 @@ xfs_iomap_write_direct(
         */
        XFS_BMAP_INIT(&free_list, &firstfsb);
        nimaps = 1;
-       error = xfs_bmapi(tp, ip, offset_fsb, count_fsb,
-               bmapi_flag, &firstfsb, 0, &imap, &nimaps, &free_list);
+       error = XFS_BMAPI(mp, tp, io, offset_fsb, count_fsb, bmapi_flag,
+               &firstfsb, 0, &imap, &nimaps, &free_list, NULL);
        if (error)
                goto error0;
 
@@ -551,8 +550,10 @@ xfs_iomap_write_direct(
                         "extent-state : %x \n",
                         (ip->i_mount)->m_fsname,
                         (long long)ip->i_ino,
-                        ret_imap->br_startblock, ret_imap->br_startoff,
-                        ret_imap->br_blockcount,ret_imap->br_state);
+                        (unsigned long long)ret_imap->br_startblock,
+                       (unsigned long long)ret_imap->br_startoff,
+                        (unsigned long long)ret_imap->br_blockcount,
+                       ret_imap->br_state);
         }
        return 0;
 
@@ -608,8 +609,9 @@ xfs_iomap_eof_want_preallocate(
        count_fsb = XFS_B_TO_FSB(mp, (xfs_ufsize_t)XFS_MAXIOFFSET(mp));
        while (count_fsb > 0) {
                imaps = nimaps;
-               error = XFS_BMAPI(mp, NULL, io, start_fsb, count_fsb,
-                                 0, &firstblock, 0, imap, &imaps, NULL);
+               firstblock = NULLFSBLOCK;
+               error = XFS_BMAPI(mp, NULL, io, start_fsb, count_fsb, 0,
+                                 &firstblock, 0, imap, &imaps, NULL, NULL);
                if (error)
                        return error;
                for (n = 0; n < imaps; n++) {
@@ -693,11 +695,11 @@ retry:
 
        nimaps = XFS_WRITE_IMAPS;
        firstblock = NULLFSBLOCK;
-       error = xfs_bmapi(NULL, ip, offset_fsb,
+       error = XFS_BMAPI(mp, NULL, io, offset_fsb,
                          (xfs_filblks_t)(last_fsb - offset_fsb),
                          XFS_BMAPI_DELAY | XFS_BMAPI_WRITE |
                          XFS_BMAPI_ENTIRE, &firstblock, 1, imap,
-                         &nimaps, NULL);
+                         &nimaps, NULL, NULL);
        if (error && (error != ENOSPC))
                return XFS_ERROR(error);
 
@@ -721,8 +723,10 @@ retry:
                         "extent-state : %x \n",
                         (ip->i_mount)->m_fsname,
                         (long long)ip->i_ino,
-                        ret_imap->br_startblock, ret_imap->br_startoff,
-                        ret_imap->br_blockcount,ret_imap->br_state);
+                        (unsigned long long)ret_imap->br_startblock,
+                       (unsigned long long)ret_imap->br_startoff,
+                        (unsigned long long)ret_imap->br_blockcount,
+                       ret_imap->br_state);
        }
 
        *ret_imap = imap[0];
@@ -828,9 +832,9 @@ xfs_iomap_write_allocate(
                        }
 
                        /* Go get the actual blocks */
-                       error = xfs_bmapi(tp, ip, map_start_fsb, count_fsb,
+                       error = XFS_BMAPI(mp, tp, io, map_start_fsb, count_fsb,
                                        XFS_BMAPI_WRITE, &first_block, 1,
-                                       imap, &nimaps, &free_list);
+                                       imap, &nimaps, &free_list, NULL);
                        if (error)
                                goto trans_cancel;
 
@@ -853,17 +857,21 @@ xfs_iomap_write_allocate(
                 */
 
                for (i = 0; i < nimaps; i++) {
-                       if ( !(io->io_flags & XFS_IOCORE_RT)  && 
-                               !imap[i].br_startblock) {
+                       if (!(io->io_flags & XFS_IOCORE_RT)  &&
+                           !imap[i].br_startblock) {
                                cmn_err(CE_PANIC,"Access to block zero:  "
                                        "fs <%s> inode: %lld "
-                                       "start_block : %llx start_off : %llx " 
+                                       "start_block : %llx start_off : %llx "
                                        "blkcnt : %llx extent-state : %x \n",
                                        (ip->i_mount)->m_fsname,
                                        (long long)ip->i_ino,
-                                       imap[i].br_startblock,
-                                       imap[i].br_startoff,
-                                       imap[i].br_blockcount,imap[i].br_state);
+                                       (unsigned long long)
+                                               imap[i].br_startblock,
+                                       (unsigned long long)
+                                               imap[i].br_startoff,
+                                       (unsigned long long)
+                                               imap[i].br_blockcount,
+                                       imap[i].br_state);
                         }
                        if ((offset_fsb >= imap[i].br_startoff) &&
                            (offset_fsb < (imap[i].br_startoff +
@@ -947,9 +955,9 @@ xfs_iomap_write_unwritten(
                 */
                XFS_BMAP_INIT(&free_list, &firstfsb);
                nimaps = 1;
-               error = xfs_bmapi(tp, ip, offset_fsb, count_fsb,
+               error = XFS_BMAPI(mp, tp, io, offset_fsb, count_fsb,
                                  XFS_BMAPI_WRITE|XFS_BMAPI_CONVERT, &firstfsb,
-                                 1, &imap, &nimaps, &free_list);
+                                 1, &imap, &nimaps, &free_list, NULL);
                if (error)
                        goto error_on_bmapi_transaction;
 
@@ -969,8 +977,10 @@ xfs_iomap_write_unwritten(
                                "%llx blkcnt : %llx extent-state : %x \n",
                                (ip->i_mount)->m_fsname,
                                (long long)ip->i_ino,
-                               imap.br_startblock,imap.br_startoff,
-                               imap.br_blockcount,imap.br_state);
+                               (unsigned long long)imap.br_startblock,
+                               (unsigned long long)imap.br_startoff,
+                               (unsigned long long)imap.br_blockcount,
+                               imap.br_state);
                }
 
                if ((numblks_fsb = imap.br_blockcount) == 0) {