函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:always keep this in sync with compat_blkdev_ioctl()

函数原型:int blkdev_ioctl(struct block_device *bdev, fmode_t mode, unsigned cmd, unsigned long arg)

返回类型:int

参数:

类型参数名称
struct block_device *bdev
fmode_tmode
unsignedcmd
unsigned longarg
489  __userargp等于arg
494  :cmd恒等于lush buffer cache
495  返回:blkdev_flushbuf(bdev, mode, cmd, arg)
496  :cmd恒等于set device read-only (0 = read-write)
497  返回:blkdev_roset(bdev, mode, cmd, arg)
498  :cmd恒等于BLKDISCARD
499  返回:blk_ioctl_discard(bdev, mode, arg, 0)
500  :cmd恒等于BLKSECDISCARD
501  返回:blk_ioctl_discard(bdev, mode, arg, ssue a secure erase )
503  :cmd恒等于BLKZEROOUT
504  返回:blk_ioctl_zeroout(bdev, mode, arg)
505  :cmd恒等于Zoned block device ioctl's:*@BLKREPORTZONE: Get zone information
506  返回:blkdev_report_zones_ioctl(bdev, mode, cmd, arg)
507  :cmd恒等于BLKRESETZONE
508  :cmd恒等于BLKOPENZONE
509  :cmd恒等于BLKCLOSEZONE
510  :cmd恒等于BLKFINISHZONE
511  返回:blkdev_zone_mgmt_ioctl(bdev, mode, cmd, arg)
512  :cmd恒等于BLKGETZONESZ
513  返回:put_uint(arg, bdev_zone_sectors(bdev))
514  :cmd恒等于BLKGETNRZONES
515  返回:put_uint(arg, blkdev_nr_zones(bd_disk))
516  :cmd恒等于get device geometry
517  返回:blkdev_getgeo(bdev, argp)
518  :cmd恒等于get current read ahead setting
519  :cmd恒等于get filesystem (mm/filemap.c) read-ahead
520  如果非arg则返回:负EINVAL
522  返回:put_long(arg, (ra_pages * PAGE_SIZE) / 512)
523  :cmd恒等于get read-only status (0 = read_write)
524  返回:put_int(arg, bdev_read_only(bdev) != 0)
525  :cmd恒等于A jump here: 108-111 have been used for various private purposes.
526  返回:put_int(arg, block_size(bdev))
527  :cmd恒等于get block device sector size
528  返回:put_int(arg, bdev_logical_block_size(bdev))
529  :cmd恒等于BLKPBSZGET
530  返回:put_uint(arg, bdev_physical_block_size(bdev))
531  :cmd恒等于BLKIOMIN
532  返回:put_uint(arg, bdev_io_min(bdev))
533  :cmd恒等于BLKIOOPT
534  返回:put_uint(arg, bdev_io_opt(bdev))
535  :cmd恒等于BLKALIGNOFF
536  返回:put_int(arg, bdev_alignment_offset(bdev))
537  :cmd恒等于BLKDISCARDZEROES
538  返回:put_uint(arg, 0)
539  :cmd恒等于get max sectors per request (ll_rw_blk.c)
540  max_sectors等于min_t - return minimum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(unsignedint, USHRT_MAX, queue_max_sectors(bdev_get_queue(bdev)))
542  返回:put_ushort(arg, max_sectors)
543  :cmd恒等于BLKROTATIONAL
544  返回:put_ushort(arg, !blk_queue_nonrot(bdev_get_queue(bdev)))
545  :cmd恒等于set read ahead for block device
546  :cmd恒等于set filesystem (mm/filemap.c) read-ahead
547  如果非操作权限检查则返回:负EACCES
549  ra_pages等于arg乘512除PAGE_SIZE
550  返回:0
551  :cmd恒等于BLKBSZSET
552  返回:set the logical block size
553  :cmd恒等于BLKPG
554  返回:blkpg_ioctl(bdev, argp)
555  :cmd恒等于-read partition table
556  返回:blkdev_reread_part(bdev)
557  :cmd恒等于urn device size /512 (long *arg)
558  size等于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
559  如果size右移9位大于0UL的反则返回:负EFBIG
561  返回:put_ulong(arg, size >> 9)
562  :cmd恒等于urn device size in bytes (u64 *arg)
563  返回:put_u64(arg, 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 )
564  :cmd恒等于BLKTRACESTART
565  :cmd恒等于BLKTRACESTOP
566  :cmd恒等于BLKTRACESETUP
567  :cmd恒等于BLKTRACETEARDOWN
568  返回:blk_trace_ioctl(bdev, cmd, argp)
569  :cmd恒等于IOC_PR_REGISTER
570  返回:blkdev_pr_register(bdev, argp)
571  :cmd恒等于IOC_PR_RESERVE
572  返回:blkdev_pr_reserve(bdev, argp)
573  :cmd恒等于IOC_PR_RELEASE
574  返回:blkdev_pr_release(bdev, argp)
575  :cmd恒等于IOC_PR_PREEMPT
576  返回:blkdev_pr_preempt(bdev, argp, false)
577  :cmd恒等于IOC_PR_PREEMPT_ABORT
578  返回:blkdev_pr_preempt(bdev, argp, true)
579  :cmd恒等于IOC_PR_CLEAR
580  返回:blkdev_pr_clear(bdev, argp)
581  默认
582  返回:__blkdev_driver_ioctl(bdev, mode, cmd, arg)
调用者
名称描述
compat_blkpg_ioctl
compat_blkdev_ioctlMost of the generic ioctls are handled in the normal fallback path.This assumes the blkdev's low level compat_ioctl always returnsENOIOCTLCMD for unknown ioctls.
ioctl_by_bdev