Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F145080543
D7111.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
4 KB
Referenced Files
None
Subscribers
None
D7111.diff
View Options
Index: head/sys/dev/hyperv/include/hyperv.h
===================================================================
--- head/sys/dev/hyperv/include/hyperv.h
+++ head/sys/dev/hyperv/include/hyperv.h
@@ -326,7 +326,7 @@
void *hv_chan_priv3;
struct task ch_detach_task;
- TAILQ_ENTRY(hv_vmbus_channel) ch_link;
+ TAILQ_ENTRY(hv_vmbus_channel) ch_prilink; /* primary chan link */
uint32_t ch_subidx; /* subchan index */
volatile uint32_t ch_stflags; /* atomic-op */
/* VMBUS_CHAN_ST_ */
Index: head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c
===================================================================
--- head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c
+++ head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c
@@ -134,8 +134,8 @@
newchan->ch_id, newchan->ch_subidx);
}
- mtx_lock(&sc->vmbus_chlist_lock);
- TAILQ_FOREACH(prichan, &sc->vmbus_chlist, ch_link) {
+ mtx_lock(&sc->vmbus_prichan_lock);
+ TAILQ_FOREACH(prichan, &sc->vmbus_prichans, ch_prilink) {
if (memcmp(&prichan->ch_guid_type, &newchan->ch_guid_type,
sizeof(struct hyperv_guid)) == 0 &&
memcmp(&prichan->ch_guid_inst, &newchan->ch_guid_inst,
@@ -145,18 +145,19 @@
if (VMBUS_CHAN_ISPRIMARY(newchan)) {
if (prichan == NULL) {
/* Install the new primary channel */
- TAILQ_INSERT_TAIL(&sc->vmbus_chlist, newchan, ch_link);
- mtx_unlock(&sc->vmbus_chlist_lock);
+ TAILQ_INSERT_TAIL(&sc->vmbus_prichans, newchan,
+ ch_prilink);
+ mtx_unlock(&sc->vmbus_prichan_lock);
return 0;
} else {
- mtx_unlock(&sc->vmbus_chlist_lock);
+ mtx_unlock(&sc->vmbus_prichan_lock);
device_printf(sc->vmbus_dev, "duplicated primary "
"chan%u\n", newchan->ch_id);
return EINVAL;
}
} else { /* Sub-channel */
if (prichan == NULL) {
- mtx_unlock(&sc->vmbus_chlist_lock);
+ mtx_unlock(&sc->vmbus_prichan_lock);
device_printf(sc->vmbus_dev, "no primary chan for "
"chan%u\n", newchan->ch_id);
return EINVAL;
@@ -168,7 +169,7 @@
* XXX refcnt prichan
*/
}
- mtx_unlock(&sc->vmbus_chlist_lock);
+ mtx_unlock(&sc->vmbus_prichan_lock);
/*
* This is a sub-channel; link it with the primary channel.
@@ -406,20 +407,20 @@
{
struct hv_vmbus_channel *chan;
- mtx_lock(&sc->vmbus_chlist_lock);
- while ((chan = TAILQ_FIRST(&sc->vmbus_chlist)) != NULL) {
+ mtx_lock(&sc->vmbus_prichan_lock);
+ while ((chan = TAILQ_FIRST(&sc->vmbus_prichans)) != NULL) {
KASSERT(VMBUS_CHAN_ISPRIMARY(chan), ("not primary channel"));
- TAILQ_REMOVE(&sc->vmbus_chlist, chan, ch_link);
- mtx_unlock(&sc->vmbus_chlist_lock);
+ TAILQ_REMOVE(&sc->vmbus_prichans, chan, ch_prilink);
+ mtx_unlock(&sc->vmbus_prichan_lock);
hv_vmbus_child_device_unregister(chan);
vmbus_chan_free(chan);
- mtx_lock(&sc->vmbus_chlist_lock);
+ mtx_lock(&sc->vmbus_prichan_lock);
}
bzero(sc->vmbus_chmap,
sizeof(struct hv_vmbus_channel *) * VMBUS_CHAN_MAX);
- mtx_unlock(&sc->vmbus_chlist_lock);
+ mtx_unlock(&sc->vmbus_prichan_lock);
}
/**
Index: head/sys/dev/hyperv/vmbus/vmbus.c
===================================================================
--- head/sys/dev/hyperv/vmbus/vmbus.c
+++ head/sys/dev/hyperv/vmbus/vmbus.c
@@ -1104,8 +1104,8 @@
mtx_init(&sc->vmbus_scan_lock, "vmbus scan", NULL, MTX_DEF);
sc->vmbus_gpadl = VMBUS_GPADL_START;
- mtx_init(&sc->vmbus_chlist_lock, "vmbus chlist", NULL, MTX_DEF);
- TAILQ_INIT(&sc->vmbus_chlist);
+ mtx_init(&sc->vmbus_prichan_lock, "vmbus prichan", NULL, MTX_DEF);
+ TAILQ_INIT(&sc->vmbus_prichans);
sc->vmbus_chmap = malloc(
sizeof(struct hv_vmbus_channel *) * VMBUS_CHAN_MAX, M_DEVBUF,
M_WAITOK | M_ZERO);
@@ -1176,7 +1176,7 @@
}
free(sc->vmbus_chmap, M_DEVBUF);
mtx_destroy(&sc->vmbus_scan_lock);
- mtx_destroy(&sc->vmbus_chlist_lock);
+ mtx_destroy(&sc->vmbus_prichan_lock);
return (ret);
}
@@ -1258,7 +1258,7 @@
free(sc->vmbus_chmap, M_DEVBUF);
mtx_destroy(&sc->vmbus_scan_lock);
- mtx_destroy(&sc->vmbus_chlist_lock);
+ mtx_destroy(&sc->vmbus_prichan_lock);
return (0);
}
Index: head/sys/dev/hyperv/vmbus/vmbus_var.h
===================================================================
--- head/sys/dev/hyperv/vmbus/vmbus_var.h
+++ head/sys/dev/hyperv/vmbus/vmbus_var.h
@@ -102,8 +102,9 @@
#define VMBUS_SCAN_CHCNT_DONE 0x80000000
uint32_t vmbus_scan_devcnt;
- struct mtx vmbus_chlist_lock;
- TAILQ_HEAD(, hv_vmbus_channel) vmbus_chlist;
+ /* Primary channels */
+ struct mtx vmbus_prichan_lock;
+ TAILQ_HEAD(, hv_vmbus_channel) vmbus_prichans;
};
#define VMBUS_FLAG_ATTACHED 0x0001 /* vmbus was attached */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Feb 16, 6:22 PM (10 h, 15 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28786207
Default Alt Text
D7111.diff (4 KB)
Attached To
Mode
D7111: hyperv/vmbus: Field renaming to reflect reality
Attached
Detach File
Event Timeline
Log In to Comment