summaryrefslogtreecommitdiff
path: root/include/target
diff options
context:
space:
mode:
authorMatthew Wilcox <willy@infradead.org>2018-06-12 22:05:43 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2018-06-20 05:02:25 +0300
commit83c2b54b9295a5fc0d9c8f1751aaf8099d1760f6 (patch)
treeb93af98e7faa42e779d5af7dfa7ec3d030e9a250 /include/target
parentba80917d9932da022d2e74eae66e44139dd65136 (diff)
downloadlinux-83c2b54b9295a5fc0d9c8f1751aaf8099d1760f6.tar.xz
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 */