summaryrefslogtreecommitdiffstats
path: root/include/target
diff options
context:
space:
mode:
authorMatthew Wilcox <willy@infradead.org>2018-06-12 12:05:43 -0700
committerMartin K. Petersen <martin.petersen@oracle.com>2018-06-19 22:02:25 -0400
commit83c2b54b9295a5fc0d9c8f1751aaf8099d1760f6 (patch)
treeb93af98e7faa42e779d5af7dfa7ec3d030e9a250 /include/target
parentba80917d9932da022d2e74eae66e44139dd65136 (diff)
downloadlinux-83c2b54b9295a5fc0d9c8f1751aaf8099d1760f6.tar.gz
linux-83c2b54b9295a5fc0d9c8f1751aaf8099d1760f6.tar.bz2
linux-83c2b54b9295a5fc0d9c8f1751aaf8099d1760f6.zip
scsi: target: Abstract tag freeing
Introduce target_free_tag() and convert all drivers to use it. Signed-off-by: Matthew Wilcox <willy@infradead.org> Reviewed-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'include/target')
-rw-r--r--include/target/target_core_base.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h
index 922a39f45abc..260c2f3e9460 100644
--- a/include/target/target_core_base.h
+++ b/include/target/target_core_base.h
@@ -934,4 +934,9 @@ static inline void atomic_dec_mb(atomic_t *v)
smp_mb__after_atomic();
}
+static inline void target_free_tag(struct se_session *sess, struct se_cmd *cmd)
+{
+ percpu_ida_free(&sess->sess_tag_pool, cmd->map_tag);
+}
+
#endif /* TARGET_CORE_BASE_H */