From patchwork Mon Oct 27 07:59:31 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Pinski X-Patchwork-Id: 39570 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f70.google.com (mail-ee0-f70.google.com [74.125.83.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id AA1012118A for ; Mon, 27 Oct 2014 08:01:19 +0000 (UTC) Received: by mail-ee0-f70.google.com with SMTP id b57sf196031eek.9 for ; Mon, 27 Oct 2014 01:01:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:mailing-list :precedence:list-id:list-unsubscribe:list-subscribe:list-archive :list-post:list-help:sender:delivered-to:from:to:cc:subject:date :message-id:in-reply-to:references:x-original-sender :x-original-authentication-results; bh=3Fo/mU8l9DfsqfdgWviMcm8K+OhTS4Xbqih5JqCXTN0=; b=LQ8gzCavacqgvMQ7lbxh0uQLriIaVSyWGMo3FWidHET2gtCYtd9LGl98wEnH1vJO5P IiumwEdR+jAtznlFvwcftdq5OFD9/up4vs7p7ggCGwtmLroI/gKT+J1zQh4kYkBCStHG afnedul9lKz1pFbgGS0qyozjA5Cj1guCORiqh407oIGhrWsOBVtPni5VdsV9L3+MNn4S LQ/hvVJOYSKyP/Dlgb7ch8jZVAfqDSQdVnhG+QMc3lJMDz1iFUC2eb0FSstffNiobF0d MAgK3Ewe1ub62zpuRhTumCZ9NyJCoCJ0rYpvItOcqkJC+L87+M9IugT4h4PfA++P7WI/ 7d2g== X-Gm-Message-State: ALoCoQk2XQoEYhzDR3H4U0yJ0Di8VFRSalbgjZtmC441exDCCWaqI0+zy2H2nb/u54jkJjSlVa2W X-Received: by 10.152.29.134 with SMTP id k6mr12773lah.9.1414396878592; Mon, 27 Oct 2014 01:01:18 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.28.4 with SMTP id x4ls676946lag.42.gmail; Mon, 27 Oct 2014 01:01:18 -0700 (PDT) X-Received: by 10.112.48.3 with SMTP id h3mr21916538lbn.71.1414396878247; Mon, 27 Oct 2014 01:01:18 -0700 (PDT) Received: from mail-lb0-x230.google.com (mail-lb0-x230.google.com. [2a00:1450:4010:c04::230]) by mx.google.com with ESMTPS id y2si18685304lae.49.2014.10.27.01.01.18 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 27 Oct 2014 01:01:18 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::230 as permitted sender) client-ip=2a00:1450:4010:c04::230; Received: by mail-lb0-f176.google.com with SMTP id p9so5141304lbv.7 for ; Mon, 27 Oct 2014 01:01:18 -0700 (PDT) X-Received: by 10.112.12.35 with SMTP id v3mr21637716lbb.80.1414396878149; Mon, 27 Oct 2014 01:01:18 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.84.229 with SMTP id c5csp247307lbz; Mon, 27 Oct 2014 01:01:17 -0700 (PDT) X-Received: by 10.70.128.11 with SMTP id nk11mr22158323pdb.113.1414396876648; Mon, 27 Oct 2014 01:01:16 -0700 (PDT) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id l3si8948665pdc.176.2014.10.27.01.01.15 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Oct 2014 01:01:16 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-53803-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 15629 invoked by alias); 27 Oct 2014 08:00:04 -0000 Mailing-List: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org Precedence: list List-Id: List-Unsubscribe: , List-Subscribe: List-Archive: List-Post: , List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 15335 invoked by uid 89); 27 Oct 2014 08:00:01 -0000 X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-HELO: mail-ie0-f175.google.com X-Received: by 10.50.6.100 with SMTP id z4mr20245557igz.37.1414396798060; Mon, 27 Oct 2014 00:59:58 -0700 (PDT) From: Andrew Pinski To: libc-alpha@sourceware.org Cc: Andrew Pinski Subject: [PATCH 07/29] Allow generic stat and statfs not have padding for 32bit targets Date: Mon, 27 Oct 2014 00:59:31 -0700 Message-Id: <1414396793-9005-8-git-send-email-apinski@cavium.com> In-Reply-To: <1414396793-9005-1-git-send-email-apinski@cavium.com> References: <1414396793-9005-1-git-send-email-apinski@cavium.com> X-Original-Sender: apinski@cavium.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::230 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=pass header.i=@sourceware.org X-Google-Group-Id: 836684582541 With ILP32, off_t, ino_t, blkcnt_t, fsbcnt_t, fsbfilcnt_t are all 64bit types, this allows us to use the same layout for the structure stat and statfs as LP64. So we need to remove the padding which is added for non 64bit targets. * sysdeps/unix/sysv/linux/generic/bits/stat.h (__field64): Use the 64bit version when off_t, ino_t and blkcnt_t match their 64bit version. * sysdeps/unix/sysv/linux/generic/bits/statfs.h (__field64): Use the 64bit version when fsblkcnt_t and fsfilcnt_t match their 64bit version. --- sysdeps/unix/sysv/linux/generic/bits/stat.h | 5 ++++- sysdeps/unix/sysv/linux/generic/bits/statfs.h | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/sysdeps/unix/sysv/linux/generic/bits/stat.h b/sysdeps/unix/sysv/linux/generic/bits/stat.h index faa2800..3c92184 100644 --- a/sysdeps/unix/sysv/linux/generic/bits/stat.h +++ b/sysdeps/unix/sysv/linux/generic/bits/stat.h @@ -42,7 +42,10 @@ #if defined __USE_FILE_OFFSET64 # define __field64(type, type64, name) type64 name -#elif __WORDSIZE == 64 +#elif __WORDSIZE == 64 \ + || (defined(__OFF_T_MATCHES_OFF64_T) \ + && defined(__INO_T_MATCHES_INO64_T) \ + && defined (__BLKCNT_T_TYPE_MATCHES_BLKCNT64_T_TYPE)) # define __field64(type, type64, name) type name #elif __BYTE_ORDER == __LITTLE_ENDIAN # define __field64(type, type64, name) \ diff --git a/sysdeps/unix/sysv/linux/generic/bits/statfs.h b/sysdeps/unix/sysv/linux/generic/bits/statfs.h index e32cf76..d3bfb50 100644 --- a/sysdeps/unix/sysv/linux/generic/bits/statfs.h +++ b/sysdeps/unix/sysv/linux/generic/bits/statfs.h @@ -34,7 +34,9 @@ #if defined __USE_FILE_OFFSET64 # define __field64(type, type64, name) type64 name -#elif __WORDSIZE == 64 +#elif __WORDSIZE == 64 \ + || (defined (__FSBLKCNT_T_TYPE_MATCHES_FSBLKCNT64_T_TYPE) \ + && defined (__FSFILCNT_T_TYPE_MATCHES_FSFILCNT64_T_TYPE)) # define __field64(type, type64, name) type name #elif __BYTE_ORDER == __LITTLE_ENDIAN # define __field64(type, type64, name) \