-
Notifications
You must be signed in to change notification settings - Fork 2
/
mke2fs-add-inline_data-support-in-mke2fs
62 lines (56 loc) · 1.85 KB
/
mke2fs-add-inline_data-support-in-mke2fs
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
61
mke2fs: add inline_data support in mke2fs
From: Zheng Liu <[email protected]>
Ext_attr feature not enabled, inline_data feature doesn't be specified.
Signed-off-by: Zheng Liu <[email protected]>
Signed-off-by: Theodore Ts'o <[email protected]>
---
misc/mke2fs.8.in | 3 +++
misc/mke2fs.c | 14 +++++++++++++-
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/misc/mke2fs.8.in b/misc/mke2fs.8.in
index 023ba49..5731542 100644
--- a/misc/mke2fs.8.in
+++ b/misc/mke2fs.8.in
@@ -578,6 +578,9 @@ option).
@JDEV@must be created with the same
@JDEV@block size as the filesystems that will be using it.
.TP
+.B inline_data
+Allow data to be stored in inode
+.TP
.B large_file
Filesystem can contain files that are greater than 2GB. (Modern kernels
set this feature automatically when a file > 2GB is created.)
diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index bbf477a..60658d0 100644
--- a/misc/mke2fs.c
+++ b/misc/mke2fs.c
@@ -902,7 +902,8 @@ static __u32 ok_features[3] = {
EXT2_FEATURE_INCOMPAT_META_BG|
EXT4_FEATURE_INCOMPAT_FLEX_BG|
EXT4_FEATURE_INCOMPAT_MMP |
- EXT4_FEATURE_INCOMPAT_64BIT,
+ EXT4_FEATURE_INCOMPAT_64BIT|
+ EXT4_FEATURE_INCOMPAT_INLINE_DATA,
/* R/O compat */
EXT2_FEATURE_RO_COMPAT_LARGE_FILE|
EXT4_FEATURE_RO_COMPAT_HUGE_FILE|
@@ -2042,6 +2043,17 @@ profile_error:
exit(1);
}
+ /* Since inline_data depends on ext_attr, we would ask it to be
+ * enabled.
+ */
+ if ((fs_param.s_feature_incompat & EXT4_FEATURE_INCOMPAT_INLINE_DATA) &&
+ !(fs_param.s_feature_compat & EXT2_FEATURE_COMPAT_EXT_ATTR)) {
+ com_err(program_name, 0,
+ _("Ext_attr feature not enabled, so inline_data "
+ "feature doesn't be specified"));
+ exit(1);
+ }
+
if (fs_param.s_blocks_per_group) {
if (fs_param.s_blocks_per_group < 256 ||
fs_param.s_blocks_per_group > 8 * (unsigned) blocksize) {
--
1.7.12.rc0.22.gcdd159b