forked from huaijin-chen/taobao-kernel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path0021-ext4-Enable-ext4-inline-support.patch
50 lines (45 loc) · 2.04 KB
/
0021-ext4-Enable-ext4-inline-support.patch
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
From db2a21d036834c326a901b88c5b223854022c621 Mon Sep 17 00:00:00 2001
From: Tao Ma <[email protected]>
Date: Mon, 12 Dec 2011 17:24:57 +0800
Subject: [PATCH 21/22] ext4: Enable ext4 inline support.
Patch-mainline: in house
This patch enables ext4 inline support.
Signed-off-by: Tao Ma <[email protected]>
---
Index: linux-2.6.32-279.2.1.el5/fs/ext4/ext4.h
===================================================================
--- linux-2.6.32-279.2.1.el5.orig/fs/ext4/ext4.h
+++ linux-2.6.32-279.2.1.el5/fs/ext4/ext4.h
@@ -1349,6 +1349,9 @@ EXT4_INODE_BIT_FNS(state, state_flags)
#define EXT4_FEATURE_INCOMPAT_64BIT 0x0080
#define EXT4_FEATURE_INCOMPAT_MMP 0x0100
#define EXT4_FEATURE_INCOMPAT_FLEX_BG 0x0200
+#define EXT4_FEATURE_INCOMPAT_EA_INODE 0x0400 /* EA in inode */
+#define EXT4_FEATURE_INCOMPAT_DIRDATA 0x1000 /* data in dirent */
+#define EXT4_FEATURE_INCOMPAT_INLINEDATA 0x2000 /* data in inode */
#define EXT4_FEATURE_COMPAT_SUPP EXT2_FEATURE_COMPAT_EXT_ATTR
#define EXT4_FEATURE_INCOMPAT_SUPP (EXT4_FEATURE_INCOMPAT_FILETYPE| \
@@ -1356,7 +1359,9 @@ EXT4_INODE_BIT_FNS(state, state_flags)
EXT4_FEATURE_INCOMPAT_META_BG| \
EXT4_FEATURE_INCOMPAT_EXTENTS| \
EXT4_FEATURE_INCOMPAT_64BIT| \
- EXT4_FEATURE_INCOMPAT_FLEX_BG)
+ EXT4_FEATURE_INCOMPAT_FLEX_BG| \
+ EXT4_FEATURE_INCOMPAT_MMP | \
+ EXT4_FEATURE_INCOMPAT_INLINEDATA)
#define EXT4_FEATURE_RO_COMPAT_SUPP (EXT4_FEATURE_RO_COMPAT_SPARSE_SUPER| \
EXT4_FEATURE_RO_COMPAT_LARGE_FILE| \
EXT4_FEATURE_RO_COMPAT_GDT_CSUM| \
Index: linux-2.6.32-279.2.1.el5/fs/ext4/ialloc.c
===================================================================
--- linux-2.6.32-279.2.1.el5.orig/fs/ext4/ialloc.c
+++ linux-2.6.32-279.2.1.el5/fs/ext4/ialloc.c
@@ -1040,6 +1040,10 @@ got:
ei->i_extra_isize = EXT4_SB(sb)->s_want_extra_isize;
+ ei->i_inline_off = 0;
+ if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_INLINEDATA))
+ ext4_set_inode_state(inode, EXT4_STATE_MAY_INLINE_DATA);
+
ret = inode;
if (vfs_dq_alloc_inode(inode)) {
err = -EDQUOT;