From patchwork Sat Aug 6 10:45:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felix Janda X-Patchwork-Id: 9266231 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id ED5C960754 for ; Sun, 7 Aug 2016 07:36:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E1C3B27D4D for ; Sun, 7 Aug 2016 07:36:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D683627F88; Sun, 7 Aug 2016 07:36:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.2 required=2.0 tests=BAYES_00, DATE_IN_PAST_12_24, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from oss.sgi.com (oss.sgi.com [192.48.182.195]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 73F1327D4D for ; Sun, 7 Aug 2016 07:36:26 +0000 (UTC) Received: from oss.sgi.com (localhost [IPv6:::1]) by oss.sgi.com (Postfix) with ESMTP id 514547CFB; Sun, 7 Aug 2016 02:35:55 -0500 (CDT) X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id C45047CDC for ; Sun, 7 Aug 2016 02:35:50 -0500 (CDT) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 7D6BC8F8035 for ; Sun, 7 Aug 2016 00:35:50 -0700 (PDT) X-ASG-Debug-ID: 1470555347-0bf57b369e48b120001-NocioJ Received: from mout02.posteo.de (mout02.posteo.de [185.67.36.66]) by cuda.sgi.com with ESMTP id UzXzfK1KjuTLBJ5W (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Sun, 07 Aug 2016 00:35:48 -0700 (PDT) X-Barracuda-Envelope-From: felix.janda@posteo.de X-Barracuda-Effective-Source-IP: mout02.posteo.de[185.67.36.66] X-Barracuda-Apparent-Source-IP: 185.67.36.66 Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 224D520A78 for ; Sun, 7 Aug 2016 09:35:47 +0200 (CEST) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 3s6XQV4hsFz1043 for ; Sun, 7 Aug 2016 09:35:46 +0200 (CEST) X-Mailbox-Line: From 54046df0c8591a0c5678dee87a8c8aba02ea1d88 Mon Sep 17 00:00:00 2001 Message-Id: <54046df0c8591a0c5678dee87a8c8aba02ea1d88.1470555003.git.felix.janda@posteo.de> In-Reply-To: References: From: Felix Janda Date: Sat, 6 Aug 2016 12:45:52 +0200 Subject: [PATCH xfsprogs 08/14] replace pread64 by equivalent pread To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH xfsprogs 08/14] replace pread64 by equivalent pread X-Barracuda-Connect: mout02.posteo.de[185.67.36.66] X-Barracuda-Start-Time: 1470555348 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Barracuda-Scan-Msg-Size: 2824 X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.81 X-Barracuda-Spam-Status: No, SCORE=0.81 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=DATE_IN_PAST_12_24, DATE_IN_PAST_12_24_2 X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.31809 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.01 DATE_IN_PAST_12_24 Date: is 12 to 24 hours before Received: date 0.80 DATE_IN_PAST_12_24_2 DATE_IN_PAST_12_24_2 X-BeenThere: xfs@oss.sgi.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: XFS Filesystem from SGI List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xfs-bounces@oss.sgi.com Sender: xfs-bounces@oss.sgi.com X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Felix Janda Reviewed-by: Christoph Hellwig --- include/darwin.h | 1 - include/freebsd.h | 1 - io/pread.c | 10 +++++----- libxfs/rdwr.c | 2 +- repair/prefetch.c | 2 +- 5 files changed, 7 insertions(+), 9 deletions(-) diff --git a/include/darwin.h b/include/darwin.h index 850d733..f4dbd9f 100644 --- a/include/darwin.h +++ b/include/darwin.h @@ -141,7 +141,6 @@ typedef u_int64_t xfs_ino_t; typedef u_int32_t xfs_dev_t; typedef int64_t xfs_daddr_t; -#define pread64 pread #define pwrite64 pwrite #define fdatasync fsync #define memalign(a,sz) valloc(sz) diff --git a/include/freebsd.h b/include/freebsd.h index 784e287..041dafe 100644 --- a/include/freebsd.h +++ b/include/freebsd.h @@ -35,7 +35,6 @@ /* FreeBSD file API is 64-bit aware */ #define pwrite64 pwrite -#define pread64 pread #define fdatasync fsync #define memalign(a,sz) valloc(sz) diff --git a/io/pread.c b/io/pread.c index cafead0..3395503 100644 --- a/io/pread.c +++ b/io/pread.c @@ -214,7 +214,7 @@ do_pread( ssize_t buffer_size) { if (!vectors) - return pread64(fd, buffer, min(count, buffer_size), offset); + return pread(fd, buffer, min(count, buffer_size), offset); return do_preadv(fd, offset, count, buffer_size); } @@ -254,7 +254,7 @@ read_random( if (bytes == 0) break; if (bytes < 0) { - perror("pread64"); + perror("pread"); return -1; } ops++; @@ -296,7 +296,7 @@ read_backward( if (bytes == 0) return ops; if (bytes < 0) { - perror("pread64"); + perror("pread"); return -1; } ops++; @@ -314,7 +314,7 @@ read_backward( if (bytes == 0) break; if (bytes < 0) { - perror("pread64"); + perror("pread"); return -1; } ops++; @@ -345,7 +345,7 @@ read_forward( if (bytes == 0) break; if (bytes < 0) { - perror("pread64"); + perror("pread"); return -1; } ops++; diff --git a/libxfs/rdwr.c b/libxfs/rdwr.c index cb74b3c..36c39d9 100644 --- a/libxfs/rdwr.c +++ b/libxfs/rdwr.c @@ -915,7 +915,7 @@ __read_buf(int fd, void *buf, int len, off64_t offset, int flags) { int sts; - sts = pread64(fd, buf, len, offset); + sts = pread(fd, buf, len, offset); if (sts < 0) { int error = errno; fprintf(stderr, _("%s: read failed: %s\n"), diff --git a/repair/prefetch.c b/repair/prefetch.c index b4f20d9..175594c 100644 --- a/repair/prefetch.c +++ b/repair/prefetch.c @@ -565,7 +565,7 @@ pf_batch_read( /* * now read the data and put into the xfs_but_t's */ - len = pread64(mp_fd, buf, (int)(last_off - first_off), first_off); + len = pread(mp_fd, buf, (int)(last_off - first_off), first_off); /* * Check the last buffer on the list to see if we need to