]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfsprogs: replace pread64/pwrite64 by equivalent pread/pwrite
authorFelix Janda <felix.janda@posteo.de>
Tue, 1 Nov 2016 01:38:33 +0000 (12:38 +1100)
committerDave Chinner <david@fromorbit.com>
Tue, 1 Nov 2016 01:38:33 +0000 (12:38 +1100)
Signed-off-by: Felix Janda <felix.janda@posteo.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
copy/xfs_copy.c
include/darwin.h
include/freebsd.h
io/pread.c
io/pwrite.c
libxfs/rdwr.c
mdrestore/xfs_mdrestore.c
mkfs/xfs_mkfs.c
po/de.po
po/pl.po
repair/prefetch.c

index a2aceed806d2057eb26528ecd77d1fa0de04c09f..a7da824f53ec13b5b160879cee1a57f1962669ee 100644 (file)
@@ -862,7 +862,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"),
index e342170bfba0a5b657be6e0f3423992f4e28c787..ad07346cc940931893e6701a634348cf6dc765c9 100644 (file)
@@ -142,8 +142,6 @@ typedef u_int32_t   xfs_dev_t;
 typedef int64_t                xfs_daddr_t;
 typedef __u32          xfs_nlink_t;
 
-#define pread64                pread
-#define pwrite64       pwrite
 #define fdatasync      fsync
 #define memalign(a,sz) valloc(sz)
 
index 0d6ce51ccbb71794beb02aeffd6d8d7e878cfca2..c6eb63a98455ae53f02161bb49bbc7c65c91cecf 100644 (file)
@@ -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)
 
index cafead0e7239ac2a42394715d7660799a38c0ac0..339550360d27e98af14074fcfee83645df7da14b 100644 (file)
@@ -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++;
index 67631ce5894469f92a363911d82e12fbbf400ce3..7c0bb7fb7d2bebf4332a20c4bb1d6b41651a4290 100644 (file)
@@ -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++;
index ab5c91664402369e971d81bd2b9ce632c491348b..6c8a1926234397088bcd0eb09ae18281d4ecba93 100644 (file)
@@ -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);
index 1540dcdf7b7e07c5896df36a5012d28abb0a105a..0d399f16aaa460c13bf19ce419df06e773077229 100644 (file)
@@ -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)
index ad1400fd06b89b2839e1030acf28532fc1a59c48..affa4052d62d69088adcb718862f7871b4e6fb03 100644 (file)
@@ -1127,7 +1127,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;
        }
index ff1930e2ffd79cbea90ecf35a53a7ac72065cbe9..fab26677e258bdd8321ac04285734227543db400 100644 (file)
--- 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
index 33a9d8107c8f4e2206261377969c5454ba49dea7..49209f3df06b1897b243b0f72e4e956a946b59e2 100644 (file)
--- 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
index b76a784ad8f3d5f77bc9de189ca222ce0b0711ca..ff506061389eeb06ca72db0a37466fcbab4e399a 100644 (file)
@@ -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