提交 a7b287bf 编写于 作者: I Israel Rukshin 提交者: Jason Gunthorpe

IB/iser: Refactor iscsi_iser_check_protection function

Reduce lines of code by using local variable.
Signed-off-by: NIsrael Rukshin <israelr@mellanox.com>
Reviewed-by: NMax Gurtovoy <maxg@mellanox.com>
Reviewed-by: NSagi Grimberg <sagi@grimberg.me>
Reviewed-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
上级 a188339c
...@@ -406,13 +406,10 @@ static u8 ...@@ -406,13 +406,10 @@ static u8
iscsi_iser_check_protection(struct iscsi_task *task, sector_t *sector) iscsi_iser_check_protection(struct iscsi_task *task, sector_t *sector)
{ {
struct iscsi_iser_task *iser_task = task->dd_data; struct iscsi_iser_task *iser_task = task->dd_data;
enum iser_data_dir dir = iser_task->dir[ISER_DIR_IN] ?
ISER_DIR_IN : ISER_DIR_OUT;
if (iser_task->dir[ISER_DIR_IN]) return iser_check_task_pi_status(iser_task, dir, sector);
return iser_check_task_pi_status(iser_task, ISER_DIR_IN,
sector);
else
return iser_check_task_pi_status(iser_task, ISER_DIR_OUT,
sector);
} }
/** /**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册