]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blobdiff - libxfs/xfs_alloc_btree.c
Merge whitespace changes over
[thirdparty/xfsprogs-dev.git] / libxfs / xfs_alloc_btree.c
index a51c97bc8cae1a60043ba3fa357d69dee95d0713..1fc539cc56e41d142fbd5b525a851770f81ddc73 100644 (file)
@@ -1,32 +1,32 @@
 /*
- * Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
- * 
+ * Copyright (c) 2000-2001 Silicon Graphics, Inc.  All Rights Reserved.
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of version 2 of the GNU General Public License as
  * published by the Free Software Foundation.
- * 
+ *
  * This program is distributed in the hope that it would be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * 
+ *
  * Further, this software is distributed without any warranty that it is
  * free of the rightful claim of any third person regarding infringement
  * or the like.  Any license provided herein, whether implied or
  * otherwise, applies only to this software file.  Patent licenses, if
  * any, provided herein do not apply to combinations of this program with
  * other software, or any other product whatsoever.
- * 
+ *
  * You should have received a copy of the GNU General Public License along
  * with this program; if not, write the Free Software Foundation, Inc., 59
  * Temple Place - Suite 330, Boston MA 02111-1307, USA.
- * 
+ *
  * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
  * Mountain View, CA  94043, or:
- * 
- * http://www.sgi.com 
- * 
- * For further information regarding this notice, see: 
- * 
+ *
+ * http://www.sgi.com
+ *
+ * For further information regarding this notice, see:
+ *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
@@ -97,7 +97,7 @@ xfs_alloc_delrec(
                *stat = 0;
                return 0;
        }
-       XFS_STATS_INC(xs_abt_delrec);
+       XFS_STATS_INC(xfsstats.xs_abt_delrec);
        /*
         * It's a nonleaf.  Excise the key and ptr being deleted, by
         * sliding the entries past them down one.
@@ -113,9 +113,9 @@ xfs_alloc_delrec(
                }
 #endif
                if (ptr < INT_GET(block->bb_numrecs, ARCH_CONVERT)) {
-                       ovbcopy(&lkp[ptr], &lkp[ptr - 1],
+                       memmove(&lkp[ptr - 1], &lkp[ptr],
                                (INT_GET(block->bb_numrecs, ARCH_CONVERT) - ptr) * sizeof(*lkp)); /* INT_: mem copy */
-                       ovbcopy(&lpp[ptr], &lpp[ptr - 1],
+                       memmove(&lpp[ptr - 1], &lpp[ptr],
                                (INT_GET(block->bb_numrecs, ARCH_CONVERT) - ptr) * sizeof(*lpp)); /* INT_: mem copy */
                        xfs_alloc_log_ptrs(cur, bp, ptr, INT_GET(block->bb_numrecs, ARCH_CONVERT) - 1);
                        xfs_alloc_log_keys(cur, bp, ptr, INT_GET(block->bb_numrecs, ARCH_CONVERT) - 1);
@@ -128,7 +128,7 @@ xfs_alloc_delrec(
        else {
                lrp = XFS_ALLOC_REC_ADDR(block, 1, cur);
                if (ptr < INT_GET(block->bb_numrecs, ARCH_CONVERT)) {
-                       ovbcopy(&lrp[ptr], &lrp[ptr - 1],
+                       memmove(&lrp[ptr - 1], &lrp[ptr],
                                (INT_GET(block->bb_numrecs, ARCH_CONVERT) - ptr) * sizeof(*lrp));
                        xfs_alloc_log_recs(cur, bp, ptr, INT_GET(block->bb_numrecs, ARCH_CONVERT) - 1);
                }
@@ -204,6 +204,23 @@ xfs_alloc_delrec(
                        if ((error = xfs_alloc_put_freelist(cur->bc_tp,
                                        cur->bc_private.a.agbp, NULL, bno)))
                                return error;
+                       /*
+                        * Since blocks move to the free list without the
+                        * coordination used in xfs_bmap_finish, we can't allow
+                        * block to be available for reallocation and
+                        * non-transaction writing (user data) until we know
+                        * that the transaction that moved it to the free list
+                        * is permanently on disk. We track the blocks by
+                        * declaring these blocks as "busy"; the busy list is
+                        * maintained on a per-ag basis and each transaction
+                        * records which entries should be removed when the
+                        * iclog commits to disk. If a busy block is
+                        * allocated, the iclog is pushed up to the LSN
+                        * that freed the block.
+                        */
+                       xfs_alloc_mark_busy(cur->bc_tp,
+                               INT_GET(agf->agf_seqno, ARCH_CONVERT), bno, 1);
+
                        xfs_trans_agbtree_delta(cur->bc_tp, -1);
                        xfs_alloc_log_agf(cur->bc_tp, cur->bc_private.a.agbp,
                                XFS_AGF_ROOTS | XFS_AGF_LEVELS);
@@ -302,7 +319,7 @@ xfs_alloc_delrec(
                }
                /*
                 * Otherwise, grab the number of records in right for
-                * future reference, and fix up the temp cursor to point 
+                * future reference, and fix up the temp cursor to point
                 * to our block again (last record).
                 */
                rrecs = INT_GET(right->bb_numrecs, ARCH_CONVERT);
@@ -445,8 +462,8 @@ xfs_alloc_delrec(
                                return error;
                }
 #endif
-               bcopy(rkp, lkp, INT_GET(right->bb_numrecs, ARCH_CONVERT) * sizeof(*lkp)); /* INT_: structure copy */
-               bcopy(rpp, lpp, INT_GET(right->bb_numrecs, ARCH_CONVERT) * sizeof(*lpp)); /* INT_: structure copy */
+               memcpy(lkp, rkp, INT_GET(right->bb_numrecs, ARCH_CONVERT) * sizeof(*lkp)); /* INT_: structure copy */
+               memcpy(lpp, rpp, INT_GET(right->bb_numrecs, ARCH_CONVERT) * sizeof(*lpp)); /* INT_: structure copy */
                xfs_alloc_log_keys(cur, lbp, INT_GET(left->bb_numrecs, ARCH_CONVERT) + 1,
                                   INT_GET(left->bb_numrecs, ARCH_CONVERT) + INT_GET(right->bb_numrecs, ARCH_CONVERT));
                xfs_alloc_log_ptrs(cur, lbp, INT_GET(left->bb_numrecs, ARCH_CONVERT) + 1,
@@ -457,7 +474,7 @@ xfs_alloc_delrec(
                 */
                lrp = XFS_ALLOC_REC_ADDR(left, INT_GET(left->bb_numrecs, ARCH_CONVERT) + 1, cur);
                rrp = XFS_ALLOC_REC_ADDR(right, 1, cur);
-               bcopy(rrp, lrp, INT_GET(right->bb_numrecs, ARCH_CONVERT) * sizeof(*lrp));
+               memcpy(lrp, rrp, INT_GET(right->bb_numrecs, ARCH_CONVERT) * sizeof(*lrp));
                xfs_alloc_log_recs(cur, lbp, INT_GET(left->bb_numrecs, ARCH_CONVERT) + 1,
                                   INT_GET(left->bb_numrecs, ARCH_CONVERT) + INT_GET(right->bb_numrecs, ARCH_CONVERT));
        }
@@ -486,12 +503,12 @@ xfs_alloc_delrec(
        left->bb_rightsib = right->bb_rightsib; /* INT_: direct copy */
        xfs_alloc_log_block(cur->bc_tp, lbp, XFS_BB_NUMRECS | XFS_BB_RIGHTSIB);
        /*
-        * If there is a right sibling now, make it point to the 
+        * If there is a right sibling now, make it point to the
         * remaining block.
         */
        if (INT_GET(left->bb_rightsib, ARCH_CONVERT) != NULLAGBLOCK) {
                xfs_alloc_block_t       *rrblock;
-               xfs_buf_t                       *rrbp;
+               xfs_buf_t               *rrbp;
 
                if ((error = xfs_btree_read_bufs(mp, cur->bc_tp,
                                cur->bc_private.a.agno, INT_GET(left->bb_rightsib, ARCH_CONVERT), 0,
@@ -509,6 +526,21 @@ xfs_alloc_delrec(
        if ((error = xfs_alloc_put_freelist(cur->bc_tp, cur->bc_private.a.agbp,
                        NULL, rbno)))
                return error;
+       /*
+        * Since blocks move to the free list without the coordination
+        * used in xfs_bmap_finish, we can't allow block to be available
+        * for reallocation and non-transaction writing (user data)
+        * until we know that the transaction that moved it to the free
+        * list is permanently on disk. We track the blocks by declaring
+        * these blocks as "busy"; the busy list is maintained on a
+        * per-ag basis and each transaction records which entries
+        * should be removed when the iclog commits to disk. If a
+        * busy block is allocated, the iclog is pushed up to the
+        * LSN that freed the block.
+        */
+       xfs_alloc_mark_busy(cur->bc_tp,
+               INT_GET(agf->agf_seqno, ARCH_CONVERT), bno, 1);
+
        xfs_trans_agbtree_delta(cur->bc_tp, -1);
        /*
         * Adjust the current level's cursor so that we're left referring
@@ -517,7 +549,7 @@ xfs_alloc_delrec(
         */
        if (level > 0)
                cur->bc_ptrs[level]--;
-       /* 
+       /*
         * Return value means the next level up has something to do.
         */
        *stat = 2;
@@ -563,7 +595,7 @@ xfs_alloc_insrec(
         * and we're done.
         */
        if (level >= cur->bc_nlevels) {
-               XFS_STATS_INC(xs_abt_insrec);
+               XFS_STATS_INC(xfsstats.xs_abt_insrec);
                if ((error = xfs_alloc_newroot(cur, &i)))
                        return error;
                *bnop = NULLAGBLOCK;
@@ -583,7 +615,7 @@ xfs_alloc_insrec(
                *stat = 0;
                return 0;
        }
-       XFS_STATS_INC(xs_abt_insrec);
+       XFS_STATS_INC(xfsstats.xs_abt_insrec);
        /*
         * Get pointers to the btree buffer and block.
         */
@@ -592,7 +624,7 @@ xfs_alloc_insrec(
 #ifdef DEBUG
        if ((error = xfs_btree_check_sblock(cur, block, level, bp)))
                return error;
-       /* 
+       /*
         * Check that the new entry is being inserted in the right place.
         */
        if (ptr <= INT_GET(block->bb_numrecs, ARCH_CONVERT)) {
@@ -678,9 +710,9 @@ xfs_alloc_insrec(
                                return error;
                }
 #endif
-               ovbcopy(&kp[ptr - 1], &kp[ptr],
+               memmove(&kp[ptr], &kp[ptr - 1],
                        (INT_GET(block->bb_numrecs, ARCH_CONVERT) - ptr + 1) * sizeof(*kp)); /* INT_: copy */
-               ovbcopy(&pp[ptr - 1], &pp[ptr],
+               memmove(&pp[ptr], &pp[ptr - 1],
                        (INT_GET(block->bb_numrecs, ARCH_CONVERT) - ptr + 1) * sizeof(*pp)); /* INT_: copy */
 #ifdef DEBUG
                if ((error = xfs_btree_check_sptr(cur, *bnop, level)))
@@ -704,7 +736,7 @@ xfs_alloc_insrec(
                 * It's a leaf entry.  Make a hole for the new record.
                 */
                rp = XFS_ALLOC_REC_ADDR(block, 1, cur);
-               ovbcopy(&rp[ptr - 1], &rp[ptr],
+               memmove(&rp[ptr], &rp[ptr - 1],
                        (INT_GET(block->bb_numrecs, ARCH_CONVERT) - ptr + 1) * sizeof(*rp));
                /*
                 * Now stuff the new record in, bump numrecs
@@ -792,7 +824,7 @@ xfs_alloc_log_block(
 STATIC void
 xfs_alloc_log_keys(
        xfs_btree_cur_t         *cur,   /* btree cursor */
-       xfs_buf_t                       *bp,    /* buffer containing btree block */
+       xfs_buf_t               *bp,    /* buffer containing btree block */
        int                     kfirst, /* index of first key to log */
        int                     klast)  /* index of last key to log */
 {
@@ -814,7 +846,7 @@ xfs_alloc_log_keys(
 STATIC void
 xfs_alloc_log_ptrs(
        xfs_btree_cur_t         *cur,   /* btree cursor */
-       xfs_buf_t                       *bp,    /* buffer containing btree block */
+       xfs_buf_t               *bp,    /* buffer containing btree block */
        int                     pfirst, /* index of first pointer to log */
        int                     plast)  /* index of last pointer to log */
 {
@@ -883,7 +915,7 @@ xfs_alloc_lookup(
        int                     level;  /* level in the btree */
        xfs_mount_t             *mp;    /* file system mount point */
 
-       XFS_STATS_INC(xs_abt_lookup);
+       XFS_STATS_INC(xfsstats.xs_abt_lookup);
        /*
         * Get the allocation group header, and the root block number.
         */
@@ -903,8 +935,8 @@ xfs_alloc_lookup(
         * pointer down to the next level.
         */
        for (level = cur->bc_nlevels - 1, diff = 1; level >= 0; level--) {
-               xfs_buf_t       *bp;            /* buffer pointer for btree block */
-               xfs_daddr_t     d;              /* disk address of btree block */
+               xfs_buf_t       *bp;    /* buffer pointer for btree block */
+               xfs_daddr_t     d;      /* disk address of btree block */
 
                /*
                 * Get the disk address we're looking for.
@@ -919,7 +951,7 @@ xfs_alloc_lookup(
                        bp = (xfs_buf_t *)0;
                if (!bp) {
                        /*
-                        * Need to get a new buffer.  Read it, then 
+                        * Need to get a new buffer.  Read it, then
                         * set it in the cursor, releasing the old one.
                         */
                        if ((error = xfs_btree_read_bufs(mp, cur->bc_tp, agno,
@@ -978,7 +1010,7 @@ xfs_alloc_lookup(
                                xfs_extlen_t    blockcount;     /* key value */
                                xfs_agblock_t   startblock;     /* key value */
 
-                               XFS_STATS_INC(xs_abt_compare);
+                               XFS_STATS_INC(xfsstats.xs_abt_compare);
                                /*
                                 * keyno is average of low and high.
                                 */
@@ -1096,10 +1128,10 @@ xfs_alloc_lshift(
        int                     i;      /* loop index */
 #endif
        xfs_alloc_key_t         key;    /* key value for leaf level upward */
-       xfs_buf_t                       *lbp;   /* buffer for left neighbor block */
+       xfs_buf_t               *lbp;   /* buffer for left neighbor block */
        xfs_alloc_block_t       *left;  /* left neighbor btree block */
        int                     nrec;   /* new number of left block entries */
-       xfs_buf_t                       *rbp;   /* buffer for right (current) block */
+       xfs_buf_t               *rbp;   /* buffer for right (current) block */
        xfs_alloc_block_t       *right; /* right (current) btree block */
        xfs_alloc_key_t         *rkp=NULL;      /* key pointer for right block */
        xfs_alloc_ptr_t         *rpp=NULL;      /* address pointer for right block */
@@ -1122,7 +1154,7 @@ xfs_alloc_lshift(
                return 0;
        }
        /*
-        * If the cursor entry is the one that would be moved, don't 
+        * If the cursor entry is the one that would be moved, don't
         * do it... it's too complicated.
         */
        if (cur->bc_ptrs[level] <= 1) {
@@ -1198,12 +1230,12 @@ xfs_alloc_lshift(
                                return error;
                }
 #endif
-               ovbcopy(rkp + 1, rkp, INT_GET(right->bb_numrecs, ARCH_CONVERT) * sizeof(*rkp));
-               ovbcopy(rpp + 1, rpp, INT_GET(right->bb_numrecs, ARCH_CONVERT) * sizeof(*rpp));
+               memmove(rkp, rkp + 1, INT_GET(right->bb_numrecs, ARCH_CONVERT) * sizeof(*rkp));
+               memmove(rpp, rpp + 1, INT_GET(right->bb_numrecs, ARCH_CONVERT) * sizeof(*rpp));
                xfs_alloc_log_keys(cur, rbp, 1, INT_GET(right->bb_numrecs, ARCH_CONVERT));
                xfs_alloc_log_ptrs(cur, rbp, 1, INT_GET(right->bb_numrecs, ARCH_CONVERT));
        } else {
-               ovbcopy(rrp + 1, rrp, INT_GET(right->bb_numrecs, ARCH_CONVERT) * sizeof(*rrp));
+               memmove(rrp, rrp + 1, INT_GET(right->bb_numrecs, ARCH_CONVERT) * sizeof(*rrp));
                xfs_alloc_log_recs(cur, rbp, 1, INT_GET(right->bb_numrecs, ARCH_CONVERT));
                key.ar_startblock = rrp->ar_startblock; /* INT_: direct copy */
                key.ar_blockcount = rrp->ar_blockcount; /* INT_: direct copy */
@@ -1232,15 +1264,15 @@ xfs_alloc_newroot(
 {
        int                     error;  /* error return value */
        xfs_agblock_t           lbno;   /* left block number */
-       xfs_buf_t                       *lbp;   /* left btree buffer */
+       xfs_buf_t               *lbp;   /* left btree buffer */
        xfs_alloc_block_t       *left;  /* left btree block */
        xfs_mount_t             *mp;    /* mount structure */
        xfs_agblock_t           nbno;   /* new block number */
-       xfs_buf_t                       *nbp;   /* new (root) buffer */
+       xfs_buf_t               *nbp;   /* new (root) buffer */
        xfs_alloc_block_t       *new;   /* new (root) btree block */
        int                     nptr;   /* new value for key index, 1 or 2 */
        xfs_agblock_t           rbno;   /* right block number */
-       xfs_buf_t                       *rbp;   /* right btree buffer */
+       xfs_buf_t               *rbp;   /* right btree buffer */
        xfs_alloc_block_t       *right; /* right btree block */
 
        mp = cur->bc_mp;
@@ -1330,7 +1362,7 @@ xfs_alloc_newroot(
        INT_SET(new->bb_level, ARCH_CONVERT, (__uint16_t)cur->bc_nlevels);
        INT_SET(new->bb_numrecs, ARCH_CONVERT, 2);
        INT_SET(new->bb_leftsib, ARCH_CONVERT, NULLAGBLOCK);
-        INT_SET(new->bb_rightsib, ARCH_CONVERT, NULLAGBLOCK);
+       INT_SET(new->bb_rightsib, ARCH_CONVERT, NULLAGBLOCK);
        xfs_alloc_log_block(cur->bc_tp, nbp, XFS_BB_ALL_BITS);
        ASSERT(lbno != NULLAGBLOCK && rbno != NULLAGBLOCK);
        /*
@@ -1389,9 +1421,9 @@ xfs_alloc_rshift(
        int                     error;  /* error return value */
        int                     i;      /* loop index */
        xfs_alloc_key_t         key;    /* key value for leaf level upward */
-       xfs_buf_t                       *lbp;   /* buffer for left (current) block */
+       xfs_buf_t               *lbp;   /* buffer for left (current) block */
        xfs_alloc_block_t       *left;  /* left (current) btree block */
-       xfs_buf_t                       *rbp;   /* buffer for right neighbor block */
+       xfs_buf_t               *rbp;   /* buffer for right neighbor block */
        xfs_alloc_block_t       *right; /* right neighbor btree block */
        xfs_alloc_key_t         *rkp;   /* key pointer for right block */
        xfs_btree_cur_t         *tcur;  /* temporary cursor */
@@ -1456,8 +1488,8 @@ xfs_alloc_rshift(
                                return error;
                }
 #endif
-               ovbcopy(rkp, rkp + 1, INT_GET(right->bb_numrecs, ARCH_CONVERT) * sizeof(*rkp));
-               ovbcopy(rpp, rpp + 1, INT_GET(right->bb_numrecs, ARCH_CONVERT) * sizeof(*rpp));
+               memmove(rkp + 1, rkp, INT_GET(right->bb_numrecs, ARCH_CONVERT) * sizeof(*rkp));
+               memmove(rpp + 1, rpp, INT_GET(right->bb_numrecs, ARCH_CONVERT) * sizeof(*rpp));
 #ifdef DEBUG
                if ((error = xfs_btree_check_sptr(cur, INT_GET(*lpp, ARCH_CONVERT), level)))
                        return error;
@@ -1473,7 +1505,7 @@ xfs_alloc_rshift(
 
                lrp = XFS_ALLOC_REC_ADDR(left, INT_GET(left->bb_numrecs, ARCH_CONVERT), cur);
                rrp = XFS_ALLOC_REC_ADDR(right, 1, cur);
-               ovbcopy(rrp, rrp + 1, INT_GET(right->bb_numrecs, ARCH_CONVERT) * sizeof(*rrp));
+               memmove(rrp + 1, rrp, INT_GET(right->bb_numrecs, ARCH_CONVERT) * sizeof(*rrp));
                *rrp = *lrp;
                xfs_alloc_log_recs(cur, rbp, 1, INT_GET(right->bb_numrecs, ARCH_CONVERT) + 1);
                key.ar_startblock = rrp->ar_startblock; /* INT_: direct copy */
@@ -1523,10 +1555,10 @@ xfs_alloc_split(
        int                     error;  /* error return value */
        int                     i;      /* loop index/record number */
        xfs_agblock_t           lbno;   /* left (current) block number */
-       xfs_buf_t                       *lbp;   /* buffer for left block */
+       xfs_buf_t               *lbp;   /* buffer for left block */
        xfs_alloc_block_t       *left;  /* left (current) btree block */
        xfs_agblock_t           rbno;   /* right (new) block number */
-       xfs_buf_t                       *rbp;   /* buffer for right block */
+       xfs_buf_t               *rbp;   /* buffer for right block */
        xfs_alloc_block_t       *right; /* right (new) btree block */
 
        /*
@@ -1589,8 +1621,8 @@ xfs_alloc_split(
                                return error;
                }
 #endif
-               bcopy(lkp, rkp, INT_GET(right->bb_numrecs, ARCH_CONVERT) * sizeof(*rkp)); /* INT_: copy */
-               bcopy(lpp, rpp, INT_GET(right->bb_numrecs, ARCH_CONVERT) * sizeof(*rpp));/* INT_: copy */
+               memcpy(rkp, lkp, INT_GET(right->bb_numrecs, ARCH_CONVERT) * sizeof(*rkp)); /* INT_: copy */
+               memcpy(rpp, lpp, INT_GET(right->bb_numrecs, ARCH_CONVERT) * sizeof(*rpp)); /* INT_: copy */
                xfs_alloc_log_keys(cur, rbp, 1, INT_GET(right->bb_numrecs, ARCH_CONVERT));
                xfs_alloc_log_ptrs(cur, rbp, 1, INT_GET(right->bb_numrecs, ARCH_CONVERT));
                *keyp = *rkp;
@@ -1604,7 +1636,7 @@ xfs_alloc_split(
 
                lrp = XFS_ALLOC_REC_ADDR(left, i, cur);
                rrp = XFS_ALLOC_REC_ADDR(right, 1, cur);
-               bcopy(lrp, rrp, INT_GET(right->bb_numrecs, ARCH_CONVERT) * sizeof(*rrp));
+               memcpy(rrp, lrp, INT_GET(right->bb_numrecs, ARCH_CONVERT) * sizeof(*rrp));
                xfs_alloc_log_recs(cur, rbp, 1, INT_GET(right->bb_numrecs, ARCH_CONVERT));
                keyp->ar_startblock = rrp->ar_startblock; /* INT_: direct copy */
                keyp->ar_blockcount = rrp->ar_blockcount; /* INT_: direct copy */
@@ -1626,7 +1658,7 @@ xfs_alloc_split(
         */
        if (INT_GET(right->bb_rightsib, ARCH_CONVERT) != NULLAGBLOCK) {
                xfs_alloc_block_t       *rrblock;       /* rr btree block */
-               xfs_buf_t                       *rrbp;          /* buffer for rrblock */
+               xfs_buf_t               *rrbp;          /* buffer for rrblock */
 
                if ((error = xfs_btree_read_bufs(cur->bc_mp, cur->bc_tp,
                                cur->bc_private.a.agno, INT_GET(right->bb_rightsib, ARCH_CONVERT), 0,
@@ -1680,7 +1712,7 @@ xfs_alloc_updkey(
         */
        for (ptr = 1; ptr == 1 && level < cur->bc_nlevels; level++) {
                xfs_alloc_block_t       *block; /* btree block */
-               xfs_buf_t                       *bp;    /* buffer for block */
+               xfs_buf_t               *bp;    /* buffer for block */
 #ifdef DEBUG
                int                     error;  /* error return value */
 #endif
@@ -1755,7 +1787,7 @@ xfs_alloc_decrement(
                if (--cur->bc_ptrs[lev] > 0)
                        break;
                /*
-                * Read-ahead the left block, we're going to read it 
+                * Read-ahead the left block, we're going to read it
                 * in the next loop.
                 */
                xfs_btree_readahead(cur, lev, XFS_BTCUR_LEFTRA);
@@ -1770,7 +1802,7 @@ xfs_alloc_decrement(
         */
        for (block = XFS_BUF_TO_ALLOC_BLOCK(cur->bc_bufs[lev]); lev > level; ) {
                xfs_agblock_t   agbno;  /* block number of btree block */
-               xfs_buf_t               *bp;    /* buffer pointer for block */
+               xfs_buf_t       *bp;    /* buffer pointer for block */
 
                agbno = INT_GET(*XFS_ALLOC_PTR_ADDR(block, cur->bc_ptrs[lev], cur), ARCH_CONVERT);
                if ((error = xfs_btree_read_bufs(cur->bc_mp, cur->bc_tp,
@@ -1824,7 +1856,7 @@ xfs_alloc_delete(
        return 0;
 }
 
-/* 
+/*
  * Get the data from the pointed-to record.
  */
 int                                    /* error */
@@ -1878,7 +1910,7 @@ xfs_alloc_increment(
        int                     *stat)  /* success/failure */
 {
        xfs_alloc_block_t       *block; /* btree block */
-       xfs_buf_t                       *bp;    /* tree block buffer */
+       xfs_buf_t               *bp;    /* tree block buffer */
        int                     error;  /* error return value */
        int                     lev;    /* btree level */
 
@@ -1925,7 +1957,7 @@ xfs_alloc_increment(
                if (++cur->bc_ptrs[lev] <= INT_GET(block->bb_numrecs, ARCH_CONVERT))
                        break;
                /*
-                * Read-ahead the right block, we're going to read it 
+                * Read-ahead the right block, we're going to read it
                 * in the next loop.
                 */
                xfs_btree_readahead(cur, lev, XFS_BTCUR_RIGHTRA);