From patchwork Wed Oct 21 18:12:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 55396 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lf0-f71.google.com (mail-lf0-f71.google.com [209.85.215.71]) by patches.linaro.org (Postfix) with ESMTPS id 56C1A23024 for ; Wed, 21 Oct 2015 18:13:03 +0000 (UTC) Received: by lffz202 with SMTP id z202sf21075089lff.3 for ; Wed, 21 Oct 2015 11:13:02 -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:subject:date :message-id:x-original-sender:x-original-authentication-results; bh=CdX/Beys3JAbIvMQMIhIpiyzYOG9Zw+KSh5Q8SgOag4=; b=Xfj0pYu1DCHSUUYVX3iAHzYVfRLQI16Aus/sUeKWe4zXxyYRjnweDsZ6VJujW3Dbj2 uVU1yte5eixYidgXapifPgLHnGG2E7JT7p4bhpJZGSIQzavMZB1jr3BiEfA+q6EM5Bls ixmRZn6BIXvs81znfIwCvEXWwRV06La1Bd8N4F4IsDC5jw6vwbn5mbNdujcUm/SpNsZE cScOLX7OAKb6cGqk/nP0SGJOyqq03FQXw9edZTU+Lv01YR6Q93pRsyWGOkvX4/PPQiKF BKEuU4rWOJ94Y0so1yiX8ohjCQXnCvXUgg90ws98vEbla31tZY0d5lZCH+pIWAw9d5vp P4xA== X-Gm-Message-State: ALoCoQlyFmXk35sYta4rwAm3hlUPP7JOVp/DEU0JkGx+6yPIPPsacErfxy4q64H4RiQsNOA42obh X-Received: by 10.181.11.195 with SMTP id ek3mr2636191wid.7.1445451182279; Wed, 21 Oct 2015 11:13:02 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.156.78 with SMTP id f75ls274818lfe.69.gmail; Wed, 21 Oct 2015 11:13:02 -0700 (PDT) X-Received: by 10.112.132.74 with SMTP id os10mr6301241lbb.40.1445451181988; Wed, 21 Oct 2015 11:13:01 -0700 (PDT) Received: from mail-lf0-x232.google.com (mail-lf0-x232.google.com. [2a00:1450:4010:c07::232]) by mx.google.com with ESMTPS id 100si7295011lft.42.2015.10.21.11.13.01 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Oct 2015 11:13:01 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c07::232 as permitted sender) client-ip=2a00:1450:4010:c07::232; Received: by lffv3 with SMTP id v3so25142530lff.0 for ; Wed, 21 Oct 2015 11:13:01 -0700 (PDT) X-Received: by 10.25.150.199 with SMTP id y190mr4157896lfd.35.1445451181514; Wed, 21 Oct 2015 11:13:01 -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.59.35 with SMTP id w3csp136081lbq; Wed, 21 Oct 2015 11:13:00 -0700 (PDT) X-Received: by 10.50.43.170 with SMTP id x10mr12491599igl.89.1445451180532; Wed, 21 Oct 2015 11:13:00 -0700 (PDT) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id y143si8433759iod.53.2015.10.21.11.13.00 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Oct 2015 11:13:00 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-64370-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 40629 invoked by alias); 21 Oct 2015 18:12:49 -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 40614 invoked by uid 89); 21 Oct 2015 18:12:48 -0000 X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-yk0-f181.google.com X-Received: by 10.13.216.141 with SMTP id a135mr7757380ywe.12.1445451164117; Wed, 21 Oct 2015 11:12:44 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH] Cleanup sync_file_range implementation Date: Wed, 21 Oct 2015 16:12:35 -0200 Message-Id: <1445451155-23390-1-git-send-email-adhemerval.zanella@linaro.com> X-Original-Sender: adhemerval.zanella@linaro.org 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:c07::232 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=pass header.i=@sourceware.org X-Google-Group-Id: 836684582541 Since GLIBC requires a minimum 2.6.32 kernel, the patch cleanups the mips code to assume __NR_sync_file_range and the powerpc one to either assume __NR_sync_file_range2 or __NR_sync_file_range. Checked on powerpc64le and build for mips (ABIO32, ABIN32, and ABI64). * sysdeps/unix/sysv/linux/powerpc/powerpc64/sync_file_range.c (__NR_sync_file_range2): Assume it is always defined. * sysdeps/unix/sysv/linux/mips/mips32/sync_file_range.c (__NR_sync_file_range): Assume it is always defined. --- ChangeLog | 5 +++++ sysdeps/unix/sysv/linux/mips/mips32/sync_file_range.c | 11 ----------- sysdeps/unix/sysv/linux/powerpc/powerpc64/sync_file_range.c | 11 ----------- 3 files changed, 5 insertions(+), 22 deletions(-) diff --git a/sysdeps/unix/sysv/linux/mips/mips32/sync_file_range.c b/sysdeps/unix/sysv/linux/mips/mips32/sync_file_range.c index b79e44d..0d85168 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/sync_file_range.c +++ b/sysdeps/unix/sysv/linux/mips/mips32/sync_file_range.c @@ -23,8 +23,6 @@ #include #include - -#ifdef __NR_sync_file_range int sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags) { @@ -33,12 +31,3 @@ sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags) __LONG_LONG_PAIR ((long) (to >> 32), (long) to), flags); } -#else -int -sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags) -{ - __set_errno (ENOSYS); - return -1; -} -stub_warning (sync_file_range) -#endif diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/sync_file_range.c b/sysdeps/unix/sysv/linux/powerpc/powerpc64/sync_file_range.c index 9f46458..92245f9 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/sync_file_range.c +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/sync_file_range.c @@ -23,19 +23,8 @@ #include #include - -#if defined __NR_sync_file_range2 int sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags) { return SYSCALL_CANCEL (sync_file_range2, fd, flags, from, to); } -#else -int -sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags) -{ - __set_errno (ENOSYS); - return -1; -} -stub_warning (sync_file_range) -#endif