diff --git a/.gitmodules b/.gitmodules index 95d8032..aaca964 100644 --- a/.gitmodules +++ b/.gitmodules @@ -64,3 +64,15 @@ [submodule "packages/linux-zen/zfs-linux-zen"] path = packages/linux-zen/zfs-linux-zen url = ssh+git://aur@aur.archlinux.org/zfs-linux-zen.git +[submodule "packages/linux-vfio/zfs-linux-vfio"] + path = packages/linux-vfio/zfs-linux-vfio + url = ssh://aur@aur.archlinux.org/zfs-linux-vfio.git +[submodule "packages/linux-vfio/zfs-linux-vfio-git"] + path = packages/linux-vfio/zfs-linux-vfio-git + url = ssh://aur@aur.archlinux.org/zfs-linux-vfio-git.git +[submodule "packages/linux-vfio/spl-linux-vfio-git"] + path = packages/linux-vfio/spl-linux-vfio-git + url = ssh://aur@aur.archlinux.org/spl-linux-vfio-git.git +[submodule "packages/linux-vfio/spl-linux-vfio"] + path = packages/linux-vfio/spl-linux-vfio + url = ssh://aur@aur.archlinux.org/spl-linux-vfio.git diff --git a/conf.sh b/conf.sh index 36b8988..9fd2807 100644 --- a/conf.sh +++ b/conf.sh @@ -1,9 +1,9 @@ # ZFSonLinux stable version -zol_version="0.7.3" +zol_version="0.7.4" # The ZOL source hashes are from zfsonlinux.org -zfs_src_hash="cb8fc606835d3f91471e49aca31a6a0a71733b1cbe74fa510e0fe0efa670fe51" -spl_src_hash="cd8b8624163577bdec1d1d214c942c5771f183432a04d35c00fc6e7f12fa836b" +spl_src_hash="cae43c81838f90a444be25bdff5c6c3ee99ffe515a2f477d9758a6274a1a7dc4" +zfs_src_hash="9536a9be5d05329570afc9fc168be45cd38f832e2e7ede15f2c5cd223beb16d3" zfs_bash_completion_hash="b60214f70ffffb62ffe489cbfabd2e069d14ed2a391fac0e36f914238394b540" zfs_initcpio_install_hash="e33adabbe3f2f4866802c9d63c7810c7a42b4df2288d0cdd23376519b15b36e4" diff --git a/packages/common-git/spl-utils-common-git b/packages/common-git/spl-utils-common-git index 66dd2e7..888b4c3 160000 --- a/packages/common-git/spl-utils-common-git +++ b/packages/common-git/spl-utils-common-git @@ -1 +1 @@ -Subproject commit 66dd2e745124865955906685ff76de0d0161aba4 +Subproject commit 888b4c3b56a820d74fc61822a05e95bf669147ab diff --git a/packages/common-git/zfs-utils-common-git b/packages/common-git/zfs-utils-common-git index b06cc0e..2f25c4e 160000 --- a/packages/common-git/zfs-utils-common-git +++ b/packages/common-git/zfs-utils-common-git @@ -1 +1 @@ -Subproject commit b06cc0e568ec5b78a75331c66b9ff184945b6e5a +Subproject commit 2f25c4ed8b09ed799a3d75be0d9982d227df8de9 diff --git a/packages/common/spl-utils-common b/packages/common/spl-utils-common index 8c7010a..06cd2f6 160000 --- a/packages/common/spl-utils-common +++ b/packages/common/spl-utils-common @@ -1 +1 @@ -Subproject commit 8c7010a5873ff7fea945219ab559efb95cdbfe5b +Subproject commit 06cd2f639b87548cf14244e565c9955e6d3148bd diff --git a/packages/common/zfs-utils-common b/packages/common/zfs-utils-common index c5e6537..f9e13d3 160000 --- a/packages/common/zfs-utils-common +++ b/packages/common/zfs-utils-common @@ -1 +1 @@ -Subproject commit c5e653772a545e4076a559d82f20f2bb3d3f260a +Subproject commit f9e13d33fdd312f15423b1cab05f6db81836e16f diff --git a/packages/linux-hardened/spl-linux-hardened b/packages/linux-hardened/spl-linux-hardened index e72cf25..c45b1cb 160000 --- a/packages/linux-hardened/spl-linux-hardened +++ b/packages/linux-hardened/spl-linux-hardened @@ -1 +1 @@ -Subproject commit e72cf258d6ce143674d04a456710eb26d16b19e7 +Subproject commit c45b1cb97933f6e3b5bf10a9cace8e20608f4baa diff --git a/packages/linux-hardened/spl-linux-hardened-git b/packages/linux-hardened/spl-linux-hardened-git index eb71b2e..6ed3452 160000 --- a/packages/linux-hardened/spl-linux-hardened-git +++ b/packages/linux-hardened/spl-linux-hardened-git @@ -1 +1 @@ -Subproject commit eb71b2e0e0d4f19e632eb6ee79159f022e1ef7f2 +Subproject commit 6ed34527968c28341735d4a7dd3e541d163138de diff --git a/packages/linux-hardened/zfs-linux-hardened b/packages/linux-hardened/zfs-linux-hardened index 2bbf289..744b229 160000 --- a/packages/linux-hardened/zfs-linux-hardened +++ b/packages/linux-hardened/zfs-linux-hardened @@ -1 +1 @@ -Subproject commit 2bbf289a793145f9446ad646306e765548f2ec8b +Subproject commit 744b229831ff3c3b0ef5878a7fe9d72bac6fa40e diff --git a/packages/linux-hardened/zfs-linux-hardened-git b/packages/linux-hardened/zfs-linux-hardened-git index f87708a..adda567 160000 --- a/packages/linux-hardened/zfs-linux-hardened-git +++ b/packages/linux-hardened/zfs-linux-hardened-git @@ -1 +1 @@ -Subproject commit f87708ae068b750eba5c697fadd3511c6f78e307 +Subproject commit adda567424592d4ab0ff7b8f6bc6a9f1c7d4bb07 diff --git a/packages/linux-lts/spl-linux-lts b/packages/linux-lts/spl-linux-lts index 1d45094..900f6b9 160000 --- a/packages/linux-lts/spl-linux-lts +++ b/packages/linux-lts/spl-linux-lts @@ -1 +1 @@ -Subproject commit 1d4509405be16e6a35ea36a5eb0874fce83863c6 +Subproject commit 900f6b979b228a0b0ba9f8491f7f3775bc86bed1 diff --git a/packages/linux-lts/spl-linux-lts-git b/packages/linux-lts/spl-linux-lts-git index 14f2a5e..b80858e 160000 --- a/packages/linux-lts/spl-linux-lts-git +++ b/packages/linux-lts/spl-linux-lts-git @@ -1 +1 @@ -Subproject commit 14f2a5e097608cdc40d8d84638c8b6a5af2f7194 +Subproject commit b80858e1c58bc28ae95edc181d56bd7557a252be diff --git a/packages/linux-lts/zfs-linux-lts b/packages/linux-lts/zfs-linux-lts index 7f3d156..d1fe132 160000 --- a/packages/linux-lts/zfs-linux-lts +++ b/packages/linux-lts/zfs-linux-lts @@ -1 +1 @@ -Subproject commit 7f3d1562f5e28143ee96d97458a67deb651fc4db +Subproject commit d1fe132af45fcd5579e5fa12e09c8cfce115b997 diff --git a/packages/linux-lts/zfs-linux-lts-git b/packages/linux-lts/zfs-linux-lts-git index 3b04412..4e01bb5 160000 --- a/packages/linux-lts/zfs-linux-lts-git +++ b/packages/linux-lts/zfs-linux-lts-git @@ -1 +1 @@ -Subproject commit 3b04412f9bbb3ecc201bc591229ae3eec2de56ee +Subproject commit 4e01bb561977f88ae80571ad42018fd21e7790cb diff --git a/packages/linux-vfio/spl-linux-vfio b/packages/linux-vfio/spl-linux-vfio new file mode 160000 index 0000000..ac8ad86 --- /dev/null +++ b/packages/linux-vfio/spl-linux-vfio @@ -0,0 +1 @@ +Subproject commit ac8ad862f99eece4d9f3d4ff59d0c85ecefa3a2a diff --git a/packages/linux-vfio/spl-linux-vfio-git b/packages/linux-vfio/spl-linux-vfio-git new file mode 160000 index 0000000..c2679ab --- /dev/null +++ b/packages/linux-vfio/spl-linux-vfio-git @@ -0,0 +1 @@ +Subproject commit c2679ab5728b8275abfa70476da9560ad844b2a3 diff --git a/packages/linux-vfio/zfs-linux-vfio b/packages/linux-vfio/zfs-linux-vfio new file mode 160000 index 0000000..8eca03f --- /dev/null +++ b/packages/linux-vfio/zfs-linux-vfio @@ -0,0 +1 @@ +Subproject commit 8eca03fd95b2076f30c0972d7a3341f258a5e65e diff --git a/packages/linux-vfio/zfs-linux-vfio-git b/packages/linux-vfio/zfs-linux-vfio-git new file mode 160000 index 0000000..f02469a --- /dev/null +++ b/packages/linux-vfio/zfs-linux-vfio-git @@ -0,0 +1 @@ +Subproject commit f02469af6e1bec435f9b83dd35eb1a20fc56c00d diff --git a/packages/linux-zen/spl-linux-zen b/packages/linux-zen/spl-linux-zen index 1b79c9f..9a3bd3c 160000 --- a/packages/linux-zen/spl-linux-zen +++ b/packages/linux-zen/spl-linux-zen @@ -1 +1 @@ -Subproject commit 1b79c9fbe1a2a6f6aa567caff01a71f4c365758a +Subproject commit 9a3bd3c64b998b5339914e94903189aa1bcdd810 diff --git a/packages/linux-zen/spl-linux-zen-git b/packages/linux-zen/spl-linux-zen-git index 1ffed03..bebb9be 160000 --- a/packages/linux-zen/spl-linux-zen-git +++ b/packages/linux-zen/spl-linux-zen-git @@ -1 +1 @@ -Subproject commit 1ffed03a2691b6b11a25daaf1e113c8de4294ff5 +Subproject commit bebb9bef98a0bc8fece581b8464036b1b8012c35 diff --git a/packages/linux-zen/zfs-linux-zen b/packages/linux-zen/zfs-linux-zen index 57bc328..ff4d8c1 160000 --- a/packages/linux-zen/zfs-linux-zen +++ b/packages/linux-zen/zfs-linux-zen @@ -1 +1 @@ -Subproject commit 57bc32840902c1fd2238cab607fe6c949a5846bf +Subproject commit ff4d8c16348ef2af9d98d038525e8b169aa9c59d diff --git a/packages/linux-zen/zfs-linux-zen-git b/packages/linux-zen/zfs-linux-zen-git index 697f793..345cedd 160000 --- a/packages/linux-zen/zfs-linux-zen-git +++ b/packages/linux-zen/zfs-linux-zen-git @@ -1 +1 @@ -Subproject commit 697f793d87adbe00e12797b7d60950c1a318635a +Subproject commit 345ceddebdb5fd224c317271db94fb4cc6b8b85e diff --git a/packages/linux/spl-linux b/packages/linux/spl-linux index b499976..36206b4 160000 --- a/packages/linux/spl-linux +++ b/packages/linux/spl-linux @@ -1 +1 @@ -Subproject commit b4999762c20c4cea1eb6b173651500bb32f41af3 +Subproject commit 36206b455a101b33b5ff44131d00eb102d4f63aa diff --git a/packages/linux/spl-linux-git b/packages/linux/spl-linux-git index 3920f48..4879199 160000 --- a/packages/linux/spl-linux-git +++ b/packages/linux/spl-linux-git @@ -1 +1 @@ -Subproject commit 3920f48d1ce3fec53015f2afca61e3ee3d8c8240 +Subproject commit 487919911f80b990b0d9691287c3ffe40e0c36f5 diff --git a/packages/linux/zfs-linux b/packages/linux/zfs-linux index a7a3d0d..6129aee 160000 --- a/packages/linux/zfs-linux +++ b/packages/linux/zfs-linux @@ -1 +1 @@ -Subproject commit a7a3d0d854c9b763db942cf2efdf8dde89c78d5b +Subproject commit 6129aee0a7f57f9b08fcb716d1491b8618a38474 diff --git a/packages/linux/zfs-linux-git b/packages/linux/zfs-linux-git index 19d44c1..726b9dc 160000 --- a/packages/linux/zfs-linux-git +++ b/packages/linux/zfs-linux-git @@ -1 +1 @@ -Subproject commit 19d44c1b74f022d5464f7eeb5305089590055866 +Subproject commit 726b9dc39568bc7fa7f7a4d601cf3c028969facf diff --git a/src/kernels/common-git.sh b/src/kernels/common-git.sh index 11a8ff4..a52cded 100644 --- a/src/kernels/common-git.sh +++ b/src/kernels/common-git.sh @@ -3,7 +3,7 @@ mode_name="common-git" mode_desc="Select and use the packages that are common between all kernels (git version)" # Version for GIT packages -pkgrel_git="2" +pkgrel_git="1" zfs_git_commit="" spl_git_commit="" zfs_git_url="https://github.com/zfsonlinux/zfs.git" diff --git a/src/kernels/linux-hardened.sh b/src/kernels/linux-hardened.sh index 9c679d1..9967951 100644 --- a/src/kernels/linux-hardened.sh +++ b/src/kernels/linux-hardened.sh @@ -4,7 +4,7 @@ mode_desc="Select and use the packages for the linux-hardened kernel" # Kernel versions for hardened packages pkgrel="1" -kernel_version="4.14.3.a-1" +kernel_version="4.14.5.a-1" # Kernel version for GIT packages pkgrel_git="${pkgrel}" diff --git a/src/kernels/linux-lts.sh b/src/kernels/linux-lts.sh index b75a766..4bdff61 100644 --- a/src/kernels/linux-lts.sh +++ b/src/kernels/linux-lts.sh @@ -3,8 +3,8 @@ mode_name="lts" mode_desc="Select and use the packages for the linux-lts kernel" # Kernel versions for LTS packages -pkgrel="2" -kernel_version="4.9.66-1" +pkgrel="1" +kernel_version="4.9.68-1" # Kernel version for GIT packages pkgrel_git="${pkgrel}" diff --git a/src/kernels/linux-vfio.sh b/src/kernels/linux-vfio.sh new file mode 100644 index 0000000..1ff18e7 --- /dev/null +++ b/src/kernels/linux-vfio.sh @@ -0,0 +1,104 @@ +# For build.sh +mode_name="vfio" +mode_desc="Select and use the packages for the linux-vfio kernel" + +# Kernel versions for default ZFS packages +pkgrel="1" +kernel_version="4.13.12-2" + +# Kernel version for GIT packages +pkgrel_git="${pkgrel}" +kernel_version_git="${kernel_version}" +zfs_git_commit="" +spl_git_commit="" +zfs_git_url="https://github.com/zfsonlinux/zfs.git" +spl_git_url="https://github.com/zfsonlinux/spl.git" + +header="\ +# Maintainer: Jesus Alvarez +# +# This PKGBUILD was generated by the archzfs build scripts located at +# +# http://github.com/archzfs/archzfs +# +# ! WARNING ! +# +# The archzfs packages are kernel modules, so these PKGBUILDS will only work with the kernel package they target. In this +# case, the archzfs-linux-vfio packages will only work with the default linux-vfio package! To have a single PKGBUILD target many +# kernels would make for a cluttered PKGBUILD! +# +# If you have a custom kernel, you will need to change things in the PKGBUILDS. If you would like to have AUR or archzfs repo +# packages for your favorite kernel package built using the archzfs build tools, submit a request in the Issue tracker on the +# archzfs github page. +#" + +update_linux_pkgbuilds() { + pkg_list=("spl-linux-vfio" "zfs-linux-vfio") + kernel_version_full=$(kernel_version_full ${kernel_version}) + kernel_version_full_pkgver=$(kernel_version_full_no_hyphen ${kernel_version}) + kernel_version_major=${kernel_version%-*} + kernel_mod_path="${kernel_version_full}-vfio" + archzfs_package_group="archzfs-linux-vfio" + spl_pkgver=${zol_version}.${kernel_version_full_pkgver} + zfs_pkgver=${zol_version}.${kernel_version_full_pkgver} + spl_pkgrel=${pkgrel} + zfs_pkgrel=${pkgrel} + spl_conflicts="'spl-linux-vfio-git'" + zfs_conflicts="'zfs-linux-vfio-git'" + spl_utils_pkgname="spl-utils-common=${zol_version}" + spl_pkgname="spl-linux-vfio" + zfs_utils_pkgname="zfs-utils-common=${zol_version}" + zfs_pkgname="zfs-linux-vfio" + # Paths are relative to build.sh + spl_pkgbuild_path="packages/${kernel_name}/${spl_pkgname}" + zfs_pkgbuild_path="packages/${kernel_name}/${zfs_pkgname}" + spl_src_target="https://github.com/zfsonlinux/zfs/releases/download/zfs-${zol_version}/spl-${zol_version}.tar.gz" + zfs_src_target="https://github.com/zfsonlinux/zfs/releases/download/zfs-${zol_version}/zfs-${zol_version}.tar.gz" + spl_workdir="\${srcdir}/spl-${zol_version}" + zfs_workdir="\${srcdir}/zfs-${zol_version}" + linux_depends="\"linux-vfio=${kernel_version_full}\"" + linux_headers_depends="\"linux-vfio-headers=${kernel_version_full}\"" + zfs_makedepends="\"${spl_pkgname}-headers\"" +} + +update_linux_git_pkgbuilds() { + pkg_list=("spl-linux-vfio-git" "zfs-linux-vfio-git") + kernel_version=${kernel_version_git} + kernel_version_full=$(kernel_version_full ${kernel_version}) + kernel_version_full_pkgver=$(kernel_version_full_no_hyphen ${kernel_version}) + kernel_version_major=${kernel_version%-*} + kernel_mod_path="${kernel_version_full}-vfio" + archzfs_package_group="archzfs-linux-vfio-git" + spl_pkgver="" # Set later by call to git_calc_pkgver + zfs_pkgver="" # Set later by call to git_calc_pkgver + spl_pkgrel=${pkgrel_git} + zfs_pkgrel=${pkgrel_git} + spl_conflicts="'spl-linux-vfio'" + zfs_conflicts="'zfs-linux-vfio'" + spl_pkgname="spl-linux-vfio-git" + zfs_pkgname="zfs-linux-vfio-git" + spl_pkgbuild_path="packages/${kernel_name}/${spl_pkgname}" + zfs_pkgbuild_path="packages/${kernel_name}/${zfs_pkgname}" + spl_src_target="git+${spl_git_url}" + if [[ ${spl_git_commit} != "" ]]; then + spl_src_target="git+${spl_git_url}#commit=${spl_git_commit}" + fi + spl_src_hash="SKIP" + linux_depends="\"linux-vfio=${kernel_version_full}\"" + linux_headers_depends="\"linux-vfio-headers=${kernel_version_full}\"" + spl_makedepends="\"git\"" + zfs_src_target="git+${zfs_git_url}" + if [[ ${zfs_git_commit} != "" ]]; then + zfs_src_target="git+${zfs_git_url}#commit=${zfs_git_commit}" + fi + zfs_src_hash="SKIP" + zfs_makedepends="\"git\" \"${spl_pkgname}-headers\"" + spl_workdir="\${srcdir}/spl" + zfs_workdir="\${srcdir}/zfs" + if have_command "update"; then + git_check_repo + git_calc_pkgver + fi + spl_utils_pkgname="spl-utils-common-git>=${spl_git_ver}" + zfs_utils_pkgname="zfs-utils-common-git>=${zfs_git_ver}" +} diff --git a/src/kernels/linux-zen.sh b/src/kernels/linux-zen.sh index 7b3701f..d789929 100644 --- a/src/kernels/linux-zen.sh +++ b/src/kernels/linux-zen.sh @@ -3,8 +3,8 @@ mode_name="zen" mode_desc="Select and use the packages for the linux-zen kernel" # Kernel versions for default ZFS packages -pkgrel="3" -kernel_version="4.14.3-1" +pkgrel="1" +kernel_version="4.14.5-1" # Kernel version for GIT packages pkgrel_git="${pkgrel}" diff --git a/src/kernels/linux.sh b/src/kernels/linux.sh index 3d32e6b..c71bdd6 100644 --- a/src/kernels/linux.sh +++ b/src/kernels/linux.sh @@ -3,8 +3,8 @@ mode_name="std" mode_desc="Select and use the packages for the default linux kernel" # Kernel versions for default ZFS packages -pkgrel="4" -kernel_version="4.14.3-1" +pkgrel="1" +kernel_version="4.14.5-1" # Kernel version for GIT packages pkgrel_git="${pkgrel}" diff --git a/src/spl/0001-Linux-4.14-compat-vfs_read-vfs_write.patch b/src/spl/0001-Linux-4.14-compat-vfs_read-vfs_write.patch deleted file mode 100644 index bf04af0..0000000 --- a/src/spl/0001-Linux-4.14-compat-vfs_read-vfs_write.patch +++ /dev/null @@ -1,206 +0,0 @@ -From ed19bccfb651843fa208232b3a2d3d22a4152bc8 Mon Sep 17 00:00:00 2001 -From: Brian Behlendorf -Date: Wed, 15 Nov 2017 17:19:23 -0800 -Subject: [PATCH] Linux 4.14 compat: vfs_read & vfs_write - -The kernel_read & kernel_write functions have always wrapped the -vfs_read & vfs_write functions respectively. However, they could -not be used by vn_rdwr() since the offset wasn't passed as a -pointer. This prevented us from being able to properly update -the file offset. - -Linux 4.14 unexported vfs_read & vfs_write but also changed the -signature of kernel_read & kernel_write to provide the needed -functionality. Use these updated functions when available. - -Reviewed-by: Pritam Baral -Signed-off-by: Brian Behlendorf -Closes #656 -Closes #667 ---- - config/spl-build.m4 | 60 +++++++++++++++++++++++++++++++++++++++++++++ - include/linux/file_compat.h | 41 +++++++++++++++++++++++++++++++ - module/spl/spl-vnode.c | 21 +++------------- - 3 files changed, 105 insertions(+), 17 deletions(-) - -diff --git a/config/spl-build.m4 b/config/spl-build.m4 -index 8e9dc99..7b66f2c 100644 ---- a/config/spl-build.m4 -+++ b/config/spl-build.m4 -@@ -52,6 +52,8 @@ AC_DEFUN([SPL_AC_CONFIG_KERNEL], [ - SPL_AC_KMEM_CACHE_CREATE_USERCOPY - SPL_AC_WAIT_QUEUE_ENTRY_T - SPL_AC_WAIT_QUEUE_HEAD_ENTRY -+ SPL_AC_KERNEL_WRITE -+ SPL_AC_KERNEL_READ - ]) - - AC_DEFUN([SPL_AC_MODULE_SYMVERS], [ -@@ -1594,3 +1596,61 @@ AC_DEFUN([SPL_AC_WAIT_QUEUE_HEAD_ENTRY], [ - AC_MSG_RESULT(no) - ]) - ]) -+ -+dnl # -+dnl # 4.14 API change -+dnl # kernel_write() which was introduced in 3.9 was updated to take -+dnl # the offset as a pointer which is needed by vn_rdwr(). -+dnl # -+AC_DEFUN([SPL_AC_KERNEL_WRITE], [ -+ AC_MSG_CHECKING([whether kernel_write() takes loff_t pointer]) -+ tmp_flags="$EXTRA_KCFLAGS" -+ EXTRA_KCFLAGS="-Werror" -+ SPL_LINUX_TRY_COMPILE([ -+ #include -+ ],[ -+ struct file *file = NULL; -+ const void *buf = NULL; -+ size_t count = 0; -+ loff_t *pos = NULL; -+ ssize_t ret; -+ -+ ret = kernel_write(file, buf, count, pos); -+ ],[ -+ AC_MSG_RESULT(yes) -+ AC_DEFINE(HAVE_KERNEL_WRITE_PPOS, 1, -+ [kernel_write() take loff_t pointer]) -+ ],[ -+ AC_MSG_RESULT(no) -+ ]) -+ EXTRA_KCFLAGS="$tmp_flags" -+]) -+ -+dnl # -+dnl # 4.14 API change -+dnl # kernel_read() which has existed for forever was updated to take -+dnl # the offset as a pointer which is needed by vn_rdwr(). -+dnl # -+AC_DEFUN([SPL_AC_KERNEL_READ], [ -+ AC_MSG_CHECKING([whether kernel_read() takes loff_t pointer]) -+ tmp_flags="$EXTRA_KCFLAGS" -+ EXTRA_KCFLAGS="-Werror" -+ SPL_LINUX_TRY_COMPILE([ -+ #include -+ ],[ -+ struct file *file = NULL; -+ void *buf = NULL; -+ size_t count = 0; -+ loff_t *pos = NULL; -+ ssize_t ret; -+ -+ ret = kernel_read(file, buf, count, pos); -+ ],[ -+ AC_MSG_RESULT(yes) -+ AC_DEFINE(HAVE_KERNEL_READ_PPOS, 1, -+ [kernel_read() take loff_t pointer]) -+ ],[ -+ AC_MSG_RESULT(no) -+ ]) -+ EXTRA_KCFLAGS="$tmp_flags" -+]) -diff --git a/include/linux/file_compat.h b/include/linux/file_compat.h -index 7d61ba5..55ba2cc 100644 ---- a/include/linux/file_compat.h -+++ b/include/linux/file_compat.h -@@ -26,6 +26,7 @@ - #define _SPL_FILE_COMPAT_H - - #include -+#include - #ifdef HAVE_FDTABLE_HEADER - #include - #endif -@@ -70,6 +71,46 @@ spl_filp_fallocate(struct file *fp, int mode, loff_t offset, loff_t len) - return (error); - } - -+static inline ssize_t -+spl_kernel_write(struct file *file, const void *buf, size_t count, loff_t *pos) -+{ -+#if defined(HAVE_KERNEL_WRITE_PPOS) -+ return (kernel_write(file, buf, count, pos)); -+#else -+ mm_segment_t saved_fs; -+ ssize_t ret; -+ -+ saved_fs = get_fs(); -+ set_fs(get_ds()); -+ -+ ret = vfs_write(file, (__force const char __user *)buf, count, pos); -+ -+ set_fs(saved_fs); -+ -+ return (ret); -+#endif -+} -+ -+static inline ssize_t -+spl_kernel_read(struct file *file, void *buf, size_t count, loff_t *pos) -+{ -+#if defined(HAVE_KERNEL_READ_PPOS) -+ return (kernel_read(file, buf, count, pos)); -+#else -+ mm_segment_t saved_fs; -+ ssize_t ret; -+ -+ saved_fs = get_fs(); -+ set_fs(get_ds()); -+ -+ ret = vfs_read(file, (void __user *)buf, count, pos); -+ -+ set_fs(saved_fs); -+ -+ return (ret); -+#endif -+} -+ - #ifdef HAVE_2ARGS_VFS_FSYNC - #define spl_filp_fsync(fp, sync) vfs_fsync(fp, sync) - #else -diff --git a/module/spl/spl-vnode.c b/module/spl/spl-vnode.c -index 0e4c386..19b3b76 100644 ---- a/module/spl/spl-vnode.c -+++ b/module/spl/spl-vnode.c -@@ -211,35 +211,22 @@ int - vn_rdwr(uio_rw_t uio, vnode_t *vp, void *addr, ssize_t len, offset_t off, - uio_seg_t seg, int ioflag, rlim64_t x2, void *x3, ssize_t *residp) - { -- loff_t offset; -- mm_segment_t saved_fs; -- struct file *fp; -+ struct file *fp = vp->v_file; -+ loff_t offset = off; - int rc; - - ASSERT(uio == UIO_WRITE || uio == UIO_READ); -- ASSERT(vp); -- ASSERT(vp->v_file); - ASSERT(seg == UIO_SYSSPACE); - ASSERT((ioflag & ~FAPPEND) == 0); - -- fp = vp->v_file; -- -- offset = off; - if (ioflag & FAPPEND) - offset = fp->f_pos; - -- /* Writable user data segment must be briefly increased for this -- * process so we can use the user space read call paths to write -- * in to memory allocated by the kernel. */ -- saved_fs = get_fs(); -- set_fs(get_ds()); -- - if (uio & UIO_WRITE) -- rc = vfs_write(fp, addr, len, &offset); -+ rc = spl_kernel_write(fp, addr, len, &offset); - else -- rc = vfs_read(fp, addr, len, &offset); -+ rc = spl_kernel_read(fp, addr, len, &offset); - -- set_fs(saved_fs); - fp->f_pos = offset; - - if (rc < 0) --- -2.15.1 - diff --git a/src/spl/PKGBUILD.sh b/src/spl/PKGBUILD.sh index 3f18e1d..f75ab53 100755 --- a/src/spl/PKGBUILD.sh +++ b/src/spl/PKGBUILD.sh @@ -9,8 +9,8 @@ pkgrel=${spl_pkgrel} makedepends=(${linux_headers_depends} ${spl_makedepends}) arch=("x86_64") url="http://zfsonlinux.org/" -source=("${spl_src_target}" '0001-Linux-4.14-compat-vfs_read-vfs_write.patch') -sha256sums=("${spl_src_hash}" 'd20506fbe6e9ee928005e8a73c03e4b4d207268348f684b9c7a33301067793b8') +source=("${spl_src_target}") +sha256sums=("${spl_src_hash}") license=("GPL") depends=("${spl_utils_pkgname}" "kmod" ${linux_depends}) @@ -54,8 +54,4 @@ package_${spl_pkgname}-headers() { EOF -if [[ ! ${archzfs_package_group} =~ -git$ ]]; then - sed -i "/^build()/i prepare() {\n cd \"${spl_workdir}\"\n patch -Np1 -i \${srcdir}/0001-Linux-4.14-compat-vfs_read-vfs_write.patch\n}" ${spl_pkgbuild_path}/PKGBUILD -fi - pkgbuild_cleanup "${spl_pkgbuild_path}/PKGBUILD"