Date: Wed, 7 May 2014 06:34:03 +0000 (UTC) From: Edward Tomasz Napierala <trasz@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265497 - stable/10/sys/cam/ctl Message-ID: <201405070634.s476Y3Fc092065@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: trasz Date: Wed May 7 06:34:03 2014 New Revision: 265497 URL: http://svnweb.freebsd.org/changeset/base/265497 Log: MFC r264024: Use atomic ops instead of mutexes where appropriate. Submitted by: mav@ Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Wed May 7 06:31:45 2014 (r265496) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Wed May 7 06:34:03 2014 (r265497) @@ -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 "
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201405070634.s476Y3Fc092065>