File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed
Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -1066,7 +1066,7 @@ static int truncate_partial_nodes(struct dnode_of_data *dn,
10661066 int i ;
10671067 int idx = depth - 2 ;
10681068
1069- nid [0 ] = le32_to_cpu ( ri -> i_nid [ offset [0 ] - NODE_DIR1_BLOCK ] );
1069+ nid [0 ] = get_nid ( dn -> inode_page , offset [0 ], true );
10701070 if (!nid [0 ])
10711071 return 0 ;
10721072
@@ -1177,7 +1177,7 @@ int f2fs_truncate_inode_blocks(struct inode *inode, pgoff_t from)
11771177
11781178skip_partial :
11791179 while (cont ) {
1180- dn .nid = le32_to_cpu ( ri -> i_nid [ offset [0 ] - NODE_DIR1_BLOCK ] );
1180+ dn .nid = get_nid ( page , offset [0 ], true );
11811181 switch (offset [0 ]) {
11821182 case NODE_DIR1_BLOCK :
11831183 case NODE_DIR2_BLOCK :
@@ -1209,13 +1209,10 @@ int f2fs_truncate_inode_blocks(struct inode *inode, pgoff_t from)
12091209 }
12101210 if (err < 0 )
12111211 goto fail ;
1212- if (offset [1 ] == 0 &&
1213- ri -> i_nid [offset [0 ] - NODE_DIR1_BLOCK ]) {
1212+ if (offset [1 ] == 0 && get_nid (page , offset [0 ], true)) {
12141213 lock_page (page );
12151214 BUG_ON (page -> mapping != NODE_MAPPING (sbi ));
1216- f2fs_wait_on_page_writeback (page , NODE , true, true);
1217- ri -> i_nid [offset [0 ] - NODE_DIR1_BLOCK ] = 0 ;
1218- set_page_dirty (page );
1215+ set_nid (page , offset [0 ], 0 , true);
12191216 unlock_page (page );
12201217 }
12211218 offset [1 ] = 0 ;
You can’t perform that action at this time.
0 commit comments