diff -Nru spl-linux-0.6.1/.gitignore spl-linux-0.6.2/.gitignore --- spl-linux-0.6.1/.gitignore 2013-03-25 20:30:22.000000000 +0000 +++ spl-linux-0.6.2/.gitignore 2013-08-16 22:17:35.000000000 +0000 @@ -14,20 +14,13 @@ # Normal rules # *.[oa] -*.ko -*.ko.unsigned -*.ko.out -*.ko.out.sig *.lo *.la -*.mod.c *~ *.swp -.*.cmd .deps .libs .DS_Store -modules.order Makefile Makefile.in @@ -52,3 +45,6 @@ tags TAGS cscope.* +*.rpm +*.deb +*.tar.gz diff -Nru spl-linux-0.6.1/META spl-linux-0.6.2/META --- spl-linux-0.6.1/META 2013-03-25 20:30:22.000000000 +0000 +++ spl-linux-0.6.2/META 2013-08-16 22:17:35.000000000 +0000 @@ -1,6 +1,6 @@ Meta: 1 Name: spl Branch: 1.0 -Version: 0.6.0 -Release: rc14 +Version: 0.6.2 +Release: 1 Release-Tags: relext diff -Nru spl-linux-0.6.1/Makefile.am spl-linux-0.6.2/Makefile.am --- spl-linux-0.6.1/Makefile.am 2013-03-25 20:30:22.000000000 +0000 +++ spl-linux-0.6.2/Makefile.am 2013-08-16 22:17:35.000000000 +0000 @@ -1,3 +1,6 @@ + +ACLOCAL_AMFLAGS = -I config + include $(top_srcdir)/config/rpm.am include $(top_srcdir)/config/deb.am include $(top_srcdir)/config/tgz.am diff -Nru spl-linux-0.6.1/README.markdown spl-linux-0.6.2/README.markdown --- spl-linux-0.6.1/README.markdown 2013-03-25 20:30:22.000000000 +0000 +++ spl-linux-0.6.2/README.markdown 2013-08-16 22:17:35.000000000 +0000 @@ -2,7 +2,7 @@ many of the Solaris kernel APIs. This shim layer makes it possible to run Solaris kernel code in the Linux kernel with relatively minimal modification. This can be particularly useful when you want to track -upstream Solaris development closely and don’t want the overhead of +upstream Solaris development closely and do not want the overhead of maintaining a large patch which converts Solaris primitives to Linux primitives. @@ -11,6 +11,11 @@ $ ./configure $ make pkg +If you are building directly from the git tree and not an officially +released tarball you will need to generate the configure script. +This can be done by executing the autogen.sh script after installing +the GNU autotools for your distribution. + To copy the kernel code inside your kernel source tree for builtin compilation: diff -Nru spl-linux-0.6.1/autogen.sh spl-linux-0.6.2/autogen.sh --- spl-linux-0.6.1/autogen.sh 2013-03-25 20:30:22.000000000 +0000 +++ spl-linux-0.6.2/autogen.sh 2013-08-16 22:17:35.000000000 +0000 @@ -1,7 +1,4 @@ #!/bin/sh -aclocal -I config -libtoolize --automake --copy -autoheader -automake --add-missing --include-deps --copy -autoconf +autoreconf -fiv +rm -Rf autom4te.cache diff -Nru spl-linux-0.6.1/config/.gitignore spl-linux-0.6.2/config/.gitignore --- spl-linux-0.6.1/config/.gitignore 2013-03-25 20:30:22.000000000 +0000 +++ spl-linux-0.6.2/config/.gitignore 2013-08-16 22:17:35.000000000 +0000 @@ -1,6 +1,8 @@ -config.guess -config.sub -depcomp -install-sh -ltmain.sh -missing +/config.guess +/config.sub +/depcomp +/install-sh +/ltmain.sh +/missing +/libtool.m4 +/lt*.m4 diff -Nru spl-linux-0.6.1/config/Rules.am spl-linux-0.6.2/config/Rules.am --- spl-linux-0.6.1/config/Rules.am 2013-03-25 20:30:22.000000000 +0000 +++ spl-linux-0.6.2/config/Rules.am 2013-08-16 22:17:35.000000000 +0000 @@ -9,5 +9,6 @@ DEFAULT_INCLUDES = -include ${top_builddir}/spl_config.h AM_LIBTOOLFLAGS = --silent +AM_CPPFLAGS = -D__USE_LARGEFILE64 AM_CFLAGS = -Wall -Wshadow -Wstrict-prototypes -fno-strict-aliasing -AM_CFLAGS += -D__USE_LARGEFILE64 ${DEBUG_CFLAGS} +AM_CFLAGS += ${DEBUG_CFLAGS} diff -Nru spl-linux-0.6.1/config/deb.am spl-linux-0.6.2/config/deb.am --- spl-linux-0.6.1/config/deb.am 2013-03-25 20:30:22.000000000 +0000 +++ spl-linux-0.6.2/config/deb.am 2013-08-16 22:17:35.000000000 +0000 @@ -34,7 +34,7 @@ version=${VERSION}-${RELEASE}; \ arch=`$(RPM) -qp $${name}-kmod-$${version}.src.rpm --qf %{arch} | tail -1`; \ pkg1=kmod-$${name}*$${version}.$${arch}.rpm; \ - fakeroot $(ALIEN) --scripts --to-deb $$pkg1; \ + fakeroot $(ALIEN) --bump=0 --scripts --to-deb $$pkg1; \ $(RM) $$pkg1 endif @@ -44,7 +44,7 @@ version=${VERSION}-${RELEASE}; \ arch=`$(RPM) -qp $${name}-$${version}.src.rpm --qf %{arch} | tail -1`; \ pkg1=$${name}-$${version}.$${arch}.rpm; \ - fakeroot $(ALIEN) --scripts --to-deb $$pkg1; \ + fakeroot $(ALIEN) --bump=0 --scripts --to-deb $$pkg1; \ $(RM) $$pkg1 endif diff -Nru spl-linux-0.6.1/config/spl-build.m4 spl-linux-0.6.2/config/spl-build.m4 --- spl-linux-0.6.1/config/spl-build.m4 2013-03-25 20:30:22.000000000 +0000 +++ spl-linux-0.6.2/config/spl-build.m4 2013-08-16 22:17:35.000000000 +0000 @@ -33,6 +33,8 @@ SPL_AC_TASK_CURR SPL_AC_CTL_UNNUMBERED SPL_AC_CTL_NAME + SPL_AC_VMALLOC_INFO + SPL_AC_PDE_DATA SPL_AC_FLS64 SPL_AC_DEVICE_CREATE SPL_AC_5ARGS_DEVICE_CREATE @@ -71,6 +73,7 @@ SPL_AC_INODE_TRUNCATE_RANGE SPL_AC_FS_STRUCT_SPINLOCK SPL_AC_CRED_STRUCT + SPL_AC_KUIDGID_T SPL_AC_GROUPS_SEARCH SPL_AC_PUT_TASK_STRUCT SPL_AC_5ARGS_PROC_HANDLER @@ -105,7 +108,7 @@ if ! test -f "$LINUX_OBJ/$LINUX_SYMBOLS"; then AC_MSG_ERROR([ *** Please make sure the kernel devel package for your distribution - *** is installed. If your building with a custom kernel make sure the + *** is installed. If you are building with a custom kernel, make sure the *** kernel is configured, built, and the '--with-linux=PATH' configure *** option refers to the location of the kernel source.]) fi @@ -156,7 +159,7 @@ if test ! -d "$kernelsrc"; then AC_MSG_ERROR([ *** Please make sure the kernel devel package for your distribution - *** is installed then try again. If that fails you can specify the + *** is installed and then try again. If that fails, you can specify the *** location of the kernel source with the '--with-linux=PATH' option.]) fi @@ -229,10 +232,10 @@ dnl # dnl # Check for rpm+rpmbuild to build RPM packages. If these tools -dnl # are missing it is non-fatal but you will not be able to build +dnl # are missing, it is non-fatal, but you will not be able to build dnl # RPM packages and will be warned if you try too. dnl # -dnl # By default the generic spec file will be used because it requires +dnl # By default, the generic spec file will be used because it requires dnl # minimal dependencies. Distribution specific spec files can be dnl # placed under the 'rpm/' directory and enabled using dnl # the --with-spec= configure option. @@ -1358,6 +1361,43 @@ ]) dnl # +dnl # 3.10 API change, +dnl # struct vmalloc_info is now declared in linux/vmalloc.h +dnl # +AC_DEFUN([SPL_AC_VMALLOC_INFO], [ + AC_MSG_CHECKING([whether struct vmalloc_info is declared]) + SPL_LINUX_TRY_COMPILE([ + #include + struct vmalloc_info { void *a; }; + ],[ + return 0; + ],[ + AC_MSG_RESULT(no) + ],[ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_VMALLOC_INFO, 1, [yes]) + ]) +]) + +dnl # +dnl # 3.10 API change, +dnl # PDE is replaced by PDE_DATA +dnl # +AC_DEFUN([SPL_AC_PDE_DATA], [ + AC_MSG_CHECKING([whether PDE_DATA() is available]) + SPL_LINUX_TRY_COMPILE_SYMBOL([ + #include + ], [ + PDE_DATA(NULL); + ], [PDE_DATA], [], [ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_PDE_DATA, 1, [yes]) + ],[ + AC_MSG_RESULT(no) + ]) +]) + +dnl # dnl # 2.6.17 API change dnl # The helper functions first_online_pgdat(), next_online_pgdat(), and dnl # next_zone() are introduced to simplify for_each_zone(). These symbols @@ -1827,6 +1867,36 @@ ]) ]) + +dnl # +dnl # User namespaces, use kuid_t in place of uid_t +dnl # where available. Not strictly a user namespaces thing +dnl # but it should prevent surprises +dnl # +AC_DEFUN([SPL_AC_KUIDGID_T], [ + AC_MSG_CHECKING([whether kuid_t/kgid_t is available]) + SPL_LINUX_TRY_COMPILE([ + #include + ], [ + kuid_t userid = KUIDT_INIT(0); + kgid_t groupid = KGIDT_INIT(0); + ],[ + SPL_LINUX_TRY_COMPILE([ + #include + ], [ + kuid_t userid = 0; + kgid_t groupid = 0; + ],[ + AC_MSG_RESULT(yes; optional) + ],[ + AC_MSG_RESULT(yes; mandatory) + AC_DEFINE(HAVE_KUIDGID_T, 1, [kuid_t/kgid_t in use]) + ]) + ],[ + AC_MSG_RESULT(no) + ]) +]) + dnl # dnl # Custom SPL patch may export this symbol. dnl # @@ -1834,8 +1904,15 @@ [AC_MSG_CHECKING([whether groups_search() is available]) SPL_LINUX_TRY_COMPILE_SYMBOL([ #include + #ifdef HAVE_KUIDGID_T + #include + #endif ], [ + #ifdef HAVE_KUIDGID_T + groups_search(NULL, KGIDT_INIT(0)); + #else groups_search(NULL, 0); + #endif ], [groups_search], [], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_GROUPS_SEARCH, 1, [groups_search() is available]) diff -Nru spl-linux-0.6.1/config/spl-meta.m4 spl-linux-0.6.2/config/spl-meta.m4 --- spl-linux-0.6.1/config/spl-meta.m4 2013-03-25 20:30:22.000000000 +0000 +++ spl-linux-0.6.2/config/spl-meta.m4 2013-08-16 22:17:35.000000000 +0000 @@ -1,15 +1,37 @@ -############################################################################### -# Written by Chris Dunlap . -# Modified by Brian Behlendorf . -############################################################################### -# SPL_AC_META: Read metadata from the META file. When building from a -# git repository the SPL_META_RELEASE field will be overwritten if there -# is an annotated tag matching the form SPL_META_NAME-SPL_META_VERSION-*. -# This allows for working builds to be uniquely identified using the git -# commit hash. -############################################################################### - +dnl # +dnl # DESCRIPTION: +dnl # Read meta data from the META file. When building from a git repository +dnl # the SPL_META_RELEASE field will be overwritten if there is an annotated +dnl # tag matching the form SPL_META_NAME-SPL_META_VERSION-*. This allows +dnl # for working builds to be uniquely identified using the git commit hash. +dnl # +dnl # The META file format is as follows: +dnl # ^[ ]*KEY:[ \t]+VALUE$ +dnl # +dnl # In other words: +dnl # - KEY is separated from VALUE by a colon and one or more spaces/tabs. +dnl # - KEY and VALUE are case sensitive. +dnl # - Leading spaces are ignored. +dnl # - First match wins for duplicate keys. +dnl # +dnl # A line can be commented out by preceding it with a '#' (or technically +dnl # any non-space character since that will prevent the regex from +dnl # matching). +dnl # +dnl # WARNING: +dnl # Placing a colon followed by a space or tab (ie, ":[ \t]+") within the +dnl # VALUE will prematurely terminate the string since that sequence is +dnl # used as the awk field separator. +dnl # +dnl # KEYS: +dnl # The following META keys are recognized: +dnl # Name, Version, Release, Date, Author, LT_Current, LT_Revision, LT_Age +dnl # +dnl # Written by Chris Dunlap . +dnl # Modified by Brian Behlendorf . +dnl # AC_DEFUN([SPL_AC_META], [ + AC_PROG_AWK AC_MSG_CHECKING([metadata]) META="$srcdir/META" @@ -17,7 +39,7 @@ if test -f "$META"; then _spl_ac_meta_type="META file" - SPL_META_NAME=_SPL_AC_META_GETVAL([(?:NAME|PROJECT|PACKAGE)]); + SPL_META_NAME=_SPL_AC_META_GETVAL([(Name|Project|Package)]); if test -n "$SPL_META_NAME"; then AC_DEFINE_UNQUOTED([SPL_META_NAME], ["$SPL_META_NAME"], [Define the project name.] @@ -25,7 +47,7 @@ AC_SUBST([SPL_META_NAME]) fi - SPL_META_VERSION=_SPL_AC_META_GETVAL([VERSION]); + SPL_META_VERSION=_SPL_AC_META_GETVAL([Version]); if test -n "$SPL_META_VERSION"; then AC_DEFINE_UNQUOTED([SPL_META_VERSION], ["$SPL_META_VERSION"], [Define the project version.] @@ -33,8 +55,8 @@ AC_SUBST([SPL_META_VERSION]) fi - SPL_META_RELEASE=_SPL_AC_META_GETVAL([RELEASE]); - if git rev-parse --git-dir > /dev/null 2>&1; then + SPL_META_RELEASE=_SPL_AC_META_GETVAL([Release]); + if test ! -f ".nogitrelease" && git rev-parse --git-dir > /dev/null 2>&1; then _match="${SPL_META_NAME}-${SPL_META_VERSION}*" _alias=$(git describe --match=${_match} 2>/dev/null) _release=$(echo ${_alias}|cut -f3- -d'-'|sed 's/-/_/g') @@ -65,7 +87,7 @@ AC_SUBST([SPL_META_ALIAS]) fi - SPL_META_DATA=_SPL_AC_META_GETVAL([DATE]); + SPL_META_DATA=_SPL_AC_META_GETVAL([Date]); if test -n "$SPL_META_DATA"; then AC_DEFINE_UNQUOTED([SPL_META_DATA], ["$SPL_META_DATA"], [Define the project release date.] @@ -73,7 +95,7 @@ AC_SUBST([SPL_META_DATA]) fi - SPL_META_AUTHOR=_SPL_AC_META_GETVAL([AUTHOR]); + SPL_META_AUTHOR=_SPL_AC_META_GETVAL([Author]); if test -n "$SPL_META_AUTHOR"; then AC_DEFINE_UNQUOTED([SPL_META_AUTHOR], ["$SPL_META_AUTHOR"], [Define the project author.] @@ -82,9 +104,9 @@ fi m4_pattern_allow([^LT_(CURRENT|REVISION|AGE)$]) - SPL_META_LT_CURRENT=_SPL_AC_META_GETVAL([LT_CURRENT]); - SPL_META_LT_REVISION=_SPL_AC_META_GETVAL([LT_REVISION]); - SPL_META_LT_AGE=_SPL_AC_META_GETVAL([LT_AGE]); + SPL_META_LT_CURRENT=_SPL_AC_META_GETVAL([LT_Current]); + SPL_META_LT_REVISION=_SPL_AC_META_GETVAL([LT_Revision]); + SPL_META_LT_AGE=_SPL_AC_META_GETVAL([LT_Age]); if test -n "$SPL_META_LT_CURRENT" \ -o -n "$SPL_META_LT_REVISION" \ -o -n "$SPL_META_LT_AGE"; then @@ -115,15 +137,18 @@ ] ) -AC_DEFUN([_SPL_AC_META_GETVAL], - [`perl -n\ - -e "BEGIN { \\$key=shift @ARGV; }"\ - -e "next unless s/^\s*\\$key@<:@:=@:>@//i;"\ - -e "s/^((?:@<:@^'\"#@:>@*(?:(@<:@'\"@:>@)@<:@^\2@:>@*\2)*)*)#.*/\\@S|@1/;"\ - -e "s/^\s+//;"\ - -e "s/\s+$//;"\ - -e "s/^(@<:@'\"@:>@)(.*)\1/\\@S|@2/;"\ - -e "\\$val=\\$_;"\ - -e "END { print \\$val if defined \\$val; }"\ - '$1' $META`]dnl +dnl # _SPL_AC_META_GETVAL (KEY_NAME_OR_REGEX) +dnl # +dnl # Returns the META VALUE associated with the given KEY_NAME_OR_REGEX expr. +dnl # +dnl # Despite their resemblance to line noise, +dnl # the "@<:@" and "@:>@" constructs are quadrigraphs for "[" and "]". +dnl # +dnl # +dnl # The "$[]1" and "$[]2" constructs prevent M4 parameter expansion +dnl # so a literal $1 and $2 will be passed to the resulting awk script, +dnl # whereas the "$1" will undergo M4 parameter expansion for the META key. +dnl # +AC_DEFUN([_SPL_AC_META_GETVAL], + [`$AWK -F ':@<:@ \t@:>@+' '$[]1 ~ /^ *$1$/ { print $[]2; exit }' $META`]dnl ) diff -Nru spl-linux-0.6.1/configure.ac spl-linux-0.6.2/configure.ac --- spl-linux-0.6.1/configure.ac 2013-03-25 20:30:22.000000000 +0000 +++ spl-linux-0.6.2/configure.ac 2013-08-16 22:17:35.000000000 +0000 @@ -28,9 +28,10 @@ AC_LANG(C) SPL_AC_META AC_CONFIG_AUX_DIR([config]) +AC_CONFIG_MACRO_DIR([config]) AC_CANONICAL_SYSTEM AM_MAINTAINER_MODE -AM_SILENT_RULES +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) AM_INIT_AUTOMAKE([$SPL_META_NAME], [$SPL_META_VERSION]) AC_CONFIG_HEADERS([spl_config.h], [ (mv spl_config.h spl_config.h.tmp && diff -Nru spl-linux-0.6.1/copy-builtin spl-linux-0.6.2/copy-builtin --- spl-linux-0.6.1/copy-builtin 2013-03-25 20:30:22.000000000 +0000 +++ spl-linux-0.6.2/copy-builtin 2013-08-16 22:17:35.000000000 +0000 @@ -33,6 +33,7 @@ cp --recursive include "$KERNEL_DIR/include/spl" cp --recursive module "$KERNEL_DIR/spl" cp spl_config.h "$KERNEL_DIR/" +cp spl.release.in "$KERNEL_DIR/" adjust_obj_paths() { diff -Nru spl-linux-0.6.1/debian/changelog spl-linux-0.6.2/debian/changelog --- spl-linux-0.6.1/debian/changelog 2013-03-27 01:44:36.000000000 +0000 +++ spl-linux-0.6.2/debian/changelog 2013-08-24 00:16:04.000000000 +0000 @@ -1,3 +1,80 @@ +spl-linux (0.6.2-1~quantal) quantal; urgency=low + + [ Jan Engelhardt ] + * build: resolve orthographic and other grammatical errors + * build: use CPPFLAGS + * gitignore: anchor entries at their respective directory + * build: do not call boilerplate ourself + + [ Brian Behlendorf ] + * Automake 1.10.1 compat: AM_SILENT_RULES + * Replace the SPL_AC_META perl dependency with awk + * Add additional dependencies for DKMS package + + [ Etienne Dechamps ] + * Fix various generic kmod RPM spec issues. + + [ Turbo Fredriksson ] + * Support .nogitrelease file + * Add --bump=0 to alien + * Ignore *.{deb,rpm,tar.gz} files in the top directory. + + [ Brian Behlendorf ] + * Add msec/usec/nsec to tick convertors + * Fix delay() + * Fix taskq_wait_id() + + [ Tim Chase ] + * Fix --enable-debug-kmem-tracking option + + [ Brian Behlendorf ] + * Add ASSERT0 and VERIFY0 macros + * Fix ASSERT0 and VERIFY0 macro typo + + [ Matthew Thode ] + * Copy spl.release.in to kernel dir + + [ Nathaniel Clark ] + * Add --buildroot option to kmod build + + [ Yuxuan Shui ] + * Linux 3.10 compat: struct vmalloc_info moved + * Linux 3.10 compat: replace PDE()->data with PDE_DATA() + * Linux 3.10 compat: add missing include of linux/slab.h + + [ Richard Yao ] + * Linux 3.10 compat: Do not rely on struct proc_dir_entry definition + + [ Brian Behlendorf ] + * Fix --enable-debug-kmem-tracking option + * Fix bogus kmem leak warning + * Improve build instructions + + [ James H ] + * Modify gethrestime to use current_kernel_time() + + [ Brian Behlendorf ] + * Return -1 for generic kmem cache shrinker + * Fix KMC_OFFSLAB type caches + * Add kmod repo integration + + [ Richard Yao ] + * Linux 3.11 compat: Replace num_physpages with totalram_pages + * Fix race in spl_kmem_cache_reap_now() + * PaX/GrSecurity Linux 3.8.y compat: Use __no_const on struct ctl_table + * Linux 3.8 compat: Use kuid_t/kgid_t when required + + [ Brian Behlendorf ] + * Tag spl-0.6.2 + + [ Darik Horn ] + * Use dh_autoreconf. + * Use dh_auto_configure. + * Revert "Set extend-diff-ignore='.*' in the debian/source/options file" + * Use the deb revision instead of the META release. + + -- Darik Horn Fri, 23 Aug 2013 19:04:40 -0500 + spl-linux (0.6.1-1~quantal) quantal; urgency=low * Initial release. diff -Nru spl-linux-0.6.1/debian/control spl-linux-0.6.2/debian/control --- spl-linux-0.6.1/debian/control 2013-03-27 01:22:37.000000000 +0000 +++ spl-linux-0.6.2/debian/control 2013-08-24 00:14:07.000000000 +0000 @@ -7,6 +7,7 @@ autogen, automake, debhelper (>= 8), + dh-autoreconf, dkms (>= 2.2.0.2), libtool, Standards-Version: 3.9.3 diff -Nru spl-linux-0.6.1/debian/rules spl-linux-0.6.2/debian/rules --- spl-linux-0.6.1/debian/rules 2013-03-27 01:22:37.000000000 +0000 +++ spl-linux-0.6.2/debian/rules 2013-08-24 00:14:07.000000000 +0000 @@ -3,16 +3,21 @@ NAME := $(shell awk '$$1 == "Name:" { print $$2; }' META) VERSION := $(shell dpkg-parsechangelog \ | awk '$$1 == "Version:" { print $$2; }' | cut -d- -f1) +REVISION := $(shell dpkg-parsechangelog \ + | awk '$$1 == "Version:" { print $$2; }' | cut -d- -f2-) + +%: + dh $@ --with autoreconf override_dh_auto_configure: @# Embed the downstream version in the module. - @sed -e 's/^Version:.*/Version: $(VERSION)/' -i.orig META - - @# Create the makefiles and configure script. - ./autogen.sh + @sed \ + -e 's/^Version:.*/Version: $(VERSION)/' \ + -e 's/^Release:.*/Release: $(REVISION)/' \ + -i.orig META @# Build the userland, but don't build the kernel modules. - ./configure --prefix=/usr --with-config=user + dh_auto_configure -- --with-config=user override_dh_auto_test: # scripts/check.sh tries insmod and rmmod, so it cannot @@ -50,6 +55,3 @@ override_dh_auto_clean: dh_auto_clean @if test -e META.orig; then mv META.orig META; fi - -%: - dh $@ diff -Nru spl-linux-0.6.1/debian/source/options spl-linux-0.6.2/debian/source/options --- spl-linux-0.6.1/debian/source/options 2013-03-27 01:22:37.000000000 +0000 +++ spl-linux-0.6.2/debian/source/options 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -extend-diff-ignore='.*' diff -Nru spl-linux-0.6.1/include/linux/proc_compat.h spl-linux-0.6.2/include/linux/proc_compat.h --- spl-linux-0.6.1/include/linux/proc_compat.h 2013-03-25 20:30:22.000000000 +0000 +++ spl-linux-0.6.2/include/linux/proc_compat.h 2013-08-16 22:17:35.000000000 +0000 @@ -43,9 +43,6 @@ #endif extern struct proc_dir_entry *proc_spl_kstat; -struct proc_dir_entry *proc_dir_entry_find(struct proc_dir_entry *root, - const char *str); -int proc_dir_entries(struct proc_dir_entry *root); int spl_proc_init(void); void spl_proc_fini(void); diff -Nru spl-linux-0.6.1/include/sys/cred.h spl-linux-0.6.2/include/sys/cred.h --- spl-linux-0.6.1/include/sys/cred.h 2013-03-25 20:30:22.000000000 +0000 +++ spl-linux-0.6.2/include/sys/cred.h 2013-08-16 22:17:35.000000000 +0000 @@ -45,6 +45,36 @@ #endif /* HAVE_CRED_STRUCT */ +#ifdef HAVE_KUIDGID_T + + /* + * Linux 3.8+ uses typedefs to redefine uid_t and gid_t. We have to rename the + * typedefs to recover the original types. We then can use them provided that + * we are careful about translating from k{g,u}id_t to the original versions + * and vice versa. + */ + #define uid_t xuid_t + #define gid_t xgid_t + #include + #undef uid_t + #undef gid_t + + #define KUID_TO_SUID(x) (__kuid_val(x)) + #define KGID_TO_SGID(x) (__kgid_val(x)) + #define SUID_TO_KUID(x) (KUIDT_INIT(x)) + #define SGID_TO_KGID(x) (KGIDT_INIT(x)) + #define KGIDP_TO_SGIDP(x) (&(x)->val) + +#else /* HAVE_KUIDGID_T */ + + #define KUID_TO_SUID(x) (x) + #define KGID_TO_SGID(x) (x) + #define SUID_TO_KUID(x) (x) + #define SGID_TO_KGID(x) (x) + #define KGIDP_TO_SGIDP(x) (x) + +#endif /* HAVE_KUIDGID_T */ + extern void crhold(cred_t *cr); extern void crfree(cred_t *cr); extern uid_t crgetuid(const cred_t *cr); diff -Nru spl-linux-0.6.1/include/sys/debug.h spl-linux-0.6.2/include/sys/debug.h --- spl-linux-0.6.1/include/sys/debug.h 2013-03-25 20:30:22.000000000 +0000 +++ spl-linux-0.6.2/include/sys/debug.h 2013-08-16 22:17:35.000000000 +0000 @@ -35,10 +35,12 @@ * ASSERT3S() - Assert signed X OP Y is true, if not panic. * ASSERT3U() - Assert unsigned X OP Y is true, if not panic. * ASSERT3P() - Assert pointer X OP Y is true, if not panic. + * ASSERT0() - Assert value is zero, if not panic. * VERIFY() - Verify X is true, if not panic. * VERIFY3S() - Verify signed X OP Y is true, if not panic. * VERIFY3U() - Verify unsigned X OP Y is true, if not panic. * VERIFY3P() - Verify pointer X OP Y is true, if not panic. + * VERIFY0() - Verify value is zero, if not panic. */ #ifndef _SPL_DEBUG_H @@ -79,10 +81,12 @@ #define VERIFY3U(x,y,z) VERIFY3_IMPL(x, y, z, uint64_t, "%llu", \ (unsigned long long)) #define VERIFY3P(x,y,z) VERIFY3_IMPL(x, y, z, uintptr_t, "%p", (void *)) +#define VERIFY0(x) VERIFY3_IMPL(0, ==, x, int64_t, "%lld", (long long)) #define ASSERT3S(x,y,z) ((void)0) #define ASSERT3U(x,y,z) ((void)0) #define ASSERT3P(x,y,z) ((void)0) +#define ASSERT0(x) ((void)0) #else /* Debugging Enabled */ @@ -130,10 +134,12 @@ #define VERIFY3U(x,y,z) VERIFY3_IMPL(x, y, z, uint64_t, "%llu", \ (unsigned long long)) #define VERIFY3P(x,y,z) VERIFY3_IMPL(x, y, z, uintptr_t, "%p", (void *)) +#define VERIFY0(x) VERIFY3_IMPL(0, ==, x, int64_t, "%lld", (long long)) #define ASSERT3S(x,y,z) VERIFY3S(x, y, z) #define ASSERT3U(x,y,z) VERIFY3U(x, y, z) #define ASSERT3P(x,y,z) VERIFY3P(x, y, z) +#define ASSERT0(x) VERIFY0(x) #define ASSERTV(x) x #define VERIFY(x) ASSERT(x) diff -Nru spl-linux-0.6.1/include/sys/kstat.h spl-linux-0.6.2/include/sys/kstat.h --- spl-linux-0.6.1/include/sys/kstat.h 2013-03-25 20:30:22.000000000 +0000 +++ spl-linux-0.6.2/include/sys/kstat.h 2013-08-16 22:17:35.000000000 +0000 @@ -83,6 +83,13 @@ typedef int kid_t; /* unique kstat id */ typedef int kstat_update_t(struct kstat_s *, int); /* dynamic update cb */ +typedef struct kstat_module { + char ksm_name[KSTAT_STRLEN+1]; /* module name */ + struct list_head ksm_module_list; /* module linkage */ + struct list_head ksm_kstat_list; /* list of kstat entries */ + struct proc_dir_entry *ksm_proc; /* proc entry */ +} kstat_module_t; + typedef struct kstat_s { int ks_magic; /* magic value */ kid_t ks_kid; /* unique kstat ID */ @@ -102,6 +109,7 @@ void *ks_private; /* private data */ kmutex_t ks_lock; /* kstat data lock */ struct list_head ks_list; /* kstat linkage */ + kstat_module_t *ks_owner; /* kstat module linkage */ } kstat_t; typedef struct kstat_named_s { diff -Nru spl-linux-0.6.1/include/sys/timer.h spl-linux-0.6.2/include/sys/timer.h --- spl-linux-0.6.1/include/sys/timer.h 2013-03-25 20:30:22.000000000 +0000 +++ spl-linux-0.6.2/include/sys/timer.h 2013-08-16 22:17:35.000000000 +0000 @@ -35,7 +35,12 @@ #define ddi_get_lbolt() ((clock_t)jiffies) #define ddi_get_lbolt64() ((int64_t)get_jiffies_64()) -#define delay(ticks) schedule_timeout((long)(ticks)) +#define delay(ticks) schedule_timeout_uninterruptible(ticks) + +#define SEC_TO_TICK(sec) ((sec) * HZ) +#define MSEC_TO_TICK(ms) msecs_to_jiffies(ms) +#define USEC_TO_TICK(us) usecs_to_jiffies(us) +#define NSEC_TO_TICK(ns) usecs_to_jiffies(ns / NSEC_PER_USEC) #endif /* _SPL_TIMER_H */ diff -Nru spl-linux-0.6.1/include/sys/vmsystm.h spl-linux-0.6.2/include/sys/vmsystm.h --- spl-linux-0.6.1/include/sys/vmsystm.h 2013-03-25 20:30:22.000000000 +0000 +++ spl-linux-0.6.2/include/sys/vmsystm.h 2013-08-16 22:17:35.000000000 +0000 @@ -41,7 +41,7 @@ */ #define membar_producer() smp_wmb() -#define physmem num_physpages +#define physmem totalram_pages #define freemem nr_free_pages() #define availrmem spl_kmem_availrmem() @@ -74,10 +74,12 @@ #ifndef HAVE_GET_VMALLOC_INFO #ifdef CONFIG_MMU +#ifndef HAVE_VMALLOC_INFO struct vmalloc_info { unsigned long used; unsigned long largest_chunk; }; +#endif typedef void (*get_vmalloc_info_t)(struct vmalloc_info *); extern get_vmalloc_info_t get_vmalloc_info_fn; diff -Nru spl-linux-0.6.1/module/.gitignore spl-linux-0.6.2/module/.gitignore --- spl-linux-0.6.1/module/.gitignore 2013-03-25 20:30:22.000000000 +0000 +++ spl-linux-0.6.2/module/.gitignore 2013-08-16 22:17:35.000000000 +0000 @@ -1,3 +1,11 @@ +*.ko +*.ko.unsigned +*.ko.out +*.ko.out.sig +*.mod.c +.*.cmd +modules.order + /.tmp_versions /Module.markers /Module.symvers diff -Nru spl-linux-0.6.1/module/spl/spl-cred.c spl-linux-0.6.2/module/spl/spl-cred.c --- spl-linux-0.6.1/module/spl/spl-cred.c 2013-03-25 20:30:22.000000000 +0000 +++ spl-linux-0.6.2/module/spl/spl-cred.c 2013-08-16 22:17:35.000000000 +0000 @@ -38,7 +38,11 @@ #else /* Implementation from 2.6.30 kernel */ static int +#ifdef HAVE_KUIDGID_T +cr_groups_search(const struct group_info *group_info, kgid_t grp) +#else cr_groups_search(const struct group_info *group_info, gid_t grp) +#endif { unsigned int left, right; @@ -49,7 +53,7 @@ right = group_info->ngroups; while (left < right) { unsigned int mid = (left+right)/2; - int cmp = grp - GROUP_AT(group_info, mid); + int cmp = KGID_TO_SGID(grp) - KGID_TO_SGID(GROUP_AT(group_info, mid)); if (cmp > 0) left = mid + 1; else if (cmp < 0) @@ -110,7 +114,7 @@ gid_t *gids; gi = get_group_info(cr->group_info); - gids = gi->blocks[0]; + gids = KGIDP_TO_SGIDP(gi->blocks[0]); put_group_info(gi); return gids; @@ -124,7 +128,7 @@ int rc; gi = get_group_info(cr->group_info); - rc = cr_groups_search(cr->group_info, gid); + rc = cr_groups_search(cr->group_info, SGID_TO_KGID(gid)); put_group_info(gi); return rc; @@ -180,7 +184,7 @@ task_lock((struct task_struct *)cr); get_group_info(cr->group_info); - gids = cr->group_info->blocks[0]; + gids = KGID_TO_SGID(cr->group_info->blocks[0]); put_group_info(cr->group_info); if (lock) @@ -215,56 +219,56 @@ uid_t crgetuid(const cred_t *cr) { - return cr->euid; + return KUID_TO_SUID(cr->euid); } /* Return the real user id */ uid_t crgetruid(const cred_t *cr) { - return cr->uid; + return KUID_TO_SUID(cr->uid); } /* Return the saved user id */ uid_t crgetsuid(const cred_t *cr) { - return cr->suid; + return KUID_TO_SUID(cr->suid); } /* Return the filesystem user id */ uid_t crgetfsuid(const cred_t *cr) { - return cr->fsuid; + return KUID_TO_SUID(cr->fsuid); } /* Return the effective group id */ gid_t crgetgid(const cred_t *cr) { - return cr->egid; + return KGID_TO_SGID(cr->egid); } /* Return the real group id */ gid_t crgetrgid(const cred_t *cr) { - return cr->gid; + return KGID_TO_SGID(cr->gid); } /* Return the saved group id */ gid_t crgetsgid(const cred_t *cr) { - return cr->sgid; + return KGID_TO_SGID(cr->sgid); } /* Return the filesystem group id */ gid_t crgetfsgid(const cred_t *cr) { - return cr->fsgid; + return KGID_TO_SGID(cr->fsgid); } EXPORT_SYMBOL(crhold); diff -Nru spl-linux-0.6.1/module/spl/spl-debug.c spl-linux-0.6.2/module/spl/spl-debug.c --- spl-linux-0.6.1/module/spl/spl-debug.c 2013-03-25 20:30:22.000000000 +0000 +++ spl-linux-0.6.2/module/spl/spl-debug.c 2013-08-16 22:17:35.000000000 +0000 @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -548,7 +549,7 @@ static int trace_max_debug_mb(void) { - return MAX(512, ((num_physpages >> (20 - PAGE_SHIFT)) * 80) / 100); + return MAX(512, ((totalram_pages >> (20 - PAGE_SHIFT)) * 80) / 100); } static struct trace_page * @@ -1188,7 +1189,7 @@ /* If spl_debug_mb is set to an invalid value or uninitialized * then just make the total buffers smp_num_cpus TCD_MAX_PAGES */ - if (max > (num_physpages >> (20 - 2 - PAGE_SHIFT)) / 5 || + if (max > (totalram_pages >> (20 - 2 - PAGE_SHIFT)) / 5 || max >= 512 || max < 0) { max = TCD_MAX_PAGES; } else { diff -Nru spl-linux-0.6.1/module/spl/spl-kmem.c spl-linux-0.6.2/module/spl/spl-kmem.c --- spl-linux-0.6.1/module/spl/spl-kmem.c 2013-03-25 20:30:22.000000000 +0000 +++ spl-linux-0.6.2/module/spl/spl-kmem.c 2013-08-16 22:17:35.000000000 +0000 @@ -403,9 +403,9 @@ spin_lock_irqsave(lock, flags); - head = &table[hash_ptr(addr, bits)]; - hlist_for_each_rcu(node, head) { - p = list_entry_rcu(node, struct kmem_debug, kd_hlist); + head = &table[hash_ptr((void *)addr, bits)]; + hlist_for_each(node, head) { + p = list_entry(node, struct kmem_debug, kd_hlist); if (p->kd_addr == addr) { hlist_del_init(&p->kd_hlist); list_del_init(&p->kd_list); @@ -497,7 +497,7 @@ dptr->kd_line = line; spin_lock_irqsave(&kmem_lock, irq_flags); - hlist_add_head_rcu(&dptr->kd_hlist, + hlist_add_head(&dptr->kd_hlist, &kmem_table[hash_ptr(ptr, KMEM_HASH_BITS)]); list_add_tail(&dptr->kd_list, &kmem_list); spin_unlock_irqrestore(&kmem_lock, irq_flags); @@ -538,10 +538,10 @@ kfree(dptr->kd_func); - memset(dptr, 0x5a, sizeof(kmem_debug_t)); + memset((void *)dptr, 0x5a, sizeof(kmem_debug_t)); kfree(dptr); - memset(ptr, 0x5a, size); + memset((void *)ptr, 0x5a, size); kfree(ptr); SEXIT; @@ -612,7 +612,7 @@ dptr->kd_line = line; spin_lock_irqsave(&vmem_lock, irq_flags); - hlist_add_head_rcu(&dptr->kd_hlist, + hlist_add_head(&dptr->kd_hlist, &vmem_table[hash_ptr(ptr, VMEM_HASH_BITS)]); list_add_tail(&dptr->kd_list, &vmem_list); spin_unlock_irqrestore(&vmem_lock, irq_flags); @@ -653,10 +653,10 @@ kfree(dptr->kd_func); - memset(dptr, 0x5a, sizeof(kmem_debug_t)); + memset((void *)dptr, 0x5a, sizeof(kmem_debug_t)); kfree(dptr); - memset(ptr, 0x5a, size); + memset((void *)ptr, 0x5a, size); vfree(ptr); SEXIT; @@ -1368,7 +1368,8 @@ if (skc->skc_flags & KMC_OFFSLAB) { *objs = SPL_KMEM_CACHE_OBJ_PER_SLAB; - *size = sizeof(spl_kmem_slab_t); + *size = P2ROUNDUP(sizeof(spl_kmem_slab_t), PAGE_SIZE); + SRETURN(0); } else { sks_size = spl_sks_size(skc); obj_size = spl_obj_size(skc); @@ -2122,7 +2123,15 @@ } up_read(&spl_kmem_cache_sem); - return (unused * sysctl_vfs_cache_pressure) / 100; + /* + * After performing reclaim always return -1 to indicate we cannot + * perform additional reclaim. This prevents shrink_slabs() from + * repeatedly invoking this generic shrinker and potentially spinning. + */ + if (sc->nr_to_scan) + return -1; + + return unused; } SPL_SHRINKER_CALLBACK_WRAPPER(spl_kmem_cache_generic_shrinker); @@ -2187,12 +2196,12 @@ /* Reclaim from the magazine then the slabs ignoring age and delay. */ if (spl_kmem_cache_expire & KMC_EXPIRE_MEM) { spl_kmem_magazine_t *skm; - int i; + unsigned long irq_flags; - for_each_online_cpu(i) { - skm = skc->skc_mag[i]; - spl_cache_flush(skc, skm, skm->skm_avail); - } + local_irq_save(irq_flags); + skm = skc->skc_mag[smp_processor_id()]; + spl_cache_flush(skc, skm, skm->skm_avail); + local_irq_restore(irq_flags); } spl_slab_reclaim(skc, count, 1); @@ -2418,13 +2427,6 @@ int rc = 0; SENTRY; - init_rwsem(&spl_kmem_cache_sem); - INIT_LIST_HEAD(&spl_kmem_cache_list); - spl_kmem_cache_taskq = taskq_create("spl_kmem_cache", - 1, maxclsyspri, 1, 32, TASKQ_PREPOPULATE); - - spl_register_shrinker(&spl_kmem_cache_shrinker); - #ifdef DEBUG_KMEM kmem_alloc_used_set(0); vmem_alloc_used_set(0); @@ -2432,12 +2434,25 @@ spl_kmem_init_tracking(&kmem_list, &kmem_lock, KMEM_TABLE_SIZE); spl_kmem_init_tracking(&vmem_list, &vmem_lock, VMEM_TABLE_SIZE); #endif + + init_rwsem(&spl_kmem_cache_sem); + INIT_LIST_HEAD(&spl_kmem_cache_list); + spl_kmem_cache_taskq = taskq_create("spl_kmem_cache", + 1, maxclsyspri, 1, 32, TASKQ_PREPOPULATE); + + spl_register_shrinker(&spl_kmem_cache_shrinker); + SRETURN(rc); } void spl_kmem_fini(void) { + SENTRY; + + spl_unregister_shrinker(&spl_kmem_cache_shrinker); + taskq_destroy(spl_kmem_cache_taskq); + #ifdef DEBUG_KMEM /* Display all unreclaimed memory addresses, including the * allocation size and the first few bytes of what's located @@ -2457,10 +2472,6 @@ spl_kmem_fini_tracking(&kmem_list, &kmem_lock); spl_kmem_fini_tracking(&vmem_list, &vmem_lock); #endif /* DEBUG_KMEM */ - SENTRY; - - spl_unregister_shrinker(&spl_kmem_cache_shrinker); - taskq_destroy(spl_kmem_cache_taskq); SEXIT; } diff -Nru spl-linux-0.6.1/module/spl/spl-kstat.c spl-linux-0.6.2/module/spl/spl-kstat.c --- spl-linux-0.6.1/module/spl/spl-kstat.c 2013-03-25 20:30:22.000000000 +0000 +++ spl-linux-0.6.2/module/spl/spl-kstat.c 2013-08-16 22:17:35.000000000 +0000 @@ -33,9 +33,12 @@ #endif #define SS_DEBUG_SUBSYS SS_KSTAT +#ifndef HAVE_PDE_DATA +#define PDE_DATA(x) (PDE(x)->data) +#endif -static spinlock_t kstat_lock; -static struct list_head kstat_list; +static kmutex_t kstat_module_lock; +static struct list_head kstat_module_list; static kid_t kstat_id; static void @@ -348,6 +351,47 @@ .stop = kstat_seq_stop, }; +static kstat_module_t * +kstat_find_module(char *name) +{ + kstat_module_t *module; + + list_for_each_entry(module, &kstat_module_list, ksm_module_list) + if (strncmp(name, module->ksm_name, KSTAT_STRLEN) == 0) + return (module); + + return (NULL); +} + +static kstat_module_t * +kstat_create_module(char *name) +{ + kstat_module_t *module; + struct proc_dir_entry *pde; + + pde = proc_mkdir(name, proc_spl_kstat); + if (pde == NULL) + return (NULL); + + module = kmem_alloc(sizeof (kstat_module_t), KM_SLEEP); + module->ksm_proc = pde; + strlcpy(module->ksm_name, name, KSTAT_STRLEN+1); + INIT_LIST_HEAD(&module->ksm_kstat_list); + list_add_tail(&module->ksm_module_list, &kstat_module_list); + + return (module); + +} + +static void +kstat_delete_module(kstat_module_t *module) +{ + ASSERT(list_empty(&module->ksm_kstat_list)); + remove_proc_entry(module->ksm_name, proc_spl_kstat); + list_del(&module->ksm_module_list); + kmem_free(module, sizeof(kstat_module_t)); +} + static int proc_kstat_open(struct inode *inode, struct file *filp) { @@ -359,7 +403,7 @@ return rc; f = filp->private_data; - f->private = PDE(inode)->data; + f->private = PDE_DATA(inode); return rc; } @@ -390,10 +434,10 @@ if (ksp == NULL) return ksp; - spin_lock(&kstat_lock); + mutex_enter(&kstat_module_lock); ksp->ks_kid = kstat_id; kstat_id++; - spin_unlock(&kstat_lock); + mutex_exit(&kstat_module_lock); ksp->ks_magic = KS_MAGIC; mutex_init(&ksp->ks_lock, NULL, MUTEX_DEFAULT, NULL); @@ -456,71 +500,64 @@ void __kstat_install(kstat_t *ksp) { - struct proc_dir_entry *de_module, *de_name; + kstat_module_t *module; kstat_t *tmp; - int rc = 0; - SENTRY; - - spin_lock(&kstat_lock); - /* Item may only be added to the list once */ - list_for_each_entry(tmp, &kstat_list, ks_list) { - if (tmp == ksp) { - spin_unlock(&kstat_lock); - SGOTO(out, rc = -EEXIST); - } - } + ASSERT(ksp); - list_add_tail(&ksp->ks_list, &kstat_list); - spin_unlock(&kstat_lock); + mutex_enter(&kstat_module_lock); - de_module = proc_dir_entry_find(proc_spl_kstat, ksp->ks_module); - if (de_module == NULL) { - de_module = proc_mkdir(ksp->ks_module, proc_spl_kstat); - if (de_module == NULL) - SGOTO(out, rc = -EUNATCH); + module = kstat_find_module(ksp->ks_module); + if (module == NULL) { + module = kstat_create_module(ksp->ks_module); + if (module == NULL) + goto out; } - de_name = create_proc_entry(ksp->ks_name, 0444, de_module); - if (de_name == NULL) - SGOTO(out, rc = -EUNATCH); + /* + * Only one entry by this name per-module, on failure the module + * shouldn't be deleted because we know it has at least one entry. + */ + list_for_each_entry(tmp, &module->ksm_kstat_list, ks_list) + if (strncmp(tmp->ks_name, ksp->ks_name, KSTAT_STRLEN) == 0) + goto out; + + list_add_tail(&ksp->ks_list, &module->ksm_kstat_list); mutex_enter(&ksp->ks_lock); - ksp->ks_proc = de_name; - de_name->proc_fops = &proc_kstat_operations; - de_name->data = (void *)ksp; + ksp->ks_owner = module; + ksp->ks_proc = proc_create_data(ksp->ks_name, 0444, + module->ksm_proc, &proc_kstat_operations, (void *)ksp); + if (ksp->ks_proc == NULL) { + list_del_init(&ksp->ks_list); + if (list_empty(&module->ksm_kstat_list)) + kstat_delete_module(module); + } mutex_exit(&ksp->ks_lock); out: - if (rc) { - spin_lock(&kstat_lock); - list_del_init(&ksp->ks_list); - spin_unlock(&kstat_lock); - } - - SEXIT; + mutex_exit(&kstat_module_lock); } EXPORT_SYMBOL(__kstat_install); void __kstat_delete(kstat_t *ksp) { - struct proc_dir_entry *de_module; + kstat_module_t *module = ksp->ks_owner; - spin_lock(&kstat_lock); - list_del_init(&ksp->ks_list); - spin_unlock(&kstat_lock); - - if (ksp->ks_proc) { - de_module = ksp->ks_proc->parent; - remove_proc_entry(ksp->ks_name, de_module); - - /* Remove top level module directory if it's empty */ - if (proc_dir_entries(de_module) == 0) - remove_proc_entry(de_module->name, de_module->parent); + mutex_enter(&kstat_module_lock); + list_del_init(&ksp->ks_list); + mutex_exit(&kstat_module_lock); + + if (ksp->ks_proc) { + remove_proc_entry(ksp->ks_name, module->ksm_proc); + + /* Remove top level module directory if it's empty */ + if (list_empty(&module->ksm_kstat_list)) + kstat_delete_module(module); } if (!(ksp->ks_flags & KSTAT_FLAG_VIRTUAL)) - kmem_free(ksp->ks_data, ksp->ks_data_size); + kmem_free(ksp->ks_data, ksp->ks_data_size); mutex_destroy(&ksp->ks_lock); kmem_free(ksp, sizeof(*ksp)); @@ -533,8 +570,8 @@ spl_kstat_init(void) { SENTRY; - spin_lock_init(&kstat_lock); - INIT_LIST_HEAD(&kstat_list); + mutex_init(&kstat_module_lock, NULL, MUTEX_DEFAULT, NULL); + INIT_LIST_HEAD(&kstat_module_list); kstat_id = 0; SRETURN(0); } @@ -543,7 +580,8 @@ spl_kstat_fini(void) { SENTRY; - ASSERT(list_empty(&kstat_list)); + ASSERT(list_empty(&kstat_module_list)); + mutex_destroy(&kstat_module_lock); SEXIT; } diff -Nru spl-linux-0.6.1/module/spl/spl-proc.c spl-linux-0.6.2/module/spl/spl-proc.c --- spl-linux-0.6.1/module/spl/spl-proc.c 2013-03-25 20:30:22.000000000 +0000 +++ spl-linux-0.6.2/module/spl/spl-proc.c 2013-08-16 22:17:35.000000000 +0000 @@ -29,6 +29,7 @@ #include #include #include +#include #include #ifdef SS_DEBUG_SUBSYS @@ -37,6 +38,12 @@ #define SS_DEBUG_SUBSYS SS_PROC +#if defined(CONSTIFY_PLUGIN) && LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0) +typedef struct ctl_table __no_const spl_ctl_table; +#else +typedef struct ctl_table spl_ctl_table; +#endif + #ifdef DEBUG_KMEM static unsigned long table_min = 0; static unsigned long table_max = ~0; @@ -323,7 +330,7 @@ SPL_PROC_HANDLER(proc_console_max_delay_cs) { int rc, max_delay_cs; - struct ctl_table dummy = *table; + spl_ctl_table dummy = *table; long d; SENTRY; @@ -355,7 +362,7 @@ SPL_PROC_HANDLER(proc_console_min_delay_cs) { int rc, min_delay_cs; - struct ctl_table dummy = *table; + spl_ctl_table dummy = *table; long d; SENTRY; @@ -387,7 +394,7 @@ SPL_PROC_HANDLER(proc_console_backoff) { int rc, backoff; - struct ctl_table dummy = *table; + spl_ctl_table dummy = *table; SENTRY; dummy.data = &backoff; @@ -417,7 +424,7 @@ { int rc = 0; unsigned long min = 0, max = ~0, val; - struct ctl_table dummy = *table; + spl_ctl_table dummy = *table; SENTRY; dummy.data = &val; @@ -444,7 +451,7 @@ { int rc = 0; unsigned long min = 0, max = ~0, val = 0, mask; - struct ctl_table dummy = *table; + spl_ctl_table dummy = *table; spl_kmem_cache_t *skc; SENTRY; @@ -1120,39 +1127,6 @@ { 0 } }; -static int -proc_dir_entry_match(int len, const char *name, struct proc_dir_entry *de) -{ - if (de->namelen != len) - return 0; - - return !memcmp(name, de->name, len); -} - -struct proc_dir_entry * -proc_dir_entry_find(struct proc_dir_entry *root, const char *str) -{ - struct proc_dir_entry *de; - - for (de = root->subdir; de; de = de->next) - if (proc_dir_entry_match(strlen(str), str, de)) - return de; - - return NULL; -} - -int -proc_dir_entries(struct proc_dir_entry *root) -{ - struct proc_dir_entry *de; - int i = 0; - - for (de = root->subdir; de; de = de->next) - i++; - - return i; -} - int spl_proc_init(void) { @@ -1174,11 +1148,11 @@ if (proc_spl_kmem == NULL) SGOTO(out, rc = -EUNATCH); - proc_spl_kmem_slab = create_proc_entry("slab", 0444, proc_spl_kmem); + proc_spl_kmem_slab = proc_create_data("slab", 0444, + proc_spl_kmem, &proc_slab_operations, NULL); if (proc_spl_kmem_slab == NULL) SGOTO(out, rc = -EUNATCH); - proc_spl_kmem_slab->proc_fops = &proc_slab_operations; #endif /* DEBUG_KMEM */ proc_spl_kstat = proc_mkdir("kstat", proc_spl); diff -Nru spl-linux-0.6.1/module/spl/spl-taskq.c spl-linux-0.6.2/module/spl/spl-taskq.c --- spl-linux-0.6.1/module/spl/spl-taskq.c 2013-03-25 20:30:22.000000000 +0000 +++ spl-linux-0.6.2/module/spl/spl-taskq.c 2013-08-16 22:17:35.000000000 +0000 @@ -342,39 +342,27 @@ SRETURN(NULL); } -/* - * The taskq_wait_id() function blocks until the passed task id completes. - * This does not guarantee that all lower task id's have completed. - */ -void -taskq_wait_id(taskq_t *tq, taskqid_t id) +static int +taskq_wait_id_check(taskq_t *tq, taskqid_t id) { - DEFINE_WAIT(wait); - taskq_ent_t *t; int active = 0; - SENTRY; - - ASSERT(tq); - ASSERT(id > 0); + int rc; spin_lock_irqsave(&tq->tq_lock, tq->tq_lock_flags); - t = taskq_find(tq, id, &active); - if (t) - prepare_to_wait(&t->tqent_waitq, &wait, TASK_UNINTERRUPTIBLE); + rc = (taskq_find(tq, id, &active) == NULL); spin_unlock_irqrestore(&tq->tq_lock, tq->tq_lock_flags); - /* - * We rely on the kernels autoremove_wake_function() function to - * remove us from the wait queue in the context of wake_up(). - * Once woken the taskq_ent_t pointer must never be accessed. - */ - if (t) { - t = NULL; - schedule(); - __set_current_state(TASK_RUNNING); - } + return (rc); +} - SEXIT; +/* + * The taskq_wait_id() function blocks until the passed task id completes. + * This does not guarantee that all lower task ids have completed. + */ +void +taskq_wait_id(taskq_t *tq, taskqid_t id) +{ + wait_event(tq->tq_wait_waitq, taskq_wait_id_check(tq, id)); } EXPORT_SYMBOL(taskq_wait_id); diff -Nru spl-linux-0.6.1/module/spl/spl-time.c spl-linux-0.6.2/module/spl/spl-time.c --- spl-linux-0.6.1/module/spl/spl-time.c 2013-03-25 20:30:22.000000000 +0000 +++ spl-linux-0.6.2/module/spl/spl-time.c 2013-08-16 22:17:35.000000000 +0000 @@ -40,11 +40,10 @@ void __gethrestime(timestruc_t *ts) { - struct timeval tv; + struct timespec tspec = current_kernel_time(); - do_gettimeofday(&tv); - ts->tv_sec = tv.tv_sec; - ts->tv_nsec = tv.tv_usec * NSEC_PER_USEC; + ts->tv_sec = tspec.tv_sec; + ts->tv_nsec = tspec.tv_nsec; } EXPORT_SYMBOL(__gethrestime); diff -Nru spl-linux-0.6.1/module/spl/spl-vnode.c spl-linux-0.6.2/module/spl/spl-vnode.c --- spl-linux-0.6.1/module/spl/spl-vnode.c 2013-03-25 20:30:22.000000000 +0000 +++ spl-linux-0.6.2/module/spl/spl-vnode.c 2013-08-16 22:17:35.000000000 +0000 @@ -24,6 +24,7 @@ * Solaris Porting Layer (SPL) Vnode Implementation. \*****************************************************************************/ +#include #include #include #include @@ -616,8 +617,8 @@ vap->va_type = vn_mode_to_vtype(stat.mode); vap->va_mode = stat.mode; - vap->va_uid = stat.uid; - vap->va_gid = stat.gid; + vap->va_uid = KUID_TO_SUID(stat.uid); + vap->va_gid = KGID_TO_SGID(stat.gid); vap->va_fsid = 0; vap->va_nodeid = stat.ino; vap->va_nlink = stat.nlink; diff -Nru spl-linux-0.6.1/module/splat/splat-atomic.c spl-linux-0.6.2/module/splat/splat-atomic.c --- spl-linux-0.6.1/module/splat/splat-atomic.c 2013-03-25 20:30:22.000000000 +0000 +++ spl-linux-0.6.2/module/splat/splat-atomic.c 2013-08-16 22:17:35.000000000 +0000 @@ -26,6 +26,7 @@ #include #include +#include #include "splat-internal.h" #define SPLAT_ATOMIC_NAME "atomic" diff -Nru spl-linux-0.6.1/module/splat/splat-kmem.c spl-linux-0.6.2/module/splat/splat-kmem.c --- spl-linux-0.6.1/module/splat/splat-kmem.c 2013-03-25 20:30:22.000000000 +0000 +++ spl-linux-0.6.2/module/splat/splat-kmem.c 2013-08-16 22:17:35.000000000 +0000 @@ -745,6 +745,7 @@ char *name = SPLAT_KMEM_TEST5_NAME; int rc; + /* On slab (default + kmem + vmem) */ rc = splat_kmem_cache_test(file, arg, name, 128, 0, 0); if (rc) return rc; @@ -753,7 +754,24 @@ if (rc) return rc; - return splat_kmem_cache_test(file, arg, name, 128, 0, KMC_VMEM); + rc = splat_kmem_cache_test(file, arg, name, 128, 0, KMC_VMEM); + if (rc) + return rc; + + /* Off slab (default + kmem + vmem) */ + rc = splat_kmem_cache_test(file, arg, name, 128, 0, KMC_OFFSLAB); + if (rc) + return rc; + + rc = splat_kmem_cache_test(file, arg, name, 128, 0, + KMC_KMEM | KMC_OFFSLAB); + if (rc) + return rc; + + rc = splat_kmem_cache_test(file, arg, name, 128, 0, + KMC_VMEM | KMC_OFFSLAB); + + return rc; } /* @@ -765,6 +783,7 @@ char *name = SPLAT_KMEM_TEST6_NAME; int rc; + /* On slab (default + kmem + vmem) */ rc = splat_kmem_cache_test(file, arg, name, 256*1024, 0, 0); if (rc) return rc; @@ -773,7 +792,24 @@ if (rc) return rc; - return splat_kmem_cache_test(file, arg, name, 1024*1024, 0, KMC_VMEM); + rc = splat_kmem_cache_test(file, arg, name, 1024*1024, 0, KMC_VMEM); + if (rc) + return rc; + + /* Off slab (default + kmem + vmem) */ + rc = splat_kmem_cache_test(file, arg, name, 256*1024, 0, KMC_OFFSLAB); + if (rc) + return rc; + + rc = splat_kmem_cache_test(file, arg, name, 64*1024, 0, + KMC_KMEM | KMC_OFFSLAB); + if (rc) + return rc; + + rc = splat_kmem_cache_test(file, arg, name, 1024*1024, 0, + KMC_VMEM | KMC_OFFSLAB); + + return rc; } /* @@ -789,6 +825,11 @@ rc = splat_kmem_cache_test(file, arg, name, 157, i, 0); if (rc) return rc; + + rc = splat_kmem_cache_test(file, arg, name, 157, i, + KMC_OFFSLAB); + if (rc) + return rc; } return rc; diff -Nru spl-linux-0.6.1/module/splat/splat-thread.c spl-linux-0.6.2/module/splat/splat-thread.c --- spl-linux-0.6.1/module/splat/splat-thread.c 2013-03-25 20:30:22.000000000 +0000 +++ spl-linux-0.6.2/module/splat/splat-thread.c 2013-08-16 22:17:35.000000000 +0000 @@ -26,6 +26,7 @@ #include #include +#include #include "splat-internal.h" #define SPLAT_THREAD_NAME "thread" diff -Nru spl-linux-0.6.1/module/splat/splat-time.c spl-linux-0.6.2/module/splat/splat-time.c --- spl-linux-0.6.1/module/splat/splat-time.c 2013-03-25 20:30:22.000000000 +0000 +++ spl-linux-0.6.2/module/splat/splat-time.c 2013-08-16 22:17:35.000000000 +0000 @@ -25,6 +25,7 @@ \*****************************************************************************/ #include +#include #include "splat-internal.h" #define SPLAT_TIME_NAME "time" diff -Nru spl-linux-0.6.1/rpm/fedora/spl-dkms.spec.in spl-linux-0.6.2/rpm/fedora/spl-dkms.spec.in --- spl-linux-0.6.1/rpm/fedora/spl-dkms.spec.in 2013-03-25 20:30:22.000000000 +0000 +++ spl-linux-0.6.2/rpm/fedora/spl-dkms.spec.in 2013-08-16 22:17:35.000000000 +0000 @@ -15,6 +15,8 @@ BuildArch: noarch Requires: dkms >= 2.2.0.2 +Requires: gcc, make, perl +Requires: kernel-devel Provides: %{module}-kmod = %{version} %description @@ -62,6 +64,7 @@ exit 0 %changelog -* Tue Mar 12 2013 Brian Behlendorf - 0.6.0-1 -- Initial dkms packaging. - +* Wed Aug 21 2013 Brian Behlendorf - 0.6.2-1 +- Released 0.6.2-1 +* Fri Mar 22 2013 Brian Behlendorf - 0.6.1-1 +- First official stable release. diff -Nru spl-linux-0.6.1/rpm/fedora/spl-kmod.spec.in spl-linux-0.6.2/rpm/fedora/spl-kmod.spec.in --- spl-linux-0.6.1/rpm/fedora/spl-kmod.spec.in 2013-03-25 20:30:22.000000000 +0000 +++ spl-linux-0.6.2/rpm/fedora/spl-kmod.spec.in 2013-08-16 22:17:35.000000000 +0000 @@ -1,6 +1,8 @@ %define module @PACKAGE@ -%define repo rpmfusion +#define repo rpmfusion +#define repo chaos +# (un)define the next line to either build for the newest or all current kernels %define buildforkernels newest #define buildforkernels current #define buildforkernels akmod @@ -23,28 +25,42 @@ URL: http://zfsonlinux.org/ Source0: %{module}-%{version}.tar.gz Source10: kmodtool - -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -ExclusiveArch: i586 i686 x86_64 - -# Likely compiles but is not supported. -ExcludeArch: ppc ppc64 +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id} -u -n) # The developments headers will conflict with the dkms packages. Conflicts: %{module}-dkms +%if %{defined repo} + +# Building for a repository use the proper build-sysbuild package +# to determine which kernel-devel packages should be installed. BuildRequires: %{_bindir}/kmodtool +%{!?kernels:BuildRequires: buildsys-build-%{repo}-kerneldevpkgs-%{?buildforkernels:%{buildforkernels}}%{!?buildforkernels:current}-%{_target_cpu}} + +%else + +# Building local packages attempt to to use the installed kernel. +%{?rhel:BuildRequires: kernel-devel} +%{?fedora:BuildRequires: kernel-devel} +%{?suse_version:BuildRequires: kernel-source} + +%if !%{defined kernels} && !%{defined build_src_rpm} + %if 0%{?rhel}%{?fedora}%{?suse_version} + %define kernels %(ls -1 /usr/src/kernels) + %else + %define kernels %(ls -1 /lib/modules) + %endif +%endif +%endif %if 0%{?fedora} >= 17 %define prefix /usr %endif -%{!?kernels:BuildRequires: buildsys-build-rpmfusion-kerneldevpkgs-%{?buildforkernels:%{buildforkernels}}%{!?buildforkernels:current}-%{_target_cpu} } - # Kmodtool does its magic here. A patched version of kmodtool is shipped -# with the source rpm until kmod development packages are supported upstream. +# because the latest versions may not be available for your distribution. # https://bugzilla.rpmfusion.org/show_bug.cgi?id=2714 -%{expand:%(sh %{SOURCE10} --target %{_target_cpu} --repo %{repo} --kmodname %{name} --devel %{?prefix:--prefix "%{?prefix}"} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null) } +%{expand:%(bash %{SOURCE10} --target %{_target_cpu} %{?repo:--repo %{?repo}} --kmodname %{name} %{?buildforkernels:--%{buildforkernels}} --devel %{?prefix:--prefix "%{?prefix}"} %{?kernels:--for-kernels "%{?kernels}"} %{?kernelbuildroot:--buildroot "%{?kernelbuildroot}"} 2>/dev/null) } %description @@ -56,7 +72,7 @@ %{?kmodtool_check} # Print kmodtool output for debugging purposes: -sh %{SOURCE10} --target %{_target_cpu} --repo %{repo} --kmodname %{name} --devel %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null +bash %{SOURCE10} --target %{_target_cpu} %{?repo:--repo %{?repo}} --kmodname %{name} %{?buildforkernels:--%{buildforkernels}} --devel %{?prefix:--prefix "%{?prefix}"} %{?kernels:--for-kernels "%{?kernels}"} %{?kernelbuildroot:--buildroot "%{?kernelbuildroot}"} 2>/dev/null %if %{with debug} %define debug --enable-debug @@ -99,18 +115,28 @@ %build for kernel_version in %{?kernel_versions}; do - pushd _kmod_build_${kernel_version%%___*} + cd _kmod_build_${kernel_version%%___*} %configure \ --with-config=kernel \ +%if 0%{?rhel}%{?fedora} --with-linux="${kernel_version##*___}" \ --with-linux-obj="${kernel_version##*___}" \ +%else + --with-linux="$( \ + if [ -e "/lib/modules/${kernel_version%%___*}/source" ]; then \ + echo "/lib/modules/${kernel_version%%___*}/source"; \ + else \ + echo "/lib/modules/${kernel_version%%___*}/build"; \ + fi)" \ + --with-linux-obj="/lib/modules/${kernel_version%%___*}/build" \ +%endif %{debug} \ %{debug_log} \ %{debug_kmem} \ %{debug_kmem_tracking} \ %{atomic_spinlocks} make %{?_smp_mflags} - popd + cd .. done @@ -119,12 +145,12 @@ # Relies on the kernel 'modules_install' make target. for kernel_version in %{?kernel_versions}; do - pushd _kmod_build_${kernel_version%%___*} + cd _kmod_build_${kernel_version%%___*} make install \ DESTDIR=${RPM_BUILD_ROOT} \ %{?prefix:INSTALL_MOD_PATH=%{?prefix}} \ INSTALL_MOD_DIR=%{kmodinstdir_postfix} - popd + cd .. done chmod u+x ${RPM_BUILD_ROOT}%{kmodinstdir_prefix}/*/extra/*/*/* %{?akmod_install} @@ -134,5 +160,7 @@ rm -rf $RPM_BUILD_ROOT %changelog -* Tue Mar 12 2013 Brian Behlendorf - 0.6.0-1 -- Initial kmods2 packaging. +* Wed Aug 21 2013 Brian Behlendorf - 0.6.2-1 +- Released 0.6.2-1 +* Tue Mar 22 2013 Brian Behlendorf - 0.6.1-1 +- First official stable release. diff -Nru spl-linux-0.6.1/rpm/fedora/spl.spec.in spl-linux-0.6.2/rpm/fedora/spl.spec.in --- spl-linux-0.6.1/rpm/fedora/spl.spec.in 2013-03-25 20:30:22.000000000 +0000 +++ spl-linux-0.6.2/rpm/fedora/spl.spec.in 2013-08-16 22:17:35.000000000 +0000 @@ -37,5 +37,7 @@ %{_mandir}/man1/* %changelog -* Tue Mar 12 2013 Brian Behlendorf - 0.6.0-1 -- Refreshed RPM packaging. +* Wed Aug 21 2013 Brian Behlendorf - 0.6.2-1 +- Released 0.6.2-1 +* Fri Mar 22 2013 Brian Behlendorf - 0.6.1-1 +- First official stable release. diff -Nru spl-linux-0.6.1/rpm/generic/spl-dkms.spec.in spl-linux-0.6.2/rpm/generic/spl-dkms.spec.in --- spl-linux-0.6.1/rpm/generic/spl-dkms.spec.in 2013-03-25 20:30:22.000000000 +0000 +++ spl-linux-0.6.2/rpm/generic/spl-dkms.spec.in 2013-08-16 22:17:35.000000000 +0000 @@ -15,6 +15,8 @@ BuildArch: noarch Requires: dkms >= 2.2.0.2 +Requires: gcc, make, perl +Requires: kernel-devel Provides: %{module}-kmod = %{version} %description @@ -62,6 +64,7 @@ exit 0 %changelog -* Tue Mar 12 2013 Brian Behlendorf - 0.6.0-1 -- Initial dkms packaging. - +* Wed Aug 21 2013 Brian Behlendorf - 0.6.2-1 +- Released 0.6.2-1 +* Fri Mar 22 2013 Brian Behlendorf - 0.6.1-1 +- First official stable release. diff -Nru spl-linux-0.6.1/rpm/generic/spl-kmod.spec.in spl-linux-0.6.2/rpm/generic/spl-kmod.spec.in --- spl-linux-0.6.1/rpm/generic/spl-kmod.spec.in 2013-03-25 20:30:22.000000000 +0000 +++ spl-linux-0.6.2/rpm/generic/spl-kmod.spec.in 2013-08-16 22:17:35.000000000 +0000 @@ -1,4 +1,11 @@ %define module @PACKAGE@ +#define repo rpmfusion +#define repo chaos + +# (un)define the next line to either build for the newest or all current kernels +%define buildforkernels newest +#define buildforkernels current +#define buildforkernels akmod %bcond_with debug %bcond_with debug_log @@ -18,17 +25,25 @@ URL: http://zfsonlinux.org/ Source0: %{module}-%{version}.tar.gz Source10: kmodtool -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id} -u -n) # The developments headers will conflict with the dkms packages. Conflicts: %{module}-dkms -# Source packages minimally require a kernel-devel dependency. +%if %{defined repo} + +# Building for a repository use the proper build-sysbuild package +# to determine which kernel-devel packages should be installed. +BuildRequires: %{_bindir}/kmodtool +%{!?kernels:BuildRequires: buildsys-build-%{repo}-kerneldevpkgs-%{?buildforkernels:%{buildforkernels}}%{!?buildforkernels:current}-%{_target_cpu}} + +%else + +# Building local packages attempt to to use the installed kernel. %{?rhel:BuildRequires: kernel-devel} %{?fedora:BuildRequires: kernel-devel} %{?suse_version:BuildRequires: kernel-source} -# Binary packages build against all installed kernels by default. %if !%{defined kernels} && !%{defined build_src_rpm} %if 0%{?rhel}%{?fedora}%{?suse_version} %define kernels %(ls -1 /usr/src/kernels) @@ -36,6 +51,7 @@ %define kernels %(ls -1 /lib/modules) %endif %endif +%endif %if 0%{?fedora} >= 17 %define prefix /usr @@ -44,7 +60,7 @@ # Kmodtool does its magic here. A patched version of kmodtool is shipped # because the latest versions may not be available for your distribution. # https://bugzilla.rpmfusion.org/show_bug.cgi?id=2714 -%{expand:%(bash %{SOURCE10} --target %{_target_cpu} --kmodname %{name} --devel %{?prefix:--prefix "%{?prefix}"} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null) } +%{expand:%(bash %{SOURCE10} --target %{_target_cpu} %{?repo:--repo %{?repo}} --kmodname %{name} %{?buildforkernels:--%{buildforkernels}} --devel %{?prefix:--prefix "%{?prefix}"} %{?kernels:--for-kernels "%{?kernels}"} %{?kernelbuildroot:--buildroot "%{?kernelbuildroot}"} 2>/dev/null) } %description @@ -56,7 +72,7 @@ %{?kmodtool_check} # Print kmodtool output for debugging purposes: -bash %{SOURCE10} --target %{_target_cpu} --kmodname %{name} --devel %{?prefix:--prefix "%{?prefix}"} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null +bash %{SOURCE10} --target %{_target_cpu} %{?repo:--repo %{?repo}} --kmodname %{name} %{?buildforkernels:--%{buildforkernels}} --devel %{?prefix:--prefix "%{?prefix}"} %{?kernels:--for-kernels "%{?kernels}"} %{?kernelbuildroot:--buildroot "%{?kernelbuildroot}"} 2>/dev/null %if %{with debug} %define debug --enable-debug @@ -106,12 +122,12 @@ --with-linux="${kernel_version##*___}" \ --with-linux-obj="${kernel_version##*___}" \ %else - --with-linux=\ - %(if [ -e /lib/modules/${kernel_version%%___*}/source ]; then \ - echo "/lib/modules/${kernel_version%%___*}/source" \ + --with-linux="$( \ + if [ -e "/lib/modules/${kernel_version%%___*}/source" ]; then \ + echo "/lib/modules/${kernel_version%%___*}/source"; \ else \ - echo "/lib/modules/${kernel_version%%___*}/build" \ - fi) \ + echo "/lib/modules/${kernel_version%%___*}/build"; \ + fi)" \ --with-linux-obj="/lib/modules/${kernel_version%%___*}/build" \ %endif %{debug} \ @@ -144,5 +160,7 @@ rm -rf $RPM_BUILD_ROOT %changelog -* Tue Mar 12 2013 Brian Behlendorf - 0.6.0-1 -- Initial kmods2 packaging. +* Wed Aug 21 2013 Brian Behlendorf - 0.6.2-1 +- Released 0.6.2-1 +* Tue Mar 22 2013 Brian Behlendorf - 0.6.1-1 +- First official stable release. diff -Nru spl-linux-0.6.1/rpm/generic/spl.spec.in spl-linux-0.6.2/rpm/generic/spl.spec.in --- spl-linux-0.6.1/rpm/generic/spl.spec.in 2013-03-25 20:30:22.000000000 +0000 +++ spl-linux-0.6.2/rpm/generic/spl.spec.in 2013-08-16 22:17:35.000000000 +0000 @@ -37,5 +37,7 @@ %{_mandir}/man1/* %changelog -* Tue Mar 12 2013 Brian Behlendorf - 0.6.0-1 -- Refreshed RPM packaging. +* Wed Aug 21 2013 Brian Behlendorf - 0.6.2-1 +- Released 0.6.2-1 +* Fri Mar 22 2013 Brian Behlendorf - 0.6.1-1 +- First official stable release. diff -Nru spl-linux-0.6.1/scripts/kmodtool spl-linux-0.6.2/scripts/kmodtool --- spl-linux-0.6.1/scripts/kmodtool 2013-03-25 20:30:22.000000000 +0000 +++ spl-linux-0.6.2/scripts/kmodtool 2013-08-16 22:17:35.000000000 +0000 @@ -37,6 +37,7 @@ prefix= filterfile= target= +buildroot= error_out() { @@ -154,9 +155,6 @@ Requires: ${kmodname}-kmod-common >= %{?epoch:%{epoch}:}%{version} Requires(post): ${prefix}/sbin/depmod Requires(postun): ${prefix}/sbin/depmod -%{?KmodsRequires:Requires: %{KmodsRequires}-uname-r = ${kernel_uname_r}} -%{?KmodsBuildRequires:BuildRequires: %{KmodsBuildRequires}-uname-r = ${kernel_uname_r}} -%{?KmodsBuildRequires:BuildRequires: %{KmodsBuildRequires}} EOF if [[ ${obsolete_name} ]]; then @@ -169,6 +167,8 @@ cat < /dev/null || : %postun -n kmod-${kmodname}-${kernel_uname_r} @@ -201,15 +201,38 @@ print_rpmtemplate_kmoddevelpkg () { + if [[ "${1}" == "--custom" ]]; then + shift + local customkernel=true + elif [[ "${1}" == "--redhat" ]]; then + shift + local redhatkernel=true + fi + + local kernel_uname_r=${1} + cat <= %{?epoch:%{epoch}:}%{version}-%{release}" + fi + + if [[ ${obsolete_name} ]]; then + echo "Provides: kmod-${obsolete_name}-devel = ${obsolete_version}" + echo "Obsoletes: kmod-${obsolete_name}-devel < ${obsolete_version}" + fi + cat < objects for the newest kernel. + %files -n kmod-${kmodname}-devel %defattr(644,root,root,755) %{_usrsrc}/${kmodname}-%{version} @@ -238,23 +261,32 @@ local kernel_uname_r=${1} local kernel_variant="${2:+-${2}}" + # first part cat <= %{?epoch:%{epoch}:}%{version}-%{release} +%{?KmodsMetaRequires:Requires: %{?KmodsMetaRequires}} EOF - + if [[ ${obsolete_name} ]]; then echo "Provides: kmod-${obsolete_name}${kernel_variant} = ${obsolete_version}" echo "Obsoletes: kmod-${obsolete_name}${kernel_variant} < ${obsolete_version}" @@ -305,9 +338,9 @@ { for kernel in ${1} do - if [[ -e "/usr/src/kernels/${kernel}" ]] ; then + if [[ -e "${buildroot}/usr/src/kernels/${kernel}" ]] ; then # this looks like a Fedora/RH kernel -- print a normal template (which includes the proper BR) and be happy :) - kernel_versions="${kernel_versions}${kernel}___%{_usrsrc}/kernels/${kernel} " + kernel_versions="${kernel_versions}${kernel}___${buildroot}%{_usrsrc}/kernels/${kernel} " # parse kernel versions string and print template local kernel_verrelarch=${kernel%%${kernels_known_variants}} @@ -315,6 +348,10 @@ # create development package if [[ "${devel}" ]]; then + # create devel package including common headers + print_rpmtemplate_kmoddevelpkg --redhat ${kernel} ${kernel##${kernel_verrelarch}} + + # create devel package print_rpmtemplate_per_kmoddevelpkg --redhat ${kernel} ${kernel##${kernel_verrelarch}} fi elif [[ -e ${prefix}/lib/modules/"${kernel}"/build/Makefile ]] ; then @@ -326,6 +363,10 @@ # create development package if [[ "${devel}" ]]; then + # create devel package including common headers + print_rpmtemplate_kmoddevelpkg --custom "${kernel}" + + # create devel package print_rpmtemplate_per_kmoddevelpkg --custom "${kernel}" fi else @@ -333,11 +374,6 @@ fi done - # create common development package - if [[ "${devel}" ]]; then - print_rpmtemplate_kmoddevelpkg "${1}" - fi - # well, it's no header anymore, but who cares ;-) print_rpmtemplate_header } @@ -365,16 +401,14 @@ # create package print_rpmtemplate_per_kmodpkg ${kernel} ${kernel##${kernel_verrelarch}} - # create development package if [[ "${devel}" ]]; then + # create devel package including common headers + print_rpmtemplate_kmoddevelpkg ${kernel} ${kernel##${kernel_verrelarch}} + + # create devel package print_rpmtemplate_per_kmoddevelpkg ${kernel} ${kernel##${kernel_verrelarch}} fi done - - # create common development package - if [[ "${devel}" ]]; then - print_rpmtemplate_kmoddevelpkg "${1}" - fi } myprog_help () @@ -382,7 +416,6 @@ echo "Usage: $(basename ${0}) [OPTIONS]" echo $'\n'"Creates a template to be used during kmod building" echo $'\n'"Available options:" - # FIXME echo " --datadir -- look for our shared files in " echo " --filterfile -- filter the results with grep --file " echo " --for-kernels -- created templates only for these kernels" echo " --kmodname -- name of the kmod (required)" @@ -390,6 +423,7 @@ echo " --noakmod -- no akmod package" echo " --repo -- use buildsys-build--kerneldevpkgs" echo " --target -- target-arch (required)" + echo " --buildroot -- Build root (place to look for build files)" } while [ "${1}" ] ; do @@ -478,6 +512,11 @@ shift build_kernels="current" ;; + --buildroot) + shift + buildroot="${1}" + shift + ;; --help) myprog_help exit 0