函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:blk_ioctl_discard

函数原型:static int blk_ioctl_discard(struct block_device *bdev, fmode_t mode, unsigned long arg, unsigned long flags)

返回类型:int

参数:

类型参数名称
struct block_device *bdev
fmode_tmode
unsigned longarg
unsigned longflags
179  q等于bdev_get_queue(bdev)
180  mapping等于i_mapping
183  如果非mode按位与le is open for writing 的值则返回:负EBADF
186  如果非blk_queue_discard(q)则返回:负EOPNOTSUPP
189  如果copy_from_user(range, (void__user * )arg, range的长度)则返回:负EFAULT
192  start等于range[0]
193  len等于range[1]
195  如果start按位与511则返回:负EINVAL
197  如果len按位与511则返回:负EINVAL
200  如果startlen大于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 则返回:负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  返回: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:
调用者
名称描述
blkdev_ioctlalways keep this in sync with compat_blkdev_ioctl()