diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2015-07-15 13:08:21 -0700 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2015-08-05 08:08:07 -0700 |
commit | 86531d6b84bc096d5d9dbc23333df0ab8d347763 (patch) | |
tree | 337420cfa917add8aa0735bff2ee8780d416c6ac /fs/f2fs/node.c | |
parent | 727edac572034557d207b293a47de25145e3d58c (diff) | |
download | blackbird-obmc-linux-86531d6b84bc096d5d9dbc23333df0ab8d347763.tar.gz blackbird-obmc-linux-86531d6b84bc096d5d9dbc23333df0ab8d347763.zip |
f2fs: callers take care of the page from bio error
This patch changes for a caller to handle the page after its bio gets an error.
Reviewed-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/node.c')
-rw-r--r-- | fs/f2fs/node.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index a05eb35a372c..7dd2b9d78a45 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -991,8 +991,7 @@ fail: /* * Caller should do after getting the following values. * 0: f2fs_put_page(page, 0) - * LOCKED_PAGE: f2fs_put_page(page, 1) - * error: nothing + * LOCKED_PAGE or error: f2fs_put_page(page, 1) */ static int read_node_page(struct page *page, int rw) { @@ -1010,7 +1009,6 @@ static int read_node_page(struct page *page, int rw) if (unlikely(ni.blk_addr == NULL_ADDR)) { ClearPageUptodate(page); - f2fs_put_page(page, 1); return -ENOENT; } @@ -1041,10 +1039,7 @@ void ra_node_page(struct f2fs_sb_info *sbi, nid_t nid) return; err = read_node_page(apage, READA); - if (err == 0) - f2fs_put_page(apage, 0); - else if (err == LOCKED_PAGE) - f2fs_put_page(apage, 1); + f2fs_put_page(apage, err ? 1 : 0); } struct page *get_node_page(struct f2fs_sb_info *sbi, pgoff_t nid) @@ -1057,10 +1052,12 @@ repeat: return ERR_PTR(-ENOMEM); err = read_node_page(page, READ_SYNC); - if (err < 0) + if (err < 0) { + f2fs_put_page(page, 1); return ERR_PTR(err); - else if (err != LOCKED_PAGE) + } else if (err != LOCKED_PAGE) { lock_page(page); + } if (unlikely(!PageUptodate(page) || nid != nid_of_node(page))) { ClearPageUptodate(page); @@ -1096,10 +1093,12 @@ repeat: return ERR_PTR(-ENOMEM); err = read_node_page(page, READ_SYNC); - if (err < 0) + if (err < 0) { + f2fs_put_page(page, 1); return ERR_PTR(err); - else if (err == LOCKED_PAGE) + } else if (err == LOCKED_PAGE) { goto page_hit; + } blk_start_plug(&plug); |