From 58d00fd641a0b00f4bc12310242635b6d5938d8b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20R=C4=99korajski?= Date: Sun, 27 Sep 2015 18:35:50 +0200 Subject: [PATCH] - up to 0.6.5.1 --- linux-3.18.patch | 84 ------------------------------------------- linux-3.19.patch | 92 ------------------------------------------------ linux-4.0.patch | 38 -------------------- zfs.spec | 32 ++++++++++------- 4 files changed, 20 insertions(+), 226 deletions(-) delete mode 100644 linux-3.18.patch delete mode 100644 linux-3.19.patch delete mode 100644 linux-4.0.patch diff --git a/linux-3.18.patch b/linux-3.18.patch deleted file mode 100644 index fb26f4b..0000000 --- a/linux-3.18.patch +++ /dev/null @@ -1,84 +0,0 @@ -From 107077a193a5c35e83ab3ba890c429f31736d055 Mon Sep 17 00:00:00 2001 -From: Ned Bass -Date: Thu, 16 Oct 2014 13:52:56 -0700 -Subject: [PATCH] Remove checks for mandatory locks - -The Linux VFS handles mandatory locks generically so we shouldn't -need to check for conflicting locks in zfs_read(), zfs_write(), or -zfs_freesp(). Linux 3.18 removed the lock_may_read() and -lock_may_write() interfaces which we were relying on for this -purpose. Rather than emulating those interfaces we remove the -redundant checks. - -Signed-off-by: Ned Bass -Signed-off-by: Brian Behlendorf -Closes #2804 ---- - module/zfs/zfs_vnops.c | 18 ------------------ - module/zfs/zfs_znode.c | 10 ---------- - 2 files changed, 28 deletions(-) - -diff --git a/module/zfs/zfs_vnops.c b/module/zfs/zfs_vnops.c -index 4f53173..02fab99 100644 ---- a/module/zfs/zfs_vnops.c -+++ b/module/zfs/zfs_vnops.c -@@ -471,15 +471,6 @@ zfs_read(struct inode *ip, uio_t *uio, int ioflag, cred_t *cr) - } - - /* -- * Check for mandatory locks -- */ -- if (mandatory_lock(ip) && -- !lock_may_read(ip, uio->uio_loffset, uio->uio_resid)) { -- ZFS_EXIT(zsb); -- return (SET_ERROR(EAGAIN)); -- } -- -- /* - * If we're in FRSYNC mode, sync out this znode before reading it. - */ - if (ioflag & FRSYNC || zsb->z_os->os_sync == ZFS_SYNC_ALWAYS) -@@ -648,15 +639,6 @@ zfs_write(struct inode *ip, uio_t *uio, int ioflag, cred_t *cr) - } - - /* -- * Check for mandatory locks before calling zfs_range_lock() -- * in order to prevent a deadlock with locks set via fcntl(). -- */ -- if (mandatory_lock(ip) && !lock_may_write(ip, woff, n)) { -- ZFS_EXIT(zsb); -- return (SET_ERROR(EAGAIN)); -- } -- -- /* - * Pre-fault the pages to ensure slow (eg NFS) pages - * don't hold up txg. - * Skip this if uio contains loaned arc_buf. -diff --git a/module/zfs/zfs_znode.c b/module/zfs/zfs_znode.c -index 23e0907..a7ef07c 100644 ---- a/module/zfs/zfs_znode.c -+++ b/module/zfs/zfs_znode.c -@@ -1471,7 +1471,6 @@ zfs_trunc(znode_t *zp, uint64_t end) - int - zfs_freesp(znode_t *zp, uint64_t off, uint64_t len, int flag, boolean_t log) - { -- struct inode *ip = ZTOI(zp); - dmu_tx_t *tx; - zfs_sb_t *zsb = ZTOZSB(zp); - zilog_t *zilog = zsb->z_log; -@@ -1493,15 +1492,6 @@ zfs_freesp(znode_t *zp, uint64_t off, uint64_t len, int flag, boolean_t log) - return (error); - } - -- /* -- * Check for any locks in the region to be freed. -- */ -- if (ip->i_flock && mandatory_lock(ip)) { -- uint64_t length = (len ? len : zp->z_size - off); -- if (!lock_may_write(ip, off, length)) -- return (SET_ERROR(EAGAIN)); -- } -- - if (len == 0) { - error = zfs_trunc(zp, off); - } else { diff --git a/linux-3.19.patch b/linux-3.19.patch deleted file mode 100644 index 59f354a..0000000 --- a/linux-3.19.patch +++ /dev/null @@ -1,92 +0,0 @@ ---- zfs-0.6.3/module/zfs/zpl_file.c~ 2014-06-12 22:58:09.000000000 +0200 -+++ zfs-0.6.3/module/zfs/zpl_file.c 2015-03-30 21:34:49.848900638 +0200 -@@ -23,6 +23,7 @@ - */ - - -+#include - #include - #include - #include -@@ -527,7 +528,11 @@ - static int - zpl_ioctl_getflags(struct file *filp, void __user *arg) - { -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0) -+ struct inode *ip = filp->f_path.dentry->d_inode; -+#else - struct inode *ip = filp->f_dentry->d_inode; -+#endif - unsigned int ioctl_flags = 0; - uint64_t zfs_flags = ITOZ(ip)->z_pflags; - int error; -@@ -563,7 +568,11 @@ - static int - zpl_ioctl_setflags(struct file *filp, void __user *arg) - { -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0) -+ struct inode *ip = filp->f_path.dentry->d_inode; -+#else - struct inode *ip = filp->f_dentry->d_inode; -+#endif - uint64_t zfs_flags = ITOZ(ip)->z_pflags; - unsigned int ioctl_flags; - cred_t *cr = CRED(); ---- zfs-0.6.3/module/zpios/pios.c~ 2014-06-12 22:58:09.000000000 +0200 -+++ zfs-0.6.3/module/zpios/pios.c 2015-03-30 21:38:27.752243085 +0200 -@@ -36,6 +36,7 @@ - #include - #include - #include -+#include - #include "zpios-internal.h" - - -@@ -1143,7 +1144,11 @@ - static long - zpios_unlocked_ioctl(struct file *file, unsigned int cmd, unsigned long arg) - { -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0) -+ unsigned int minor = iminor(file->f_path.dentry->d_inode); -+#else - unsigned int minor = iminor(file->f_dentry->d_inode); -+#endif - int rc = 0; - - /* Ignore tty ioctls */ -@@ -1187,7 +1192,11 @@ - zpios_write(struct file *file, const char __user *buf, - size_t count, loff_t *ppos) - { -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0) -+ unsigned int minor = iminor(file->f_path.dentry->d_inode); -+#else - unsigned int minor = iminor(file->f_dentry->d_inode); -+#endif - zpios_info_t *info = (zpios_info_t *)file->private_data; - int rc = 0; - -@@ -1224,7 +1233,11 @@ - static ssize_t - zpios_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) - { -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0) -+ unsigned int minor = iminor(file->f_path.dentry->d_inode); -+#else - unsigned int minor = iminor(file->f_dentry->d_inode); -+#endif - zpios_info_t *info = (zpios_info_t *)file->private_data; - int rc = 0; - -@@ -1258,7 +1271,11 @@ - - static loff_t zpios_seek(struct file *file, loff_t offset, int origin) - { -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0) -+ unsigned int minor = iminor(file->f_path.dentry->d_inode); -+#else - unsigned int minor = iminor(file->f_dentry->d_inode); -+#endif - zpios_info_t *info = (zpios_info_t *)file->private_data; - int rc = -EINVAL; - diff --git a/linux-4.0.patch b/linux-4.0.patch deleted file mode 100644 index ed5965a..0000000 --- a/linux-4.0.patch +++ /dev/null @@ -1,38 +0,0 @@ ---- zfs-0.6.3/config/kernel-bdi-setup-and-register.m4.orig 2014-06-12 22:58:09.000000000 +0200 -+++ zfs-0.6.3/config/kernel-bdi-setup-and-register.m4 2015-04-19 14:12:52.429710415 +0200 -@@ -9,8 +9,13 @@ - [AC_MSG_CHECKING([whether bdi_setup_and_register() is available]) - ZFS_LINUX_TRY_COMPILE_SYMBOL([ - #include -+ #include - ], [ -+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0) -+ int r = bdi_setup_and_register(NULL, NULL); -+ #else - int r = bdi_setup_and_register(NULL, NULL, 0); -+ #endif - r = *(&r); - ], [bdi_setup_and_register], [mm/backing-dev.c], [ - AC_MSG_RESULT(yes) ---- zfs-0.6.3/module/zfs/zfs_vfsops.c~ 2014-06-12 22:58:09.000000000 +0200 -+++ zfs-0.6.3/module/zfs/zfs_vfsops.c 2015-04-19 14:14:13.503040887 +0200 -@@ -67,6 +67,7 @@ - #include - #include - #include "zfs_comutil.h" -+#include "linux/version.h" - - - /*ARGSUSED*/ -@@ -1241,7 +1241,11 @@ - zsb->z_bdi.ra_pages = 0; - sb->s_bdi = &zsb->z_bdi; - -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0) -+ error = -bdi_setup_and_register(&zsb->z_bdi, "zfs"); -+#else - error = -bdi_setup_and_register(&zsb->z_bdi, "zfs", BDI_CAP_MAP_COPY); -+#endif - if (error) - goto out; - #endif /* HAVE_BDI */ diff --git a/zfs.spec b/zfs.spec index 5f5d29d..2520ac4 100644 --- a/zfs.spec +++ b/zfs.spec @@ -22,21 +22,18 @@ exit 1 %define _duplicate_files_terminate_build 0 %define pname zfs -%define rel 8 +%define rel 1 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: 0.6.3 +Version: 0.6.5.1 Release: %{rel}%{?_pld_builder:%{?with_kernel:@%{_kernel_ver_str}}} License: CDDL (ZFS), GPL v2+ (ZPIOS) Group: Applications/System Source0: http://archive.zfsonlinux.org/downloads/zfsonlinux/zfs/%{pname}-%{version}.tar.gz -# Source0-md5: 5bcc32c122934d421eba68e16826637d +# Source0-md5: 0421551f728c1fd4239bdd9932ba2c52 Patch0: %{pname}-link.patch -Patch1: linux-3.18.patch -Patch2: x32.patch -Patch3: linux-3.19.patch -Patch4: linux-4.0.patch +Patch1: x32.patch URL: http://zfsonlinux.org/ BuildRequires: autoconf >= 2.50 BuildRequires: automake @@ -216,9 +213,6 @@ p=`pwd`\ %setup -q -n %{pname}-%{version} %patch0 -p1 %patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 %build %{__libtoolize} @@ -253,6 +247,9 @@ cp -a installed/* $RPM_BUILD_ROOT %{__make} install \ DESTDIR=$RPM_BUILD_ROOT \ DEFAULT_INIT_DIR=/etc/rc.d/init.d + +install -d $RPM_BUILD_ROOT%{_pkgconfigdir} +%{__mv} $RPM_BUILD_ROOT%{_npkgconfigdir}/* $RPM_BUILD_ROOT%{_pkgconfigdir} %endif %clean @@ -266,6 +263,7 @@ rm -rf $RPM_BUILD_ROOT %defattr(644,root,root,755) %doc AUTHORS COPYRIGHT DISCLAIMER OPENSOLARIS.LICENSE README.markdown %attr(755,root,root) /sbin/mount.zfs +%attr(755,root,root) %{_bindir}/arc_summary.py %attr(755,root,root) %{_bindir}/arcstat.py %attr(755,root,root) %{_bindir}/dbufstat.py %attr(755,root,root) %{_sbindir}/fsck.zfs @@ -284,7 +282,12 @@ rm -rf $RPM_BUILD_ROOT %dir %{_sysconfdir}/zfs/zed.d %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zfs/zed.d/*.sh %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zfs/zed.d/zed.rc -%attr(754,root,root) /etc/rc.d/init.d/zfs +%attr(754,root,root) /etc/rc.d/init.d/zfs-import +%attr(754,root,root) /etc/rc.d/init.d/zfs-mount +%attr(754,root,root) /etc/rc.d/init.d/zfs-share +%attr(754,root,root) /etc/rc.d/init.d/zfs-zed +%config(noreplace) %verify(not md5 mtime size) /etc/default/zfs +/etc/zfs/zfs-functions /usr/lib/modules-load.d/zfs.conf /etc/systemd/system-preset/50-zfs.preset %{systemdunitdir}/zed.service @@ -313,6 +316,7 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/man1/zpios.1* %{_mandir}/man1/ztest.1* %{_mandir}/man5/vdev_id.conf.5* +%{_mandir}/man5/zfs-events.5* %{_mandir}/man5/zfs-module-parameters.5* %{_mandir}/man5/zpool-features.5* %{_mandir}/man8/fsck.zfs.8* @@ -352,6 +356,8 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/libzpool.la %{_includedir}/libspl %{_includedir}/libzfs +%{_pkgconfigdir}/libzfs.pc +%{_pkgconfigdir}/libzfs_core.pc %files static %defattr(644,root,root,755) @@ -363,11 +369,13 @@ rm -rf $RPM_BUILD_ROOT %files -n dracut-zfs %defattr(644,root,root,755) -%doc dracut/README.dracut.markdown +%doc contrib/dracut/README.dracut.markdown %dir %{dracutlibdir}/modules.d/90zfs +%attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/export-zfs.sh %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/module-setup.sh %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/mount-zfs.sh %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/parse-zfs.sh +%attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/zfs-lib.sh %endif %if %{with kernel} -- 2.44.0