linux-4.4.1/bitmap_find_free_region()
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
*参照元 [#t1639f62]
#backlinks
*説明 [#e7f5e4fe]
-パス: [[linux-4.4.1/lib/bitmap.c]]
-FIXME: これは何?
--説明
**引数 [#xbb1bc1f]
-unsigned long *bitmap
--
-unsigned int bits
--
-int order
--
**返り値 [#l71c2335]
-int
--
**参考 [#m3f37584]
*実装 [#ne3fa367]
/**
* bitmap_find_free_region - find a contiguous aligned m...
* @bitmap: array of unsigned longs corresponding t...
* @bits: number of bits in the bitmap
* @order: region size (log base 2 of number of bit...
*
* Find a region of free (zero) bits in a @bitmap of @bi...
* allocate them (set them to one). Only consider regio...
* a power (@order) of two, aligned to that power of two...
* makes the search algorithm much faster.
*
* Return the bit offset in bitmap of the allocated regi...
* or -errno on failure.
*/
int bitmap_find_free_region(unsigned long *bitmap, unsig...
{
unsigned int pos, end; /* scans bitmap ...
for (pos = 0 ; (end = pos + (1U << order)) <= bi...
if (!__reg_op(bitmap, pos, order, REG_OP...
continue;
__reg_op(bitmap, pos, order, REG_OP_ALLO...
return pos;
}
-
--[[linux-4.4.1/__reg_op()]]
return -ENOMEM;
}
EXPORT_SYMBOL(bitmap_find_free_region);
-
--[[linux-4.4.1/EXPORT_SYMBOL()]]
*コメント [#i1b1d947]
終了行:
*参照元 [#t1639f62]
#backlinks
*説明 [#e7f5e4fe]
-パス: [[linux-4.4.1/lib/bitmap.c]]
-FIXME: これは何?
--説明
**引数 [#xbb1bc1f]
-unsigned long *bitmap
--
-unsigned int bits
--
-int order
--
**返り値 [#l71c2335]
-int
--
**参考 [#m3f37584]
*実装 [#ne3fa367]
/**
* bitmap_find_free_region - find a contiguous aligned m...
* @bitmap: array of unsigned longs corresponding t...
* @bits: number of bits in the bitmap
* @order: region size (log base 2 of number of bit...
*
* Find a region of free (zero) bits in a @bitmap of @bi...
* allocate them (set them to one). Only consider regio...
* a power (@order) of two, aligned to that power of two...
* makes the search algorithm much faster.
*
* Return the bit offset in bitmap of the allocated regi...
* or -errno on failure.
*/
int bitmap_find_free_region(unsigned long *bitmap, unsig...
{
unsigned int pos, end; /* scans bitmap ...
for (pos = 0 ; (end = pos + (1U << order)) <= bi...
if (!__reg_op(bitmap, pos, order, REG_OP...
continue;
__reg_op(bitmap, pos, order, REG_OP_ALLO...
return pos;
}
-
--[[linux-4.4.1/__reg_op()]]
return -ENOMEM;
}
EXPORT_SYMBOL(bitmap_find_free_region);
-
--[[linux-4.4.1/EXPORT_SYMBOL()]]
*コメント [#i1b1d947]
ページ名: