summaryrefslogtreecommitdiffstats
path: root/include/target
diff options
context:
space:
mode:
authorNicholas Bellinger <nab@linux-iscsi.org>2013-11-13 18:34:55 -0800
committerNicholas Bellinger <nab@linux-iscsi.org>2013-11-13 18:34:55 -0800
commitee480683d975973e3ff679850871e00e011c4a96 (patch)
treea7c5d09f34b8f606fb3f709eb15615513d5981db /include/target
parent29f4c090079f442ea2723d292e4e64f0b6ac1f27 (diff)
target: Convert se_device statistics to atomic_long_t
This patch converts the handful of se_device statistics to type atomic_long_t, instead of using se_device->stats_lock when incrementing these values. More importantly, go ahead and drop the spinlock usage within transport_lookup_cmd_lun() fast-path code. Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'include/target')
-rw-r--r--include/target/target_core_base.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h
index 96bf1b0239c..fab91baf8ef 100644
--- a/include/target/target_core_base.h
+++ b/include/target/target_core_base.h
@@ -683,11 +683,10 @@ struct se_device {
/* Pointer to transport specific device structure */
u32 dev_index;
u64 creation_time;
- u32 num_resets;
- u64 num_cmds;
- u64 read_bytes;
- u64 write_bytes;
- spinlock_t stats_lock;
+ atomic_long_t num_resets;
+ atomic_long_t num_cmds;
+ atomic_long_t read_bytes;
+ atomic_long_t write_bytes;
/* Active commands on this virtual SE device */
atomic_t simple_cmds;
atomic_t dev_ordered_id;