summaryrefslogtreecommitdiff
path: root/sys-fs
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2024-02-06 05:42:43 +0000
committerV3n3RiX <venerix@koprulu.sector>2024-02-06 05:42:43 +0000
commit9e0addc1cf71ebec277b59e38eb3fa30e650cf9f (patch)
treefad7eaf86ed6caf32c2c6e1b52157364ec9a79f6 /sys-fs
parentd82c6c919aa63b46ec1683492b75162951f09072 (diff)
gentoo auto-resync : 06:02:2024 - 05:42:43
Diffstat (limited to 'sys-fs')
-rw-r--r--sys-fs/Manifest.gzbin22199 -> 22203 bytes
-rw-r--r--sys-fs/xfsprogs/Manifest5
-rw-r--r--sys-fs/xfsprogs/files/0001-Remove-use-of-LFS64-interfaces.patch652
-rw-r--r--sys-fs/xfsprogs/files/0002-io-Adapt-to-64-bit-time_t.patch37
-rw-r--r--sys-fs/xfsprogs/files/0003-build-Request-64-bit-time_t-where-possible.patch31
-rw-r--r--sys-fs/xfsprogs/xfsprogs-6.6.0.ebuild100
-rw-r--r--sys-fs/zfs-kmod/Manifest2
-rw-r--r--sys-fs/zfs-kmod/files/zfs-kmod-2.2.2-autotrim.patch31
-rw-r--r--sys-fs/zfs-kmod/zfs-kmod-2.2.2-r1.ebuild219
9 files changed, 1077 insertions, 0 deletions
diff --git a/sys-fs/Manifest.gz b/sys-fs/Manifest.gz
index 3c804a0018e6..818ecc0e85fa 100644
--- a/sys-fs/Manifest.gz
+++ b/sys-fs/Manifest.gz
Binary files differ
diff --git a/sys-fs/xfsprogs/Manifest b/sys-fs/xfsprogs/Manifest
index 524e27ea1891..9d272a56f44a 100644
--- a/sys-fs/xfsprogs/Manifest
+++ b/sys-fs/xfsprogs/Manifest
@@ -1,10 +1,15 @@
+AUX 0001-Remove-use-of-LFS64-interfaces.patch 15619 BLAKE2B 9d2dfa2e81182466b81bdee612649145a20900497ed25886320564ef0798e7e381ceb23d84ff7a958ca68d72a681ed33af89a0cca59daf359c5c9df3039e3310 SHA512 0a4485e85041e276462de91c70708748acc98caf82aea0f4baddb18393b8cedce15c5cc4b04ae09656da32f2219be900ce1c7516705994bc8629685ac5229c97
+AUX 0002-io-Adapt-to-64-bit-time_t.patch 1641 BLAKE2B 51a74717f974b24543e8a9151a0b0dcda59a01acd7620f5d00bf3659899ac6cb1b7bc481b5c32aac9482f72932a2ec377980fd4c71d73689a6e1f4cc7f3cb188 SHA512 66794967658cf6406240cef596c4e64c71eaf9bbe4091a94e236170fe17b4045e95d1627a65a973aa77cce9032fff9a933d19e11669440661dd99c713dc6dad5
+AUX 0003-build-Request-64-bit-time_t-where-possible.patch 1297 BLAKE2B 2e2a379aef0fc803cfb319919f19c51917e2084fe13ad72f9c62f97cd7561a0262fd192cc7625a0ac52c9bbc4611eb31e61984edfb1b52788fa2346f236eb56b SHA512 022267f15c044d595b6a52e91e0802b98ae2f3b4b8b921b64fc79dadec498473f3053ba19c6fb44766fe4ff8bdd85df577c77030523524c8079ed47e4d06bd51
AUX xfsprogs-5.18.0-docdir.patch 278 BLAKE2B 5277fff17f26b4da946535a430878bfe1e91f92f41c44f2eaaac80703d58176f8d15e14f0586fcf23f29ce207f193303dc662ae5cca6877d6eca9f5ae698620f SHA512 0a94f24b292bece9786bceb99100c25b6d697b9ecf1566bb52b8266683e3adaee415bf7d79c81eed7f2adf846f982f3d91122c9a6dcbb7e16231983037fe9cae
AUX xfsprogs-5.3.0-libdir.patch 1137 BLAKE2B 7e455b8b82c553a819155fb4c1fee3d5c31bef0fa4c7ab0bf4ad4558a9a5b0b2f408138558c3601deb3ba85d465ab2dae5248bc20a4ba83f08cf733b27a796a1 SHA512 eaec31b6dab500c2e9c4fe7d5d82e60a40f3073cff99af0ae2aa817f6e4541f6a3de0a48f9151a274c6dd97e99ca26192b95b920aea1c5227d75232b808c98fa
AUX xfsprogs-6.3.0-gettext-0.22.patch 378 BLAKE2B 6744a37393dca2ca00443091751f850e1bb15461c14a8d1afa26a2e98d3ab47bf891bf327392e5b9d55d762de3ebec76b8f1a88d620c142513077b0d0753f23a SHA512 15bb8c3901f06c58964917495ff9f623b90ef3358b14199fecef35658323a3a611a5182059a1ee232ba24074fa671ba48e858171e92c99d4b84af65cad674ff6
DIST xfsprogs-6.3.0.tar.xz 1328452 BLAKE2B 47a4ec45c88f26b32debd52283602d8244f996c071853b6bf7cf905f917436b1324bc9b58338346c8255201629d69e771d6c3bfd81f33f4f3c3907251d0a6c8c SHA512 dbb3e77d0d9cf184a0e647b8231350401a7549a23a0bfd9121cf2a1b48e85f71d98329dff440fc6e984bcecfdcc2a72f0f27c4989560f3c55359f21f3fb434bb
DIST xfsprogs-6.4.0.tar.xz 1344720 BLAKE2B 566a80a1fa90520c6cc2b20c8e8cde41eb83a48f0b6d4a978f9e5d43960e99b54cab3e0c2cd4147a3d8f4944e50876063fc571441c8239d6deaaa01604843a6b SHA512 831e7747640bc2964b182226d8bb6f637610b123aeec9b3cb97a5de5d5b65bde30c6b40ad2e78de6a5214e823dd75de3a2bdfddd8ab1638f5c7340a760c91b3f
DIST xfsprogs-6.5.0.tar.xz 1348452 BLAKE2B 40d578bf5bf3da93c608d2a1c5af02f0ac3a99c695b8003f684b75ce01b8d89dc197620e724e5461da174e050068c352eff622e970ea748e53685ab942cc2e92 SHA512 0a2db9c3df8209b2b6d264b7ef87f4c101f5129dfa14cb09159dbef181c09508fa8460eb1f4293300f24696ce236ca49065e47068cebdee00ee8ab9e2b75211c
+DIST xfsprogs-6.6.0.tar.xz 1351792 BLAKE2B a479126ed19389c057af28ac3564893826a6d27859984cfadb28b17663759d8f19b1796031d43f294bf8001f5ddda8854b6b0d90d0229092bd31fbdf6e5d1554 SHA512 89b4436a958075ac77cc2b5b5f0618164d47f7d6fbc2271a7927c886fba7bf67284e1825c1ecc259969235222b4d084a40c354edb6d83c21029d737108aa38da
EBUILD xfsprogs-6.3.0.ebuild 2416 BLAKE2B 9b04f33065008e4829ef6e0ff9e3845e756b5dc372263b56ca595720db6cf6b49a8072f6d5e3be23fcba41cf1401dd98946d84033c9e081233e44dd234460e68 SHA512 502c9ab8b5fc8b8b0ee73cc59d391d906a47d7d9b5043480a3d4abe53a6c2b4beb7b73898e85ccf83525f3d5dad8aaccab35c115992f75fcfbca591d6d911f25
EBUILD xfsprogs-6.4.0.ebuild 2373 BLAKE2B 60ccff59881ecb1caaafa8ec8690a6fdc8964d6c381e1720a8c701960edb2f9373b8d6a5e4203510daec9b6c6a9a17abc6982c151c654e757b9b4183ebdf5d25 SHA512 1589d85c07e3e25e22418bcf7b898692b027aa2704946b8f3106249b561ecbf2db4c34941f7eb55a3aa48461066f3ad0e831c973e3777eb5e0e68782aabb6c05
EBUILD xfsprogs-6.5.0.ebuild 2426 BLAKE2B a29fd7bfc8dbb8a7b00bcfb709d6148efeb0efc692179bda2d63defecd90b73df5cd944005da80e86c639ea2683fdd6dc3b8a1a9125b2c244e94cdaa3c6b1c0f SHA512 9ee29506e3d9dd3350a487144d04be553b8428ac6037a602c62abaf680525f6a7d592f5fb2d87168befee9e29ed03fa60b18f1ba4b13d7cd29347c03e4958e7f
+EBUILD xfsprogs-6.6.0.ebuild 2563 BLAKE2B 40c6707d3ddbcdbdc8387a410f5aa2c7d43505ad61afdd4214571c4811fb223f6331a47d686a57d5302edd718461e1a46b8837bbb66e4ac01f0cc8aabe573923 SHA512 2e5b81aab41e72ff9502b0c9d599a8f03d5a8b433bf52b34eddf7c4cae37f9150c3cae89c47ce4609a887305025f38d45f9cdb6d72460a4b5f1592048135ba9c
MISC metadata.xml 339 BLAKE2B b7d67fc8bcf854e7a2453c23e5d5d8c193525ccd16a643e80415a103d2d22c892458ea6ada32653d04b3d471c780f07b2b0537a317d9e64468130e065c6f5ab1 SHA512 445b4f6d853a272cc6bf8fde42745adf226512fa310f9af4bbabad4cfa5a6888b2c2215dfc0896c07b800820b69417c6d408bb21ed17a5224b5c9e3412c5f62d
diff --git a/sys-fs/xfsprogs/files/0001-Remove-use-of-LFS64-interfaces.patch b/sys-fs/xfsprogs/files/0001-Remove-use-of-LFS64-interfaces.patch
new file mode 100644
index 000000000000..a0b32f714d9c
--- /dev/null
+++ b/sys-fs/xfsprogs/files/0001-Remove-use-of-LFS64-interfaces.patch
@@ -0,0 +1,652 @@
+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
+
diff --git a/sys-fs/xfsprogs/files/0002-io-Adapt-to-64-bit-time_t.patch b/sys-fs/xfsprogs/files/0002-io-Adapt-to-64-bit-time_t.patch
new file mode 100644
index 000000000000..405f2eb8a288
--- /dev/null
+++ b/sys-fs/xfsprogs/files/0002-io-Adapt-to-64-bit-time_t.patch
@@ -0,0 +1,37 @@
+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
+
diff --git a/sys-fs/xfsprogs/files/0003-build-Request-64-bit-time_t-where-possible.patch b/sys-fs/xfsprogs/files/0003-build-Request-64-bit-time_t-where-possible.patch
new file mode 100644
index 000000000000..21c2d07821e8
--- /dev/null
+++ b/sys-fs/xfsprogs/files/0003-build-Request-64-bit-time_t-where-possible.patch
@@ -0,0 +1,31 @@
+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
+
diff --git a/sys-fs/xfsprogs/xfsprogs-6.6.0.ebuild b/sys-fs/xfsprogs/xfsprogs-6.6.0.ebuild
new file mode 100644
index 000000000000..29cecd2a7b76
--- /dev/null
+++ b/sys-fs/xfsprogs/xfsprogs-6.6.0.ebuild
@@ -0,0 +1,100 @@
+# 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 toolchain-funcs
+
+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
+
+ # 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
+ --with-crond-dir="${EPREFIX}/etc/cron.d"
+ --with-systemd-unit-dir="$(systemd_get_systemunitdir)"
+ --with-udev-rule-dir="$(get_udevdir)"
+ $(use_enable icu libicu)
+ $(use_enable nls gettext)
+ $(use_enable libedit editline)
+ )
+
+ if tc-is-lto ; then
+ myconf+=( --enable-lto )
+ else
+ myconf+=( --disable-lto )
+ fi
+
+ 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
+}
diff --git a/sys-fs/zfs-kmod/Manifest b/sys-fs/zfs-kmod/Manifest
index 452125878960..7be3fa75b1c6 100644
--- a/sys-fs/zfs-kmod/Manifest
+++ b/sys-fs/zfs-kmod/Manifest
@@ -1,10 +1,12 @@
AUX zfs-kmod-2.1.11-gentoo.patch 1076 BLAKE2B d2b0fe2ff1ac31c2a2a184141f107010dae61d2de465462b8177db1a07918be2bd2fc4d4570ad8758da87ef14cf3878db062fe9eb5b53fa3156e7db5c06073d4 SHA512 9e103aae75036e52f89e79c4d4ed3cffe670ef423cda7c2f936533b9329e994c7a02d241289f6565e9d086e5b0bdd6865ab3677c3ad84eaadf3abe310977b6a8
AUX zfs-kmod-2.2.2-arm64-neon.patch 3145 BLAKE2B 6125fd18649341e44768a84a508cf6d59db72356ebf513fbfb56b50e4fcc9052cee0e315d448e22067b5458336efa3897557dc2cc4ed8b6ef4dda75e0db3e2e0 SHA512 a238df628397fc72e604ec163401865f8348f121bbffac119f5b094ce06318f89fbfb30a1e424ac4835348df67e2512ee05ae5007ee765dc3876d3ba30cdd99d
+AUX zfs-kmod-2.2.2-autotrim.patch 1186 BLAKE2B 4dcc5eead0b86fa365ed2c228ac1c0b01f89cc36210959c55d5bf06d1b4e739d6e8a0dee3910ae0c08d7859b3c05cf483aec29d5184d3725cfc66419a943c336 SHA512 cf0d10b00ea045184966424474307a00ff95a96a4c0ea8e7e1037b1b101c2e9d6e2a4b52851427031bcba7ef7ff0d71b90d074f33385166d447896b41771396e
DIST zfs-2.1.14.tar.gz 35167471 BLAKE2B a7b22eaf05e4fbf416ebe4d7b884c515942fc9375c1dd322cefa00c19c550b9318a4192d6a909d49d58523c8f1a6eaf00189dd58e6543fae17cf8cc35042f469 SHA512 4a65c8b7d5576fa2dcc14e7ccaa93191c1d3791479cf89bd02c2bd04434ff5e93709b328796d4f9ba93da19f12772e359df373f40919350a3e1e4c52758b47c8
DIST zfs-2.1.14.tar.gz.asc 836 BLAKE2B f01bc58bf6c3d367c494ed4ea9f3fb1141f3aafdbf4f913b9e0d60d31557076d5ae0e25ca93b013f5fd85e21ba5ae9f61e1a03af54bb0c743869c0ce3d5519df SHA512 be0f386cce952b4047dc2448e356078668e8d4392802dd3bb1a426741f15f4d9fb689cd1cb09972bdbc9fe2e4e782ec4b4754fe811c5657bc1f5308bd38e3926
DIST zfs-2.2.2.tar.gz 33816541 BLAKE2B f0619ae42d898d18077096217d0a9ddd7c7378424707aa51d3645661b2889a1459bc4a5e9fe42b6860b2d26e4600da35765b0e741725dafacc2ead2370cad866 SHA512 bba252cbf7986f2cce154dd18a34aa478cf98f70106337188dc894de2446d60a58fa643706927757d1787506b44d4ff404897a2d0e16aacb0a7bf27765703332
DIST zfs-2.2.2.tar.gz.asc 836 BLAKE2B bdc86492b2bf45d329e34e89ea7796f5cbf518d32ab114c909321b1d0d8040b9ce4e25b3b85fcbc5ea62ee10a2d716b5b27e37c2c005b307c0b593815c49d625 SHA512 110be1aa90f4749106717165a3cb5116379e2d170146a2b3d2601f04212450da9327e028d6e1e5de7f8a46c6bb7a15e2bcdd09e3e760590fbc695f9562f1440b
EBUILD zfs-kmod-2.1.14.ebuild 4601 BLAKE2B 451f240a8bfda7164ee48ae37bb410b8c3e06ca7184126da122258e7f6f8da62d23c9e6b0481e310735d92e460fbe5617a9f01da04cdb0ae801039c93cb12cd7 SHA512 7240287b57eaac31f6d0c7d4994c6a4de44a41ac9470aeb4c95e33ddb9557d7c70fad24c037f32ae026b4b7bb745ec5f4f496a802457dbdb95a8f1ec7f527c49
+EBUILD zfs-kmod-2.2.2-r1.ebuild 6025 BLAKE2B c0f21b6c1a70b1f664700ec4a85be54d8ef15f2dec828b977f6d52ee9ed2f6468454d6ac161f70e97d49fdcc0b4799ffc56cae137cac8be65a2e7c1a1b42626a SHA512 afc32eef22464550c1097ce60df52c45288ca90509cab45809c763eb5903cdc510dfcc3c53b4d8ff4711cc3e611bc3125426bb692d5f9357a31329e973db8c2f
EBUILD zfs-kmod-2.2.2.ebuild 5980 BLAKE2B 7db333fae56ed3306ef21b8adb9172ef056367c339d6bf57e43ab15d6f48888a84c31c317dfc46b757498aacf7f83c2b47436658cbcb6515b78b003c7f806611 SHA512 3da30083362ba3bb9b52d0b6cf3b5874ecacd0c6f208cb86c3b98997905a00d66cd59b8593c9732ff94aafad57c097cad65b3f78d26a803d985758a79d2e9d86
EBUILD zfs-kmod-9999.ebuild 5939 BLAKE2B 880f2d7d9caefc7c02a16662ea7f57f2c7315527b100159c4c1f65f13cd54bd13ce6fdf137fbf70c80531abc6cfe92b4854a5bc3a72b74b073b70b18552102aa SHA512 5c1e74764724963d200b40e95fbe30ea478c07c82be939f509651ed6d0c4cde86634a9e41d8ff854f23ae432a8d755c4455f9f8cd0d41ee8ec3a8cd50691603d
MISC metadata.xml 776 BLAKE2B 4c48182f7ceee679b4d947a70cb232980969b59bdc425463a929b6ae8be5f79450a3869bf3cc4d00069b65cda8a06f42eba29a7974c5e1b34a2998992901bcbe SHA512 f3f0af7dcdd26a01fc1b00af46ff64e7e6d7bb83a2225ea4cbff5c1a56651ddfdf3e7f59af914833f52828b9d059c6a8cb7f32037319abed129c40987349745f
diff --git a/sys-fs/zfs-kmod/files/zfs-kmod-2.2.2-autotrim.patch b/sys-fs/zfs-kmod/files/zfs-kmod-2.2.2-autotrim.patch
new file mode 100644
index 000000000000..6d72389fdb25
--- /dev/null
+++ b/sys-fs/zfs-kmod/files/zfs-kmod-2.2.2-autotrim.patch
@@ -0,0 +1,31 @@
+https://bugs.gentoo.org/923745
+https://github.com/openzfs/zfs/issues/15453
+https://github.com/openzfs/zfs/pull/15781
+https://github.com/openzfs/zfs/pull/15789
+
+From a0aa7a2ee3b56d7b6d69c2081034ec8293a6d605 Mon Sep 17 00:00:00 2001
+From: Kevin Jin <33590050+jxdking@users.noreply.github.com>
+Date: Wed, 17 Jan 2024 12:03:58 -0500
+Subject: [PATCH] Autotrim High Load Average Fix
+
+Switch from cv_wait() to cv_wait_idle() in vdev_autotrim_wait_kick(),
+which should mitigate the high load average while waiting.
+
+Reviewed-by: Brian Atkinson <batkinson@lanl.gov>
+Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
+Reviewed-by: Alexander Motin <mav@FreeBSD.org>
+Signed-off-by: jxdking <lostking2008@hotmail.com>
+Closes #15781
+--- a/module/zfs/vdev_trim.c
++++ b/module/zfs/vdev_trim.c
+@@ -194,7 +194,8 @@ vdev_autotrim_wait_kick(vdev_t *vd, int num_of_kick)
+ for (int i = 0; i < num_of_kick; i++) {
+ if (vd->vdev_autotrim_exit_wanted)
+ break;
+- cv_wait(&vd->vdev_autotrim_kick_cv, &vd->vdev_autotrim_lock);
++ cv_wait_idle(&vd->vdev_autotrim_kick_cv,
++ &vd->vdev_autotrim_lock);
+ }
+ boolean_t exit_wanted = vd->vdev_autotrim_exit_wanted;
+ mutex_exit(&vd->vdev_autotrim_lock);
+
diff --git a/sys-fs/zfs-kmod/zfs-kmod-2.2.2-r1.ebuild b/sys-fs/zfs-kmod/zfs-kmod-2.2.2-r1.ebuild
new file mode 100644
index 000000000000..7b28bf3a94ab
--- /dev/null
+++ b/sys-fs/zfs-kmod/zfs-kmod-2.2.2-r1.ebuild
@@ -0,0 +1,219 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools dist-kernel-utils flag-o-matic linux-mod-r1 multiprocessing
+
+DESCRIPTION="Linux ZFS kernel module for sys-fs/zfs"
+HOMEPAGE="https://github.com/openzfs/zfs"
+
+MODULES_KERNEL_MAX=6.6
+MODULES_KERNEL_MIN=3.10
+
+if [[ ${PV} == 9999 ]] ; then
+ EGIT_REPO_URI="https://github.com/openzfs/zfs.git"
+ inherit git-r3
+ unset MODULES_KERNEL_MAX
+else
+ VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/openzfs.asc
+ inherit verify-sig
+
+ MY_PV=${PV/_rc/-rc}
+ SRC_URI="https://github.com/openzfs/zfs/releases/download/zfs-${MY_PV}/zfs-${MY_PV}.tar.gz"
+ SRC_URI+=" verify-sig? ( https://github.com/openzfs/zfs/releases/download/zfs-${MY_PV}/zfs-${MY_PV}.tar.gz.asc )"
+ S="${WORKDIR}/zfs-${MY_PV}"
+
+ ZFS_KERNEL_COMPAT="${MODULES_KERNEL_MAX}"
+ # Increments minor eg 5.14 -> 5.15, and still supports override.
+ ZFS_KERNEL_DEP="${ZFS_KERNEL_COMPAT_OVERRIDE:-${ZFS_KERNEL_COMPAT}}"
+ ZFS_KERNEL_DEP="${ZFS_KERNEL_DEP%%.*}.$(( ${ZFS_KERNEL_DEP##*.} + 1))"
+
+ if [[ ${PV} != *_rc* ]] ; then
+ KEYWORDS="~amd64 ~arm64 ~loong ~ppc64 ~riscv ~sparc"
+ fi
+fi
+
+LICENSE="CDDL MIT debug? ( GPL-2+ )"
+SLOT="0/${PVR}"
+IUSE="custom-cflags debug +rootfs"
+RESTRICT="test"
+
+BDEPEND="
+ app-alternatives/awk
+ dev-lang/perl
+"
+
+if [[ ${PV} != 9999 ]] ; then
+ BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )"
+
+ IUSE+=" +dist-kernel-cap"
+ RDEPEND="
+ dist-kernel-cap? ( dist-kernel? (
+ <virtual/dist-kernel-${ZFS_KERNEL_DEP}
+ ) )
+ "
+fi
+
+# Used to suggest matching USE, but without suggesting to disable
+PDEPEND="dist-kernel? ( ~sys-fs/zfs-${PV}[dist-kernel] )"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-2.1.11-gentoo.patch
+ "${FILESDIR}"/${PN}-2.2.2-arm64-neon.patch
+ "${FILESDIR}"/${PN}-2.2.2-autotrim.patch
+)
+
+pkg_pretend() {
+ use rootfs || return 0
+
+ if has_version virtual/dist-kernel && ! use dist-kernel; then
+ ewarn "You have virtual/dist-kernel installed, but"
+ ewarn "USE=\"dist-kernel\" is not enabled for ${CATEGORY}/${PN}"
+ ewarn "It's recommended to globally enable dist-kernel USE flag"
+ ewarn "to auto-trigger initrd rebuilds with kernel updates"
+ fi
+}
+
+pkg_setup() {
+ local CONFIG_CHECK="
+ EFI_PARTITION
+ ZLIB_DEFLATE
+ ZLIB_INFLATE
+ !DEBUG_LOCK_ALLOC
+ !PAX_KERNEXEC_PLUGIN_METHOD_OR
+ "
+ use debug && CONFIG_CHECK+="
+ DEBUG_INFO
+ FRAME_POINTER
+ !DEBUG_INFO_REDUCED
+ "
+ use rootfs && CONFIG_CHECK+="
+ BLK_DEV_INITRD
+ DEVTMPFS
+ "
+
+ kernel_is -lt 5 && CONFIG_CHECK+=" IOSCHED_NOOP"
+
+ if [[ ${PV} != 9999 ]] ; then
+ local kv_major_max kv_minor_max zcompat
+ zcompat="${ZFS_KERNEL_COMPAT_OVERRIDE:-${ZFS_KERNEL_COMPAT}}"
+ kv_major_max="${zcompat%%.*}"
+ zcompat="${zcompat#*.}"
+ kv_minor_max="${zcompat%%.*}"
+ kernel_is -le "${kv_major_max}" "${kv_minor_max}" || die \
+ "Linux ${kv_major_max}.${kv_minor_max} is the latest supported version"
+ fi
+
+ linux-mod-r1_pkg_setup
+}
+
+src_prepare() {
+ default
+
+ # Run unconditionally (bug #792627)
+ eautoreconf
+
+ if [[ ${PV} != 9999 ]] ; then
+ # Set module revision number
+ sed -Ei "s/(Release:.*)1/\1${PR}-gentoo/" META || die
+ fi
+}
+
+src_configure() {
+ use custom-cflags || strip-flags
+ filter-ldflags -Wl,*
+
+ local myconf=(
+ --bindir="${EPREFIX}"/bin
+ --sbindir="${EPREFIX}"/sbin
+ --with-config=kernel
+ --with-linux="${KV_DIR}"
+ --with-linux-obj="${KV_OUT_DIR}"
+ $(use_enable debug)
+
+ # See gentoo.patch
+ GENTOO_MAKEARGS_EVAL="${MODULES_MAKEARGS[*]@Q}"
+ TEST_JOBS="$(makeopts_jobs)"
+ )
+
+ econf "${myconf[@]}"
+}
+
+src_compile() {
+ emake "${MODULES_MAKEARGS[@]}"
+}
+
+src_install() {
+ emake "${MODULES_MAKEARGS[@]}" DESTDIR="${ED}" install
+ modules_post_process
+
+ dodoc AUTHORS COPYRIGHT META README.md
+}
+
+_old_layout_cleanup() {
+ # new files are just extra/{spl,zfs}.ko with no subdirs.
+ local olddir=(
+ avl/zavl
+ icp/icp
+ lua/zlua
+ nvpair/znvpair
+ spl/spl
+ unicode/zunicode
+ zcommon/zcommon
+ zfs/zfs
+ zstd/zzstd
+ )
+
+ # kernel/module/Kconfig contains possible compressed extentions.
+ local kext kextfiles
+ for kext in .ko{,.{gz,xz,zst}}; do
+ kextfiles+=( "${olddir[@]/%/${kext}}" )
+ done
+
+ local oldfile oldpath
+ for oldfile in "${kextfiles[@]}"; do
+ oldpath="${EROOT}/lib/modules/${KV_FULL}/extra/${oldfile}"
+ if [[ -f "${oldpath}" ]]; then
+ ewarn "Found obsolete zfs module ${oldfile} for current kernel ${KV_FULL}, removing."
+ rm -rv "${oldpath}" || die
+ # we do not remove non-empty directories just for safety in case there's something else.
+ # also it may fail if there are both compressed and uncompressed modules installed.
+ rmdir -v --ignore-fail-on-non-empty "${oldpath%/*.*}" || die
+ fi
+ done
+}
+
+pkg_postinst() {
+ # Check for old module layout before doing anything else.
+ # only attempt layout cleanup if new .ko location is used.
+ local newko=( "${EROOT}/lib/modules/${KV_FULL}/extra"/{zfs,spl}.ko* )
+ # We check first array member, if glob above did not exand, it will be "zfs.ko*" and -f will return false.
+ # if glob expanded -f will do correct file precense check.
+ [[ -f ${newko[0]} ]] && _old_layout_cleanup
+
+ linux-mod-r1_pkg_postinst
+
+ if [[ -z ${ROOT} ]] && use dist-kernel ; then
+ dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}"
+ fi
+
+ if use x86 || use arm ; then
+ ewarn "32-bit kernels will likely require increasing vmalloc to"
+ ewarn "at least 256M and decreasing zfs_arc_max to some value less than that."
+ fi
+
+ if has_version sys-boot/grub ; then
+ ewarn "This version of OpenZFS includes support for new feature flags"
+ ewarn "that are incompatible with previous versions. GRUB2 support for"
+ ewarn "/boot with the new feature flags is not yet available."
+ ewarn "Do *NOT* upgrade root pools to use the new feature flags."
+ ewarn "Any new pools will be created with the new feature flags by default"
+ ewarn "and will not be compatible with older versions of OpenZFS. To"
+ ewarn "create a new pool that is backward compatible wih GRUB2, use "
+ ewarn
+ ewarn "zpool create -o compatibility=grub2 ..."
+ ewarn
+ ewarn "Refer to /usr/share/zfs/compatibility.d/grub2 for list of features."
+ fi
+}