Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:include\linux\generic-radix-tree.h Create Date:2022-07-28 06:25:31
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:__idx_to_offset

Proto:static inline size_t __idx_to_offset(size_t idx, size_t obj_size)

Type:size_t

Parameter:

TypeParameterName
size_tidx
size_tobj_size
101  If __builtin_constant_p(obj_size) Then BUILD_BUG_ON - break compile if a condition is true(obj_size > PAGE_SIZE)
103  Else BUG_ON(obj_size > PAGE_SIZE)
106  If Not s_power_of_2() - check if a value is a power of two*@n: the value to check* Determine whether some value is a power of two, where zero is* *not* considered a power of two.* Return: true if @n is a power of 2, otherwise false. Then
107  objs_per_page = PAGE_SIZE / obj_size
109  Return idx / objs_per_page * PAGE_SIZE + idx % objs_per_page * obj_size
111  Else
112  Return idx * obj_size