Skip to content

Commit 20cf661

Browse files
kelleymhliuw
authored andcommitted
Drivers: hv: vmbus: Remove unused code to check for subchannels
The last caller of vmbus_are_subchannels_present() was removed in commit c967590 ("scsi: storvsc: Fix a race in sub-channel creation that can cause panic"). Remove this dead code, and the utility function invoke_sc_cb() that it is the only caller of. Signed-off-by: Michael Kelley <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Wei Liu <[email protected]>
1 parent 9a87977 commit 20cf661

File tree

2 files changed

+0
-47
lines changed

2 files changed

+0
-47
lines changed

drivers/hv/channel_mgmt.c

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1581,47 +1581,13 @@ int vmbus_request_offers(void)
15811581
return ret;
15821582
}
15831583

1584-
static void invoke_sc_cb(struct vmbus_channel *primary_channel)
1585-
{
1586-
struct list_head *cur, *tmp;
1587-
struct vmbus_channel *cur_channel;
1588-
1589-
if (primary_channel->sc_creation_callback == NULL)
1590-
return;
1591-
1592-
list_for_each_safe(cur, tmp, &primary_channel->sc_list) {
1593-
cur_channel = list_entry(cur, struct vmbus_channel, sc_list);
1594-
1595-
primary_channel->sc_creation_callback(cur_channel);
1596-
}
1597-
}
1598-
15991584
void vmbus_set_sc_create_callback(struct vmbus_channel *primary_channel,
16001585
void (*sc_cr_cb)(struct vmbus_channel *new_sc))
16011586
{
16021587
primary_channel->sc_creation_callback = sc_cr_cb;
16031588
}
16041589
EXPORT_SYMBOL_GPL(vmbus_set_sc_create_callback);
16051590

1606-
bool vmbus_are_subchannels_present(struct vmbus_channel *primary)
1607-
{
1608-
bool ret;
1609-
1610-
ret = !list_empty(&primary->sc_list);
1611-
1612-
if (ret) {
1613-
/*
1614-
* Invoke the callback on sub-channel creation.
1615-
* This will present a uniform interface to the
1616-
* clients.
1617-
*/
1618-
invoke_sc_cb(primary);
1619-
}
1620-
1621-
return ret;
1622-
}
1623-
EXPORT_SYMBOL_GPL(vmbus_are_subchannels_present);
1624-
16251591
void vmbus_set_chn_rescind_callback(struct vmbus_channel *channel,
16261592
void (*chn_rescind_cb)(struct vmbus_channel *))
16271593
{

include/linux/hyperv.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,19 +1106,6 @@ void vmbus_set_sc_create_callback(struct vmbus_channel *primary_channel,
11061106
void vmbus_set_chn_rescind_callback(struct vmbus_channel *channel,
11071107
void (*chn_rescind_cb)(struct vmbus_channel *));
11081108

1109-
/*
1110-
* Check if sub-channels have already been offerred. This API will be useful
1111-
* when the driver is unloaded after establishing sub-channels. In this case,
1112-
* when the driver is re-loaded, the driver would have to check if the
1113-
* subchannels have already been established before attempting to request
1114-
* the creation of sub-channels.
1115-
* This function returns TRUE to indicate that subchannels have already been
1116-
* created.
1117-
* This function should be invoked after setting the callback function for
1118-
* sub-channel creation.
1119-
*/
1120-
bool vmbus_are_subchannels_present(struct vmbus_channel *primary);
1121-
11221109
/* The format must be the same as struct vmdata_gpa_direct */
11231110
struct vmbus_channel_packet_page_buffer {
11241111
u16 type;

0 commit comments

Comments
 (0)