Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:__blkdev_issue_write_same - generate number of bios with same page*@bdev: target blockdev*@sector: start sector*@nr_sects: number of sectors to write*@gfp_mask: memory allocation flags (for bio_alloc)*@page: page containing data to write*@biop: pointer to

Proto:static int __blkdev_issue_write_same(struct block_device *bdev, sector_t sector, sector_t nr_sects, gfp_t gfp_mask, struct page *page, struct bio **biop)

Type:int

Parameter:

TypeParameterName
struct block_device *bdev
sector_tsector
sector_tnr_sects
gfp_tgfp_mask
struct page *page
struct bio **biop
135  q = bdev_get_queue(bdev)
137  bio = biop
140  If Not q Then Return -ENXIO
143  If bdev_read_only(bdev) Then Return -EPERM
146  bs_mask = (bdev_logical_block_size(bdev) >> 9) - 1
147  If (sector | nr_sects) & bs_mask Then Return -EINVAL
150  If Not bdev_write_same(bdev) Then Return -EOPNOTSUPP
154  max_write_same_sectors = The max size one bio can handle is UINT_MAX becasue bvec_iter.bi_size* is defined as 'unsigned int', meantime it has to aligned to with logical* block size which is the minimum accepted unit by hardware.
156  When nr_sects cycle
157  bio = blk_next_bio(bio, 1, gfp_mask)
158  device address in 512 byte sectors = sector
159  bio_set_dev(bio, bdev)
160  how many bio_vec's = 1
161  bv_page = page
162  bv_offset = 0
163  bv_len = bdev_logical_block_size(bdev)
164  bsolete, don't use in new code
170  Else
172  nr_sects = 0
174  cond_resched()
177  biop = bio
178  Return 0
Caller
NameDescribe
blkdev_issue_write_samelkdev_issue_write_same - queue a write same operation*@bdev: target blockdev*@sector: start sector*@nr_sects: number of sectors to write*@gfp_mask: memory allocation flags (for bio_alloc)*@page: page containing data* Description: