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: Zhang Zhen <zhenzhang.zhang@huawei.com>
Reviewed-by: Yan, Zheng <zheng.z.yan@intel.com>
This commit is contained in:
Zhang Zhen 2014-05-28 15:09:55 +08:00 committed by Yan, Zheng
parent ca665e0282
commit 23cd573b46

View File

@ -211,17 +211,14 @@ 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) { if (err < PAGE_CACHE_SIZE)
/* zero fill remainder of page */ /* zero fill remainder of page */
zero_user_segment(page, err, PAGE_CACHE_SIZE); zero_user_segment(page, err, PAGE_CACHE_SIZE);
} else { else
flush_dcache_page(page); flush_dcache_page(page);
}
}
SetPageUptodate(page);
if (err >= 0) SetPageUptodate(page);
ceph_readpage_to_fscache(inode, page); ceph_readpage_to_fscache(inode, page);
out: out: