*参照元 [#hb909383]
#backlinks

*説明 [#n7c1bfc0]
-パス: [[linux-2.6.25/linux-2.6.25/mm/bounce.c]]

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


**引数 [#q2201762]
-struct request_queue *q
--
-struct bio **bio_orig
--
-mempool_t *pool
--

**返り値 [#m00afb66]
-なし

**参考 [#yb91ccef]


*実装 [#ydc6bd75]
 static void __blk_queue_bounce(struct request_queue *q, struct bio **bio_orig,
                                mempool_t *pool)
 {
         struct page *page;
         struct bio *bio = NULL;
         int i, rw = bio_data_dir(*bio_orig);
         struct bio_vec *to, *from;
-
--[[linux-2.6.25/page]]
--[[linux-2.6.25/bio]]
--[[linux-2.6.25/bio_vec]]
--[[linux-2.6.25/bio_data_dir()]]

         bio_for_each_segment(from, *bio_orig, i) {
                 page = from->bv_page;
-
--[[linux-2.6.25/bio_for_each_segment()]]

                 /*
                  * is destination page below bounce pfn?
                  */
                 if (page_to_pfn(page) <= q->bounce_pfn)
                         continue;
-
--[[linux-2.6.25/page_to_pfn()]]

                 /*
                  * irk, bounce it
                  */
                 if (!bio)
                         bio = bio_alloc(GFP_NOIO, (*bio_orig)->bi_vcnt);
-
--[[linux-2.6.25/bio_alloc()]]

                 to = bio->bi_io_vec + i;
 
                 to->bv_page = mempool_alloc(pool, q->bounce_gfp);
                 to->bv_len = from->bv_len;
                 to->bv_offset = from->bv_offset;
                 inc_zone_page_state(to->bv_page, NR_BOUNCE);
-
--[[linux-2.6.25/mempool_alloc()]]
--[[linux-2.6.25/inc_zone_page_state()]]

                 if (rw == WRITE) {
                         char *vto, *vfrom;
 
                         flush_dcache_page(from->bv_page);
                         vto = page_address(to->bv_page) + to->bv_offset;
                         vfrom = kmap(from->bv_page) + from->bv_offset;
                         memcpy(vto, vfrom, to->bv_len);
                         kunmap(from->bv_page);
-
--[[linux-2.6.25/flush_dcache_page()]]
--[[linux-2.6.25/page_address()]]
--[[linux-2.6.25/kmap()]]
--[[linux-2.6.25/memcpy()]]
--[[linux-2.6.25/kunmap()]]

                 }
         }
 
         /*
          * no pages bounced
          */
         if (!bio)
                 return;
 
         blk_add_trace_bio(q, *bio_orig, BLK_TA_BOUNCE);
-
--[[linux-2.6.25/blk_add_trace_bio()]]

         /*
          * at least one page was bounced, fill in possible non-highmem
          * pages
          */
         __bio_for_each_segment(from, *bio_orig, i, 0) {
-
--[[linux-2.6.25/__bio_for_each_segment()]]

                 to = bio_iovec_idx(bio, i);
                 if (!to->bv_page) {
                         to->bv_page = from->bv_page;
                         to->bv_len = from->bv_len;
                         to->bv_offset = from->bv_offset;
                 }
-
--[[linux-2.6.25/bio_iovec_idx()]]

         }
 
         bio->bi_bdev = (*bio_orig)->bi_bdev;
         bio->bi_flags |= (1 << BIO_BOUNCED);
         bio->bi_sector = (*bio_orig)->bi_sector;
         bio->bi_rw = (*bio_orig)->bi_rw;
 
         bio->bi_vcnt = (*bio_orig)->bi_vcnt;
         bio->bi_idx = (*bio_orig)->bi_idx;
         bio->bi_size = (*bio_orig)->bi_size;
 
         if (pool == page_pool) {
                 bio->bi_end_io = bounce_end_io_write;
                 if (rw == READ)
                         bio->bi_end_io = bounce_end_io_read;
         } else {
                 bio->bi_end_io = bounce_end_io_write_isa;
                 if (rw == READ)
                         bio->bi_end_io = bounce_end_io_read_isa;
         }
 
         bio->bi_private = *bio_orig;
         *bio_orig = bio;
 }

*コメント [#n2353ac7]

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