aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/f2fs/data.c11
-rw-r--r--fs/f2fs/f2fs.h2
-rw-r--r--fs/f2fs/segment.c9
3 files changed, 22 insertions, 0 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 8a831f17503e..00b37a1bd15c 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -1053,6 +1053,11 @@ int f2fs_map_blocks(struct inode *inode, struct f2fs_map_blocks *map,
1053 map->m_flags = F2FS_MAP_MAPPED; 1053 map->m_flags = F2FS_MAP_MAPPED;
1054 if (map->m_next_extent) 1054 if (map->m_next_extent)
1055 *map->m_next_extent = pgofs + map->m_len; 1055 *map->m_next_extent = pgofs + map->m_len;
1056
1057 /* for hardware encryption, but to avoid potential issue in future */
1058 if (flag == F2FS_GET_BLOCK_DIO)
1059 f2fs_wait_on_block_writeback_range(inode,
1060 map->m_pblk, map->m_len);
1056 goto out; 1061 goto out;
1057 } 1062 }
1058 1063
@@ -1211,6 +1216,12 @@ skip:
1211 goto next_dnode; 1216 goto next_dnode;
1212 1217
1213sync_out: 1218sync_out:
1219
1220 /* for hardware encryption, but to avoid potential issue in future */
1221 if (flag == F2FS_GET_BLOCK_DIO && map->m_flags & F2FS_MAP_MAPPED)
1222 f2fs_wait_on_block_writeback_range(inode,
1223 map->m_pblk, map->m_len);
1224
1214 if (flag == F2FS_GET_BLOCK_PRECACHE) { 1225 if (flag == F2FS_GET_BLOCK_PRECACHE) {
1215 if (map->m_flags & F2FS_MAP_MAPPED) { 1226 if (map->m_flags & F2FS_MAP_MAPPED) {
1216 unsigned int ofs = start_pgofs - map->m_lblk; 1227 unsigned int ofs = start_pgofs - map->m_lblk;
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index c25c67868b98..5c80eca194b5 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -2988,6 +2988,8 @@ void f2fs_allocate_data_block(struct f2fs_sb_info *sbi, struct page *page,
2988void f2fs_wait_on_page_writeback(struct page *page, 2988void f2fs_wait_on_page_writeback(struct page *page,
2989 enum page_type type, bool ordered); 2989 enum page_type type, bool ordered);
2990void f2fs_wait_on_block_writeback(struct inode *inode, block_t blkaddr); 2990void f2fs_wait_on_block_writeback(struct inode *inode, block_t blkaddr);
2991void f2fs_wait_on_block_writeback_range(struct inode *inode, block_t blkaddr,
2992 block_t len);
2991void f2fs_write_data_summaries(struct f2fs_sb_info *sbi, block_t start_blk); 2993void f2fs_write_data_summaries(struct f2fs_sb_info *sbi, block_t start_blk);
2992void f2fs_write_node_summaries(struct f2fs_sb_info *sbi, block_t start_blk); 2994void f2fs_write_node_summaries(struct f2fs_sb_info *sbi, block_t start_blk);
2993int f2fs_lookup_journal_in_cursum(struct f2fs_journal *journal, int type, 2995int f2fs_lookup_journal_in_cursum(struct f2fs_journal *journal, int type,
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index e38b2f69b68e..6edcf8391dd3 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -3303,6 +3303,15 @@ void f2fs_wait_on_block_writeback(struct inode *inode, block_t blkaddr)
3303 } 3303 }
3304} 3304}
3305 3305
3306void f2fs_wait_on_block_writeback_range(struct inode *inode, block_t blkaddr,
3307 block_t len)
3308{
3309 block_t i;
3310
3311 for (i = 0; i < len; i++)
3312 f2fs_wait_on_block_writeback(inode, blkaddr + i);
3313}
3314
3306static int read_compacted_summaries(struct f2fs_sb_info *sbi) 3315static int read_compacted_summaries(struct f2fs_sb_info *sbi)
3307{ 3316{
3308 struct f2fs_checkpoint *ckpt = F2FS_CKPT(sbi); 3317 struct f2fs_checkpoint *ckpt = F2FS_CKPT(sbi);