aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/data.c
diff options
context:
space:
mode:
authorChao Yu <chao2.yu@samsung.com>2014-03-22 14:57:23 +0800
committerZiyan <jaraidaniel@gmail.com>2015-05-02 14:36:40 +0200
commit9c312174602bf1cf448d847d5633215e94a090fc (patch)
tree65a32b8bb2a66fc52e67f6e94ce0fe1c15329015 /fs/f2fs/data.c
parentd302e989359f18ab1d4f34a333547413d569550d (diff)
downloadkernel_samsung_tuna-9c312174602bf1cf448d847d5633215e94a090fc.zip
kernel_samsung_tuna-9c312174602bf1cf448d847d5633215e94a090fc.tar.gz
kernel_samsung_tuna-9c312174602bf1cf448d847d5633215e94a090fc.tar.bz2
f2fs: avoid unnecessary bio submit when wait page writeback
This patch introduce is_merged_page() to check whether current page is merged in f2fs bio cache. When page is not in cache, we can avoid submitting bio cache, resulting in having more chance to merge pages. Signed-off-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs/data.c')
-rw-r--r--fs/f2fs/data.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index f4a9eb4..ea58787 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -140,7 +140,7 @@ void f2fs_submit_merged_bio(struct f2fs_sb_info *sbi,
io = is_read_io(rw) ? &sbi->read_io : &sbi->write_io[btype];
- mutex_lock(&io->io_mutex);
+ down_write(&io->io_rwsem);
/* change META to META_FLUSH in the checkpoint procedure */
if (type >= META_FLUSH) {
@@ -148,7 +148,7 @@ void f2fs_submit_merged_bio(struct f2fs_sb_info *sbi,
io->fio.rw = WRITE_FLUSH_FUA | REQ_META | REQ_PRIO;
}
__submit_merged_bio(io);
- mutex_unlock(&io->io_mutex);
+ up_write(&io->io_rwsem);
}
/*
@@ -186,7 +186,7 @@ void f2fs_submit_page_mbio(struct f2fs_sb_info *sbi, struct page *page,
verify_block_addr(sbi, blk_addr);
- mutex_lock(&io->io_mutex);
+ down_write(&io->io_rwsem);
if (!is_read)
inc_page_count(sbi, F2FS_WRITEBACK);
@@ -210,7 +210,7 @@ alloc_new:
io->last_block_in_bio = blk_addr;
- mutex_unlock(&io->io_mutex);
+ up_write(&io->io_rwsem);
trace_f2fs_submit_page_mbio(page, fio->rw, fio->type, blk_addr);
}