This source file includes following definitions.
- iscsit_determine_maxcmdsn
- iscsit_increment_maxcmdsn
1
2
3
4
5
6
7
8
9
10
11
12 #include <target/target_core_base.h>
13 #include <target/target_core_fabric.h>
14
15 #include <target/iscsi/iscsi_target_core.h>
16 #include "iscsi_target_device.h"
17 #include "iscsi_target_tpg.h"
18 #include "iscsi_target_util.h"
19
20 void iscsit_determine_maxcmdsn(struct iscsi_session *sess)
21 {
22 struct se_node_acl *se_nacl;
23
24
25
26
27
28
29
30 if (sess->sess_ops->SessionType)
31 return;
32
33 se_nacl = sess->se_sess->se_node_acl;
34
35
36
37
38
39
40
41 sess->cmdsn_window = se_nacl->queue_depth;
42 atomic_add(se_nacl->queue_depth - 1, &sess->max_cmd_sn);
43 }
44
45 void iscsit_increment_maxcmdsn(struct iscsi_cmd *cmd, struct iscsi_session *sess)
46 {
47 u32 max_cmd_sn;
48
49 if (cmd->immediate_cmd || cmd->maxcmdsn_inc)
50 return;
51
52 cmd->maxcmdsn_inc = 1;
53
54 max_cmd_sn = atomic_inc_return(&sess->max_cmd_sn);
55 pr_debug("Updated MaxCmdSN to 0x%08x\n", max_cmd_sn);
56 }
57 EXPORT_SYMBOL(iscsit_increment_maxcmdsn);