Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:blk_ioctl_discard

Proto:static int blk_ioctl_discard(struct block_device *bdev, fmode_t mode, unsigned long arg, unsigned long flags)

Type:int

Parameter:

TypeParameterName
struct block_device *bdev
fmode_tmode
unsigned longarg
unsigned longflags
179  q = bdev_get_queue(bdev)
180  mapping = i_mapping
183  If Not (mode & le is open for writing ) Then Return -EBADF
186  If Not blk_queue_discard(q) Then Return -EOPNOTSUPP
189  If copy_from_user(range, (void__user * )arg, size of range ) Then Return -EFAULT
192  start = range[0]
193  len = range[1]
195  If start & 511 Then Return -EINVAL
197  If len & 511 Then Return -EINVAL
200  If start + len > NOTE: in a 32bit arch with a preemptable kernel and* an UP compile the i_size_read/write must be atomic* with respect to the local cpu (unlike with preempt disabled),* but they don't need to be atomic with respect to other cpus like in* true SMP (so they Then Return -EINVAL
202  runcate_inode_pages_range - truncate range of pages specified by start & end byte offsets*@mapping: mapping to truncate*@lstart: offset from which to truncate*@lend: offset to which to truncate (inclusive)* Truncate the page cache, removing the pages that
203  Return 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:
Caller
NameDescribe
blkdev_ioctlalways keep this in sync with compat_blkdev_ioctl()