History

Merge tag 'f2fs-for-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs

Pull f2fs updates from Jaegeuk Kim: "In this round, we've made more work into per-file compression support. For example, F2FS_IOC_GET | SET_COMPRESS_OPTION provides a way to change the algorithm or cluster size per file. F2FS_IOC_COMPRESS | DECOMPRESS_FILE provides a way to compress and decompress the existing normal files manually. There is also a new mount option, compress_mode=fs|user, which can control who compresses the data. Chao also added a checksum feature with a mount option so that we are able to detect any corrupted cluster. In addition, Daniel contributed casefolding with encryption patch, which will be used for Android devices. Summary: Enhancements: - add ioctls and mount option to manage per-file compression feature - support casefolding with encryption - support checksum for compressed cluster - avoid IO starvation by replacing mutex with rwsem - add sysfs, max_io_bytes, to control max bio size Bug fixes: - fix use-after-free issue when compression and fsverity are enabled - fix consistency corruption during fault injection test - fix data offset for lseek - get rid of buffer_head which has 32bits limit in fiemap - fix some bugs in multi-partitions support - fix nat entry count calculation in shrinker - fix some stat information And, we've refactored some logics and fix minor bugs as well" * tag 'f2fs-for-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs: (36 commits) f2fs: compress: fix compression chksum f2fs: fix shift-out-of-bounds in sanity_check_raw_super() f2fs: fix race of pending_pages in decompression f2fs: fix to account inline xattr correctly during recovery f2fs: inline: fix wrong inline inode stat f2fs: inline: correct comment in f2fs_recover_inline_data f2fs: don't check PAGE_SIZE again in sanity_check_raw_super() f2fs: convert to F2FS_*_INO macro f2fs: introduce max_io_bytes, a sysfs entry, to limit bio size f2fs: don't allow any writes on readonly mount f2fs: avoid race condition for shrinker count f2fs: add F2FS_IOC_DECOMPRESS_FILE and F2FS_IOC_COMPRESS_FILE f2fs: add compress_mode mount option f2fs: Remove unnecessary unlikely() f2fs: init dirty_secmap incorrectly f2fs: remove buffer_head which has 32bits limit f2fs: fix wrong block count instead of bytes f2fs: use new conversion functions between blks and bytes f2fs: rename logical_to_blk and blk_to_logical f2fs: fix kbytes written stat for multi-device case ...

Linus Torvalds committed 5 years ago

Commit ff49c862 parents b97d4c4 75e91c838 files · +1075 −386Browse files

Showing the changes to include/uapi/linux (1 of 38 files). Show all

Unified · Split

include/uapi/linux/f2fs.h+98−0
@@ -0,0 +1,98 @@
1+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2+
3+#ifndef _UAPI_LINUX_F2FS_H
4+#define _UAPI_LINUX_F2FS_H
5+#include <linux/types.h>
6+#include <linux/ioctl.h>
7+
8+/*
9+ * f2fs-specific ioctl commands
10+ */
11+#define F2FS_IOCTL_MAGIC 0xf5
12+#define F2FS_IOC_START_ATOMIC_WRITE _IO(F2FS_IOCTL_MAGIC, 1)
13+#define F2FS_IOC_COMMIT_ATOMIC_WRITE _IO(F2FS_IOCTL_MAGIC, 2)
14+#define F2FS_IOC_START_VOLATILE_WRITE _IO(F2FS_IOCTL_MAGIC, 3)
15+#define F2FS_IOC_RELEASE_VOLATILE_WRITE _IO(F2FS_IOCTL_MAGIC, 4)
16+#define F2FS_IOC_ABORT_VOLATILE_WRITE _IO(F2FS_IOCTL_MAGIC, 5)
17+#define F2FS_IOC_GARBAGE_COLLECT _IOW(F2FS_IOCTL_MAGIC, 6, __u32)
18+#define F2FS_IOC_WRITE_CHECKPOINT _IO(F2FS_IOCTL_MAGIC, 7)
19+#define F2FS_IOC_DEFRAGMENT _IOWR(F2FS_IOCTL_MAGIC, 8, \
20+ struct f2fs_defragment)
21+#define F2FS_IOC_MOVE_RANGE _IOWR(F2FS_IOCTL_MAGIC, 9, \
22+ struct f2fs_move_range)
23+#define F2FS_IOC_FLUSH_DEVICE _IOW(F2FS_IOCTL_MAGIC, 10, \
24+ struct f2fs_flush_device)
25+#define F2FS_IOC_GARBAGE_COLLECT_RANGE _IOW(F2FS_IOCTL_MAGIC, 11, \
26+ struct f2fs_gc_range)
27+#define F2FS_IOC_GET_FEATURES _IOR(F2FS_IOCTL_MAGIC, 12, __u32)
28+#define F2FS_IOC_SET_PIN_FILE _IOW(F2FS_IOCTL_MAGIC, 13, __u32)
29+#define F2FS_IOC_GET_PIN_FILE _IOR(F2FS_IOCTL_MAGIC, 14, __u32)
30+#define F2FS_IOC_PRECACHE_EXTENTS _IO(F2FS_IOCTL_MAGIC, 15)
31+#define F2FS_IOC_RESIZE_FS _IOW(F2FS_IOCTL_MAGIC, 16, __u64)
32+#define F2FS_IOC_GET_COMPRESS_BLOCKS _IOR(F2FS_IOCTL_MAGIC, 17, __u64)
33+#define F2FS_IOC_RELEASE_COMPRESS_BLOCKS \
34+ _IOR(F2FS_IOCTL_MAGIC, 18, __u64)
35+#define F2FS_IOC_RESERVE_COMPRESS_BLOCKS \
36+ _IOR(F2FS_IOCTL_MAGIC, 19, __u64)
37+#define F2FS_IOC_SEC_TRIM_FILE _IOW(F2FS_IOCTL_MAGIC, 20, \
38+ struct f2fs_sectrim_range)
39+#define F2FS_IOC_GET_COMPRESS_OPTION _IOR(F2FS_IOCTL_MAGIC, 21, \
40+ struct f2fs_comp_option)
41+#define F2FS_IOC_SET_COMPRESS_OPTION _IOW(F2FS_IOCTL_MAGIC, 22, \
42+ struct f2fs_comp_option)
43+#define F2FS_IOC_DECOMPRESS_FILE _IO(F2FS_IOCTL_MAGIC, 23)
44+#define F2FS_IOC_COMPRESS_FILE _IO(F2FS_IOCTL_MAGIC, 24)
45+
46+/*
47+ * should be same as XFS_IOC_GOINGDOWN.
48+ * Flags for going down operation used by FS_IOC_GOINGDOWN
49+ */
50+#define F2FS_IOC_SHUTDOWN _IOR('X', 125, __u32) /* Shutdown */
51+#define F2FS_GOING_DOWN_FULLSYNC 0x0 /* going down with full sync */
52+#define F2FS_GOING_DOWN_METASYNC 0x1 /* going down with metadata */
53+#define F2FS_GOING_DOWN_NOSYNC 0x2 /* going down */
54+#define F2FS_GOING_DOWN_METAFLUSH 0x3 /* going down with meta flush */
55+#define F2FS_GOING_DOWN_NEED_FSCK 0x4 /* going down to trigger fsck */
56+
57+/*
58+ * Flags used by F2FS_IOC_SEC_TRIM_FILE
59+ */
60+#define F2FS_TRIM_FILE_DISCARD 0x1 /* send discard command */
61+#define F2FS_TRIM_FILE_ZEROOUT 0x2 /* zero out */
62+#define F2FS_TRIM_FILE_MASK 0x3
63+
64+struct f2fs_gc_range {
65+ __u32 sync;
66+ __u64 start;
67+ __u64 len;
68+};
69+
70+struct f2fs_defragment {
71+ __u64 start;
72+ __u64 len;
73+};
74+
75+struct f2fs_move_range {
76+ __u32 dst_fd; /* destination fd */
77+ __u64 pos_in; /* start position in src_fd */
78+ __u64 pos_out; /* start position in dst_fd */
79+ __u64 len; /* size to move */
80+};
81+
82+struct f2fs_flush_device {
83+ __u32 dev_num; /* device number to flush */
84+ __u32 segments; /* # of segments to flush */
85+};
86+
87+struct f2fs_sectrim_range {
88+ __u64 start;
89+ __u64 len;
90+ __u64 flags;
91+};
92+
93+struct f2fs_comp_option {
94+ __u8 algorithm;
95+ __u8 log_cluster_size;
96+};
97+
98+#endif /* _UAPI_LINUX_F2FS_H */