hc
2024-05-10 748e4f3d702def1a4bff191e0cf93b6a05340f01
kernel/drivers/target/target_core_ua.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*******************************************************************************
23 * Filename: target_core_ua.c
34 *
....@@ -6,20 +7,6 @@
67 * (c) Copyright 2009-2013 Datera, Inc.
78 *
89 * Nicholas A. Bellinger <nab@kernel.org>
9
- *
10
- * This program is free software; you can redistribute it and/or modify
11
- * it under the terms of the GNU General Public License as published by
12
- * the Free Software Foundation; either version 2 of the License, or
13
- * (at your option) any later version.
14
- *
15
- * This program is distributed in the hope that it will be useful,
16
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
- * GNU General Public License for more details.
19
- *
20
- * You should have received a copy of the GNU General Public License
21
- * along with this program; if not, write to the Free Software
22
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2310 *
2411 ******************************************************************************/
2512
....@@ -212,6 +199,8 @@
212199 struct se_node_acl *nacl;
213200 struct se_ua *ua = NULL, *ua_p;
214201 int head = 1;
202
+ bool dev_ua_intlck_clear = (dev->dev_attrib.emulate_ua_intlck_ctrl
203
+ == TARGET_UA_INTLCK_CTRL_CLEAR);
215204
216205 if (WARN_ON_ONCE(!sess))
217206 return false;
....@@ -242,7 +231,7 @@
242231 * highest priority UNIT_ATTENTION and ASC/ASCQ without
243232 * clearing it.
244233 */
245
- if (dev->dev_attrib.emulate_ua_intlck_ctrl != 0) {
234
+ if (!dev_ua_intlck_clear) {
246235 *asc = ua->ua_asc;
247236 *ascq = ua->ua_ascq;
248237 break;
....@@ -266,9 +255,9 @@
266255 pr_debug("[%s]: %s UNIT ATTENTION condition with"
267256 " INTLCK_CTRL: %d, mapped LUN: %llu, got CDB: 0x%02x"
268257 " reported ASC: 0x%02x, ASCQ: 0x%02x\n",
269
- nacl->se_tpg->se_tpg_tfo->get_fabric_name(),
270
- (dev->dev_attrib.emulate_ua_intlck_ctrl != 0) ? "Reporting" :
271
- "Releasing", dev->dev_attrib.emulate_ua_intlck_ctrl,
258
+ nacl->se_tpg->se_tpg_tfo->fabric_name,
259
+ dev_ua_intlck_clear ? "Releasing" : "Reporting",
260
+ dev->dev_attrib.emulate_ua_intlck_ctrl,
272261 cmd->orig_fe_lun, cmd->t_task_cdb[0], *asc, *ascq);
273262
274263 return head == 0;
....@@ -327,7 +316,7 @@
327316
328317 pr_debug("[%s]: Released UNIT ATTENTION condition, mapped"
329318 " LUN: %llu, got REQUEST_SENSE reported ASC: 0x%02x,"
330
- " ASCQ: 0x%02x\n", nacl->se_tpg->se_tpg_tfo->get_fabric_name(),
319
+ " ASCQ: 0x%02x\n", nacl->se_tpg->se_tpg_tfo->fabric_name,
331320 cmd->orig_fe_lun, *asc, *ascq);
332321
333322 return (head) ? -EPERM : 0;