| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /******************************************************************************* |
|---|
| 2 | 3 | * This file contains the configfs implementation for iSCSI Target mode |
|---|
| 3 | 4 | * from the LIO-Target Project. |
|---|
| .. | .. |
|---|
| 6 | 7 | * |
|---|
| 7 | 8 | * Author: Nicholas A. Bellinger <nab@linux-iscsi.org> |
|---|
| 8 | 9 | * |
|---|
| 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. |
|---|
| 18 | 10 | ****************************************************************************/ |
|---|
| 19 | 11 | |
|---|
| 20 | 12 | #include <linux/configfs.h> |
|---|
| .. | .. |
|---|
| 1343 | 1335 | |
|---|
| 1344 | 1336 | /* Start functions for target_core_fabric_ops */ |
|---|
| 1345 | 1337 | |
|---|
| 1346 | | -static char *iscsi_get_fabric_name(void) |
|---|
| 1347 | | -{ |
|---|
| 1348 | | - return "iSCSI"; |
|---|
| 1349 | | -} |
|---|
| 1350 | | - |
|---|
| 1351 | 1338 | static int iscsi_get_cmd_state(struct se_cmd *se_cmd) |
|---|
| 1352 | 1339 | { |
|---|
| 1353 | 1340 | struct iscsi_cmd *cmd = container_of(se_cmd, struct iscsi_cmd, se_cmd); |
|---|
| .. | .. |
|---|
| 1392 | 1379 | return conn->conn_transport->iscsit_get_dataout(conn, cmd, false); |
|---|
| 1393 | 1380 | |
|---|
| 1394 | 1381 | 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; |
|---|
| 1407 | 1382 | } |
|---|
| 1408 | 1383 | |
|---|
| 1409 | 1384 | static int lio_queue_status(struct se_cmd *se_cmd) |
|---|
| .. | .. |
|---|
| 1552 | 1527 | |
|---|
| 1553 | 1528 | const struct target_core_fabric_ops iscsi_ops = { |
|---|
| 1554 | 1529 | .module = THIS_MODULE, |
|---|
| 1555 | | - .name = "iscsi", |
|---|
| 1530 | + .fabric_alias = "iscsi", |
|---|
| 1531 | + .fabric_name = "iSCSI", |
|---|
| 1556 | 1532 | .node_acl_size = sizeof(struct iscsi_node_acl), |
|---|
| 1557 | | - .get_fabric_name = iscsi_get_fabric_name, |
|---|
| 1558 | 1533 | .tpg_get_wwn = lio_tpg_get_endpoint_wwn, |
|---|
| 1559 | 1534 | .tpg_get_tag = lio_tpg_get_tag, |
|---|
| 1560 | 1535 | .tpg_get_default_depth = lio_tpg_get_default_depth, |
|---|
| .. | .. |
|---|
| 1572 | 1547 | .sess_get_index = lio_sess_get_index, |
|---|
| 1573 | 1548 | .sess_get_initiator_sid = lio_sess_get_initiator_sid, |
|---|
| 1574 | 1549 | .write_pending = lio_write_pending, |
|---|
| 1575 | | - .write_pending_status = lio_write_pending_status, |
|---|
| 1576 | 1550 | .set_default_node_attributes = lio_set_default_node_attributes, |
|---|
| 1577 | 1551 | .get_cmd_state = iscsi_get_cmd_state, |
|---|
| 1578 | 1552 | .queue_data_in = lio_queue_data_in, |
|---|
| .. | .. |
|---|
| 1599 | 1573 | .tfc_tpg_nacl_attrib_attrs = lio_target_nacl_attrib_attrs, |
|---|
| 1600 | 1574 | .tfc_tpg_nacl_auth_attrs = lio_target_nacl_auth_attrs, |
|---|
| 1601 | 1575 | .tfc_tpg_nacl_param_attrs = lio_target_nacl_param_attrs, |
|---|
| 1576 | + |
|---|
| 1577 | + .write_pending_must_be_called = true, |
|---|
| 1602 | 1578 | }; |
|---|