diff options
author | Gu Zheng <guz.fnst@cn.fujitsu.com> | 2014-03-07 18:43:36 +0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2014-03-10 18:45:15 +0900 |
commit | d653788a43475eb3cdfcfaa60fb53451878944cf (patch) | |
tree | 0da228bfc15f19a852ef49e7b2519022d8e15a96 /fs/f2fs/segment.c | |
parent | 46c04366bbfd112a74dcfebbe41c9bf3f496ea75 (diff) | |
download | blackbird-op-linux-d653788a43475eb3cdfcfaa60fb53451878944cf.tar.gz blackbird-op-linux-d653788a43475eb3cdfcfaa60fb53451878944cf.zip |
f2fs: optimize restore_node_summary slightly
Previously, we ra_sum_pages to pre-read contiguous pages as more
as possible, and if we fail to alloc more pages, an ENOMEM error
will be reported upstream, even though we have alloced some pages
yet. In fact, we can use the available pages to do the job partly,
and continue the rest in the following circle. Only reporting ENOMEM
upstream if we really can not alloc any available page.
And another fix is ignoring dealing with the following pages if an
EIO occurs when reading page from page_list.
Signed-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com>
Reviewed-by: Chao Yu <chao2.yu@samsung.com>
[Jaegeuk Kim: modify the flow for better neat code]
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs/segment.c')
-rw-r--r-- | fs/f2fs/segment.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 199c964680c5..b3f84318b7ed 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -1160,9 +1160,12 @@ static int read_normal_summaries(struct f2fs_sb_info *sbi, int type) ns->ofs_in_node = 0; } } else { - if (restore_node_summary(sbi, segno, sum)) { + int err; + + err = restore_node_summary(sbi, segno, sum); + if (err) { f2fs_put_page(new, 1); - return -EINVAL; + return err; } } } |