函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:block\blk-lib.c Create Date:2022-07-27 18:42:32
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:lkdev_issue_discard - queue a discard*@bdev: blockdev to issue discard for*@sector: start sector*@nr_sects: number of sectors to discard*@gfp_mask: memory allocation flags (for bio_alloc)*@flags: BLKDEV_DISCARD_* flags to control behaviour* Description:

函数原型:int blkdev_issue_discard(struct block_device *bdev, sector_t sector, sector_t nr_sects, gfp_t gfp_mask, unsigned long flags)

返回类型:int

参数:

类型参数名称
struct block_device *bdev
sector_tsector
sector_tnr_sects
gfp_tgfp_mask
unsigned longflags
100  struct bio * bio = NULL
104  lk_start_plug - initialize blk_plug and track it inside the task_struct*@plug: The &struct blk_plug that needs to be initialized* Description:* blk_start_plug() indicates to the block layer an intent by the caller
105  ret等于__blkdev_issue_discard(bdev, sector, nr_sects, gfp_mask, flags, & bio)
107  如果非retbio
108  ret等于submit_bio_wait - submit a bio, and wait until it completes*@bio: The &struct bio which describes the I/O* Simple wrapper around submit_bio()
109  如果ret恒等于负EOPNOTSUPPret等于0
111  _put - release a reference to a bio*@bio: bio to release reference to* Description:* Put a reference to a &struct bio, either one you have gotten with* bio_alloc, bio_get or bio_clone_*. The last put of a bio will free it.
113  lk_finish_plug - mark the end of a batch of submitted I/O*@plug: The &struct blk_plug passed to blk_start_plug()* Description:* Indicate that a batch of I/O submissions is complete. This function* must be paired with an initial call to blk_start_plug()
115  返回:ret
调用者
名称描述
discard_swapswapon tell device that all the old swap contents can be discarded,* to allow the swap device to optimize its wear-levelling.
discard_swap_clusterswap allocation tell device that a cluster of swap can now be discarded,* to allow the swap device to optimize its wear-levelling.
blk_ioctl_discard