.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /******************************************************************************* |
---|
2 | 3 | * Filename: target_core_ua.c |
---|
3 | 4 | * |
---|
.. | .. |
---|
6 | 7 | * (c) Copyright 2009-2013 Datera, Inc. |
---|
7 | 8 | * |
---|
8 | 9 | * 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. |
---|
23 | 10 | * |
---|
24 | 11 | ******************************************************************************/ |
---|
25 | 12 | |
---|
.. | .. |
---|
212 | 199 | struct se_node_acl *nacl; |
---|
213 | 200 | struct se_ua *ua = NULL, *ua_p; |
---|
214 | 201 | int head = 1; |
---|
| 202 | + bool dev_ua_intlck_clear = (dev->dev_attrib.emulate_ua_intlck_ctrl |
---|
| 203 | + == TARGET_UA_INTLCK_CTRL_CLEAR); |
---|
215 | 204 | |
---|
216 | 205 | if (WARN_ON_ONCE(!sess)) |
---|
217 | 206 | return false; |
---|
.. | .. |
---|
242 | 231 | * highest priority UNIT_ATTENTION and ASC/ASCQ without |
---|
243 | 232 | * clearing it. |
---|
244 | 233 | */ |
---|
245 | | - if (dev->dev_attrib.emulate_ua_intlck_ctrl != 0) { |
---|
| 234 | + if (!dev_ua_intlck_clear) { |
---|
246 | 235 | *asc = ua->ua_asc; |
---|
247 | 236 | *ascq = ua->ua_ascq; |
---|
248 | 237 | break; |
---|
.. | .. |
---|
266 | 255 | pr_debug("[%s]: %s UNIT ATTENTION condition with" |
---|
267 | 256 | " INTLCK_CTRL: %d, mapped LUN: %llu, got CDB: 0x%02x" |
---|
268 | 257 | " 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, |
---|
272 | 261 | cmd->orig_fe_lun, cmd->t_task_cdb[0], *asc, *ascq); |
---|
273 | 262 | |
---|
274 | 263 | return head == 0; |
---|
.. | .. |
---|
327 | 316 | |
---|
328 | 317 | pr_debug("[%s]: Released UNIT ATTENTION condition, mapped" |
---|
329 | 318 | " 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, |
---|
331 | 320 | cmd->orig_fe_lun, *asc, *ascq); |
---|
332 | 321 | |
---|
333 | 322 | return (head) ? -EPERM : 0; |
---|