From 0754ea125cefb032c96b3689ca56ad1cf29daaae Mon Sep 17 00:00:00 2001 From: Sablin Viacheslav Date: Sun, 3 Nov 2024 23:02:21 +0300 Subject: sys/linux: added new ioctls for f2fs --- sys/linux/fs_ioctl_f2fs.txt | 18 ++++++++++++++++++ sys/linux/fs_ioctl_f2fs.txt.const | 8 ++++++++ 2 files changed, 26 insertions(+) (limited to 'sys/linux') diff --git a/sys/linux/fs_ioctl_f2fs.txt b/sys/linux/fs_ioctl_f2fs.txt index bff10d2b5..c89496eff 100644 --- a/sys/linux/fs_ioctl_f2fs.txt +++ b/sys/linux/fs_ioctl_f2fs.txt @@ -25,6 +25,11 @@ ioctl$F2FS_IOC_RESIZE_FS(fd fd, cmd const[F2FS_IOC_RESIZE_FS], arg ptr[in, int64 ioctl$F2FS_IOC_GET_COMPRESS_BLOCKS(fd fd, cmd const[F2FS_IOC_GET_COMPRESS_BLOCKS], arg ptr[out, int64]) ioctl$F2FS_IOC_RELEASE_COMPRESS_BLOCKS(fd fd, cmd const[F2FS_IOC_RELEASE_COMPRESS_BLOCKS], arg ptr[out, int64]) ioctl$F2FS_IOC_RESERVE_COMPRESS_BLOCKS(fd fd, cmd const[F2FS_IOC_RESERVE_COMPRESS_BLOCKS], arg ptr[out, int64]) +ioctl$F2FS_IOC_SEC_TRIM_FILE(fd fd, cmd const[F2FS_IOC_SEC_TRIM_FILE], arg ptr[in, f2fs_sectrim_range]) +ioctl$F2FS_IOC_GET_COMPRESS_OPTION(fd fd, cmd const[F2FS_IOC_GET_COMPRESS_OPTION], arg ptr[out, f2fs_comp_option]) +ioctl$F2FS_IOC_SET_COMPRESS_OPTION(fd fd, cmd const[F2FS_IOC_SET_COMPRESS_OPTION], arg ptr[in, f2fs_comp_option]) +ioctl$F2FS_IOC_DECOMPRESS_FILE(fd fd, cmd const[F2FS_IOC_DECOMPRESS_FILE], arg const[0]) +ioctl$F2FS_IOC_COMPRESS_FILE(fd fd, cmd const[F2FS_IOC_COMPRESS_FILE], arg const[0]) # F2FS_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. @@ -54,3 +59,16 @@ f2fs_flush_device { } f2fs_shutdown_flag = F2FS_GOING_DOWN_FULLSYNC, F2FS_GOING_DOWN_METASYNC, F2FS_GOING_DOWN_NOSYNC, F2FS_GOING_DOWN_METAFLUSH, F2FS_GOING_DOWN_NEED_FSCK + +f2fs_sectrim_range { + start int64 + len int64 + flags flags[f2fs_sectrim_range_flag, int64] +} + +f2fs_sectrim_range_flag = F2FS_TRIM_FILE_DISCARD, F2FS_TRIM_FILE_ZEROOUT, F2FS_TRIM_FILE_MASK + +f2fs_comp_option { + algorithm int8 + log_cluster_size int8 +} diff --git a/sys/linux/fs_ioctl_f2fs.txt.const b/sys/linux/fs_ioctl_f2fs.txt.const index 87010cfea..b4833c02d 100644 --- a/sys/linux/fs_ioctl_f2fs.txt.const +++ b/sys/linux/fs_ioctl_f2fs.txt.const @@ -7,11 +7,14 @@ F2FS_GOING_DOWN_NEED_FSCK = 4 F2FS_GOING_DOWN_NOSYNC = 2 F2FS_IOC_ABORT_ATOMIC_WRITE = 62725, mips64le:ppc64le:536933637 F2FS_IOC_COMMIT_ATOMIC_WRITE = 62722, mips64le:ppc64le:536933634 +F2FS_IOC_COMPRESS_FILE = 62744, mips64le:ppc64le:536933656 +F2FS_IOC_DECOMPRESS_FILE = 62743, mips64le:ppc64le:536933655 F2FS_IOC_DEFRAGMENT = 3222336776 F2FS_IOC_FLUSH_DEVICE = 1074328842, mips64le:ppc64le:2148070666 F2FS_IOC_GARBAGE_COLLECT = 1074066694, mips64le:ppc64le:2147808518 F2FS_IOC_GARBAGE_COLLECT_RANGE = 1075377419, 386:1075115275, mips64le:ppc64le:2149119243 F2FS_IOC_GET_COMPRESS_BLOCKS = 2148070673, mips64le:ppc64le:1074328849 +F2FS_IOC_GET_COMPRESS_OPTION = 2147677461, mips64le:ppc64le:1073935637 F2FS_IOC_GET_FEATURES = 2147808524, mips64le:ppc64le:1074066700 F2FS_IOC_GET_PIN_FILE = 2147808526, mips64le:ppc64le:1074066702 F2FS_IOC_MOVE_RANGE = 3223385353, 386:3223123209 @@ -20,9 +23,14 @@ F2FS_IOC_RELEASE_COMPRESS_BLOCKS = 2148070674, mips64le:ppc64le:1074328850 F2FS_IOC_RELEASE_VOLATILE_WRITE = 62724, mips64le:ppc64le:536933636 F2FS_IOC_RESERVE_COMPRESS_BLOCKS = 2148070675, mips64le:ppc64le:1074328851 F2FS_IOC_RESIZE_FS = 1074328848, mips64le:ppc64le:2148070672 +F2FS_IOC_SEC_TRIM_FILE = 1075377428, mips64le:ppc64le:2149119252 +F2FS_IOC_SET_COMPRESS_OPTION = 1073935638, mips64le:ppc64le:2147677462 F2FS_IOC_SET_PIN_FILE = 1074066701, mips64le:ppc64le:2147808525 F2FS_IOC_SHUTDOWN = 2147768445, mips64le:ppc64le:1074026621 F2FS_IOC_START_ATOMIC_WRITE = 62721, mips64le:ppc64le:536933633 F2FS_IOC_START_VOLATILE_WRITE = 62723, mips64le:ppc64le:536933635 F2FS_IOC_WRITE_CHECKPOINT = 62727, mips64le:ppc64le:536933639 +F2FS_TRIM_FILE_DISCARD = 1 +F2FS_TRIM_FILE_MASK = 3 +F2FS_TRIM_FILE_ZEROOUT = 2 __NR_ioctl = 54, amd64:16, arm64:riscv64:29, mips64le:5015 -- cgit mrf-deployment