Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name: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:

Proto:int blkdev_issue_discard(struct block_device *bdev, sector_t sector, sector_t nr_sects, gfp_t gfp_mask, unsigned long flags)

Type:int

Parameter:

TypeParameterName
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  If Not ret && bio Then
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  If ret == -EOPNOTSUPP Then ret = 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  Return ret
Caller
NameDescribe
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