Print this page
8381 Convert ipsec_alg_lock from mutex to rwlock
*** 19,28 ****
--- 19,29 ----
* CDDL HEADER END
*/
/*
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright (c) 2012 Nexenta Systems, Inc. All rights reserved.
*/
#ifndef _INET_SADB_H
#define _INET_SADB_H
*** 913,925 ****
mutex_enter(&assoc->ipsa_lock); \
if ((_sa)->_which == IPSEC_CTX_TMPL_ALLOC) { \
ipsec_stack_t *ipss; \
\
ipss = assoc->ipsa_netstack->netstack_ipsec; \
! mutex_enter(&ipss->ipsec_alg_lock); \
(void) ipsec_create_ctx_tmpl(_sa, _type); \
! mutex_exit(&ipss->ipsec_alg_lock); \
} \
mutex_exit(&assoc->ipsa_lock); \
if ((_tmpl = (_sa)->_which) == IPSEC_CTX_TMPL_ALLOC) \
_tmpl = NULL; \
} \
--- 914,926 ----
mutex_enter(&assoc->ipsa_lock); \
if ((_sa)->_which == IPSEC_CTX_TMPL_ALLOC) { \
ipsec_stack_t *ipss; \
\
ipss = assoc->ipsa_netstack->netstack_ipsec; \
! rw_enter(&ipss->ipsec_alg_lock, RW_READER); \
(void) ipsec_create_ctx_tmpl(_sa, _type); \
! rw_exit(&ipss->ipsec_alg_lock); \
} \
mutex_exit(&assoc->ipsa_lock); \
if ((_tmpl = (_sa)->_which) == IPSEC_CTX_TMPL_ALLOC) \
_tmpl = NULL; \
} \