summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/gc.c
diff options
context:
space:
mode:
authorChao Yu <chao2.yu@samsung.com>2016-02-22 18:36:38 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2016-02-22 21:40:02 -0800
commit7a9d75481b85d59204d76097d41a28db663a7a43 (patch)
tree4bcb0d357731896f48fafffdae9843ecabde0f4f /fs/f2fs/gc.c
parent9a4cbc9e5318608740e3e3e44d4d565e19ad5e74 (diff)
downloadlinux-7a9d75481b85d59204d76097d41a28db663a7a43.tar.gz
linux-7a9d75481b85d59204d76097d41a28db663a7a43.tar.bz2
linux-7a9d75481b85d59204d76097d41a28db663a7a43.zip
f2fs: trace old block address for CoWed page
This patch enables to trace old block address of CoWed page for better debugging. f2fs_submit_page_mbio: dev = (1,0), ino = 1, page_index = 0x1d4f0, oldaddr = 0xfe8ab, newaddr = 0xfee90 rw = WRITE_SYNC, type = NODE f2fs_submit_page_mbio: dev = (1,0), ino = 1, page_index = 0x1d4f8, oldaddr = 0xfe8b0, newaddr = 0xfee91 rw = WRITE_SYNC, type = NODE f2fs_submit_page_mbio: dev = (1,0), ino = 1, page_index = 0x1d4fa, oldaddr = 0xfe8ae, newaddr = 0xfee92 rw = WRITE_SYNC, type = NODE f2fs_submit_page_mbio: dev = (1,0), ino = 134824, page_index = 0x96, oldaddr = 0xf049b, newaddr = 0x2bbe rw = WRITE, type = DATA f2fs_submit_page_mbio: dev = (1,0), ino = 134824, page_index = 0x97, oldaddr = 0xf049c, newaddr = 0x2bbf rw = WRITE, type = DATA f2fs_submit_page_mbio: dev = (1,0), ino = 134824, page_index = 0x98, oldaddr = 0xf049d, newaddr = 0x2bc0 rw = WRITE, type = DATA f2fs_submit_page_mbio: dev = (1,0), ino = 135260, page_index = 0x47, oldaddr = 0xffffffff, newaddr = 0xf2631 rw = WRITE, type = DATA f2fs_submit_page_mbio: dev = (1,0), ino = 135260, page_index = 0x48, oldaddr = 0xffffffff, newaddr = 0xf2632 rw = WRITE, type = DATA f2fs_submit_page_mbio: dev = (1,0), ino = 135260, page_index = 0x49, oldaddr = 0xffffffff, newaddr = 0xf2633 rw = WRITE, type = DATA Signed-off-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/gc.c')
-rw-r--r--fs/f2fs/gc.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index 8d63fc0b84ea..4bd0c91d7b5f 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -581,10 +581,10 @@ static void move_encrypted_block(struct inode *inode, block_t bidx)
/* read page */
fio.page = page;
- fio.blk_addr = dn.data_blkaddr;
+ fio.new_blkaddr = fio.old_blkaddr = dn.data_blkaddr;
fio.encrypted_page = pagecache_get_page(META_MAPPING(fio.sbi),
- fio.blk_addr,
+ fio.new_blkaddr,
FGP_LOCK|FGP_CREAT,
GFP_NOFS);
if (!fio.encrypted_page)
@@ -611,12 +611,12 @@ static void move_encrypted_block(struct inode *inode, block_t bidx)
/* allocate block address */
f2fs_wait_on_page_writeback(dn.node_page, NODE, true);
- allocate_data_block(fio.sbi, NULL, fio.blk_addr,
- &fio.blk_addr, &sum, CURSEG_COLD_DATA);
+ allocate_data_block(fio.sbi, NULL, fio.old_blkaddr, &fio.new_blkaddr,
+ &sum, CURSEG_COLD_DATA);
fio.rw = WRITE_SYNC;
f2fs_submit_page_mbio(&fio);
- dn.data_blkaddr = fio.blk_addr;
+ dn.data_blkaddr = fio.new_blkaddr;
set_data_blkaddr(&dn);
f2fs_update_extent_cache(&dn);
set_inode_flag(F2FS_I(inode), FI_APPEND_WRITE);