mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
iscsi-target: Introduce session_get_next_ttt
Reduce code duplication. Signed-off-by: Sagi Grimberg <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
This commit is contained in:
parent
631af55062
commit
c1e34b6404
3 changed files with 17 additions and 17 deletions
|
|
@ -880,4 +880,17 @@ struct iscsit_global {
|
|||
struct iscsi_portal_group *discovery_tpg;
|
||||
};
|
||||
|
||||
static inline u32 session_get_next_ttt(struct iscsi_session *session)
|
||||
{
|
||||
u32 ttt;
|
||||
|
||||
spin_lock_bh(&session->ttt_lock);
|
||||
ttt = session->targ_xfer_tag++;
|
||||
if (ttt == 0xFFFFFFFF)
|
||||
ttt = session->targ_xfer_tag++;
|
||||
spin_unlock_bh(&session->ttt_lock);
|
||||
|
||||
return ttt;
|
||||
}
|
||||
|
||||
#endif /* ISCSI_TARGET_CORE_H */
|
||||
|
|
|
|||
Loading…
Reference in a new issue