@@ -108,22 +108,6 @@ static void erofs_free_inode(struct inode *inode)
108
108
kmem_cache_free (erofs_inode_cachep , vi );
109
109
}
110
110
111
- static bool check_layout_compatibility (struct super_block * sb ,
112
- struct erofs_super_block * dsb )
113
- {
114
- const unsigned int feature = le32_to_cpu (dsb -> feature_incompat );
115
-
116
- EROFS_SB (sb )-> feature_incompat = feature ;
117
-
118
- /* check if current kernel meets all mandatory requirements */
119
- if (feature & (~EROFS_ALL_FEATURE_INCOMPAT )) {
120
- erofs_err (sb , "unidentified incompatible feature %x, please upgrade kernel" ,
121
- feature & ~EROFS_ALL_FEATURE_INCOMPAT );
122
- return false;
123
- }
124
- return true;
125
- }
126
-
127
111
/* read variable-sized metadata, offset will be aligned by 4-byte */
128
112
void * erofs_read_metadata (struct super_block * sb , struct erofs_buf * buf ,
129
113
erofs_off_t * offset , int * lengthp )
@@ -279,7 +263,7 @@ static int erofs_scan_devices(struct super_block *sb,
279
263
280
264
static int erofs_read_superblock (struct super_block * sb )
281
265
{
282
- struct erofs_sb_info * sbi ;
266
+ struct erofs_sb_info * sbi = EROFS_SB ( sb ) ;
283
267
struct erofs_buf buf = __EROFS_BUF_INITIALIZER ;
284
268
struct erofs_super_block * dsb ;
285
269
void * data ;
@@ -291,9 +275,7 @@ static int erofs_read_superblock(struct super_block *sb)
291
275
return PTR_ERR (data );
292
276
}
293
277
294
- sbi = EROFS_SB (sb );
295
278
dsb = (struct erofs_super_block * )(data + EROFS_SUPER_OFFSET );
296
-
297
279
ret = - EINVAL ;
298
280
if (le32_to_cpu (dsb -> magic ) != EROFS_SUPER_MAGIC_V1 ) {
299
281
erofs_err (sb , "cannot find valid erofs superblock" );
@@ -318,8 +300,12 @@ static int erofs_read_superblock(struct super_block *sb)
318
300
}
319
301
320
302
ret = - EINVAL ;
321
- if (!check_layout_compatibility (sb , dsb ))
303
+ sbi -> feature_incompat = le32_to_cpu (dsb -> feature_incompat );
304
+ if (sbi -> feature_incompat & ~EROFS_ALL_FEATURE_INCOMPAT ) {
305
+ erofs_err (sb , "unidentified incompatible feature %x, please upgrade kernel" ,
306
+ sbi -> feature_incompat & ~EROFS_ALL_FEATURE_INCOMPAT );
322
307
goto out ;
308
+ }
323
309
324
310
sbi -> sb_size = 128 + dsb -> sb_extslots * EROFS_SB_EXTSLOT_SIZE ;
325
311
if (sbi -> sb_size > PAGE_SIZE - EROFS_SUPER_OFFSET ) {
0 commit comments