]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
libxfs: replace libxfs_putbuf with libxfs_buf_relse
authorDarrick J. Wong <darrick.wong@oracle.com>
Sun, 1 Mar 2020 17:33:38 +0000 (12:33 -0500)
committerEric Sandeen <sandeen@sandeen.net>
Sun, 1 Mar 2020 17:33:38 +0000 (12:33 -0500)
Change all the libxfs_putbuf calls to libxfs_buf_relse to match the
kernel interface, since one is a #define of the other.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
23 files changed:
copy/xfs_copy.c
db/fsmap.c
db/info.c
db/init.c
db/io.c
libxfs/init.c
libxfs/libxfs_api_defs.h
libxfs/libxfs_io.h
libxfs/libxfs_priv.h
libxfs/rdwr.c
libxfs/trans.c
repair/attr_repair.c
repair/da_util.c
repair/dino_chunks.c
repair/dinode.c
repair/dir2.c
repair/phase3.c
repair/phase6.c
repair/prefetch.c
repair/rmap.c
repair/rt.c
repair/scan.c
repair/xfs_repair.c

index 7f4615ac705aacc9563bad5466ac55cc7c5392c5..3e519471605b9a080778b12aeab57f1dc28f10d8 100644 (file)
@@ -716,12 +716,12 @@ main(int argc, char **argv)
        libxfs_sb_from_disk(sb, XFS_BUF_TO_SBP(sbp));
 
        /* Do it again, now with proper length and verifier */
-       libxfs_putbuf(sbp);
+       libxfs_buf_relse(sbp);
        libxfs_purgebuf(sbp);
        sbp = libxfs_readbuf(mbuf.m_ddev_targp, XFS_SB_DADDR,
                             1 << (sb->sb_sectlog - BBSHIFT),
                             0, &xfs_sb_buf_ops);
-       libxfs_putbuf(sbp);
+       libxfs_buf_relse(sbp);
 
        mp = libxfs_mount(&mbuf, sb, xargs.ddev, xargs.logdev, xargs.rtdev, 0);
        if (mp == NULL) {
index 29f3827c54c419ebbcf97a510a9ed0b2c06a473c..a6e61962df5f18a0519ab0a67a4b2cf3c5e59184 100644 (file)
@@ -75,7 +75,7 @@ fsmap(
 
                bt_cur = libxfs_rmapbt_init_cursor(mp, NULL, agbp, agno);
                if (!bt_cur) {
-                       libxfs_putbuf(agbp);
+                       libxfs_buf_relse(agbp);
                        dbprintf(_("Not enough memory.\n"));
                        return;
                }
@@ -85,14 +85,14 @@ fsmap(
                                fsmap_fn, &info);
                if (error) {
                        libxfs_btree_del_cursor(bt_cur, XFS_BTREE_ERROR);
-                       libxfs_putbuf(agbp);
+                       libxfs_buf_relse(agbp);
                        dbprintf(_("Error %d while querying fsmap btree.\n"),
                                error);
                        return;
                }
 
                libxfs_btree_del_cursor(bt_cur, XFS_BTREE_NOERROR);
-               libxfs_putbuf(agbp);
+               libxfs_buf_relse(agbp);
 
                if (agno == start_ag)
                        low.rm_startblock = 0;
index fc5ccfe753e270386e4cb30b5bd9d6f5a2953d39..5c941dc462081be9210742b7d4dc4f8980aedbfa 100644 (file)
--- a/db/info.c
+++ b/db/info.c
@@ -89,7 +89,7 @@ print_agresv_info(
        length = be32_to_cpu(agf->agf_length);
        free = be32_to_cpu(agf->agf_freeblks) +
               be32_to_cpu(agf->agf_flcount);
-       libxfs_putbuf(bp);
+       libxfs_buf_relse(bp);
 
        printf("AG %d: length: %u free: %u reserved: %u used: %u",
                        agno, length, free, ask, used);
index e5450d2b56ced89f1a166543a9b84a184520b4b3..15b4ec0c73ea0df6443d5f4e71e7c530f8f3c8db 100644 (file)
--- a/db/init.c
+++ b/db/init.c
@@ -123,7 +123,7 @@ init(
 
        /* copy SB from buffer to in-core, converting architecture as we go */
        libxfs_sb_from_disk(&xmount.m_sb, XFS_BUF_TO_SBP(bp));
-       libxfs_putbuf(bp);
+       libxfs_buf_relse(bp);
        libxfs_purgebuf(bp);
 
        sbp = &xmount.m_sb;
diff --git a/db/io.c b/db/io.c
index 6b66472ed28347e679b3319e60849143bfb9c578..a11b7bb1edea2d4fb6580d4ae56ebb1481b3278a 100644 (file)
--- a/db/io.c
+++ b/db/io.c
@@ -96,7 +96,7 @@ pop_cur(void)
                return;
        }
        if (iocur_top->bp) {
-               libxfs_putbuf(iocur_top->bp);
+               libxfs_buf_relse(iocur_top->bp);
                iocur_top->bp = NULL;
        }
        if (iocur_top->bbmap) {
index 5eeb58c84dcd6067d93c79577d81194784be3432..a30debe9bc7908c3d16a204ee9843d779f4b0f6e 100644 (file)
@@ -457,7 +457,7 @@ rtmount_init(
                        progname);
                return -1;
        }
-       libxfs_putbuf(bp);
+       libxfs_buf_relse(bp);
        return 0;
 }
 
@@ -737,7 +737,7 @@ libxfs_mount(
                if (!debugger)
                        return NULL;
        } else
-               libxfs_putbuf(bp);
+               libxfs_buf_relse(bp);
 
        if (mp->m_logdev_targp->dev &&
            mp->m_logdev_targp->dev != mp->m_ddev_targp->dev) {
@@ -752,7 +752,7 @@ libxfs_mount(
                                return NULL;
                }
                if (bp)
-                       libxfs_putbuf(bp);
+                       libxfs_buf_relse(bp);
        }
 
        /* Initialize realtime fields in the mount structure */
@@ -782,7 +782,7 @@ libxfs_mount(
                                                                progname);
                        sbp->sb_agcount = 1;
                }
-               libxfs_putbuf(bp);
+               libxfs_buf_relse(bp);
        }
 
        error = libxfs_initialize_perag(mp, sbp->sb_agcount, &mp->m_maxagi);
index 1a438e5867b5fa517c53c8ba7e4e5c7b3e21a74d..8bca7ddfa534e241ef774d22f9b38311f4e6f442 100644 (file)
@@ -44,6 +44,7 @@
 #define xfs_btree_del_cursor           libxfs_btree_del_cursor
 #define xfs_btree_init_block           libxfs_btree_init_block
 #define xfs_buf_delwri_submit          libxfs_buf_delwri_submit
+#define xfs_buf_relse                  libxfs_buf_relse
 #define xfs_bunmapi                    libxfs_bunmapi
 #define xfs_calc_dquots_per_chunk      libxfs_calc_dquots_per_chunk
 #define xfs_da3_node_hdr_from_disk     libxfs_da3_node_hdr_from_disk
index 716db5537dfabcb6d1dceb0596546cd73ac794ee..3ddfc0c83ee7d56ebd748c622d89a64c0df7af81 100644 (file)
@@ -148,7 +148,7 @@ extern struct cache_operations      libxfs_bcache_operations;
 #define libxfs_getbuf_flags(dev, daddr, len, flags) \
        libxfs_trace_getbuf_flags(__FUNCTION__, __FILE__, __LINE__, \
                            (dev), (daddr), (len), (flags))
-#define libxfs_putbuf(buf) \
+#define libxfs_buf_relse(buf) \
        libxfs_trace_putbuf(__FUNCTION__, __FILE__, __LINE__, (buf))
 
 extern xfs_buf_t *libxfs_trace_readbuf(const char *, const char *, int,
@@ -180,7 +180,7 @@ extern xfs_buf_t *libxfs_getbuf_map(struct xfs_buftarg *,
                        struct xfs_buf_map *, int, int);
 extern xfs_buf_t *libxfs_getbuf_flags(struct xfs_buftarg *, xfs_daddr_t,
                        int, unsigned int);
-extern void    libxfs_putbuf (xfs_buf_t *);
+void   libxfs_buf_relse(struct xfs_buf *bp);
 
 #endif
 
index fe08f96bfa59379e5a06189afb906b802608863f..4bd3c462cf1c674e7189fcf9f67538f7dd0235ee 100644 (file)
@@ -377,7 +377,6 @@ roundup_64(uint64_t x, uint32_t y)
        (len) = __bar; /* no set-but-unused warning */  \
        NULL;                                           \
 })
-#define xfs_buf_relse(bp)              libxfs_putbuf(bp)
 #define xfs_buf_get(devp,blkno,len)    (libxfs_getbuf((devp), (blkno), (len)))
 #define xfs_bwrite(bp)                 libxfs_writebuf((bp), 0)
 #define xfs_buf_oneshot(bp)            ((void) 0)
index ba16ad4de3277af098d2c75bb1c2638a56d7359c..a7f9c327494a8f000c81aef8c52e0fddf423bfaa 100644 (file)
@@ -48,7 +48,7 @@
  *
  * The result of this is that until the userspace code outside libxfs is cleaned
  * up, functions that release buffers from userspace control (i.e
- * libxfs_writebuf/libxfs_putbuf) need to zero bp->b_error to prevent
+ * libxfs_writebuf/libxfs_buf_relse) need to zero bp->b_error to prevent
  * propagation of stale errors into future buffer operations.
  */
 
@@ -394,7 +394,6 @@ libxfs_log_header(
 #undef libxfs_getbuf
 #undef libxfs_getbuf_map
 #undef libxfs_getbuf_flags
-#undef libxfs_putbuf
 
 xfs_buf_t      *libxfs_readbuf(struct xfs_buftarg *, xfs_daddr_t, int, int,
                                const struct xfs_buf_ops *);
@@ -406,7 +405,7 @@ xfs_buf_t   *libxfs_getbuf_map(struct xfs_buftarg *, struct xfs_buf_map *,
                                int, int);
 xfs_buf_t      *libxfs_getbuf_flags(struct xfs_buftarg *, xfs_daddr_t, int,
                                unsigned int);
-void           libxfs_putbuf (xfs_buf_t *);
+void           libxfs_buf_relse(struct xfs_buf *bp);
 
 #define        __add_trace(bp, func, file, line)       \
 do {                                           \
@@ -476,7 +475,7 @@ void
 libxfs_trace_putbuf(const char *func, const char *file, int line, xfs_buf_t *bp)
 {
        __add_trace(bp, func, file, line);
-       libxfs_putbuf(bp);
+       libxfs_buf_relse(bp);
 }
 
 
@@ -851,7 +850,8 @@ libxfs_getbuf_map(struct xfs_buftarg *btp, struct xfs_buf_map *map,
 }
 
 void
-libxfs_putbuf(xfs_buf_t *bp)
+libxfs_buf_relse(
+       struct xfs_buf  *bp)
 {
        /*
         * ensure that any errors on this use of the buffer don't carry
@@ -1190,7 +1190,7 @@ libxfs_writebuf(xfs_buf_t *bp, int flags)
        bp->b_error = 0;
        bp->b_flags &= ~LIBXFS_B_STALE;
        bp->b_flags |= (LIBXFS_B_DIRTY | flags);
-       libxfs_putbuf(bp);
+       libxfs_buf_relse(bp);
        return 0;
 }
 
@@ -1527,7 +1527,7 @@ xfs_buf_delwri_submit(
                error2 = libxfs_writebufr(bp);
                if (!error)
                        error = error2;
-               libxfs_putbuf(bp);
+               libxfs_buf_relse(bp);
        }
 
        return error;
index 18b87d705ccae5c7525af94fd572e78eb11b0772..59cb897f306b793ea594a39724c6553379e20bca 100644 (file)
@@ -566,7 +566,7 @@ libxfs_trans_brelse(
        ASSERT(bp->b_transp == tp);
 
        if (!tp) {
-               libxfs_putbuf(bp);
+               libxfs_buf_relse(bp);
                return;
        }
 
@@ -602,7 +602,7 @@ libxfs_trans_brelse(
        xfs_buf_item_put(bip);
 
        bp->b_transp = NULL;
-       libxfs_putbuf(bp);
+       libxfs_buf_relse(bp);
 }
 
 /*
@@ -839,7 +839,7 @@ inode_item_done(
        if (error) {
                fprintf(stderr, _("%s: warning - iflush_int failed (%d)\n"),
                        progname, error);
-               libxfs_putbuf(bp);
+               libxfs_buf_relse(bp);
                goto free;
        }
 
@@ -868,7 +868,7 @@ buf_item_done(
        xfs_buf_item_put(bip);
        if (hold)
                return;
-       libxfs_putbuf(bp);
+       libxfs_buf_relse(bp);
 }
 
 static void
@@ -906,7 +906,7 @@ buf_item_unlock(
        bip->bli_flags &= ~XFS_BLI_HOLD;
        xfs_buf_item_put(bip);
        if (!hold)
-               libxfs_putbuf(bp);
+               libxfs_buf_relse(bp);
 }
 
 static void
index 688a7e56f7a32cb90baef63695eaa3c059964a0e..c63721ca3c851169f036e173555173e113bc65ea 100644 (file)
@@ -418,7 +418,7 @@ rmtval_get(xfs_mount_t *mp, xfs_ino_t ino, blkmap_t *blkmap,
                if (bp->b_error == -EFSBADCRC || bp->b_error == -EFSCORRUPTED) {
                        do_warn(
        _("Corrupt remote block for attributes of inode %" PRIu64 "\n"), ino);
-                       libxfs_putbuf(bp);
+                       libxfs_buf_relse(bp);
                        clearit = 1;
                        break;
                }
@@ -430,7 +430,7 @@ rmtval_get(xfs_mount_t *mp, xfs_ino_t ino, blkmap_t *blkmap,
                amountdone += length;
                value += length;
                i++;
-               libxfs_putbuf(bp);
+               libxfs_buf_relse(bp);
        }
        return (clearit);
 }
@@ -782,7 +782,7 @@ process_leaf_attr_level(xfs_mount_t *mp,
                        do_warn(
        _("bad attribute leaf magic %#x for inode %" PRIu64 "\n"),
                                 leafhdr.magic, ino);
-                       libxfs_putbuf(bp);
+                       libxfs_buf_relse(bp);
                        goto error_out;
                }
 
@@ -793,7 +793,7 @@ process_leaf_attr_level(xfs_mount_t *mp,
                if (process_leaf_attr_block(mp, leaf, da_bno, ino,
                                da_cursor->blkmap, current_hashval,
                                &greatest_hashval, &repair))  {
-                       libxfs_putbuf(bp);
+                       libxfs_buf_relse(bp);
                        goto error_out;
                }
 
@@ -813,7 +813,7 @@ process_leaf_attr_level(xfs_mount_t *mp,
                        do_warn(
        _("bad sibling back pointer for block %u in attribute fork for inode %" PRIu64 "\n"),
                                da_bno, ino);
-                       libxfs_putbuf(bp);
+                       libxfs_buf_relse(bp);
                        goto error_out;
                }
 
@@ -822,7 +822,7 @@ process_leaf_attr_level(xfs_mount_t *mp,
 
                if (da_bno != 0) {
                        if (verify_da_path(mp, da_cursor, 0, XFS_ATTR_FORK)) {
-                               libxfs_putbuf(bp);
+                               libxfs_buf_relse(bp);
                                goto error_out;
                        }
                }
@@ -838,7 +838,7 @@ process_leaf_attr_level(xfs_mount_t *mp,
                if (repair && !no_modify)
                        libxfs_writebuf(bp, 0);
                else
-                       libxfs_putbuf(bp);
+                       libxfs_buf_relse(bp);
        } while (da_bno != 0);
 
        if (verify_final_da_path(mp, da_cursor, 0, XFS_ATTR_FORK))  {
@@ -992,7 +992,7 @@ _("would clear forw/back pointers in block 0 for attributes in inode %" PRIu64 "
        if (badness) {
                *repair = 0;
                /* the block is bad.  lose the attribute fork. */
-               libxfs_putbuf(bp);
+               libxfs_buf_relse(bp);
                return 1;
        }
 
@@ -1001,7 +1001,7 @@ _("would clear forw/back pointers in block 0 for attributes in inode %" PRIu64 "
        if (*repair && !no_modify)
                libxfs_writebuf(bp, 0);
        else
-               libxfs_putbuf(bp);
+               libxfs_buf_relse(bp);
 
        return 0;
 }
@@ -1045,7 +1045,7 @@ _("would clear forw/back pointers in block 0 for attributes in inode %" PRIu64 "
                *repair = 1;
                libxfs_writebuf(bp, 0);
        } else
-               libxfs_putbuf(bp);
+               libxfs_buf_relse(bp);
        error = process_node_attr(mp, ino, dip, blkmap); /* + repair */
        if (error)
                *repair = 0;
@@ -1107,7 +1107,7 @@ process_longform_attr(
        /* is this block sane? */
        if (__check_attr_header(mp, bp, ino)) {
                *repair = 0;
-               libxfs_putbuf(bp);
+               libxfs_buf_relse(bp);
                return 1;
        }
 
@@ -1130,7 +1130,7 @@ process_longform_attr(
                do_warn(
        _("bad attribute leaf magic # %#x for dir ino %" PRIu64 "\n"),
                        be16_to_cpu(info->magic), ino);
-               libxfs_putbuf(bp);
+               libxfs_buf_relse(bp);
                *repair = 0;
                return 1;
        }
index bf25f7f2a969cdfe462154e65775544d33031bab..c02d621c728d8534d946ee32fdf3800bf9bf3f3d 100644 (file)
@@ -145,7 +145,7 @@ _("found non-root LEAFN node in inode %" PRIu64 " bno = %u\n"),
                                        da_cursor->ino, bno);
                        }
                        *rbno = 0;
-                       libxfs_putbuf(bp);
+                       libxfs_buf_relse(bp);
                        return 1;
                }
 
@@ -155,13 +155,13 @@ _("found non-root LEAFN node in inode %" PRIu64 " bno = %u\n"),
 _("bad %s magic number 0x%x in inode %" PRIu64 " bno = %u\n"),
                                        FORKNAME(whichfork), nodehdr.magic,
                                        da_cursor->ino, bno);
-                       libxfs_putbuf(bp);
+                       libxfs_buf_relse(bp);
                        goto error_out;
                }
 
                /* corrupt node; rebuild the dir. */
                if (bp->b_error == -EFSBADCRC || bp->b_error == -EFSCORRUPTED) {
-                       libxfs_putbuf(bp);
+                       libxfs_buf_relse(bp);
                        do_warn(
 _("corrupt %s tree block %u for inode %" PRIu64 "\n"),
                                FORKNAME(whichfork), bno, da_cursor->ino);
@@ -173,7 +173,7 @@ _("corrupt %s tree block %u for inode %" PRIu64 "\n"),
 _("bad %s record count in inode %" PRIu64 ", count = %d, max = %d\n"),
                                FORKNAME(whichfork), da_cursor->ino,
                                nodehdr.count, geo->node_ents);
-                       libxfs_putbuf(bp);
+                       libxfs_buf_relse(bp);
                        goto error_out;
                }
 
@@ -186,7 +186,7 @@ _("bad %s record count in inode %" PRIu64 ", count = %d, max = %d\n"),
                                do_warn(
 _("bad header depth for directory inode %" PRIu64 "\n"),
                                        da_cursor->ino);
-                               libxfs_putbuf(bp);
+                               libxfs_buf_relse(bp);
                                i = -1;
                                goto error_out;
                        }
@@ -197,7 +197,7 @@ _("bad header depth for directory inode %" PRIu64 "\n"),
                                do_warn(
 _("bad %s btree for inode %" PRIu64 "\n"),
                                        FORKNAME(whichfork), da_cursor->ino);
-                               libxfs_putbuf(bp);
+                               libxfs_buf_relse(bp);
                                goto error_out;
                        }
                }
@@ -222,7 +222,7 @@ _("bad %s btree for inode %" PRIu64 "\n"),
 
 error_out:
        while (i > 1 && i <= da_cursor->active) {
-               libxfs_putbuf(da_cursor->level[i].bp);
+               libxfs_buf_relse(da_cursor->level[i].bp);
                i++;
        }
 
@@ -252,7 +252,7 @@ release_da_cursor_int(
                }
                ASSERT(error != 0);
 
-               libxfs_putbuf(cursor->level[level].bp);
+               libxfs_buf_relse(cursor->level[level].bp);
                cursor->level[level].bp = NULL;
        }
 
@@ -406,7 +406,7 @@ _("would correct bad hashval in non-leaf %s block\n"
        if (cursor->level[this_level].dirty && !no_modify)
                libxfs_writebuf(cursor->level[this_level].bp, 0);
        else
-               libxfs_putbuf(cursor->level[this_level].bp);
+               libxfs_buf_relse(cursor->level[this_level].bp);
 
        cursor->level[this_level].bp = NULL;
 
@@ -600,7 +600,7 @@ _("bad level %d in %s block %u for inode %" PRIu64 "\n"),
 #ifdef XR_DIR_TRACE
                        fprintf(stderr, "verify_da_path returns 1 (bad) #4\n");
 #endif
-                       libxfs_putbuf(bp);
+                       libxfs_buf_relse(bp);
                        return 1;
                }
 
@@ -622,7 +622,7 @@ _("bad level %d in %s block %u for inode %" PRIu64 "\n"),
                if (cursor->level[this_level].dirty && !no_modify)
                        libxfs_writebuf(cursor->level[this_level].bp, 0);
                else
-                       libxfs_putbuf(cursor->level[this_level].bp);
+                       libxfs_buf_relse(cursor->level[this_level].bp);
 
                /* switch cursor to point at the new buffer we just read */
                cursor->level[this_level].bp = bp;
index dbf3d37a675432292e5703ba6fe7762f862fd558..863c4531530a03349609a80233e25a0fadff2344 100644 (file)
@@ -56,7 +56,7 @@ check_aginode_block(xfs_mount_t       *mp,
        if (cnt)
                bp->b_ops = &xfs_inode_buf_ops;
 
-       libxfs_putbuf(bp);
+       libxfs_buf_relse(bp);
        return(cnt);
 }
 
@@ -670,7 +670,7 @@ process_inode_chunk(
                                        M_IGEO(mp)->blocks_per_cluster));
                        while (bp_index > 0) {
                                bp_index--;
-                               libxfs_putbuf(bplist[bp_index]);
+                               libxfs_buf_relse(bplist[bp_index]);
                        }
                        free(bplist);
                        return(1);
@@ -759,7 +759,7 @@ next_readbuf:
                        *bogus = 1;
                        for (bp_index = 0; bp_index < cluster_count; bp_index++)
                                if (bplist[bp_index])
-                                       libxfs_putbuf(bplist[bp_index]);
+                                       libxfs_buf_relse(bplist[bp_index]);
                        free(bplist);
                        return(0);
                }
@@ -942,7 +942,7 @@ process_next:
                                if (dirty && !no_modify)
                                        libxfs_writebuf(bplist[bp_index], 0);
                                else
-                                       libxfs_putbuf(bplist[bp_index]);
+                                       libxfs_buf_relse(bplist[bp_index]);
                        }
                        free(bplist);
                        break;
index 3ee76ea324c12be65606c0e27e6523f53352ed3b..2c6621d590ca3ec76adaa1bb3118fe30e2a58a5e 100644 (file)
@@ -1234,7 +1234,7 @@ bad:
                if (writebuf && !no_modify)
                        libxfs_writebuf(bp, 0);
                else
-                       libxfs_putbuf(bp);
+                       libxfs_buf_relse(bp);
        }
        return 0;
 }
@@ -1296,7 +1296,7 @@ _("cannot read inode %" PRIu64 ", file block %d, disk block %" PRIu64 "\n"),
                        do_warn(
 _("Corrupt symlink remote block %" PRIu64 ", inode %" PRIu64 ".\n"),
                                fsbno, lino);
-                       libxfs_putbuf(bp);
+                       libxfs_buf_relse(bp);
                        return 1;
                }
                if (bp->b_error == -EFSBADCRC) {
@@ -1316,7 +1316,7 @@ _("Bad symlink buffer CRC, block %" PRIu64 ", inode %" PRIu64 ".\n"
                                do_warn(
 _("bad symlink header ino %" PRIu64 ", file block %d, disk block %" PRIu64 "\n"),
                                        lino, i, fsbno);
-                               libxfs_putbuf(bp);
+                               libxfs_buf_relse(bp);
                                return 1;
                        }
                        src += sizeof(struct xfs_dsymlink_hdr);
@@ -1331,7 +1331,7 @@ _("bad symlink header ino %" PRIu64 ", file block %d, disk block %" PRIu64 "\n")
                if (badcrc && !no_modify)
                        libxfs_writebuf(bp, 0);
                else
-                       libxfs_putbuf(bp);
+                       libxfs_buf_relse(bp);
        }
        return 0;
 }
index 723aee1fea56ef6157f353cd72684c6324f0bf2a..769e341c684d0bf211f90387d4a2b3ee08d2fede 100644 (file)
@@ -1012,7 +1012,7 @@ _("bad directory block magic # %#x in block %u for directory inode %" PRIu64 "\n
                *repair = 1;
                libxfs_writebuf(bp, 0);
        } else
-               libxfs_putbuf(bp);
+               libxfs_buf_relse(bp);
        return rval;
 }
 
@@ -1131,7 +1131,7 @@ _("can't read file block %u for directory inode %" PRIu64 "\n"),
                        do_warn(
 _("bad directory leaf magic # %#x for directory inode %" PRIu64 " block %u\n"),
                                leafhdr.magic, ino, da_bno);
-                       libxfs_putbuf(bp);
+                       libxfs_buf_relse(bp);
                        goto error_out;
                }
                buf_dirty = 0;
@@ -1141,7 +1141,7 @@ _("bad directory leaf magic # %#x for directory inode %" PRIu64 " block %u\n"),
                 */
                if (process_leaf_block_dir2(mp, leaf, da_bno, ino,
                                current_hashval, &greatest_hashval)) {
-                       libxfs_putbuf(bp);
+                       libxfs_buf_relse(bp);
                        goto error_out;
                }
                /*
@@ -1159,14 +1159,14 @@ _("bad directory leaf magic # %#x for directory inode %" PRIu64 " block %u\n"),
                        do_warn(
 _("bad sibling back pointer for block %u in directory inode %" PRIu64 "\n"),
                                da_bno, ino);
-                       libxfs_putbuf(bp);
+                       libxfs_buf_relse(bp);
                        goto error_out;
                }
                prev_bno = da_bno;
                da_bno = leafhdr.forw;
                if (da_bno != 0) {
                        if (verify_da_path(mp, da_cursor, 0, XFS_DATA_FORK)) {
-                               libxfs_putbuf(bp);
+                               libxfs_buf_relse(bp);
                                goto error_out;
                        }
                }
@@ -1182,7 +1182,7 @@ _("bad sibling back pointer for block %u in directory inode %" PRIu64 "\n"),
                        *repair = 1;
                        libxfs_writebuf(bp, 0);
                } else
-                       libxfs_putbuf(bp);
+                       libxfs_buf_relse(bp);
        } while (da_bno != 0);
        if (verify_final_da_path(mp, da_cursor, 0, XFS_DATA_FORK)) {
                /*
@@ -1341,7 +1341,7 @@ _("bad directory block magic # %#x in block %" PRIu64 " for directory inode %" P
                        *repair = 1;
                        libxfs_writebuf(bp, 0);
                } else
-                       libxfs_putbuf(bp);
+                       libxfs_buf_relse(bp);
        }
        if (good == 0)
                return 1;
index 161852e0bca642540efa411da9f6e711258df21c..1c6929acb35c4d436c15f524fbd48e42a9f5dd33 100644 (file)
@@ -49,7 +49,7 @@ process_agi_unlinked(
        if (agi_dirty)
                libxfs_writebuf(bp, 0);
        else
-               libxfs_putbuf(bp);
+               libxfs_buf_relse(bp);
 }
 
 static void
index 7bbc6da21b8c3513d1a0fc6840b8a2b03a2b7263..3fb1af248f79e563295c24e117f8ad98be33ef8e 100644 (file)
@@ -1624,7 +1624,7 @@ longform_dir2_entry_check_data(
                        dir2_kill_block(mp, ip, da_bno, bp);
                } else {
                        do_warn(_("would junk block\n"));
-                       libxfs_putbuf(bp);
+                       libxfs_buf_relse(bp);
                }
                freetab->ents[db].v = NULLDATAOFF;
                *bpp = NULL;
@@ -2063,21 +2063,21 @@ longform_dir2_check_leaf(
                do_warn(
        _("leaf block %u for directory inode %" PRIu64 " bad header\n"),
                        da_bno, ip->i_ino);
-               libxfs_putbuf(bp);
+               libxfs_buf_relse(bp);
                return 1;
        }
 
        if (leafhdr.magic == XFS_DIR3_LEAF1_MAGIC) {
                error = check_da3_header(mp, bp, ip->i_ino);
                if (error) {
-                       libxfs_putbuf(bp);
+                       libxfs_buf_relse(bp);
                        return error;
                }
        }
 
        seeval = dir_hash_see_all(hashtab, ents, leafhdr.count, leafhdr.stale);
        if (dir_hash_check(hashtab, ip, seeval)) {
-               libxfs_putbuf(bp);
+               libxfs_buf_relse(bp);
                return 1;
        }
        badtail = freetab->nents != be32_to_cpu(ltp->bestcount);
@@ -2089,10 +2089,10 @@ longform_dir2_check_leaf(
                do_warn(
        _("leaf block %u for directory inode %" PRIu64 " bad tail\n"),
                        da_bno, ip->i_ino);
-               libxfs_putbuf(bp);
+               libxfs_buf_relse(bp);
                return 1;
        }
-       libxfs_putbuf(bp);
+       libxfs_buf_relse(bp);
        return fixit;
 }
 
@@ -2155,7 +2155,7 @@ longform_dir2_check_node(
                        do_warn(
        _("unknown magic number %#x for block %u in directory inode %" PRIu64 "\n"),
                                leafhdr.magic, da_bno, ip->i_ino);
-                       libxfs_putbuf(bp);
+                       libxfs_buf_relse(bp);
                        return 1;
                }
 
@@ -2164,7 +2164,7 @@ longform_dir2_check_node(
                    leafhdr.magic == XFS_DA3_NODE_MAGIC) {
                        error = check_da3_header(mp, bp, ip->i_ino);
                        if (error) {
-                               libxfs_putbuf(bp);
+                               libxfs_buf_relse(bp);
                                return error;
                        }
                }
@@ -2172,7 +2172,7 @@ longform_dir2_check_node(
                /* ignore nodes */
                if (leafhdr.magic == XFS_DA_NODE_MAGIC ||
                    leafhdr.magic == XFS_DA3_NODE_MAGIC) {
-                       libxfs_putbuf(bp);
+                       libxfs_buf_relse(bp);
                        continue;
                }
 
@@ -2186,12 +2186,12 @@ longform_dir2_check_node(
                        do_warn(
        _("leaf block %u for directory inode %" PRIu64 " bad header\n"),
                                da_bno, ip->i_ino);
-                       libxfs_putbuf(bp);
+                       libxfs_buf_relse(bp);
                        return 1;
                }
                seeval = dir_hash_see_all(hashtab, ents,
                                        leafhdr.count, leafhdr.stale);
-               libxfs_putbuf(bp);
+               libxfs_buf_relse(bp);
                if (seeval != DIR_HASH_CK_OK)
                        return 1;
        }
@@ -2226,14 +2226,14 @@ longform_dir2_check_node(
                        do_warn(
        _("free block %u for directory inode %" PRIu64 " bad header\n"),
                                da_bno, ip->i_ino);
-                       libxfs_putbuf(bp);
+                       libxfs_buf_relse(bp);
                        return 1;
                }
 
                if (freehdr.magic == XFS_DIR3_FREE_MAGIC) {
                        error = check_dir3_header(mp, bp, ip->i_ino);
                        if (error) {
-                               libxfs_putbuf(bp);
+                               libxfs_buf_relse(bp);
                                return error;
                        }
                }
@@ -2244,7 +2244,7 @@ longform_dir2_check_node(
                                do_warn(
        _("free block %u entry %i for directory ino %" PRIu64 " bad\n"),
                                        da_bno, i, ip->i_ino);
-                               libxfs_putbuf(bp);
+                               libxfs_buf_relse(bp);
                                return 1;
                        }
                        used += be16_to_cpu(bests[i]) != NULLDATAOFF;
@@ -2254,10 +2254,10 @@ longform_dir2_check_node(
                        do_warn(
        _("free block %u for directory inode %" PRIu64 " bad nused\n"),
                                da_bno, ip->i_ino);
-                       libxfs_putbuf(bp);
+                       libxfs_buf_relse(bp);
                        return 1;
                }
-               libxfs_putbuf(bp);
+               libxfs_buf_relse(bp);
        }
        for (i = 0; i < freetab->nents; i++) {
                if ((freetab->ents[i].s == 0) &&
@@ -2433,14 +2433,14 @@ out_fix:
                dir_hash_dup_names(hashtab);
                for (i = 0; i < num_bps; i++)
                        if (bplist[i])
-                               libxfs_putbuf(bplist[i]);
+                               libxfs_buf_relse(bplist[i]);
                longform_dir2_rebuild(mp, ino, ip, irec, ino_offset, hashtab);
                *num_illegal = 0;
                *need_dot = 0;
        } else {
                for (i = 0; i < num_bps; i++)
                        if (bplist[i])
-                               libxfs_putbuf(bplist[i]);
+                               libxfs_buf_relse(bplist[i]);
        }
 
        free(bplist);
index 8e3772ed16f32b04aaba7aff4b12e2d06b906465..f7ea9c8f824df913e341c2bb0a56cd499953c6b3 100644 (file)
@@ -129,7 +129,7 @@ pf_queue_io(
                        pf_read_inode_dirs(args, bp);
                XFS_BUF_SET_PRIORITY(bp, XFS_BUF_PRIORITY(bp) +
                                                CACHE_PREFETCH_PRIORITY);
-               libxfs_putbuf(bp);
+               libxfs_buf_relse(bp);
                return;
        }
        XFS_BUF_SET_PRIORITY(bp, flag);
@@ -286,13 +286,13 @@ pf_scan_lbtree(
         */
        if (bp->b_error) {
                bp->b_flags |= LIBXFS_B_UNCHECKED;
-               libxfs_putbuf(bp);
+               libxfs_buf_relse(bp);
                return 0;
        }
 
        rc = (*func)(XFS_BUF_TO_BLOCK(bp), level - 1, isadir, args);
 
-       libxfs_putbuf(bp);
+       libxfs_buf_relse(bp);
 
        return rc;
 }
@@ -578,7 +578,7 @@ pf_batch_read(
                if ((bplist[num - 1]->b_flags & LIBXFS_B_DISCONTIG)) {
                        libxfs_readbufr_map(mp->m_ddev_targp, bplist[num - 1], 0);
                        bplist[num - 1]->b_flags |= LIBXFS_B_UNCHECKED;
-                       libxfs_putbuf(bplist[num - 1]);
+                       libxfs_buf_relse(bplist[num - 1]);
                        num--;
                }
 
@@ -612,7 +612,7 @@ pf_batch_read(
                                B_IS_INODE(XFS_BUF_PRIORITY(bplist[i])) ? 'I' : 'M',
                                bplist[i], (long long)XFS_BUF_ADDR(bplist[i]),
                                args->agno);
-                       libxfs_putbuf(bplist[i]);
+                       libxfs_buf_relse(bplist[i]);
                }
                pthread_mutex_lock(&args->lock);
                if (which != PF_SECONDARY) {
index 2f99d35ddd02e694ebbdaa5f8421115c80b0ead4..bc53e6c07cde6b9ff7465bef4bfeea8f140f58a1 100644 (file)
@@ -527,7 +527,7 @@ rmap_store_ag_btree_rec(
                }
                b++;
        }
-       libxfs_putbuf(agflbp);
+       libxfs_buf_relse(agflbp);
        agflbp = NULL;
        bitmap_free(&own_ag_bitmap);
 
@@ -579,7 +579,7 @@ err_slab:
        free_slab_cursor(&rm_cur);
 err:
        if (agflbp)
-               libxfs_putbuf(agflbp);
+               libxfs_buf_relse(agflbp);
        if (own_ag_bitmap)
                bitmap_free(&own_ag_bitmap);
        return error;
@@ -1082,7 +1082,7 @@ err:
        if (bt_cur)
                libxfs_btree_del_cursor(bt_cur, XFS_BTREE_NOERROR);
        if (agbp)
-               libxfs_putbuf(agbp);
+               libxfs_buf_relse(agbp);
        free_slab_cursor(&rm_cur);
        return 0;
 }
@@ -1417,7 +1417,7 @@ err:
                libxfs_btree_del_cursor(bt_cur, error ? XFS_BTREE_ERROR :
                                                        XFS_BTREE_NOERROR);
        if (agbp)
-               libxfs_putbuf(agbp);
+               libxfs_buf_relse(agbp);
        free_slab_cursor(&rl_cur);
        return 0;
 }
index 7108e3d52ecac0debcf351d1fe97fd5cbbb351f7..3319829ce5574fee326ea14862808a6c2d57e40c 100644 (file)
@@ -222,7 +222,7 @@ process_rtbitmap(xfs_mount_t        *mp,
                                prevbit = 0;
                        }
                }
-               libxfs_putbuf(bp);
+               libxfs_buf_relse(bp);
                if (extno == mp->m_sb.sb_rextents)
                        break;
        }
@@ -266,7 +266,7 @@ process_rtsummary(xfs_mount_t       *mp,
                bytes = bp->b_un.b_addr;
                memmove((char *)sumfile + sumbno * mp->m_sb.sb_blocksize, bytes,
                        mp->m_sb.sb_blocksize);
-               libxfs_putbuf(bp);
+               libxfs_buf_relse(bp);
        }
 }
 #endif
index 34dcb22aec2cedb57a09bdf4f3200c6808862cbc..1caab676ba5ed1afdf913b24c78a806784dbbfd7 100644 (file)
@@ -82,7 +82,7 @@ scan_sbtree(
 
        (*func)(XFS_BUF_TO_BLOCK(bp), nlevels - 1, root, agno, suspect,
                        isroot, magic, priv, ops);
-       libxfs_putbuf(bp);
+       libxfs_buf_relse(bp);
 }
 
 /*
@@ -154,7 +154,7 @@ scan_lbtree(
        if ((dirty || badcrc) && !no_modify)
                libxfs_writebuf(bp, 0);
        else
-               libxfs_putbuf(bp);
+               libxfs_buf_relse(bp);
 
        return(err);
 }
@@ -2138,7 +2138,7 @@ scan_freelist(
 
        agcnts->fdblocks += state.count;
 
-       libxfs_putbuf(agflbuf);
+       libxfs_buf_relse(agflbuf);
 }
 
 static void
@@ -2428,12 +2428,12 @@ scan_ag(
        if (agi_dirty && !no_modify)
                libxfs_writebuf(agibuf, 0);
        else
-               libxfs_putbuf(agibuf);
+               libxfs_buf_relse(agibuf);
 
        if (agf_dirty && !no_modify)
                libxfs_writebuf(agfbuf, 0);
        else
-               libxfs_putbuf(agfbuf);
+               libxfs_buf_relse(agfbuf);
 
        if (sb_dirty && !no_modify) {
                if (agno == 0)
@@ -2441,7 +2441,7 @@ scan_ag(
                libxfs_sb_to_disk(XFS_BUF_TO_SBP(sbbuf), sb);
                libxfs_writebuf(sbbuf, 0);
        } else
-               libxfs_putbuf(sbbuf);
+               libxfs_buf_relse(sbbuf);
        free(sb);
        PROG_RPT_INC(prog_rpt_done[agno], 1);
 
@@ -2451,11 +2451,11 @@ scan_ag(
        return;
 
 out_free_agibuf:
-       libxfs_putbuf(agibuf);
+       libxfs_buf_relse(agibuf);
 out_free_agfbuf:
-       libxfs_putbuf(agfbuf);
+       libxfs_buf_relse(agfbuf);
 out_free_sbbuf:
-       libxfs_putbuf(sbbuf);
+       libxfs_buf_relse(sbbuf);
 out_free_sb:
        free(sb);
 
index 6b4635349a370b8b94a1a4517ebbadfe7395bb33..ebd631e719d6bacd8dd6914db5844b7193cdc87e 100644 (file)
@@ -479,7 +479,7 @@ guess_correct_sunit(
                if (error)
                        continue;
                libxfs_sb_from_disk(&sb, XFS_BUF_TO_SBP(bp));
-               libxfs_putbuf(bp);
+               libxfs_buf_relse(bp);
 
                calc_rootino = libxfs_ialloc_calc_rootino(mp, sb.sb_unit);
                if (calc_rootino == mp->m_sb.sb_rootino)