]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfsprogs: replace lseek64 by equivalent lseek
authorFelix Janda <felix.janda@posteo.de>
Tue, 1 Nov 2016 01:38:29 +0000 (12:38 +1100)
committerDave Chinner <david@fromorbit.com>
Tue, 1 Nov 2016 01:38:29 +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>
12 files changed:
copy/xfs_copy.c
fsr/xfs_fsr.c
include/darwin.h
include/freebsd.h
io/pread.c
io/seek.c
libxfs/rdwr.c
logprint/log_misc.c
logprint/logprint.c
po/de.po
po/pl.po
repair/sb.c

index cad38114cf6c4adb393cd01735ceca70f803b24d..a2aceed806d2057eb26528ecd77d1fa0de04c09f 100644 (file)
@@ -162,7 +162,7 @@ check_errors(void)
                        if (target[i].err_type == 0)
                                do_log(_("write error"));
                        else
-                               do_log(_("lseek64 error"));
+                               do_log(_("lseek error"));
                        do_log(_(" at offset %lld\n"), target[i].position);
                }
        }
@@ -192,7 +192,7 @@ do_write(
                buf = &w_buf;
 
        if (target[args->id].position != buf->position)  {
-               if (lseek64(args->fd, buf->position, SEEK_SET) < 0)  {
+               if (lseek(args->fd, buf->position, SEEK_SET) < 0)  {
                        error = target[args->id].err_type = 1;
                } else  {
                        target[args->id].position = buf->position;
@@ -263,7 +263,7 @@ handler(int sig)
                                                target[i].position);
                                } else  {
                                        do_warn(
-               _("%s:  lseek64 error on target %d \"%s\" at offset %lld\n"),
+               _("%s:  lseek error on target %d \"%s\" at offset %lld\n"),
                                                progname, i, target[i].name,
                                                target[i].position);
                                }
@@ -388,9 +388,9 @@ read_wbuf(int fd, wbuf *buf, xfs_mount_t *mp)
        }
 
        if (source_position != buf->position)  {
-               lres = lseek64(fd, buf->position, SEEK_SET);
+               lres = lseek(fd, buf->position, SEEK_SET);
                if (lres < 0LL)  {
-                       do_warn(_("%s:  lseek64 failure at offset %lld\n"),
+                       do_warn(_("%s:  lseek failure at offset %lld\n"),
                                progname, source_position);
                        die_perror();
                }
index d87d02060ab6d0d7a7991d6886d88c0c988eacf5..98390e7065b7494f4d358950c693f5f36ae175b8 100644 (file)
@@ -1318,7 +1318,7 @@ packfile(char *fname, char *tname, int fd,
                                fsrprintf(_("could not trunc tmp %s\n"),
                                           tname);
                        }
-                       if (lseek64(tfd, outmap[extent].bmv_length, SEEK_CUR) < 0) {
+                       if (lseek(tfd, outmap[extent].bmv_length, SEEK_CUR) < 0) {
                                fsrprintf(_("could not lseek in tmpfile: %s : %s\n"),
                                   tname, strerror(errno));
                                goto out;
@@ -1338,7 +1338,7 @@ packfile(char *fname, char *tname, int fd,
                                        " %s\n"), tname);
                                goto out;
                        }
-                       if (lseek64(tfd, outmap[extent].bmv_length, SEEK_CUR) < 0) {
+                       if (lseek(tfd, outmap[extent].bmv_length, SEEK_CUR) < 0) {
                                fsrprintf(_("could not lseek in tmpfile: %s : %s\n"),
                                   tname, strerror(errno));
                                goto out;
@@ -1346,7 +1346,7 @@ packfile(char *fname, char *tname, int fd,
                }
        } /* end of space allocation loop */
 
-       if (lseek64(tfd, 0, SEEK_SET)) {
+       if (lseek(tfd, 0, SEEK_SET)) {
                fsrprintf(_("Couldn't rewind on temporary file\n"));
                goto out;
        }
@@ -1366,12 +1366,12 @@ packfile(char *fname, char *tname, int fd,
        for (extent = 0; extent < nextents; extent++) {
                pos = outmap[extent].bmv_offset;
                if (outmap[extent].bmv_block == -1) {
-                       if (lseek64(tfd, outmap[extent].bmv_length, SEEK_CUR) < 0) {
+                       if (lseek(tfd, outmap[extent].bmv_length, SEEK_CUR) < 0) {
                                fsrprintf(_("could not lseek in tmpfile: %s : %s\n"),
                                   tname, strerror(errno));
                                goto out;
                        }
-                       if (lseek64(fd, outmap[extent].bmv_length, SEEK_CUR) < 0) {
+                       if (lseek(fd, outmap[extent].bmv_length, SEEK_CUR) < 0) {
                                fsrprintf(_("could not lseek in file: %s : %s\n"),
                                   fname, strerror(errno));
                                goto out;
index 063f6fb446b2f027df21b07a5739a0e98c139af1..e342170bfba0a5b657be6e0f3423992f4e28c787 100644 (file)
@@ -142,7 +142,6 @@ typedef u_int32_t   xfs_dev_t;
 typedef int64_t                xfs_daddr_t;
 typedef __u32          xfs_nlink_t;
 
-#define lseek64                lseek
 #define pread64                pread
 #define pwrite64       pwrite
 #define fdatasync      fsync
index 8029802b9dced19b1868fb6b79aac6dbd8cee502..0d6ce51ccbb71794beb02aeffd6d8d7e878cfca2 100644 (file)
@@ -34,7 +34,6 @@
 #define __LITTLE_ENDIAN        LITTLE_ENDIAN
 
 /* FreeBSD file API is 64-bit aware */
-#define lseek64                lseek
 #define pwrite64       pwrite
 #define pread64                pread
 #define fdatasync      fsync
index b98355f5baaf0c09fa0ded765aed12a85a9f760c..cafead0e7239ac2a42394715d7660799a38c0ac0 100644 (file)
@@ -233,7 +233,7 @@ read_random(
        int             ops = 0;
 
        srandom(seed);
-       end = lseek64(fd, 0, SEEK_END);
+       end = lseek(fd, 0, SEEK_END);
        offset = (eof || offset > end) ? end : offset;
        if ((bytes = (offset % buffersize)))
                offset -= bytes;
@@ -279,8 +279,8 @@ read_backward(
        long long       cnt = *count;
        int             ops = 0;
 
-       end = lseek64(fd, 0, SEEK_END);
-       off = eof ? end : min(end, lseek64(fd, off, SEEK_SET));
+       end = lseek(fd, 0, SEEK_END);
+       off = eof ? end : min(end, lseek(fd, off, SEEK_SET));
        if ((end = off - cnt) < 0) {
                cnt += end;     /* subtraction, end is negative */
                end = 0;
index 35a369e6a355458d85da6ed717625f8424767e16..d06375dc1d0b509293bbc94786c47846777204d1 100644 (file)
--- a/io/seek.c
+++ b/io/seek.c
@@ -147,7 +147,7 @@ seek_f(
         * decide if we want to display that type of entry.
         */
        if (flag & SEEK_HFLAG) {
-               offset = lseek64(file->fd, start, SEEK_HOLE);
+               offset = lseek(file->fd, start, SEEK_HOLE);
                if ((start == offset) || !(flag & SEEK_DFLAG)) {
                        /*
                         * this offset is a hole or are only displaying holes.
@@ -162,7 +162,7 @@ seek_f(
 
        /* The offset is not a hole, or we are looking just for data */
        current = DATA;
-       offset = lseek64(file->fd, start, SEEK_DATA);
+       offset = lseek(file->fd, start, SEEK_DATA);
 
 found_hole:
        /*
@@ -202,7 +202,7 @@ found_hole:
 
                current ^= 1;           /* alternate between data and hole */
                start = offset;
-               offset = lseek64(file->fd, start, seekinfo[current].seektype);
+               offset = lseek(file->fd, start, seekinfo[current].seektype);
        }
        return 0;
 }
index 0fea9cb2bb72cfe5f6d7044a1b8a86364f70fe1c..ab5c91664402369e971d81bd2b9ce632c491348b 100644 (file)
@@ -88,7 +88,7 @@ libxfs_device_zero(struct xfs_buftarg *btp, xfs_daddr_t start, uint len)
        fd = libxfs_device_to_fd(btp->dev);
        start_offset = LIBXFS_BBTOOFF64(start);
 
-       if ((lseek64(fd, start_offset, SEEK_SET)) < 0) {
+       if ((lseek(fd, start_offset, SEEK_SET)) < 0) {
                fprintf(stderr, _("%s: %s seek to offset %llu failed: %s\n"),
                        progname, __FUNCTION__,
                        (unsigned long long)start_offset, strerror(errno));
index 6dc0ed4b2e4c8e8332e842dbb2ece1f5bbce56e1..a0f1766e880f5f73e05aaac15e3fcf0410669aea 100644 (file)
@@ -751,8 +751,8 @@ xlog_print_lseek(struct xlog *log, int fd, xfs_daddr_t blkno, int whence)
                offset = BBTOOFF64(blkno+log->l_logBBstart);
        else
                offset = BBTOOFF64(blkno);
-       if (lseek64(fd, offset, whence) < 0) {
-               fprintf(stderr, _("%s: lseek64 to %lld failed: %s\n"),
+       if (lseek(fd, offset, whence) < 0) {
+               fprintf(stderr, _("%s: lseek to %lld failed: %s\n"),
                        progname, (long long)offset, strerror(errno));
                exit(1);
        }
index a5c9b324e194d71dff91822c872b19ea47e25b0a..37b8cb9116d136fa356b770974bf77bf8ff70952 100644 (file)
@@ -80,7 +80,7 @@ logstat(xfs_mount_t *mp)
                        x.dname, strerror(errno));
                exit(1);
        }
-       lseek64(fd, 0, SEEK_SET);
+       lseek(fd, 0, SEEK_SET);
        if (read(fd, buf, sizeof(buf)) != sizeof(buf)) {
                fprintf(stderr, _("    read of XFS superblock failed\n"));
                exit(1);
index 61a60f3ea0921398eb4b2265eebd1856e295a5f8..ff1930e2ffd79cbea90ecf35a53a7ac72065cbe9 100644 (file)
--- a/po/de.po
+++ b/po/de.po
@@ -45,8 +45,8 @@ msgid "write error"
 msgstr "Schreibfehler"
 
 #: .././copy/xfs_copy.c:146
-msgid "lseek64 error"
-msgstr "lseek64-Fehler"
+msgid "lseek error"
+msgstr "lseek-Fehler"
 
 #: .././copy/xfs_copy.c:147
 #, c-format
@@ -70,8 +70,8 @@ msgstr "%s: Schreibfehler auf Ziel %d »%s« bei Versatz %lld\n"
 
 #: .././copy/xfs_copy.c:260
 #, c-format
-msgid "%s:  lseek64 error on target %d \"%s\" at offset %lld\n"
-msgstr "%s: lseek64-Fehler auf Ziel %d »%s« bei Versatz %lld\n"
+msgid "%s:  lseek error on target %d \"%s\" at offset %lld\n"
+msgstr "%s: lseek-Fehler auf Ziel %d »%s« bei Versatz %lld\n"
 
 #: .././copy/xfs_copy.c:266
 #, c-format
@@ -104,8 +104,8 @@ msgstr "Aufruf: %s [-bd] [-L Protokolldatei] Quelle Ziel [Ziel ...]\n"
 
 #: .././copy/xfs_copy.c:386
 #, c-format
-msgid "%s:  lseek64 failure at offset %lld\n"
-msgstr "%s:  lseek64-Fehlschlag bei Versatz %lld\n"
+msgid "%s:  lseek failure at offset %lld\n"
+msgstr "%s:  lseek-Fehlschlag bei Versatz %lld\n"
 
 #: .././copy/xfs_copy.c:401
 #, c-format
@@ -6472,8 +6472,8 @@ msgstr "DQUOT: Magische 0x%hx Markierungen 0%ho\n"
 
 #: .././logprint/log_misc.c:821
 #, c-format
-msgid "%s: lseek64 to %lld failed: %s\n"
-msgstr "%s: lseek64 auf %lld fehlgeschlagen: %s\n"
+msgid "%s: lseek to %lld failed: %s\n"
+msgstr "%s: lseek auf %lld fehlgeschlagen: %s\n"
 
 #: .././logprint/log_misc.c:864
 #, c-format
index 9d5128f17d73c9a6b083df92b555a632ea5e22bc..33a9d8107c8f4e2206261377969c5454ba49dea7 100644 (file)
--- a/po/pl.po
+++ b/po/pl.po
@@ -44,8 +44,8 @@ msgid "write error"
 msgstr "błąd zapisu"
 
 #: .././copy/xfs_copy.c:146
-msgid "lseek64 error"
-msgstr "błąd lseek64"
+msgid "lseek error"
+msgstr "błąd lseek"
 
 #: .././copy/xfs_copy.c:147
 #, c-format
@@ -69,8 +69,8 @@ msgstr "%s: błąd zapisu przy celu %d \"%s\" pod offsetem %lld\n"
 
 #: .././copy/xfs_copy.c:241
 #, c-format
-msgid "%s:  lseek64 error on target %d \"%s\" at offset %lld\n"
-msgstr "%s: błąd lseek64 przy celu %d \"%s\" pod offsetem %lld\n"
+msgid "%s:  lseek error on target %d \"%s\" at offset %lld\n"
+msgstr "%s: błąd lseek przy celu %d \"%s\" pod offsetem %lld\n"
 
 #: .././copy/xfs_copy.c:247
 #, c-format
@@ -103,8 +103,8 @@ msgstr "Składnia: %s [-bdV] [-L plik_logu] źródło cel [cel ...]\n"
 
 #: .././copy/xfs_copy.c:367
 #, c-format
-msgid "%s:  lseek64 failure at offset %lld\n"
-msgstr "%s: niepowodzenie lseek64 pod offsetem %lld\n"
+msgid "%s:  lseek failure at offset %lld\n"
+msgstr "%s: niepowodzenie lseek pod offsetem %lld\n"
 
 #: .././copy/xfs_copy.c:382
 #, c-format
@@ -6394,8 +6394,8 @@ msgstr ""
 
 #: .././logprint/log_misc.c:863
 #, c-format
-msgid "%s: lseek64 to %lld failed: %s\n"
-msgstr "%s: lseek64 na %lld nie powiodło się: %s\n"
+msgid "%s: lseek to %lld failed: %s\n"
+msgstr "%s: lseek na %lld nie powiodło się: %s\n"
 
 #: .././logprint/log_misc.c:909
 #, c-format
index ac13a663450de47aaea2bf2fe55519539b7062fc..004702c52d9a7e387e2073022fbdc2600bd37e64 100644 (file)
@@ -138,7 +138,7 @@ __find_secondary_sb(
                /*
                 * read disk 1 MByte at a time.
                 */
-               if (lseek64(x.dfd, off, SEEK_SET) != off)  {
+               if (lseek(x.dfd, off, SEEK_SET) != off)  {
                        done = 1;
                }
 
@@ -512,7 +512,7 @@ write_primary_sb(xfs_sb_t *sbp, int size)
        }
        memset(buf, 0, size);
 
-       if (lseek64(x.dfd, 0LL, SEEK_SET) != 0LL) {
+       if (lseek(x.dfd, 0LL, SEEK_SET) != 0LL) {
                free(buf);
                do_error(_("couldn't seek to offset 0 in filesystem\n"));
        }
@@ -551,7 +551,7 @@ get_sb(xfs_sb_t *sbp, xfs_off_t off, int size, xfs_agnumber_t agno)
 
        /* try and read it first */
 
-       if (lseek64(x.dfd, off, SEEK_SET) != off)  {
+       if (lseek(x.dfd, off, SEEK_SET) != off)  {
                do_warn(
        _("error reading superblock %u -- seek to offset %" PRId64 " failed\n"),
                        agno, off);