From patchwork Sat Aug 6 10:45:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Felix Janda X-Patchwork-Id: 9266239 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 4C02460754 for ; Sun, 7 Aug 2016 07:36:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 405FA27D4D for ; Sun, 7 Aug 2016 07:36:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3533627F88; Sun, 7 Aug 2016 07:36:56 +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 A746C27D4D for ; Sun, 7 Aug 2016 07:36:55 +0000 (UTC) Received: from oss.sgi.com (localhost [IPv6:::1]) by oss.sgi.com (Postfix) with ESMTP id 240DC7D0A; Sun, 7 Aug 2016 02:35:57 -0500 (CDT) X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id AE6187CEB for ; Sun, 7 Aug 2016 02:35:51 -0500 (CDT) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id 172F0AC006 for ; Sun, 7 Aug 2016 00:35:50 -0700 (PDT) X-ASG-Debug-ID: 1470555347-0bf57c136a420110001-NocioJ Received: from mout02.posteo.de (mout02.posteo.de [185.67.36.66]) by cuda.sgi.com with ESMTP id JPi58X2BAUNVXRr7 (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 8CE5720850 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 3s6XQW0mFJz104K for ; Sun, 7 Aug 2016 09:35:47 +0200 (CEST) X-Mailbox-Line: From e62e8eae310f54fee1391ee069e9e6d88a9c5483 Mon Sep 17 00:00:00 2001 Message-Id: In-Reply-To: References: From: Felix Janda Date: Sat, 6 Aug 2016 12:45:54 +0200 Subject: [PATCH xfsprogs 09/14] replace pwrite64 by equivalent pwrite To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH xfsprogs 09/14] replace pwrite64 by equivalent pwrite 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.15:443/cgi-mod/mark.cgi X-Barracuda-Scan-Msg-Size: 5859 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 --- copy/xfs_copy.c | 2 +- include/darwin.h | 1 - include/freebsd.h | 1 - io/pwrite.c | 10 +++++----- libxfs/rdwr.c | 6 +++--- mdrestore/xfs_mdrestore.c | 4 ++-- mkfs/xfs_mkfs.c | 2 +- po/de.po | 4 ++-- po/pl.po | 8 ++++---- 9 files changed, 18 insertions(+), 20 deletions(-) diff --git a/copy/xfs_copy.c b/copy/xfs_copy.c index cc5207d..816ab29 100644 --- a/copy/xfs_copy.c +++ b/copy/xfs_copy.c @@ -860,7 +860,7 @@ main(int argc, char **argv) off = mp->m_sb.sb_dblocks * source_blocksize; off -= sizeof(lb); - if (pwrite64(target[i].fd, lb, sizeof(lb), off) < 0) { + if (pwrite(target[i].fd, lb, sizeof(lb), off) < 0) { do_log(_("%s: failed to write last block\n"), progname); do_log(_("\tIs target \"%s\" too small?\n"), diff --git a/include/darwin.h b/include/darwin.h index f4dbd9f..fb13915 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 pwrite64 pwrite #define fdatasync fsync #define memalign(a,sz) valloc(sz) diff --git a/include/freebsd.h b/include/freebsd.h index 041dafe..df924ef 100644 --- a/include/freebsd.h +++ b/include/freebsd.h @@ -34,7 +34,6 @@ #define __LITTLE_ENDIAN LITTLE_ENDIAN /* FreeBSD file API is 64-bit aware */ -#define pwrite64 pwrite #define fdatasync fsync #define memalign(a,sz) valloc(sz) diff --git a/io/pwrite.c b/io/pwrite.c index 67631ce..7c0bb7f 100644 --- a/io/pwrite.c +++ b/io/pwrite.c @@ -101,7 +101,7 @@ do_pwrite( ssize_t buffer_size) { if (!vectors) - return pwrite64(fd, buffer, min(count, buffer_size), offset); + return pwrite(fd, buffer, min(count, buffer_size), offset); return do_pwritev(fd, offset, count, buffer_size); } @@ -137,7 +137,7 @@ write_random( if (bytes == 0) break; if (bytes < 0) { - perror("pwrite64"); + perror("pwrite"); return -1; } ops++; @@ -175,7 +175,7 @@ write_backward( if (bytes == 0) return ops; if (bytes < 0) { - perror("pwrite64"); + perror("pwrite"); return -1; } ops++; @@ -193,7 +193,7 @@ write_backward( if (bytes == 0) break; if (bytes < 0) { - perror("pwrite64"); + perror("pwrite"); return -1; } ops++; @@ -228,7 +228,7 @@ write_buffer( if (bytes == 0) break; if (bytes < 0) { - perror("pwrite64"); + perror("pwrite"); return -1; } ops++; diff --git a/libxfs/rdwr.c b/libxfs/rdwr.c index 36c39d9..8e9d86a 100644 --- a/libxfs/rdwr.c +++ b/libxfs/rdwr.c @@ -1083,16 +1083,16 @@ __write_buf(int fd, void *buf, int len, off64_t offset, int flags) { int sts; - sts = pwrite64(fd, buf, len, offset); + sts = pwrite(fd, buf, len, offset); if (sts < 0) { int error = errno; - fprintf(stderr, _("%s: pwrite64 failed: %s\n"), + fprintf(stderr, _("%s: pwrite failed: %s\n"), progname, strerror(error)); if (flags & LIBXFS_B_EXIT) exit(1); return -error; } else if (sts != len) { - fprintf(stderr, _("%s: error - pwrite64 only %d of %d bytes\n"), + fprintf(stderr, _("%s: error - pwrite only %d of %d bytes\n"), progname, sts, len); if (flags & LIBXFS_B_EXIT) exit(1); diff --git a/mdrestore/xfs_mdrestore.c b/mdrestore/xfs_mdrestore.c index 1540dcd..0d399f1 100644 --- a/mdrestore/xfs_mdrestore.c +++ b/mdrestore/xfs_mdrestore.c @@ -134,7 +134,7 @@ perform_restore( off64_t off; off = sb.sb_dblocks * sb.sb_blocksize - sizeof(lb); - if (pwrite64(dst_fd, lb, sizeof(lb), off) < 0) + if (pwrite(dst_fd, lb, sizeof(lb), off) < 0) fatal("failed to write last block, is target too " "small? (error: %s)\n", strerror(errno)); } @@ -146,7 +146,7 @@ perform_restore( print_progress("%lld MB read", bytes_read >> 20); for (cur_index = 0; cur_index < mb_count; cur_index++) { - if (pwrite64(dst_fd, &block_buffer[cur_index << + if (pwrite(dst_fd, &block_buffer[cur_index << tmb.mb_blocklog], block_size, be64_to_cpu(block_index[cur_index]) << BBSHIFT) < 0) diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c index 5d5fcb7..e038d48 100644 --- a/mkfs/xfs_mkfs.c +++ b/mkfs/xfs_mkfs.c @@ -1111,7 +1111,7 @@ zero_old_xfs_structures( off = 0; for (i = 1; i < sb.sb_agcount; i++) { off += sb.sb_agblocks; - if (pwrite64(xi->dfd, buf, new_sb->sb_sectsize, + if (pwrite(xi->dfd, buf, new_sb->sb_sectsize, off << sb.sb_blocklog) == -1) break; } diff --git a/po/de.po b/po/de.po index ff1930e..fab2667 100644 --- a/po/de.po +++ b/po/de.po @@ -5893,8 +5893,8 @@ msgstr "%s: lesen fehlgeschlagen: %s\n" #: .././libxfs/rdwr.c:502 #, c-format -msgid "%s: pwrite64 failed: %s\n" -msgstr "%s: pwrite64 fehlgeschlagen: %s\n" +msgid "%s: pwrite failed: %s\n" +msgstr "%s: pwrite fehlgeschlagen: %s\n" #: .././libxfs/rdwr.c:509 #, c-format diff --git a/po/pl.po b/po/pl.po index 33a9d81..49209f3 100644 --- a/po/pl.po +++ b/po/pl.po @@ -5940,13 +5940,13 @@ msgstr "%s: błąd - odczytano tylko %d z %d bajtów\n" #: .././libxfs/rdwr.c:878 #, c-format -msgid "%s: pwrite64 failed: %s\n" -msgstr "%s: pwrite64 nie powiodło się: %s\n" +msgid "%s: pwrite failed: %s\n" +msgstr "%s: pwrite nie powiodło się: %s\n" #: .././libxfs/rdwr.c:884 #, c-format -msgid "%s: error - pwrite64 only %d of %d bytes\n" -msgstr "%s: błąd - wykonano pwrite64 tylko %d z %d bajtów\n" +msgid "%s: error - pwrite only %d of %d bytes\n" +msgstr "%s: błąd - wykonano pwrite tylko %d z %d bajtów\n" #: .././libxfs/rdwr.c:920 #, c-format