@@ -1403,6 +1403,7 @@ ext4_ext_create_new_leaf(handle_t *handle, struct inode *inode,
1403
1403
{
1404
1404
struct ext4_ext_path * curp ;
1405
1405
int depth , i , err = 0 ;
1406
+ ext4_lblk_t ee_block = le32_to_cpu (newext -> ee_block );
1406
1407
1407
1408
repeat :
1408
1409
i = depth = ext_depth (inode );
@@ -1424,33 +1425,30 @@ ext4_ext_create_new_leaf(handle_t *handle, struct inode *inode,
1424
1425
goto errout ;
1425
1426
1426
1427
/* refill path */
1427
- path = ext4_find_extent (inode ,
1428
- (ext4_lblk_t )le32_to_cpu (newext -> ee_block ),
1429
- path , gb_flags );
1428
+ path = ext4_find_extent (inode , ee_block , path , gb_flags );
1430
1429
return path ;
1431
- } else {
1432
- /* tree is full, time to grow in depth */
1433
- err = ext4_ext_grow_indepth (handle , inode , mb_flags );
1434
- if (err )
1435
- goto errout ;
1430
+ }
1436
1431
1437
- /* refill path */
1438
- path = ext4_find_extent (inode ,
1439
- (ext4_lblk_t )le32_to_cpu (newext -> ee_block ),
1440
- path , gb_flags );
1441
- if (IS_ERR (path ))
1442
- return path ;
1432
+ /* tree is full, time to grow in depth */
1433
+ err = ext4_ext_grow_indepth (handle , inode , mb_flags );
1434
+ if (err )
1435
+ goto errout ;
1443
1436
1444
- /*
1445
- * only first (depth 0 -> 1) produces free space;
1446
- * in all other cases we have to split the grown tree
1447
- */
1448
- depth = ext_depth (inode );
1449
- if (path [depth ].p_hdr -> eh_entries == path [depth ].p_hdr -> eh_max ) {
1450
- /* now we need to split */
1451
- goto repeat ;
1452
- }
1437
+ /* refill path */
1438
+ path = ext4_find_extent (inode , ee_block , path , gb_flags );
1439
+ if (IS_ERR (path ))
1440
+ return path ;
1441
+
1442
+ /*
1443
+ * only first (depth 0 -> 1) produces free space;
1444
+ * in all other cases we have to split the grown tree
1445
+ */
1446
+ depth = ext_depth (inode );
1447
+ if (path [depth ].p_hdr -> eh_entries == path [depth ].p_hdr -> eh_max ) {
1448
+ /* now we need to split */
1449
+ goto repeat ;
1453
1450
}
1451
+
1454
1452
return path ;
1455
1453
1456
1454
errout :
0 commit comments