From: Felix Janda <felix.janda@posteo.de>
To: xfs@oss.sgi.com
Subject: [PATCHv2 xfsprogs 07/14] replace pread64/pwrite64 by equivalent pread/pwrite
Date: Sat, 6 Aug 2016 12:45:52 +0200 [thread overview]
Message-ID: <721b38cd2dd2f0cfa7fd7976a1d941be3429478e.1471107858.git.felix.janda@posteo.de> (raw)
In-Reply-To: <cover.1471107858.git.felix.janda@posteo.de>
[-- Attachment #1: Type: text/plain, Size: 7488 bytes --]
Signed-off-by: Felix Janda <felix.janda@posteo.de>
---
copy/xfs_copy.c | 2 +-
include/darwin.h | 2 --
include/freebsd.h | 2 --
io/pread.c | 10 +++++-----
io/pwrite.c | 10 +++++-----
libxfs/rdwr.c | 8 ++++----
mdrestore/xfs_mdrestore.c | 4 ++--
mkfs/xfs_mkfs.c | 2 +-
po/de.po | 4 ++--
po/pl.po | 8 ++++----
repair/prefetch.c | 2 +-
11 files changed, 25 insertions(+), 29 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 850d733..fb13915 100644
--- a/include/darwin.h
+++ b/include/darwin.h
@@ -141,8 +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..df924ef 100644
--- a/include/freebsd.h
+++ b/include/freebsd.h
@@ -34,8 +34,6 @@
#define __LITTLE_ENDIAN LITTLE_ENDIAN
/* 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/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 cb74b3c..8e9d86a 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"),
@@ -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
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
--
2.7.3
[-- Attachment #2: Type: text/plain, Size: 121 bytes --]
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2016-08-13 17:25 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-13 17:04 [PATCHv2 xfsprogs 00/14] Convert from off64_t to off_t Felix Janda
2016-08-06 10:45 ` [PATCHv2 xfsprogs 04/14] replace [fl]stat64 by equivalent [fl]stat Felix Janda
2016-08-18 17:38 ` Christoph Hellwig
2016-08-06 10:45 ` [PATCHv2 xfsprogs 05/14] replace ftruncate64 by equivalent ftruncate Felix Janda
2016-08-18 17:38 ` Christoph Hellwig
2016-08-06 10:45 ` [PATCHv2 xfsprogs 06/14] replace lseek64 by equivalent lseek Felix Janda
2016-08-18 17:38 ` Christoph Hellwig
2016-08-06 10:45 ` Felix Janda [this message]
2016-08-18 17:39 ` [PATCHv2 xfsprogs 07/14] replace pread64/pwrite64 by equivalent pread/pwrite Christoph Hellwig
2016-08-06 11:03 ` [PATCHv2 xfsprogs 08/14] replace sendfile64 by equivalent sendfile Felix Janda
2016-08-18 17:39 ` Christoph Hellwig
2016-08-07 5:21 ` [PATCHv2 xfsprogs 01/14] configure: use AC_SYS_LARGEFILE Felix Janda
2016-08-18 17:37 ` Christoph Hellwig
2016-08-07 5:28 ` [PATCHv2 xfsprogs 03/14] remove unecessary definitions of _FILE_OFFSET_BITS Felix Janda
2016-08-18 17:38 ` Christoph Hellwig
2016-08-07 5:52 ` [PATCHv2 xfsprogs 14/14] platform: remove use of off64_t Felix Janda
2016-08-18 17:45 ` Christoph Hellwig
2016-08-13 16:03 ` [PATCHv2 xfsprogs 13/14] xfs.h: require transparent LFS for all users Felix Janda
2016-08-18 17:45 ` Christoph Hellwig
2016-08-13 16:03 ` [PATCHv2 xfsprogs 09/14] fadvise.c: replace posix_fadvise64 by equivalent posix_fadvise Felix Janda
2016-08-18 17:42 ` Christoph Hellwig
2016-08-13 16:17 ` [PATCHv2 xfsprogs 10/14] Makefile: disable fsr for Mac OS X Felix Janda
2016-08-18 17:43 ` Christoph Hellwig
2016-08-13 16:20 ` [PATCHv2 xfsprogs 11/14] fsr: remove workaround for statvfs on " Felix Janda
2016-08-18 17:44 ` Christoph Hellwig
2016-08-13 16:22 ` [PATCHv2 xfsprogs 12/14] replace statvfs64 by equivalent statvfs Felix Janda
2016-08-18 17:44 ` Christoph Hellwig
2016-08-13 16:50 ` [PATCHv2 xfsprogs 02/14] configure: error out when LFS does not work Felix Janda
2016-08-18 17:37 ` Christoph Hellwig
2016-08-22 3:09 ` [PATCHv2 xfsprogs 00/14] Convert from off64_t to off_t Dave Chinner
2016-08-22 7:06 ` Felix Janda
2016-08-22 11:51 ` Dave Chinner
2016-08-22 19:16 ` Felix Janda
2016-08-24 1:19 ` Dave Chinner
2016-08-24 20:47 ` Felix Janda
2016-08-25 8:04 ` Christoph Hellwig
2016-08-25 22:01 ` Dave Chinner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=721b38cd2dd2f0cfa7fd7976a1d941be3429478e.1471107858.git.felix.janda@posteo.de \
--to=felix.janda@posteo.de \
--cc=xfs@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).