- 追加された行はこの色です。
- 削除された行はこの色です。
*参照元 [#je6472a2]
#backlinks
*説明 [#i87cc72c]
-パス: [[linux-2.6.33/include/linux/page-flags.h]]
-PG_uptodate ビットのテスト
--指定されたページのフラグ(flags メンバ)に
PG_uptodate ビットが立っているかテストする。
--このフラグは他の CPU から更新されている場合があるため、
読み込みメモリバリアが必要。
PG_uptodate ビットをセットする。
--このフラグは他の CPU が読み出そうとしている場合があるため、
書き込みメモリバリアが必要。
**引数 [#m2468e41]
-struct page *page
--フラグを検査するページ構造体
--[[linux-2.6.33/page]]
**返り値 [#mb524d27]
-int(おそらく)
--型、意味は test_bit() に準じる。
--型はおそらく int。意味はビットがセットされていれば 0 以外、ビットがセットされていなければ 0 が返る、ことが多い。
-なし
**参考 [#p0c8b4f5]
-ページの属性フラグ(PG_xxxx)
--[[linux-2.6.33/pageflags]]
-この関数の片割れ(セット関数)
--[[linux-2.6.33/SetPageUptodate()]]
-この関数の片割れ(テスト関数)
--[[linux-2.6.33/PageUptodate()]]
*実装 [#ra9382e1]
static inline void SetPageUptodate(struct page *page)
{
#ifdef CONFIG_S390
if (!test_and_set_bit(PG_uptodate, &page->flags))
page_clear_dirty(page);
-FIXME: IBM S/390 の場合は特別な処理が必要なようだが、
理由はわからない。
--[[linux-2.6.33/test_and_set_bit()]]
--[[linux-2.6.33/page_clear_dirty()]]
#else
/*
* Memory barrier must be issued before setting the PG_uptodate bit,
* so that all previous stores issued in order to bring the page
* uptodate are actually visible before PageUptodate becomes true.
*
* s390 doesn't need an explicit smp_wmb here because the test and
* set bit already provides full barriers.
*/
smp_wmb();
-書き込みメモリバリア。
--[[linux-2.6.33/smp_wmb()]]
set_bit(PG_uptodate, &(page)->flags);
-ビット位置にビットをセットする。
--[[linux-2.6.33/set_bit()]]
#endif
}
*コメント [#xf59aa5c]