aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorEdward Tomasz Napierala <trasz@FreeBSD.org>2014-04-01 21:54:20 +0000
committerEdward Tomasz Napierala <trasz@FreeBSD.org>2014-04-01 21:54:20 +0000
commit01a111f4472728e524430486c594bf58bb10d98d (patch)
tree06a46f7c9296c01396dc9bceb22200e3f6dfdbe2 /sys
parentecba49ddfc7c9212e49a2cffb0345900f9933062 (diff)
downloadsrc-01a111f4472728e524430486c594bf58bb10d98d.tar.gz
src-01a111f4472728e524430486c594bf58bb10d98d.zip
Use atomic ops instead of mutexes where appropriate.
Submitted by: mav@ Sponsored by: The FreeBSD Foundation
Notes
Notes: svn path=/head/; revision=264024
Diffstat (limited to 'sys')
-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 b5744f292d6e..63a1c951284c 100644
--- a/sys/cam/ctl/ctl_frontend_iscsi.c
+++ b/sys/cam/ctl/ctl_frontend_iscsi.c
@@ -967,9 +967,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) {
@@ -2522,10 +2520,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 "