diff options
author | Mark Johnston <[email protected]> | 2020-06-30 15:35:29 -0400 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2020-07-06 11:53:31 -0700 |
commit | 6e0056171234b84450af2afbb6594bd3b09422b5 (patch) | |
tree | 89ea4c7e98ddc130bc23004ad944c54ba78a3bc2 /include | |
parent | a4b0a74c7f346cab0a9ae3f8f55bd1a372e14336 (diff) |
Add a "try" operation for range locks
zfs_rangelock_tryenter() bails immediately instead of waiting for the
lock to become available. This will be used to resolve a deadlock in
the FreeBSD page-in code. No functional change intended.
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Ryan Moeller <[email protected]>
Signed-off-by: Mark Johnston <[email protected]>
Closes #10519
Diffstat (limited to 'include')
-rw-r--r-- | include/sys/zfs_rlock.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/sys/zfs_rlock.h b/include/sys/zfs_rlock.h index 0ac1561f9..2302abb37 100644 --- a/include/sys/zfs_rlock.h +++ b/include/sys/zfs_rlock.h @@ -71,6 +71,8 @@ void zfs_rangelock_fini(zfs_rangelock_t *); zfs_locked_range_t *zfs_rangelock_enter(zfs_rangelock_t *, uint64_t, uint64_t, zfs_rangelock_type_t); +zfs_locked_range_t *zfs_rangelock_tryenter(zfs_rangelock_t *, + uint64_t, uint64_t, zfs_rangelock_type_t); void zfs_rangelock_exit(zfs_locked_range_t *); void zfs_rangelock_reduce(zfs_locked_range_t *, uint64_t, uint64_t); |