diff mbox

[v3,03/21] IB/srpt: Remove struct srpt_node_acl

Message ID 56B3D4D7.8060800@sandisk.com (mailing list archive)
State Superseded
Headers show

Commit Message

Bart Van Assche Feb. 4, 2016, 10:46 p.m. UTC
Since struct srpt_node_acl is identical to struct se_node_acl,
remove the definition of the former structure. This patch does
not change any functionality.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Alex Estrin <alex.estrin@intel.com>
Cc: Sagi Grimberg <sagig@mellanox.com>
---
 drivers/infiniband/ulp/srpt/ib_srpt.c | 2 +-
 drivers/infiniband/ulp/srpt/ib_srpt.h | 8 --------
 2 files changed, 1 insertion(+), 9 deletions(-)

Comments

Christoph Hellwig Feb. 9, 2016, 1:15 p.m. UTC | #1
> -	.node_acl_size			= sizeof(struct srpt_node_acl),
> +	.node_acl_size			= sizeof(struct se_node_acl),

just drop this line entirely, the core code will do the right thing.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Bart Van Assche Feb. 9, 2016, 3:03 p.m. UTC | #2
On 02/09/16 05:15, Christoph Hellwig wrote:
>> -	.node_acl_size			= sizeof(struct srpt_node_acl),
>> +	.node_acl_size			= sizeof(struct se_node_acl),
>
> just drop this line entirely, the core code will do the right thing.

Hello Christoph,

Can you show me the code in the LIO core that handles not specifying 
.node_acl_size ? I have tried to find it but haven't found it yet.

Thanks,

Bart.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Christoph Hellwig Feb. 9, 2016, 3:08 p.m. UTC | #3
On Tue, Feb 09, 2016 at 07:03:52AM -0800, Bart Van Assche wrote:
> On 02/09/16 05:15, Christoph Hellwig wrote:
>>> -	.node_acl_size			= sizeof(struct srpt_node_acl),
>>> +	.node_acl_size			= sizeof(struct se_node_acl),
>>
>> just drop this line entirely, the core code will do the right thing.
>
> Hello Christoph,
>
> Can you show me the code in the LIO core that handles not specifying 
> .node_acl_size ? I have tried to find it but haven't found it yet.

static struct se_node_acl *target_alloc_node_acl(struct se_portal_group *tpg,
		const unsigned char *initiatorname)
{
	struct se_node_acl *acl;
	u32 queue_depth;

	acl = kzalloc(max(sizeof(*acl), tpg->se_tpg_tfo->node_acl_size),
			GFP_KERNEL);

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Bart Van Assche Feb. 9, 2016, 3:13 p.m. UTC | #4
On 02/09/16 07:08, Christoph Hellwig wrote:
> On Tue, Feb 09, 2016 at 07:03:52AM -0800, Bart Van Assche wrote:
>> On 02/09/16 05:15, Christoph Hellwig wrote:
>>>> -	.node_acl_size			= sizeof(struct srpt_node_acl),
>>>> +	.node_acl_size			= sizeof(struct se_node_acl),
>>>
>>> just drop this line entirely, the core code will do the right thing.
>>
>> Hello Christoph,
>>
>> Can you show me the code in the LIO core that handles not specifying
>> .node_acl_size ? I have tried to find it but haven't found it yet.
>
> static struct se_node_acl *target_alloc_node_acl(struct se_portal_group *tpg,
> 		const unsigned char *initiatorname)
> {
> 	struct se_node_acl *acl;
> 	u32 queue_depth;
>
> 	acl = kzalloc(max(sizeof(*acl), tpg->se_tpg_tfo->node_acl_size),
> 			GFP_KERNEL);

Hello Christoph,

Ah, thanks, I came across that code but had overlooked the "max()" part 
in the above code. I will resubmit this patch series.

Bart.


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c
index 4ee9678..e9e062d 100644
--- a/drivers/infiniband/ulp/srpt/ib_srpt.c
+++ b/drivers/infiniband/ulp/srpt/ib_srpt.c
@@ -3508,7 +3508,7 @@  static struct configfs_attribute *srpt_wwn_attrs[] = {
 static const struct target_core_fabric_ops srpt_template = {
 	.module				= THIS_MODULE,
 	.name				= "srpt",
-	.node_acl_size			= sizeof(struct srpt_node_acl),
+	.node_acl_size			= sizeof(struct se_node_acl),
 	.get_fabric_name		= srpt_get_fabric_name,
 	.tpg_get_wwn			= srpt_get_fabric_wwn,
 	.tpg_get_tag			= srpt_get_tag,
diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.h b/drivers/infiniband/ulp/srpt/ib_srpt.h
index 09037f2..b0ede97 100644
--- a/drivers/infiniband/ulp/srpt/ib_srpt.h
+++ b/drivers/infiniband/ulp/srpt/ib_srpt.h
@@ -363,12 +363,4 @@  struct srpt_device {
 	struct list_head	list;
 };
 
-/**
- * struct srpt_node_acl - Per-initiator ACL data (managed via configfs).
- * @nacl:      Target core node ACL information.
- */
-struct srpt_node_acl {
-	struct se_node_acl	nacl;
-};
-
 #endif				/* IB_SRPT_H */