From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id F28707F5E for ; Wed, 22 Jan 2014 01:17:25 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 882F5AC002 for ; Tue, 21 Jan 2014 23:17:22 -0800 (PST) Received: from ipmail04.adl6.internode.on.net (ipmail04.adl6.internode.on.net [150.101.137.141]) by cuda.sgi.com with ESMTP id 7nV3xpwH2r2QVZNm for ; Tue, 21 Jan 2014 23:17:21 -0800 (PST) Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.76) (envelope-from ) id 1W5s3p-0001YP-L5 for xfs@oss.sgi.com; Wed, 22 Jan 2014 18:17:17 +1100 Received: from dave by disappointment with local (Exim 4.80) (envelope-from ) id 1W5s3p-0002jy-KJ for xfs@oss.sgi.com; Wed, 22 Jan 2014 18:17:17 +1100 From: Dave Chinner Subject: [PATCH 2/3] libxfs: remove map from libxfs_readbufr_map Date: Wed, 22 Jan 2014 18:17:12 +1100 Message-Id: <1390375033-10483-3-git-send-email-david@fromorbit.com> In-Reply-To: <1390375033-10483-1-git-send-email-david@fromorbit.com> References: <1390375033-10483-1-git-send-email-david@fromorbit.com> List-Id: XFS Filesystem from SGI List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: xfs-bounces@oss.sgi.com Sender: xfs-bounces@oss.sgi.com To: xfs@oss.sgi.com From: Dave Chinner 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 --- 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 123214d..d29816c 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 2872410..bb0369f 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 bf92788..ac7739f 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) -- 1.8.4.rc3 _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs