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,
1066
1066
int i ;
1067
1067
int idx = depth - 2 ;
1068
1068
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 );
1070
1070
if (!nid [0 ])
1071
1071
return 0 ;
1072
1072
@@ -1177,7 +1177,7 @@ int f2fs_truncate_inode_blocks(struct inode *inode, pgoff_t from)
1177
1177
1178
1178
skip_partial :
1179
1179
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 );
1181
1181
switch (offset [0 ]) {
1182
1182
case NODE_DIR1_BLOCK :
1183
1183
case NODE_DIR2_BLOCK :
@@ -1209,13 +1209,10 @@ int f2fs_truncate_inode_blocks(struct inode *inode, pgoff_t from)
1209
1209
}
1210
1210
if (err < 0 )
1211
1211
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)) {
1214
1213
lock_page (page );
1215
1214
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);
1219
1216
unlock_page (page );
1220
1217
}
1221
1218
offset [1 ] = 0 ;
You can’t perform that action at this time.
0 commit comments