generic-find-next-le-bit: Import whitespace changes and akpm sign-off from mm
[ext4-patch-queue.git] / remove-obsolete-fragments.patch
blob1a36a527755c50ddb999f74ba0b632123689a6fb
1 From: Coly Li <coyli@suse.de>
3 Once ext4 will not implement fragment, it is believed it will never be
4 implement in future. Therefore fragment related source code in ext4 should
5 be obsoleted -- no one will use it.
7 This patch obsolete fragment from ext4. Another patch posted on linux-ext4
8 removing fragment supporting from e2fsprogs.
10 Signed-off-by: Coly Li <coyli@suse.de>
11 Acked-by: Andreas Dilger <adilger@clusterfs.com>
12 Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
13 ---
15 fs/ext4/ialloc.c | 5 -----
16 fs/ext4/inode.c | 10 ----------
17 fs/ext4/super.c | 15 ---------------
18 include/linux/ext4_fs.h | 35 ++++++-----------------------------
19 include/linux/ext4_fs_i.h | 5 -----
20 include/linux/ext4_fs_sb.h | 3 ---
21 6 files changed, 6 insertions(+), 67 deletions(-)
23 diff -puN fs/ext4/ialloc.c~ext4-remove-obsolete-fragments fs/ext4/ialloc.c
24 --- a/fs/ext4/ialloc.c~ext4-remove-obsolete-fragments
25 +++ a/fs/ext4/ialloc.c
26 @@ -573,11 +573,6 @@ got:
27 /* dirsync only applies to directories */
28 if (!S_ISDIR(mode))
29 ei->i_flags &= ~EXT4_DIRSYNC_FL;
30 -#ifdef EXT4_FRAGMENTS
31 - ei->i_faddr = 0;
32 - ei->i_frag_no = 0;
33 - ei->i_frag_size = 0;
34 -#endif
35 ei->i_file_acl = 0;
36 ei->i_dir_acl = 0;
37 ei->i_dtime = 0;
38 diff -puN fs/ext4/inode.c~ext4-remove-obsolete-fragments fs/ext4/inode.c
39 --- a/fs/ext4/inode.c~ext4-remove-obsolete-fragments
40 +++ a/fs/ext4/inode.c
41 @@ -2741,11 +2741,6 @@ void ext4_read_inode(struct inode * inod
43 inode->i_blocks = le32_to_cpu(raw_inode->i_blocks);
44 ei->i_flags = le32_to_cpu(raw_inode->i_flags);
45 -#ifdef EXT4_FRAGMENTS
46 - ei->i_faddr = le32_to_cpu(raw_inode->i_faddr);
47 - ei->i_frag_no = raw_inode->i_frag;
48 - ei->i_frag_size = raw_inode->i_fsize;
49 -#endif
50 ei->i_file_acl = le32_to_cpu(raw_inode->i_file_acl);
51 if (EXT4_SB(inode->i_sb)->s_es->s_creator_os !=
52 cpu_to_le32(EXT4_OS_HURD))
53 @@ -2897,11 +2892,6 @@ static int ext4_do_update_inode(handle_t
54 raw_inode->i_blocks = cpu_to_le32(inode->i_blocks);
55 raw_inode->i_dtime = cpu_to_le32(ei->i_dtime);
56 raw_inode->i_flags = cpu_to_le32(ei->i_flags);
57 -#ifdef EXT4_FRAGMENTS
58 - raw_inode->i_faddr = cpu_to_le32(ei->i_faddr);
59 - raw_inode->i_frag = ei->i_frag_no;
60 - raw_inode->i_fsize = ei->i_frag_size;
61 -#endif
62 if (EXT4_SB(inode->i_sb)->s_es->s_creator_os !=
63 cpu_to_le32(EXT4_OS_HURD))
64 raw_inode->i_file_acl_high =
65 diff -puN fs/ext4/super.c~ext4-remove-obsolete-fragments fs/ext4/super.c
66 --- a/fs/ext4/super.c~ext4-remove-obsolete-fragments
67 +++ a/fs/ext4/super.c
68 @@ -1759,14 +1759,6 @@ static int ext4_fill_super (struct super
69 if (sbi->s_inode_size > EXT4_GOOD_OLD_INODE_SIZE)
70 sb->s_time_gran = 1 << (EXT4_EPOCH_BITS - 2);
72 - sbi->s_frag_size = EXT4_MIN_FRAG_SIZE <<
73 - le32_to_cpu(es->s_log_frag_size);
74 - if (blocksize != sbi->s_frag_size) {
75 - printk(KERN_ERR
76 - "EXT4-fs: fragsize %lu != blocksize %u (unsupported)\n",
77 - sbi->s_frag_size, blocksize);
78 - goto failed_mount;
79 - }
80 sbi->s_desc_size = le16_to_cpu(es->s_desc_size);
81 if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_64BIT)) {
82 if (sbi->s_desc_size < EXT4_MIN_DESC_SIZE_64BIT ||
83 @@ -1780,7 +1772,6 @@ static int ext4_fill_super (struct super
84 } else
85 sbi->s_desc_size = EXT4_MIN_DESC_SIZE;
86 sbi->s_blocks_per_group = le32_to_cpu(es->s_blocks_per_group);
87 - sbi->s_frags_per_group = le32_to_cpu(es->s_frags_per_group);
88 sbi->s_inodes_per_group = le32_to_cpu(es->s_inodes_per_group);
89 if (EXT4_INODE_SIZE(sb) == 0)
90 goto cantfind_ext4;
91 @@ -1804,12 +1795,6 @@ static int ext4_fill_super (struct super
92 sbi->s_blocks_per_group);
93 goto failed_mount;
95 - if (sbi->s_frags_per_group > blocksize * 8) {
96 - printk (KERN_ERR
97 - "EXT4-fs: #fragments per group too big: %lu\n",
98 - sbi->s_frags_per_group);
99 - goto failed_mount;
101 if (sbi->s_inodes_per_group > blocksize * 8) {
102 printk (KERN_ERR
103 "EXT4-fs: #inodes per group too big: %lu\n",
104 diff -puN include/linux/ext4_fs.h~ext4-remove-obsolete-fragments include/linux/ext4_fs.h
105 --- a/include/linux/ext4_fs.h~ext4-remove-obsolete-fragments
106 +++ a/include/linux/ext4_fs.h
107 @@ -105,20 +105,6 @@
108 #define EXT4_BLOCK_ALIGN(size, blkbits) ALIGN((size), (1 << (blkbits)))
111 - * Macro-instructions used to manage fragments
112 - */
113 -#define EXT4_MIN_FRAG_SIZE 1024
114 -#define EXT4_MAX_FRAG_SIZE 4096
115 -#define EXT4_MIN_FRAG_LOG_SIZE 10
116 -#ifdef __KERNEL__
117 -# define EXT4_FRAG_SIZE(s) (EXT4_SB(s)->s_frag_size)
118 -# define EXT4_FRAGS_PER_BLOCK(s) (EXT4_SB(s)->s_frags_per_block)
119 -#else
120 -# define EXT4_FRAG_SIZE(s) (EXT4_MIN_FRAG_SIZE << (s)->s_log_frag_size)
121 -# define EXT4_FRAGS_PER_BLOCK(s) (EXT4_BLOCK_SIZE(s) / EXT4_FRAG_SIZE(s))
122 -#endif
125 * Structure of a blocks group descriptor
127 struct ext4_group_desc
128 @@ -312,27 +298,24 @@ struct ext4_inode {
129 __le32 i_generation; /* File version (for NFS) */
130 __le32 i_file_acl; /* File ACL */
131 __le32 i_dir_acl; /* Directory ACL */
132 - __le32 i_faddr; /* Fragment address */
133 + __le32 i_obso_faddr; /* Obsoleted fragment address */
134 union {
135 struct {
136 - __u8 l_i_frag; /* Fragment number */
137 - __u8 l_i_fsize; /* Fragment size */
138 + __le16 l_i_reserved1; /* Obsoleted fragment number/size which are removed in ext4 */
139 __le16 l_i_file_acl_high;
140 __le16 l_i_uid_high; /* these 2 fields */
141 __le16 l_i_gid_high; /* were reserved2[0] */
142 __u32 l_i_reserved2;
143 } linux2;
144 struct {
145 - __u8 h_i_frag; /* Fragment number */
146 - __u8 h_i_fsize; /* Fragment size */
147 + __le16 h_i_reserved1; /* Obsoleted fragment number/size which are removed in ext4 */
148 __u16 h_i_mode_high;
149 __u16 h_i_uid_high;
150 __u16 h_i_gid_high;
151 __u32 h_i_author;
152 } hurd2;
153 struct {
154 - __u8 m_i_frag; /* Fragment number */
155 - __u8 m_i_fsize; /* Fragment size */
156 + __le16 h_i_reserved1; /* Obsoleted fragment number/size which are removed in ext4 */
157 __le16 m_i_file_acl_high;
158 __u32 m_i_reserved2[2];
159 } masix2;
160 @@ -423,8 +406,6 @@ do { \
162 #if defined(__KERNEL__) || defined(__linux__)
163 #define i_reserved1 osd1.linux1.l_i_reserved1
164 -#define i_frag osd2.linux2.l_i_frag
165 -#define i_fsize osd2.linux2.l_i_fsize
166 #define i_file_acl_high osd2.linux2.l_i_file_acl_high
167 #define i_uid_low i_uid
168 #define i_gid_low i_gid
169 @@ -435,8 +416,6 @@ do { \
170 #elif defined(__GNU__)
172 #define i_translator osd1.hurd1.h_i_translator
173 -#define i_frag osd2.hurd2.h_i_frag;
174 -#define i_fsize osd2.hurd2.h_i_fsize;
175 #define i_uid_high osd2.hurd2.h_i_uid_high
176 #define i_gid_high osd2.hurd2.h_i_gid_high
177 #define i_author osd2.hurd2.h_i_author
178 @@ -444,8 +423,6 @@ do { \
179 #elif defined(__masix__)
181 #define i_reserved1 osd1.masix1.m_i_reserved1
182 -#define i_frag osd2.masix2.m_i_frag
183 -#define i_fsize osd2.masix2.m_i_fsize
184 #define i_file_acl_high osd2.masix2.m_i_file_acl_high
185 #define i_reserved2 osd2.masix2.m_i_reserved2
187 @@ -535,9 +512,9 @@ struct ext4_super_block {
188 /*10*/ __le32 s_free_inodes_count; /* Free inodes count */
189 __le32 s_first_data_block; /* First Data Block */
190 __le32 s_log_block_size; /* Block size */
191 - __le32 s_log_frag_size; /* Fragment size */
192 + __le32 s_obso_log_frag_size; /* Obsoleted fragment size */
193 /*20*/ __le32 s_blocks_per_group; /* # Blocks per group */
194 - __le32 s_frags_per_group; /* # Fragments per group */
195 + __le32 s_obso_frags_per_group; /* Obsoleted fragments per group */
196 __le32 s_inodes_per_group; /* # Inodes per group */
197 __le32 s_mtime; /* Mount time */
198 /*30*/ __le32 s_wtime; /* Write time */
199 diff -puN include/linux/ext4_fs_i.h~ext4-remove-obsolete-fragments include/linux/ext4_fs_i.h
200 --- a/include/linux/ext4_fs_i.h~ext4-remove-obsolete-fragments
201 +++ a/include/linux/ext4_fs_i.h
202 @@ -78,11 +78,6 @@ struct ext4_ext_cache {
203 struct ext4_inode_info {
204 __le32 i_data[15]; /* unconverted */
205 __u32 i_flags;
206 -#ifdef EXT4_FRAGMENTS
207 - __u32 i_faddr;
208 - __u8 i_frag_no;
209 - __u8 i_frag_size;
210 -#endif
211 ext4_fsblk_t i_file_acl;
212 __u32 i_dir_acl;
213 __u32 i_dtime;
214 diff -puN include/linux/ext4_fs_sb.h~ext4-remove-obsolete-fragments include/linux/ext4_fs_sb.h
215 --- a/include/linux/ext4_fs_sb.h~ext4-remove-obsolete-fragments
216 +++ a/include/linux/ext4_fs_sb.h
217 @@ -30,11 +30,8 @@ struct ext4_reservation_slot;
218 * third extended-fs super-block data in memory
220 struct ext4_sb_info {
221 - unsigned long s_frag_size; /* Size of a fragment in bytes */
222 unsigned long s_desc_size; /* Size of a group descriptor in bytes */
223 - unsigned long s_frags_per_block;/* Number of fragments per block */
224 unsigned long s_inodes_per_block;/* Number of inodes per block */
225 - unsigned long s_frags_per_group;/* Number of fragments in a group */
226 unsigned long s_blocks_per_group;/* Number of blocks in a group */
227 unsigned long s_inodes_per_group;/* Number of inodes in a group */
228 unsigned long s_itb_per_group; /* Number of inode table blocks per group */