*参照元 [#odc6193b]
#backlinks

*説明 [#vdea77da]
-パス: [[linux-2.6.33/mm/filemap.c]]

-FIXME: これは何?
--説明


**引数 [#v09f9701]
-struct address_space *mapping
--
--[[linux-2.6.33/address_space]]
-loff_t start_byte
--
-loff_t end_byte
--


**返り値 [#a9cd122f]
-int
--


**参考 [#vca99c51]


*実装 [#z7507eab]
 /**
  * filemap_fdatawait_range - wait for writeback to complete
  * @mapping:		address space structure to wait for
  * @start_byte:		offset in bytes where the range starts
  * @end_byte:		offset in bytes where the range ends (inclusive)
  *
  * Walk the list of under-writeback pages of the given address space
  * in the given range and wait for all of them.
  */
 int filemap_fdatawait_range(struct address_space *mapping, loff_t start_byte,
 			    loff_t end_byte)
 {
 	pgoff_t index = start_byte >> PAGE_CACHE_SHIFT;
 	pgoff_t end = end_byte >> PAGE_CACHE_SHIFT;
 	struct pagevec pvec;
 	int nr_pages;
 	int ret = 0;
 
-
--[[linux-2.6.33/pagevec]]

 	if (end_byte < start_byte)
 		return 0;
 
 	pagevec_init(&pvec, 0);
-
--[[linux-2.6.33/pagevec_init()]]

 	while ((index <= end) &&
 			(nr_pages = pagevec_lookup_tag(&pvec, mapping, &index,
 			PAGECACHE_TAG_WRITEBACK,
 			min(end - index, (pgoff_t)PAGEVEC_SIZE-1) + 1)) != 0) {
 		unsigned i;
 
-
--[[linux-2.6.33/pagevec_lookup_tag()]]

 		for (i = 0; i < nr_pages; i++) {
 			struct page *page = pvec.pages[i];
 
-
--[[linux-2.6.33/page]]

 			/* until radix tree lookup accepts end_index */
 			if (page->index > end)
 				continue;
 
 			wait_on_page_writeback(page);
 			if (PageError(page))
 				ret = -EIO;
-
--[[linux-2.6.33/wait_on_page_writeback()]]
--[[linux-2.6.33/PageError()]]

 		}
 		pagevec_release(&pvec);
-
--[[linux-2.6.33/pagevec_release()]]

 		cond_resched();
-
--[[linux-2.6.33/cond_resched()]]

 	}
 
 	/* Check for outstanding write errors */
 	if (test_and_clear_bit(AS_ENOSPC, &mapping->flags))
 		ret = -ENOSPC;
-
--[[linux-2.6.33/test_and_clear_bit()]]

 	if (test_and_clear_bit(AS_EIO, &mapping->flags))
 		ret = -EIO;
 
-
--[[linux-2.6.33/test_and_clear_bit()]]

 	return ret;
 }
 EXPORT_SYMBOL(filemap_fdatawait_range);
-特にライセンスを区別せずシンボルを公開する。
--[[linux-2.6.33/EXPORT_SYMBOL()]]


*コメント [#f72cce09]


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