|
@@ -599,8 +599,12 @@ static bool is_alive(struct f2fs_sb_info *sbi, struct f2fs_summary *sum,
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
-static void move_encrypted_block(struct inode *inode, block_t bidx,
|
|
|
- unsigned int segno, int off)
|
|
|
+/*
|
|
|
+ * Move data block via META_MAPPING while keeping locked data page.
|
|
|
+ * This can be used to move blocks, aka LBAs, directly on disk.
|
|
|
+ */
|
|
|
+static void move_data_block(struct inode *inode, block_t bidx,
|
|
|
+ unsigned int segno, int off)
|
|
|
{
|
|
|
struct f2fs_io_info fio = {
|
|
|
.sbi = F2FS_I_SB(inode),
|
|
@@ -873,9 +877,10 @@ next_step:
|
|
|
start_bidx = start_bidx_of_node(nofs, inode)
|
|
|
+ ofs_in_node;
|
|
|
if (f2fs_encrypted_file(inode))
|
|
|
- move_encrypted_block(inode, start_bidx, segno, off);
|
|
|
+ move_data_block(inode, start_bidx, segno, off);
|
|
|
else
|
|
|
- move_data_page(inode, start_bidx, gc_type, segno, off);
|
|
|
+ move_data_page(inode, start_bidx, gc_type,
|
|
|
+ segno, off);
|
|
|
|
|
|
if (locked) {
|
|
|
up_write(&fi->dio_rwsem[WRITE]);
|