Commit 23cd573b authored by Zhang Zhen's avatar Zhang Zhen Committed by Yan, Zheng

ceph: refactor readpage_nounlock() to make the logic clearer

If the return value of ceph_osdc_readpages() is not negative,
it is certainly greater than or equal to zero.

Remove the useless condition judgment and redundant braces.
Signed-off-by: default avatarZhang Zhen <zhenzhang.zhang@huawei.com>
Reviewed-by: default avatarYan, Zheng <zheng.z.yan@intel.com>
parent ca665e02
...@@ -211,18 +211,15 @@ static int readpage_nounlock(struct file *filp, struct page *page) ...@@ -211,18 +211,15 @@ static int readpage_nounlock(struct file *filp, struct page *page)
SetPageError(page); SetPageError(page);
ceph_fscache_readpage_cancel(inode, page); ceph_fscache_readpage_cancel(inode, page);
goto out; goto out;
} else {
if (err < PAGE_CACHE_SIZE) {
/* zero fill remainder of page */
zero_user_segment(page, err, PAGE_CACHE_SIZE);
} else {
flush_dcache_page(page);
}
} }
SetPageUptodate(page); if (err < PAGE_CACHE_SIZE)
/* zero fill remainder of page */
zero_user_segment(page, err, PAGE_CACHE_SIZE);
else
flush_dcache_page(page);
if (err >= 0) SetPageUptodate(page);
ceph_readpage_to_fscache(inode, page); ceph_readpage_to_fscache(inode, page);
out: out:
return err < 0 ? err : 0; return err < 0 ? err : 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment