summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/gc.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2017-09-06 02:04:35 +0200
committerJaegeuk Kim <jaegeuk@kernel.org>2017-09-06 05:21:48 +0200
commitd4c759ee5faa51e0b0ee55d8a229ba5b80c4917e (patch)
tree7ca28f80d5556105f86196e39d03062ee9a9950d /fs/f2fs/gc.c
parentf2fs: introduce f2fs_encrypted_file for clean-up (diff)
downloadlinux-d4c759ee5faa51e0b0ee55d8a229ba5b80c4917e.tar.xz
linux-d4c759ee5faa51e0b0ee55d8a229ba5b80c4917e.zip
f2fs: use generic terms used for encrypted block management
This patch renames functions regarding to buffer management via META_MAPPING used for encrypted blocks especially. We can actually use them in generic way. Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/gc.c')
-rw-r--r--fs/f2fs/gc.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index 6a12f33d0cdd..bfe6a8ccc3a0 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -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]);