*参照元 [#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 marked pages
  * @mapping: address_space which holds the pagecache and I/O vectors
  * @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 flag set
  * @offset: start offset into @mapping, in pagecache page-sized units
  * @req_size: hint: total size of the read which the caller is performing in
  *            pagecache pages
  *
  * page_cache_async_ondemand() should be called when a page is used which
  * has the PG_readahead flag; this is a marker to suggest that the application
  * has used up enough of the readahead window that we should start pulling in
  * 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_size);
 
-
--[[linux-2.6.33/ondemand_readahead()]]

 #ifdef CONFIG_BLOCK
 	/*
 	 * Normally the current page is !uptodate and lock_page() will be
 	 * immediately called to implicitly unplug the device. However this
 	 * is not always true for RAID conifgurations, where data arrives
 	 * not strictly in their submission order. In this case we need to
 	 * 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]

トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS