History

resource: Pass full extent of empty space to resource_alignf callback

__find_resource_space() calculates the full extent of empty space but only passes the aligned space to resource_alignf callback. In some situations, the callback may choose take advantage of the free space before the requested alignment. Pass the full extent of the calculated empty space to resource_alignf callback as an additional parameter.

Ilpo Järvinen committed 7 months ago

Commit f699bcc1 parent edfaa8116 files · +35 −13Browse files

Showing the changes to kernel (1 of 16 files). Show all

Unified · Split

kernel/resource.c+2−1
@@ -759,7 +759,8 @@ static int __find_resource_space(struct resource *root, struct resource *old, · 758 unmodified lines
759759 alloc.flags = avail.flags;
760760 if (alignf) {
761761 alloc.start = alignf(constraint->alignf_data,
762− &avail, size, constraint->align);
762+ &avail, &tmp,
763+ size, constraint->align);
763764 } else {
764765 alloc.start = avail.start;
765766 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t