b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * This file and its contents are supplied under the terms of the
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * Common Development and Distribution License ("CDDL"), version 1.0.
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * You may only use this file in accordance with the terms of version
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * 1.0 of the CDDL.
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * A full copy of the text of the CDDL should have accompanied this
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * source. A copy of the CDDL is also available via the Internet at
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * rwlock(9f)
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross/* This is the API we're emulating */
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross/* avoiding synch.h */
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Rossrw_init(krwlock_t *rwlp, char *name, krw_type_t type, void *arg)
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross (void) rwlock_init(&rwlp->rw_lock, USYNC_THREAD, NULL);
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross return (rw_read_held(rwlp) || rw_write_held(rwlp));
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * Return the kthread_t * of the lock owner