sys-fs/xfsprogs: Sync with Gentoo

It's from Gentoo commit f08cde6b18c81fdb8deba6262da461b7da34f622.
This commit is contained in:
Flatcar Buildbot 2024-09-02 07:21:02 +00:00 committed by Krzesimir Nowak
parent d5e3996b65
commit d3ceb2763e
10 changed files with 57 additions and 1086 deletions

View File

@ -1,5 +1,3 @@
DIST xfsprogs-6.4.0.tar.xz 1344720 BLAKE2B 566a80a1fa90520c6cc2b20c8e8cde41eb83a48f0b6d4a978f9e5d43960e99b54cab3e0c2cd4147a3d8f4944e50876063fc571441c8239d6deaaa01604843a6b SHA512 831e7747640bc2964b182226d8bb6f637610b123aeec9b3cb97a5de5d5b65bde30c6b40ad2e78de6a5214e823dd75de3a2bdfddd8ab1638f5c7340a760c91b3f
DIST xfsprogs-6.6.0.tar.xz 1351792 BLAKE2B a479126ed19389c057af28ac3564893826a6d27859984cfadb28b17663759d8f19b1796031d43f294bf8001f5ddda8854b6b0d90d0229092bd31fbdf6e5d1554 SHA512 89b4436a958075ac77cc2b5b5f0618164d47f7d6fbc2271a7927c886fba7bf67284e1825c1ecc259969235222b4d084a40c354edb6d83c21029d737108aa38da
DIST xfsprogs-6.7.0.tar.xz 1349748 BLAKE2B e16db682cafbd35266e9130a64943c19304174ebd501e30aa32fb8f0d1904286ccdef62c0820480541c7272575d770eea7e73e7dc83c0b452eb5fb2a3a7085ca SHA512 4f543e4c5c4e88e4f9ce16b82ca1151330f687469368fe7470b68e8bb21d1d3c7280eb2e691d3bdf24ae3d4fa2ee5764dc34637198bca0d4ffa65eea2f10ac74
DIST xfsprogs-6.10.0.tar.xz 1449872 BLAKE2B dc02fb14cd07e20d618070358700003a0990125ce3d8b15fa0248c6d494a89bbfb51c267583fc863edeee0d84069c7016f7992e750faa357618cd0d7f5748d2e SHA512 ec80eedfd3471c836e99eb8507c0de2895f261d36316145b02f2effbcc1bb5a52eae3ad2148d45bc49f1a30e0267aa4e3f3176a5e01ec84b2da24b3fb430ffce
DIST xfsprogs-6.8.0.tar.xz 1367196 BLAKE2B 8c296698da1170bb7ff369c2bf5f156e812ddf43ee817369029ad951d6c1e18c20d093db385b9a523f6cb7ba3e01f8924eb3540b71efa4bec8bf3defe2418562 SHA512 f5b5c6d8da70cc0f3361b3420982aabfabb0bc54b9eb60b93a9aaeedb33a9ecede4061d5c1300b96d7aba7d44a4207672c4a33e115bf0f5c711a151f3fc65e0d
DIST xfsprogs-6.9.0.tar.xz 1383116 BLAKE2B d952603716cc4022a935c426630b0b7838573476a730c6832f36ef0274a640e64667d3e3a2dd9fd2c5f2c12cdb348fd93abfef5c49e5c5fe2d5a83945dfc7894 SHA512 c597453759c400690810971f0b2daf0e4e22c74270b0f9800e2235da5e5c1383b59bc1176c5bba0023f74b623020fb51c62f0e98a74885cf3a8336e0b81c9023

View File

@ -1,652 +0,0 @@
https://lore.kernel.org/linux-xfs/20240205232343.2162947-1-sam@gentoo.org/
From a162f061dc8c2145ae006461d661a03e986c4bf7 Mon Sep 17 00:00:00 2001
From: Violet Purcell <vimproved@inventati.org>
Date: Sat, 22 Jul 2023 21:12:59 -0400
Subject: [PATCH 1/3] Remove use of LFS64 interfaces
LFS64 interfaces are non-standard and are being removed in the upcoming musl
1.2.5. Setting _FILE_OFFSET_BITS=64 (which is currently being done) makes all
interfaces on glibc 64-bit by default, so using the LFS64 interfaces is
redundant. This commit replaces all occurences of off64_t with off_t,
stat64 with stat, and fstat64 with fstat.
Link: https://bugs.gentoo.org/907039
Cc: Felix Janda <felix.janda@posteo.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Violet Purcell <vimproved@inventati.org>
Signed-off-by: Sam James <sam@gentoo.org>
--- 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 */
--- 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];
--- 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;
}
--- 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) {
--- 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;
}
--- 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) {
--- 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;
--- 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);
--- 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);
--- 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;
--- 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;
--- a/io/mmap.c
+++ b/io/mmap.c
@@ -63,11 +63,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"),
@@ -155,7 +155,8 @@ mmap_f(
int argc,
char **argv)
{
- off64_t offset;
+ off_t offset;
+
ssize_t length = 0, length2 = 0;
void *address = NULL;
char *filename;
@@ -308,7 +309,7 @@ msync_f(
int argc,
char **argv)
{
- off64_t offset;
+ off_t offset;
ssize_t length;
void *start;
int c, flags = 0;
@@ -401,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;
@@ -566,7 +567,7 @@ mwrite_f(
int argc,
char **argv)
{
- off64_t offset, tmp;
+ off_t offset, tmp;
ssize_t length;
void *start;
char *sp;
--- 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;
--- 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;
--- 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;
--- 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 */
--- 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;
--- 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;
--- 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;
--- 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);
--- 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,
--- 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)
--- 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;
--- 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;
--- 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;
--- 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;
--
2.43.0

View File

@ -1,37 +0,0 @@
https://lore.kernel.org/linux-xfs/20240205232343.2162947-1-sam@gentoo.org/
From 37495c1600002551badb5eb16ff244b0c5ffd3b0 Mon Sep 17 00:00:00 2001
From: Sam James <sam@gentoo.org>
Date: Fri, 15 Dec 2023 00:40:26 +0000
Subject: [PATCH 2/3] io: Adapt to >= 64-bit time_t
We now require (at least) 64-bit time_t, so we need to adjust some printf
specifiers accordingly.
Unfortunately, we've stumbled upon a ridiculous C mmoment whereby there's
no neat format specifier (not even one of the inttypes ones) for time_t, so
we cast to intmax_t and use %jd.
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sam James <sam@gentoo.org>
--- a/io/stat.c
+++ b/io/stat.c
@@ -66,11 +66,11 @@ dump_raw_stat(struct stat *st)
printf("stat.ino = %llu\n", (unsigned long long)st->st_ino);
printf("stat.size = %lld\n", (long long)st->st_size);
printf("stat.blocks = %lld\n", (long long)st->st_blocks);
- printf("stat.atime.tv_sec = %ld\n", st->st_atim.tv_sec);
+ printf("stat.atime.tv_sec = %jd\n", (intmax_t)st->st_atim.tv_sec);
printf("stat.atime.tv_nsec = %ld\n", st->st_atim.tv_nsec);
- printf("stat.ctime.tv_sec = %ld\n", st->st_ctim.tv_sec);
+ printf("stat.ctime.tv_sec = %jd\n", (intmax_t)st->st_ctim.tv_sec);
printf("stat.ctime.tv_nsec = %ld\n", st->st_ctim.tv_nsec);
- printf("stat.mtime.tv_sec = %ld\n", st->st_mtim.tv_sec);
+ printf("stat.mtime.tv_sec = %jd\n", (intmax_t)st->st_mtim.tv_sec);
printf("stat.mtime.tv_nsec = %ld\n", st->st_mtim.tv_nsec);
printf("stat.rdev_major = %u\n", major(st->st_rdev));
printf("stat.rdev_minor = %u\n", minor(st->st_rdev));
--
2.43.0

View File

@ -1,31 +0,0 @@
https://lore.kernel.org/linux-xfs/20240205232343.2162947-1-sam@gentoo.org/
From 98e6a32ebe3b1b0e643c27f1bbee0058c9edc047 Mon Sep 17 00:00:00 2001
From: Sam James <sam@gentoo.org>
Date: Sat, 11 Nov 2023 08:22:22 +0000
Subject: [PATCH 3/3] build: Request 64-bit time_t where possible
Suggested by Darrick during LFS review. We take the same approach as in
5c0599b721d1d232d2e400f357abdf2736f24a97 ('Fix building xfsprogs on 32-bit platforms')
to avoid autoconf hell - just take the tried & tested approach which is working
fine for us with LFS already.
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sam James <sam@gentoo.org>
--- a/include/builddefs.in
+++ b/include/builddefs.in
@@ -13,8 +13,8 @@ OPTIMIZER = @opt_build@
MALLOCLIB = @malloc_lib@
LOADERFLAGS = @LDFLAGS@
LTLDFLAGS = @LDFLAGS@
-CFLAGS = @CFLAGS@ -D_FILE_OFFSET_BITS=64 -Wno-address-of-packed-member
-BUILD_CFLAGS = @BUILD_CFLAGS@ -D_FILE_OFFSET_BITS=64
+CFLAGS = @CFLAGS@ -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -Wno-address-of-packed-member
+BUILD_CFLAGS = @BUILD_CFLAGS@ -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64
# make sure we don't pick up whacky LDFLAGS from the make environment and
# only use what we calculate from the configured options above.
--
2.43.0

View File

@ -0,0 +1,46 @@
https://bugs.gentoo.org/938569
https://lore.kernel.org/linux-xfs/172480131521.2291268.17945339760767205637.stgit@frogsfrogsfrogs/
From fd885ea4d54be6e98df7342bd99b77bc8cbd64d5 Mon Sep 17 00:00:00 2001
Message-ID: <fd885ea4d54be6e98df7342bd99b77bc8cbd64d5.1724802060.git.sam@gentoo.org>
From: "Darrick J. Wong" <djwong@kernel.org>
Date: Tue, 27 Aug 2024 16:33:58 -0700
Subject: [PATCH] xfs: fix C++ compilation errors in xfs_fs.h
Several people reported C++ compilation errors due to things that C
compilers allow but C++ compilers do not. Fix both of these problems,
and hope there aren't more of these brown paper bags in 2 months when we
finally get these fixes through the process into a released xfsprogs.
Reported-by: kernel@mattwhitlock.name
Reported-by: sam@gentoo.org
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=219203
Fixes: 233f4e12bbb2c ("xfs: add parent pointer ioctls")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
libxfs/xfs_fs.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libxfs/xfs_fs.h b/libxfs/xfs_fs.h
index 454b63ef..2b8e1f4f 100644
--- a/libxfs/xfs_fs.h
+++ b/libxfs/xfs_fs.h
@@ -906,13 +906,13 @@ static inline struct xfs_getparents_rec *
xfs_getparents_next_rec(struct xfs_getparents *gp,
struct xfs_getparents_rec *gpr)
{
- void *next = ((void *)gpr + gpr->gpr_reclen);
+ void *next = ((char *)gpr + gpr->gpr_reclen);
void *end = (void *)(uintptr_t)(gp->gp_buffer + gp->gp_bufsize);
if (next >= end)
return NULL;
- return next;
+ return (struct xfs_getparents_rec *)next;
}
/* Iterate through this file handle's directory parent pointers. */
--
2.46.0

View File

@ -1,157 +0,0 @@
https://lore.kernel.org/linux-xfs/171142126323.2211955.1239989461209318080.stgit@frogsfrogsfrogs/
From mboxrd@z Thu Jan 1 00:00:00 1970
Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 80EBA128387
for <linux-xfs@vger.kernel.org>; Tue, 26 Mar 2024 02:59:42 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1711421982; cv=none; b=BWaXePO42YIrz9dUA7DXc3SL5MWIoC+liDfJkd/1AM/cv7gR6JRGHa5e5W3sXZFsI6S6pH/fKSEijUigTR0kiRGPFWbeCiDWEGQdq6y4AChFbZMTfQSg4Jei7pONholMK08CyBQ/K4UutICyqbos2cdxAGKKjNPTIOtdQdkiHdc=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1711421982; c=relaxed/simple;
bh=qfMP8tvVLZAoDkRmqI3ZwhMEx6csbe2+Xclngz+n+GI=;
h=Date:Subject:From:To:Cc:Message-ID:In-Reply-To:References:
MIME-Version:Content-Type; b=O5h4CVWF9TsE/Yho55MGUjmR7zhvoPO0EhXK59BWm/HSUFB3D7vD+ozThDlpENzz0iLrKzdR6aPYBS78cRpOzAszO4ZnMf0HPbFlLmlsIHK/ha5XFPO2qrmLgOGUkKKZepgXIROIA9knDYpxuvlWHnOptPf9birJvyR0gztAEyw=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=dkgsPgmY; arc=none smtp.client-ip=10.30.226.201
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="dkgsPgmY"
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0A482C433C7;
Tue, 26 Mar 2024 02:59:42 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
s=k20201202; t=1711421982;
bh=qfMP8tvVLZAoDkRmqI3ZwhMEx6csbe2+Xclngz+n+GI=;
h=Date:Subject:From:To:Cc:In-Reply-To:References:From;
b=dkgsPgmYjqxxC1yEflpaDSaicJ6J1MpL6wH2GNkbwb7jHMXma/nM8+TuJ7ITuHQGY
WXTMKAQFvTq29s+IWJaQZtuCfgH6cDQ3JTkRcjvg/OgSTo0X+aqxadBBnAjO4AP5/P
hX4gszw3hlZ8oDjMvW9Wl6nLyDmR82rshZOTF4hZfQ8mkbU3Vzcsg2QiPQQzzKgfon
3c/GxXIQ7V2jg37MBrPpNRYPvqBXWn1X/EkR0wuFiUtw9fTJ6Wyt0Vr6/vemAf2U+S
gwHkISopsTOE3k8cCYYf7LXqmtU3PLOOqWBDol6TkWe6OgIOMSljoytIkFq1up/zhz
LHrtnfD5yRlLg==
Date: Mon, 25 Mar 2024 19:59:41 -0700
Subject: [PATCH 01/13] libxfs: fix incorrect porting to 6.7
From: "Darrick J. Wong" <djwong@kernel.org>
To: cem@kernel.org, djwong@kernel.org
Cc: Christoph Hellwig <hch@lst.de>, Bill O'Donnell <bodonnel@redhat.com>,
linux-xfs@vger.kernel.org
Message-ID: <171142126323.2211955.1239989461209318080.stgit@frogsfrogsfrogs>
In-Reply-To: <171142126291.2211955.14829143192552278353.stgit@frogsfrogsfrogs>
References: <171142126291.2211955.14829143192552278353.stgit@frogsfrogsfrogs>
User-Agent: StGit/0.19
Precedence: bulk
X-Mailing-List: linux-xfs@vger.kernel.org
List-Id: <linux-xfs.vger.kernel.org>
List-Subscribe: <mailto:linux-xfs+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-xfs+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
From: Darrick J. Wong <djwong@kernel.org>
Userspace libxfs is supposed to match the kernel libxfs except for the
preprocessor include directives. Fix a few discrepancies that came up
for whatever reason.
To fix the build errors resulting from CONFIG_XFS_RT not being defined,
add it to libxfs.h and alter the Makefile to track xfs_rtbitmap.h.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Bill O'Donnell <bodonnel@redhat.com>
---
db/check.c | 1 -
include/libxfs.h | 4 ++++
libxfs/Makefile | 1 +
libxfs/xfs_rtbitmap.c | 2 +-
libxfs/xfs_rtbitmap.h | 3 ---
repair/rt.c | 1 -
6 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/db/check.c b/db/check.c
index 9d5576c333b2..a47a5d9cb5b4 100644
--- a/db/check.c
+++ b/db/check.c
@@ -20,7 +20,6 @@
#include "init.h"
#include "malloc.h"
#include "dir2.h"
-#include "xfs_rtbitmap.h"
typedef enum {
IS_USER_QUOTA, IS_PROJECT_QUOTA, IS_GROUP_QUOTA,
diff --git a/include/libxfs.h b/include/libxfs.h
index 9cec394ca407..aeec2bc76126 100644
--- a/include/libxfs.h
+++ b/include/libxfs.h
@@ -7,6 +7,9 @@
#ifndef __LIBXFS_H__
#define __LIBXFS_H__
+/* For userspace XFS_RT is always defined */
+#define CONFIG_XFS_RT
+
#include "libxfs_api_defs.h"
#include "platform_defs.h"
#include "xfs.h"
@@ -80,6 +83,7 @@ struct iomap;
#include "xfs_refcount_btree.h"
#include "xfs_refcount.h"
#include "xfs_btree_staging.h"
+#include "xfs_rtbitmap.h"
#ifndef ARRAY_SIZE
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
diff --git a/libxfs/Makefile b/libxfs/Makefile
index 010ee68e2292..6f688c0ad25a 100644
--- a/libxfs/Makefile
+++ b/libxfs/Makefile
@@ -50,6 +50,7 @@ HFILES = \
xfs_refcount_btree.h \
xfs_rmap.h \
xfs_rmap_btree.h \
+ xfs_rtbitmap.h \
xfs_sb.h \
xfs_shared.h \
xfs_trans_resv.h \
diff --git a/libxfs/xfs_rtbitmap.c b/libxfs/xfs_rtbitmap.c
index 8f313339e97f..fb083499070c 100644
--- a/libxfs/xfs_rtbitmap.c
+++ b/libxfs/xfs_rtbitmap.c
@@ -931,7 +931,7 @@ xfs_rtcheck_alloc_range(
*/
int
xfs_rtfree_extent(
- xfs_trans_t *tp, /* transaction pointer */
+ struct xfs_trans *tp, /* transaction pointer */
xfs_rtxnum_t start, /* starting rtext number to free */
xfs_rtxlen_t len) /* length of extent freed */
{
diff --git a/libxfs/xfs_rtbitmap.h b/libxfs/xfs_rtbitmap.h
index db2f8c924b05..c0637057d69c 100644
--- a/libxfs/xfs_rtbitmap.h
+++ b/libxfs/xfs_rtbitmap.h
@@ -6,9 +6,6 @@
#ifndef __XFS_RTBITMAP_H__
#define __XFS_RTBITMAP_H__
-/* For userspace XFS_RT is always defined */
-#define CONFIG_XFS_RT
-
struct xfs_rtalloc_args {
struct xfs_mount *mp;
struct xfs_trans *tp;
diff --git a/repair/rt.c b/repair/rt.c
index abe58b569c0c..9f3bc8d53ec6 100644
--- a/repair/rt.c
+++ b/repair/rt.c
@@ -13,7 +13,6 @@
#include "protos.h"
#include "err_protos.h"
#include "rt.h"
-#include "xfs_rtbitmap.h"
#define xfs_highbit64 libxfs_highbit64 /* for XFS_RTBLOCKLOG macro */

View File

@ -26,8 +26,7 @@ BDEPEND="nls? ( sys-devel/gettext )"
RDEPEND+=" selinux? ( sec-policy/selinux-xfs )"
PATCHES=(
"${FILESDIR}"/${PN}-5.3.0-libdir.patch
"${FILESDIR}"/${PN}-6.7.0-fix-porting-to-6.7.patch
"${FILESDIR}"/${PN}-6.10.0-c++-void.patch
)
src_prepare() {
@ -73,6 +72,8 @@ src_configure() {
--enable-static
# Doesn't do anything beyond adding -flto (bug #930947).
--disable-lto
# The default value causes double 'lib'
--localstatedir="${EPREFIX}/var"
--with-crond-dir="${EPREFIX}/etc/cron.d"
--with-systemd-unit-dir="$(systemd_get_systemunitdir)"
--with-udev-rule-dir="$(get_udevdir)/rules.d"
@ -93,9 +94,15 @@ src_install() {
emake DIST_ROOT="${ED}" HAVE_ZIPPED_MANPAGES=false install
emake DIST_ROOT="${ED}" HAVE_ZIPPED_MANPAGES=false install-dev
# Not actually used but --localstatedir causes this empty dir
# to be installed.
rmdir "${ED}"/var/lib/xfsprogs "${ED}"/var/lib || die
if ! use static-libs; then
rm "${ED}/usr/$(get_libdir)/libhandle.a" || die
fi
find "${ED}" -name '*.la' -delete || die
}
pkg_postrm() {

View File

@ -1,96 +0,0 @@
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit flag-o-matic systemd usr-ldscript
DESCRIPTION="XFS filesystem utilities"
HOMEPAGE="https://xfs.wiki.kernel.org/ https://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git/"
SRC_URI="https://www.kernel.org/pub/linux/utils/fs/xfs/${PN}/${P}.tar.xz"
LICENSE="LGPL-2.1"
SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~mips ppc ppc64 ~riscv ~s390 sparc x86"
IUSE="icu libedit nls selinux"
RDEPEND="
dev-libs/inih
dev-libs/userspace-rcu:=
>=sys-apps/util-linux-2.17.2
icu? ( dev-libs/icu:= )
libedit? ( dev-libs/libedit )
"
DEPEND="${RDEPEND}"
BDEPEND="nls? ( sys-devel/gettext )"
RDEPEND+=" selinux? ( sec-policy/selinux-xfs )"
PATCHES=(
"${FILESDIR}"/${PN}-5.3.0-libdir.patch
"${FILESDIR}"/${PN}-5.18.0-docdir.patch
)
src_prepare() {
default
# Fix doc dir
sed -i \
-e "/^PKG_DOC_DIR/s:@pkg_name@:${PF}:" \
include/builddefs.in || die
# Don't install compressed docs
sed 's@\(CHANGES\)\.gz[[:space:]]@\1 @' -i doc/Makefile || die
}
src_configure() {
# include/builddefs.in will add FCFLAGS to CFLAGS which will
# unnecessarily clutter CFLAGS (and fortran isn't used)
unset FCFLAGS
# If set in user env, this breaks configure
unset PLATFORM
export DEBUG=-DNDEBUG
# Package is honoring CFLAGS; No need to use OPTIMIZER anymore.
# However, we have to provide an empty value to avoid default
# flags.
export OPTIMIZER=" "
# Avoid automagic on libdevmapper (bug #709694)
export ac_cv_search_dm_task_create=no
# bug 903611
use elibc_musl && append-flags -D_LARGEFILE64_SOURCE
# Build fails with -O3 (bug #712698)
replace-flags -O3 -O2
# Upstream does NOT support --disable-static anymore,
# https://www.spinics.net/lists/linux-xfs/msg30185.html
# https://www.spinics.net/lists/linux-xfs/msg30272.html
local myconf=(
--enable-static
--enable-blkid
# Doesn't do anything beyond adding -flto (bug #930947).
--disable-lto
--with-crond-dir="${EPREFIX}/etc/cron.d"
--with-systemd-unit-dir="$(systemd_get_systemunitdir)"
$(use_enable icu libicu)
$(use_enable nls gettext)
$(use_enable libedit editline)
)
econf "${myconf[@]}"
}
src_compile() {
emake V=1
}
src_install() {
emake DIST_ROOT="${ED}" HAVE_ZIPPED_MANPAGES=false install
emake DIST_ROOT="${ED}" HAVE_ZIPPED_MANPAGES=false install-dev
gen_usr_ldscript -a handle
}

View File

@ -1,107 +0,0 @@
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit flag-o-matic systemd udev usr-ldscript
DESCRIPTION="XFS filesystem utilities"
HOMEPAGE="https://xfs.wiki.kernel.org/ https://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git/"
SRC_URI="https://www.kernel.org/pub/linux/utils/fs/xfs/${PN}/${P}.tar.xz"
LICENSE="LGPL-2.1"
SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~mips ppc ppc64 ~riscv ~s390 sparc x86"
IUSE="icu libedit nls selinux"
RDEPEND="
dev-libs/inih
dev-libs/userspace-rcu:=
>=sys-apps/util-linux-2.17.2
icu? ( dev-libs/icu:= )
libedit? ( dev-libs/libedit )
"
DEPEND="${RDEPEND}"
BDEPEND="nls? ( sys-devel/gettext )"
RDEPEND+=" selinux? ( sec-policy/selinux-xfs )"
PATCHES=(
"${FILESDIR}"/${PN}-5.3.0-libdir.patch
"${FILESDIR}"/0001-Remove-use-of-LFS64-interfaces.patch
"${FILESDIR}"/0002-io-Adapt-to-64-bit-time_t.patch
"${FILESDIR}"/0003-build-Request-64-bit-time_t-where-possible.patch
)
src_prepare() {
default
# Fix doc dir
sed -i \
-e "/^PKG_DOC_DIR/s:@pkg_name@:${PF}:" \
include/builddefs.in || die
# Don't install compressed docs
sed 's@\(CHANGES\)\.gz[[:space:]]@\1 @' -i doc/Makefile || die
}
src_configure() {
# include/builddefs.in will add FCFLAGS to CFLAGS which will
# unnecessarily clutter CFLAGS (and fortran isn't used)
unset FCFLAGS
# If set in user env, this breaks configure
unset PLATFORM
export DEBUG=-DNDEBUG
# Package is honoring CFLAGS; No need to use OPTIMIZER anymore.
# However, we have to provide an empty value to avoid default
# flags.
export OPTIMIZER=" "
# Avoid automagic on libdevmapper (bug #709694)
export ac_cv_search_dm_task_create=no
# bug 903611
use elibc_musl && append-flags -D_LARGEFILE64_SOURCE
# Build fails with -O3 (bug #712698)
replace-flags -O3 -O2
# Upstream does NOT support --disable-static anymore,
# https://www.spinics.net/lists/linux-xfs/msg30185.html
# https://www.spinics.net/lists/linux-xfs/msg30272.html
local myconf=(
--enable-static
--enable-blkid
# Doesn't do anything beyond adding -flto (bug #930947).
--disable-lto
--with-crond-dir="${EPREFIX}/etc/cron.d"
--with-systemd-unit-dir="$(systemd_get_systemunitdir)"
--with-udev-rule-dir="$(get_udevdir)/rules.d"
$(use_enable icu libicu)
$(use_enable nls gettext)
$(use_enable libedit editline)
)
econf "${myconf[@]}"
}
src_compile() {
emake V=1
}
src_install() {
emake DIST_ROOT="${ED}" HAVE_ZIPPED_MANPAGES=false install
emake DIST_ROOT="${ED}" HAVE_ZIPPED_MANPAGES=false install-dev
gen_usr_ldscript -a handle
}
pkg_postrm() {
udev_reload
}
pkg_postinst() {
udev_reload
}

View File

@ -11,7 +11,7 @@ SRC_URI="https://www.kernel.org/pub/linux/utils/fs/xfs/${PN}/${P}.tar.xz"
LICENSE="LGPL-2.1"
SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~mips ppc ppc64 ~riscv ~s390 sparc x86"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~mips ppc ppc64 ~riscv ~s390 sparc x86"
IUSE="icu libedit nls selinux static-libs"
RDEPEND="