Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102661391
D40746.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D40746.diff
View Options
diff --git a/sys/kern/subr_pctrie.c b/sys/kern/subr_pctrie.c
--- a/sys/kern/subr_pctrie.c
+++ b/sys/kern/subr_pctrie.c
@@ -560,8 +560,9 @@
NULL, PCTRIE_LOCKED);
if (pctrie_isleaf(child)) {
m = pctrie_toval(child);
- if (*m >= index)
- return (m);
+ KASSERT(*m >= index,
+ ("pctrie_lookup_ge: leaf < index"));
+ return (m);
} else if (child != NULL)
goto descend;
} while (slot < (PCTRIE_COUNT - 1));
@@ -677,8 +678,9 @@
NULL, PCTRIE_LOCKED);
if (pctrie_isleaf(child)) {
m = pctrie_toval(child);
- if (*m <= index)
- return (m);
+ KASSERT(*m <= index,
+ ("pctrie_lookup_le: leaf > index"));
+ return (m);
} else if (child != NULL)
goto descend;
} while (slot > 0);
diff --git a/sys/vm/vm_radix.c b/sys/vm/vm_radix.c
--- a/sys/vm/vm_radix.c
+++ b/sys/vm/vm_radix.c
@@ -595,8 +595,9 @@
LOCKED);
if (vm_radix_isleaf(child)) {
m = vm_radix_topage(child);
- if (m->pindex >= index)
- return (m);
+ KASSERT(m->pindex >= index,
+ ("vm_radix_lookup_ge: leaf<index"));
+ return (m);
} else if (child != NULL)
goto descend;
} while (slot < (VM_RADIX_COUNT - 1));
@@ -709,8 +710,9 @@
LOCKED);
if (vm_radix_isleaf(child)) {
m = vm_radix_topage(child);
- if (m->pindex <= index)
- return (m);
+ KASSERT(m->pindex <= index,
+ ("vm_radix_lookup_le: leaf>index"));
+ return (m);
} else if (child != NULL)
goto descend;
} while (slot > 0);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 16, 12:23 PM (21 h, 43 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14658657
Default Alt Text
D40746.diff (1 KB)
Attached To
Mode
D40746: radix_trie: skip needless compare in lookup_le, lookup_ge
Attached
Detach File
Event Timeline
Log In to Comment