Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3985390imm; Wed, 5 Sep 2018 08:57:15 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZHeYAn0OKLrFjWB47YiJtgnqaC0KNyam133bLQfAXVgUXNoQqxXzJSpZYiMAfsAleKVi8j X-Received: by 2002:aa7:88d3:: with SMTP id p19-v6mr41325612pfo.160.1536163035910; Wed, 05 Sep 2018 08:57:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536163035; cv=none; d=google.com; s=arc-20160816; b=KZNkfTluK5HQzPsuRm16hOAr4fjmHBcU4B0+JYQOmRFKgWFpPYhiN55rDuc1cRI/xL B5IV3dH9lA5OwI+JyRPlWhNCTdCkD7j0myLSZiHfWZTzzQaTp2es6hnQsD7SRsoh2usE pZPyic3JiimezCPQkYvRMxEloRtc/BwALR46qwv9UTP1gX/z8v6hetCOL71TlT3kyWRJ ix2lwdnPiaW+NrIW0VlfI/vehhEm0+pbTs/9tP89VqxTPSgEsFr1D1jmpb2xKw32wDVi r5nMzzvRMQTZzgCmBKef0LSmqebWSWPUW24PrJT5CZw9I/iP5EFuIQAiouSWbRvVIESA e3Fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:cc:to:from :subject:organization; bh=p6UXX9WBvkMZSBxelUpRGdkHyo0qh1ga7YucrcuvN18=; b=k2Etl9mt1E0vjmCh+8rYxF6GTZFsVXTD/2/6ij1r5Z6y1Fw6mn+jLgOtQ8PlYbJk+5 2usV+f57qCZInUue4jaxqLjYXO5lSnDXr8J+DmPmHJOH11BlCDg6iBSfJSyikgs3IzgW G5WkfRWG2PlSKpdSIN7CudPy4Bn9f2FN5oqlluNqlMKj7mzGVV5AgKumbCTwd3AHmy2I rWv+ZXRJqUxMSXPR+BLj12Jx67bMc85dC4gY+MsQy+Bq+7WScYCIUwQqKgd9GhQRtZGS 6kAG3Y+iYX16xeTLu2pEbqxN3m5/ir2xs69rVlrwIrVSpg3jnb8N1s06YsPfEVWcQvWM tQIw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v129-v6si2582668pfv.278.2018.09.05.08.57.00; Wed, 05 Sep 2018 08:57:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727826AbeIEU0O (ORCPT + 99 others); Wed, 5 Sep 2018 16:26:14 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:33744 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726189AbeIEU0O (ORCPT ); Wed, 5 Sep 2018 16:26:14 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B7F19DFE5; Wed, 5 Sep 2018 15:55:25 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-123-84.rdu2.redhat.com [10.10.123.84]) by smtp.corp.redhat.com (Postfix) with ESMTP id 29983D1CE6; Wed, 5 Sep 2018 15:55:24 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 Subject: [PATCH 07/11] UAPI: nilfs2: Fix use of undefined byteswapping functions From: David Howells To: linux-api@vger.kernel.org, linux-kbuild@vger.kernel.org Cc: Ryusuke Konishi , linux-nilfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, dhowells@redhat.com Date: Wed, 05 Sep 2018 16:55:23 +0100 Message-ID: <153616292366.23468.14988166998690800938.stgit@warthog.procyon.org.uk> In-Reply-To: <153616286704.23468.584491117180383924.stgit@warthog.procyon.org.uk> References: <153616286704.23468.584491117180383924.stgit@warthog.procyon.org.uk> User-Agent: StGit/unknown-version MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Wed, 05 Sep 2018 15:55:25 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Wed, 05 Sep 2018 15:55:25 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dhowells@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org nilfs2 exports a load of inline functions to userspace that call kernel byteswapping functions that don't exist in UAPI. Fix this by making it #include asm/byteorder.h and use the functions declared there. A better way is probably to remove these inline functions from the nilfs2 header since they are technically broken. Signed-off-by: David Howells cc: Ryusuke Konishi cc: linux-nilfs@vger.kernel.org cc: linux-fsdevel@vger.kernel.org --- include/uapi/linux/nilfs2_ondisk.h | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/include/uapi/linux/nilfs2_ondisk.h b/include/uapi/linux/nilfs2_ondisk.h index a7e66ab11d1d..d3bd2fe08791 100644 --- a/include/uapi/linux/nilfs2_ondisk.h +++ b/include/uapi/linux/nilfs2_ondisk.h @@ -29,6 +29,7 @@ #include #include +#include #define NILFS_INODE_BMAP_SIZE 7 @@ -533,19 +534,19 @@ enum { static inline void \ nilfs_checkpoint_set_##name(struct nilfs_checkpoint *cp) \ { \ - cp->cp_flags = cpu_to_le32(le32_to_cpu(cp->cp_flags) | \ + cp->cp_flags = __cpu_to_le32(__le32_to_cpu(cp->cp_flags) | \ (1UL << NILFS_CHECKPOINT_##flag)); \ } \ static inline void \ nilfs_checkpoint_clear_##name(struct nilfs_checkpoint *cp) \ { \ - cp->cp_flags = cpu_to_le32(le32_to_cpu(cp->cp_flags) & \ + cp->cp_flags = __cpu_to_le32(__le32_to_cpu(cp->cp_flags) & \ ~(1UL << NILFS_CHECKPOINT_##flag)); \ } \ static inline int \ nilfs_checkpoint_##name(const struct nilfs_checkpoint *cp) \ { \ - return !!(le32_to_cpu(cp->cp_flags) & \ + return !!(__le32_to_cpu(cp->cp_flags) & \ (1UL << NILFS_CHECKPOINT_##flag)); \ } @@ -595,20 +596,20 @@ enum { static inline void \ nilfs_segment_usage_set_##name(struct nilfs_segment_usage *su) \ { \ - su->su_flags = cpu_to_le32(le32_to_cpu(su->su_flags) | \ + su->su_flags = __cpu_to_le32(__le32_to_cpu(su->su_flags) | \ (1UL << NILFS_SEGMENT_USAGE_##flag));\ } \ static inline void \ nilfs_segment_usage_clear_##name(struct nilfs_segment_usage *su) \ { \ su->su_flags = \ - cpu_to_le32(le32_to_cpu(su->su_flags) & \ + __cpu_to_le32(__le32_to_cpu(su->su_flags) & \ ~(1UL << NILFS_SEGMENT_USAGE_##flag)); \ } \ static inline int \ nilfs_segment_usage_##name(const struct nilfs_segment_usage *su) \ { \ - return !!(le32_to_cpu(su->su_flags) & \ + return !!(__le32_to_cpu(su->su_flags) & \ (1UL << NILFS_SEGMENT_USAGE_##flag)); \ } @@ -619,15 +620,15 @@ NILFS_SEGMENT_USAGE_FNS(ERROR, error) static inline void nilfs_segment_usage_set_clean(struct nilfs_segment_usage *su) { - su->su_lastmod = cpu_to_le64(0); - su->su_nblocks = cpu_to_le32(0); - su->su_flags = cpu_to_le32(0); + su->su_lastmod = __cpu_to_le64(0); + su->su_nblocks = __cpu_to_le32(0); + su->su_flags = __cpu_to_le32(0); } static inline int nilfs_segment_usage_clean(const struct nilfs_segment_usage *su) { - return !le32_to_cpu(su->su_flags); + return !__le32_to_cpu(su->su_flags); } /**