aboutsummaryrefslogtreecommitdiffstats
path: root/meta-filesystems/recipes-utils/xfsprogs/files/0005-Replace-off64_t-stat64-with-off_t-stat.patch
blob: 940d63c010d6883a0308e520519dc50def4db6bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
From f260099fc45f0653aa4758d1d581e07f5b9c6a54 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Wed, 21 Dec 2022 17:43:07 -0800
Subject: [PATCH] Replace off64_t/stat64 with off_t/stat

When using AC_SYS_LARGEFILE, it will automatically add
-D_FILE_OFFSET_BITS=64 to enable 64bit off_t and all lfs64 support

helps compile on musl where off_t was always 64bit and lfs64 were never
needed

Upstream-Status: Submitted [https://lore.kernel.org/linux-xfs/20221222015327.939932-1-raj.khem@gmail.com/T/#t]
Signed-off-by: Khem Raj <raj.khem@gmail.com>

---
 copy/xfs_copy.c           |  2 +-
 fsr/xfs_fsr.c             |  2 +-
 io/bmap.c                 |  6 +++---
 io/copy_file_range.c      |  4 ++--
 io/cowextsize.c           |  6 +++---
 io/fadvise.c              |  2 +-
 io/fiemap.c               |  6 +++---
 io/fsmap.c                |  6 +++---
 io/io.h                   | 10 +++++-----
 io/madvise.c              |  2 +-
 io/mincore.c              |  2 +-
 io/mmap.c                 | 12 ++++++------
 io/pread.c                | 22 +++++++++++-----------
 io/pwrite.c               | 20 ++++++++++----------
 io/reflink.c              |  4 ++--
 io/seek.c                 |  6 +++---
 io/sendfile.c             |  6 +++---
 io/stat.c                 |  2 +-
 io/sync_file_range.c      |  2 +-
 io/truncate.c             |  2 +-
 libxfs/rdwr.c             |  8 ++++----
 mdrestore/xfs_mdrestore.c |  2 +-
 repair/prefetch.c         |  2 +-
 scrub/spacemap.c          |  6 +++---
 spaceman/freesp.c         |  4 ++--
 spaceman/trim.c           |  2 +-
 26 files changed, 74 insertions(+), 74 deletions(-)

diff --git a/copy/xfs_copy.c b/copy/xfs_copy.c
index 0420649..98a578a 100644
--- a/copy/xfs_copy.c
+++ b/copy/xfs_copy.c
@@ -881,7 +881,7 @@ main(int argc, char **argv)
 			}
 		} else  {
 			char	*lb = memalign(wbuf_align, XFS_MAX_SECTORSIZE);
-			off64_t	off;
+			off_t	off;
 			ssize_t	len;
 
 			/* ensure device files are sufficiently large */
diff --git a/fsr/xfs_fsr.c b/fsr/xfs_fsr.c
index ba02506..12fffbd 100644
--- a/fsr/xfs_fsr.c
+++ b/fsr/xfs_fsr.c
@@ -1148,7 +1148,7 @@ packfile(char *fname, char *tname, int fd,
 	struct dioattr	dio;
 	static xfs_swapext_t   sx;
 	struct xfs_flock64  space;
-	off64_t 	cnt, pos;
+	off_t 	cnt, pos;
 	void 		*fbuf = NULL;
 	int 		ct, wc, wc_b4;
 	char		ffname[SMBUFSZ];
diff --git a/io/bmap.c b/io/bmap.c
index 722a389..6182e1c 100644
--- a/io/bmap.c
+++ b/io/bmap.c
@@ -257,7 +257,7 @@ bmap_f(
 #define	FLG_BSW		0000010	/* Not on begin of stripe width */
 #define	FLG_ESW		0000001	/* Not on end   of stripe width */
 		int	agno;
-		off64_t agoff, bbperag;
+		off_t agoff, bbperag;
 		int	foff_w, boff_w, aoff_w, tot_w, agno_w;
 		char	rbuf[32], bbuf[32], abuf[32];
 		int	sunit, swidth;
@@ -267,8 +267,8 @@ bmap_f(
 		if (is_rt)
 			sunit = swidth = bbperag = 0;
 		else {
-			bbperag = (off64_t)fsgeo.agblocks *
-				  (off64_t)fsgeo.blocksize / BBSIZE;
+			bbperag = (off_t)fsgeo.agblocks *
+				  (off_t)fsgeo.blocksize / BBSIZE;
 			sunit = (fsgeo.sunit * fsgeo.blocksize) / BBSIZE;
 			swidth = (fsgeo.swidth * fsgeo.blocksize) / BBSIZE;
 		}
diff --git a/io/copy_file_range.c b/io/copy_file_range.c
index d154fa7..422e691 100644
--- a/io/copy_file_range.c
+++ b/io/copy_file_range.c
@@ -54,7 +54,7 @@ copy_file_range_cmd(int fd, long long *src_off, long long *dst_off, size_t len)
 	return 0;
 }
 
-static off64_t
+static off_t
 copy_src_filesize(int fd)
 {
 	struct stat st;
@@ -154,7 +154,7 @@ copy_range_f(int argc, char **argv)
 	}
 
 	if (!len_specified) {
-		off64_t	sz;
+		off_t	sz;
 
 		sz = copy_src_filesize(fd);
 		if (sz < 0 || (unsigned long long)sz > SIZE_MAX) {
diff --git a/io/cowextsize.c b/io/cowextsize.c
index f6b134d..00e40c6 100644
--- a/io/cowextsize.c
+++ b/io/cowextsize.c
@@ -50,10 +50,10 @@ static int
 set_cowextsize(const char *path, int fd, long extsz)
 {
 	struct fsxattr	fsx;
-	struct stat64	stat;
+	struct stat	stat;
 
-	if (fstat64(fd, &stat) < 0) {
-		perror("fstat64");
+	if (fstat(fd, &stat) < 0) {
+		perror("fstat");
 		exitcode = 1;
 		return 0;
 	}
diff --git a/io/fadvise.c b/io/fadvise.c
index 60cc0f0..0966c41 100644
--- a/io/fadvise.c
+++ b/io/fadvise.c
@@ -39,7 +39,7 @@ fadvise_f(
 	int		argc,
 	char		**argv)
 {
-	off64_t		offset = 0, length = 0;
+	off_t		offset = 0, length = 0;
 	int		c, range = 0, advise = POSIX_FADV_NORMAL;
 
 	while ((c = getopt(argc, argv, "dnrsw")) != EOF) {
diff --git a/io/fiemap.c b/io/fiemap.c
index f0c74df..b41f71b 100644
--- a/io/fiemap.c
+++ b/io/fiemap.c
@@ -234,9 +234,9 @@ fiemap_f(
 	int		tot_w = 5;	/* 5 since its just one number */
 	int		flg_w = 5;
 	__u64		last_logical = 0;	/* last extent offset handled */
-	off64_t		start_offset = 0;	/* mapping start */
-	off64_t		length = -1LL;		/* mapping length */
-	off64_t		range_end = -1LL;	/* mapping end*/
+	off_t		start_offset = 0;	/* mapping start */
+	off_t		length = -1LL;		/* mapping length */
+	off_t		range_end = -1LL;	/* mapping end*/
 	size_t		fsblocksize, fssectsize;
 	struct stat	st;
 
diff --git a/io/fsmap.c b/io/fsmap.c
index 7db5184..bf11963 100644
--- a/io/fsmap.c
+++ b/io/fsmap.c
@@ -170,7 +170,7 @@ dump_map_verbose(
 	unsigned long long	i;
 	struct fsmap		*p;
 	int			agno;
-	off64_t			agoff, bperag;
+	off_t			agoff, bperag;
 	int			foff_w, boff_w, aoff_w, tot_w, agno_w, own_w;
 	int			nr_w, dev_w;
 	char			rbuf[40], bbuf[40], abuf[40], obuf[40];
@@ -183,8 +183,8 @@ dump_map_verbose(
 	dev_w = 3;
 	nr_w = 4;
 	tot_w = MINTOT_WIDTH;
-	bperag = (off64_t)fsgeo->agblocks *
-		  (off64_t)fsgeo->blocksize;
+	bperag = (off_t)fsgeo->agblocks *
+		  (off_t)fsgeo->blocksize;
 	sunit = (fsgeo->sunit * fsgeo->blocksize);
 	swidth = (fsgeo->swidth * fsgeo->blocksize);
 
diff --git a/io/io.h b/io/io.h
index fe474fa..68e5e48 100644
--- a/io/io.h
+++ b/io/io.h
@@ -53,7 +53,7 @@ extern int stat_f(int argc, char **argv);
 typedef struct mmap_region {
 	void		*addr;		/* address of start of mapping */
 	size_t		length;		/* length of mapping */
-	off64_t		offset;		/* start offset into backing file */
+	off_t		offset;		/* start offset into backing file */
 	int		prot;		/* protection mode of the mapping */
 	int		flags;		/* MAP_* flags passed to mmap() */
 	char		*name;		/* name of backing file */
@@ -63,13 +63,13 @@ extern mmap_region_t	*maptable;	/* mmap'd region array */
 extern int		mapcount;	/* #entries in the mapping table */
 extern mmap_region_t	*mapping;	/* active mapping table entry */
 extern int maplist_f(void);
-extern void *check_mapping_range(mmap_region_t *, off64_t, size_t, int);
+extern void *check_mapping_range(mmap_region_t *, off_t, size_t, int);
 
 /*
  * Various xfs_io helper routines/globals
  */
 
-extern off64_t		filesize(void);
+extern off_t		filesize(void);
 extern int		openfile(char *, struct xfs_fsop_geom *, int, mode_t,
 				 struct fs_path *);
 extern int		addfile(char *, int , struct xfs_fsop_geom *, int,
@@ -84,9 +84,9 @@ extern size_t		io_buffersize;
 extern int		vectors;
 extern struct iovec	*iov;
 extern int		alloc_buffer(size_t, int, unsigned int);
-extern int		read_buffer(int, off64_t, long long, long long *,
+extern int		read_buffer(int, off_t, long long, long long *,
 					int, int);
-extern void		dump_buffer(off64_t, ssize_t);
+extern void		dump_buffer(off_t, ssize_t);
 
 extern void		attr_init(void);
 extern void		bmap_init(void);
diff --git a/io/madvise.c b/io/madvise.c
index bde3153..6e9c5b1 100644
--- a/io/madvise.c
+++ b/io/madvise.c
@@ -39,7 +39,7 @@ madvise_f(
 	int		argc,
 	char		**argv)
 {
-	off64_t		offset, llength;
+	off_t		offset, llength;
 	size_t		length;
 	void		*start;
 	int		advise = MADV_NORMAL, c;
diff --git a/io/mincore.c b/io/mincore.c
index 67f1d6c..24147ac 100644
--- a/io/mincore.c
+++ b/io/mincore.c
@@ -17,7 +17,7 @@ mincore_f(
 	int		argc,
 	char		**argv)
 {
-	off64_t		offset, llength;
+	off_t		offset, llength;
 	size_t		length;
 	size_t		blocksize, sectsize;
 	void		*start;
diff --git a/io/mmap.c b/io/mmap.c
index 7114404..128a2c0 100644
--- a/io/mmap.c
+++ b/io/mmap.c
@@ -64,11 +64,11 @@ print_mapping(
 void *
 check_mapping_range(
 	mmap_region_t	*map,
-	off64_t		offset,
+	off_t		offset,
 	size_t		length,
 	int		pagealign)
 {
-	off64_t		relative;
+	off_t		relative;
 
 	if (offset < mapping->offset) {
 		printf(_("offset (%lld) is before start of mapping (%lld)\n"),
@@ -156,7 +156,7 @@ mmap_f(
 	int		argc,
 	char		**argv)
 {
-	off64_t		offset;
+	off_t		offset;
 	ssize_t		length = 0, length2 = 0;
 	void		*address = NULL;
 	char		*filename;
@@ -309,7 +309,7 @@ msync_f(
 	int		argc,
 	char		**argv)
 {
-	off64_t		offset;
+	off_t		offset;
 	ssize_t		length;
 	void		*start;
 	int		c, flags = 0;
@@ -402,7 +402,7 @@ mread_f(
 	int		argc,
 	char		**argv)
 {
-	off64_t		offset, tmp, dumpoffset, printoffset;
+	off_t		offset, tmp, dumpoffset, printoffset;
 	ssize_t		length;
 	size_t		dumplen, cnt = 0;
 	char		*bp;
@@ -567,7 +567,7 @@ mwrite_f(
 	int		argc,
 	char		**argv)
 {
-	off64_t		offset, tmp;
+	off_t		offset, tmp;
 	ssize_t		length;
 	void		*start;
 	char		*sp;
diff --git a/io/pread.c b/io/pread.c
index 0f1d8b9..79990c6 100644
--- a/io/pread.c
+++ b/io/pread.c
@@ -116,7 +116,7 @@ alloc_buffer(
 static void
 __dump_buffer(
 	void		*buf,
-	off64_t		offset,
+	off_t		offset,
 	ssize_t		len)
 {
 	int		i, j;
@@ -141,7 +141,7 @@ __dump_buffer(
 
 void
 dump_buffer(
-	off64_t		offset,
+	off_t		offset,
 	ssize_t		len)
 {
 	int		i, l;
@@ -164,7 +164,7 @@ dump_buffer(
 static ssize_t
 do_preadv(
 	int		fd,
-	off64_t		offset,
+	off_t		offset,
 	long long	count)
 {
 	int		vecs = 0;
@@ -199,7 +199,7 @@ do_preadv(
 static ssize_t
 do_pread(
 	int		fd,
-	off64_t		offset,
+	off_t		offset,
 	long long	count,
 	size_t		buffer_size)
 {
@@ -212,13 +212,13 @@ do_pread(
 static int
 read_random(
 	int		fd,
-	off64_t		offset,
+	off_t		offset,
 	long long	count,
 	long long	*total,
 	unsigned int	seed,
 	int		eof)
 {
-	off64_t		end, off, range;
+	off_t		end, off, range;
 	ssize_t		bytes;
 	int		ops = 0;
 
@@ -259,12 +259,12 @@ read_random(
 static int
 read_backward(
 	int		fd,
-	off64_t		*offset,
+	off_t		*offset,
 	long long	*count,
 	long long	*total,
 	int		eof)
 {
-	off64_t		end, off = *offset;
+	off_t		end, off = *offset;
 	ssize_t		bytes = 0, bytes_requested;
 	long long	cnt = *count;
 	int		ops = 0;
@@ -319,7 +319,7 @@ read_backward(
 static int
 read_forward(
 	int		fd,
-	off64_t		offset,
+	off_t		offset,
 	long long	count,
 	long long	*total,
 	int		verbose,
@@ -353,7 +353,7 @@ read_forward(
 int
 read_buffer(
 	int		fd,
-	off64_t		offset,
+	off_t		offset,
 	long long	count,
 	long long	*total,
 	int		verbose,
@@ -368,7 +368,7 @@ pread_f(
 	char		**argv)
 {
 	size_t		bsize;
-	off64_t		offset;
+	off_t		offset;
 	unsigned int	zeed = 0;
 	long long	count, total, tmp;
 	size_t		fsblocksize, fssectsize;
diff --git a/io/pwrite.c b/io/pwrite.c
index 467bfa9..8d134c5 100644
--- a/io/pwrite.c
+++ b/io/pwrite.c
@@ -54,7 +54,7 @@ pwrite_help(void)
 static ssize_t
 do_pwritev(
 	int		fd,
-	off64_t		offset,
+	off_t		offset,
 	long long	count,
 	int		pwritev2_flags)
 {
@@ -97,7 +97,7 @@ do_pwritev(
 static ssize_t
 do_pwrite(
 	int		fd,
-	off64_t		offset,
+	off_t		offset,
 	long long	count,
 	size_t		buffer_size,
 	int		pwritev2_flags)
@@ -110,13 +110,13 @@ do_pwrite(
 
 static int
 write_random(
-	off64_t		offset,
+	off_t		offset,
 	long long	count,
 	unsigned int	seed,
 	long long	*total,
 	int 		pwritev2_flags)
 {
-	off64_t		off, range;
+	off_t		off, range;
 	ssize_t		bytes;
 	int		ops = 0;
 
@@ -155,12 +155,12 @@ write_random(
 
 static int
 write_backward(
-	off64_t		offset,
+	off_t		offset,
 	long long	*count,
 	long long	*total,
 	int		pwritev2_flags)
 {
-	off64_t		end, off = offset;
+	off_t		end, off = offset;
 	ssize_t		bytes = 0, bytes_requested;
 	long long	cnt = *count;
 	int		ops = 0;
@@ -214,11 +214,11 @@ write_backward(
 
 static int
 write_buffer(
-	off64_t		offset,
+	off_t		offset,
 	long long	count,
 	size_t		bs,
 	int		fd,
-	off64_t		skip,
+	off_t		skip,
 	long long	*total,
 	int		pwritev2_flags)
 {
@@ -253,7 +253,7 @@ write_buffer(
 
 static int
 write_once(
-	off64_t		offset,
+	off_t		offset,
 	long long	count,
 	long long	*total,
 	int		pwritev2_flags)
@@ -275,7 +275,7 @@ pwrite_f(
 	char		**argv)
 {
 	size_t		bsize;
-	off64_t		offset, skip = 0;
+	off_t		offset, skip = 0;
 	long long	count, total, tmp;
 	unsigned int	zeed = 0, seed = 0xcdcdcdcd;
 	size_t		fsblocksize, fssectsize;
diff --git a/io/reflink.c b/io/reflink.c
index 8e4f389..b6a3c05 100644
--- a/io/reflink.c
+++ b/io/reflink.c
@@ -98,7 +98,7 @@ dedupe_f(
 	int		argc,
 	char		**argv)
 {
-	off64_t		soffset, doffset;
+	off_t		soffset, doffset;
 	long long	count, total;
 	char		*infile;
 	int		condensed, quiet_flag;
@@ -226,7 +226,7 @@ reflink_f(
 	int		argc,
 	char		**argv)
 {
-	off64_t		soffset, doffset;
+	off_t		soffset, doffset;
 	long long	count = 0, total;
 	char		*infile = NULL;
 	int		condensed, quiet_flag;
diff --git a/io/seek.c b/io/seek.c
index 6734ecb..ffe7439 100644
--- a/io/seek.c
+++ b/io/seek.c
@@ -63,8 +63,8 @@ static void
 seek_output(
 	int	startflag,
 	char	*type,
-	off64_t	start,
-	off64_t	offset)
+	off_t	start,
+	off_t	offset)
 {
 	if (offset == -1) {
 		if (errno == ENXIO) {
@@ -92,7 +92,7 @@ seek_f(
 	int	argc,
 	char	**argv)
 {
-	off64_t		offset, start;
+	off_t		offset, start;
 	size_t		fsblocksize, fssectsize;
 	int		c;
 	int		current;	/* specify data or hole */
diff --git a/io/sendfile.c b/io/sendfile.c
index a003bb5..2ce569c 100644
--- a/io/sendfile.c
+++ b/io/sendfile.c
@@ -34,12 +34,12 @@ sendfile_help(void)
 
 static int
 send_buffer(
-	off64_t		offset,
+	off_t		offset,
 	size_t		count,
 	int		fd,
 	long long	*total)
 {
-	off64_t		off = offset;
+	off_t		off = offset;
 	ssize_t		bytes, bytes_remaining = count;
 	int		ops = 0;
 
@@ -66,7 +66,7 @@ sendfile_f(
 	int		argc,
 	char		**argv)
 {
-	off64_t		offset = 0;
+	off_t		offset = 0;
 	long long	count, total;
 	size_t		blocksize, sectsize;
 	struct timeval	t1, t2;
diff --git a/io/stat.c b/io/stat.c
index b57f9ee..e8f68dc 100644
--- a/io/stat.c
+++ b/io/stat.c
@@ -21,7 +21,7 @@ static cmdinfo_t stat_cmd;
 static cmdinfo_t statfs_cmd;
 static cmdinfo_t statx_cmd;
 
-off64_t
+off_t
 filesize(void)
 {
 	struct stat	st;
diff --git a/io/sync_file_range.c b/io/sync_file_range.c
index 94285c2..2375a06 100644
--- a/io/sync_file_range.c
+++ b/io/sync_file_range.c
@@ -30,7 +30,7 @@ sync_range_f(
 	int		argc,
 	char		**argv)
 {
-	off64_t		offset = 0, length = 0;
+	off_t		offset = 0, length = 0;
 	int		c, sync_mode = 0;
 	size_t		blocksize, sectsize;
 
diff --git a/io/truncate.c b/io/truncate.c
index 1d04919..a74b613 100644
--- a/io/truncate.c
+++ b/io/truncate.c
@@ -16,7 +16,7 @@ truncate_f(
 	int		argc,
 	char		**argv)
 {
-	off64_t		offset;
+	off_t		offset;
 	size_t		blocksize, sectsize;
 
 	init_cvtnum(&blocksize, &sectsize);
diff --git a/libxfs/rdwr.c b/libxfs/rdwr.c
index 0e33211..153007d 100644
--- a/libxfs/rdwr.c
+++ b/libxfs/rdwr.c
@@ -576,7 +576,7 @@ libxfs_balloc(
 
 
 static int
-__read_buf(int fd, void *buf, int len, off64_t offset, int flags)
+__read_buf(int fd, void *buf, int len, off_t offset, int flags)
 {
 	int	sts;
 
@@ -638,7 +638,7 @@ libxfs_readbufr_map(struct xfs_buftarg *btp, struct xfs_buf *bp, int flags)
 
 	buf = bp->b_addr;
 	for (i = 0; i < bp->b_nmaps; i++) {
-		off64_t	offset = LIBXFS_BBTOOFF64(bp->b_maps[i].bm_bn);
+		off_t	offset = LIBXFS_BBTOOFF64(bp->b_maps[i].bm_bn);
 		int len = BBTOB(bp->b_maps[i].bm_len);
 
 		error = __read_buf(fd, buf, len, offset, flags);
@@ -797,7 +797,7 @@ err:
 }
 
 static int
-__write_buf(int fd, void *buf, int len, off64_t offset, int flags)
+__write_buf(int fd, void *buf, int len, off_t offset, int flags)
 {
 	int	sts;
 
@@ -863,7 +863,7 @@ libxfs_bwrite(
 		void	*buf = bp->b_addr;
 
 		for (i = 0; i < bp->b_nmaps; i++) {
-			off64_t	offset = LIBXFS_BBTOOFF64(bp->b_maps[i].bm_bn);
+			off_t	offset = LIBXFS_BBTOOFF64(bp->b_maps[i].bm_bn);
 			int len = BBTOB(bp->b_maps[i].bm_len);
 
 			bp->b_error = __write_buf(fd, buf, len, offset,
diff --git a/mdrestore/xfs_mdrestore.c b/mdrestore/xfs_mdrestore.c
index 8e3998d..334bdd2 100644
--- a/mdrestore/xfs_mdrestore.c
+++ b/mdrestore/xfs_mdrestore.c
@@ -160,7 +160,7 @@ verify_device_size(
 	} else {
 		/* ensure device is sufficiently large enough */
 		char		lb[XFS_MAX_SECTORSIZE] = { 0 };
-		off64_t		off;
+		off_t		off;
 
 		off = nr_blocks * blocksize - sizeof(lb);
 		if (pwrite(dev_fd, lb, sizeof(lb), off) < 0)
diff --git a/repair/prefetch.c b/repair/prefetch.c
index 78c1e39..b0dd197 100644
--- a/repair/prefetch.c
+++ b/repair/prefetch.c
@@ -475,7 +475,7 @@ pf_batch_read(
 {
 	struct xfs_buf		*bplist[MAX_BUFS];
 	unsigned int		num;
-	off64_t			first_off, last_off, next_off;
+	off_t			first_off, last_off, next_off;
 	int			len, size;
 	int			i;
 	int			inode_bufs;
diff --git a/scrub/spacemap.c b/scrub/spacemap.c
index b6fd411..9cefe07 100644
--- a/scrub/spacemap.c
+++ b/scrub/spacemap.c
@@ -97,11 +97,11 @@ scan_ag_rmaps(
 	struct scrub_ctx	*ctx = (struct scrub_ctx *)wq->wq_ctx;
 	struct scan_blocks	*sbx = arg;
 	struct fsmap		keys[2];
-	off64_t			bperag;
+	off_t			bperag;
 	int			ret;
 
-	bperag = (off64_t)ctx->mnt.fsgeom.agblocks *
-		 (off64_t)ctx->mnt.fsgeom.blocksize;
+	bperag = (off_t)ctx->mnt.fsgeom.agblocks *
+		 (off_t)ctx->mnt.fsgeom.blocksize;
 
 	memset(keys, 0, sizeof(struct fsmap) * 2);
 	keys->fmr_device = ctx->fsinfo.fs_datadev;
diff --git a/spaceman/freesp.c b/spaceman/freesp.c
index 70dcdb5..f5177cb 100644
--- a/spaceman/freesp.c
+++ b/spaceman/freesp.c
@@ -62,7 +62,7 @@ static void
 addtohist(
 	xfs_agnumber_t	agno,
 	xfs_agblock_t	agbno,
-	off64_t		len)
+	off_t		len)
 {
 	long		i;
 
@@ -152,7 +152,7 @@ scan_ag(
 	struct fsmap		*l, *h;
 	struct fsmap		*p;
 	struct xfs_fd		*xfd = &file->xfd;
-	off64_t			aglen;
+	off_t			aglen;
 	xfs_agblock_t		agbno;
 	unsigned long long	freeblks = 0;
 	unsigned long long	freeexts = 0;
diff --git a/spaceman/trim.c b/spaceman/trim.c
index e9ed47e..727dd81 100644
--- a/spaceman/trim.c
+++ b/spaceman/trim.c
@@ -26,7 +26,7 @@ trim_f(
 	struct xfs_fd		*xfd = &file->xfd;
 	struct xfs_fsop_geom	*fsgeom = &xfd->fsgeom;
 	xfs_agnumber_t		agno = 0;
-	off64_t			offset = 0;
+	off_t			offset = 0;
 	ssize_t			length = 0;
 	ssize_t			minlen = 0;
 	int			aflag = 0;