aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/checkpoint.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk.kim@samsung.com>2013-03-08 07:29:23 -0500
committerJaegeuk Kim <jaegeuk.kim@samsung.com>2013-03-20 05:30:06 -0400
commit393ff91f57c87d48ffed30878be6e3e486d3a00a (patch)
treec80fe33bcf8546ebce9ab6fc043b99889e67536f /fs/f2fs/checkpoint.c
parent25c0a6e529b56ca010e1f46239edd07c1b484b63 (diff)
f2fs: reduce unncessary locking pages during read
This patch reduces redundant locking and unlocking pages during read operations. In f2fs_readpage, let's use wait_on_page_locked() instead of lock_page. And then, when we need to modify any data finally, let's lock the page so that we can avoid lock contention. [readpage rule] - The f2fs_readpage returns unlocked page, or released page too in error cases. - Its caller should handle read error, -EIO, after locking the page, which indicates read completion. - Its caller should check PageUptodate after grab_cache_page. Signed-off-by: Changman Lee <cm224.lee@samsung.com> Reviewed-by: Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs/checkpoint.c')
-rw-r--r--fs/f2fs/checkpoint.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
index 2b6fc131e2ce..d947e66ee8a8 100644
--- a/fs/f2fs/checkpoint.c
+++ b/fs/f2fs/checkpoint.c
@@ -57,13 +57,15 @@ repeat:
57 cond_resched(); 57 cond_resched();
58 goto repeat; 58 goto repeat;
59 } 59 }
60 if (f2fs_readpage(sbi, page, index, READ_SYNC)) { 60 if (PageUptodate(page))
61 f2fs_put_page(page, 1); 61 goto out;
62
63 if (f2fs_readpage(sbi, page, index, READ_SYNC))
62 goto repeat; 64 goto repeat;
63 }
64 mark_page_accessed(page);
65 65
66 /* We do not allow returning an errorneous page */ 66 lock_page(page);
67out:
68 mark_page_accessed(page);
67 return page; 69 return page;
68} 70}
69 71