Skip to content

Commit

Permalink
ksmbd: use ib_device_get_netdev() instead of calling ops.get_netdev
Browse files Browse the repository at this point in the history
ULPs are not supposed to call to ops.* directly.

Suggested-by: Leon Romanovsky <leon@kernel.org>
Reviewed-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
  • Loading branch information
Namjae Jeon authored and Steve French committed Mar 28, 2025
1 parent 6171063 commit 6955bfe
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions fs/smb/server/transport_rdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -2142,8 +2142,7 @@ static int smb_direct_ib_client_add(struct ib_device *ib_dev)
if (ib_dev->node_type != RDMA_NODE_IB_CA)
smb_direct_port = SMB_DIRECT_PORT_IWARP;

if (!ib_dev->ops.get_netdev ||
!rdma_frwr_is_supported(&ib_dev->attrs))
if (!rdma_frwr_is_supported(&ib_dev->attrs))
return 0;

smb_dev = kzalloc(sizeof(*smb_dev), KSMBD_DEFAULT_GFP);
Expand Down Expand Up @@ -2243,8 +2242,7 @@ bool ksmbd_rdma_capable_netdev(struct net_device *netdev)
for (i = 0; i < smb_dev->ib_dev->phys_port_cnt; i++) {
struct net_device *ndev;

ndev = smb_dev->ib_dev->ops.get_netdev(smb_dev->ib_dev,
i + 1);
ndev = ib_device_get_netdev(smb_dev->ib_dev, i + 1);
if (!ndev)
continue;

Expand Down

0 comments on commit 6955bfe

Please sign in to comment.