]> git.proxmox.com Git - mirror_spl-debian.git/log
mirror_spl-debian.git
10 years ago* linux-headers-_KVERS_ is a virtual package. Instead, depend on
Turbo Fredriksson [Tue, 21 May 2013 21:22:10 +0000 (23:22 +0200)]
* linux-headers-_KVERS_ is a virtual package. Instead, depend on
  linux-headers-_KVERS_-common AND linux-headers-_KVERS_-amd64.
* find kernel source in $KSRC and kernel objects in $KOBJ.

10 years ago* Build udebs and optionally modules package(s) - both .deb and .udeb.
Aron Xu [Fri, 12 Jul 2013 18:20:29 +0000 (02:20 +0800)]
* Build udebs and optionally modules package(s) - both .deb and .udeb.
* The spl-modules-udeb must depend on zlib-modules-udeb for zlib_deflate module.
* Files for the 'normal' module to install in the correct place.

Conflicts:
debian/changelog

10 years agoRelease to experimental
Aron Xu [Thu, 4 Jul 2013 07:59:18 +0000 (15:59 +0800)]
Release to experimental

10 years agoAdd lintian overrides
Aron Xu [Thu, 4 Jul 2013 07:42:44 +0000 (15:42 +0800)]
Add lintian overrides

10 years agoCorrect Closes entry
Aron Xu [Mon, 1 Jul 2013 14:06:17 +0000 (22:06 +0800)]
Correct Closes entry

10 years agoCorrect bracket
Aron Xu [Mon, 1 Jul 2013 14:05:48 +0000 (22:05 +0800)]
Correct bracket

10 years agoBe more detailed for GPL-2+
Aron Xu [Fri, 28 Jun 2013 17:44:43 +0000 (01:44 +0800)]
Be more detailed for GPL-2+

10 years agoCorrect upstream URL.
Aron Xu [Fri, 28 Jun 2013 17:35:50 +0000 (01:35 +0800)]
Correct upstream URL.

10 years agoUse /usr/bin/printf directly
Aron Xu [Thu, 30 May 2013 19:38:14 +0000 (03:38 +0800)]
Use /usr/bin/printf directly

We need printf from coreutils to make sure it supports byte format,
however there are shells that have which a builtin command, returning
something not as expected. There is no problem to use the path directly
since coreutils is the Priority:required so we can assume its presence.

10 years agoVarious small improvements to d/control d/compat
Aron Xu [Thu, 30 May 2013 19:10:24 +0000 (03:10 +0800)]
Various small improvements to d/control d/compat

 * Std-ver: 3.9.4
 * Add Uploaders field.
 * Increase compatible level of dh to 9, to take the advantage of
   hardening, etc.
 * Enhance the Recommends version of spl.
 * Improve long descriptions.

11 years agoForget about .pc files
Carlos Alberto Lopez Perez [Wed, 1 May 2013 15:01:25 +0000 (17:01 +0200)]
Forget about .pc files

11 years agoMerge tag 'upstream/0.6.1'
Carlos Alberto Lopez Perez [Wed, 10 Apr 2013 01:07:06 +0000 (03:07 +0200)]
Merge tag 'upstream/0.6.1'

Upstream version 0.6.1

11 years agoImported Upstream version 0.6.1
Carlos Alberto Lopez Perez [Wed, 10 Apr 2013 01:07:06 +0000 (03:07 +0200)]
Imported Upstream version 0.6.1

11 years agoRemove debuild-ppa.sh
Carlos Alberto Lopez Perez [Tue, 9 Apr 2013 10:22:49 +0000 (12:22 +0200)]
Remove debuild-ppa.sh

 * Remove the helper script for uploading to PPA.

11 years agoMerge branch 'clopez'
Aron Xu [Mon, 8 Apr 2013 08:36:44 +0000 (16:36 +0800)]
Merge branch 'clopez'

11 years agoMerge tag 'upstream/0.6.1'
Aron Xu [Mon, 8 Apr 2013 06:23:22 +0000 (14:23 +0800)]
Merge tag 'upstream/0.6.1'

Upstream version 0.6.1

Conflicts:
.gitignore
README.markdown
rpm/fedora/spl-dkms.spec.in
rpm/fedora/spl.spec.in

11 years agoImported Upstream version 0.6.1
Aron Xu [Mon, 8 Apr 2013 06:22:35 +0000 (14:22 +0800)]
Imported Upstream version 0.6.1

11 years agoFix and improve the generation of the stripped kernel source tree
Carlos Alberto Lopez Perez [Tue, 2 Apr 2013 21:00:01 +0000 (23:00 +0200)]
Fix and improve the generation of the stripped kernel source tree

  * Commit 493972c8 broke the rules used for the generation of the
    stripped kernel source tree because of the requirement of the
    rpm directory to be present for CONFIG_KERNEL
    (which is clearly not required for us).

  * Add a new rule to sed Makefile.am and manually set "SUBDIRS" to
    "module include" for CONFIG_KERNEL and remove it for the other
    configs.

    * This has the benefit that now running ./configure --with-config=user
    && make in the DKMS source tree is a nop while before it gave
    an error.

  * Improve the robustness of the rules by ensuring that they will
    abort if something is not as expected.

11 years agoReset changelog and update maintainer and vcs fields on debian/control
Carlos Alberto Lopez Perez [Tue, 2 Apr 2013 00:01:38 +0000 (02:01 +0200)]
Reset changelog and update maintainer and vcs fields on debian/control

11 years agoLower DKMS version requirements to Squeeze version.
Carlos Alberto Lopez Perez [Mon, 1 Apr 2013 23:40:05 +0000 (01:40 +0200)]
Lower DKMS version requirements to Squeeze version.

 * Squeeze DKMS version is 2.1.1.2-5

11 years agoFix debian/watch (another time)
Carlos Alberto Lopez Perez [Mon, 1 Apr 2013 23:36:42 +0000 (01:36 +0200)]
Fix debian/watch (another time)

 * Upstream is not longer using github to distribute tarballs
   * 0.6.1 tarballs were not added (as the time of writing this) to
     https://github.com/zfsonlinux/spl/downloads
 * Update the url to http://zfsonlinux.org/
 * uscan --report-status now says:
   Newest version on remote site is 0.6.1, local version is 0.6.1
   => Package is up to date

11 years agoMerge branch 'upstream'
Carlos Alberto Lopez Perez [Mon, 1 Apr 2013 23:00:20 +0000 (01:00 +0200)]
Merge branch 'upstream'

11 years agoTag spl-0.6.1
Brian Behlendorf [Mon, 25 Mar 2013 20:46:47 +0000 (13:46 -0700)]
Tag spl-0.6.1

META file and release log updated.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
11 years agoProvide ${kmodname}-devel-kmod for yum-builddep
Brian Behlendorf [Mon, 25 Mar 2013 18:18:11 +0000 (11:18 -0700)]
Provide ${kmodname}-devel-kmod for yum-builddep

In order to ensure that yum-builddep pulls in all the build
requirements a generic ${kmodname}-devel-kmod provides line is
added.  This allows a version of the development headers to be
included without requiring knowledge of the kernel version.

This is important because unlike rpmbuild which does correctly
expand the source rpm spec file, yum-builddep does not.  Without
this generic provides line mock which relies on yum-builddep is
unable to automatically satisfy the dependency.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
11 years agoUse 'git describe' for working builds
Brian Behlendorf [Fri, 22 Mar 2013 18:27:20 +0000 (11:27 -0700)]
Use 'git describe' for working builds

When building from an arbitrary commit in the git tree it's useful
for the resulting packages to be uniquely identifiable.  Therefore,
the build system has been updated to detect if your compiling in
git tree.

If you are building in a git tree, and there are commits after the
last annotated tag.  Then the <id>-<hash> component of 'git describe'
will be used to overwrite the 'Release:' field in the META file.

The only tricky part is that to ensure the 'make dist' tarball is
built using the correct release.  A dist-hook was added to the top
level make file to rewrite the META file using the correct release.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #195
Issue #111

11 years agoDo not call cond_resched() in spl_slab_reclaim()
Richard Yao [Thu, 21 Mar 2013 17:21:11 +0000 (13:21 -0400)]
Do not call cond_resched() in spl_slab_reclaim()

Calling cond_resched() after each object is freed and then after each
slab is freed can cause slabs of objects to live for excessive periods
of time following reclaimation. This interferes with the kernel's own
memory management when called from kswapd and can cause direct reclaim
to occur in response to memory pressure that should have been resolved.

Signed-off-by: Richard Yao <ryao@cs.stonybrook.edu>
11 years agoUse requested kernel for dkms builds
Brian Behlendorf [Wed, 20 Mar 2013 22:11:24 +0000 (15:11 -0700)]
Use requested kernel for dkms builds

The --with-linux and --with-linux-obj options must be specified
as part of the dkms build otherwise the package will be built
against the running kernel.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
11 years agoRemove spl-dkms conflict with spl-kmod
Brian Behlendorf [Wed, 20 Mar 2013 18:33:15 +0000 (11:33 -0700)]
Remove spl-dkms conflict with spl-kmod

Because the spl-dkms package also provides spl-kmod for the
spl user package yum flags this as a conflict.  To avoid the
problem remove the Conflicts tag from spl-dkms and just rely
on the one in spl-kmod.

  spl-dkms-0.6.0-rc14.fc18.noarch has installed conflicts
    spl-kmod: spl-dkms-0.6.0-rc14.fc18.noarch

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
11 years agoCreate splat man page
Darik Horn [Fri, 15 Mar 2013 19:25:32 +0000 (12:25 -0700)]
Create splat man page

The automake templates have been updated to install this man
page and the existing packaging was updated to include it.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
11 years agoRefresh RPM packaging
Brian Behlendorf [Fri, 8 Feb 2013 19:02:08 +0000 (11:02 -0800)]
Refresh RPM packaging

Refresh the existing RPM packaging to conform to the 'Fedora
Packaging Guidelines'.  This includes adopting the kmods2
packaging standard which is used fod kmods distributed by
rpmfusion for Fedora/RHEL.

  http://fedoraproject.org/wiki/Packaging:Guidelines
  http://rpmfusion.org/Packaging/KernelModules/Kmods2

While the spec files have been entirely rewritten from a
user perspective the only major changes are:

* The Fedora packages now have a build dependency on the
  rpmfusion repositories.  The generic kmod packages also
  have a new dependency on kmodtool-1.22 but it is bundled
  with the source rpm so no additional packages are needed.

* The kernel binary module packages have been renamed from
  spl-modules-* to kmod-spl-* as specificed by kmods2.

* The is now a common kmod-spl-devel-* package in addition
  to the per-kernel devel packages.  The common package
  contains the development headers while the per-kernel
  package contains kernel specific build products.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #222

11 years agoFix debian/watch
Carlos Alberto Lopez Perez [Sat, 16 Mar 2013 22:52:23 +0000 (23:52 +0100)]
Fix debian/watch

  * Only report non-rc versions.
  * uscan --report-status now says:
      Newest version on remote site is 0.5.2

11 years agoDelete void spl-dkms.prerm
Carlos Alberto Lopez Perez [Sat, 16 Mar 2013 20:48:27 +0000 (21:48 +0100)]
Delete void spl-dkms.prerm

  * There is not need to have empty skeleton {pre,post}{inst,rm} files
  * debhelper will create this at build time automatically when needed

  * debhelper(7)

    Automatic generation of debian install scripts:

       Some debhelper commands will automatically generate parts of debian
       maintainer scripts. If you want these automatically generated things
       included in your existing debian maintainer scripts, then you need to
       add "#DEBHELPER#" to your scripts, in the place the code should be
       added.  "#DEBHELPER#" will be replaced by any auto-generated code when
       you run dh_installdeb.

       If a script does not exist at all and debhelper needs to add something
       to it, then debhelper will create the complete script.

11 years agoChange spl-kmod-devel install path
Brian Behlendorf [Wed, 20 Feb 2013 21:58:05 +0000 (13:58 -0800)]
Change spl-kmod-devel install path

Install the common spl kernel development headers under
/usr/src/spl-<version>/ rather than in a kernel specific
directory.  The kernel specific build products such as
spl_config.h and Modules.symvers are left installed under
/usr/src/spl-<version>/<kernel>.

This was done to be consistent with where dkms expects
kernel module source to be packaged.  It also allows for
a common spl-kmod-devel package which includes the headers,
and per-kernel spl-kmod-devel-<kernel> packages.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
11 years agoMerge branch 'linux-3.9'
Brian Behlendorf [Thu, 14 Mar 2013 17:43:46 +0000 (10:43 -0700)]
Merge branch 'linux-3.9'

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #221

11 years agoLinux 3.9 compat: Switch to hlist_for_each{,_rcu}
Richard Yao [Mon, 4 Mar 2013 20:17:03 +0000 (15:17 -0500)]
Linux 3.9 compat: Switch to hlist_for_each{,_rcu}

torvalds/linux@b67bfe0d42cac56c512dd5da4b1b347a23f4b70a changed
hlist_for_each_entry{,_rcu} to take 3 arguments instead of 4. We handle
this by switching to hlist_for_each{,_rcu}, which works across all
supported kernels.

Signed-off-by: Richard Yao <ryao@cs.stonybrook.edu>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
11 years agoDrop support for 3 argument version of set_fs_pwd
Richard Yao [Tue, 12 Mar 2013 02:02:45 +0000 (22:02 -0400)]
Drop support for 3 argument version of set_fs_pwd

This was a suggestion that Brian Behlendorf made when reviewing an early
pull request for Linux 3.9 support. This commit was made intentionally
easy to revert should we ever have a reason to reintroduce support for
older kernels.

Signed-off-by: Richard Yao <ryao@cs.stonybrook.edu>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
11 years agoLinux 3.9 compat: set_fs_root takes const struct path *
Richard Yao [Mon, 4 Mar 2013 05:24:04 +0000 (00:24 -0500)]
Linux 3.9 compat: set_fs_root takes const struct path *

torvalds/linux@dcf787f39162ce32ca325b3e784aba2d2444619a enforces
const-correctness in passing struct path *.

Signed-off-by: Richard Yao <ryao@cs.stonybrook.edu>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
11 years agoLinux 3.9 compat: vfs_getattr takes two arguments
Richard Yao [Mon, 4 Mar 2013 05:02:43 +0000 (00:02 -0500)]
Linux 3.9 compat: vfs_getattr takes two arguments

The function prototype of vfs_getattr previoulsy took struct vfsmount *
and struct dentry * as arguments. These would always be defined together
in a struct path *.

torvalds/linux@3dadecce20603aa380023c65e6f55f108fd5e952 modified
vfs_getattr to take struct path * is taken as an argument instead.

Signed-off-by: Richard Yao <ryao@cs.stonybrook.edu>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
11 years agoLinux 3.9 compat: Do not depend on f_vfsmnt
Richard Yao [Mon, 4 Mar 2013 04:45:33 +0000 (23:45 -0500)]
Linux 3.9 compat: Do not depend on f_vfsmnt

torvalds/linux@182be684784334598eee1d90274e7f7aa0063616 removed the
preprocessor definition for f_vfsmnt. The ability to access the
mountpoint via ->f_path.mnt has been stable for a long time, so we
switch to that.

Signed-off-by: Richard Yao <ryao@cs.stonybrook.edu>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
11 years agoLinux 3.9 compat: Include linux/sched/rt.h
Richard Yao [Mon, 4 Mar 2013 04:42:32 +0000 (23:42 -0500)]
Linux 3.9 compat: Include linux/sched/rt.h

Linux 3.9 reorganized sched.h, splitting it into numerous files.
torvalds/linux@8bd75c77b7c6a3954140dd2e20346aef3efe4a35 moved MAX_PRIO
and MAX_RT_PRIO to linux/sched/rt.h.

Signed-off-by: Richard Yao <ryao@cs.stonybrook.edu>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
11 years agoMerge branch 'build-system'
Brian Behlendorf [Wed, 6 Mar 2013 23:49:57 +0000 (15:49 -0800)]
Merge branch 'build-system'

11 years agoRefresh links to web site
Ned Bass [Tue, 5 Mar 2013 01:26:55 +0000 (17:26 -0800)]
Refresh links to web site

Update links to refer to the official ZFS on Linux website instead of
@behlendorf's personal fork on github.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
11 years agoRemove ARCH packaging
Brian Behlendorf [Sat, 16 Feb 2013 23:32:08 +0000 (15:32 -0800)]
Remove ARCH packaging

The kernel modules are now available in the Arch User Repository
(AUR) via zfs.  Since their packaging is maintained and superior
to ours it is being removed from the tree.

  https://wiki.archlinux.org/index.php/ZFS

Now that various distributions are picking up the packages we
should eventually be able to remove most of this infrastructure.
Packaging belongs with the distributions not upstream.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
11 years agoImprove wording for package descriptions
Carlos Alberto Lopez Perez [Sat, 2 Mar 2013 22:36:30 +0000 (23:36 +0100)]
Improve wording for package descriptions

     * This matchs the description of the ITP

11 years agoRemove 0001-Revert-Remove-etc-hostid-missing-warning.patch patch
Carlos Alberto Lopez Perez [Sat, 2 Mar 2013 21:50:43 +0000 (22:50 +0100)]
Remove 0001-Revert-Remove-etc-hostid-missing-warning.patch patch

 * The previous commit (cfeaec5) ensured that /etc/hostid will exist
   on the system after the package is installed.

 * Therefore remove this patch that warns about the non existence of
   such file.

11 years agoFix the way we handle /etc/hostid
Carlos Alberto Lopez Perez [Sat, 2 Mar 2013 21:48:42 +0000 (22:48 +0100)]
Fix the way we handle /etc/hostid

  * /etc/hostid should not be a configuration file.
    This is by policy:
    E.2 Fully-featured maintainer script configuration handling
    http://www.debian.org/doc/debian-policy/ap-pkg-conffiles.html

    This kind of site-specific configuration files should not be added
    to the package files.
    You don't want this file to be removed when you purge the package.

  * Handle the creation on /etc/hostid on zfs-dkms.postinst

    * Check if /etc/hostid exists and is at least 4 bytes size.

      * If it isn't, then write the value returned by "hostid" on /etc/hostid
        taking care of endianness

    * Note that on zfs-dkms.postinst #DEBHELPER# is after this check for
      /etc/hostid. Therefore the stabilization of /etc/hostid will be
      done before the spl mode is built by DKMS.

11 years agoRemove custom install-data-local for headers
Brian Behlendorf [Wed, 13 Feb 2013 22:01:00 +0000 (14:01 -0800)]
Remove custom install-data-local for headers

Rather than use a custom install target it is cleaner to define
a 'kerneldir' and set 'kernel_HEADERS' appropriately.  This
allows us to leverage the standing configure install support.

Additionally, I took this opertunity add the missing make files
to the include subdirectories.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
11 years agoAdd KMODDIR to install target
Brian Behlendorf [Tue, 12 Feb 2013 23:56:02 +0000 (15:56 -0800)]
Add KMODDIR to install target

Provide a mechanism to control the directory name the modules
are installed in.  The kernel privdes INSTALL_MOD_DIR for
this but it was hardcoded to be 'addon/spl'.

Add a KMODDIR variable which can be passed to 'make install'
to override the default directory name.  While we're here
change the default from 'addon/spl' to 'extra' which is the
kernel.org default.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
11 years agoFix spl_config.h install permissions
Brian Behlendorf [Fri, 8 Feb 2013 21:54:24 +0000 (13:54 -0800)]
Fix spl_config.h install permissions

The default permissions used by install are 755.  Since this
file isn't executable 644 is more appropriate.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
11 years agoRemove INSTALL
Brian Behlendorf [Fri, 8 Feb 2013 20:17:18 +0000 (12:17 -0800)]
Remove INSTALL

The generic INSTALL instructions can be safely dropped.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
11 years agoExplicity select what is copied inside the DKMS source tree
Carlos Alberto Lopez Perez [Wed, 20 Feb 2013 22:06:48 +0000 (23:06 +0100)]
Explicity select what is copied inside the DKMS source tree

 * We use the variable DKMSFILES to explicity select wich files
   or directories are copied inside the DKMS source tree.

 * Once copied. We rewrite configure.ac with awk to remove the
   userland/misc components and only keep the kernel stuff that
   is needed by DKMS.

   * The awk lines deletes from inside AC_CONFIG_FILES([]) of configure.ac
     everything except:
(Makefile$|include/|module/|*.release$|dkms.conf$)

   * Then we run ./autogen.sh to generate the configure scripts
     inside the DKMS source tree

 * This allows us to ship a clean DKMS source tree with *only* the kernel
   components and free from the userland/misc ones (ex: splat)

    * Prevents manual build on the DKMS source tree.

11 years agoUse dh --with dkms
Carlos Alberto Lopez Perez [Wed, 20 Feb 2013 20:57:26 +0000 (21:57 +0100)]
Use dh --with dkms

11 years agoUse $(MAKE) instead of make:
Carlos Alberto Lopez Perez [Wed, 20 Feb 2013 20:48:53 +0000 (21:48 +0100)]
Use $(MAKE) instead of make:

 * This allows the environment variables (MAKEFLAGS) and arguments
   to be correctly inherited by the submakes.

11 years agoDisable automatic log dumping
Brian Behlendorf [Tue, 5 Feb 2013 23:59:36 +0000 (15:59 -0800)]
Disable automatic log dumping

Long ago infrastructure was added to the SPL to keep an internal
debug log of the last few seconds of activity.  This was helpful
during the early development, but these days it is no longer
needed.  I haven't had to resort to this debug buffer to resolve
an issue for several years now.

Today better more generic tools like systemtap and ftrace have
evolved to the point where they can be used for this purpose.
Along with the stack trace dumped to the system console, and in
rare cases a crash dump we almost always have the debug we need.

Therefore, I'm disabling the code which automatically dumps
this log to disk during an assertion except for the case where
spl_debug_panic_on_bug is set (disabled by default).

This should be viewed as a first step towards either.

  a) Retiring this infrastructure and complexity entirely, or
  b) Integrating this logging more properly with ftrace.

As part of this change I'm also removing from the packages the
undocumented spl utility which is used to decode the binary logs.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
11 years agoFix HAVE_MUTEX_OWNER_TASK_STRUCT autotools check on PPC64
Richard Yao [Tue, 5 Feb 2013 21:42:29 +0000 (16:42 -0500)]
Fix HAVE_MUTEX_OWNER_TASK_STRUCT autotools check on PPC64

The HAVE_MUTEX_OWNER_TASK_STRUCT fails on PPC64 with the following
error:

error: 'current' undeclared (first use in this function)

We include linux/sched.h to ensure that current is available.

Signed-off-by: Richard Yao <ryao@cs.stonybrook.edu>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
11 years agoFix atomic64_* autoconf checks
Brian Behlendorf [Tue, 5 Feb 2013 17:35:43 +0000 (09:35 -0800)]
Fix atomic64_* autoconf checks

The SPL_AC_ATOMIC_SPINLOCK, SPL_AC_TYPE_ATOMIC64_CMPXCHG, and
SPL_AC_TYPE_ATOMIC64_XCHG were all directly including the
'asm/atomic.h' header.  As of Linux 3.4 this header was removed
which results in a build failure.

The right thing to do is include 'linux/atomic.h' however we
can't safely do this because it doesn't exist in 2.6.26 kernels.
Therefore, we include 'linux/fs.h' which in turn includes the
correct atomic header regardless of the kernel version.

When these incorrect APIs are used in ZFS the following build
failure results.

  arc.c:791:80: warning: '__ret' may be used uninitialized
  in this function [-Wuninitialized]
  arc.c:791:1875: error: call to '__cmpxchg_wrong_size'
  declared with attribute error: Bad argument size for cmpxchg

Since this is all Linux 2.6.24 compatibility code there's
an argument to be made that it should be removed because
kernels this old are not supported.  However, because we're
so close to a release I'm going to leave it in place for now.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes zfsonlinux/zfs#814
Closes zfsonlinux/zfs#1254

11 years agoPPA 0.6.0.97-0ubuntu1 release. (rc14)
Darik Horn [Mon, 4 Feb 2013 03:59:49 +0000 (21:59 -0600)]
PPA 0.6.0.97-0ubuntu1 release. (rc14)

Bump the version number to reset the builders.

Closes: zfsonlinux/zfs#1258
11 years agoPPA 0.6.0.96-0ubuntu1 release. (rc14)
Darik Horn [Sat, 2 Feb 2013 21:13:08 +0000 (15:13 -0600)]
PPA 0.6.0.96-0ubuntu1 release. (rc14)

11 years agoMerge branch 'upstream'
Darik Horn [Sat, 2 Feb 2013 21:11:39 +0000 (15:11 -0600)]
Merge branch 'upstream'

11 years agoSPL 0.6.0-rc14
Brian Behlendorf [Fri, 1 Feb 2013 19:24:54 +0000 (11:24 -0800)]
SPL 0.6.0-rc14

11 years agoFix tsd_get/set() race with tsd_exit/destroy()
Brian Behlendorf [Thu, 31 Jan 2013 20:59:39 +0000 (12:59 -0800)]
Fix tsd_get/set() race with tsd_exit/destroy()

The tsd_exit() and tsd_destroy() functions remove entries from
hash bins without taking the hash bin lock.  They do take the
table lock, but tsd_get() and tsd_set() only take the hash bin
lock to allow for maximum concurency.

The result is that while tsd_get() and tsd_set() are traversing
the hash bin list it can be modified by another thread in which
happens to hash to the same value.  To avoid this add the needed
locking to tsd_exit() and tsd_destroy().

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #174

11 years agoCheck for KALLSYMS
Brian Behlendorf [Wed, 30 Jan 2013 00:13:07 +0000 (16:13 -0800)]
Check for KALLSYMS

Check at ./configure time that the kernel was built with kallsyms
support.  If the kernel doesn't have CONFIG_KALLSYMS defined the
modules will still compile cleanly but will not be loadable.  So
we really want to catch this early during ./configure.  Note that
we do not require CONFIG_KALLSYMS_ALL but it may be safely defined.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6

11 years agoDefine BE_IN16 & BE_IN32 for lz4 compression
Eric Dillmann [Mon, 28 Jan 2013 22:48:11 +0000 (23:48 +0100)]
Define BE_IN16 & BE_IN32 for lz4 compression

The new lz4 compression algorithm, zfsonlinux/zfs@9759c60, requires
the generic BE_IN16 and BE_IN32 functions.  These are added to the SPL
for other consumers to take advantage of.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
11 years agoAdd spl_kmem_cache_expire module option
Brian Behlendorf [Fri, 18 Jan 2013 23:44:27 +0000 (15:44 -0800)]
Add spl_kmem_cache_expire module option

Cache aging was implemented because it was part of the default Solaris
kmem_cache behavior.  The idea is that per-cpu objects which haven't been
accessed in several seconds should be returned to the cache.  On the other
hand Linux slabs never move objects back to the slabs unless there is
memory pressure on the system.

This behavior is now configurable through the 'spl_kmem_cache_expire'
module option.  The value is a bit mask with the following meaning.

  0x1 - Solaris style cache aging eviction is enabled.
  0x2 - Linux style low memory eviction is enabled.

Both methods may be safely enabled simultaneously, but by default
both are disabled.  It has never been clear if the kmem cache aging
(which has been around from day one) actually does any good.  It has
however been the source of numerous bugs so I wouldn't mind retiring
it entirely.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes zfsonlinux/zfs#1227
Closes #210

11 years agoPPA 0.6.0.95-0ubuntu1 release.
Darik Horn [Sat, 26 Jan 2013 20:51:28 +0000 (14:51 -0600)]
PPA 0.6.0.95-0ubuntu1 release.

11 years agoPPA 0.6.0.94-0ubuntu1 release.
Darik Horn [Thu, 24 Jan 2013 04:32:51 +0000 (22:32 -0600)]
PPA 0.6.0.94-0ubuntu1 release.

11 years agoPPA 0.6.0.93-0ubuntu1 release.
Darik Horn [Sat, 19 Jan 2013 03:54:06 +0000 (21:54 -0600)]
PPA 0.6.0.93-0ubuntu1 release.

11 years agoMerge branch 'upstream'
Darik Horn [Sat, 19 Jan 2013 03:53:12 +0000 (21:53 -0600)]
Merge branch 'upstream'

11 years agoRemove spl_invalidate_inodes()
Brian Behlendorf [Thu, 17 Jan 2013 19:33:24 +0000 (11:33 -0800)]
Remove spl_invalidate_inodes()

This functionality is no longer required by ZFS, see commit
zfsonlinux/zfs@7b3e34ba5a7ee8d0fda44d214f6f11eb16cdb26f.
Since there are no other consumers, and because it adds
additional autoconf complexity which must be maintained
the spl_invalidate_inodes() function has been removed.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue zfsonlinux/zfs#795

11 years agoPPA 0.6.0.92-0ubuntu1 release.
Darik Horn [Tue, 15 Jan 2013 01:01:27 +0000 (19:01 -0600)]
PPA 0.6.0.92-0ubuntu1 release.

11 years agoMerge branch 'upstream'
Darik Horn [Tue, 15 Jan 2013 00:55:59 +0000 (18:55 -0600)]
Merge branch 'upstream'

11 years agokmem-cache: Fix slab ageing soft lockup
Brian Behlendorf [Fri, 11 Jan 2013 22:29:32 +0000 (14:29 -0800)]
kmem-cache: Fix slab ageing soft lockup

Commit a10287e00d13c4c4dbbff14f42b00b03da363fcb slightly reworked
the slab ageing code such that it is no longer dependent on the
Linux delayed work queue interfaces.

This was good for portability and performance, but it requires us
to use the on_each_cpu() function to execute the spl_magazine_age()
function.  That means that the function is now executing in interrupt
context whereas before it was scheduled in normal process context.
And that means we need to be slightly more careful about the locking
in the interrupt handler.

With the reworked code it's possible that we'll be holding the
skc->skc_lock and be interrupted to handle the spl_magazine_age()
IRQ.  This will result in a deadlock and soft lockup errors unless
we're careful to detect the contention and avoid taking the lock in
the interupt handler.  So that's what this patch does.

Alternately, (and slightly more conventionally) we could have used
spin_lock_irqsave() to prevent this race entirely but I'd perfer to
avoid disabling interrupts as much as possible due to performance
concerns.  There is absolutely no penalty for us not aging objects
out of the magazine due to contention.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Prakash Surya <surya1@llnl.gov>
Closes zfsonlinux/zfs#1193

11 years agocall_usermodehelper() should wait for process
Ned Bass [Thu, 10 Jan 2013 00:09:47 +0000 (16:09 -0800)]
call_usermodehelper() should wait for process

As of Linux 3.4 the UMH_WAIT_* constants were renumbered.  In
particular, the meaning of "1" changed from UMH_WAIT_PROC (wait for
process to complete), to UMH_WAIT_EXEC (wait for the exec, but not the
process).  A number of call sites used the number 1 instead of the
constant name, so the behavior was not as expected on kernels with
this change.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
11 years agoCheck for ZLIB_INFLATE and ZLIB_DEFLATE
Brian Behlendorf [Wed, 9 Jan 2013 23:26:46 +0000 (15:26 -0800)]
Check for ZLIB_INFLATE and ZLIB_DEFLATE

Check at ./configure time that the kernel was built with zlib
support enabled.  This support may either be configured as a
module or builtin to the kernel.  But if it's missing the build
will fail so it's best to catch this early.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes zfsonlinux/zfs#582

11 years agoLinux compat 3.7.1, on_each_cpu()
Brian Behlendorf [Mon, 7 Jan 2013 22:09:09 +0000 (14:09 -0800)]
Linux compat 3.7.1, on_each_cpu()

Some kernels require that we include the 'linux/irqflags.h'
header for the SPL_AC_3ARGS_ON_EACH_CPU check.  Otherwise,
the functions local_irq_enable()/local_irq_disable() will not
be defined and the prototype will be misdetected as the four
argument version.

This change actually include 'linux/interrupt.h' which in turn
includes 'linux/irqflags.h' to be as generic as possible.

Additionally, passing NULL as the function can result in a
gcc error because the on_each_cpu() macro executes it
unconditionally.  To make the test more robust we pass the
dummy function on_each_cpu_func().

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #204

11 years agoRHEL 6.4 compat, fallocate()
Brian Behlendorf [Tue, 8 Jan 2013 17:42:49 +0000 (09:42 -0800)]
RHEL 6.4 compat, fallocate()

In the upstream kernel the FALLOC_FL_PUNCH_HOLE #define was
introduced after the fallocate() function was moved from the
inode_operations to the file_operations structure.  Therefore,
the SPL code assumed that if FALLOC_FL_PUNCH_HOLE was defined
it was safe to use f_ops->fallocate().

Unfortunately, the RHEL6.4 kernel has only backported the
FALLOC_FL_PUNCH_HOLE #define and not the fallocate() change.

To address this compatibility issue the spl_filp_fallocate()
helper function was added to properly detect which interface
is available.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
11 years agoAdd cv_wait_io() to account I/O time
Matt Johnston [Fri, 21 Dec 2012 02:29:16 +0000 (10:29 +0800)]
Add cv_wait_io() to account I/O time

Under Linux when a task is waiting on I/O it should call the
io_schedule() function for proper accounting.  The Solaris
cv_wait() function provides no way to specify what the cv
is waiting on therefore cv_wait_io() is introduced.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #206

11 years agoPPA 0.6.0.91-0ubuntu1 release. (rc13)
Darik Horn [Fri, 21 Dec 2012 03:12:38 +0000 (21:12 -0600)]
PPA 0.6.0.91-0ubuntu1 release. (rc13)

11 years agoDelete patch 0002 for RPM builds.
Darik Horn [Fri, 21 Dec 2012 03:07:54 +0000 (21:07 -0600)]
Delete patch 0002 for RPM builds.

`0002-Revert-Revert-Stabilize-the-hostid-for-RPM-installations.patch`
is for long obsolete RPM builds and unnecessary for DEB builds.

11 years agoMerge branch 'upstream'
Darik Horn [Fri, 21 Dec 2012 03:04:02 +0000 (21:04 -0600)]
Merge branch 'upstream'

11 years agoSPL 0.6.0-rc13
Brian Behlendorf [Thu, 20 Dec 2012 19:01:47 +0000 (11:01 -0800)]
SPL 0.6.0-rc13

11 years agoRefresh AUTHORS
Brian Behlendorf [Wed, 19 Dec 2012 17:37:24 +0000 (09:37 -0800)]
Refresh AUTHORS

The AUTHORS file was getting stale.  Refresh its contents
using the authors listed in the git commit logs.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
11 years agoRemove the ChangeLog
Brian Behlendorf [Wed, 19 Dec 2012 17:28:18 +0000 (09:28 -0800)]
Remove the ChangeLog

The ChangeLog was retired long ago, the git commit logs are
authoritative.  To avoid any confusion remove the ChangeLog.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
11 years agoFix spl_kmem_init_kallsyms_lookup() panic
Brian Behlendorf [Wed, 19 Dec 2012 01:02:27 +0000 (17:02 -0800)]
Fix spl_kmem_init_kallsyms_lookup() panic

Due to I/O buffering the helper may return successfully before
the proc handler has a chance to execute.  To catch this case
wait up to 1 second to verify spl_kallsyms_lookup_name_fn was
updated to a non SYMBOL_POISON value.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes zfsonlinux/zfs#699
Closes zfsonlinux/zfs#859

11 years agoDo not use KERNEL_DIR env var in Makefile.am
Richard Yao [Mon, 17 Dec 2012 17:43:45 +0000 (09:43 -0800)]
Do not use KERNEL_DIR env var in Makefile.am

A Gentoo user reported an issue where the build system would
attempt to recurse into the kernel source tree if KERNEL_DIR
is set in the environment. KERNEL_DIR is an environment variable
that is used when the kernel sources are in a non-standard
location, so it is necessary to stop relying on it to prevent
this issue.

https://bugs.gentoo.org/show_bug.cgi?id=433946

Signed-off-by: Richard Yao <ryao@cs.stonybrook.edu>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
11 years agoPPA 0.6.0.90-0ubuntu1 release.
Darik Horn [Sat, 15 Dec 2012 21:32:50 +0000 (15:32 -0600)]
PPA 0.6.0.90-0ubuntu1 release.

11 years agoMerge branch 'upstream'
Darik Horn [Sat, 15 Dec 2012 21:31:45 +0000 (15:31 -0600)]
Merge branch 'upstream'

11 years agoMerge branch 'taskq'
Brian Behlendorf [Wed, 12 Dec 2012 18:45:11 +0000 (10:45 -0800)]
Merge branch 'taskq'

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #199

11 years agoRemoved SPL_AC_3ARGS_INIT_WORK check
Brian Behlendorf [Mon, 10 Dec 2012 21:53:25 +0000 (13:53 -0800)]
Removed SPL_AC_3ARGS_INIT_WORK check

All consumers of the kernel delayed work queues have been shifted
over to rely on the taskq implementation.  This compatibility code
can now be removed.  Any new callers which need this functionality
should use the taskq interfaces for delayed work items.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
11 years agokmem-cache: Use a taskq for async allocations
Brian Behlendorf [Mon, 10 Dec 2012 21:40:03 +0000 (13:40 -0800)]
kmem-cache: Use a taskq for async allocations

Shift the asynchronous allocations over to use the taskq interfaces.
This allows us to abandon the kernels delayed work queue interface
and all the compatibility code it requires.

This code never actually used the delay functionality it was just
done this way to leverage the existing compatibility code.  All that
is required is a thread context to perform the allocation in.  The
only thing clever in this change is that we take advantage of the
preallocated task queue entries to avoid a memory allocation.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
11 years agokmem-cache: Use taskqs for ageing
Brian Behlendorf [Mon, 10 Dec 2012 18:53:46 +0000 (10:53 -0800)]
kmem-cache: Use taskqs for ageing

Shift the cache and magazine ageing functionality over to the new
delayed taskq interfaces.  This allows us to abandon the kernels
delayed work queue interface and all the compatibility code it
requires.

However, the delayed taskq interface does not allow us to schedule
a task for a specfic cpu so the ageing code was slightly reworked.
The magazine ageing delay has been directly linked to the cache
ageing function.  The spl_cache_age() function invokes on_each_cpu()
in order to run spl_magazine_age() on each cpu.  It then blocks
waiting for them to complete and promptly reclaims any free slabs.

When restructing the code wasn't the primary goal I think the
new code is far more understable and maintainable.  It also should
help minimize magazine thrashing because free slabs are immediately
released after the magazine is aged.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
11 years agokmem-cache: spl_kmem_cache_create() may always sleep
Brian Behlendorf [Mon, 10 Dec 2012 19:01:08 +0000 (11:01 -0800)]
kmem-cache: spl_kmem_cache_create() may always sleep

When this code was originally written I went overboard and allowed
for the possibility of creating a cache in an atomic context.  In
practice there are no callers which ever do this.  This makes sense
since a cache is by design a long lived data structure.

To prevent abuse of this function going forward I'm removing the
code which is supported to handle an atomic context.  All allocators
have been updated to use KM_SLEEP and the might_sleep() debug macro
has been added to immediately detect atomic callers.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
11 years agosplat taskq:front: Reduce stack frame
Brian Behlendorf [Mon, 10 Dec 2012 23:27:05 +0000 (15:27 -0800)]
splat taskq:front: Reduce stack frame

The slightly increased size of the taskq_ent_t when debugging is
enabled has pushed the taskq:front splat test over frame size
limit.  To resolve this dynamically allocate the taskq_ent_t
structures so they are part of the heap instead of the stack.

  In function 'splat_taskq_test6_impl'
  error: the frame size of 1648 bytes is larger than 1024 bytes

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
11 years agosplat taskq:order: Reduce stack frame
Brian Behlendorf [Mon, 10 Dec 2012 23:24:39 +0000 (15:24 -0800)]
splat taskq:order: Reduce stack frame

The slightly increased size of the taskq_ent_t when debugging is
enabled has pushed the taskq:order splat test over frame size
limit.  To resolve this dynamically allocate the taskq_ent_t
structures so they are part of the heap instead of the stack.

  In function 'splat_taskq_test5_impl'
  error: the frame size of 1680 bytes is larger than 1024 bytes

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
11 years agosplat taskq:cancel: Add test case
Brian Behlendorf [Thu, 6 Dec 2012 23:42:32 +0000 (15:42 -0800)]
splat taskq:cancel: Add test case

Add a test case for taskq_cancel_id() to verify it is working
properly.  Just like taskq:delay we start by dispatching 100
tasks.  However this time 1/3 of the tasks use taskq_dispatch()
and will be run immediately, and 2/3 use taskq_dispatch_delay().
The idea is to create a busy taskq with both active, pending,
and delayed tasks.

After all the items have been successfully dispatched the test
begins randomly canceling known task ids.  It will do this for
5 seconds randomly canceling a task id and then sleeping for a
few milliseconds.   The task being canceled may have already run,
still be on the pending list, or may be currently being executed
by a worker thread.  The idea is to ensure we catch any subtle
race conditions.

Once all the non-canceled tasks have completed we cross check
the number of tasks which ran with the number of tasks which
were successfully canceled.  Additionally, we verify that the
taskq_cancel_id() function never blocks longer than needed.
This time is bounded by the longest run time of the task which
was dispatched.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
11 years agosplat taskq:delay: Add test case
Brian Behlendorf [Thu, 6 Dec 2012 22:52:35 +0000 (14:52 -0800)]
splat taskq:delay: Add test case

Add a test case for taskq_dispatch_delay() to verify it is working
properly.  The test dispatchs 100 tasks to a taskq with random
expiration times spread over 5 seconds.  As each task expires and
gets executed by a worker thread it verifies that it was run at
the correct time.  Once all the delayed tasks have been executed
we double check that all the dispatched tasks were successful.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
11 years agotaskq delay/cancel functionality
Brian Behlendorf [Thu, 6 Dec 2012 20:38:19 +0000 (12:38 -0800)]
taskq delay/cancel functionality

Add the ability to dispatch a delayed task to a taskq.  The desired
behavior is for the task to be queued but not executed by a worker
thread until the expiration time is reached.  To achieve this two
new functions were added.

* taskq_dispatch_delay() -

  This function behaves exactly like taskq_dispatch() however it
takes a third 'expire_time' argument.  The caller should pass the
desired time the task should be executed as an absolute value in
jiffies.  The task is guarenteed not to run before this time, it
may run slightly latter if all the worker threads are busy.

* taskq_cancel_id() -

  Given a task id attempt to cancel the task before it gets executed.
This is primarily useful for canceling delay tasks but can be used for
canceling any previously dispatched task.  There are three possible
return values.

  0      - The task was found and canceled before it was executed.
  ENOENT - The task was not found, either it was already run or an
           invalid task id was supplied by the caller.
  EBUSY  - The task is currently executing any may not be canceled.
           This function will block until the task has been completed.

* taskq_wait_all() -

  The taskq_wait_id() function was renamed taskq_wait_all() to more
clearly reflect its actual behavior.  It is only curreny used by
the splat taskq regression tests.

* taskq_wait_id() -

  Historically, the only difference between this function and
taskq_wait() was that you passed the task id.  In both functions you
would block until ALL lower task ids which executed.  This was
semantically correct but could be very slow particularly if there
were delay tasks submitted.

  To better accomidate the delay tasks this function was reimplemnted.
It will now only block until the passed task id has been completed.

This is actually a fairly low risk change for a few reasons.

* Only new ZFS callers will make use of the new interfaces and
  very little common code was changed to support the new functions.

* The existing taskq_wait() implementation was not changed just
  slightly refactored.

* The newly optimized taskq_wait_id() implementation was never
  used by ZFS we can't accidentally introduce a new bug there.

NOTE: This functionality does not exist in the Illumos taskqs.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
11 years agotaskq style, remove #define wrappers
Brian Behlendorf [Thu, 6 Dec 2012 21:04:27 +0000 (13:04 -0800)]
taskq style, remove #define wrappers

When the taskq implementation was originally written I wrapped all
the API functions in #define's.  This was done as a preventative
measure to ensure that a taskq symbol never conflicted with an
existing kernel symbol.

However, in practice the taskq symbols never conflicted.  The only
major conflicts occured with the kmem cache API.  Since this added
layer of obfuscation never bought us anything for the taskq's I'm
removing it.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
11 years agotaskq style, convert spaces to soft tabs
Brian Behlendorf [Thu, 6 Dec 2012 20:57:42 +0000 (12:57 -0800)]
taskq style, convert spaces to soft tabs

Update the taskq implementation to conform with the style used
throughout the rest of the code.  There are no functional
changes in this commit.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
11 years agosplat linux:shrinker: Fix fail-safe
Steven Johnson [Tue, 4 Dec 2012 00:41:10 +0000 (08:41 +0800)]
splat linux:shrinker: Fix fail-safe

Ensure the fail-safe is reset between successive tests.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>