Function report |
Source Code:block\compat_ioctl.c |
Create Date:2022-07-28 18:01:33 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name: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.
Proto:long compat_blkdev_ioctl(struct file *file, unsigned cmd, unsigned long arg)
Type:long
Parameter:
| Type | Parameter | Name |
|---|---|---|
| struct file * | file | |
| unsigned | cmd | |
| unsigned long | arg |
| 318 | ret = -No ioctl command |
| 330 | If f_flags & O_NDELAY Then mode |= File is opened with O_NDELAY (only set for block devices) |
| 336 | Case cmd == get device geometry |
| 338 | Case cmd == BLKPBSZGET |
| 339 | Return compat_put_uint(arg, bdev_physical_block_size(bdev)) |
| 341 | Return compat_put_uint(arg, bdev_io_min(bdev)) |
| 343 | Return compat_put_uint(arg, bdev_io_opt(bdev)) |
| 344 | Case cmd == BLKALIGNOFF |
| 345 | Return compat_put_int(arg, bdev_alignment_offset(bdev)) |
| 346 | Case cmd == BLKDISCARDZEROES |
| 347 | Return compat_put_uint(arg, 0) |
| 348 | Case cmd == lush buffer cache |
| 349 | Case cmd == set device read-only (0 = read-write) |
| 350 | Case cmd == BLKDISCARD |
| 351 | Case cmd == BLKSECDISCARD |
| 352 | Case cmd == BLKZEROOUT |
| 357 | Case cmd == -read partition table |
| 359 | Case cmd == BLKRESETZONE |
| 360 | Case cmd == BLKOPENZONE |
| 361 | Case cmd == BLKCLOSEZONE |
| 362 | Case cmd == BLKFINISHZONE |
| 363 | Case cmd == BLKGETZONESZ |
| 364 | Case cmd == BLKGETNRZONES |
| 367 | Case cmd == BLKBSZSET_32 |
| 372 | Case cmd == get current read ahead setting |
| 373 | Case cmd == get filesystem (mm/filemap.c) read-ahead |
| 378 | Case cmd == get read-only status (0 = read_write) |
| 379 | Return compat_put_int(arg, bdev_read_only(bdev) != 0) |
| 380 | Case cmd == BLKBSZGET_32 |
| 381 | Return compat_put_int(arg, block_size(bdev)) |
| 382 | Case cmd == get block device sector size |
| 383 | Return compat_put_int(arg, bdev_logical_block_size(bdev)) |
| 384 | Case cmd == get max sectors per request (ll_rw_blk.c) |
| 387 | Return compat_put_ushort(arg, max_sectors) |
| 388 | Case cmd == BLKROTATIONAL |
| 389 | Return compat_put_ushort(arg, !blk_queue_nonrot(bdev_get_queue(bdev))) |
| 391 | Case cmd == set read ahead for block device |
| 392 | Case cmd == set filesystem (mm/filemap.c) read-ahead |
| 393 | If Not Check operation authority Then Return -EACCES |
| 396 | Return 0 |
| 397 | Case cmd == urn device size /512 (long *arg) |
| 401 | Return compat_put_ulong(arg, size >> 9) |
| 403 | Case cmd == BLKGETSIZE64_32 |
| 406 | Case cmd == BLKTRACESETUP32 |
| 407 | Case cmd == BLKTRACESTART |
| 408 | Case cmd == BLKTRACESTOP |
| 409 | Case cmd == BLKTRACETEARDOWN |
| 411 | Return ret |
| 412 | Case cmd == IOC_PR_REGISTER |
| 413 | Case cmd == IOC_PR_RESERVE |
| 414 | Case cmd == IOC_PR_RELEASE |
| 415 | Case cmd == IOC_PR_PREEMPT |
| 416 | Case cmd == IOC_PR_PREEMPT_ABORT |
| 417 | Case cmd == IOC_PR_CLEAR |
| 420 | Default |
| 421 | If compat_ioctl Then ret = compat_ioctl(bdev, mode, cmd, arg) |
| 423 | If ret == -No ioctl command Then ret = compat_blkdev_driver_ioctl(bdev, mode, cmd, arg) |
| 425 | Return ret |
| Source code conversion tool public plug-in interface | X |
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |