summaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/Makefile.am23
-rw-r--r--include/linux/bitops_compat.h30
-rw-r--r--include/linux/compiler_compat.h47
-rw-r--r--include/linux/delay_compat.h47
-rw-r--r--include/linux/file_compat.h140
-rw-r--r--include/linux/list_compat.h50
-rw-r--r--include/linux/math64_compat.h33
-rw-r--r--include/linux/mm_compat.h209
-rw-r--r--include/linux/proc_compat.h35
-rw-r--r--include/linux/rwsem_compat.h68
-rw-r--r--include/linux/wait_compat.h55
-rw-r--r--include/linux/zlib_compat.h37
12 files changed, 0 insertions, 774 deletions
diff --git a/include/linux/Makefile.am b/include/linux/Makefile.am
deleted file mode 100644
index 712e94ebe..000000000
--- a/include/linux/Makefile.am
+++ /dev/null
@@ -1,23 +0,0 @@
-COMMON_H =
-
-KERNEL_H = \
- $(top_srcdir)/include/linux/bitops_compat.h \
- $(top_srcdir)/include/linux/compiler_compat.h \
- $(top_srcdir)/include/linux/delay_compat.h \
- $(top_srcdir)/include/linux/file_compat.h \
- $(top_srcdir)/include/linux/list_compat.h \
- $(top_srcdir)/include/linux/math64_compat.h \
- $(top_srcdir)/include/linux/mm_compat.h \
- $(top_srcdir)/include/linux/proc_compat.h \
- $(top_srcdir)/include/linux/rwsem_compat.h \
- $(top_srcdir)/include/linux/wait_compat.h \
- $(top_srcdir)/include/linux/zlib_compat.h
-
-USER_H =
-
-EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
-
-if CONFIG_KERNEL
-kerneldir = @prefix@/src/spl-$(VERSION)/include/linux
-kernel_HEADERS = $(KERNEL_H)
-endif
diff --git a/include/linux/bitops_compat.h b/include/linux/bitops_compat.h
deleted file mode 100644
index a62b628e8..000000000
--- a/include/linux/bitops_compat.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC.
- * Copyright (C) 2007 The Regents of the University of California.
- * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
- * Written by Brian Behlendorf <[email protected]>.
- * UCRL-CODE-235197
- *
- * This file is part of the SPL, Solaris Porting Layer.
- * For details, see <http://zfsonlinux.org/>.
- *
- * The SPL is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * The SPL is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with the SPL. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef _SPL_BITOPS_COMPAT_H
-#define _SPL_BITOPS_COMPAT_H
-
-#include <linux/bitops.h>
-
-#endif /* _SPL_BITOPS_COMPAT_H */
diff --git a/include/linux/compiler_compat.h b/include/linux/compiler_compat.h
deleted file mode 100644
index 696d79572..000000000
--- a/include/linux/compiler_compat.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC.
- * Copyright (C) 2007 The Regents of the University of California.
- * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
- * Written by Brian Behlendorf <[email protected]>.
- * UCRL-CODE-235197
- *
- * This file is part of the SPL, Solaris Porting Layer.
- * For details, see <http://zfsonlinux.org/>.
- *
- * The SPL is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * The SPL is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with the SPL. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef _SPL_COMPILER_COMPAT_H
-#define _SPL_COMPILER_COMPAT_H
-
-#include <linux/compiler.h>
-
-#ifndef ACCESS_ONCE
-/*
- * Prevent the compiler from merging or refetching accesses. The compiler
- * is also forbidden from reordering successive instances of ACCESS_ONCE(),
- * but only when the compiler is aware of some particular ordering. One way
- * to make the compiler aware of ordering is to put the two invocations of
- * ACCESS_ONCE() in different C statements.
- *
- * This macro does absolutely -nothing- to prevent the CPU from reordering,
- * merging, or refetching absolutely anything at any time. Its main intended
- * use is to mediate communication between process-level code and irq/NMI
- * handlers, all running on the same CPU.
- */
-/* Taken from 2.6.33.2 */
-#define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x))
-#endif
-
-#endif /* _SPL_COMPILER_COMPAT_H */
diff --git a/include/linux/delay_compat.h b/include/linux/delay_compat.h
deleted file mode 100644
index c7a381100..000000000
--- a/include/linux/delay_compat.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2007-2013 Lawrence Livermore National Security, LLC.
- * Copyright (C) 2007 The Regents of the University of California.
- * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
- * Written by Brian Behlendorf <[email protected]>.
- * UCRL-CODE-235197
- *
- * This file is part of the SPL, Solaris Porting Layer.
- * For details, see <http://zfsonlinux.org/>.
- *
- * The SPL is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * The SPL is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with the SPL. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef _SPL_DELAY_COMPAT_H
-#define _SPL_DELAY_COMPAT_H
-
-#include <linux/delay.h>
-#include <linux/time.h>
-
-/* usleep_range() introduced in 2.6.36 */
-#ifndef HAVE_USLEEP_RANGE
-
-static inline void
-usleep_range(unsigned long min, unsigned long max)
-{
- unsigned int min_ms = min / USEC_PER_MSEC;
-
- if (min >= MAX_UDELAY_MS)
- msleep(min_ms);
- else
- udelay(min);
-}
-
-#endif /* HAVE_USLEEP_RANGE */
-
-#endif /* _SPL_DELAY_COMPAT_H */
diff --git a/include/linux/file_compat.h b/include/linux/file_compat.h
deleted file mode 100644
index 55ba2cc76..000000000
--- a/include/linux/file_compat.h
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC.
- * Copyright (C) 2007 The Regents of the University of California.
- * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
- * Written by Brian Behlendorf <[email protected]>.
- * UCRL-CODE-235197
- *
- * This file is part of the SPL, Solaris Porting Layer.
- * For details, see <http://zfsonlinux.org/>.
- *
- * The SPL is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * The SPL is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with the SPL. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef _SPL_FILE_COMPAT_H
-#define _SPL_FILE_COMPAT_H
-
-#include <linux/fs.h>
-#include <linux/uaccess.h>
-#ifdef HAVE_FDTABLE_HEADER
-#include <linux/fdtable.h>
-#endif
-
-static inline struct file *
-spl_filp_open(const char *name, int flags, int mode, int *err)
-{
- struct file *filp = NULL;
- int rc;
-
- filp = filp_open(name, flags, mode);
- if (IS_ERR(filp)) {
- rc = PTR_ERR(filp);
- if (err)
- *err = rc;
- filp = NULL;
- }
- return (filp);
-}
-
-#define spl_filp_close(f) filp_close(f, NULL)
-#define spl_filp_poff(f) (&(f)->f_pos)
-#define spl_filp_write(fp, b, s, p) (fp)->f_op->write((fp), (b), (s), p)
-
-static inline int
-spl_filp_fallocate(struct file *fp, int mode, loff_t offset, loff_t len)
-{
- int error = -EOPNOTSUPP;
-
-#ifdef HAVE_FILE_FALLOCATE
- if (fp->f_op->fallocate)
- error = fp->f_op->fallocate(fp, mode, offset, len);
-#else
-#ifdef HAVE_INODE_FALLOCATE
- if (fp->f_dentry && fp->f_dentry->d_inode &&
- fp->f_dentry->d_inode->i_op->fallocate)
- error = fp->f_dentry->d_inode->i_op->fallocate(
- fp->f_dentry->d_inode, mode, offset, len);
-#endif /* HAVE_INODE_FALLOCATE */
-#endif /* HAVE_FILE_FALLOCATE */
-
- 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
-#define spl_filp_fsync(fp, sync) vfs_fsync(fp, (fp)->f_dentry, sync)
-#endif /* HAVE_2ARGS_VFS_FSYNC */
-
-#ifdef HAVE_INODE_LOCK_SHARED
-#define spl_inode_lock(ip) inode_lock(ip)
-#define spl_inode_unlock(ip) inode_unlock(ip)
-#define spl_inode_lock_shared(ip) inode_lock_shared(ip)
-#define spl_inode_unlock_shared(ip) inode_unlock_shared(ip)
-#define spl_inode_trylock(ip) inode_trylock(ip)
-#define spl_inode_trylock_shared(ip) inode_trylock_shared(ip)
-#define spl_inode_is_locked(ip) inode_is_locked(ip)
-#define spl_inode_lock_nested(ip, s) inode_lock_nested(ip, s)
-#else
-#define spl_inode_lock(ip) mutex_lock(&(ip)->i_mutex)
-#define spl_inode_unlock(ip) mutex_unlock(&(ip)->i_mutex)
-#define spl_inode_lock_shared(ip) mutex_lock(&(ip)->i_mutex)
-#define spl_inode_unlock_shared(ip) mutex_unlock(&(ip)->i_mutex)
-#define spl_inode_trylock(ip) mutex_trylock(&(ip)->i_mutex)
-#define spl_inode_trylock_shared(ip) mutex_trylock(&(ip)->i_mutex)
-#define spl_inode_is_locked(ip) mutex_is_locked(&(ip)->i_mutex)
-#define spl_inode_lock_nested(ip, s) mutex_lock_nested(&(ip)->i_mutex, s)
-#endif
-
-#endif /* SPL_FILE_COMPAT_H */
diff --git a/include/linux/list_compat.h b/include/linux/list_compat.h
deleted file mode 100644
index fece8ad34..000000000
--- a/include/linux/list_compat.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC.
- * Copyright (C) 2007 The Regents of the University of California.
- * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
- * Written by Brian Behlendorf <[email protected]>.
- * UCRL-CODE-235197
- *
- * This file is part of the SPL, Solaris Porting Layer.
- * For details, see <http://zfsonlinux.org/>.
- *
- * The SPL is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * The SPL is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with the SPL. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef _SPL_LIST_COMPAT_H
-#define _SPL_LIST_COMPAT_H
-
-#include <linux/list.h>
-
-#ifndef list_for_each_entry_safe_reverse
-
-/*
- * list_for_each_entry_safe_reverse
- * @pos: the type * to use as a loop cursor.
- * @n: another type * to use as temporary storage
- * @head: the head for your list.
- * @member: the name of the list_struct within the struct.
- *
- * Iterate backwards over list of given type, safe against removal
- * of list entry.
- */
-#define list_for_each_entry_safe_reverse(pos, n, head, member) \
- for (pos = list_entry((head)->prev, typeof(*pos), member), \
- n = list_entry(pos->member.prev, typeof(*pos), member); \
- &pos->member != (head); \
- pos = n, n = list_entry(n->member.prev, typeof(*n), member))
-
-#endif /* list_for_each_entry_safe_reverse */
-
-#endif /* SPL_LIST_COMPAT_H */
diff --git a/include/linux/math64_compat.h b/include/linux/math64_compat.h
deleted file mode 100644
index c02f58479..000000000
--- a/include/linux/math64_compat.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC.
- * Copyright (C) 2007 The Regents of the University of California.
- * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
- * Written by Brian Behlendorf <[email protected]>.
- * UCRL-CODE-235197
- *
- * This file is part of the SPL, Solaris Porting Layer.
- * For details, see <http://zfsonlinux.org/>.
- *
- * The SPL is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * The SPL is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with the SPL. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef _SPL_MATH64_COMPAT_H
-#define _SPL_MATH64_COMPAT_H
-
-#ifndef abs64
-/* CSTYLED */
-#define abs64(x) ({ uint64_t t = (x) >> 63; ((x) ^ t) - t; })
-#endif
-
-#endif /* _SPL_MATH64_COMPAT_H */
diff --git a/include/linux/mm_compat.h b/include/linux/mm_compat.h
deleted file mode 100644
index c10652efd..000000000
--- a/include/linux/mm_compat.h
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC.
- * Copyright (C) 2007 The Regents of the University of California.
- * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
- * Written by Brian Behlendorf <[email protected]>.
- * UCRL-CODE-235197
- *
- * This file is part of the SPL, Solaris Porting Layer.
- * For details, see <http://zfsonlinux.org/>.
- *
- * The SPL is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * The SPL is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with the SPL. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef _SPL_MM_COMPAT_H
-#define _SPL_MM_COMPAT_H
-
-#include <linux/mm.h>
-#include <linux/fs.h>
-
-#if !defined(HAVE_SHRINK_CONTROL_STRUCT)
-struct shrink_control {
- gfp_t gfp_mask;
- unsigned long nr_to_scan;
-};
-#endif /* HAVE_SHRINK_CONTROL_STRUCT */
-
-/*
- * 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);
- */
-
-#define spl_register_shrinker(x) register_shrinker(x)
-#define spl_unregister_shrinker(x) unregister_shrinker(x)
-
-/*
- * 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 \
-}
-
-#define SPL_SHRINKER_CALLBACK_FWD_DECLARE(fn) \
-static int fn(int nr_to_scan, unsigned int gfp_mask)
-
-#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.35 to 2.6.39 Shrinker API Compatibility.
- */
-#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 3.0 to 3.11 Shrinker API Compatibility.
- */
-#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 3.12 and later Shrinker API Compatibility.
- */
-#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 \
-}
-
-#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
-
-#if defined(HAVE_SPLIT_SHRINKER_CALLBACK)
-typedef unsigned long spl_shrinker_t;
-#else
-typedef int spl_shrinker_t;
-#define SHRINK_STOP (-1)
-#endif
-
-#endif /* SPL_MM_COMPAT_H */
diff --git a/include/linux/proc_compat.h b/include/linux/proc_compat.h
deleted file mode 100644
index 91d914e10..000000000
--- a/include/linux/proc_compat.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC.
- * Copyright (C) 2007 The Regents of the University of California.
- * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
- * Written by Brian Behlendorf <[email protected]>.
- * UCRL-CODE-235197
- *
- * This file is part of the SPL, Solaris Porting Layer.
- * For details, see <http://zfsonlinux.org/>.
- *
- * The SPL is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * The SPL is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with the SPL. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef _SPL_PROC_COMPAT_H
-#define _SPL_PROC_COMPAT_H
-
-#include <linux/proc_fs.h>
-
-extern struct proc_dir_entry *proc_spl_kstat;
-
-int spl_proc_init(void);
-void spl_proc_fini(void);
-
-#endif /* SPL_PROC_COMPAT_H */
diff --git a/include/linux/rwsem_compat.h b/include/linux/rwsem_compat.h
deleted file mode 100644
index 7a0dcf8dc..000000000
--- a/include/linux/rwsem_compat.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC.
- * Copyright (C) 2007 The Regents of the University of California.
- * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
- * Written by Brian Behlendorf <[email protected]>.
- * UCRL-CODE-235197
- *
- * This file is part of the SPL, Solaris Porting Layer.
- * For details, see <http://zfsonlinux.org/>.
- *
- * The SPL is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * The SPL is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with the SPL. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef _SPL_RWSEM_COMPAT_H
-#define _SPL_RWSEM_COMPAT_H
-
-#include <linux/rwsem.h>
-
-#if defined(CONFIG_PREEMPT_RT_FULL)
-#define SPL_RWSEM_SINGLE_READER_VALUE (1)
-#define SPL_RWSEM_SINGLE_WRITER_VALUE (0)
-#elif defined(CONFIG_RWSEM_GENERIC_SPINLOCK)
-#define SPL_RWSEM_SINGLE_READER_VALUE (1)
-#define SPL_RWSEM_SINGLE_WRITER_VALUE (-1)
-#else
-#define SPL_RWSEM_SINGLE_READER_VALUE (RWSEM_ACTIVE_READ_BIAS)
-#define SPL_RWSEM_SINGLE_WRITER_VALUE (RWSEM_ACTIVE_WRITE_BIAS)
-#endif
-
-/* Linux 3.16 changed activity to count for rwsem-spinlock */
-#if defined(CONFIG_PREEMPT_RT_FULL)
-#define RWSEM_COUNT(sem) sem->read_depth
-#elif defined(HAVE_RWSEM_ACTIVITY)
-#define RWSEM_COUNT(sem) sem->activity
-/* Linux 4.8 changed count to an atomic_long_t for !rwsem-spinlock */
-#elif defined(HAVE_RWSEM_ATOMIC_LONG_COUNT)
-#define RWSEM_COUNT(sem) atomic_long_read(&(sem)->count)
-#else
-#define RWSEM_COUNT(sem) sem->count
-#endif
-
-int rwsem_tryupgrade(struct rw_semaphore *rwsem);
-
-#if defined(RWSEM_SPINLOCK_IS_RAW)
-#define spl_rwsem_lock_irqsave(lk, fl) raw_spin_lock_irqsave(lk, fl)
-#define spl_rwsem_unlock_irqrestore(lk, fl) \
- raw_spin_unlock_irqrestore(lk, fl)
-#define spl_rwsem_trylock_irqsave(lk, fl) raw_spin_trylock_irqsave(lk, fl)
-#else
-#define spl_rwsem_lock_irqsave(lk, fl) spin_lock_irqsave(lk, fl)
-#define spl_rwsem_unlock_irqrestore(lk, fl) spin_unlock_irqrestore(lk, fl)
-#define spl_rwsem_trylock_irqsave(lk, fl) spin_trylock_irqsave(lk, fl)
-#endif /* RWSEM_SPINLOCK_IS_RAW */
-
-#define spl_rwsem_is_locked(rwsem) rwsem_is_locked(rwsem)
-
-#endif /* _SPL_RWSEM_COMPAT_H */
diff --git a/include/linux/wait_compat.h b/include/linux/wait_compat.h
deleted file mode 100644
index 10fe2d896..000000000
--- a/include/linux/wait_compat.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (C) 2007-2014 Lawrence Livermore National Security, LLC.
- * Copyright (C) 2007 The Regents of the University of California.
- * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
- * Written by Brian Behlendorf <[email protected]>.
- * UCRL-CODE-235197
- *
- * This file is part of the SPL, Solaris Porting Layer.
- * For details, see <http://zfsonlinux.org/>.
- *
- * The SPL is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * The SPL is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with the SPL. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef _SPL_WAIT_COMPAT_H
-#define _SPL_WAIT_COMPAT_H
-
-#include <linux/sched.h>
-#include <linux/wait.h>
-
-#ifndef HAVE_WAIT_ON_BIT_ACTION
-#define spl_wait_on_bit(word, bit, mode) wait_on_bit(word, bit, mode)
-#else
-
-static inline int
-spl_bit_wait(void *word)
-{
- schedule();
- return (0);
-}
-
-#define spl_wait_on_bit(word, bit, mode) \
- wait_on_bit(word, bit, spl_bit_wait, mode)
-
-#endif /* HAVE_WAIT_ON_BIT_ACTION */
-
-#ifdef HAVE_WAIT_QUEUE_ENTRY_T
-typedef wait_queue_head_t spl_wait_queue_head_t;
-typedef wait_queue_entry_t spl_wait_queue_entry_t;
-#else
-typedef wait_queue_head_t spl_wait_queue_head_t;
-typedef wait_queue_t spl_wait_queue_entry_t;
-#endif
-
-#endif /* SPL_WAIT_COMPAT_H */
diff --git a/include/linux/zlib_compat.h b/include/linux/zlib_compat.h
deleted file mode 100644
index 3c14285d2..000000000
--- a/include/linux/zlib_compat.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2011 Lawrence Livermore National Security, LLC.
- * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
- * Written by Brian Behlendorf <[email protected]>.
- * UCRL-CODE-235197
- *
- * This file is part of the SPL, Solaris Porting Layer.
- * For details, see <http://zfsonlinux.org/>.
- *
- * The SPL is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * The SPL is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with the SPL. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef _SPL_ZLIB_COMPAT_H
-#define _SPL_ZLIB_COMPAT_H
-
-#include <linux/zlib.h>
-
-#ifdef HAVE_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE
-#define spl_zlib_deflate_workspacesize(wb, ml) \
- zlib_deflate_workspacesize(wb, ml)
-#else
-#define spl_zlib_deflate_workspacesize(wb, ml) \
- zlib_deflate_workspacesize()
-#endif /* HAVE_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE */
-
-#endif /* SPL_ZLIB_COMPAT_H */