函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:blkpg_ioctl

函数原型:static int blkpg_ioctl(struct block_device *bdev, struct blkpg_ioctl_arg __user *arg)

返回类型:int

参数:

类型参数名称
struct block_device *bdev
struct blkpg_ioctl_arg __user *arg
25  如果非操作权限检查则返回:负EACCES
27  如果copy_from_user( & a, arg, sizeof(structblkpg_ioctl_arg))则返回:负EFAULT
29  如果copy_from_user( & p, data, sizeof(structblkpg_partition))则返回:负EFAULT
31  disk等于bd_disk
32  如果bdev不等于bd_contains则返回:负EINVAL
34  partno等于partition number
35  如果partno小于等于0则返回:负EINVAL
38  :op恒等于The subfunctions (for the op field)
39  start等于starting offset in bytes 右移9位
40  length等于length in bytes 右移9位
42  如果sizeof(sector_t)恒等于sizeof(long)且sizeof(longlong)大于sizeof(long)则
44  pstart等于start, plength等于length
45  如果pstart不等于startplength不等于lengthpstart小于0或plength小于0或partno大于65535则返回:负EINVAL
50  如果starting offset in bytes 按位与bdev_logical_block_size(bdev)减1则返回:负EINVAL
53  mutex_lock( & open/close mutex )
56  disk_part_iter_init( & piter, disk, clude 0-sized parts )
66  disk_part_iter_exit( & piter)
69  part等于add_partition(disk, partno, start, length, ADDPART_FLAG_NONE, NULL)
71  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
72  返回:PTR_ERR_OR_ZERO(part)
73  :op恒等于BLKPG_DEL_PARTITION
74  part等于disk_get_part(disk, partno)
75  如果非part则返回:负ENXIO
78  bdevp等于bdget(part_devt(part))
79  disk_put_part(part)
80  如果非bdevp则返回:负ENOMEM
83  mutex_lock( & open/close mutex )
84  如果bd_openers
86  bdput(bdevp)
87  返回:负EBUSY
90  fsync_bdev(bdevp)
91  invalidate_bdev(bdevp)
93  mutex_lock_nested( & open/close mutex , 1)
94  delete_partition(disk, partno)
95  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
96  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
97  bdput(bdevp)
99  返回:0
100  :op恒等于BLKPG_RESIZE_PARTITION
101  start等于starting offset in bytes 右移9位
103  length等于length in bytes 右移9位
105  如果sizeof(sector_t)恒等于sizeof(long)且sizeof(longlong)大于sizeof(long)则
107  pstart等于start, plength等于length
108  如果pstart不等于startplength不等于lengthpstart小于0或plength小于0则返回:负EINVAL
112  part等于disk_get_part(disk, partno)
113  如果非part则返回:负ENXIO
115  bdevp等于bdget(part_devt(part))
116  如果非bdevp
118  返回:负ENOMEM
120  mutex_lock( & open/close mutex )
121  mutex_lock_nested( & open/close mutex , 1)
122  如果start不等于start_sect
125  bdput(bdevp)
127  返回:负EINVAL
130  disk_part_iter_init( & piter, disk, clude 0-sized parts )
145  disk_part_iter_exit( & piter)
146  Should be called with mutex lock held (typically bd_mutex) of partition* to provide mutual exlusion among writers otherwise seqcount might be* left in wrong state leaving the readers spinning infinitely.
147  NOTE: unlike i_size_read(), i_size_write() does need locking around it* (normally i_mutex), otherwise on 32bit/SMP an update of i_size_seqcount* can be lost, resulting in subsequent i_size_read() calls spinning forever.
148  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
149  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
150  bdput(bdevp)
151  disk_put_part(part)
152  返回:0
153  默认
154  返回:负EINVAL
调用者
名称描述
blkdev_ioctlalways keep this in sync with compat_blkdev_ioctl()