forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-11 1f93a7dfd1f8d5ff7a5c53246c7534fe2332d6f4
kernel/drivers/target/iscsi/iscsi_target_configfs.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*******************************************************************************
23 * This file contains the configfs implementation for iSCSI Target mode
34 * from the LIO-Target Project.
....@@ -6,15 +7,6 @@
67 *
78 * Author: Nicholas A. Bellinger <nab@linux-iscsi.org>
89 *
9
- * This program is free software; you can redistribute it and/or modify
10
- * it under the terms of the GNU General Public License as published by
11
- * the Free Software Foundation; either version 2 of the License, or
12
- * (at your option) any later version.
13
- *
14
- * This program is distributed in the hope that it will be useful,
15
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
- * GNU General Public License for more details.
1810 ****************************************************************************/
1911
2012 #include <linux/configfs.h>
....@@ -1343,11 +1335,6 @@
13431335
13441336 /* Start functions for target_core_fabric_ops */
13451337
1346
-static char *iscsi_get_fabric_name(void)
1347
-{
1348
- return "iSCSI";
1349
-}
1350
-
13511338 static int iscsi_get_cmd_state(struct se_cmd *se_cmd)
13521339 {
13531340 struct iscsi_cmd *cmd = container_of(se_cmd, struct iscsi_cmd, se_cmd);
....@@ -1392,18 +1379,6 @@
13921379 return conn->conn_transport->iscsit_get_dataout(conn, cmd, false);
13931380
13941381 return 0;
1395
-}
1396
-
1397
-static int lio_write_pending_status(struct se_cmd *se_cmd)
1398
-{
1399
- struct iscsi_cmd *cmd = container_of(se_cmd, struct iscsi_cmd, se_cmd);
1400
- int ret;
1401
-
1402
- spin_lock_bh(&cmd->istate_lock);
1403
- ret = !(cmd->cmd_flags & ICF_GOT_LAST_DATAOUT);
1404
- spin_unlock_bh(&cmd->istate_lock);
1405
-
1406
- return ret;
14071382 }
14081383
14091384 static int lio_queue_status(struct se_cmd *se_cmd)
....@@ -1552,9 +1527,9 @@
15521527
15531528 const struct target_core_fabric_ops iscsi_ops = {
15541529 .module = THIS_MODULE,
1555
- .name = "iscsi",
1530
+ .fabric_alias = "iscsi",
1531
+ .fabric_name = "iSCSI",
15561532 .node_acl_size = sizeof(struct iscsi_node_acl),
1557
- .get_fabric_name = iscsi_get_fabric_name,
15581533 .tpg_get_wwn = lio_tpg_get_endpoint_wwn,
15591534 .tpg_get_tag = lio_tpg_get_tag,
15601535 .tpg_get_default_depth = lio_tpg_get_default_depth,
....@@ -1572,7 +1547,6 @@
15721547 .sess_get_index = lio_sess_get_index,
15731548 .sess_get_initiator_sid = lio_sess_get_initiator_sid,
15741549 .write_pending = lio_write_pending,
1575
- .write_pending_status = lio_write_pending_status,
15761550 .set_default_node_attributes = lio_set_default_node_attributes,
15771551 .get_cmd_state = iscsi_get_cmd_state,
15781552 .queue_data_in = lio_queue_data_in,
....@@ -1599,4 +1573,6 @@
15991573 .tfc_tpg_nacl_attrib_attrs = lio_target_nacl_attrib_attrs,
16001574 .tfc_tpg_nacl_auth_attrs = lio_target_nacl_auth_attrs,
16011575 .tfc_tpg_nacl_param_attrs = lio_target_nacl_param_attrs,
1576
+
1577
+ .write_pending_must_be_called = true,
16021578 };