aboutsummaryrefslogtreecommitdiffstats
path: root/testing/spl-grsec
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2014-07-24 12:11:54 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2014-07-24 13:59:52 +0000
commitd4a11f9e05d9d75e8975329eec6575a7b7def3d5 (patch)
tree05b6e375e962eb44911fc1d6bd7c137eee66405e /testing/spl-grsec
parent93902261b4976d7165f9a58bb2a54f2c962ae0cd (diff)
downloadaports-d4a11f9e05d9d75e8975329eec6575a7b7def3d5.tar.bz2
aports-d4a11f9e05d9d75e8975329eec6575a7b7def3d5.tar.xz
testing/spl-grsec: rebuild against kernel 3.14.13-r0
Diffstat (limited to 'testing/spl-grsec')
-rw-r--r--testing/spl-grsec/APKBUILD20
-rw-r--r--testing/spl-grsec/linux-3.12.patch435
-rw-r--r--testing/spl-grsec/linux-3.13.patch232
3 files changed, 6 insertions, 681 deletions
diff --git a/testing/spl-grsec/APKBUILD b/testing/spl-grsec/APKBUILD
index 9029a154f4..ac182db2a0 100644
--- a/testing/spl-grsec/APKBUILD
+++ b/testing/spl-grsec/APKBUILD
@@ -5,10 +5,10 @@ _realname=spl
_name=$_realname-$_flavor
_kpkg=linux-$_flavor
-_kver=3.14.12
-_kpkgrel=1
+_kver=3.14.13
+_kpkgrel=0
-_realver=0.6.2
+_realver=0.6.3
_mypkgrel=0
# source the kernel version
@@ -34,8 +34,6 @@ makedepends="$depends_dev perl automake autoconf libtool"
install=""
subpackages="$pkgname-dev $pkgname-utils"
source="http://archive.zfsonlinux.org/downloads/zfsonlinux/spl/spl-$_realver.tar.gz
- linux-3.12.patch
- linux-3.13.patch
"
_builddir="$srcdir"/spl-$_realver
@@ -86,12 +84,6 @@ utils() {
"$pkgdir"/lib/ || return 1
}
-md5sums="f00535bf89a7fde0e08f44a14a1f1e03 spl-0.6.2.tar.gz
-e6d211f6311d8e3b86e64069242e571b linux-3.12.patch
-748bbd0f0e402dda14549261866b2900 linux-3.13.patch"
-sha256sums="3c577c7055d6c73179726b9c8a7fd48f9122be0b345c50cd54732e801165daa4 spl-0.6.2.tar.gz
-f4f70183f8f8acacbda303709a98222af593f0f2eac893fbecf0e12d8a05bb3e linux-3.12.patch
-0ce776e548ca153ad9423d292295becee852d08a732a203cfb091ae5f253b71c linux-3.13.patch"
-sha512sums="a79bc730f80e08e917249a0872d1215fd8507c9fcf42a63d6abf320befadea94973df6530c110701f554005309dbbcefb4b6b17a3da38e8a70c8e1b186bae6a6 spl-0.6.2.tar.gz
-894ed56e75ed662dcdd51b900bf5407b5450c818e817560f8b135677beb03d4316564511547ee35b5106a669c3035d9e81830d26eec9f0d68f7bf5f58a05c930 linux-3.12.patch
-695fc6e1923503f5fd5235814b91faec5d31e3cf6d063718342312c14a266ad64093da6deb0ecce22fd6d379bf7fe7af1a4e11cdf78475b53fc1d7bdd966c4e6 linux-3.13.patch"
+md5sums="8df6ce3c8f1d9af6526b36f5079cba59 spl-0.6.3.tar.gz"
+sha256sums="898aa3912c73420a0082375679e28267a26d348a84561e25898a171785f41fe3 spl-0.6.3.tar.gz"
+sha512sums="3a3fecb7bc1944e1b3946593dd8fe22ca70ac79fb2a353664837161b22642817310a54f4fa06e63eedf72dc75a9fbf312fd6c363fd0565d6290d1b8850d83293 spl-0.6.3.tar.gz"
diff --git a/testing/spl-grsec/linux-3.12.patch b/testing/spl-grsec/linux-3.12.patch
deleted file mode 100644
index 105b0dcb2d..0000000000
--- a/testing/spl-grsec/linux-3.12.patch
+++ /dev/null
@@ -1,435 +0,0 @@
-From c3d9c0df3ee8d43db22815ebbfbe8b803fa46e46 Mon Sep 17 00:00:00 2001
-From: Richard Yao <ryao@gentoo.org>
-Date: Tue, 5 Nov 2013 11:35:54 -0500
-Subject: [PATCH] Linux 3.12 compat: New shrinker API
-
-torvalds/linux@24f7c6 introduced a new shrinker API while
-torvalds/linux@a0b021 dropped support for the old shrinker API.
-This patch adds support for the new shrinker API by wrapping
-the old one with the new one.
-
-This change also reorganizes the autotools checks on the shrinker
-API such that the configure script will fail early if an unknown
-API is encountered in the future.
-
-Support for the set_shrinker() API which was used by Linux 2.6.22
-and older has been dropped. As a general rule compatibility is
-only maintained back to Linux 2.6.26.
-
-Signed-off-by: Richard Yao <ryao@gentoo.org>
-Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
-Closes zfsonlinux/zfs#1732
-Closes zfsonlinux/zfs#1822
-Closes #293
-Closes #307
----
- config/spl-build.m4 | 116 ++++++++++++++++++------
- include/linux/mm_compat.h | 226 +++++++++++++++++++++++++++++-----------------
- 2 files changed, 229 insertions(+), 113 deletions(-)
-
-diff --git a/config/spl-build.m4 b/config/spl-build.m4
-index b0e3348..7d744db 100644
---- a/config/spl-build.m4
-+++ b/config/spl-build.m4
-@@ -27,8 +27,7 @@ AC_DEFUN([SPL_AC_CONFIG_KERNEL], [
- SPL_AC_TYPE_ATOMIC64_XCHG
- SPL_AC_TYPE_UINTPTR_T
- SPL_AC_2ARGS_REGISTER_SYSCTL
-- SPL_AC_SET_SHRINKER
-- SPL_AC_3ARGS_SHRINKER_CALLBACK
-+ SPL_AC_SHRINKER_CALLBACK
- SPL_AC_PATH_IN_NAMEIDATA
- SPL_AC_TASK_CURR
- SPL_AC_CTL_UNNUMBERED
-@@ -885,37 +884,18 @@ AC_DEFUN([SPL_AC_2ARGS_REGISTER_SYSCTL],
- ])
- ])
-
--dnl #
--dnl # 2.6.23 API change
--dnl # Old set_shrinker API replaced with register_shrinker
--dnl #
--AC_DEFUN([SPL_AC_SET_SHRINKER], [
-- AC_MSG_CHECKING([whether set_shrinker() available])
-- SPL_LINUX_TRY_COMPILE([
-- #include <linux/mm.h>
-- ],[
-- return set_shrinker(DEFAULT_SEEKS, NULL);
-- ],[
-- AC_MSG_RESULT([yes])
-- AC_DEFINE(HAVE_SET_SHRINKER, 1,
-- [set_shrinker() available])
-- ],[
-- AC_MSG_RESULT([no])
-- ])
--])
--
--dnl #
--dnl # 2.6.35 API change,
--dnl # Add context to shrinker callback
--dnl #
--AC_DEFUN([SPL_AC_3ARGS_SHRINKER_CALLBACK],
-- [AC_MSG_CHECKING([whether shrinker callback wants 3 args])
-+AC_DEFUN([SPL_AC_SHRINKER_CALLBACK],[
- tmp_flags="$EXTRA_KCFLAGS"
- EXTRA_KCFLAGS="-Werror"
-+ dnl #
-+ dnl # 2.6.23 to 2.6.34 API change
-+ dnl # ->shrink(int nr_to_scan, gfp_t gfp_mask)
-+ dnl #
-+ AC_MSG_CHECKING([whether old 2-argument shrinker exists])
- SPL_LINUX_TRY_COMPILE([
- #include <linux/mm.h>
-
-- int shrinker_cb(struct shrinker *, int, unsigned int);
-+ int shrinker_cb(int nr_to_scan, gfp_t gfp_mask);
- ],[
- struct shrinker cache_shrinker = {
- .shrink = shrinker_cb,
-@@ -924,10 +904,86 @@ AC_DEFUN([SPL_AC_3ARGS_SHRINKER_CALLBACK],
- register_shrinker(&cache_shrinker);
- ],[
- AC_MSG_RESULT(yes)
-- AC_DEFINE(HAVE_3ARGS_SHRINKER_CALLBACK, 1,
-- [shrinker callback wants 3 args])
-+ AC_DEFINE(HAVE_2ARGS_OLD_SHRINKER_CALLBACK, 1,
-+ [old shrinker callback wants 2 args])
- ],[
- AC_MSG_RESULT(no)
-+ dnl #
-+ dnl # 2.6.35 - 2.6.39 API change
-+ dnl # ->shrink(struct shrinker *,
-+ dnl # int nr_to_scan, gfp_t gfp_mask)
-+ dnl #
-+ AC_MSG_CHECKING([whether old 3-argument shrinker exists])
-+ SPL_LINUX_TRY_COMPILE([
-+ #include <linux/mm.h>
-+
-+ int shrinker_cb(struct shrinker *, int nr_to_scan,
-+ gfp_t gfp_mask);
-+ ],[
-+ struct shrinker cache_shrinker = {
-+ .shrink = shrinker_cb,
-+ .seeks = DEFAULT_SEEKS,
-+ };
-+ register_shrinker(&cache_shrinker);
-+ ],[
-+ AC_MSG_RESULT(yes)
-+ AC_DEFINE(HAVE_3ARGS_SHRINKER_CALLBACK, 1,
-+ [old shrinker callback wants 3 args])
-+ ],[
-+ AC_MSG_RESULT(no)
-+ dnl #
-+ dnl # 3.0 - 3.11 API change
-+ dnl # ->shrink(struct shrinker *,
-+ dnl # struct shrink_control *sc)
-+ dnl #
-+ AC_MSG_CHECKING(
-+ [whether new 2-argument shrinker exists])
-+ SPL_LINUX_TRY_COMPILE([
-+ #include <linux/mm.h>
-+
-+ int shrinker_cb(struct shrinker *,
-+ struct shrink_control *sc);
-+ ],[
-+ struct shrinker cache_shrinker = {
-+ .shrink = shrinker_cb,
-+ .seeks = DEFAULT_SEEKS,
-+ };
-+ register_shrinker(&cache_shrinker);
-+ ],[
-+ AC_MSG_RESULT(yes)
-+ AC_DEFINE(HAVE_2ARGS_NEW_SHRINKER_CALLBACK, 1,
-+ [new shrinker callback wants 2 args])
-+ ],[
-+ AC_MSG_RESULT(no)
-+ dnl #
-+ dnl # 3.12 API change,
-+ dnl # ->shrink() is logically split in to
-+ dnl # ->count_objects() and ->scan_objects()
-+ dnl #
-+ AC_MSG_CHECKING(
-+ [whether ->count_objects callback exists])
-+ SPL_LINUX_TRY_COMPILE([
-+ #include <linux/mm.h>
-+
-+ unsigned long shrinker_cb(
-+ struct shrinker *,
-+ struct shrink_control *sc);
-+ ],[
-+ struct shrinker cache_shrinker = {
-+ .count_objects = shrinker_cb,
-+ .scan_objects = shrinker_cb,
-+ .seeks = DEFAULT_SEEKS,
-+ };
-+ register_shrinker(&cache_shrinker);
-+ ],[
-+ AC_MSG_RESULT(yes)
-+ AC_DEFINE(HAVE_SPLIT_SHRINKER_CALLBACK,
-+ 1, [->count_objects exists])
-+ ],[
-+ AC_MSG_ERROR(error)
-+ ])
-+ ])
-+ ])
- ])
- EXTRA_KCFLAGS="$tmp_flags"
- ])
-diff --git a/include/linux/mm_compat.h b/include/linux/mm_compat.h
-index cb1bef9..37c9b08 100644
---- a/include/linux/mm_compat.h
-+++ b/include/linux/mm_compat.h
-@@ -148,107 +148,167 @@ typedef int (*shrink_icache_memory_t)(struct shrinker *,
- #endif /* HAVE_SHRINK_ICACHE_MEMORY */
-
- /*
-- * Linux 2.6. - 2.6. Shrinker API Compatibility.
-+ * Due to frequent changes in the shrinker API the following
-+ * compatibility wrappers should be used. They are as follows:
-+ *
-+ * SPL_SHRINKER_DECLARE is used to declare the shrinker which is
-+ * passed to spl_register_shrinker()/spl_unregister_shrinker(). Use
-+ * shrinker_name to set the shrinker variable name, shrinker_callback
-+ * to set the callback function, and seek_cost to define the cost of
-+ * reclaiming an object.
-+ *
-+ * SPL_SHRINKER_DECLARE(shrinker_name, shrinker_callback, seek_cost);
-+ *
-+ * SPL_SHRINKER_CALLBACK_FWD_DECLARE is used when a forward declaration
-+ * of the shrinker callback function is required. Only the callback
-+ * function needs to be passed.
-+ *
-+ * SPL_SHRINKER_CALLBACK_FWD_DECLARE(shrinker_callback);
-+ *
-+ * SPL_SHRINKER_CALLBACK_WRAPPER is used to declare the callback function
-+ * which is registered with the shrinker. This function will call your
-+ * custom shrinker which must use the following prototype. Notice the
-+ * leading __'s, these must be appended to the callback_function name.
-+ *
-+ * int __shrinker_callback(struct shrinker *, struct shrink_control *)
-+ * SPL_SHRINKER_CALLBACK_WRAPPER(shrinker_callback);a
-+ *
-+ *
-+ * Example:
-+ *
-+ * SPL_SHRINKER_CALLBACK_FWD_DECLARE(my_shrinker_fn);
-+ * SPL_SHRINKER_DECLARE(my_shrinker, my_shrinker_fn, 1);
-+ *
-+ * static int
-+ * __my_shrinker_fn(struct shrinker *shrink, struct shrink_control *sc)
-+ * {
-+ * if (sc->nr_to_scan) {
-+ * ...scan objects in the cache and reclaim them...
-+ * }
-+ *
-+ * ...calculate number of objects in the cache...
-+ *
-+ * return (number of objects in the cache);
-+ * }
-+ * SPL_SHRINKER_CALLBACK_WRAPPER(my_shrinker_fn);
- */
--#ifdef HAVE_SET_SHRINKER
--typedef struct spl_shrinker {
-- struct shrinker *shrinker;
-- shrinker_t fn;
-- int seeks;
--} spl_shrinker_t;
--
--static inline void
--spl_register_shrinker(spl_shrinker_t *ss)
--{
-- ss->shrinker = set_shrinker(ss->seeks, ss->fn);
--}
-
--static inline void
--spl_unregister_shrinker(spl_shrinker_t *ss)
--{
-- remove_shrinker(ss->shrinker);
--}
-+#define spl_register_shrinker(x) register_shrinker(x)
-+#define spl_unregister_shrinker(x) unregister_shrinker(x)
-
--# define SPL_SHRINKER_DECLARE(s, x, y) \
-- static spl_shrinker_t s = { \
-- .shrinker = NULL, \
-- .fn = x, \
-- .seeks = y \
-- }
--
--# define SPL_SHRINKER_CALLBACK_FWD_DECLARE(fn) \
-- static int fn(int, unsigned int)
--# define SPL_SHRINKER_CALLBACK_WRAPPER(fn) \
--static int \
--fn(int nr_to_scan, unsigned int gfp_mask) \
--{ \
-- struct shrink_control sc; \
-- \
-- sc.nr_to_scan = nr_to_scan; \
-- sc.gfp_mask = gfp_mask; \
-- \
-- return __ ## fn(NULL, &sc); \
-+/*
-+ * Linux 2.6.23 - 2.6.34 Shrinker API Compatibility.
-+ */
-+#if defined(HAVE_2ARGS_OLD_SHRINKER_CALLBACK)
-+#define SPL_SHRINKER_DECLARE(s, x, y) \
-+static struct shrinker s = { \
-+ .shrink = x, \
-+ .seeks = y \
- }
-
--#else
-+#define SPL_SHRINKER_CALLBACK_FWD_DECLARE(fn) \
-+static int fn(int nr_to_scan, unsigned int gfp_mask)
-
--# define spl_register_shrinker(x) register_shrinker(x)
--# define spl_unregister_shrinker(x) unregister_shrinker(x)
--# define SPL_SHRINKER_DECLARE(s, x, y) \
-- static struct shrinker s = { \
-- .shrink = x, \
-- .seeks = y \
-- }
-+#define SPL_SHRINKER_CALLBACK_WRAPPER(fn) \
-+static int \
-+fn(int nr_to_scan, unsigned int gfp_mask) \
-+{ \
-+ struct shrink_control sc; \
-+ \
-+ sc.nr_to_scan = nr_to_scan; \
-+ sc.gfp_mask = gfp_mask; \
-+ \
-+ return (__ ## fn(NULL, &sc)); \
-+}
-
- /*
-- * Linux 2.6. - 2.6. Shrinker API Compatibility.
-+ * Linux 2.6.35 to 2.6.39 Shrinker API Compatibility.
- */
--# if defined(HAVE_SHRINK_CONTROL_STRUCT)
--# define SPL_SHRINKER_CALLBACK_FWD_DECLARE(fn) \
-- static int fn(struct shrinker *, struct shrink_control *)
--# define SPL_SHRINKER_CALLBACK_WRAPPER(fn) \
--static int \
--fn(struct shrinker *shrink, struct shrink_control *sc) { \
-- return __ ## fn(shrink, sc); \
-+#elif defined(HAVE_3ARGS_SHRINKER_CALLBACK)
-+#define SPL_SHRINKER_DECLARE(s, x, y) \
-+static struct shrinker s = { \
-+ .shrink = x, \
-+ .seeks = y \
-+}
-+
-+#define SPL_SHRINKER_CALLBACK_FWD_DECLARE(fn) \
-+static int fn(struct shrinker *, int, unsigned int)
-+
-+#define SPL_SHRINKER_CALLBACK_WRAPPER(fn) \
-+static int \
-+fn(struct shrinker *shrink, int nr_to_scan, unsigned int gfp_mask) \
-+{ \
-+ struct shrink_control sc; \
-+ \
-+ sc.nr_to_scan = nr_to_scan; \
-+ sc.gfp_mask = gfp_mask; \
-+ \
-+ return (__ ## fn(shrink, &sc)); \
- }
-
- /*
-- * Linux 2.6. - 2.6. Shrinker API Compatibility.
-+ * Linux 3.0 to 3.11 Shrinker API Compatibility.
- */
--# elif defined(HAVE_3ARGS_SHRINKER_CALLBACK)
--# define SPL_SHRINKER_CALLBACK_FWD_DECLARE(fn) \
-- static int fn(struct shrinker *, int, unsigned int)
--# define SPL_SHRINKER_CALLBACK_WRAPPER(fn) \
--static int \
--fn(struct shrinker *shrink, int nr_to_scan, unsigned int gfp_mask) \
--{ \
-- struct shrink_control sc; \
-- \
-- sc.nr_to_scan = nr_to_scan; \
-- sc.gfp_mask = gfp_mask; \
-- \
-- return __ ## fn(shrink, &sc); \
-+#elif defined(HAVE_2ARGS_NEW_SHRINKER_CALLBACK)
-+#define SPL_SHRINKER_DECLARE(s, x, y) \
-+static struct shrinker s = { \
-+ .shrink = x, \
-+ .seeks = y \
-+}
-+
-+#define SPL_SHRINKER_CALLBACK_FWD_DECLARE(fn) \
-+static int fn(struct shrinker *, struct shrink_control *)
-+
-+#define SPL_SHRINKER_CALLBACK_WRAPPER(fn) \
-+static int \
-+fn(struct shrinker *shrink, struct shrink_control *sc) \
-+{ \
-+ return (__ ## fn(shrink, sc)); \
- }
-
- /*
-- * Linux 2.6. - 2.6. Shrinker API Compatibility.
-+ * Linux 3.12 and later Shrinker API Compatibility.
- */
--# else
--# define SPL_SHRINKER_CALLBACK_FWD_DECLARE(fn) \
-- static int fn(int, unsigned int)
--# define SPL_SHRINKER_CALLBACK_WRAPPER(fn) \
--static int \
--fn(int nr_to_scan, unsigned int gfp_mask) \
--{ \
-- struct shrink_control sc; \
-- \
-- sc.nr_to_scan = nr_to_scan; \
-- sc.gfp_mask = gfp_mask; \
-- \
-- return __ ## fn(NULL, &sc); \
-+#elif defined(HAVE_SPLIT_SHRINKER_CALLBACK)
-+#define SPL_SHRINKER_DECLARE(s, x, y) \
-+static struct shrinker s = { \
-+ .count_objects = x ## _count_objects, \
-+ .scan_objects = x ## _scan_objects, \
-+ .seeks = y \
- }
-
--# endif
--#endif /* HAVE_SET_SHRINKER */
-+#define SPL_SHRINKER_CALLBACK_FWD_DECLARE(fn) \
-+static unsigned long fn ## _count_objects(struct shrinker *, \
-+ struct shrink_control *); \
-+static unsigned long fn ## _scan_objects(struct shrinker *, \
-+ struct shrink_control *)
-+
-+#define SPL_SHRINKER_CALLBACK_WRAPPER(fn) \
-+static unsigned long \
-+fn ## _count_objects(struct shrinker *shrink, struct shrink_control *sc)\
-+{ \
-+ int __ret__; \
-+ \
-+ sc->nr_to_scan = 0; \
-+ __ret__ = __ ## fn(NULL, sc); \
-+ \
-+ /* Errors may not be returned and must be converted to zeros */ \
-+ return ((__ret__ < 0) ? 0 : __ret__); \
-+} \
-+ \
-+static unsigned long \
-+fn ## _scan_objects(struct shrinker *shrink, struct shrink_control *sc) \
-+{ \
-+ int __ret__; \
-+ \
-+ __ret__ = __ ## fn(NULL, sc); \
-+ return ((__ret__ < 0) ? SHRINK_STOP : __ret__); \
-+}
-+#else
-+/*
-+ * Linux 2.x to 2.6.22, or a newer shrinker API has been introduced.
-+ */
-+#error "Unknown shrinker callback"
-+#endif
-
- #endif /* SPL_MM_COMPAT_H */
---
-1.8.5.1
-
diff --git a/testing/spl-grsec/linux-3.13.patch b/testing/spl-grsec/linux-3.13.patch
deleted file mode 100644
index 483d559d3a..0000000000
--- a/testing/spl-grsec/linux-3.13.patch
+++ /dev/null
@@ -1,232 +0,0 @@
-From 50a0749eba31e821a7edf286f1e3b149f7d13c59 Mon Sep 17 00:00:00 2001
-From: Richard Yao <ryao@gentoo.org>
-Date: Mon, 25 Nov 2013 11:22:33 -0500
-Subject: [PATCH] Linux 3.13 compat: Pass NULL for new delegated inode argument
-
-This check was originally added for SLES10, a093c6a, to check for
-a 'struct vfsmount *' argument which they added. However, since
-SLES10 is based on a 2.6.16 kernel which is no longer supported
-this functionality was dropped. The checks were refactored to
-support Linux 3.13 without concern for historical versions.
-
-Signed-off-by: Richard Yao <ryao@gentoo.org>
-Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
-Closes #312
----
- config/spl-build.m4 | 52 ++++++++++++++++++++++++++++++++++++++++----------
- module/spl/spl-vnode.c | 22 ++++++++++++---------
- 2 files changed, 55 insertions(+), 19 deletions(-)
-
-diff --git a/config/spl-build.m4 b/config/spl-build.m4
-index 7d744db..8426780 100644
---- a/config/spl-build.m4
-+++ b/config/spl-build.m4
-@@ -1842,41 +1842,73 @@ AC_DEFUN([SPL_AC_SET_FS_PWD_WITH_CONST],
- EXTRA_KCFLAGS="$tmp_flags"
- ])
-
--dnl #
--dnl # SLES API change, never adopted in mainline,
--dnl # Third 'struct vfsmount *' argument removed.
--dnl #
- AC_DEFUN([SPL_AC_2ARGS_VFS_UNLINK],
- [AC_MSG_CHECKING([whether vfs_unlink() wants 2 args])
- SPL_LINUX_TRY_COMPILE([
- #include <linux/fs.h>
- ],[
-- vfs_unlink(NULL, NULL);
-+ vfs_unlink((struct inode *) NULL, (struct dentry *) NULL);
- ],[
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_2ARGS_VFS_UNLINK, 1,
- [vfs_unlink() wants 2 args])
- ],[
- AC_MSG_RESULT(no)
-+ dnl #
-+ dnl # Linux 3.13 API change
-+ dnl # Added delegated inode
-+ dnl #
-+ AC_MSG_CHECKING([whether vfs_unlink() wants 3 args])
-+ SPL_LINUX_TRY_COMPILE([
-+ #include <linux/fs.h>
-+ ],[
-+ vfs_unlink((struct inode *) NULL,
-+ (struct dentry *) NULL,
-+ (struct inode **) NULL);
-+ ],[
-+ AC_MSG_RESULT(yes)
-+ AC_DEFINE(HAVE_3ARGS_VFS_UNLINK, 1,
-+ [vfs_unlink() wants 3 args])
-+ ],[
-+ AC_MSG_ERROR(no)
-+ ])
-+
- ])
- ])
-
--dnl #
--dnl # SLES API change, never adopted in mainline,
--dnl # Third and sixth 'struct vfsmount *' argument removed.
--dnl #
- AC_DEFUN([SPL_AC_4ARGS_VFS_RENAME],
- [AC_MSG_CHECKING([whether vfs_rename() wants 4 args])
- SPL_LINUX_TRY_COMPILE([
- #include <linux/fs.h>
- ],[
-- vfs_rename(NULL, NULL, NULL, NULL);
-+ vfs_rename((struct inode *) NULL, (struct dentry *) NULL,
-+ (struct inode *) NULL, (struct dentry *) NULL);
- ],[
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_4ARGS_VFS_RENAME, 1,
- [vfs_rename() wants 4 args])
- ],[
- AC_MSG_RESULT(no)
-+ dnl #
-+ dnl # Linux 3.13 API change
-+ dnl # Added delegated inode
-+ dnl #
-+ AC_MSG_CHECKING([whether vfs_rename() wants 5 args])
-+ SPL_LINUX_TRY_COMPILE([
-+ #include <linux/fs.h>
-+ ],[
-+ vfs_rename((struct inode *) NULL,
-+ (struct dentry *) NULL,
-+ (struct inode *) NULL,
-+ (struct dentry *) NULL,
-+ (struct inode **) NULL);
-+ ],[
-+ AC_MSG_RESULT(yes)
-+ AC_DEFINE(HAVE_5ARGS_VFS_RENAME, 1,
-+ [vfs_rename() wants 5 args])
-+ ],[
-+ AC_MSG_ERROR(no)
-+ ])
- ])
- ])
-
-diff --git a/module/spl/spl-vnode.c b/module/spl/spl-vnode.c
-index 0784ff2..5496067 100644
---- a/module/spl/spl-vnode.c
-+++ b/module/spl/spl-vnode.c
-@@ -334,7 +334,11 @@ vn_remove(const char *path, uio_seg_t seg, int flags)
- if (inode)
- ihold(inode);
-
-+#ifdef HAVE_2ARGS_VFS_UNLINK
- rc = vfs_unlink(parent.dentry->d_inode, dentry);
-+#else
-+ rc = vfs_unlink(parent.dentry->d_inode, dentry, NULL);
-+#endif /* HAVE_2ARGS_VFS_UNLINK */
- exit1:
- dput(dentry);
- } else {
-@@ -412,10 +416,10 @@ vn_rename(const char *oldname, const char *newname, int x1)
-
- #ifdef HAVE_4ARGS_VFS_RENAME
- rc = vfs_rename(old_dir->d_inode, old_dentry,
-- new_dir->d_inode, new_dentry);
-+ new_dir->d_inode, new_dentry);
- #else
-- rc = vfs_rename(old_dir->d_inode, old_dentry, oldnd.nd_mnt,
-- new_dir->d_inode, new_dentry, newnd.nd_mnt);
-+ rc = vfs_rename(old_dir->d_inode, old_dentry,
-+ new_dir->d_inode, new_dentry, NULL);
- #endif /* HAVE_4ARGS_VFS_RENAME */
- exit4:
- unlock_rename(new_dir, old_dir);
-@@ -478,9 +482,9 @@ vn_remove(const char *path, uio_seg_t seg, int flags)
- if (inode)
- atomic_inc(&inode->i_count);
- #ifdef HAVE_2ARGS_VFS_UNLINK
-- rc = vfs_unlink(nd.nd_dentry->d_inode, dentry);
-+ rc = vfs_unlink(nd.nd_dentry->d_inode, dentry);
- #else
-- rc = vfs_unlink(nd.nd_dentry->d_inode, dentry, nd.nd_mnt);
-+ rc = vfs_unlink(nd.nd_dentry->d_inode, dentry, NULL);
- #endif /* HAVE_2ARGS_VFS_UNLINK */
- exit2:
- dput(dentry);
-@@ -571,11 +575,11 @@ vn_rename(const char *oldname, const char *newname, int x1)
- SGOTO(exit5, rc);
-
- #ifdef HAVE_4ARGS_VFS_RENAME
-- rc = vfs_rename(old_dir->d_inode, old_dentry,
-- new_dir->d_inode, new_dentry);
-+ rc = vfs_rename(old_dir->d_inode, old_dentry,
-+ new_dir->d_inode, new_dentry);
- #else
-- rc = vfs_rename(old_dir->d_inode, old_dentry, oldnd.nd_mnt,
-- new_dir->d_inode, new_dentry, newnd.nd_mnt);
-+ rc = vfs_rename(old_dir->d_inode, old_dentry,
-+ new_dir->d_inode, new_dentry, NULL);
- #endif /* HAVE_4ARGS_VFS_RENAME */
- exit5:
- dput(new_dentry);
---
-1.9.3
-
-
-
-
-From 3e96de17d723d6f6c9e2fd04b059b50d4e0bbef0 Mon Sep 17 00:00:00 2001
-From: Richard Yao <ryao@gentoo.org>
-Date: Thu, 8 Aug 2013 04:30:55 -0400
-Subject: [PATCH] Linux 3.13 compat: Remove unused flags variable from
- __cv_init()
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-GCC 4.8.1 complained about an unused flags variable when building
-against Linux 2.6.26.8:
-
-/var/tmp/portage/sys-kernel/spl-9999/work/spl-9999/module/spl/../../module/spl/spl-condvar.c:
-In function ‘__cv_init’:
-/var/tmp/portage/sys-kernel/spl-9999/work/spl-9999/module/spl/../../module/spl/spl-condvar.c:39:6:
-error: variable ‘flags’ set but not used
-[-Werror=unused-but-set-variable]
- int flags = KM_SLEEP;
- ^
- cc1: all warnings being treated as errors
-
-Additionally, the superfluous code uses a preempt_count variable that is
-no longer available on Linux 3.13. Deleting the unnecessary code fixes a
-Linux 3.13 compatibility issue.
-
-Signed-off-by: Richard Yao <ryao@gentoo.org>
-Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
-Closes #312
----
- module/spl/spl-condvar.c | 8 --------
- 1 file changed, 8 deletions(-)
-
-diff --git a/module/spl/spl-condvar.c b/module/spl/spl-condvar.c
-index 283648a..8236412 100644
---- a/module/spl/spl-condvar.c
-+++ b/module/spl/spl-condvar.c
-@@ -36,8 +36,6 @@
- void
- __cv_init(kcondvar_t *cvp, char *name, kcv_type_t type, void *arg)
- {
-- int flags = KM_SLEEP;
--
- SENTRY;
- ASSERT(cvp);
- ASSERT(name == NULL);
-@@ -51,12 +49,6 @@ __cv_init(kcondvar_t *cvp, char *name, kcv_type_t type, void *arg)
- atomic_set(&cvp->cv_refs, 1);
- cvp->cv_mutex = NULL;
-
-- /* We may be called when there is a non-zero preempt_count or
-- * interrupts are disabled is which case we must not sleep.
-- */
-- if (current_thread_info()->preempt_count || irqs_disabled())
-- flags = KM_NOSLEEP;
--
- SEXIT;
- }
- EXPORT_SYMBOL(__cv_init);
---
-1.9.3
-