From patchwork Wed Jan 29 06:49:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 11355575 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 9215E924 for ; Wed, 29 Jan 2020 06:49:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6736720716 for ; Wed, 29 Jan 2020 06:49:29 +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="U6WZgtnL" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726043AbgA2Gt3 (ORCPT ); Wed, 29 Jan 2020 01:49:29 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:43060 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726020AbgA2Gt2 (ORCPT ); Wed, 29 Jan 2020 01:49:28 -0500 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:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=I+WRzRbkEmVcsGD0rCc/ZFXJqXvy5BASpe4e86R9DBQ=; b=U6WZgtnLW8kAD6VCGRCzAMVLn 9jxrA6DlSZZBTo8+j71v43LzynRQYI5gd+L3IW7Gfgdbl5a9VED+kGo+go7q09u7j6v9iIgg60+Dp uP3HSCJD06KZBhjAoZ4WSCqYMFd2wjsIShpwPYwasElEnuAWu015WeQ9AM7IBwHyW1CqJjBypRqK2 PZ2UeYwczqI26k2lHJItqLahBM8ffBuIYucd+2aFcNYDNJ/GAF/QQJQ/J4rc50wbKz3DUpqwnEe14 vft71EyNEo7yogK6DT6+0r52BT+h+/zm7cuiEEwWgT/z12fK4AZHMynB3+++Jpy6YURbpU3x/KcOj UYMV7dGGA==; Received: from [2001:4bb8:18c:3335:c19:50e8:dbcf:dcc6] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1iwhAG-0001Se-A0 for linux-xfs@vger.kernel.org; Wed, 29 Jan 2020 06:49:28 +0000 From: Christoph Hellwig To: linux-xfs@vger.kernel.org Subject: [PATCH 1/5] xfsprogs: remove the ENABLE_GETTEXT substitution in platform_defs.h.in Date: Wed, 29 Jan 2020 07:49:19 +0100 Message-Id: <20200129064923.43088-2-hch@lst.de> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200129064923.43088-1-hch@lst.de> References: <20200129064923.43088-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 ENABLE_GETTEXT is already defined on the command line if enabled, no need to duplicate it in platform_defs.h.in. Signed-off-by: Christoph Hellwig --- include/platform_defs.h.in | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/platform_defs.h.in b/include/platform_defs.h.in index 1f7ceafb..6cc56e31 100644 --- a/include/platform_defs.h.in +++ b/include/platform_defs.h.in @@ -36,8 +36,6 @@ typedef struct filldir filldir_t; typedef unsigned short umode_t; #endif -/* Define if you want gettext (I18N) support */ -#undef ENABLE_GETTEXT #ifdef ENABLE_GETTEXT # include # define _(x) gettext(x) From patchwork Wed Jan 29 06:49:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 11355577 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 04B55924 for ; Wed, 29 Jan 2020 06:49:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CEDC920716 for ; Wed, 29 Jan 2020 06:49: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="Y+Ek/TK7" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726076AbgA2Gtb (ORCPT ); Wed, 29 Jan 2020 01:49:31 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:43066 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726020AbgA2Gtb (ORCPT ); Wed, 29 Jan 2020 01:49:31 -0500 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:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Jwcm3EybhJoixusZ+7B7Ht2NyrKET5NCZJKhVTHy2yE=; b=Y+Ek/TK7V0P/5vlrQAjFGF7Do CFiN0ugG/ckx0shvarUNIulqG02bLcpHHxPYEYQhAQe0fL1XXY4Wuky24klQoR1dU6NtqIEi6ya7G lpYbEuMabHwVimoBu96JyvA+Ds3/XCw7kEqEmhETdO2ZJQS0gEqzpPP4Rr1hjlElkY1lhXidj1zQ3 u+gkDdKYzLPFFbLbJ3debl5aW8DiOwklffFuqcBtw2wsYcY4XINl8BCZASFv1ZNXQBWek+mVo1kan JoamKED0h8qWZQECyEhm046OnracdW36HB7WHiF2L1T+MI/g2pFVWzwoTen6VdXu2tByAPnoEEtok WfAT/pDOA==; Received: from [2001:4bb8:18c:3335:c19:50e8:dbcf:dcc6] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1iwhAI-0001T2-QL for linux-xfs@vger.kernel.org; Wed, 29 Jan 2020 06:49:31 +0000 From: Christoph Hellwig To: linux-xfs@vger.kernel.org Subject: [PATCH 2/5] xfsprogs: remove the SIZEOF_CHAR_P substitution in platform_defs.h.in Date: Wed, 29 Jan 2020 07:49:20 +0100 Message-Id: <20200129064923.43088-3-hch@lst.de> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200129064923.43088-1-hch@lst.de> References: <20200129064923.43088-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 SIZEOF_CHAR_P is not used anywhere in the code, so remove the reference to it. Signed-off-by: Christoph Hellwig --- include/platform_defs.h.in | 1 - 1 file changed, 1 deletion(-) diff --git a/include/platform_defs.h.in b/include/platform_defs.h.in index 6cc56e31..ff0a6a4e 100644 --- a/include/platform_defs.h.in +++ b/include/platform_defs.h.in @@ -28,7 +28,6 @@ typedef struct filldir filldir_t; /* long and pointer must be either 32 bit or 64 bit */ #undef SIZEOF_LONG -#undef SIZEOF_CHAR_P #define BITS_PER_LONG (SIZEOF_LONG * CHAR_BIT) /* Check whether to define umode_t ourselves. */ From patchwork Wed Jan 29 06:49:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 11355579 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 85573924 for ; Wed, 29 Jan 2020 06:49:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 637A220716 for ; Wed, 29 Jan 2020 06:49:34 +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="JjjgsM/E" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726091AbgA2Gte (ORCPT ); Wed, 29 Jan 2020 01:49:34 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:43074 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726020AbgA2Gtd (ORCPT ); Wed, 29 Jan 2020 01:49:33 -0500 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:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=yOk1fHoDyDrIQPGTJ8PzLnMM5svvHUopHmu37/prav4=; b=JjjgsM/E+CFworXq6kVxKiWSU dmIMsLdvJwG3UBiZ4Fv/9T9SctfAKSI1cyxCRYiuSBz7EXjWpVixikhjdS/zkNyVe2Am/u8oQl1ox osj84/GI4bo0jtX+9/+wEUfCA7QtN4AqE/A4BQfUiQJBDfIvNAOpG2JvDozm8KhWvdqBzDALwoA+O H7OrbLsX2AJ0Kzsu8QXNO7fOr5WVKm0AWfy77FILS/Ip0FiMeMMqvd8azmNkRkjtF6zat5aav4TPd I/DaBXOPLHhslY5/QsOrSXUqH80kzycMPeiyTpnKCXQVatV/3Cvk0S/bSV1tcXrSAejEmNN4Ayjlm DYbXwaHAQ==; Received: from [2001:4bb8:18c:3335:c19:50e8:dbcf:dcc6] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1iwhAL-0001TJ-AI for linux-xfs@vger.kernel.org; Wed, 29 Jan 2020 06:49:33 +0000 From: Christoph Hellwig To: linux-xfs@vger.kernel.org Subject: [PATCH 3/5] repair: remove BITS_PER_LONG cpp checks in bmap.[ch] Date: Wed, 29 Jan 2020 07:49:21 +0100 Message-Id: <20200129064923.43088-4-hch@lst.de> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200129064923.43088-1-hch@lst.de> References: <20200129064923.43088-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 Add a little helper to validate the nex count so that we can use compile time magic checks for sizeof long directly. Also don't print the max in case of an overflow as the value will always be the same. Signed-off-by: Christoph Hellwig --- repair/bmap.c | 29 +++++++++++++++++++++-------- repair/bmap.h | 13 ------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/repair/bmap.c b/repair/bmap.c index 44e43ab4..d8da8c95 100644 --- a/repair/bmap.c +++ b/repair/bmap.c @@ -22,6 +22,22 @@ pthread_key_t dblkmap_key; pthread_key_t ablkmap_key; +/* + * For 32 bit platforms, we are limited to extent arrays of 2^31 bytes, which + * limits the number of extents in an inode we can check. If we don't limit the + * valid range, we can overflow the BLKMAP_SIZE() calculation and allocate less + * memory than we think we needed, and hence walk off the end of the array and + * corrupt memory. + */ +static inline bool +blkmap_nex_valid( + xfs_extnum_t nex) +{ + if (sizeof(long) < 8 && nex >= INT_MAX / sizeof(bmap_ext_t)) + return false; + return true; +} + blkmap_t * blkmap_alloc( xfs_extnum_t nex, @@ -35,8 +51,7 @@ blkmap_alloc( if (nex < 1) nex = 1; -#if (BITS_PER_LONG == 32) /* on 64-bit platforms this is never true */ - if (nex > BLKMAP_NEXTS_MAX) { + if (!blkmap_nex_valid(nex)) { do_warn( _("Number of extents requested in blkmap_alloc (%d) overflows 32 bits.\n" "If this is not a corruption, then you will need a 64 bit system\n" @@ -44,7 +59,6 @@ blkmap_alloc( nex); return NULL; } -#endif key = whichfork ? ablkmap_key : dblkmap_key; blkmap = pthread_getspecific(key); @@ -278,20 +292,19 @@ blkmap_grow( ASSERT(pthread_getspecific(key) == blkmap); } -#if (BITS_PER_LONG == 32) /* on 64-bit platforms this is never true */ - if (new_naexts > BLKMAP_NEXTS_MAX) { + if (!blkmap_nex_valid(new_naexts)) { do_error( _("Number of extents requested in blkmap_grow (%d) overflows 32 bits.\n" "You need a 64 bit system to repair this filesystem.\n"), new_naexts); return NULL; } -#endif + if (new_naexts <= 0) { do_error( _("Number of extents requested in blkmap_grow (%d) overflowed the\n" - "maximum number of supported extents (%d).\n"), - new_naexts, BLKMAP_NEXTS_MAX); + "maximum number of supported extents.\n"), + new_naexts); return NULL; } diff --git a/repair/bmap.h b/repair/bmap.h index 4b588df8..df9602b3 100644 --- a/repair/bmap.h +++ b/repair/bmap.h @@ -28,19 +28,6 @@ typedef struct blkmap { #define BLKMAP_SIZE(n) \ (offsetof(blkmap_t, exts) + (sizeof(bmap_ext_t) * (n))) -/* - * For 32 bit platforms, we are limited to extent arrays of 2^31 bytes, which - * limits the number of extents in an inode we can check. If we don't limit the - * valid range, we can overflow the BLKMAP_SIZE() calculation and allocate less - * memory than we think we needed, and hence walk off the end of the array and - * corrupt memory. - */ -#if BITS_PER_LONG == 32 -#define BLKMAP_NEXTS_MAX ((INT_MAX / sizeof(bmap_ext_t)) - 1) -#else -#define BLKMAP_NEXTS_MAX INT_MAX -#endif - extern pthread_key_t dblkmap_key; extern pthread_key_t ablkmap_key; From patchwork Wed Jan 29 06:49:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 11355581 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 4AB3F924 for ; Wed, 29 Jan 2020 06:49:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1FEBE20716 for ; Wed, 29 Jan 2020 06:49:37 +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="hKjRCOkA" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726104AbgA2Gtg (ORCPT ); Wed, 29 Jan 2020 01:49:36 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:43080 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726020AbgA2Gtg (ORCPT ); Wed, 29 Jan 2020 01:49:36 -0500 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:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=gBZB3KppZ4QBoVpHGIOFPKet9GTGXtzkxdWnhAT7HVE=; b=hKjRCOkAKiuLO7h7lioRrm6dR uON79ny4jTAcmsaKMqMyxyCxCkvyfZ1vpS3XTx8MG3amRhyKYfChiXMT2rwxqrWbLlTBJo/lkK0e0 8c1tA09gDtjzZ/QzD061TwAc9kciogPd3Vvm04E6xe+nSu21nhN5cjEFRO9aZqA7f0wp1IaEuYBdI jB9V9NeYu+AadfoYzTdY3g3MCghL5qHJIytT9IOST7iWodCtlvfsAWX+ipcegqJ1Mdq6Ag72qAasq KejjZyc08fnVEL3w3UpIjxN6tzUaIkpmALgMO/w4z83iWJSL2HTTflZL4Os7/N/BQfhpbu9DrtZkB EHs2bfB0g==; Received: from [2001:4bb8:18c:3335:c19:50e8:dbcf:dcc6] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1iwhAN-0001Ta-TZ for linux-xfs@vger.kernel.org; Wed, 29 Jan 2020 06:49:36 +0000 From: Christoph Hellwig To: linux-xfs@vger.kernel.org Subject: [PATCH 4/5] xfsprogs: remove the SIZEOF_LONG substitution in platform_defs.h.in Date: Wed, 29 Jan 2020 07:49:22 +0100 Message-Id: <20200129064923.43088-5-hch@lst.de> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200129064923.43088-1-hch@lst.de> References: <20200129064923.43088-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 BITS_PER_LONG is now only checked in C expressions, so we can simply define it based on sizeof(long). Signed-off-by: Christoph Hellwig --- include/platform_defs.h.in | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/include/platform_defs.h.in b/include/platform_defs.h.in index ff0a6a4e..36006cbf 100644 --- a/include/platform_defs.h.in +++ b/include/platform_defs.h.in @@ -26,9 +26,7 @@ typedef struct filldir filldir_t; -/* long and pointer must be either 32 bit or 64 bit */ -#undef SIZEOF_LONG -#define BITS_PER_LONG (SIZEOF_LONG * CHAR_BIT) +#define BITS_PER_LONG (sizeof(long) * CHAR_BIT) /* Check whether to define umode_t ourselves. */ #ifndef HAVE_UMODE_T From patchwork Wed Jan 29 06:49:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 11355583 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 ADD7092A for ; Wed, 29 Jan 2020 06:49:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8B68F2070A for ; Wed, 29 Jan 2020 06:49:39 +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="cbi2oLyO" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726124AbgA2Gtj (ORCPT ); Wed, 29 Jan 2020 01:49:39 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:43086 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726020AbgA2Gtj (ORCPT ); Wed, 29 Jan 2020 01:49:39 -0500 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:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=tI1xgn2vFOX75YS0soWfkrXVuxM6BsCw9IYdmDtTH1Q=; b=cbi2oLyO1e4/3DeoauXqhnl2M v+DQx9IHyLVLub3RNddT8BVRHcF66zXrpc5so0a8OktqdqgeGK9kPfjlUJKapFxlk5BPfy7gwREuo tM9XOqMTeKlf+m7I99t8TKZOnhVFju9qdRbCeIJrxPyHOah9cPe78B5p8Q/32o/wzsh7i37dgM3YH hkEjbaDC19f9MvatsbNSGy5rJYAF1euGcAbdi6mKjd0I+gigFt94fS0Ss1A/59vQmW1nYZ5Fs3f+H JYKNAiBhIiQbxSj6XbVZ9zWfWVlXUlN7kARxpgnUmvMcjMqIr8Ac4ZC1NPXGQCi9HAwi6hnN4+1Vf qeNznJ66A==; Received: from [2001:4bb8:18c:3335:c19:50e8:dbcf:dcc6] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1iwhAQ-0001U9-EV for linux-xfs@vger.kernel.org; Wed, 29 Jan 2020 06:49:38 +0000 From: Christoph Hellwig To: linux-xfs@vger.kernel.org Subject: [PATCH 5/5] xfsprogs: stop generating platform_defs.h Date: Wed, 29 Jan 2020 07:49:23 +0100 Message-Id: <20200129064923.43088-6-hch@lst.de> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200129064923.43088-1-hch@lst.de> References: <20200129064923.43088-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 Now that all the autoconf substituations are gone, there is no need to generate this (and thus any) header. Signed-off-by: Christoph Hellwig --- .gitignore | 1 - Makefile | 15 ++++----------- configure.ac | 1 - debian/rules | 2 -- include/Makefile | 2 +- include/{platform_defs.h.in => platform_defs.h} | 0 6 files changed, 5 insertions(+), 16 deletions(-) rename include/{platform_defs.h.in => platform_defs.h} (100%) diff --git a/.gitignore b/.gitignore index fd131b6f..20d033ae 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,6 @@ # build system .census .gitcensus -/include/platform_defs.h /include/builddefs /install-sh diff --git a/Makefile b/Makefile index 0edc2700..ff6a977d 100644 --- a/Makefile +++ b/Makefile @@ -49,7 +49,7 @@ SRCTARINC = m4/libtool.m4 m4/lt~obsolete.m4 m4/ltoptions.m4 m4/ltsugar.m4 \ m4/ltversion.m4 po/xfsprogs.pot .gitcensus $(CONFIGURE) LDIRT = config.log .ltdep .dep config.status config.cache confdefs.h \ conftest* built .census install.* install-dev.* *.gz *.xz \ - autom4te.cache/* libtool include/builddefs include/platform_defs.h + autom4te.cache/* libtool include/builddefs ifeq ($(HAVE_BUILDDEFS), yes) LDIRDIRT = $(SRCDIR) @@ -84,7 +84,7 @@ endif # include is listed last so it is processed last in clean rules. SUBDIRS = $(LIBFROG_SUBDIR) $(LIB_SUBDIRS) $(TOOL_SUBDIRS) include -default: include/builddefs include/platform_defs.h +default: include/builddefs ifeq ($(HAVE_BUILDDEFS), no) $(Q)$(MAKE) $(MAKEOPTS) -C . $@ else @@ -130,13 +130,6 @@ configure: configure.ac include/builddefs: configure ./configure $$LOCAL_CONFIGURE_OPTIONS -include/platform_defs.h: include/builddefs -## Recover from the removal of $@ - @if test -f $@; then :; else \ - rm -f include/builddefs; \ - $(MAKE) $(MAKEOPTS) $(AM_MAKEFLAGS) include/builddefs; \ - fi - install: $(addsuffix -install,$(SUBDIRS)) $(INSTALL) -m 755 -d $(PKG_DOC_DIR) $(INSTALL) -m 644 README $(PKG_DOC_DIR) @@ -160,14 +153,14 @@ realclean: distclean # # All this gunk is to allow for a make dist on an unconfigured tree # -dist: include/builddefs include/platform_defs.h default +dist: include/builddefs default ifeq ($(HAVE_BUILDDEFS), no) $(Q)$(MAKE) $(MAKEOPTS) -C . $@ else $(Q)$(MAKE) $(MAKEOPTS) $(SRCTAR) endif -deb: include/builddefs include/platform_defs.h +deb: include/builddefs ifeq ($(HAVE_BUILDDEFS), no) $(Q)$(MAKE) $(MAKEOPTS) -C . $@ else diff --git a/configure.ac b/configure.ac index 5eb7c14b..49c3a466 100644 --- a/configure.ac +++ b/configure.ac @@ -3,7 +3,6 @@ AC_PREREQ(2.50) AC_CONFIG_AUX_DIR([.]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_SRCDIR([include/libxfs.h]) -AC_CONFIG_HEADER(include/platform_defs.h) AC_PREFIX_DEFAULT(/usr) AC_PROG_INSTALL diff --git a/debian/rules b/debian/rules index e8509fb3..41c0c004 100755 --- a/debian/rules +++ b/debian/rules @@ -43,14 +43,12 @@ config: .census @echo "== dpkg-buildpackage: configure" 1>&2 $(checkdir) AUTOHEADER=/bin/true dh_autoreconf - $(options) $(MAKE) $(PMAKEFLAGS) include/platform_defs.h touch .census dibuild: $(checkdir) @echo "== dpkg-buildpackage: installer" 1>&2 if [ ! -f mkfs/mkfs.xfs-$(bootpkg) ]; then \ - $(diopts) $(MAKE) include/platform_defs.h; \ mkdir -p include/xfs; \ for dir in include libxfs; do \ $(MAKE) $(PMAKEFLAGS) -C $$dir NODEP=1 install-headers; \ diff --git a/include/Makefile b/include/Makefile index a80867e4..c92ecbd5 100644 --- a/include/Makefile +++ b/include/Makefile @@ -37,7 +37,7 @@ HFILES = handle.h \ xqm.h \ xfs_arch.h -LSRCFILES = platform_defs.h.in builddefs.in buildmacros buildrules install-sh +LSRCFILES = builddefs.in buildmacros buildrules install-sh LSRCFILES += $(DKHFILES) $(LIBHFILES) LDIRT = disk LDIRDIRT = xfs diff --git a/include/platform_defs.h.in b/include/platform_defs.h similarity index 100% rename from include/platform_defs.h.in rename to include/platform_defs.h