summaryrefslogtreecommitdiffstats
path: root/fs/erofs/zdata.c
diff options
context:
space:
mode:
authorGao Xiang <gaoxiang25@huawei.com>2019-10-08 14:56:13 +0200
committerGao Xiang <gaoxiang25@huawei.com>2019-10-15 18:07:56 +0200
commitbda17a4577da729d17b8f87bf3279b9db201d8ca (patch)
treed0a3e5da54710a7992164a226005e3b5342fb985 /fs/erofs/zdata.c
parenterofs: clean up collection handling routines (diff)
downloadlinux-bda17a4577da729d17b8f87bf3279b9db201d8ca.tar.xz
linux-bda17a4577da729d17b8f87bf3279b9db201d8ca.zip
erofs: remove dead code since managed cache is now built-in
After commit 4279f3f9889f ("staging: erofs: turn cache strategies into mount options"), cache strategies are changed into mount options rather than old build configs. Let's kill useless code for obsoleted build options. Link: https://lore.kernel.org/r/20191008125616.183715-2-gaoxiang25@huawei.com Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Diffstat (limited to '')
-rw-r--r--fs/erofs/zdata.c25
1 files changed, 4 insertions, 21 deletions
diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c
index ef32757d1aac..93f8bc1a64f6 100644
--- a/fs/erofs/zdata.c
+++ b/fs/erofs/zdata.c
@@ -574,7 +574,7 @@ static int z_erofs_do_read_page(struct z_erofs_decompress_frontend *fe,
struct list_head *pagepool)
{
struct inode *const inode = fe->inode;
- struct erofs_sb_info *const sbi __maybe_unused = EROFS_I_SB(inode);
+ struct erofs_sb_info *const sbi = EROFS_I_SB(inode);
struct erofs_map_blocks *const map = &fe->map;
struct z_erofs_collector *const clt = &fe->clt;
const loff_t offset = page_offset(page);
@@ -997,8 +997,6 @@ static struct page *pickup_page_for_submission(struct z_erofs_pcluster *pcl,
struct address_space *mc,
gfp_t gfp)
{
- /* determined at compile time to avoid too many #ifdefs */
- const bool nocache = __builtin_constant_p(mc) ? !mc : false;
const pgoff_t index = pcl->obj.index;
bool tocache = false;
@@ -1019,7 +1017,7 @@ repeat:
* the cached page has not been allocated and
* an placeholder is out there, prepare it now.
*/
- if (!nocache && page == PAGE_UNALLOCATED) {
+ if (page == PAGE_UNALLOCATED) {
tocache = true;
goto out_allocpage;
}
@@ -1032,21 +1030,6 @@ repeat:
mapping = READ_ONCE(page->mapping);
/*
- * if managed cache is disabled, it's no way to
- * get such a cached-like page.
- */
- if (nocache) {
- /* if managed cache is disabled, it is impossible `justfound' */
- DBG_BUGON(justfound);
-
- /* and it should be locked, not uptodate, and not truncated */
- DBG_BUGON(!PageLocked(page));
- DBG_BUGON(PageUptodate(page));
- DBG_BUGON(!mapping);
- goto out;
- }
-
- /*
* unmanaged (file) pages are all locked solidly,
* therefore it is impossible for `mapping' to be NULL.
*/
@@ -1102,7 +1085,7 @@ out_allocpage:
cpu_relax();
goto repeat;
}
- if (nocache || !tocache)
+ if (!tocache)
goto out;
if (add_to_page_cache_lru(page, mc, index + nr, gfp)) {
page->mapping = Z_EROFS_MAPPING_STAGING;
@@ -1208,7 +1191,7 @@ static bool z_erofs_vle_submit_all(struct super_block *sb,
struct z_erofs_unzip_io *fgq,
bool force_fg)
{
- struct erofs_sb_info *const sbi __maybe_unused = EROFS_SB(sb);
+ struct erofs_sb_info *const sbi = EROFS_SB(sb);
z_erofs_next_pcluster_t qtail[NR_JOBQUEUES];
struct z_erofs_unzip_io *q[NR_JOBQUEUES];
struct bio *bio;