git.iko.soy/typeable/nixpkgs
on master help sign in
zfs: Update git version
commite0a5b75d9c4355c995304d2bf8ab01864b320d5a authorWilliam A. Kennington III <william@wkennington.com> dateThu 11 Dec 2014, 00:39 (12 years ago) parenta47b064
5 files changed+142−152
pkgs/os-specific/linux/zfs/bc151f7b312dea09c6ec5b9a320e65140789643a.patch−84 pkgs/os-specific/linux/zfs/default.nix+1 pkgs/os-specific/linux/zfs/git.nix+8−4 pkgs/os-specific/linux/zfs/nix-build-git.patch+133 pkgs/os-specific/linux/zfs/remove-lock-checks.patch−64
pkgs/os-specific/linux/zfs/bc151f7b312dea09c6ec5b9a320e65140789643a.patchdeleted−84
@@ -1,84 +0,0 @@
1−From bc151f7b312dea09c6ec5b9a320e65140789643a Mon Sep 17 00:00:00 2001
2−From: Ned Bass <bass6@llnl.gov>
3−Date: Thu, 16 Oct 2014 13:52:56 -0700
4−Subject: [PATCH] Remove checks for mandatory locks
5−
6−The Linux VFS handles mandatory locks generically so we shouldn't
7−need to check for conflicting locks in zfs_read(), zfs_write(), or
8−zfs_freesp(). Linux 3.18 removed the lock_may_read() and
9−lock_may_write() interfaces which we were relying on for this
10−purpose. Rather than emulating those interfaces we remove the
11−redundant checks.
12−
13−Signed-off-by: Ned Bass <bass6@llnl.gov>
14−Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
15−Closes #2804
16−---
17− module/zfs/zfs_vnops.c | 18 ------------------
18− module/zfs/zfs_znode.c | 10 ----------
19− 2 files changed, 28 deletions(-)
20−
21−diff --git a/module/zfs/zfs_vnops.c b/module/zfs/zfs_vnops.c
22−index 33f9e0e..2f55e56 100644
23−--- a/module/zfs/zfs_vnops.c
24−+++ b/module/zfs/zfs_vnops.c
25−@@ -474,15 +474,6 @@ zfs_read(struct inode *ip, uio_t *uio, int ioflag, cred_t *cr)
26− }
27−
28− /*
29−- * Check for mandatory locks
30−- */
31−- if (mandatory_lock(ip) &&
32−- !lock_may_read(ip, uio->uio_loffset, uio->uio_resid)) {
33−- ZFS_EXIT(zsb);
34−- return (SET_ERROR(EAGAIN));
35−- }
36−-
37−- /*
38− * If we're in FRSYNC mode, sync out this znode before reading it.
39− */
40− if (ioflag & FRSYNC || zsb->z_os->os_sync == ZFS_SYNC_ALWAYS)
41−@@ -651,15 +642,6 @@ zfs_write(struct inode *ip, uio_t *uio, int ioflag, cred_t *cr)
42− }
43−
44− /*
45−- * Check for mandatory locks before calling zfs_range_lock()
46−- * in order to prevent a deadlock with locks set via fcntl().
47−- */
48−- if (mandatory_lock(ip) && !lock_may_write(ip, woff, n)) {
49−- ZFS_EXIT(zsb);
50−- return (SET_ERROR(EAGAIN));
51−- }
52−-
53−- /*
54− * Pre-fault the pages to ensure slow (eg NFS) pages
55− * don't hold up txg.
56− * Skip this if uio contains loaned arc_buf.
57−diff --git a/module/zfs/zfs_znode.c b/module/zfs/zfs_znode.c
58−index 90dbfd3..f02c021 100644
59−--- a/module/zfs/zfs_znode.c
60−+++ b/module/zfs/zfs_znode.c
61−@@ -1546,7 +1546,6 @@ zfs_trunc(znode_t *zp, uint64_t end)
62− int
63− zfs_freesp(znode_t *zp, uint64_t off, uint64_t len, int flag, boolean_t log)
64− {
65−- struct inode *ip = ZTOI(zp);
66− dmu_tx_t *tx;
67− zfs_sb_t *zsb = ZTOZSB(zp);
68− zilog_t *zilog = zsb->z_log;
69−@@ -1567,15 +1566,6 @@ zfs_freesp(znode_t *zp, uint64_t off, uint64_t len, int flag, boolean_t log)
70− goto out;
71− }
72−
73−- /*
74−- * Check for any locks in the region to be freed.
75−- */
76−- if (ip->i_flock && mandatory_lock(ip)) {
77−- uint64_t length = (len ? len : zp->z_size - off);
78−- if (!lock_may_write(ip, off, length))
79−- return (SET_ERROR(EAGAIN));
80−- }
81−-
82− if (len == 0) {
83− error = zfs_trunc(zp, off);
84− } else {
pkgs/os-specific/linux/zfs/default.nix+1
@@ -33,6 +33,7 @@ stdenv.mkDerivation rec {
3333 substituteInPlace ./config/zfs-build.m4 --replace "\$sysconfdir/init.d" "$out/etc/init.d"
3434 substituteInPlace ./etc/zfs/Makefile.am --replace "\$(sysconfdir)" "$out/etc"
3535 substituteInPlace ./cmd/zed/Makefile.am --replace "\$(sysconfdir)" "$out/etc"
36+ substituteInPlace ./module/Makefile.in --replace "/bin/cp" "cp"
3637
3738 ./autogen.sh
3839 '';
pkgs/os-specific/linux/zfs/git.nix+8−4
@@ -1,15 +1,17 @@
11{ stdenv, fetchgit, kernel, spl_git, perl, autoconf, automake, libtool, zlib, libuuid, coreutils, utillinux }:
22
33stdenv.mkDerivation {
4− name = "zfs-0.6.3-${kernel.version}";
4+ name = "zfs-0.6.4-${kernel.version}";
55
66 src = fetchgit {
77 url = git://github.com/zfsonlinux/zfs.git;
8− rev = "07dabd234dd51a1e5adc5bd21cddf5b5fdc70732";
9− sha256 = "1yqsfdhyzh33aisfvwqd692n5kfgnlz7yjixd2gqn8vx9bv0dz0b";
8+ rev = "74328ee18f94d27f9c802d29fdd311018dab2adf";
9+ sha256 = "0ayyqbb2crki1xvibfmscav5j7g0z77ys83dx10430ljamvylwb0";
1010 };
1111
12− patches = [ ./mount_zfs_prefix.patch ./nix-build.patch ./bc151f7b312dea09c6ec5b9a320e65140789643a.patch ];
12+ patches = [
13+ ./nix-build-git.patch
14+ ];
1315
1416 buildInputs = [ spl_git perl autoconf automake libtool zlib libuuid coreutils ];
1517
@@ -28,6 +30,7 @@ stdenv.mkDerivation {
2830 substituteInPlace ./config/zfs-build.m4 --replace "\$sysconfdir/init.d" "$out/etc/init.d"
2931 substituteInPlace ./etc/zfs/Makefile.am --replace "\$(sysconfdir)" "$out/etc"
3032 substituteInPlace ./cmd/zed/Makefile.am --replace "\$(sysconfdir)" "$out/etc"
33+ substituteInPlace ./module/Makefile.in --replace "/bin/cp" "cp"
3134
3235 ./autogen.sh
3336 '';
@@ -41,6 +44,7 @@ stdenv.mkDerivation {
4144 "--with-udevdir=$(out)/lib/udev"
4245 "--with-systemdunitdir=$(out)/etc/systemd/system"
4346 "--with-systemdpresetdir=$(out)/etc/systemd/system-preset"
47+ "--with-mounthelperdir=$(out)/sbin"
4448 "--sysconfdir=/etc"
4549 "--localstatedir=/var"
4650 ];
pkgs/os-specific/linux/zfs/nix-build-git.patchnew file+133
@@ -0,0 +1,133 @@
1+diff --git a/Makefile.am b/Makefile.am
2+index 49b417a..f4af44d 100644
3+--- a/Makefile.am
4++++ b/Makefile.am
5+@@ -12,10 +12,10 @@ endif
6+ if CONFIG_KERNEL
7+ SUBDIRS += module
8+
9+-extradir = @prefix@/src/zfs-$(VERSION)
10++extradir = @prefix@/libexec/zfs-$(VERSION)
11+ extra_HEADERS = zfs.release.in zfs_config.h.in
12+
13+-kerneldir = @prefix@/src/zfs-$(VERSION)/$(LINUX_VERSION)
14++kerneldir = @prefix@/zfs-$(VERSION)/$(LINUX_VERSION)
15+ nodist_kernel_HEADERS = zfs.release zfs_config.h module/$(LINUX_SYMBOLS)
16+ endif
17+
18+diff --git a/include/Makefile.am b/include/Makefile.am
19+index a94cad5..a160fe2 100644
20+--- a/include/Makefile.am
21++++ b/include/Makefile.am
22+@@ -29,6 +29,6 @@ libzfs_HEADERS = $(COMMON_H) $(USER_H)
23+ endif
24+
25+ if CONFIG_KERNEL
26+-kerneldir = @prefix@/src/zfs-$(VERSION)/include
27++kerneldir = @prefix@/include
28+ kernel_HEADERS = $(COMMON_H) $(KERNEL_H)
29+ endif
30+diff --git a/include/linux/Makefile.am b/include/linux/Makefile.am
31+index d00b1c8..3242d2e 100644
32+--- a/include/linux/Makefile.am
33++++ b/include/linux/Makefile.am
34+@@ -17,6 +17,6 @@ libzfs_HEADERS = $(COMMON_H) $(USER_H)
35+ endif
36+
37+ if CONFIG_KERNEL
38+-kerneldir = @prefix@/src/zfs-$(VERSION)/include/linux
39++kerneldir = @prefix@/include/linux
40+ kernel_HEADERS = $(COMMON_H) $(KERNEL_H)
41+ endif
42+diff --git a/include/sys/Makefile.am b/include/sys/Makefile.am
43+index 7ddace0..8da3870 100644
44+--- a/include/sys/Makefile.am
45++++ b/include/sys/Makefile.am
46+@@ -102,6 +102,6 @@ libzfs_HEADERS = $(COMMON_H) $(USER_H)
47+ endif
48+
49+ if CONFIG_KERNEL
50+-kerneldir = @prefix@/src/zfs-$(VERSION)/include/sys
51++kerneldir = @prefix@/include/sys
52+ kernel_HEADERS = $(COMMON_H) $(KERNEL_H)
53+ endif
54+diff --git a/include/sys/fm/Makefile.am b/include/sys/fm/Makefile.am
55+index 8bca5d8..a5eafcd 100644
56+--- a/include/sys/fm/Makefile.am
57++++ b/include/sys/fm/Makefile.am
58+@@ -16,6 +16,6 @@ libzfs_HEADERS = $(COMMON_H) $(USER_H)
59+ endif
60+
61+ if CONFIG_KERNEL
62+-kerneldir = @prefix@/src/zfs-$(VERSION)/include/sys/fm
63++kerneldir = @prefix@/include/sys/fm
64+ kernel_HEADERS = $(COMMON_H) $(KERNEL_H)
65+ endif
66+diff --git a/include/sys/fm/fs/Makefile.am b/include/sys/fm/fs/Makefile.am
67+index fdc9eb5..807c47c 100644
68+--- a/include/sys/fm/fs/Makefile.am
69++++ b/include/sys/fm/fs/Makefile.am
70+@@ -13,6 +13,6 @@ libzfs_HEADERS = $(COMMON_H) $(USER_H)
71+ endif
72+
73+ if CONFIG_KERNEL
74+-kerneldir = @prefix@/src/zfs-$(VERSION)/include/sys/fm/fs
75++kerneldir = @prefix@/include/sys/fm/fs
76+ kernel_HEADERS = $(COMMON_H) $(KERNEL_H)
77+ endif
78+diff --git a/include/sys/fs/Makefile.am b/include/sys/fs/Makefile.am
79+index 0859b9f..b0c6eec 100644
80+--- a/include/sys/fs/Makefile.am
81++++ b/include/sys/fs/Makefile.am
82+@@ -13,6 +13,6 @@ libzfs_HEADERS = $(COMMON_H) $(USER_H)
83+ endif
84+
85+ if CONFIG_KERNEL
86+-kerneldir = @prefix@/src/zfs-$(VERSION)/include/sys/fs
87++kerneldir = @prefix@/include/sys/fs
88+ kernel_HEADERS = $(COMMON_H) $(KERNEL_H)
89+ endif
90+diff --git a/module/Makefile.in b/module/Makefile.in
91+index 686402b..9cbf598 100644
92+--- a/module/Makefile.in
93++++ b/module/Makefile.in
94+@@ -18,9 +18,9 @@ modules:
95+ @# installed devel headers, or they may be in the module
96+ @# subdirectory when building against the spl source tree.
97+ @if [ -f @SPL_OBJ@/@SPL_SYMBOLS@ ]; then \
98+- /bin/cp @SPL_OBJ@/@SPL_SYMBOLS@ .; \
99++ cp @SPL_OBJ@/@SPL_SYMBOLS@ .; \
100+ elif [ -f @SPL_OBJ@/module/@SPL_SYMBOLS@ ]; then \
101+- /bin/cp @SPL_OBJ@/module/@SPL_SYMBOLS@ .; \
102++ cp @SPL_OBJ@/module/@SPL_SYMBOLS@ .; \
103+ else \
104+ echo -e "\n" \
105+ "*** Missing spl symbols ensure you have built the spl:\n" \
106+@@ -28,6 +28,8 @@ modules:
107+ "*** - @SPL_OBJ@/module/@SPL_SYMBOLS@\n"; \
108+ exit 1; \
109+ fi
110++ @# when copying a file out of the nix store, we need to make it writable again.
111++ chmod +w @SPL_SYMBOLS@
112+ $(MAKE) -C @LINUX_OBJ@ SUBDIRS=`pwd` @KERNELMAKE_PARAMS@ CONFIG_ZFS=m $@
113+
114+ clean:
115+@@ -42,15 +44,15 @@ clean:
116+ modules_install:
117+ @# Install the kernel modules
118+ $(MAKE) -C @LINUX_OBJ@ SUBDIRS=`pwd` $@ \
119+- INSTALL_MOD_PATH=$(DESTDIR)$(INSTALL_MOD_PATH) \
120++ INSTALL_MOD_PATH=@prefix@/$(INSTALL_MOD_PATH) \
121+ INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) \
122+ KERNELRELEASE=@LINUX_VERSION@
123+ @# Remove extraneous build products when packaging
124+- kmoddir=$(DESTDIR)$(INSTALL_MOD_PATH)/lib/modules/@LINUX_VERSION@; \
125++ kmoddir=@prefix@/$(INSTALL_MOD_PATH)/lib/modules/@LINUX_VERSION@; \
126+ if [ -n $$kmoddir ]; then \
127+ find $$kmoddir -name 'modules.*' | xargs $(RM); \
128+ fi
129+- sysmap=$(DESTDIR)$(INSTALL_MOD_PATH)/boot/System.map-@LINUX_VERSION@; \
130++ sysmap=@prefix@/$(INSTALL_MOD_PATH)/boot/System.map-@LINUX_VERSION@; \
131+ if [ -f $$sysmap ]; then \
132+ depmod -ae -F $$sysmap @LINUX_VERSION@; \
133+ fi
pkgs/os-specific/linux/zfs/remove-lock-checks.patchdeleted−64
@@ -1,64 +0,0 @@
1−diff --git a/module/zfs/zfs_vnops.c b/module/zfs/zfs_vnops.c
2−index 33f9e0e..2f55e56 100644
3−--- a/module/zfs/zfs_vnops.c
4−+++ b/module/zfs/zfs_vnops.c
5−@@ -474,15 +474,6 @@ zfs_read(struct inode *ip, uio_t *uio, int ioflag, cred_t *cr)
6− }
7−
8− /*
9−- * Check for mandatory locks
10−- */
11−- if (mandatory_lock(ip) &&
12−- !lock_may_read(ip, uio->uio_loffset, uio->uio_resid)) {
13−- ZFS_EXIT(zsb);
14−- return (SET_ERROR(EAGAIN));
15−- }
16−-
17−- /*
18− * If we're in FRSYNC mode, sync out this znode before reading it.
19− */
20− if (ioflag & FRSYNC || zsb->z_os->os_sync == ZFS_SYNC_ALWAYS)
21−@@ -651,15 +642,6 @@ zfs_write(struct inode *ip, uio_t *uio, int ioflag, cred_t *cr)
22− }
23−
24− /*
25−- * Check for mandatory locks before calling zfs_range_lock()
26−- * in order to prevent a deadlock with locks set via fcntl().
27−- */
28−- if (mandatory_lock(ip) && !lock_may_write(ip, woff, n)) {
29−- ZFS_EXIT(zsb);
30−- return (SET_ERROR(EAGAIN));
31−- }
32−-
33−- /*
34− * Pre-fault the pages to ensure slow (eg NFS) pages
35− * don't hold up txg.
36− * Skip this if uio contains loaned arc_buf.
37−diff --git a/module/zfs/zfs_znode.c b/module/zfs/zfs_znode.c
38−index 90dbfd3..f02c021 100644
39−--- a/module/zfs/zfs_znode.c
40−+++ b/module/zfs/zfs_znode.c
41−@@ -1546,7 +1546,6 @@ zfs_trunc(znode_t *zp, uint64_t end)
42− int
43− zfs_freesp(znode_t *zp, uint64_t off, uint64_t len, int flag, boolean_t log)
44− {
45−- struct inode *ip = ZTOI(zp);
46− dmu_tx_t *tx;
47− zfs_sb_t *zsb = ZTOZSB(zp);
48− zilog_t *zilog = zsb->z_log;
49−@@ -1567,15 +1566,6 @@ zfs_freesp(znode_t *zp, uint64_t off, uint64_t len, int flag, boolean_t log)
50− goto out;
51− }
52−
53−- /*
54−- * Check for any locks in the region to be freed.
55−- */
56−- if (ip->i_flock && mandatory_lock(ip)) {
57−- uint64_t length = (len ? len : zp->z_size - off);
58−- if (!lock_may_write(ip, off, length))
59−- return (SET_ERROR(EAGAIN));
60−- }
61−-
62− if (len == 0) {
63− error = zfs_trunc(zp, off);
64− } else {