From patchwork Thu Mar 12 14:17:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 11434325 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 015AC913 for ; Thu, 12 Mar 2020 14:17:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CD70320716 for ; Thu, 12 Mar 2020 14:17:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="NkowLNsn" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727439AbgCLORW (ORCPT ); Thu, 12 Mar 2020 10:17:22 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:44520 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727123AbgCLORW (ORCPT ); Thu, 12 Mar 2020 10:17:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:To:From:Sender: Reply-To:Cc:Content-Type:Content-ID:Content-Description; bh=4m9FLaCArzISyi2qBpyZ7VpxlqiV93ufgBI05+NM4es=; b=NkowLNsnp8TuT3L9znAoQEvdDx DLNk7KDoJKoRlv6bO0PROkxoNySTVBhviTDO29c5QDiWA54kkfEvmOpk3gV5g1g9kAKAipQkcI9gz 3ce7Q4o7r6yLk1C2CJZQUNFiP/HpwNjijclEVNBkOMLl9yvmcRHjJDp8Kdz/pzTK0dU85aOsZq3hZ qWkJSSk81wXnY2id7EOsCf3VoLR898PoshTLClvu1RLzBAjc55JFT5MdChyLKgHODvA4ppK6n0IBt gK14kh6xO5KuXPwylpkVhUKe6ifOB8bav9rOcFzjULb9cS+QadPwY6yXln8zgPJ5dDrgOpCCcIkHS QSPoQE3g==; Received: from [2001:4bb8:184:5cad:8026:d98c:a056:3e33] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jCOeH-0001v7-QQ for linux-xfs@vger.kernel.org; Thu, 12 Mar 2020 14:17:22 +0000 From: Christoph Hellwig To: linux-xfs@vger.kernel.org Subject: [PATCH 1/4] libxfs: turn the xfs_buf_incore stub into an inline function Date: Thu, 12 Mar 2020 15:17:12 +0100 Message-Id: <20200312141715.550387-2-hch@lst.de> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200312141715.550387-1-hch@lst.de> References: <20200312141715.550387-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org Replace the macro with an inline function to avoid compiler warnings with new backports of kernel code. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong --- libxfs/libxfs_priv.h | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/libxfs/libxfs_priv.h b/libxfs/libxfs_priv.h index 5d6dd063..17a0104b 100644 --- a/libxfs/libxfs_priv.h +++ b/libxfs/libxfs_priv.h @@ -369,14 +369,12 @@ roundup_64(uint64_t x, uint32_t y) #define XFS_BUF_UNDELAYWRITE(bp) ((bp)->b_flags &= ~LIBXFS_B_DIRTY) #define XFS_BUF_SET_BDSTRAT_FUNC(a,b) ((void) 0) -/* avoid gcc warning */ -#define xfs_buf_incore(bt,blkno,len,lockit) ({ \ - typeof(blkno) __foo = (blkno); \ - typeof(len) __bar = (len); \ - (blkno) = __foo; \ - (len) = __bar; /* no set-but-unused warning */ \ - NULL; \ -}) +static inline struct xfs_buf *xfs_buf_incore(struct xfs_buftarg *target, + xfs_daddr_t blkno, size_t numblks, xfs_buf_flags_t flags) +{ + return NULL; +} + #define xfs_buf_oneshot(bp) ((void) 0) #define XBRW_READ LIBXFS_BREAD From patchwork Thu Mar 12 14:17:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 11434327 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DF6BB913 for ; Thu, 12 Mar 2020 14:17:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B646620716 for ; Thu, 12 Mar 2020 14:17:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="uIHVBojd" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727466AbgCLORZ (ORCPT ); Thu, 12 Mar 2020 10:17:25 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:44720 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727123AbgCLORZ (ORCPT ); Thu, 12 Mar 2020 10:17:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:To:From:Sender: Reply-To:Cc:Content-Type:Content-ID:Content-Description; bh=IZjtffZt8MC15d8DmDFE9wYG7MgRMJ7WQUAUks4hKLA=; b=uIHVBojd0ZQpOnvFvKn9pqfbod 6YRU9rOhoMuh5QPV8ljuR+G7g9RHO5xoS/DtDD/xFc/hQd/eAHN2O1FqRjRQonIKeAPdOKz6pJ/3e KPeFkJaZVmsARzCFxkUXhF2GRJ/nQXqK8q+aLIPlMES0waUQRgLhEpbLzpZWo1bxAOD9mXQ5QCSWL TipKsjJtzYpm7q8oA+MMLkUtGdOYmOnDYnbiE6m/xmFgS38y1uQlfz3qRBAQRT4ucPZz+FvylF9x6 3VovP6aHqIyKIjJi+8ShoNdHJ+QY/a9C3yB7fDPsycgO2PkuZqciJnWUaFAulu6OcOwlGKuQb+8wh UCztHPsQ==; Received: from [2001:4bb8:184:5cad:8026:d98c:a056:3e33] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jCOeK-0001xY-Kp for linux-xfs@vger.kernel.org; Thu, 12 Mar 2020 14:17:25 +0000 From: Christoph Hellwig To: linux-xfs@vger.kernel.org Subject: [PATCH 2/4] libxfs: remove xfs_buf_oneshot Date: Thu, 12 Mar 2020 15:17:13 +0100 Message-Id: <20200312141715.550387-3-hch@lst.de> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200312141715.550387-1-hch@lst.de> References: <20200312141715.550387-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org This function doesn't exist in the kernel and is purely a stub in xfsprogs, so remove it. Signed-off-by: Christoph Hellwig --- libxfs/libxfs_priv.h | 2 -- libxfs/xfs_sb.c | 2 -- 2 files changed, 4 deletions(-) diff --git a/libxfs/libxfs_priv.h b/libxfs/libxfs_priv.h index 17a0104b..723dddcd 100644 --- a/libxfs/libxfs_priv.h +++ b/libxfs/libxfs_priv.h @@ -375,8 +375,6 @@ static inline struct xfs_buf *xfs_buf_incore(struct xfs_buftarg *target, return NULL; } -#define xfs_buf_oneshot(bp) ((void) 0) - #define XBRW_READ LIBXFS_BREAD #define XBRW_WRITE LIBXFS_BWRITE #define xfs_buf_zero(bp,off,len) libxfs_iomove(bp,off,len,NULL,LIBXFS_BZERO) diff --git a/libxfs/xfs_sb.c b/libxfs/xfs_sb.c index 4f750d19..b931fee7 100644 --- a/libxfs/xfs_sb.c +++ b/libxfs/xfs_sb.c @@ -982,7 +982,6 @@ xfs_update_secondary_sbs( } bp->b_ops = &xfs_sb_buf_ops; - xfs_buf_oneshot(bp); xfs_buf_zero(bp, 0, BBTOB(bp->b_length)); xfs_sb_to_disk(XFS_BUF_TO_SBP(bp), &mp->m_sb); xfs_buf_delwri_queue(bp, &buffer_list); @@ -1170,7 +1169,6 @@ xfs_sb_get_secondary( if (!bp) return -ENOMEM; bp->b_ops = &xfs_sb_buf_ops; - xfs_buf_oneshot(bp); *bpp = bp; return 0; } From patchwork Thu Mar 12 14:17:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 11434329 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9E013139A for ; Thu, 12 Mar 2020 14:17:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 73CEA2071B for ; Thu, 12 Mar 2020 14:17:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="hrcFpjfo" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727467AbgCLOR2 (ORCPT ); Thu, 12 Mar 2020 10:17:28 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:44792 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727123AbgCLOR1 (ORCPT ); Thu, 12 Mar 2020 10:17:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:To:From:Sender: Reply-To:Cc:Content-Type:Content-ID:Content-Description; bh=F0+JlZXvg+HvvDPgHo3U74jb5ZOoMRpvvo+b/qPui5k=; b=hrcFpjfo32z9WjXgNEWcDbQfAy A3gsXB21FBtOXGWJwI7JzPGHqwZeRDs5A6QKFUUzpgY5saNgn8Arh55uws2U0+WAhgPEPSw1RqTG0 P93SNavftoSdtKOrRejJ4jdhtt8wBB83NNnLNsIzxIMVP+Ndcog2QQHSuEVTB9s5IxjmXGNSTZcAv Yu/wk/AB/Ry0B5OJDE/1frdCSoqWx2pYh4tylDUsrBWV+3LDFojrkU5PL77VWbYQSQ30RN0sBcBy/ ybI5Q/PHQ50s0YZ9tNVszi3DV68byY3ZOL+lxw6WqsCH+9zyA4GQMyX6/PzoD6rARnjcSGVpypH6t aHlqLPbg==; Received: from [2001:4bb8:184:5cad:8026:d98c:a056:3e33] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jCOeN-0001z0-90 for linux-xfs@vger.kernel.org; Thu, 12 Mar 2020 14:17:27 +0000 From: Christoph Hellwig To: linux-xfs@vger.kernel.org Subject: [PATCH 3/4] xfs: remove XFS_BUF_SET_BDSTRAT_FUNC Date: Thu, 12 Mar 2020 15:17:14 +0100 Message-Id: <20200312141715.550387-4-hch@lst.de> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200312141715.550387-1-hch@lst.de> References: <20200312141715.550387-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org This function doesn't exist in the kernel and is purely a stub in xfsprogs, so remove it. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong --- libxfs/libxfs_priv.h | 1 - libxfs/logitem.c | 1 - 2 files changed, 2 deletions(-) diff --git a/libxfs/libxfs_priv.h b/libxfs/libxfs_priv.h index 723dddcd..d07d8f32 100644 --- a/libxfs/libxfs_priv.h +++ b/libxfs/libxfs_priv.h @@ -367,7 +367,6 @@ roundup_64(uint64_t x, uint32_t y) #define XBF_DONE 0 #define xfs_buf_stale(bp) ((bp)->b_flags |= LIBXFS_B_STALE) #define XFS_BUF_UNDELAYWRITE(bp) ((bp)->b_flags &= ~LIBXFS_B_DIRTY) -#define XFS_BUF_SET_BDSTRAT_FUNC(a,b) ((void) 0) static inline struct xfs_buf *xfs_buf_incore(struct xfs_buftarg *target, xfs_daddr_t blkno, size_t numblks, xfs_buf_flags_t flags) diff --git a/libxfs/logitem.c b/libxfs/logitem.c index b11df4fa..d0819dcb 100644 --- a/libxfs/logitem.c +++ b/libxfs/logitem.c @@ -84,7 +84,6 @@ xfs_buf_item_init( * the first. If we do already have one, there is * nothing to do here so return. */ - XFS_BUF_SET_BDSTRAT_FUNC(bp, xfs_bdstrat_cb); if (bp->b_log_item != NULL) { lip = bp->b_log_item; if (lip->li_type == XFS_LI_BUF) { From patchwork Thu Mar 12 14:17:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 11434331 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7DBA6139A for ; Thu, 12 Mar 2020 14:17:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5D73520650 for ; Thu, 12 Mar 2020 14:17:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="OoJ1wZsq" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727481AbgCLORb (ORCPT ); Thu, 12 Mar 2020 10:17:31 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:44838 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727123AbgCLORa (ORCPT ); Thu, 12 Mar 2020 10:17:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:To:From:Sender: Reply-To:Cc:Content-Type:Content-ID:Content-Description; bh=vS12AWsf58janhk9iuGhjFBnb85sVIiPIxLyc8eJkuY=; b=OoJ1wZsq08bzCzqNDnM5KBFUkI k7llXq7tLwjsN+LBkv8eigfaZB0bgJb43aWYzyDnuPfr333WJja0Lgv2qoWMA7fs2wcNKLrXeza9R 4eH3d4XkQ78YEpsXRZBQLz9zFKJQIdNb7Fobd5bgrwgLESg1QK/H96OVnC1KoCLXLT0HbWyKwotUD z3C/hETpLG6uJQ/FNV0YhLZROUmims0VPOCX7bQXh0Mb5utO6x7AOG8QJtpCPHhGSgMYI6lWoACZe 3hgmTEAMHJCs9Apktz4l3d4R1hPAP7k0T7SQxO/Q2XGmtWbiIh2jW8/vlVn/WfRyy/qTsMznfh4bH VimsX5Kg==; Received: from [2001:4bb8:184:5cad:8026:d98c:a056:3e33] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jCOeQ-0001zp-81 for linux-xfs@vger.kernel.org; Thu, 12 Mar 2020 14:17:30 +0000 From: Christoph Hellwig To: linux-xfs@vger.kernel.org Subject: [PATCH 4/4] libxfs: remove libxfs_iomove Date: Thu, 12 Mar 2020 15:17:15 +0100 Message-Id: <20200312141715.550387-5-hch@lst.de> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200312141715.550387-1-hch@lst.de> References: <20200312141715.550387-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org This function has been removed in the kernel already. Replace the only user that want to zero buffers with a straight call to memset. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong --- libxfs/libxfs_io.h | 6 ------ libxfs/libxfs_priv.h | 5 ++--- libxfs/rdwr.c | 24 ------------------------ 3 files changed, 2 insertions(+), 33 deletions(-) diff --git a/libxfs/libxfs_io.h b/libxfs/libxfs_io.h index a0605882..0f682305 100644 --- a/libxfs/libxfs_io.h +++ b/libxfs/libxfs_io.h @@ -213,12 +213,6 @@ extern int libxfs_device_zero(struct xfs_buftarg *, xfs_daddr_t, uint); extern int libxfs_bhash_size; -#define LIBXFS_BREAD 0x1 -#define LIBXFS_BWRITE 0x2 -#define LIBXFS_BZERO 0x4 - -extern void libxfs_iomove (xfs_buf_t *, uint, int, void *, int); - static inline int xfs_buf_verify_cksum(struct xfs_buf *bp, unsigned long cksum_offset) { diff --git a/libxfs/libxfs_priv.h b/libxfs/libxfs_priv.h index d07d8f32..b5677a22 100644 --- a/libxfs/libxfs_priv.h +++ b/libxfs/libxfs_priv.h @@ -374,9 +374,8 @@ static inline struct xfs_buf *xfs_buf_incore(struct xfs_buftarg *target, return NULL; } -#define XBRW_READ LIBXFS_BREAD -#define XBRW_WRITE LIBXFS_BWRITE -#define xfs_buf_zero(bp,off,len) libxfs_iomove(bp,off,len,NULL,LIBXFS_BZERO) +#define xfs_buf_zero(bp, off, len) \ + memset((bp)->b_addr + off, 0, len); /* mount stuff */ #define XFS_MOUNT_32BITINODES LIBXFS_MOUNT_32BITINODES diff --git a/libxfs/rdwr.c b/libxfs/rdwr.c index 7430ff09..6a9895f1 100644 --- a/libxfs/rdwr.c +++ b/libxfs/rdwr.c @@ -1009,30 +1009,6 @@ libxfs_buf_mark_dirty( bp->b_flags |= LIBXFS_B_DIRTY; } -void -libxfs_iomove(xfs_buf_t *bp, uint boff, int len, void *data, int flags) -{ -#ifdef IO_DEBUG - if (boff + len > bp->b_bcount) { - printf("Badness, iomove out of range!\n" - "bp=(bno 0x%llx, bytes %u) range=(boff %u, bytes %u)\n", - (long long)bp->b_bn, bp->b_bcount, boff, len); - abort(); - } -#endif - switch (flags) { - case LIBXFS_BZERO: - memset(bp->b_addr + boff, 0, len); - break; - case LIBXFS_BREAD: - memcpy(data, bp->b_addr + boff, len); - break; - case LIBXFS_BWRITE: - memcpy(bp->b_addr + boff, data, len); - break; - } -} - /* Complain about (and remember) dropping dirty buffers. */ static void libxfs_whine_dirty_buf(