函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Most 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.

函数原型:long compat_blkdev_ioctl(struct file *file, unsigned cmd, unsigned long arg)

返回类型:long

参数:

类型参数名称
struct file *file
unsignedcmd
unsigned longarg
318  ret等于负No ioctl command
319  inode等于host
320  bdev等于i_bdev
321  disk等于bd_disk
322  mode等于f_mode
330  如果f_flags按位与O_NDELAYmode或等于File is opened with O_NDELAY (only set for block devices)
332  否则mode与等于File is opened with O_NDELAY (only set for block devices) 的反
336  :cmd恒等于get device geometry
337  返回:compat_hdio_getgeo(disk, bdev, A pointer passed in from user mode. This should not* be used for syscall parameters, just declare them* as pointers because the syscall entry code will have* appropriately converted them already.)
338  :cmd恒等于BLKPBSZGET
339  返回:compat_put_uint(arg, bdev_physical_block_size(bdev))
340  :cmd恒等于BLKIOMIN
341  返回:compat_put_uint(arg, bdev_io_min(bdev))
342  :cmd恒等于BLKIOOPT
343  返回:compat_put_uint(arg, bdev_io_opt(bdev))
344  :cmd恒等于BLKALIGNOFF
345  返回:compat_put_int(arg, bdev_alignment_offset(bdev))
346  :cmd恒等于BLKDISCARDZEROES
347  返回:compat_put_uint(arg, 0)
348  :cmd恒等于lush buffer cache
349  :cmd恒等于set device read-only (0 = read-write)
350  :cmd恒等于BLKDISCARD
351  :cmd恒等于BLKSECDISCARD
352  :cmd恒等于BLKZEROOUT
357  :cmd恒等于-read partition table
358  :cmd恒等于Zoned block device ioctl's:*@BLKREPORTZONE: Get zone information
359  :cmd恒等于BLKRESETZONE
360  :cmd恒等于BLKOPENZONE
361  :cmd恒等于BLKCLOSEZONE
362  :cmd恒等于BLKFINISHZONE
363  :cmd恒等于BLKGETZONESZ
364  :cmd恒等于BLKGETNRZONES
365  返回:always keep this in sync with compat_blkdev_ioctl()
367  :cmd恒等于BLKBSZSET_32
368  返回:always keep this in sync with compat_blkdev_ioctl()
370  :cmd恒等于BLKPG
371  返回:compat_blkpg_ioctl(bdev, mode, cmd, A pointer passed in from user mode. This should not* be used for syscall parameters, just declare them* as pointers because the syscall entry code will have* appropriately converted them already.)
372  :cmd恒等于get current read ahead setting
373  :cmd恒等于get filesystem (mm/filemap.c) read-ahead
374  如果非arg则返回:负EINVAL
376  返回:compat_put_long(arg, (ra_pages * PAGE_SIZE) / 512)
378  :cmd恒等于get read-only status (0 = read_write)
379  返回:compat_put_int(arg, bdev_read_only(bdev) != 0)
380  :cmd恒等于BLKBSZGET_32
381  返回:compat_put_int(arg, block_size(bdev))
382  :cmd恒等于get block device sector size
383  返回:compat_put_int(arg, bdev_logical_block_size(bdev))
384  :cmd恒等于get max sectors per request (ll_rw_blk.c)
385  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)))
387  返回:compat_put_ushort(arg, max_sectors)
388  :cmd恒等于BLKROTATIONAL
389  返回:compat_put_ushort(arg, !blk_queue_nonrot(bdev_get_queue(bdev)))
391  :cmd恒等于set read ahead for block device
392  :cmd恒等于set filesystem (mm/filemap.c) read-ahead
393  如果非操作权限检查则返回:负EACCES
395  ra_pages等于arg乘512除PAGE_SIZE
396  返回:0
397  :cmd恒等于urn device size /512 (long *arg)
398  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
399  如果size右移9位大于0UL的反则返回:负EFBIG
401  返回:compat_put_ulong(arg, size >> 9)
403  :cmd恒等于BLKGETSIZE64_32
404  返回:compat_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 )
406  :cmd恒等于BLKTRACESETUP32
407  :cmd恒等于BLKTRACESTART
408  :cmd恒等于BLKTRACESTOP
409  :cmd恒等于BLKTRACETEARDOWN
410  ret等于blk_trace_ioctl(bdev, cmd, A pointer passed in from user mode. This should not* be used for syscall parameters, just declare them* as pointers because the syscall entry code will have* appropriately converted them already.)
411  返回:ret
412  :cmd恒等于IOC_PR_REGISTER
413  :cmd恒等于IOC_PR_RESERVE
414  :cmd恒等于IOC_PR_RELEASE
415  :cmd恒等于IOC_PR_PREEMPT
416  :cmd恒等于IOC_PR_PREEMPT_ABORT
417  :cmd恒等于IOC_PR_CLEAR
418  返回:always keep this in sync with compat_blkdev_ioctl()
420  默认
421  如果compat_ioctlret等于compat_ioctl(bdev, mode, cmd, arg)
423  如果ret恒等于负No ioctl command ret等于compat_blkdev_driver_ioctl(bdev, mode, cmd, arg)
425  返回:ret