Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\resource.c Create Date:2022-07-28 09:05:14
Last Modify:2022-05-22 11:14:39 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:allocate_resource - allocate a slot in the resource tree given range & alignment

Proto:static int reallocate_resource(struct resource *root, struct resource *old, resource_size_t newsize, struct resource_constraint *constraint)

Type:int

Parameter:

TypeParameterName
struct resource *root
struct resource *old
resource_size_tnewsize
struct resource_constraint *constraint
672  err = 0
673  new = old
676  write_lock( & resource_lock)
678  If err = Find empty slot in the resource tree with the given range and* alignment constraints Then Go to out
681  If True iff r1 completely contains r2 Then
682  start = start
683  end = end
684  Go to out
687  If child Then
688  err = -EBUSY
689  Go to out
692  If True iff r1 completely contains r2 Then
693  start = start
694  end = end
695  Else
696  __release_resource(old, true)
697  old = new
698  conflict = Return the conflict entry if you can't request it
699  BUG_ON(conflict)
701  out :
702  write_unlock( & resource_lock)
703  Return err
Caller
NameDescribe
allocate_resourceallocate_resource - allocate empty slot in the resource tree given range & alignment