Skip to content

Commit 4c7e425

Browse files
Yue Huhsiangkao
authored andcommitted
erofs: remove useless cache strategy of DELAYEDALLOC
After commit 1825c8d ("erofs: force inplace I/O under low memory scenario") and TRYALLOC is widely used, DELAYEDALLOC won't be used anymore. Remove related dead code. Also, remove the blank line at the end of zdata.h. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Gao Xiang <[email protected]> Signed-off-by: Yue Hu <[email protected]> Signed-off-by: Gao Xiang <[email protected]>
1 parent 86432a6 commit 4c7e425

File tree

2 files changed

+0
-21
lines changed

2 files changed

+0
-21
lines changed

fs/erofs/zdata.c

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -96,16 +96,9 @@ static void z_erofs_free_pcluster(struct z_erofs_pcluster *pcl)
9696
DBG_BUGON(1);
9797
}
9898

99-
/*
100-
* a compressed_pages[] placeholder in order to avoid
101-
* being filled with file pages for in-place decompression.
102-
*/
103-
#define PAGE_UNALLOCATED ((void *)0x5F0E4B1D)
104-
10599
/* how to allocate cached pages for a pcluster */
106100
enum z_erofs_cache_alloctype {
107101
DONTALLOC, /* don't allocate any cached pages */
108-
DELAYEDALLOC, /* delayed allocation (at the time of submitting io) */
109102
/*
110103
* try to use cached I/O if page allocation succeeds or fallback
111104
* to in-place I/O instead to avoid any direct reclaim.
@@ -267,10 +260,6 @@ static void preload_compressed_pages(struct z_erofs_collector *clt,
267260
/* I/O is needed, no possible to decompress directly */
268261
standalone = false;
269262
switch (type) {
270-
case DELAYEDALLOC:
271-
t = tagptr_init(compressed_page_t,
272-
PAGE_UNALLOCATED);
273-
break;
274263
case TRYALLOC:
275264
newpage = erofs_allocpage(pagepool, gfp);
276265
if (!newpage)
@@ -1092,15 +1081,6 @@ static struct page *pickup_page_for_submission(struct z_erofs_pcluster *pcl,
10921081
if (!page)
10931082
goto out_allocpage;
10941083

1095-
/*
1096-
* the cached page has not been allocated and
1097-
* an placeholder is out there, prepare it now.
1098-
*/
1099-
if (page == PAGE_UNALLOCATED) {
1100-
tocache = true;
1101-
goto out_allocpage;
1102-
}
1103-
11041084
/* process the target tagged pointer */
11051085
t = tagptr_init(compressed_page_t, page);
11061086
justfound = tagptr_unfold_tags(t);

fs/erofs/zdata.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,4 +186,3 @@ static inline void z_erofs_onlinepage_endio(struct page *page)
186186
#define Z_EROFS_VMAP_GLOBAL_PAGES 2048
187187

188188
#endif
189-

0 commit comments

Comments
 (0)