]> git.proxmox.com Git - mirror_spl.git/commit
Add rw_tryupgrade()
authorBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 9 Mar 2016 22:20:48 +0000 (14:20 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 10 Mar 2016 21:05:25 +0000 (13:05 -0800)
commita6ae97caed620b0e9e0575346062c751f6f15483
tree15c8b923a044403a5bda9c8e207ebe48f8af5902
parent47f98247814fff50d02ddc0772197842c57cdc3a
Add rw_tryupgrade()

This implementation of rw_tryupgrade() behaves slightly differently
from its counterparts on other platforms.  It drops the RW_READER lock
and then acquires the RW_WRITER lock leaving a small window where no
lock is held.  On other platforms the lock is never released during
the upgrade process.  This is necessary under Linux because the kernel
does not provide an upgrade function.

There are currently no callers in the ZFS code where this change in
behavior is a problem.  In fact, in most cases the code is already
written such that if the upgrade fails the RW_READER lock is dropped
and the caller blocks waiting to acquire the lock as RW_WRITER.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tim Chase <tim@chase2k.com>
Signed-off-by: Matthew Thode <prometheanfire@gentoo.org>
Closes zfsonlinux/zfs#4388
Closes #534
include/sys/rwlock.h
module/spl/spl-rwlock.c
module/splat/splat-rwlock.c