1 From 37425f422e46003ed623f8e6387bed1aa5778b96 Mon Sep 17 00:00:00 2001
2 From: Khem Raj <raj.khem@gmail.com>
3 Date: Fri, 11 Nov 2022 11:26:05 -0800
4 Subject: [PATCH] Use pread/pwrite/ftruncate/stat instead of 64bit equivalents
6 64bit functions are aliases to original functions when largefile feature
7 is enabled via autoconf or right macro is passed on compiler cmdline
11 Upstream-Status: Submitted [https://lore.kernel.org/linux-btrfs/20221215084046.122836-1-raj.khem@gmail.com/T/#u]
12 Signed-off-by: Khem Raj <raj.khem@gmail.com>
14 cmds/rescue-chunk-recover.c | 4 +-
16 kernel-shared/zoned.c | 6 +-
17 kernel-shared/zoned.h | 4 +-
19 mkfs/rootdir.c | 10 +-
20 tests/fsstress.c | 192 ++++++++++++++++++------------------
22 8 files changed, 121 insertions(+), 121 deletions(-)
24 --- a/cmds/rescue-chunk-recover.c
25 +++ b/cmds/rescue-chunk-recover.c
26 @@ -755,7 +755,7 @@ static int scan_one_device(void *dev_sca
27 if (is_super_block_address(bytenr))
28 bytenr += rc->sectorsize;
30 - if (pread64(fd, buf->data, rc->nodesize, bytenr) <
31 + if (pread(fd, buf->data, rc->nodesize, bytenr) <
35 @@ -1875,7 +1875,7 @@ static int check_one_csum(int fd, u64 st
39 - ret = pread64(fd, data, len, start);
40 + ret = pread(fd, data, len, start);
41 if (ret < 0 || ret != len) {
46 @@ -691,7 +691,7 @@ static int flush_pending(struct metadump
47 if (start == BTRFS_SUPER_INFO_OFFSET) {
48 int fd = get_dev_fd(md->root);
50 - ret = pread64(fd, async->buffer, size, start);
51 + ret = pread(fd, async->buffer, size, start);
55 @@ -1366,7 +1366,7 @@ static void write_backup_supers(int fd,
57 btrfs_set_super_bytenr(super, bytenr);
58 csum_block(buf, BTRFS_SUPER_INFO_SIZE);
59 - ret = pwrite64(fd, buf, BTRFS_SUPER_INFO_SIZE, bytenr);
60 + ret = pwrite(fd, buf, BTRFS_SUPER_INFO_SIZE, bytenr);
61 if (ret < BTRFS_SUPER_INFO_SIZE) {
64 @@ -1487,12 +1487,12 @@ static int restore_one_work(struct mdres
68 - ret = pwrite64(outfd, buffer + offset, chunk_size, bytenr);
69 + ret = pwrite(outfd, buffer + offset, chunk_size, bytenr);
70 if (ret != chunk_size)
74 - ret = pwrite64(outfd, buffer + offset,
75 + ret = pwrite(outfd, buffer + offset,
76 chunk_size, physical_dup);
77 if (ret != chunk_size)
79 @@ -2454,7 +2454,7 @@ static int fixup_device_size(struct btrf
81 if (S_ISREG(buf.st_mode)) {
82 /* Don't forget to enlarge the real file */
83 - ret = ftruncate64(out_fd, dev_size);
84 + ret = ftruncate(out_fd, dev_size);
86 error("failed to enlarge result image: %m");
88 @@ -2913,7 +2913,7 @@ static int restore_metadump(const char *
91 if (S_ISREG(st.st_mode) && st.st_size < dev_size) {
92 - ret = ftruncate64(fileno(out), dev_size);
93 + ret = ftruncate(fileno(out), dev_size);
96 "failed to enlarge result image file from %llu to %llu: %m",
97 @@ -3010,7 +3010,7 @@ static int update_disk_super_on_device(s
98 memcpy(dev_item->fsid, fs_uuid, BTRFS_UUID_SIZE);
99 csum_block((u8 *)&disk_super, BTRFS_SUPER_INFO_SIZE);
101 - ret = pwrite64(fp, &disk_super, BTRFS_SUPER_INFO_SIZE, BTRFS_SUPER_INFO_OFFSET);
102 + ret = pwrite(fp, &disk_super, BTRFS_SUPER_INFO_SIZE, BTRFS_SUPER_INFO_OFFSET);
103 if (ret != BTRFS_SUPER_INFO_SIZE) {
106 --- a/kernel-shared/zoned.c
107 +++ b/kernel-shared/zoned.c
108 @@ -194,7 +194,7 @@ static int sb_write_pointer(int fd, stru
109 bytenr = ((zones[i].start + zones[i].len)
110 << SECTOR_SHIFT) - BTRFS_SUPER_INFO_SIZE;
112 - ret = pread64(fd, buf[i], BTRFS_SUPER_INFO_SIZE, bytenr);
113 + ret = pread(fd, buf[i], BTRFS_SUPER_INFO_SIZE, bytenr);
114 if (ret != BTRFS_SUPER_INFO_SIZE)
116 super[i] = (struct btrfs_super_block *)&buf[i];
117 @@ -515,8 +515,8 @@ size_t btrfs_sb_io(int fd, void *buf, of
118 /* We can call pread/pwrite if 'fd' is non-zoned device/file */
119 if (zone_size_sector == 0) {
121 - return pread64(fd, buf, count, offset);
122 - return pwrite64(fd, buf, count, offset);
123 + return pread(fd, buf, count, offset);
124 + return pwrite(fd, buf, count, offset);
127 ASSERT(IS_ALIGNED(zone_size_sector, sb_size_sector));
128 --- a/kernel-shared/zoned.h
129 +++ b/kernel-shared/zoned.h
130 @@ -150,9 +150,9 @@ int btrfs_wipe_temporary_sb(struct btrfs
133 #define sbread(fd, buf, offset) \
134 - pread64(fd, buf, BTRFS_SUPER_INFO_SIZE, offset)
135 + pread(fd, buf, BTRFS_SUPER_INFO_SIZE, offset)
136 #define sbwrite(fd, buf, offset) \
137 - pwrite64(fd, buf, BTRFS_SUPER_INFO_SIZE, offset)
138 + pwrite(fd, buf, BTRFS_SUPER_INFO_SIZE, offset)
140 static inline int btrfs_reset_dev_zone(int fd, struct blk_zone *zone)
144 @@ -453,14 +453,14 @@ static int zero_output_file(int out_fd,
145 /* Only zero out the first 1M */
146 loop_num = SZ_1M / SZ_4K;
147 for (i = 0; i < loop_num; i++) {
148 - written = pwrite64(out_fd, buf, SZ_4K, location);
149 + written = pwrite(out_fd, buf, SZ_4K, location);
150 if (written != SZ_4K)
155 /* Then enlarge the file to size */
156 - written = pwrite64(out_fd, buf, 1, size - 1);
157 + written = pwrite(out_fd, buf, 1, size - 1);
163 @@ -340,7 +340,7 @@ static int add_file_items(struct btrfs_t
167 - ret_read = pread64(fd, buffer, st->st_size, bytes_read);
168 + ret_read = pread(fd, buffer, st->st_size, bytes_read);
169 if (ret_read == -1) {
170 error("cannot read %s at offset %llu length %llu: %m",
171 path_name, bytes_read, (unsigned long long)st->st_size);
172 @@ -386,7 +386,7 @@ again:
174 memset(eb->data, 0, sectorsize);
176 - ret_read = pread64(fd, eb->data, sectorsize, file_pos +
177 + ret_read = pread(fd, eb->data, sectorsize, file_pos +
179 if (ret_read == -1) {
180 error("cannot read %s at offset %llu length %u: %m",
181 @@ -929,7 +929,7 @@ int btrfs_mkfs_shrink_fs(struct btrfs_fs
183 struct btrfs_device *device;
184 struct list_head *cur;
185 - struct stat64 file_stat;
186 + struct stat file_stat;
190 @@ -963,14 +963,14 @@ int btrfs_mkfs_shrink_fs(struct btrfs_fs
191 *new_size_ret = new_size;
193 if (shrink_file_size) {
194 - ret = fstat64(device->fd, &file_stat);
195 + ret = fstat(device->fd, &file_stat);
197 error("failed to stat devid %llu: %m", device->devid);
200 if (!S_ISREG(file_stat.st_mode))
202 - ret = ftruncate64(device->fd, new_size);
203 + ret = ftruncate(device->fd, new_size);
205 error("failed to truncate device file of devid %llu: %m",
207 --- a/tests/fsstress.c
208 +++ b/tests/fsstress.c
209 @@ -458,7 +458,7 @@ int get_fname(int, long, pathname_t *, f
210 void init_pathname(pathname_t *);
211 int lchown_path(pathname_t *, uid_t, gid_t);
212 int link_path(pathname_t *, pathname_t *);
213 -int lstat64_path(pathname_t *, struct stat64 *);
214 +int lstat_path(pathname_t *, struct stat *);
215 void make_freq_table(void);
216 int mkdir_path(pathname_t *, mode_t);
217 int mknod_path(pathname_t *, mode_t, dev_t);
218 @@ -472,9 +472,9 @@ int rename_path(pathname_t *, pathname_t
219 int rmdir_path(pathname_t *);
220 void separate_pathname(pathname_t *, char *, pathname_t *);
221 void show_ops(int, char *);
222 -int stat64_path(pathname_t *, struct stat64 *);
223 +int stat_path(pathname_t *, struct stat *);
224 int symlink_path(const char *, pathname_t *);
225 -int truncate64_path(pathname_t *, off64_t);
226 +int truncate_path(pathname_t *, off64_t);
227 int unlink_path(pathname_t *);
229 void write_freq(void);
230 @@ -998,12 +998,12 @@ void
234 - struct stat64 statbuf;
235 + struct stat statbuf;
238 - ret = stat64(".", &statbuf);
239 + ret = stat(".", &statbuf);
241 - fprintf(stderr, "fsstress: check_cwd stat64() returned %d with errno: %d (%m)\n",
242 + fprintf(stderr, "fsstress: check_cwd stat() returned %d with errno: %d (%m)\n",
246 @@ -1171,7 +1171,7 @@ again:
250 - struct stat64 statbuf;
251 + struct stat statbuf;
255 @@ -1182,7 +1182,7 @@ doproc(void)
256 dividend = (operations + execute_freq) / (execute_freq + 1);
257 sprintf(buf, "p%x", procid);
258 (void)mkdir(buf, 0777);
259 - if (chdir(buf) < 0 || stat64(".", &statbuf) < 0) {
260 + if (chdir(buf) < 0 || stat(".", &statbuf) < 0) {
264 @@ -1214,7 +1214,7 @@ doproc(void)
265 * the forced shutdown happened.
267 if (errtag != 0 && opno % 100 == 0) {
268 - rval = stat64(".", &statbuf);
269 + rval = stat(".", &statbuf);
271 fprintf(stderr, "Detected EIO\n");
273 @@ -1537,18 +1537,18 @@ link_path(pathname_t *name1, pathname_t
277 -lstat64_path(pathname_t *name, struct stat64 *sbuf)
278 +lstat_path(pathname_t *name, struct stat *sbuf)
280 char buf[NAME_MAX + 1];
284 - rval = lstat64(name->path, sbuf);
285 + rval = lstat(name->path, sbuf);
286 if (rval >= 0 || errno != ENAMETOOLONG)
288 separate_pathname(name, buf, &newname);
289 if (chdir(buf) == 0) {
290 - rval = lstat64_path(&newname, sbuf);
291 + rval = lstat_path(&newname, sbuf);
292 assert(chdir("..") == 0);
294 free_pathname(&newname);
295 @@ -1870,18 +1870,18 @@ show_ops(int flag, char *lead_str)
299 -stat64_path(pathname_t *name, struct stat64 *sbuf)
300 +stat_path(pathname_t *name, struct stat *sbuf)
302 char buf[NAME_MAX + 1];
306 - rval = stat64(name->path, sbuf);
307 + rval = stat(name->path, sbuf);
308 if (rval >= 0 || errno != ENAMETOOLONG)
310 separate_pathname(name, buf, &newname);
311 if (chdir(buf) == 0) {
312 - rval = stat64_path(&newname, sbuf);
313 + rval = stat_path(&newname, sbuf);
314 assert(chdir("..") == 0);
316 free_pathname(&newname);
317 @@ -1913,18 +1913,18 @@ symlink_path(const char *name1, pathname
321 -truncate64_path(pathname_t *name, off64_t length)
322 +truncate_path(pathname_t *name, off64_t length)
324 char buf[NAME_MAX + 1];
328 - rval = truncate64(name->path, length);
329 + rval = truncate(name->path, length);
330 if (rval >= 0 || errno != ENAMETOOLONG)
332 separate_pathname(name, buf, &newname);
333 if (chdir(buf) == 0) {
334 - rval = truncate64_path(&newname, length);
335 + rval = truncate_path(&newname, length);
336 assert(chdir("..") == 0);
338 free_pathname(&newname);
339 @@ -2026,7 +2026,7 @@ non_btrfs_freq(const char *path)
340 ops[btrfs_ops[i]].freq = 0;
343 -void inode_info(char *str, size_t sz, struct stat64 *s, int verbose)
344 +void inode_info(char *str, size_t sz, struct stat *s, int verbose)
347 snprintf(str, sz, "[%ld %ld %d %d %lld %lld]",
348 @@ -2101,7 +2101,7 @@ allocsp_f(opnum_t opno, long r)
349 struct xfs_flock64 fl;
357 @@ -2122,9 +2122,9 @@ allocsp_f(opnum_t opno, long r)
361 - if (fstat64(fd, &stb) < 0) {
362 + if (fstat(fd, &stb) < 0) {
364 - printf("%d/%lld: allocsp - fstat64 %s failed %d\n",
365 + printf("%d/%lld: allocsp - fstat %s failed %d\n",
366 procid, opno, f.path, errno);
369 @@ -2160,7 +2160,7 @@ do_aio_rw(opnum_t opno, long r, int flag
378 @@ -2184,9 +2184,9 @@ do_aio_rw(opnum_t opno, long r, int flag
379 procid, opno, f.path, e);
382 - if (fstat64(fd, &stb) < 0) {
383 + if (fstat(fd, &stb) < 0) {
385 - printf("%d/%lld: do_aio_rw - fstat64 %s failed %d\n",
386 + printf("%d/%lld: do_aio_rw - fstat %s failed %d\n",
387 procid, opno, f.path, errno);
390 @@ -2278,7 +2278,7 @@ do_uring_rw(opnum_t opno, long r, int fl
398 struct io_uring_sqe *sqe;
399 @@ -2304,9 +2304,9 @@ do_uring_rw(opnum_t opno, long r, int fl
400 procid, opno, f.path, e);
403 - if (fstat64(fd, &stb) < 0) {
404 + if (fstat(fd, &stb) < 0) {
406 - printf("%d/%lld: do_uring_rw - fstat64 %s failed %d\n",
407 + printf("%d/%lld: do_uring_rw - fstat %s failed %d\n",
408 procid, opno, f.path, errno);
411 @@ -2522,7 +2522,7 @@ bulkstat1_f(opnum_t opno, long r)
419 struct xfs_fsop_bulkreq bsr;
420 @@ -2534,7 +2534,7 @@ bulkstat1_f(opnum_t opno, long r)
422 if (!get_fname(FT_ANYm, r, &f, NULL, NULL, &v))
423 append_pathname(&f, ".");
424 - ino = stat64_path(&f, &s) < 0 ? (ino64_t)r : s.st_ino;
425 + ino = stat_path(&f, &s) < 0 ? (ino64_t)r : s.st_ino;
429 @@ -2605,8 +2605,8 @@ clonerange_f(
430 struct file_clone_range fcr;
431 struct pathname fpath1;
432 struct pathname fpath2;
433 - struct stat64 stat1;
434 - struct stat64 stat2;
440 @@ -2660,17 +2660,17 @@ clonerange_f(
444 - if (fstat64(fd1, &stat1) < 0) {
445 + if (fstat(fd1, &stat1) < 0) {
447 - printf("%d/%lld: clonerange read - fstat64 %s failed %d\n",
448 + printf("%d/%lld: clonerange read - fstat %s failed %d\n",
449 procid, opno, fpath1.path, errno);
452 inode_info(inoinfo1, sizeof(inoinfo1), &stat1, v1);
454 - if (fstat64(fd2, &stat2) < 0) {
455 + if (fstat(fd2, &stat2) < 0) {
457 - printf("%d/%lld: clonerange write - fstat64 %s failed %d\n",
458 + printf("%d/%lld: clonerange write - fstat %s failed %d\n",
459 procid, opno, fpath2.path, errno);
462 @@ -2743,8 +2743,8 @@ copyrange_f(
463 #ifdef HAVE_COPY_FILE_RANGE
464 struct pathname fpath1;
465 struct pathname fpath2;
466 - struct stat64 stat1;
467 - struct stat64 stat2;
473 @@ -2802,17 +2802,17 @@ copyrange_f(
477 - if (fstat64(fd1, &stat1) < 0) {
478 + if (fstat(fd1, &stat1) < 0) {
480 - printf("%d/%lld: copyrange read - fstat64 %s failed %d\n",
481 + printf("%d/%lld: copyrange read - fstat %s failed %d\n",
482 procid, opno, fpath1.path, errno);
485 inode_info(inoinfo1, sizeof(inoinfo1), &stat1, v1);
487 - if (fstat64(fd2, &stat2) < 0) {
488 + if (fstat(fd2, &stat2) < 0) {
490 - printf("%d/%lld: copyrange write - fstat64 %s failed %d\n",
491 + printf("%d/%lld: copyrange write - fstat %s failed %d\n",
492 procid, opno, fpath2.path, errno);
495 @@ -2900,7 +2900,7 @@ deduperange_f(
497 struct file_dedupe_range *fdr;
498 struct pathname *fpath;
499 - struct stat64 *stat;
504 @@ -2938,7 +2938,7 @@ deduperange_f(
508 - stat = calloc(nr, sizeof(struct stat64));
509 + stat = calloc(nr, sizeof(struct stat));
511 printf("%d/%lld: line %d error %d\n",
512 procid, opno, __LINE__, errno);
513 @@ -3017,9 +3017,9 @@ deduperange_f(
517 - if (fstat64(fd[0], &stat[0]) < 0) {
518 + if (fstat(fd[0], &stat[0]) < 0) {
520 - printf("%d/%lld: deduperange read - fstat64 %s failed %d\n",
521 + printf("%d/%lld: deduperange read - fstat %s failed %d\n",
522 procid, opno, fpath[0].path, errno);
525 @@ -3027,9 +3027,9 @@ deduperange_f(
526 inode_info(&info[0], INFO_SZ, &stat[0], v[0]);
528 for (i = 1; i < nr; i++) {
529 - if (fstat64(fd[i], &stat[i]) < 0) {
530 + if (fstat(fd[i], &stat[i]) < 0) {
532 - printf("%d/%lld: deduperange write - fstat64 %s failed %d\n",
533 + printf("%d/%lld: deduperange write - fstat %s failed %d\n",
534 procid, opno, fpath[i].path, errno);
537 @@ -3179,8 +3179,8 @@ splice_f(opnum_t opno, long r)
539 struct pathname fpath1;
540 struct pathname fpath2;
541 - struct stat64 stat1;
542 - struct stat64 stat2;
548 @@ -3237,17 +3237,17 @@ splice_f(opnum_t opno, long r)
552 - if (fstat64(fd1, &stat1) < 0) {
553 + if (fstat(fd1, &stat1) < 0) {
555 - printf("%d/%lld: splice read - fstat64 %s failed %d\n",
556 + printf("%d/%lld: splice read - fstat %s failed %d\n",
557 procid, opno, fpath1.path, errno);
560 inode_info(inoinfo1, sizeof(inoinfo1), &stat1, v1);
562 - if (fstat64(fd2, &stat2) < 0) {
563 + if (fstat(fd2, &stat2) < 0) {
565 - printf("%d/%lld: splice write - fstat64 %s failed %d\n",
566 + printf("%d/%lld: splice write - fstat %s failed %d\n",
567 procid, opno, fpath2.path, errno);
570 @@ -3432,7 +3432,7 @@ dread_f(opnum_t opno, long r)
579 @@ -3454,9 +3454,9 @@ dread_f(opnum_t opno, long r)
583 - if (fstat64(fd, &stb) < 0) {
584 + if (fstat(fd, &stb) < 0) {
586 - printf("%d/%lld: dread - fstat64 %s failed %d\n",
587 + printf("%d/%lld: dread - fstat %s failed %d\n",
588 procid, opno, f.path, errno);
591 @@ -3522,7 +3522,7 @@ dwrite_f(opnum_t opno, long r)
600 @@ -3544,9 +3544,9 @@ dwrite_f(opnum_t opno, long r)
604 - if (fstat64(fd, &stb) < 0) {
605 + if (fstat(fd, &stb) < 0) {
607 - printf("%d/%lld: dwrite - fstat64 %s failed %d\n",
608 + printf("%d/%lld: dwrite - fstat %s failed %d\n",
609 procid, opno, f.path, errno);
612 @@ -3620,7 +3620,7 @@ do_fallocate(opnum_t opno, long r, int m
621 @@ -3640,9 +3640,9 @@ do_fallocate(opnum_t opno, long r, int m
625 - if (fstat64(fd, &stb) < 0) {
626 + if (fstat(fd, &stb) < 0) {
628 - printf("%d/%lld: do_fallocate - fstat64 %s failed %d\n",
629 + printf("%d/%lld: do_fallocate - fstat %s failed %d\n",
630 procid, opno, f.path, errno);
633 @@ -3734,7 +3734,7 @@ fiemap_f(opnum_t opno, long r)
642 @@ -3757,9 +3757,9 @@ fiemap_f(opnum_t opno, long r)
646 - if (fstat64(fd, &stb) < 0) {
647 + if (fstat(fd, &stb) < 0) {
649 - printf("%d/%lld: fiemap - fstat64 %s failed %d\n",
650 + printf("%d/%lld: fiemap - fstat %s failed %d\n",
651 procid, opno, f.path, errno);
654 @@ -3807,7 +3807,7 @@ freesp_f(opnum_t opno, long r)
655 struct xfs_flock64 fl;
663 @@ -3828,9 +3828,9 @@ freesp_f(opnum_t opno, long r)
667 - if (fstat64(fd, &stb) < 0) {
668 + if (fstat(fd, &stb) < 0) {
670 - printf("%d/%lld: freesp - fstat64 %s failed %d\n",
671 + printf("%d/%lld: freesp - fstat %s failed %d\n",
672 procid, opno, f.path, errno);
675 @@ -4226,7 +4226,7 @@ do_mmap(opnum_t opno, long r, int prot)
683 sigjmp_buf sigbus_jmpbuf;
684 @@ -4248,9 +4248,9 @@ do_mmap(opnum_t opno, long r, int prot)
688 - if (fstat64(fd, &stb) < 0) {
689 + if (fstat(fd, &stb) < 0) {
691 - printf("%d/%lld: do_mmap - fstat64 %s failed %d\n",
692 + printf("%d/%lld: do_mmap - fstat %s failed %d\n",
693 procid, opno, f.path, errno);
696 @@ -4370,7 +4370,7 @@ read_f(opnum_t opno, long r)
705 @@ -4391,9 +4391,9 @@ read_f(opnum_t opno, long r)
709 - if (fstat64(fd, &stb) < 0) {
710 + if (fstat(fd, &stb) < 0) {
712 - printf("%d/%lld: read - fstat64 %s failed %d\n",
713 + printf("%d/%lld: read - fstat %s failed %d\n",
714 procid, opno, f.path, errno);
717 @@ -4454,7 +4454,7 @@ readv_f(opnum_t opno, long r)
725 struct iovec *iov = NULL;
726 @@ -4480,9 +4480,9 @@ readv_f(opnum_t opno, long r)
730 - if (fstat64(fd, &stb) < 0) {
731 + if (fstat(fd, &stb) < 0) {
733 - printf("%d/%lld: readv - fstat64 %s failed %d\n",
734 + printf("%d/%lld: readv - fstat %s failed %d\n",
735 procid, opno, f.path, errno);
738 @@ -4739,7 +4739,7 @@ resvsp_f(opnum_t opno, long r)
739 struct xfs_flock64 fl;
747 @@ -4760,9 +4760,9 @@ resvsp_f(opnum_t opno, long r)
751 - if (fstat64(fd, &stb) < 0) {
752 + if (fstat(fd, &stb) < 0) {
754 - printf("%d/%lld: resvsp - fstat64 %s failed %d\n",
755 + printf("%d/%lld: resvsp - fstat %s failed %d\n",
756 procid, opno, f.path, errno);
759 @@ -4971,7 +4971,7 @@ stat_f(opnum_t opno, long r)
768 @@ -4981,7 +4981,7 @@ stat_f(opnum_t opno, long r)
772 - e = lstat64_path(&f, &stb) < 0 ? errno : 0;
773 + e = lstat_path(&f, &stb) < 0 ? errno : 0;
776 printf("%d/%lld: stat %s %d\n", procid, opno, f.path, e);
777 @@ -5133,7 +5133,7 @@ truncate_f(opnum_t opno, long r)
786 @@ -5144,11 +5144,11 @@ truncate_f(opnum_t opno, long r)
790 - e = stat64_path(&f, &stb) < 0 ? errno : 0;
791 + e = stat_path(&f, &stb) < 0 ? errno : 0;
795 - printf("%d/%lld: truncate - stat64 %s failed %d\n",
796 + printf("%d/%lld: truncate - stat %s failed %d\n",
797 procid, opno, f.path, e);
800 @@ -5157,7 +5157,7 @@ truncate_f(opnum_t opno, long r)
801 lr = ((int64_t)random() << 32) + random();
802 off = (off64_t)(lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
804 - e = truncate64_path(&f, off) < 0 ? errno : 0;
805 + e = truncate_path(&f, off) < 0 ? errno : 0;
808 printf("%d/%lld: truncate %s%s %lld %d\n", procid, opno, f.path,
809 @@ -5209,7 +5209,7 @@ unresvsp_f(opnum_t opno, long r)
810 struct xfs_flock64 fl;
818 @@ -5230,9 +5230,9 @@ unresvsp_f(opnum_t opno, long r)
822 - if (fstat64(fd, &stb) < 0) {
823 + if (fstat(fd, &stb) < 0) {
825 - printf("%d/%lld: unresvsp - fstat64 %s failed %d\n",
826 + printf("%d/%lld: unresvsp - fstat %s failed %d\n",
827 procid, opno, f.path, errno);
830 @@ -5281,7 +5281,7 @@ write_f(opnum_t opno, long r)
839 @@ -5302,9 +5302,9 @@ write_f(opnum_t opno, long r)
843 - if (fstat64(fd, &stb) < 0) {
844 + if (fstat(fd, &stb) < 0) {
846 - printf("%d/%lld: write - fstat64 %s failed %d\n",
847 + printf("%d/%lld: write - fstat %s failed %d\n",
848 procid, opno, f.path, errno);
851 @@ -5337,7 +5337,7 @@ writev_f(opnum_t opno, long r)
859 struct iovec *iov = NULL;
860 @@ -5363,9 +5363,9 @@ writev_f(opnum_t opno, long r)
864 - if (fstat64(fd, &stb) < 0) {
865 + if (fstat(fd, &stb) < 0) {
867 - printf("%d/%lld: writev - fstat64 %s failed %d\n",
868 + printf("%d/%lld: writev - fstat %s failed %d\n",
869 procid, opno, f.path, errno);
874 @@ -519,9 +519,9 @@ sum(int dirfd, int level, sum_t *dircs,
876 sum_file_data_t sum_file_data = flags[FLAG_STRUCTURE] ?
877 sum_file_data_strict : sum_file_data_permissive;
878 - struct stat64 dir_st;
879 + struct stat dir_st;
881 - if (fstat64(dirfd, &dir_st)) {
882 + if (fstat(dirfd, &dir_st)) {
886 @@ -552,7 +552,7 @@ sum(int dirfd, int level, sum_t *dircs,
888 qsort(namelist, entries, sizeof(*namelist), namecmp);
889 for (i = 0; i < entries; ++i) {
895 @@ -572,7 +572,7 @@ sum(int dirfd, int level, sum_t *dircs,
899 - ret = lstat64(namelist[i], &st);
900 + ret = lstat(namelist[i], &st);
902 fprintf(stderr, "stat failed for %s/%s: %m\n",