aboutsummaryrefslogtreecommitdiffstats
path: root/sys/linux/fs_ioctl_ext4.txt
blob: 7993d7cf783651f2afab31136a1a6681e7c7fed6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Copyright 2018 syzkaller project authors. All rights reserved.
# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.

include <uapi/linux/fs.h>
include <uapi/linux/fsmap.h>
include <fs/ext4/ext4.h>

ioctl$EXT4_IOC_GROUP_EXTEND(fd fd, cmd const[EXT4_IOC_GROUP_EXTEND], arg ptr[in, intptr])
ioctl$EXT4_IOC_GROUP_ADD(fd fd, cmd const[EXT4_IOC_GROUP_ADD], arg ptr[in, ext4_new_group_input])
ioctl$EXT4_IOC_MIGRATE(fd fd, cmd const[EXT4_IOC_MIGRATE])
ioctl$EXT4_IOC_ALLOC_DA_BLKS(fd fd, cmd const[EXT4_IOC_ALLOC_DA_BLKS])
ioctl$EXT4_IOC_MOVE_EXT(fd fd, cmd const[EXT4_IOC_MOVE_EXT], arg ptr[in, move_extent])
ioctl$EXT4_IOC_SWAP_BOOT(fd fd, cmd const[EXT4_IOC_SWAP_BOOT])
ioctl$EXT4_IOC_PRECACHE_EXTENTS(fd fd, cmd const[EXT4_IOC_PRECACHE_EXTENTS])
ioctl$EXT4_IOC_CLEAR_ES_CACHE(fd fd, cmd const[EXT4_IOC_CLEAR_ES_CACHE])
ioctl$EXT4_IOC_GETSTATE(fd fd, cmd const[EXT4_IOC_GETSTATE], arg ptr[out, flags[ext4_state_flags, int32]])
ioctl$EXT4_IOC_GET_ES_CACHE(fd fd, cmd const[EXT4_IOC_GET_ES_CACHE], args ptr[inout, fiemap])
ioctl$EXT4_IOC_CHECKPOINT(fd fd, cmd const[EXT4_IOC_CHECKPOINT], arg ptr[in, flags[ext4_checkpoint_flags, int32]])
ioctl$EXT4_IOC_GETFSUUID(fd fd, cmd const[EXT4_IOC_GETFSUUID], arg ptr[out, fsuuid])
ioctl$EXT4_IOC_SETFSUUID(fd fd, cmd const[EXT4_IOC_SETFSUUID], arg ptr[in, fsuuid])

ext4_state_flags = EXT4_STATE_FLAG_EXT_PRECACHED, EXT4_STATE_FLAG_NEW, EXT4_STATE_FLAG_NEWENTRY, EXT4_STATE_FLAG_DA_ALLOC_CLOSE
ext4_checkpoint_flags = EXT4_IOC_CHECKPOINT_FLAG_DISCARD, EXT4_IOC_CHECKPOINT_FLAG_ZEROOUT, EXT4_IOC_CHECKPOINT_FLAG_DRY_RUN

# EXT4_IOC_SHUTDOWN on root fs effectively brings the machine down in weird ways.
# Fortunately, the value does not conflict with any other ioctl commands for now.
ioctl$EXT4_IOC_SHUTDOWN(fd fd, cmd const[EXT4_IOC_SHUTDOWN]) (disabled)

# EXT4_IOC_RESIZE_FS on root fs can shrink it to 0 (or whatever is the minimum size)
# and then creation of new temp dirs for tests will fail.
# TODO: not necessary for sandbox=namespace as it tests in a tmpfs
# and/or if we mount tmpfs for sandbox=none (#971).
ioctl$EXT4_IOC_RESIZE_FS(fd fd, cmd const[EXT4_IOC_RESIZE_FS]) (disabled)

ext4_new_group_input {
	group		int32
	block_bitmap	int64
	inode_bitmap	int64
	inode_table	int64
	blocks_count	int32
	reserved_blocks	int16
	unused		const[0, int16]
}

move_extent {
	reserved	const[0, int32]
	donor_fd	fd
	orig_start	int64
	donor_start	int64
	len		int64
	moved_len	int64
}

fsuuid {
	fsu_len		flags[ext4_uuid_len, int32]
	fsu_flags	const[0, int32]
	fsu_uuid	array[int8, UUID_SIZE]
}

ext4_uuid_len = 0, UUID_SIZE