kernel & add-ons: Adjustments to use DoublyLinkedList::InsertBefore.
The Insert(before, element) function has been marked deprecated since 2010, but still had many usage and kept accumulating more. It's long past time we got rid of all them and actually deprecated the function itself. Insert(before, element) just calls InsertBefore, so no functional change.
This commit is contained in:
@@ -113,7 +113,7 @@ UnpackingDirectory::AddPackageNode(PackageNode* packageNode, dev_t deviceID)
|
|||||||
|| packageDirectory->HasPrecedenceOver(other);
|
|| packageDirectory->HasPrecedenceOver(other);
|
||||||
|
|
||||||
if (overridesHead) {
|
if (overridesHead) {
|
||||||
fPackageDirectories.Insert(other, packageDirectory);
|
fPackageDirectories.InsertBefore(other, packageDirectory);
|
||||||
NodeReinitVFS(deviceID, fID, packageDirectory, other, fFlags);
|
NodeReinitVFS(deviceID, fID, packageDirectory, other, fFlags);
|
||||||
} else
|
} else
|
||||||
fPackageDirectories.Add(packageDirectory);
|
fPackageDirectories.Add(packageDirectory);
|
||||||
@@ -141,7 +141,7 @@ UnpackingDirectory::RemovePackageNode(PackageNode* packageNode, dev_t deviceID)
|
|||||||
}
|
}
|
||||||
|
|
||||||
fPackageDirectories.Remove(newestNode);
|
fPackageDirectories.Remove(newestNode);
|
||||||
fPackageDirectories.Insert(fPackageDirectories.Head(), newestNode);
|
fPackageDirectories.InsertBefore(fPackageDirectories.Head(), newestNode);
|
||||||
NodeReinitVFS(deviceID, fID, newestNode, packageNode, fFlags);
|
NodeReinitVFS(deviceID, fID, newestNode, packageNode, fFlags);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -331,11 +331,11 @@ FragmentPacket::AddFragment(uint16 start, uint16 end, net_buffer* buffer,
|
|||||||
status_t status = gBufferModule->merge(buffer, previous, false);
|
status_t status = gBufferModule->merge(buffer, previous, false);
|
||||||
TRACE(" merge previous: %s", strerror(status));
|
TRACE(" merge previous: %s", strerror(status));
|
||||||
if (status != B_OK) {
|
if (status != B_OK) {
|
||||||
fFragments.Insert(next, previous);
|
fFragments.InsertBefore(next, previous);
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
fFragments.Insert(next, buffer);
|
fFragments.InsertBefore(next, buffer);
|
||||||
|
|
||||||
// cut down existing hole
|
// cut down existing hole
|
||||||
fBytesLeft -= end - start;
|
fBytesLeft -= end - start;
|
||||||
@@ -359,11 +359,11 @@ FragmentPacket::AddFragment(uint16 start, uint16 end, net_buffer* buffer,
|
|||||||
TRACE(" merge next: %s", strerror(status));
|
TRACE(" merge next: %s", strerror(status));
|
||||||
if (status != B_OK) {
|
if (status != B_OK) {
|
||||||
// Insert "next" at its previous position
|
// Insert "next" at its previous position
|
||||||
fFragments.Insert(afterNext, next);
|
fFragments.InsertBefore(afterNext, next);
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
fFragments.Insert(afterNext, buffer);
|
fFragments.InsertBefore(afterNext, buffer);
|
||||||
|
|
||||||
// cut down existing hole
|
// cut down existing hole
|
||||||
fBytesLeft -= end - start;
|
fBytesLeft -= end - start;
|
||||||
@@ -384,7 +384,7 @@ FragmentPacket::AddFragment(uint16 start, uint16 end, net_buffer* buffer,
|
|||||||
|
|
||||||
buffer->fragment.start = start;
|
buffer->fragment.start = start;
|
||||||
buffer->fragment.end = end;
|
buffer->fragment.end = end;
|
||||||
fFragments.Insert(next, buffer);
|
fFragments.InsertBefore(next, buffer);
|
||||||
|
|
||||||
// update length of the hole, if any
|
// update length of the hole, if any
|
||||||
fBytesLeft -= end - start;
|
fBytesLeft -= end - start;
|
||||||
|
|||||||
@@ -370,11 +370,11 @@ FragmentPacket::AddFragment(uint16 start, uint16 end, net_buffer* buffer,
|
|||||||
status_t status = gBufferModule->merge(buffer, previous, false);
|
status_t status = gBufferModule->merge(buffer, previous, false);
|
||||||
TRACE(" merge previous: %s", strerror(status));
|
TRACE(" merge previous: %s", strerror(status));
|
||||||
if (status != B_OK) {
|
if (status != B_OK) {
|
||||||
fFragments.Insert(next, previous);
|
fFragments.InsertBefore(next, previous);
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
fFragments.Insert(next, buffer);
|
fFragments.InsertBefore(next, buffer);
|
||||||
|
|
||||||
// cut down existing hole
|
// cut down existing hole
|
||||||
fBytesLeft -= end - start;
|
fBytesLeft -= end - start;
|
||||||
@@ -398,11 +398,11 @@ FragmentPacket::AddFragment(uint16 start, uint16 end, net_buffer* buffer,
|
|||||||
TRACE(" merge next: %s", strerror(status));
|
TRACE(" merge next: %s", strerror(status));
|
||||||
if (status != B_OK) {
|
if (status != B_OK) {
|
||||||
// Insert "next" at its previous position
|
// Insert "next" at its previous position
|
||||||
fFragments.Insert(afterNext, next);
|
fFragments.InsertBefore(afterNext, next);
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
fFragments.Insert(afterNext, buffer);
|
fFragments.InsertBefore(afterNext, buffer);
|
||||||
|
|
||||||
// cut down existing hole
|
// cut down existing hole
|
||||||
fBytesLeft -= end - start;
|
fBytesLeft -= end - start;
|
||||||
@@ -423,7 +423,7 @@ FragmentPacket::AddFragment(uint16 start, uint16 end, net_buffer* buffer,
|
|||||||
|
|
||||||
buffer->fragment.start = start;
|
buffer->fragment.start = start;
|
||||||
buffer->fragment.end = end;
|
buffer->fragment.end = end;
|
||||||
fFragments.Insert(next, buffer);
|
fFragments.InsertBefore(next, buffer);
|
||||||
|
|
||||||
// update length of the hole, if any
|
// update length of the hole, if any
|
||||||
fBytesLeft -= end - start;
|
fBytesLeft -= end - start;
|
||||||
|
|||||||
@@ -198,7 +198,7 @@ BufferQueue::Add(net_buffer *buffer, tcp_sequence sequence)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
fList.Insert(next, buffer);
|
fList.InsertBefore(next, buffer);
|
||||||
buffer->sequence = sequence.Number();
|
buffer->sequence = sequence.Number();
|
||||||
fNumBytes += buffer->size;
|
fNumBytes += buffer->size;
|
||||||
|
|
||||||
|
|||||||
@@ -513,7 +513,7 @@ add_route(struct net_domain* _domain, const struct net_route* newRoute)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
domain->routes.Insert(before, route);
|
domain->routes.InsertBefore(before, route);
|
||||||
update_route_infos(domain);
|
update_route_infos(domain);
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
|
|||||||
+1
-1
@@ -2549,7 +2549,7 @@ get_next_locked_block_cache(block_cache* last)
|
|||||||
|
|
||||||
if (cache != NULL) {
|
if (cache != NULL) {
|
||||||
mutex_lock(&cache->lock);
|
mutex_lock(&cache->lock);
|
||||||
sCaches.Insert(sCaches.GetNext(cache), (block_cache*)&sMarkCache);
|
sCaches.InsertBefore(sCaches.GetNext(cache), (block_cache*)&sMarkCache);
|
||||||
}
|
}
|
||||||
|
|
||||||
return cache;
|
return cache;
|
||||||
|
|||||||
@@ -679,7 +679,7 @@ panic("no more requests for owner %p (thread %" B_PRId32 ")", owner, owner->thre
|
|||||||
// insert our marker, since the owner will be gone in the next
|
// insert our marker, since the owner will be gone in the next
|
||||||
// iteration.
|
// iteration.
|
||||||
if (owner->requests.IsEmpty()) {
|
if (owner->requests.IsEmpty()) {
|
||||||
fActiveRequestOwners.Insert(owner, &marker);
|
fActiveRequestOwners.InsertBefore(owner, &marker);
|
||||||
owner = NULL;
|
owner = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1485,7 +1485,7 @@ device_node::AddChild(device_node* node)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fChildren.Insert(before, node);
|
fChildren.InsertBefore(before, node);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -8009,7 +8009,7 @@ fs_sync(dev_t device)
|
|||||||
|
|
||||||
if (vnode != NULL) {
|
if (vnode != NULL) {
|
||||||
// insert marker vnode again
|
// insert marker vnode again
|
||||||
mount->vnodes.Insert(mount->vnodes.GetNext(vnode), &marker);
|
mount->vnodes.InsertBefore(mount->vnodes.GetNext(vnode), &marker);
|
||||||
marker.SetRemoved(false);
|
marker.SetRemoved(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -488,7 +488,7 @@ register_low_resource_handler(low_resource_func function, void* data,
|
|||||||
low_resource_handler *handler = iterator.Next();
|
low_resource_handler *handler = iterator.Next();
|
||||||
|
|
||||||
if (handler->priority >= priority) {
|
if (handler->priority >= priority) {
|
||||||
sLowResourceHandlers.Insert(last, newHandler);
|
sLowResourceHandlers.InsertBefore(last, newHandler);
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
last = handler;
|
last = handler;
|
||||||
|
|||||||
@@ -545,7 +545,7 @@ VMKernelAddressSpace::_InsertRange(Range* range)
|
|||||||
|
|
||||||
// insert at the correct position in the range list
|
// insert at the correct position in the range list
|
||||||
Range* insertBeforeRange = fRangeTree.FindClosest(range->base, true);
|
Range* insertBeforeRange = fRangeTree.FindClosest(range->base, true);
|
||||||
fRangeList.Insert(
|
fRangeList.InsertBefore(
|
||||||
insertBeforeRange != NULL
|
insertBeforeRange != NULL
|
||||||
? fRangeList.GetNext(insertBeforeRange) : fRangeList.Head(),
|
? fRangeList.GetNext(insertBeforeRange) : fRangeList.Head(),
|
||||||
range);
|
range);
|
||||||
|
|||||||
Reference in New Issue
Block a user