Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:block\bounce.c Create Date:2022-07-28 17:33:25
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:__blk_queue_bounce

Proto:static void __blk_queue_bounce(struct request_queue *q, struct bio **bio_orig, mempool_t *pool)

Type:void

Parameter:

TypeParameterName
struct request_queue *q
struct bio **bio_orig
mempool_t *pool
290  rw = Return the data direction, READ or WRITE.( * bio_orig)
293  i = 0
294  bool bounce = false
295  sectors = 0
296  passthrough = bio_is_passthrough( * bio_orig)
298  bio_for_each_segment(from, * bio_orig, iter)
299  If i++ < BIO_MAX_PAGES Then sectors += bv_len >> 9
301  If page_to_pfn(bv_page) > bounce_pfn Then bounce = true
304  If Not bounce Then Return
307  If Not passthrough && sectors < bio_sectors( * bio_orig) Then
308  bio = _split - split a bio*@bio: bio to split*@sectors: number of sectors to split from the front of @bio*@gfp: gfp mask*@bs: bio set to allocate from* Allocates and returns a new bio which represents @sectors from the start of
309  _chain - chain bio completions*@bio: the target bio*@parent: the @bio's parent bio* The caller won't have a bi_end_io called when @bio completes - instead,*@parent's bi_end_io won't be called until both @parent and @bio have
310  generic_make_request - hand a buffer to its device driver for I/O*@bio: The bio describing the location in memory and on the device.* generic_make_request() is used to make I/O requests of block* devices
311  bio_orig = bio
313  bio = bounce_clone_bio( * bio_orig, GFP_NOIO, passthrough ? NULL : & bounce_bio_set)
321  When i < how many bio_vec's cycle
322  page = bv_page
324  If page_to_pfn(page) <= bounce_pfn Then Continue
327  bv_page = mempool_alloc - allocate an element from a specific memory pool*@pool: pointer to the memory pool which was allocated via* mempool_create().*@gfp_mask: the usual allocation bitmask.* this function only sleeps if the alloc_fn() function sleeps or
328  We only use atomic operations to update counters. So there is no need to* disable interrupts.(bv_page, NR_BOUNCE)
330  If rw == WRITE Then
337  memcpy(vto, vfrom, bv_len)
342  lock_bio_bounce - used bounce buffer when processing block operation*@q: queue holding the block operation*@bio: block operation* A bounce buffer was used to handle the block operation @bio in @q
344  status, etc and bvec pool number |= 1 << BIO_BOUNCED
346  If pool == page_pool Then
347  bi_end_io = bounce_end_io_write
348  If rw == generic data direction definitions Then bi_end_io = bounce_end_io_read
350  Else
351  bi_end_io = bounce_end_io_write_isa
352  If rw == generic data direction definitions Then bi_end_io = bounce_end_io_read_isa
356  bi_private = bio_orig
357  bio_orig = bio
Caller
NameDescribe
blk_queue_bounce