]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/xfs/xfs_buf_item.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
[karo-tx-linux.git] / fs / xfs / xfs_buf_item.c
index fb20f384b566e96407d3bea15bc22d16af63e54f..45df2b857d482fe478c3f4965ddfa57a648eb6ee 100644 (file)
@@ -20,7 +20,6 @@
 #include "xfs_types.h"
 #include "xfs_bit.h"
 #include "xfs_log.h"
-#include "xfs_inum.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
 #include "xfs_ag.h"
@@ -123,11 +122,11 @@ xfs_buf_item_log_check(
        ASSERT(bip->bli_logged != NULL);
 
        bp = bip->bli_buf;
-       ASSERT(XFS_BUF_COUNT(bp) > 0);
+       ASSERT(bp->b_length > 0);
        ASSERT(bp->b_addr != NULL);
        orig = bip->bli_orig;
        buffer = bp->b_addr;
-       for (x = 0; x < XFS_BUF_COUNT(bp); x++) {
+       for (x = 0; x < BBTOB(bp->b_length); x++) {
                if (orig[x] != buffer[x] && !btst(bip->bli_logged, x)) {
                        xfs_emerg(bp->b_mount,
                                "%s: bip %x buffer %x orig %x index %d",
@@ -454,7 +453,7 @@ xfs_buf_item_unpin(
                        bp->b_iodone = NULL;
                } else {
                        spin_lock(&ailp->xa_lock);
-                       xfs_trans_ail_delete(ailp, (xfs_log_item_t *)bip);
+                       xfs_trans_ail_delete(ailp, lip, SHUTDOWN_LOG_IO_ERROR);
                        xfs_buf_item_relse(bp);
                        ASSERT(bp->b_fspriv == NULL);
                }
@@ -657,7 +656,8 @@ xfs_buf_item_init(
         * truncate any pieces.  map_size is the size of the
         * bitmap needed to describe the chunks of the buffer.
         */
-       chunks = (int)((XFS_BUF_COUNT(bp) + (XFS_BLF_CHUNK - 1)) >> XFS_BLF_SHIFT);
+       chunks = (int)((BBTOB(bp->b_length) + (XFS_BLF_CHUNK - 1)) >>
+                                                               XFS_BLF_SHIFT);
        map_size = (int)((chunks + NBWORD) >> BIT_TO_WORD_SHIFT);
 
        bip = (xfs_buf_log_item_t*)kmem_zone_zalloc(xfs_buf_item_zone,
@@ -667,7 +667,7 @@ xfs_buf_item_init(
        xfs_buf_hold(bp);
        bip->bli_format.blf_type = XFS_LI_BUF;
        bip->bli_format.blf_blkno = (__int64_t)XFS_BUF_ADDR(bp);
-       bip->bli_format.blf_len = (ushort)BTOBB(XFS_BUF_COUNT(bp));
+       bip->bli_format.blf_len = (ushort)bp->b_length;
        bip->bli_format.blf_map_size = map_size;
 
 #ifdef XFS_TRANS_DEBUG
@@ -679,9 +679,9 @@ xfs_buf_item_init(
         * the buffer to indicate which bytes the callers have asked
         * to have logged.
         */
-       bip->bli_orig = (char *)kmem_alloc(XFS_BUF_COUNT(bp), KM_SLEEP);
-       memcpy(bip->bli_orig, bp->b_addr, XFS_BUF_COUNT(bp));
-       bip->bli_logged = (char *)kmem_zalloc(XFS_BUF_COUNT(bp) / NBBY, KM_SLEEP);
+       bip->bli_orig = kmem_alloc(BBTOB(bp->b_length), KM_SLEEP);
+       memcpy(bip->bli_orig, bp->b_addr, BBTOB(bp->b_length));
+       bip->bli_logged = kmem_zalloc(BBTOB(bp->b_length) / NBBY, KM_SLEEP);
 #endif
 
        /*
@@ -1006,6 +1006,6 @@ xfs_buf_iodone(
         * Either way, AIL is useless if we're forcing a shutdown.
         */
        spin_lock(&ailp->xa_lock);
-       xfs_trans_ail_delete(ailp, lip);
+       xfs_trans_ail_delete(ailp, lip, SHUTDOWN_CORRUPT_INCORE);
        xfs_buf_item_free(BUF_ITEM(lip));
 }