summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortrasz <trasz@FreeBSD.org>2014-05-07 06:34:03 +0000
committertrasz <trasz@FreeBSD.org>2014-05-07 06:34:03 +0000
commit4fd7169afe7c42349b3e5fe6c20360cad6602f35 (patch)
treee95103dfcc984bf3df27fd3abb46175a13bbf690
parent26ce3cd6c7993f9ec2fec589b5283460be5d33e6 (diff)
downloadFreeBSD-src-4fd7169afe7c42349b3e5fe6c20360cad6602f35.zip
FreeBSD-src-4fd7169afe7c42349b3e5fe6c20360cad6602f35.tar.gz
MFC r264024:
Use atomic ops instead of mutexes where appropriate. Submitted by: mav@ Sponsored by: The FreeBSD Foundation
-rw-r--r--sys/cam/ctl/ctl_frontend_iscsi.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/sys/cam/ctl/ctl_frontend_iscsi.c b/sys/cam/ctl/ctl_frontend_iscsi.c
index a19e1d9..9ce6e5f 100644
--- a/sys/cam/ctl/ctl_frontend_iscsi.c
+++ b/sys/cam/ctl/ctl_frontend_iscsi.c
@@ -958,9 +958,7 @@ cfiscsi_callout(void *context)
callout_schedule(&cs->cs_callout, 1 * hz);
- CFISCSI_SESSION_LOCK(cs);
- cs->cs_timeout++;
- CFISCSI_SESSION_UNLOCK(cs);
+ atomic_add_int(&cs->cs_timeout, 1);
#ifdef ICL_KERNEL_PROXY
if (cs->cs_waiting_for_ctld || cs->cs_login_phase) {
@@ -2510,10 +2508,8 @@ cfiscsi_datamove_out(union ctl_io *io)
*/
PDU_TOTAL_TRANSFER_LEN(request) = io->scsiio.kern_total_len;
- CFISCSI_SESSION_LOCK(cs);
- target_transfer_tag = cs->cs_target_transfer_tag;
- cs->cs_target_transfer_tag++;
- CFISCSI_SESSION_UNLOCK(cs);
+ target_transfer_tag =
+ atomic_fetchadd_32(&cs->cs_target_transfer_tag, 1);
#if 0
CFISCSI_SESSION_DEBUG(cs, "expecting Data-Out with initiator "
OpenPOWER on IntegriCloud