diff options
Diffstat (limited to 'drivers/staging/erofs/unzip_vle.h')
-rw-r--r-- | drivers/staging/erofs/unzip_vle.h | 44 |
1 files changed, 6 insertions, 38 deletions
diff --git a/drivers/staging/erofs/unzip_vle.h b/drivers/staging/erofs/unzip_vle.h index 517e5ce8c5e9..ab509d75aefd 100644 --- a/drivers/staging/erofs/unzip_vle.h +++ b/drivers/staging/erofs/unzip_vle.h @@ -16,25 +16,7 @@ #include "internal.h" #include "unzip_pagevec.h" -/* - * - 0x5A110C8D ('sallocated', Z_EROFS_MAPPING_STAGING) - - * used for temporary allocated pages (via erofs_allocpage), - * in order to seperate those from NULL mapping (eg. truncated pages) - */ -#define Z_EROFS_MAPPING_STAGING ((void *)0x5A110C8D) - -#define z_erofs_is_stagingpage(page) \ - ((page)->mapping == Z_EROFS_MAPPING_STAGING) - -static inline bool z_erofs_gather_if_stagingpage(struct list_head *page_pool, - struct page *page) -{ - if (z_erofs_is_stagingpage(page)) { - list_add(&page->lru, page_pool); - return true; - } - return false; -} +#define Z_EROFS_NR_INLINE_PAGEVECS 3 /* * Structure fields follow one of the following exclusion rules. @@ -44,8 +26,6 @@ static inline bool z_erofs_gather_if_stagingpage(struct list_head *page_pool, * */ -#define Z_EROFS_VLE_INLINE_PAGEVECS 3 - struct z_erofs_vle_work { struct mutex lock; @@ -58,7 +38,7 @@ struct z_erofs_vle_work { union { /* L: pagevec */ - erofs_vtptr_t pagevec[Z_EROFS_VLE_INLINE_PAGEVECS]; + erofs_vtptr_t pagevec[Z_EROFS_NR_INLINE_PAGEVECS]; struct rcu_head rcu; }; }; @@ -66,6 +46,7 @@ struct z_erofs_vle_work { #define Z_EROFS_VLE_WORKGRP_FMT_PLAIN 0 #define Z_EROFS_VLE_WORKGRP_FMT_LZ4 1 #define Z_EROFS_VLE_WORKGRP_FMT_MASK 1 +#define Z_EROFS_VLE_WORKGRP_FULL_LENGTH 2 typedef void *z_erofs_vle_owned_workgrp_t; @@ -147,7 +128,7 @@ static inline unsigned z_erofs_onlinepage_index(struct page *page) { union z_erofs_onlinepage_converter u; - BUG_ON(!PagePrivate(page)); + DBG_BUGON(!PagePrivate(page)); u.v = &page_private(page); return atomic_read(u.o) >> Z_EROFS_ONLINEPAGE_INDEX_SHIFT; @@ -179,7 +160,7 @@ repeat: if (!index) return; - BUG_ON(id != index); + DBG_BUGON(id != index); } v = (index << Z_EROFS_ONLINEPAGE_INDEX_SHIFT) | @@ -193,7 +174,7 @@ static inline void z_erofs_onlinepage_endio(struct page *page) union z_erofs_onlinepage_converter u; unsigned v; - BUG_ON(!PagePrivate(page)); + DBG_BUGON(!PagePrivate(page)); u.v = &page_private(page); v = atomic_dec_return(u.o); @@ -211,18 +192,5 @@ static inline void z_erofs_onlinepage_endio(struct page *page) min_t(unsigned int, THREAD_SIZE / 8 / sizeof(struct page *), 96U) #define Z_EROFS_VLE_VMAP_GLOBAL_PAGES 2048 -/* unzip_vle_lz4.c */ -int z_erofs_vle_plain_copy(struct page **compressed_pages, - unsigned int clusterpages, struct page **pages, - unsigned int nr_pages, unsigned short pageofs); -int z_erofs_vle_unzip_fast_percpu(struct page **compressed_pages, - unsigned int clusterpages, - struct page **pages, unsigned int outlen, - unsigned short pageofs); -int z_erofs_vle_unzip_vmap(struct page **compressed_pages, - unsigned int clusterpages, - void *vaddr, unsigned int llen, - unsigned short pageofs, bool overlapped); - #endif |