mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-26 19:19:32 +03:00
a0aadf5666
the directories at the top level but that proved troublesome. The kernel buildsystem and autoconf were conflicting too much. To resolve the issue I moved the kernel bits in to a modules directory which can then only use the kernel build system. We just pass along the likely make targets to the kernel build system. git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@11 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
42 lines
543 B
C
42 lines
543 B
C
#include <linux-rwlock.h>
|
|
|
|
int
|
|
rw_lock_held(krwlock_t *rwlp)
|
|
{
|
|
BUG_ON(rwlp->rw_magic != RW_MAGIC);
|
|
|
|
#ifdef CONFIG_RWSEM_GENERIC_SPINLOCK
|
|
if (rwlp->rw_sem.activity != 0) {
|
|
#else
|
|
if (rwlp->rw_sem.count != 0) {
|
|
#endif
|
|
return 1;
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
|
|
int
|
|
rw_read_held(krwlock_t *rwlp)
|
|
{
|
|
BUG_ON(rwlp->rw_magic != RW_MAGIC);
|
|
|
|
if (rw_lock_held(rwlp) && rwlp->rw_owner == NULL) {
|
|
return 1;
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
|
|
int
|
|
rw_write_held(krwlock_t *rwlp)
|
|
{
|
|
BUG_ON(rwlp->rw_magic != RW_MAGIC);
|
|
|
|
if (rwlp->rw_owner == current) {
|
|
return 1;
|
|
}
|
|
|
|
return 0;
|
|
}
|