From 6d5e5ee04e1cbf72c2920fafb7ffbc8f4592018c Mon Sep 17 00:00:00 2001 From: Dave Chinner Date: Mon, 3 Feb 2014 11:11:11 +1100 Subject: [PATCH] libxfs: remove map from libxfs_readbufr_map 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 Reviewed-by: Brian Foster Signed-off-by: Dave Chinner --- db/io.c | 4 +--- include/libxfs.h | 3 +-- libxfs/rdwr.c | 12 ++---------- 3 files changed, 4 insertions(+), 15 deletions(-) diff --git a/db/io.c b/db/io.c index 123214d16..d29816c43 100644 --- 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)); } diff --git a/include/libxfs.h b/include/libxfs.h index 287241032..bb0369fc1 100644 --- a/include/libxfs.h +++ b/include/libxfs.h @@ -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; diff --git a/libxfs/rdwr.c b/libxfs/rdwr.c index bf92788df..ac7739fc2 100644 --- a/libxfs/rdwr.c +++ b/libxfs/rdwr.c @@ -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) -- 2.47.2