]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
libxfs: remove map from libxfs_readbufr_map
authorDave Chinner <dchinner@redhat.com>
Mon, 3 Feb 2014 00:11:11 +0000 (11:11 +1100)
committerDave Chinner <david@fromorbit.com>
Mon, 3 Feb 2014 00:11:11 +0000 (11:11 +1100)
The map passed in to libxfs_readbufr_map is used to check the buffer
matches the map. However, the repair readahead code has no map it
can use to validate the buffer it set up previously, so just get rid
of the map being passed in because it serves no useful purpose.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
db/io.c
include/libxfs.h
libxfs/rdwr.c

diff --git a/db/io.c b/db/io.c
index 123214d16e90f63f72bf9bdc2731d65947daff5d..d29816c43046c6b1cd78cd27bb67f916077f1578 100644 (file)
--- a/db/io.c
+++ b/db/io.c
@@ -449,9 +449,7 @@ write_cur_bbs(void)
 
 
        /* re-read buffer from disk */
-       ret = libxfs_readbufr_map(mp->m_ddev_targp, iocur_top->bp,
-                                 iocur_top->bbmap->b, iocur_top->bbmap->nmaps,
-                                 0);
+       ret = libxfs_readbufr_map(mp->m_ddev_targp, iocur_top->bp, 0);
        if (ret != 0)
                dbprintf(_("read error: %s\n"), strerror(ret));
 }
index 287241032104af29edcda5a5a25d6f4fb28d47b2..bb0369fc1a718974cf1f809602bedee8f3564931 100644 (file)
@@ -448,8 +448,7 @@ extern void libxfs_putbufr(xfs_buf_t *);
 extern int     libxfs_writebuf_int(xfs_buf_t *, int);
 extern int     libxfs_writebufr(struct xfs_buf *);
 extern int     libxfs_readbufr(struct xfs_buftarg *, xfs_daddr_t, xfs_buf_t *, int, int);
-extern int     libxfs_readbufr_map(struct xfs_buftarg *, struct xfs_buf *,
-                                   struct xfs_buf_map *, int, int);
+extern int     libxfs_readbufr_map(struct xfs_buftarg *, struct xfs_buf *, int);
 
 extern int libxfs_bhash_size;
 
index bf92788df20bebeda698f37fd29d1b707143b360..ac7739fc257aa91baaa5372ad0f1bff82a70f29d 100644 (file)
@@ -727,27 +727,19 @@ libxfs_readbuf(struct xfs_buftarg *btp, xfs_daddr_t blkno, int len, int flags,
 }
 
 int
-libxfs_readbufr_map(struct xfs_buftarg *btp, struct xfs_buf *bp,
-                   struct xfs_buf_map *map, int nmaps, int flags)
+libxfs_readbufr_map(struct xfs_buftarg *btp, struct xfs_buf *bp, int flags)
 {
        int     fd = libxfs_device_to_fd(btp->dev);
        int     error = 0;
        char    *buf;
        int     i;
 
-       ASSERT(BBTOB(len) <= bp->b_bcount);
-
-       ASSERT(bp->b_nmaps == nmaps);
-
        fd = libxfs_device_to_fd(btp->dev);
        buf = bp->b_addr;
        for (i = 0; i < bp->b_nmaps; i++) {
                off64_t offset = LIBXFS_BBTOOFF64(bp->b_map[i].bm_bn);
                int len = BBTOB(bp->b_map[i].bm_len);
 
-               ASSERT(bp->b_map[i].bm_bn == map[i].bm_bn);
-               ASSERT(bp->b_map[i].bm_len == map[i].bm_len);
-
                error = __read_buf(fd, buf, len, offset, flags);
                if (error) {
                        bp->b_error = error;
@@ -787,7 +779,7 @@ libxfs_readbuf_map(struct xfs_buftarg *btp, struct xfs_buf_map *map, int nmaps,
        if ((bp->b_flags & (LIBXFS_B_UPTODATE|LIBXFS_B_DIRTY)))
                return bp;
 
-       error = libxfs_readbufr_map(btp, bp, map, nmaps, flags);
+       error = libxfs_readbufr_map(btp, bp, flags);
        if (!error) {
                bp->b_flags |= LIBXFS_B_UPTODATE;
                if (bp->b_ops)