diff options
author | attilio <attilio@FreeBSD.org> | 2008-02-24 16:38:58 +0000 |
---|---|---|
committer | attilio <attilio@FreeBSD.org> | 2008-02-24 16:38:58 +0000 |
commit | 0d54671a48443b15ac601a80e192bc4c8faed7f9 (patch) | |
tree | 997840c8acf28b15394b97f1d05d64f78bf81fd6 /sys/netncp | |
parent | 1c8346475e6e9a892928e5197425bb703eba2930 (diff) | |
download | FreeBSD-src-0d54671a48443b15ac601a80e192bc4c8faed7f9.zip FreeBSD-src-0d54671a48443b15ac601a80e192bc4c8faed7f9.tar.gz |
Introduce some functions in the vnode locks namespace and in the ffs
namespace in order to handle lockmgr fields in a controlled way instead
than spreading all around bogus stubs:
- VN_LOCK_AREC() allows lock recursion for a specified vnode
- VN_LOCK_ASHARE() allows lock sharing for a specified vnode
In FFS land:
- BUF_AREC() allows lock recursion for a specified buffer lock
- BUF_NOREC() disallows recursion for a specified buffer lock
Side note: union_subr.c::unionfs_node_update() is the only other function
directly handling lockmgr fields. As this is not simple to fix, it has
been left behind as "sole" exception.
Diffstat (limited to 'sys/netncp')
-rw-r--r-- | sys/netncp/ncp_conn.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/netncp/ncp_conn.c b/sys/netncp/ncp_conn.c index d870198..bff9498 100644 --- a/sys/netncp/ncp_conn.c +++ b/sys/netncp/ncp_conn.c @@ -193,7 +193,7 @@ ncp_conn_unlock(struct ncp_conn *conn, struct thread *td) int ncp_conn_assert_locked(struct ncp_conn *conn, const char *checker, struct thread *td) { - if (conn->nc_lock.lk_flags & LK_HAVE_EXCL) return 0; + if (lockstatus(&conn->nc_lock, curthread) == LK_EXCLUSIVE) return 0; printf("%s: connection isn't locked!\n", checker); return EIO; } |