diff --git a/Makefile.in b/Makefile.in index 64deb2369a..67412c63d2 100644 --- a/Makefile.in +++ b/Makefile.in @@ -72,6 +72,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ + $(top_srcdir)/config/kernel-blk-queue-discard.m4 \ $(top_srcdir)/config/kernel-blk-queue-flush.m4 \ $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \ $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \ diff --git a/cmd/Makefile.in b/cmd/Makefile.in index 4a38f36fc4..b362f4bc45 100644 --- a/cmd/Makefile.in +++ b/cmd/Makefile.in @@ -49,6 +49,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ + $(top_srcdir)/config/kernel-blk-queue-discard.m4 \ $(top_srcdir)/config/kernel-blk-queue-flush.m4 \ $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \ $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \ diff --git a/cmd/mount_zfs/Makefile.in b/cmd/mount_zfs/Makefile.in index 273e205429..5945bd1c1d 100644 --- a/cmd/mount_zfs/Makefile.in +++ b/cmd/mount_zfs/Makefile.in @@ -52,6 +52,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ + $(top_srcdir)/config/kernel-blk-queue-discard.m4 \ $(top_srcdir)/config/kernel-blk-queue-flush.m4 \ $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \ $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \ diff --git a/cmd/sas_switch_id/Makefile.in b/cmd/sas_switch_id/Makefile.in index 73a22c4ef4..64d07e09ba 100644 --- a/cmd/sas_switch_id/Makefile.in +++ b/cmd/sas_switch_id/Makefile.in @@ -51,6 +51,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ + $(top_srcdir)/config/kernel-blk-queue-discard.m4 \ $(top_srcdir)/config/kernel-blk-queue-flush.m4 \ $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \ $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \ diff --git a/cmd/zdb/Makefile.in b/cmd/zdb/Makefile.in index 5ce100dd0e..0c99ae803f 100644 --- a/cmd/zdb/Makefile.in +++ b/cmd/zdb/Makefile.in @@ -52,6 +52,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ + $(top_srcdir)/config/kernel-blk-queue-discard.m4 \ $(top_srcdir)/config/kernel-blk-queue-flush.m4 \ $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \ $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \ diff --git a/cmd/zfs/Makefile.in b/cmd/zfs/Makefile.in index 81f778a5e4..71941603da 100644 --- a/cmd/zfs/Makefile.in +++ b/cmd/zfs/Makefile.in @@ -52,6 +52,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ + $(top_srcdir)/config/kernel-blk-queue-discard.m4 \ $(top_srcdir)/config/kernel-blk-queue-flush.m4 \ $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \ $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \ diff --git a/cmd/zinject/Makefile.in b/cmd/zinject/Makefile.in index 644c0b2a36..08aaa40ed4 100644 --- a/cmd/zinject/Makefile.in +++ b/cmd/zinject/Makefile.in @@ -52,6 +52,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ + $(top_srcdir)/config/kernel-blk-queue-discard.m4 \ $(top_srcdir)/config/kernel-blk-queue-flush.m4 \ $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \ $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \ diff --git a/cmd/zpios/Makefile.in b/cmd/zpios/Makefile.in index e270f3744d..8ab6938cc4 100644 --- a/cmd/zpios/Makefile.in +++ b/cmd/zpios/Makefile.in @@ -52,6 +52,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ + $(top_srcdir)/config/kernel-blk-queue-discard.m4 \ $(top_srcdir)/config/kernel-blk-queue-flush.m4 \ $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \ $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \ diff --git a/cmd/zpool/Makefile.in b/cmd/zpool/Makefile.in index 81620379a6..85d09af714 100644 --- a/cmd/zpool/Makefile.in +++ b/cmd/zpool/Makefile.in @@ -52,6 +52,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ + $(top_srcdir)/config/kernel-blk-queue-discard.m4 \ $(top_srcdir)/config/kernel-blk-queue-flush.m4 \ $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \ $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \ diff --git a/cmd/zpool_id/Makefile.in b/cmd/zpool_id/Makefile.in index 578fdbbc6e..204efe831a 100644 --- a/cmd/zpool_id/Makefile.in +++ b/cmd/zpool_id/Makefile.in @@ -51,6 +51,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ + $(top_srcdir)/config/kernel-blk-queue-discard.m4 \ $(top_srcdir)/config/kernel-blk-queue-flush.m4 \ $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \ $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \ diff --git a/cmd/zpool_layout/Makefile.in b/cmd/zpool_layout/Makefile.in index b89e9e8e8b..09ed6de1dc 100644 --- a/cmd/zpool_layout/Makefile.in +++ b/cmd/zpool_layout/Makefile.in @@ -51,6 +51,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ + $(top_srcdir)/config/kernel-blk-queue-discard.m4 \ $(top_srcdir)/config/kernel-blk-queue-flush.m4 \ $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \ $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \ diff --git a/cmd/ztest/Makefile.in b/cmd/ztest/Makefile.in index 70532fbef4..f6c5deda7a 100644 --- a/cmd/ztest/Makefile.in +++ b/cmd/ztest/Makefile.in @@ -52,6 +52,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ + $(top_srcdir)/config/kernel-blk-queue-discard.m4 \ $(top_srcdir)/config/kernel-blk-queue-flush.m4 \ $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \ $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \ diff --git a/cmd/zvol_id/Makefile.in b/cmd/zvol_id/Makefile.in index 6bacf9944a..f369599ee8 100644 --- a/cmd/zvol_id/Makefile.in +++ b/cmd/zvol_id/Makefile.in @@ -52,6 +52,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ + $(top_srcdir)/config/kernel-blk-queue-discard.m4 \ $(top_srcdir)/config/kernel-blk-queue-flush.m4 \ $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \ $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \ diff --git a/config/kernel-blk-queue-discard.m4 b/config/kernel-blk-queue-discard.m4 new file mode 100644 index 0000000000..3e5147a519 --- /dev/null +++ b/config/kernel-blk-queue-discard.m4 @@ -0,0 +1,22 @@ +dnl # +dnl # 2.6.32 API change +dnl # Discard requests were moved to the normal I/O path. +dnl # +AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_DISCARD], [ + AC_MSG_CHECKING([whether blk_queue_discard() is available]) + tmp_flags="$EXTRA_KCFLAGS" + EXTRA_KCFLAGS="-Wno-unused-but-set-variable" + ZFS_LINUX_TRY_COMPILE([ + #include + ],[ + struct request_queue *q = NULL; + (void) blk_queue_discard(q); + ],[ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_BLK_QUEUE_DISCARD, 1, + [blk_queue_discard() is available]) + ],[ + AC_MSG_RESULT(no) + ]) + EXTRA_KCFLAGS="$tmp_flags" +]) diff --git a/config/kernel.m4 b/config/kernel.m4 index c41cdf694b..0adceadacb 100644 --- a/config/kernel.m4 +++ b/config/kernel.m4 @@ -27,6 +27,7 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [ ZFS_AC_KERNEL_BLK_QUEUE_PHYSICAL_BLOCK_SIZE ZFS_AC_KERNEL_BLK_QUEUE_IO_OPT ZFS_AC_KERNEL_BLK_QUEUE_NONROT + ZFS_AC_KERNEL_BLK_QUEUE_DISCARD ZFS_AC_KERNEL_BLK_FETCH_REQUEST ZFS_AC_KERNEL_BLK_REQUEUE_REQUEST ZFS_AC_KERNEL_BLK_RQ_BYTES diff --git a/configure b/configure index 4288ca658f..0b00c6ddd9 100755 --- a/configure +++ b/configure @@ -14151,6 +14151,75 @@ $as_echo "no" >&6; } +fi + + rm -Rf build + + + EXTRA_KCFLAGS="$tmp_flags" + + + { $as_echo "$as_me:$LINENO: checking whether blk_queue_discard() is available" >&5 +$as_echo_n "checking whether blk_queue_discard() is available... " >&6; } + tmp_flags="$EXTRA_KCFLAGS" + EXTRA_KCFLAGS="-Wno-unused-but-set-variable" + + +cat confdefs.h - <<_ACEOF >conftest.c +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + + #include + +int +main (void) +{ + + struct request_queue *q = NULL; + (void) blk_queue_discard(q); + + ; + return 0; +} + +_ACEOF + + + rm -Rf build && mkdir -p build + echo "obj-m := conftest.o" >build/Makefile + if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } >/dev/null && { ac_try='test -s build/conftest.o' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + +cat >>confdefs.h <<\_ACEOF +#define HAVE_BLK_QUEUE_DISCARD 1 +_ACEOF + + +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + + + fi rm -Rf build @@ -19969,6 +20038,75 @@ $as_echo "no" >&6; } +fi + + rm -Rf build + + + EXTRA_KCFLAGS="$tmp_flags" + + + { $as_echo "$as_me:$LINENO: checking whether blk_queue_discard() is available" >&5 +$as_echo_n "checking whether blk_queue_discard() is available... " >&6; } + tmp_flags="$EXTRA_KCFLAGS" + EXTRA_KCFLAGS="-Wno-unused-but-set-variable" + + +cat confdefs.h - <<_ACEOF >conftest.c +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + + #include + +int +main (void) +{ + + struct request_queue *q = NULL; + (void) blk_queue_discard(q); + + ; + return 0; +} + +_ACEOF + + + rm -Rf build && mkdir -p build + echo "obj-m := conftest.o" >build/Makefile + if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } >/dev/null && { ac_try='test -s build/conftest.o' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + +cat >>confdefs.h <<\_ACEOF +#define HAVE_BLK_QUEUE_DISCARD 1 +_ACEOF + + +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + + + fi rm -Rf build diff --git a/dracut/90zfs/Makefile.in b/dracut/90zfs/Makefile.in index f574205dd9..0725bbc74e 100644 --- a/dracut/90zfs/Makefile.in +++ b/dracut/90zfs/Makefile.in @@ -50,6 +50,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ + $(top_srcdir)/config/kernel-blk-queue-discard.m4 \ $(top_srcdir)/config/kernel-blk-queue-flush.m4 \ $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \ $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \ diff --git a/dracut/Makefile.in b/dracut/Makefile.in index a9f8be2053..1544385b40 100644 --- a/dracut/Makefile.in +++ b/dracut/Makefile.in @@ -49,6 +49,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ + $(top_srcdir)/config/kernel-blk-queue-discard.m4 \ $(top_srcdir)/config/kernel-blk-queue-flush.m4 \ $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \ $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \ diff --git a/etc/Makefile.in b/etc/Makefile.in index 2cb43ca3c9..14737685d0 100644 --- a/etc/Makefile.in +++ b/etc/Makefile.in @@ -49,6 +49,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ + $(top_srcdir)/config/kernel-blk-queue-discard.m4 \ $(top_srcdir)/config/kernel-blk-queue-flush.m4 \ $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \ $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \ diff --git a/etc/init.d/Makefile.in b/etc/init.d/Makefile.in index 73f07f4b6e..cbed8c0acf 100644 --- a/etc/init.d/Makefile.in +++ b/etc/init.d/Makefile.in @@ -50,6 +50,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ + $(top_srcdir)/config/kernel-blk-queue-discard.m4 \ $(top_srcdir)/config/kernel-blk-queue-flush.m4 \ $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \ $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \ diff --git a/etc/zfs/Makefile.in b/etc/zfs/Makefile.in index 8024d3095c..e161cb4551 100644 --- a/etc/zfs/Makefile.in +++ b/etc/zfs/Makefile.in @@ -50,6 +50,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ + $(top_srcdir)/config/kernel-blk-queue-discard.m4 \ $(top_srcdir)/config/kernel-blk-queue-flush.m4 \ $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \ $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \ diff --git a/include/Makefile.in b/include/Makefile.in index d7423a3c77..9f3972782f 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -51,6 +51,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ + $(top_srcdir)/config/kernel-blk-queue-discard.m4 \ $(top_srcdir)/config/kernel-blk-queue-flush.m4 \ $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \ $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \ diff --git a/include/linux/Makefile.in b/include/linux/Makefile.in index d18e5dd9c6..9c69b62571 100644 --- a/include/linux/Makefile.in +++ b/include/linux/Makefile.in @@ -51,6 +51,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ + $(top_srcdir)/config/kernel-blk-queue-discard.m4 \ $(top_srcdir)/config/kernel-blk-queue-flush.m4 \ $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \ $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \ diff --git a/include/linux/blkdev_compat.h b/include/linux/blkdev_compat.h index 56a1bafe9f..bd1b2bf540 100644 --- a/include/linux/blkdev_compat.h +++ b/include/linux/blkdev_compat.h @@ -424,6 +424,14 @@ bio_set_flags_failfast(struct block_device *bdev, int *flags) # define VDEV_REQ_FUA REQ_HARDBARRIER #endif +/* + * 2.6.32 API change + * Use the normal I/O patch for discards. + */ +#ifdef REQ_DISCARD +# define VDEV_REQ_DISCARD REQ_DISCARD +#endif + /* * Default Linux IO Scheduler, * Setting the scheduler to noop will allow the Linux IO scheduler to diff --git a/include/sys/Makefile.in b/include/sys/Makefile.in index 06c20479b8..91fd34b657 100644 --- a/include/sys/Makefile.in +++ b/include/sys/Makefile.in @@ -51,6 +51,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ + $(top_srcdir)/config/kernel-blk-queue-discard.m4 \ $(top_srcdir)/config/kernel-blk-queue-flush.m4 \ $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \ $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \ diff --git a/include/sys/fm/Makefile.in b/include/sys/fm/Makefile.in index 245995ddaa..0dcd27b10b 100644 --- a/include/sys/fm/Makefile.in +++ b/include/sys/fm/Makefile.in @@ -51,6 +51,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ + $(top_srcdir)/config/kernel-blk-queue-discard.m4 \ $(top_srcdir)/config/kernel-blk-queue-flush.m4 \ $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \ $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \ diff --git a/include/sys/fm/fs/Makefile.in b/include/sys/fm/fs/Makefile.in index 10dcd83e91..03c32de061 100644 --- a/include/sys/fm/fs/Makefile.in +++ b/include/sys/fm/fs/Makefile.in @@ -51,6 +51,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ + $(top_srcdir)/config/kernel-blk-queue-discard.m4 \ $(top_srcdir)/config/kernel-blk-queue-flush.m4 \ $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \ $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \ diff --git a/include/sys/fs/Makefile.in b/include/sys/fs/Makefile.in index ee2f168216..1f8de0f079 100644 --- a/include/sys/fs/Makefile.in +++ b/include/sys/fs/Makefile.in @@ -51,6 +51,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ + $(top_srcdir)/config/kernel-blk-queue-discard.m4 \ $(top_srcdir)/config/kernel-blk-queue-flush.m4 \ $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \ $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \ diff --git a/lib/Makefile.in b/lib/Makefile.in index 43bdf0dc22..daaf306b1c 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -49,6 +49,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ + $(top_srcdir)/config/kernel-blk-queue-discard.m4 \ $(top_srcdir)/config/kernel-blk-queue-flush.m4 \ $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \ $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \ diff --git a/lib/libavl/Makefile.in b/lib/libavl/Makefile.in index d909fa66aa..d28c6acde4 100644 --- a/lib/libavl/Makefile.in +++ b/lib/libavl/Makefile.in @@ -51,6 +51,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ + $(top_srcdir)/config/kernel-blk-queue-discard.m4 \ $(top_srcdir)/config/kernel-blk-queue-flush.m4 \ $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \ $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \ diff --git a/lib/libefi/Makefile.in b/lib/libefi/Makefile.in index a0595ce5da..4a935784a4 100644 --- a/lib/libefi/Makefile.in +++ b/lib/libefi/Makefile.in @@ -51,6 +51,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ + $(top_srcdir)/config/kernel-blk-queue-discard.m4 \ $(top_srcdir)/config/kernel-blk-queue-flush.m4 \ $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \ $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \ diff --git a/lib/libnvpair/Makefile.in b/lib/libnvpair/Makefile.in index 533d962356..e982a68bd8 100644 --- a/lib/libnvpair/Makefile.in +++ b/lib/libnvpair/Makefile.in @@ -51,6 +51,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ + $(top_srcdir)/config/kernel-blk-queue-discard.m4 \ $(top_srcdir)/config/kernel-blk-queue-flush.m4 \ $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \ $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \ diff --git a/lib/libshare/Makefile.in b/lib/libshare/Makefile.in index 8390ce835d..61b61a700d 100644 --- a/lib/libshare/Makefile.in +++ b/lib/libshare/Makefile.in @@ -51,6 +51,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ + $(top_srcdir)/config/kernel-blk-queue-discard.m4 \ $(top_srcdir)/config/kernel-blk-queue-flush.m4 \ $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \ $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \ diff --git a/lib/libspl/Makefile.in b/lib/libspl/Makefile.in index 541f72b9d1..2d1a8ad170 100644 --- a/lib/libspl/Makefile.in +++ b/lib/libspl/Makefile.in @@ -51,6 +51,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ + $(top_srcdir)/config/kernel-blk-queue-discard.m4 \ $(top_srcdir)/config/kernel-blk-queue-flush.m4 \ $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \ $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \ diff --git a/lib/libspl/asm-generic/Makefile.in b/lib/libspl/asm-generic/Makefile.in index 974f489adb..63b0ef392e 100644 --- a/lib/libspl/asm-generic/Makefile.in +++ b/lib/libspl/asm-generic/Makefile.in @@ -50,6 +50,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ + $(top_srcdir)/config/kernel-blk-queue-discard.m4 \ $(top_srcdir)/config/kernel-blk-queue-flush.m4 \ $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \ $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \ diff --git a/lib/libspl/asm-i386/Makefile.in b/lib/libspl/asm-i386/Makefile.in index f84cd39d97..2d43d89188 100644 --- a/lib/libspl/asm-i386/Makefile.in +++ b/lib/libspl/asm-i386/Makefile.in @@ -51,6 +51,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ + $(top_srcdir)/config/kernel-blk-queue-discard.m4 \ $(top_srcdir)/config/kernel-blk-queue-flush.m4 \ $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \ $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \ diff --git a/lib/libspl/asm-x86_64/Makefile.in b/lib/libspl/asm-x86_64/Makefile.in index 23c4b2917f..c6d61a5fa4 100644 --- a/lib/libspl/asm-x86_64/Makefile.in +++ b/lib/libspl/asm-x86_64/Makefile.in @@ -51,6 +51,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ + $(top_srcdir)/config/kernel-blk-queue-discard.m4 \ $(top_srcdir)/config/kernel-blk-queue-flush.m4 \ $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \ $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \ diff --git a/lib/libspl/include/Makefile.in b/lib/libspl/include/Makefile.in index 043f0fe1e4..ab1d8511ec 100644 --- a/lib/libspl/include/Makefile.in +++ b/lib/libspl/include/Makefile.in @@ -51,6 +51,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ + $(top_srcdir)/config/kernel-blk-queue-discard.m4 \ $(top_srcdir)/config/kernel-blk-queue-flush.m4 \ $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \ $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \ diff --git a/lib/libspl/include/ia32/Makefile.in b/lib/libspl/include/ia32/Makefile.in index dad5d85613..f1f6cb87fd 100644 --- a/lib/libspl/include/ia32/Makefile.in +++ b/lib/libspl/include/ia32/Makefile.in @@ -49,6 +49,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ + $(top_srcdir)/config/kernel-blk-queue-discard.m4 \ $(top_srcdir)/config/kernel-blk-queue-flush.m4 \ $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \ $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \ diff --git a/lib/libspl/include/ia32/sys/Makefile.in b/lib/libspl/include/ia32/sys/Makefile.in index d7ea24fff9..70eb6a35df 100644 --- a/lib/libspl/include/ia32/sys/Makefile.in +++ b/lib/libspl/include/ia32/sys/Makefile.in @@ -51,6 +51,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ + $(top_srcdir)/config/kernel-blk-queue-discard.m4 \ $(top_srcdir)/config/kernel-blk-queue-flush.m4 \ $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \ $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \ diff --git a/lib/libspl/include/rpc/Makefile.in b/lib/libspl/include/rpc/Makefile.in index 3a0b3a1aff..a217ab6dc6 100644 --- a/lib/libspl/include/rpc/Makefile.in +++ b/lib/libspl/include/rpc/Makefile.in @@ -51,6 +51,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ + $(top_srcdir)/config/kernel-blk-queue-discard.m4 \ $(top_srcdir)/config/kernel-blk-queue-flush.m4 \ $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \ $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \ diff --git a/lib/libspl/include/sys/Makefile.in b/lib/libspl/include/sys/Makefile.in index b8663bdd2e..efa77adc6c 100644 --- a/lib/libspl/include/sys/Makefile.in +++ b/lib/libspl/include/sys/Makefile.in @@ -51,6 +51,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ + $(top_srcdir)/config/kernel-blk-queue-discard.m4 \ $(top_srcdir)/config/kernel-blk-queue-flush.m4 \ $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \ $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \ diff --git a/lib/libspl/include/sys/dktp/Makefile.in b/lib/libspl/include/sys/dktp/Makefile.in index e5c3537955..1656d9d4ee 100644 --- a/lib/libspl/include/sys/dktp/Makefile.in +++ b/lib/libspl/include/sys/dktp/Makefile.in @@ -51,6 +51,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ + $(top_srcdir)/config/kernel-blk-queue-discard.m4 \ $(top_srcdir)/config/kernel-blk-queue-flush.m4 \ $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \ $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \ diff --git a/lib/libspl/include/sys/sysevent/Makefile.in b/lib/libspl/include/sys/sysevent/Makefile.in index edb36b0710..5a37394e3a 100644 --- a/lib/libspl/include/sys/sysevent/Makefile.in +++ b/lib/libspl/include/sys/sysevent/Makefile.in @@ -51,6 +51,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ + $(top_srcdir)/config/kernel-blk-queue-discard.m4 \ $(top_srcdir)/config/kernel-blk-queue-flush.m4 \ $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \ $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \ diff --git a/lib/libspl/include/util/Makefile.in b/lib/libspl/include/util/Makefile.in index 301fde5879..8894eb57a8 100644 --- a/lib/libspl/include/util/Makefile.in +++ b/lib/libspl/include/util/Makefile.in @@ -51,6 +51,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ + $(top_srcdir)/config/kernel-blk-queue-discard.m4 \ $(top_srcdir)/config/kernel-blk-queue-flush.m4 \ $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \ $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \ diff --git a/lib/libunicode/Makefile.in b/lib/libunicode/Makefile.in index 3e3cb2df10..6135529f8b 100644 --- a/lib/libunicode/Makefile.in +++ b/lib/libunicode/Makefile.in @@ -51,6 +51,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ + $(top_srcdir)/config/kernel-blk-queue-discard.m4 \ $(top_srcdir)/config/kernel-blk-queue-flush.m4 \ $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \ $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \ diff --git a/lib/libuutil/Makefile.in b/lib/libuutil/Makefile.in index 1fb5e573db..e10118898a 100644 --- a/lib/libuutil/Makefile.in +++ b/lib/libuutil/Makefile.in @@ -51,6 +51,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ + $(top_srcdir)/config/kernel-blk-queue-discard.m4 \ $(top_srcdir)/config/kernel-blk-queue-flush.m4 \ $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \ $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \ diff --git a/lib/libzfs/Makefile.in b/lib/libzfs/Makefile.in index 9ba47ca73a..84e9e2a7ed 100644 --- a/lib/libzfs/Makefile.in +++ b/lib/libzfs/Makefile.in @@ -51,6 +51,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ + $(top_srcdir)/config/kernel-blk-queue-discard.m4 \ $(top_srcdir)/config/kernel-blk-queue-flush.m4 \ $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \ $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \ diff --git a/lib/libzpool/Makefile.in b/lib/libzpool/Makefile.in index fc071e22a8..6c6b3b1e7a 100644 --- a/lib/libzpool/Makefile.in +++ b/lib/libzpool/Makefile.in @@ -51,6 +51,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ + $(top_srcdir)/config/kernel-blk-queue-discard.m4 \ $(top_srcdir)/config/kernel-blk-queue-flush.m4 \ $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \ $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \ diff --git a/man/Makefile.in b/man/Makefile.in index 8e98be3d16..1552a216a0 100644 --- a/man/Makefile.in +++ b/man/Makefile.in @@ -49,6 +49,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ + $(top_srcdir)/config/kernel-blk-queue-discard.m4 \ $(top_srcdir)/config/kernel-blk-queue-flush.m4 \ $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \ $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \ diff --git a/man/man8/Makefile.in b/man/man8/Makefile.in index 12524ffcce..5d1fcd726f 100644 --- a/man/man8/Makefile.in +++ b/man/man8/Makefile.in @@ -49,6 +49,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ + $(top_srcdir)/config/kernel-blk-queue-discard.m4 \ $(top_srcdir)/config/kernel-blk-queue-flush.m4 \ $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \ $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \ diff --git a/module/zfs/zvol.c b/module/zfs/zvol.c index 19888ea96f..9b13134024 100644 --- a/module/zfs/zvol.c +++ b/module/zfs/zvol.c @@ -574,6 +574,42 @@ zvol_write(void *arg) blk_end_request(req, -error, size); } +#ifdef HAVE_BLK_QUEUE_DISCARD +static void +zvol_discard(void *arg) +{ + struct request *req = (struct request *)arg; + struct request_queue *q = req->q; + zvol_state_t *zv = q->queuedata; + uint64_t offset = blk_rq_pos(req) << 9; + uint64_t size = blk_rq_bytes(req); + int error; + rl_t *rl; + + if (offset + size > zv->zv_volsize) { + blk_end_request(req, -EIO, size); + return; + } + + if (size == 0) { + blk_end_request(req, 0, size); + return; + } + + rl = zfs_range_lock(&zv->zv_znode, offset, size, RL_WRITER); + + error = dmu_free_long_range(zv->zv_objset, ZVOL_OBJ, offset, size); + + /* + * TODO: maybe we should add the operation to the log. + */ + + zfs_range_unlock(rl); + + blk_end_request(req, -error, size); +} +#endif /* HAVE_BLK_QUEUE_DISCARD */ + /* * Common read path running under the zvol taskq context. This function * is responsible for copying the requested data out of the DMU and in to @@ -674,6 +710,13 @@ zvol_request(struct request_queue *q) break; } +#ifdef HAVE_BLK_QUEUE_DISCARD + if (req->cmd_flags & VDEV_REQ_DISCARD) { + zvol_dispatch(zvol_discard, req); + break; + } +#endif /* HAVE_BLK_QUEUE_DISCARD */ + zvol_dispatch(zvol_write, req); break; default: @@ -1193,6 +1236,10 @@ __zvol_create_minor(const char *name) blk_queue_max_segment_size(zv->zv_queue, UINT_MAX); blk_queue_physical_block_size(zv->zv_queue, zv->zv_volblocksize); blk_queue_io_opt(zv->zv_queue, zv->zv_volblocksize); +#ifdef HAVE_BLK_QUEUE_DISCARD + blk_queue_max_discard_sectors(zv->zv_queue, UINT_MAX); + queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, zv->zv_queue); +#endif #ifdef HAVE_BLK_QUEUE_NONROT queue_flag_set_unlocked(QUEUE_FLAG_NONROT, zv->zv_queue); #endif diff --git a/scripts/Makefile.in b/scripts/Makefile.in index f8316f960f..a3822d902a 100644 --- a/scripts/Makefile.in +++ b/scripts/Makefile.in @@ -50,6 +50,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ + $(top_srcdir)/config/kernel-blk-queue-discard.m4 \ $(top_srcdir)/config/kernel-blk-queue-flush.m4 \ $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \ $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \ diff --git a/scripts/zpios-profile/Makefile.in b/scripts/zpios-profile/Makefile.in index 0264aa45d3..ed4e3192c1 100644 --- a/scripts/zpios-profile/Makefile.in +++ b/scripts/zpios-profile/Makefile.in @@ -50,6 +50,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ + $(top_srcdir)/config/kernel-blk-queue-discard.m4 \ $(top_srcdir)/config/kernel-blk-queue-flush.m4 \ $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \ $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \ diff --git a/scripts/zpios-test/Makefile.in b/scripts/zpios-test/Makefile.in index b5d5d25697..637dfd7fa2 100644 --- a/scripts/zpios-test/Makefile.in +++ b/scripts/zpios-test/Makefile.in @@ -50,6 +50,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ + $(top_srcdir)/config/kernel-blk-queue-discard.m4 \ $(top_srcdir)/config/kernel-blk-queue-flush.m4 \ $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \ $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \ diff --git a/scripts/zpool-config/Makefile.in b/scripts/zpool-config/Makefile.in index 73c32494d3..6afa78fc08 100644 --- a/scripts/zpool-config/Makefile.in +++ b/scripts/zpool-config/Makefile.in @@ -50,6 +50,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ + $(top_srcdir)/config/kernel-blk-queue-discard.m4 \ $(top_srcdir)/config/kernel-blk-queue-flush.m4 \ $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \ $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \ diff --git a/scripts/zpool-layout/Makefile.in b/scripts/zpool-layout/Makefile.in index 70545c4c7f..ca09273826 100644 --- a/scripts/zpool-layout/Makefile.in +++ b/scripts/zpool-layout/Makefile.in @@ -50,6 +50,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ + $(top_srcdir)/config/kernel-blk-queue-discard.m4 \ $(top_srcdir)/config/kernel-blk-queue-flush.m4 \ $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \ $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \ diff --git a/udev/Makefile.in b/udev/Makefile.in index 018d0a72e2..6b20a9fc6c 100644 --- a/udev/Makefile.in +++ b/udev/Makefile.in @@ -49,6 +49,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ + $(top_srcdir)/config/kernel-blk-queue-discard.m4 \ $(top_srcdir)/config/kernel-blk-queue-flush.m4 \ $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \ $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \ diff --git a/udev/rules.d/Makefile.in b/udev/rules.d/Makefile.in index 671fb7b759..fe559cd73e 100644 --- a/udev/rules.d/Makefile.in +++ b/udev/rules.d/Makefile.in @@ -50,6 +50,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-bio-rw-syncio.m4 \ $(top_srcdir)/config/kernel-blk-end-request.m4 \ $(top_srcdir)/config/kernel-blk-fetch-request.m4 \ + $(top_srcdir)/config/kernel-blk-queue-discard.m4 \ $(top_srcdir)/config/kernel-blk-queue-flush.m4 \ $(top_srcdir)/config/kernel-blk-queue-io-opt.m4 \ $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \ diff --git a/zfs_config.h.in b/zfs_config.h.in index c91735a8e9..887f0f7c9b 100644 --- a/zfs_config.h.in +++ b/zfs_config.h.in @@ -51,6 +51,9 @@ /* blk_fetch_request() is available */ #undef HAVE_BLK_FETCH_REQUEST +/* blk_queue_discard() is available */ +#undef HAVE_BLK_QUEUE_DISCARD + /* blk_queue_flush() is available */ #undef HAVE_BLK_QUEUE_FLUSH