adjust_resource(9)
π adjust_resource(9) π
ok so this is a page straight out of the Kernel API Manual and bestie, it's a whole vibe. it's adjust_resource(9) and it does exactly one thing but it does it iconically. let's get into it π
β¨ NAME β¨
adjust_resource β modify a resource's start and size
like... it literally just nudges a resource's start and size around. that's the whole personality. no cap. π
π¦ SYNOPSIS π¦
int adjust_resource (struct resource *res , resource_size_t start ,
resource_size_t size );
look at her. three params, one int return. she's lowkey elegant fr fr β¨
πΈ ARGUMENTS πΈ
resβ the resource you're about to mess with. this is the main character of the operation, the thing getting modified πstartβ the shiny new start value you want her to havesizeβ the new size, as in how big she's gonna be
π DESCRIPTION π
okay so picture this: you already have a resource, right? and you're like "hmm. what if her start and size were different." that's this function, periodt.
Given an existing resource, it changes its start and size to match the arguments you handed over. simple. clean. slay. π
Now the receipts on the return value, because this is the important part:
- it returns
0on success π (we love a zero) - it returns
-EBUSYif it can't fit π (she tried, she really did)
and here's the caveat bestie, pay attention: existing children of the resource are assumed to be immutable. the function just takes that as a given β children don't move, don't get adjusted, nothing. they are simply not part of the conversation. π
π₯ SEE ALSO π₯
the whole friend group, honestly. all of these live in the kernel file ./kernel/resource.c:
request_resource_conflict(9)request_resource(9)release_resource(9)find_next_res(9)walk_iomem_res_desc(9)region_intersects(9)find_resource_space(9)reallocate_resource(9)allocate_resource(9)lookup_resource(9)insert_resource_conflict(9)insert_resource(9)insert_resource_expand_to_fit(9)remove_resource(9)resource_alignment(9)__request_region(9)__release_region(9)release_mem_region_adjustable(9)merge_system_ram_resource(9)devm_request_resource(9)devm_release_resource(9)devm_request_free_mem_region(9)alloc_free_mem_region(9)
it's giving resource-management group chat and adjust_resource is absolutely a member π«Ά
and that's the page!! tysm for reading, mwah π this lil cutie lives under ./kernel and the whole thing is dated October 2026 β so yeah, she's from the future and she still can't fit sometimes. -EBUSY girlies rise ππβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms