linux-2.6.33/page_cache_async_readahead()
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
*参照元 [#h74e201f]
#backlinks
*説明 [#f9f927b7]
-パス: [[linux-2.6.33/mm/readahead.c]]
-FIXME: これは何?
--説明
**引数 [#u032cdd4]
-struct address_space *mapping
--[[linux-2.6.33/address_space]]
-struct file_ra_state *ra
--[[linux-2.6.33/file_ra_state]]
-struct file *filp
--[[linux-2.6.33/file]]
-struct page *page
--[[linux-2.6.33/page]]
-pgoff_t offset
--
-unsigned long req_size
--
**返り値 [#m063ce4c]
-なし
**参考 [#q03b54cb]
*実装 [#we862e32]
/**
* page_cache_async_readahead - file readahead for marke...
* @mapping: address_space which holds the pagecache and...
* @ra: file_ra_state which holds the readahead state
* @filp: passed on to ->readpage() and ->readpages()
* @page: the page at @offset which has the PG_readahead...
* @offset: start offset into @mapping, in pagecache pag...
* @req_size: hint: total size of the read which the cal...
* pagecache pages
*
* page_cache_async_ondemand() should be called when a p...
* has the PG_readahead flag; this is a marker to sugges...
* has used up enough of the readahead window that we sh...
* more pages.
*/
void
page_cache_async_readahead(struct address_space *mapping,
struct file_ra_state *ra, struct file *filp,
struct page *page, pgoff_t offset,
unsigned long req_size)
{
/* no read-ahead */
if (!ra->ra_pages)
return;
/*
* Same bit is used for PG_readahead and PG_reclaim.
*/
if (PageWriteback(page))
return;
-
--[[linux-2.6.33/PageWriteback()]]
ClearPageReadahead(page);
-
--[[linux-2.6.33/ClearPageReadahead()]]
/*
* Defer asynchronous read-ahead on IO congestion.
*/
if (bdi_read_congested(mapping->backing_dev_info))
return;
-
--[[linux-2.6.33/bdi_read_congested()]]
/* do read-ahead */
ondemand_readahead(mapping, ra, filp, true, offset, req...
-
--[[linux-2.6.33/ondemand_readahead()]]
#ifdef CONFIG_BLOCK
/*
* Normally the current page is !uptodate and lock_page...
* immediately called to implicitly unplug the device. ...
* is not always true for RAID conifgurations, where da...
* not strictly in their submission order. In this case...
* explicitly kick off the IO.
*/
if (PageUptodate(page))
blk_run_backing_dev(mapping->backing_dev_info, NULL);
-
--[[linux-2.6.33/PageUptodate()]]
-
--[[linux-2.6.33/blk_run_backing_dev()]]
#endif
}
EXPORT_SYMBOL_GPL(page_cache_async_readahead);
--カーネルのシンボルテーブル(GPL 用)にエクスポートする。
--[[linux-2.6.33/EXPORT_SYMBOL_GPL()]]
*コメント [#id9dd849]
終了行:
*参照元 [#h74e201f]
#backlinks
*説明 [#f9f927b7]
-パス: [[linux-2.6.33/mm/readahead.c]]
-FIXME: これは何?
--説明
**引数 [#u032cdd4]
-struct address_space *mapping
--[[linux-2.6.33/address_space]]
-struct file_ra_state *ra
--[[linux-2.6.33/file_ra_state]]
-struct file *filp
--[[linux-2.6.33/file]]
-struct page *page
--[[linux-2.6.33/page]]
-pgoff_t offset
--
-unsigned long req_size
--
**返り値 [#m063ce4c]
-なし
**参考 [#q03b54cb]
*実装 [#we862e32]
/**
* page_cache_async_readahead - file readahead for marke...
* @mapping: address_space which holds the pagecache and...
* @ra: file_ra_state which holds the readahead state
* @filp: passed on to ->readpage() and ->readpages()
* @page: the page at @offset which has the PG_readahead...
* @offset: start offset into @mapping, in pagecache pag...
* @req_size: hint: total size of the read which the cal...
* pagecache pages
*
* page_cache_async_ondemand() should be called when a p...
* has the PG_readahead flag; this is a marker to sugges...
* has used up enough of the readahead window that we sh...
* more pages.
*/
void
page_cache_async_readahead(struct address_space *mapping,
struct file_ra_state *ra, struct file *filp,
struct page *page, pgoff_t offset,
unsigned long req_size)
{
/* no read-ahead */
if (!ra->ra_pages)
return;
/*
* Same bit is used for PG_readahead and PG_reclaim.
*/
if (PageWriteback(page))
return;
-
--[[linux-2.6.33/PageWriteback()]]
ClearPageReadahead(page);
-
--[[linux-2.6.33/ClearPageReadahead()]]
/*
* Defer asynchronous read-ahead on IO congestion.
*/
if (bdi_read_congested(mapping->backing_dev_info))
return;
-
--[[linux-2.6.33/bdi_read_congested()]]
/* do read-ahead */
ondemand_readahead(mapping, ra, filp, true, offset, req...
-
--[[linux-2.6.33/ondemand_readahead()]]
#ifdef CONFIG_BLOCK
/*
* Normally the current page is !uptodate and lock_page...
* immediately called to implicitly unplug the device. ...
* is not always true for RAID conifgurations, where da...
* not strictly in their submission order. In this case...
* explicitly kick off the IO.
*/
if (PageUptodate(page))
blk_run_backing_dev(mapping->backing_dev_info, NULL);
-
--[[linux-2.6.33/PageUptodate()]]
-
--[[linux-2.6.33/blk_run_backing_dev()]]
#endif
}
EXPORT_SYMBOL_GPL(page_cache_async_readahead);
--カーネルのシンボルテーブル(GPL 用)にエクスポートする。
--[[linux-2.6.33/EXPORT_SYMBOL_GPL()]]
*コメント [#id9dd849]
ページ名: