github.com/google/syzkaller@v0.0.0-20240517125934-c0f1611a36d6/sys/linux/fs_ioctl_ext4.txt (about)

     1  # Copyright 2018 syzkaller project authors. All rights reserved.
     2  # Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
     3  
     4  include <uapi/linux/fs.h>
     5  include <uapi/linux/fsmap.h>
     6  include <fs/ext4/ext4.h>
     7  
     8  ioctl$EXT4_IOC_GROUP_EXTEND(fd fd, cmd const[EXT4_IOC_GROUP_EXTEND], arg ptr[in, intptr])
     9  ioctl$EXT4_IOC_GROUP_ADD(fd fd, cmd const[EXT4_IOC_GROUP_ADD], arg ptr[in, ext4_new_group_input])
    10  ioctl$EXT4_IOC_MIGRATE(fd fd, cmd const[EXT4_IOC_MIGRATE])
    11  ioctl$EXT4_IOC_ALLOC_DA_BLKS(fd fd, cmd const[EXT4_IOC_ALLOC_DA_BLKS])
    12  ioctl$EXT4_IOC_MOVE_EXT(fd fd, cmd const[EXT4_IOC_MOVE_EXT], arg ptr[in, move_extent])
    13  ioctl$EXT4_IOC_SWAP_BOOT(fd fd, cmd const[EXT4_IOC_SWAP_BOOT])
    14  ioctl$EXT4_IOC_PRECACHE_EXTENTS(fd fd, cmd const[EXT4_IOC_PRECACHE_EXTENTS])
    15  ioctl$EXT4_IOC_CLEAR_ES_CACHE(fd fd, cmd const[EXT4_IOC_CLEAR_ES_CACHE])
    16  ioctl$EXT4_IOC_GETSTATE(fd fd, cmd const[EXT4_IOC_GETSTATE], arg ptr[out, flags[ext4_state_flags, int32]])
    17  ioctl$EXT4_IOC_GET_ES_CACHE(fd fd, cmd const[EXT4_IOC_GET_ES_CACHE], args ptr[inout, fiemap])
    18  ioctl$EXT4_IOC_CHECKPOINT(fd fd, cmd const[EXT4_IOC_CHECKPOINT], arg ptr[in, flags[ext4_checkpoint_flags, int32]])
    19  ioctl$EXT4_IOC_GETFSUUID(fd fd, cmd const[EXT4_IOC_GETFSUUID], arg ptr[out, fsuuid])
    20  ioctl$EXT4_IOC_SETFSUUID(fd fd, cmd const[EXT4_IOC_SETFSUUID], arg ptr[in, fsuuid])
    21  
    22  ext4_state_flags = EXT4_STATE_FLAG_EXT_PRECACHED, EXT4_STATE_FLAG_NEW, EXT4_STATE_FLAG_NEWENTRY, EXT4_STATE_FLAG_DA_ALLOC_CLOSE
    23  ext4_checkpoint_flags = EXT4_IOC_CHECKPOINT_FLAG_DISCARD, EXT4_IOC_CHECKPOINT_FLAG_ZEROOUT, EXT4_IOC_CHECKPOINT_FLAG_DRY_RUN
    24  
    25  # EXT4_IOC_SHUTDOWN on root fs effectively brings the machine down in weird ways.
    26  # Fortunately, the value does not conflict with any other ioctl commands for now.
    27  ioctl$EXT4_IOC_SHUTDOWN(fd fd, cmd const[EXT4_IOC_SHUTDOWN]) (disabled)
    28  
    29  # EXT4_IOC_RESIZE_FS on root fs can shrink it to 0 (or whatever is the minimum size)
    30  # and then creation of new temp dirs for tests will fail.
    31  # TODO: not necessary for sandbox=namespace as it tests in a tmpfs
    32  # and/or if we mount tmpfs for sandbox=none (#971).
    33  ioctl$EXT4_IOC_RESIZE_FS(fd fd, cmd const[EXT4_IOC_RESIZE_FS]) (disabled)
    34  
    35  ext4_new_group_input {
    36  	group		int32
    37  	block_bitmap	int64
    38  	inode_bitmap	int64
    39  	inode_table	int64
    40  	blocks_count	int32
    41  	reserved_blocks	int16
    42  	unused		const[0, int16]
    43  }
    44  
    45  move_extent {
    46  	reserved	const[0, int32]
    47  	donor_fd	fd
    48  	orig_start	int64
    49  	donor_start	int64
    50  	len		int64
    51  	moved_len	int64
    52  }
    53  
    54  fsuuid {
    55  	fsu_len		flags[ext4_uuid_len, int32]
    56  	fsu_flags	const[0, int32]
    57  	fsu_uuid	array[int8, UUID_SIZE]
    58  }
    59  
    60  ext4_uuid_len = 0, UUID_SIZE