[packages/zfs] up to 2.2.5

atler atler at pld-linux.org
Wed Aug 7 00:38:53 CEST 2024


commit 9ca31298a8257ef8fffd277b791e9ab63aad14eb
Author: Jan Palus <atler at pld-linux.org>
Date:   Wed Aug 7 00:38:36 2024 +0200

    up to 2.2.5

 kernel-6.10.patch | 476 ------------------------------------------------------
 zfs.spec          |   8 +-
 2 files changed, 3 insertions(+), 481 deletions(-)
---
diff --git a/zfs.spec b/zfs.spec
index 129f956..b5679ee 100644
--- a/zfs.spec
+++ b/zfs.spec
@@ -24,20 +24,19 @@ exit 1
 
 %define		_duplicate_files_terminate_build	0
 
-%define	rel	2
+%define	rel	1
 %define	pname	zfs
 Summary:	Native Linux port of the ZFS filesystem
 Summary(pl.UTF-8):	Natywny linuksowy port systemu plików ZFS
 Name:		%{pname}%{?_pld_builder:%{?with_kernel:-kernel}}%{_alt_kernel}
-Version:	2.2.4
+Version:	2.2.5
 Release:	%{rel}%{?_pld_builder:%{?with_kernel:@%{_kernel_ver_str}}}
 License:	CDDL
 Group:		Applications/System
 Source0:	https://github.com/openzfs/zfs/releases/download/zfs-%{version}/%{pname}-%{version}.tar.gz
-# Source0-md5:	8d563179aadb2a008f501aee34d3daf9
+# Source0-md5:	2acc3c276b30f92590e81268ec8aaba2
 Patch0:		initdir.patch
 Patch1:		pld.patch
-Patch2:		kernel-6.10.patch
 URL:		https://zfsonlinux.org/
 BuildRequires:	autoconf >= 2.50
 BuildRequires:	automake
@@ -262,7 +261,6 @@ p=`pwd`\
 %setup -q -n %{pname}-%{version}
 %patch0 -p1
 %patch1 -p1
-%patch2 -p1
 
 %{__sed} -E -i -e '1s,#!\s*/usr/bin/env\s+python3(\s|$),#!%{__python3}\1,' \
 	cmd/arc_summary
diff --git a/kernel-6.10.patch b/kernel-6.10.patch
deleted file mode 100644
index 15ddaef..0000000
--- a/kernel-6.10.patch
+++ /dev/null
@@ -1,476 +0,0 @@
-diff --git a/META b/META
-index 19a796050..7aac80c54 100644
---- a/META
-+++ b/META
-@@ -6,5 +6,5 @@ Release:       1
- Release-Tags:  relext
- License:       CDDL
- Author:        OpenZFS
--Linux-Maximum: 6.8
-+Linux-Maximum: 6.9
- Linux-Minimum: 3.10
-diff --git a/config/kernel-blk-queue.m4 b/config/kernel-blk-queue.m4
-index 15dbe1c7d..2f0b386e6 100644
---- a/config/kernel-blk-queue.m4
-+++ b/config/kernel-blk-queue.m4
-@@ -332,7 +332,7 @@ AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_MAX_HW_SECTORS], [
- 	ZFS_LINUX_TEST_RESULT([blk_queue_max_hw_sectors], [
- 		AC_MSG_RESULT(yes)
- 	],[
--		ZFS_LINUX_TEST_ERROR([blk_queue_max_hw_sectors])
-+		AC_MSG_RESULT(no)
- 	])
- ])
- 
-@@ -355,7 +355,7 @@ AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_MAX_SEGMENTS], [
- 	ZFS_LINUX_TEST_RESULT([blk_queue_max_segments], [
- 		AC_MSG_RESULT(yes)
- 	], [
--		ZFS_LINUX_TEST_ERROR([blk_queue_max_segments])
-+		AC_MSG_RESULT(no)
- 	])
- ])
- 
-diff --git a/config/kernel-blkdev.m4 b/config/kernel-blkdev.m4
-index b6ce1e1cf..4f60f96ac 100644
---- a/config/kernel-blkdev.m4
-+++ b/config/kernel-blkdev.m4
-@@ -534,6 +534,30 @@ AC_DEFUN([ZFS_AC_KERNEL_BLKDEV_BDEV_WHOLE], [
- 	])
- ])
- 
-+dnl #
-+dnl # 5.16 API change
-+dnl # Added bdev_nr_bytes() helper.
-+dnl #
-+AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKDEV_BDEV_NR_BYTES], [
-+	ZFS_LINUX_TEST_SRC([bdev_nr_bytes], [
-+		#include <linux/blkdev.h>
-+	],[
-+		struct block_device *bdev = NULL;
-+		loff_t nr_bytes __attribute__ ((unused)) = 0;
-+		nr_bytes = bdev_nr_bytes(bdev);
-+	])
-+])
-+
-+AC_DEFUN([ZFS_AC_KERNEL_BLKDEV_BDEV_NR_BYTES], [
-+	AC_MSG_CHECKING([whether bdev_nr_bytes() is available])
-+	ZFS_LINUX_TEST_RESULT([bdev_nr_bytes], [
-+		AC_MSG_RESULT(yes)
-+		AC_DEFINE(HAVE_BDEV_NR_BYTES, 1, [bdev_nr_bytes() is available])
-+	],[
-+		AC_MSG_RESULT(no)
-+	])
-+])
-+
- dnl #
- dnl # 5.20 API change,
- dnl # Removed bdevname(), snprintf(.., %pg) should be used.
-@@ -747,6 +771,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKDEV], [
- 	ZFS_AC_KERNEL_SRC_BLKDEV_CHECK_DISK_CHANGE
- 	ZFS_AC_KERNEL_SRC_BLKDEV_BDEV_CHECK_MEDIA_CHANGE
- 	ZFS_AC_KERNEL_SRC_BLKDEV_BDEV_WHOLE
-+	ZFS_AC_KERNEL_SRC_BLKDEV_BDEV_NR_BYTES
- 	ZFS_AC_KERNEL_SRC_BLKDEV_BDEVNAME
- 	ZFS_AC_KERNEL_SRC_BLKDEV_ISSUE_DISCARD
- 	ZFS_AC_KERNEL_SRC_BLKDEV_BDEV_KOBJ
-@@ -767,6 +792,7 @@ AC_DEFUN([ZFS_AC_KERNEL_BLKDEV], [
- 	ZFS_AC_KERNEL_BLKDEV_CHECK_DISK_CHANGE
- 	ZFS_AC_KERNEL_BLKDEV_BDEV_CHECK_MEDIA_CHANGE
- 	ZFS_AC_KERNEL_BLKDEV_BDEV_WHOLE
-+	ZFS_AC_KERNEL_BLKDEV_BDEV_NR_BYTES
- 	ZFS_AC_KERNEL_BLKDEV_BDEVNAME
- 	ZFS_AC_KERNEL_BLKDEV_GET_ERESTARTSYS
- 	ZFS_AC_KERNEL_BLKDEV_ISSUE_DISCARD
-diff --git a/include/os/linux/spl/sys/kmem_cache.h b/include/os/linux/spl/sys/kmem_cache.h
-index b159bb52d..905ff57a1 100644
---- a/include/os/linux/spl/sys/kmem_cache.h
-+++ b/include/os/linux/spl/sys/kmem_cache.h
-@@ -192,22 +192,25 @@ extern void spl_kmem_reap(void);
- extern uint64_t spl_kmem_cache_inuse(kmem_cache_t *cache);
- extern uint64_t spl_kmem_cache_entry_size(kmem_cache_t *cache);
- 
-+#ifndef	SPL_KMEM_CACHE_IMPLEMENTING
-+/*
-+ * Macros for the kmem_cache_* API expected by ZFS and SPL clients. We don't
-+ * define them inside spl-kmem-cache.c, as that uses the kernel's incompatible
-+ * kmem_cache_* facilities to implement ours.
-+ */
-+
-+/* Avoid conflicts with kernel names that might be implemented as macros. */
-+#undef	kmem_cache_alloc
-+
- #define	kmem_cache_create(name, size, align, ctor, dtor, rclm, priv, vmp, fl) \
-     spl_kmem_cache_create(name, size, align, ctor, dtor, rclm, priv, vmp, fl)
- #define	kmem_cache_set_move(skc, move)	spl_kmem_cache_set_move(skc, move)
- #define	kmem_cache_destroy(skc)		spl_kmem_cache_destroy(skc)
--/*
-- * This is necessary to be compatible with other kernel modules
-- * or in-tree filesystem that may define kmem_cache_alloc,
-- * like bcachefs does it now.
-- */
--#ifdef kmem_cache_alloc
--#undef kmem_cache_alloc
--#endif
- #define	kmem_cache_alloc(skc, flags)	spl_kmem_cache_alloc(skc, flags)
- #define	kmem_cache_free(skc, obj)	spl_kmem_cache_free(skc, obj)
- #define	kmem_cache_reap_now(skc)	spl_kmem_cache_reap_now(skc)
- #define	kmem_reap()			spl_kmem_reap()
-+#endif
- 
- /*
-  * The following functions are only available for internal use.
-diff --git a/module/os/linux/spl/spl-kmem-cache.c b/module/os/linux/spl/spl-kmem-cache.c
-index 42821ad60..737c2e063 100644
---- a/module/os/linux/spl/spl-kmem-cache.c
-+++ b/module/os/linux/spl/spl-kmem-cache.c
-@@ -21,6 +21,8 @@
-  *  with the SPL.  If not, see <http://www.gnu.org/licenses/>.
-  */
- 
-+#define	SPL_KMEM_CACHE_IMPLEMENTING
-+
- #include <linux/percpu_compat.h>
- #include <sys/kmem.h>
- #include <sys/kmem_cache.h>
-@@ -33,16 +35,6 @@
- #include <linux/swap.h>
- #include <linux/prefetch.h>
- 
--/*
-- * Within the scope of spl-kmem.c file the kmem_cache_* definitions
-- * are removed to allow access to the real Linux slab allocator.
-- */
--#undef kmem_cache_destroy
--#undef kmem_cache_create
--#undef kmem_cache_alloc
--#undef kmem_cache_free
--
--
- /*
-  * Linux 3.16 replaced smp_mb__{before,after}_{atomic,clear}_{dec,inc,bit}()
-  * with smp_mb__{before,after}_atomic() because they were redundant. This is
-diff --git a/module/os/linux/zfs/vdev_disk.c b/module/os/linux/zfs/vdev_disk.c
-index 7284b922b..e69c5f384 100644
---- a/module/os/linux/zfs/vdev_disk.c
-+++ b/module/os/linux/zfs/vdev_disk.c
-@@ -150,7 +150,11 @@ vdev_bdev_mode(spa_mode_t smode)
- static uint64_t
- bdev_capacity(struct block_device *bdev)
- {
-+#ifdef HAVE_BDEV_NR_BYTES
-+	return (bdev_nr_bytes(bdev));
-+#else
- 	return (i_size_read(bdev->bd_inode));
-+#endif
- }
- 
- #if !defined(HAVE_BDEV_WHOLE)
-@@ -209,7 +213,7 @@ bdev_max_capacity(struct block_device *bdev, uint64_t wholedisk)
- 		 * "reserved" EFI partition: in such cases return the device
- 		 * usable capacity.
- 		 */
--		available = i_size_read(bdev_whole(bdev)->bd_inode) -
-+		available = bdev_capacity(bdev_whole(bdev)) -
- 		    ((EFI_MIN_RESV_SIZE + NEW_START_BLOCK +
- 		    PARTITION_END_ALIGNMENT) << SECTOR_BITS);
- 		psize = MAX(available, bdev_capacity(bdev));
-@@ -925,12 +929,12 @@ vdev_disk_io_rw(zio_t *zio)
- 	/*
- 	 * Accessing outside the block device is never allowed.
- 	 */
--	if (zio->io_offset + zio->io_size > bdev->bd_inode->i_size) {
-+	if (zio->io_offset + zio->io_size > bdev_capacity(bdev)) {
- 		vdev_dbgmsg(zio->io_vd,
- 		    "Illegal access %llu size %llu, device size %llu",
- 		    (u_longlong_t)zio->io_offset,
- 		    (u_longlong_t)zio->io_size,
--		    (u_longlong_t)i_size_read(bdev->bd_inode));
-+		    (u_longlong_t)bdev_capacity(bdev));
- 		return (SET_ERROR(EIO));
- 	}
- 
-@@ -1123,12 +1127,12 @@ vdev_classic_physio(zio_t *zio)
- 	/*
- 	 * Accessing outside the block device is never allowed.
- 	 */
--	if (io_offset + io_size > bdev->bd_inode->i_size) {
-+	if (io_offset + io_size > bdev_capacity(bdev)) {
- 		vdev_dbgmsg(zio->io_vd,
- 		    "Illegal access %llu size %llu, device size %llu",
- 		    (u_longlong_t)io_offset,
- 		    (u_longlong_t)io_size,
--		    (u_longlong_t)i_size_read(bdev->bd_inode));
-+		    (u_longlong_t)bdev_capacity(bdev));
- 		return (SET_ERROR(EIO));
- 	}
- 
-diff --git a/module/os/linux/zfs/zvol_os.c b/module/os/linux/zfs/zvol_os.c
-index 1d5d54b80..c01caa6da 100644
---- a/module/os/linux/zfs/zvol_os.c
-+++ b/module/os/linux/zfs/zvol_os.c
-@@ -1076,8 +1076,106 @@ static const struct block_device_operations zvol_ops = {
- #endif
- };
- 
-+typedef struct zvol_queue_limits {
-+	unsigned int	zql_max_hw_sectors;
-+	unsigned short	zql_max_segments;
-+	unsigned int	zql_max_segment_size;
-+	unsigned int	zql_io_opt;
-+} zvol_queue_limits_t;
-+
-+static void
-+zvol_queue_limits_init(zvol_queue_limits_t *limits, zvol_state_t *zv,
-+    boolean_t use_blk_mq)
-+{
-+	limits->zql_max_hw_sectors = (DMU_MAX_ACCESS / 4) >> 9;
-+
-+	if (use_blk_mq) {
-+		/*
-+		 * IO requests can be really big (1MB).  When an IO request
-+		 * comes in, it is passed off to zvol_read() or zvol_write()
-+		 * in a new thread, where it is chunked up into 'volblocksize'
-+		 * sized pieces and processed.  So for example, if the request
-+		 * is a 1MB write and your volblocksize is 128k, one zvol_write
-+		 * thread will take that request and sequentially do ten 128k
-+		 * IOs.  This is due to the fact that the thread needs to lock
-+		 * each volblocksize sized block.  So you might be wondering:
-+		 * "instead of passing the whole 1MB request to one thread,
-+		 * why not pass ten individual 128k chunks to ten threads and
-+		 * process the whole write in parallel?"  The short answer is
-+		 * that there's a sweet spot number of chunks that balances
-+		 * the greater parallelism with the added overhead of more
-+		 * threads. The sweet spot can be different depending on if you
-+		 * have a read or write  heavy workload.  Writes typically want
-+		 * high chunk counts while reads typically want lower ones.  On
-+		 * a test pool with 6 NVMe drives in a 3x 2-disk mirror
-+		 * configuration, with volblocksize=8k, the sweet spot for good
-+		 * sequential reads and writes was at 8 chunks.
-+		 */
-+
-+		/*
-+		 * Below we tell the kernel how big we want our requests
-+		 * to be.  You would think that blk_queue_io_opt() would be
-+		 * used to do this since it is used to "set optimal request
-+		 * size for the queue", but that doesn't seem to do
-+		 * anything - the kernel still gives you huge requests
-+		 * with tons of little PAGE_SIZE segments contained within it.
-+		 *
-+		 * Knowing that the kernel will just give you PAGE_SIZE segments
-+		 * no matter what, you can say "ok, I want PAGE_SIZE byte
-+		 * segments, and I want 'N' of them per request", where N is
-+		 * the correct number of segments for the volblocksize and
-+		 * number of chunks you want.
-+		 */
-+#ifdef HAVE_BLK_MQ
-+		if (zvol_blk_mq_blocks_per_thread != 0) {
-+			unsigned int chunks;
-+			chunks = MIN(zvol_blk_mq_blocks_per_thread, UINT16_MAX);
-+
-+			limits->zql_max_segment_size = PAGE_SIZE;
-+			limits->zql_max_segments =
-+			    (zv->zv_volblocksize * chunks) / PAGE_SIZE;
-+		} else {
-+			/*
-+			 * Special case: zvol_blk_mq_blocks_per_thread = 0
-+			 * Max everything out.
-+			 */
-+			limits->zql_max_segments = UINT16_MAX;
-+			limits->zql_max_segment_size = UINT_MAX;
-+		}
-+	} else {
-+#endif
-+		limits->zql_max_segments = UINT16_MAX;
-+		limits->zql_max_segment_size = UINT_MAX;
-+	}
-+
-+	limits->zql_io_opt = zv->zv_volblocksize;
-+}
-+
-+#ifdef HAVE_BLK_ALLOC_DISK_2ARG
-+static void
-+zvol_queue_limits_convert(zvol_queue_limits_t *limits,
-+    struct queue_limits *qlimits)
-+{
-+	memset(qlimits, 0, sizeof (struct queue_limits));
-+	qlimits->max_hw_sectors = limits->zql_max_hw_sectors;
-+	qlimits->max_segments = limits->zql_max_segments;
-+	qlimits->max_segment_size = limits->zql_max_segment_size;
-+	qlimits->io_opt = limits->zql_io_opt;
-+}
-+#else
-+static void
-+zvol_queue_limits_apply(zvol_queue_limits_t *limits,
-+    struct request_queue *queue)
-+{
-+	blk_queue_max_hw_sectors(queue, limits->zql_max_hw_sectors);
-+	blk_queue_max_segments(queue, limits->zql_max_segments);
-+	blk_queue_max_segment_size(queue, limits->zql_max_segment_size);
-+	blk_queue_io_opt(queue, limits->zql_io_opt);
-+}
-+#endif
-+
- static int
--zvol_alloc_non_blk_mq(struct zvol_state_os *zso)
-+zvol_alloc_non_blk_mq(struct zvol_state_os *zso, zvol_queue_limits_t *limits)
- {
- #if defined(HAVE_SUBMIT_BIO_IN_BLOCK_DEVICE_OPERATIONS)
- #if defined(HAVE_BLK_ALLOC_DISK)
-@@ -1087,8 +1185,11 @@ zvol_alloc_non_blk_mq(struct zvol_state_os *zso)
- 
- 	zso->zvo_disk->minors = ZVOL_MINORS;
- 	zso->zvo_queue = zso->zvo_disk->queue;
-+	zvol_queue_limits_apply(limits, zso->zvo_queue);
- #elif defined(HAVE_BLK_ALLOC_DISK_2ARG)
--	struct gendisk *disk = blk_alloc_disk(NULL, NUMA_NO_NODE);
-+	struct queue_limits qlimits;
-+	zvol_queue_limits_convert(limits, &qlimits);
-+	struct gendisk *disk = blk_alloc_disk(&qlimits, NUMA_NO_NODE);
- 	if (IS_ERR(disk)) {
- 		zso->zvo_disk = NULL;
- 		return (1);
-@@ -1109,6 +1210,7 @@ zvol_alloc_non_blk_mq(struct zvol_state_os *zso)
- 	}
- 
- 	zso->zvo_disk->queue = zso->zvo_queue;
-+	zvol_queue_limits_apply(limits, zso->zvo_queue);
- #endif /* HAVE_BLK_ALLOC_DISK */
- #else
- 	zso->zvo_queue = blk_generic_alloc_queue(zvol_request, NUMA_NO_NODE);
-@@ -1122,13 +1224,14 @@ zvol_alloc_non_blk_mq(struct zvol_state_os *zso)
- 	}
- 
- 	zso->zvo_disk->queue = zso->zvo_queue;
-+	zvol_queue_limits_apply(limits, zso->zvo_queue);
- #endif /* HAVE_SUBMIT_BIO_IN_BLOCK_DEVICE_OPERATIONS */
- 	return (0);
- 
- }
- 
- static int
--zvol_alloc_blk_mq(zvol_state_t *zv)
-+zvol_alloc_blk_mq(zvol_state_t *zv, zvol_queue_limits_t *limits)
- {
- #ifdef HAVE_BLK_MQ
- 	struct zvol_state_os *zso = zv->zv_zso;
-@@ -1144,9 +1247,12 @@ zvol_alloc_blk_mq(zvol_state_t *zv)
- 		return (1);
- 	}
- 	zso->zvo_queue = zso->zvo_disk->queue;
-+	zvol_queue_limits_apply(limits, zso->zvo_queue);
- 	zso->zvo_disk->minors = ZVOL_MINORS;
- #elif defined(HAVE_BLK_ALLOC_DISK_2ARG)
--	struct gendisk *disk = blk_mq_alloc_disk(&zso->tag_set, NULL, zv);
-+	struct queue_limits qlimits;
-+	zvol_queue_limits_convert(limits, &qlimits);
-+	struct gendisk *disk = blk_mq_alloc_disk(&zso->tag_set, &qlimits, zv);
- 	if (IS_ERR(disk)) {
- 		zso->zvo_disk = NULL;
- 		blk_mq_free_tag_set(&zso->tag_set);
-@@ -1172,6 +1278,7 @@ zvol_alloc_blk_mq(zvol_state_t *zv)
- 
- 	/* Our queue is now created, assign it to our disk */
- 	zso->zvo_disk->queue = zso->zvo_queue;
-+	zvol_queue_limits_apply(limits, zso->zvo_queue);
- 
- #endif
- #endif
-@@ -1211,6 +1318,9 @@ zvol_alloc(dev_t dev, const char *name)
- 	zv->zv_zso->use_blk_mq = zvol_use_blk_mq;
- #endif
- 
-+	zvol_queue_limits_t limits;
-+	zvol_queue_limits_init(&limits, zv, zv->zv_zso->use_blk_mq);
-+
- 	/*
- 	 * The block layer has 3 interfaces for getting BIOs:
- 	 *
-@@ -1227,10 +1337,10 @@ zvol_alloc(dev_t dev, const char *name)
- 	 *    disk and the queue separately. (5.13 kernel or older)
- 	 */
- 	if (zv->zv_zso->use_blk_mq) {
--		ret = zvol_alloc_blk_mq(zv);
-+		ret = zvol_alloc_blk_mq(zv, &limits);
- 		zso->zvo_disk->fops = &zvol_ops_blk_mq;
- 	} else {
--		ret = zvol_alloc_non_blk_mq(zso);
-+		ret = zvol_alloc_non_blk_mq(zso, &limits);
- 		zso->zvo_disk->fops = &zvol_ops;
- 	}
- 	if (ret != 0)
-@@ -1514,74 +1624,10 @@ zvol_os_create_minor(const char *name)
- 
- 	set_capacity(zv->zv_zso->zvo_disk, zv->zv_volsize >> 9);
- 
--	blk_queue_max_hw_sectors(zv->zv_zso->zvo_queue,
--	    (DMU_MAX_ACCESS / 4) >> 9);
- 
--	if (zv->zv_zso->use_blk_mq) {
--		/*
--		 * IO requests can be really big (1MB).  When an IO request
--		 * comes in, it is passed off to zvol_read() or zvol_write()
--		 * in a new thread, where it is chunked up into 'volblocksize'
--		 * sized pieces and processed.  So for example, if the request
--		 * is a 1MB write and your volblocksize is 128k, one zvol_write
--		 * thread will take that request and sequentially do ten 128k
--		 * IOs.  This is due to the fact that the thread needs to lock
--		 * each volblocksize sized block.  So you might be wondering:
--		 * "instead of passing the whole 1MB request to one thread,
--		 * why not pass ten individual 128k chunks to ten threads and
--		 * process the whole write in parallel?"  The short answer is
--		 * that there's a sweet spot number of chunks that balances
--		 * the greater parallelism with the added overhead of more
--		 * threads. The sweet spot can be different depending on if you
--		 * have a read or write  heavy workload.  Writes typically want
--		 * high chunk counts while reads typically want lower ones.  On
--		 * a test pool with 6 NVMe drives in a 3x 2-disk mirror
--		 * configuration, with volblocksize=8k, the sweet spot for good
--		 * sequential reads and writes was at 8 chunks.
--		 */
--
--		/*
--		 * Below we tell the kernel how big we want our requests
--		 * to be.  You would think that blk_queue_io_opt() would be
--		 * used to do this since it is used to "set optimal request
--		 * size for the queue", but that doesn't seem to do
--		 * anything - the kernel still gives you huge requests
--		 * with tons of little PAGE_SIZE segments contained within it.
--		 *
--		 * Knowing that the kernel will just give you PAGE_SIZE segments
--		 * no matter what, you can say "ok, I want PAGE_SIZE byte
--		 * segments, and I want 'N' of them per request", where N is
--		 * the correct number of segments for the volblocksize and
--		 * number of chunks you want.
--		 */
--#ifdef HAVE_BLK_MQ
--		if (zvol_blk_mq_blocks_per_thread != 0) {
--			unsigned int chunks;
--			chunks = MIN(zvol_blk_mq_blocks_per_thread, UINT16_MAX);
--
--			blk_queue_max_segment_size(zv->zv_zso->zvo_queue,
--			    PAGE_SIZE);
--			blk_queue_max_segments(zv->zv_zso->zvo_queue,
--			    (zv->zv_volblocksize * chunks) / PAGE_SIZE);
--		} else {
--			/*
--			 * Special case: zvol_blk_mq_blocks_per_thread = 0
--			 * Max everything out.
--			 */
--			blk_queue_max_segments(zv->zv_zso->zvo_queue,
--			    UINT16_MAX);
--			blk_queue_max_segment_size(zv->zv_zso->zvo_queue,
--			    UINT_MAX);
--		}
--#endif
--	} else {
--		blk_queue_max_segments(zv->zv_zso->zvo_queue, UINT16_MAX);
--		blk_queue_max_segment_size(zv->zv_zso->zvo_queue, UINT_MAX);
--	}
- 
- 	blk_queue_physical_block_size(zv->zv_zso->zvo_queue,
- 	    zv->zv_volblocksize);
--	blk_queue_io_opt(zv->zv_zso->zvo_queue, zv->zv_volblocksize);
- 	blk_queue_max_discard_sectors(zv->zv_zso->zvo_queue,
- 	    (zvol_max_discard_blocks * zv->zv_volblocksize) >> 9);
- 	blk_queue_discard_granularity(zv->zv_zso->zvo_queue,
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/zfs.git/commitdiff/9ca31298a8257ef8fffd277b791e9ab63aad14eb



More information about the pld-cvs-commit mailing list