diff options
author | Gao Xiang | 2018-07-26 14:21:59 +0200 |
---|---|---|
committer | Greg Kroah-Hartman | 2018-07-27 17:24:08 +0200 |
commit | b29e64d8798018c3e82a426ec34b39b825ac68dc (patch) | |
tree | 3dfecc4d2b2bb5a72bbe31659b4ea65f2385ddab /drivers/staging/erofs/internal.h | |
parent | staging: erofs: add erofs_map_blocks_iter (diff) | |
download | kernel-qcow2-linux-b29e64d8798018c3e82a426ec34b39b825ac68dc.tar.gz kernel-qcow2-linux-b29e64d8798018c3e82a426ec34b39b825ac68dc.tar.xz kernel-qcow2-linux-b29e64d8798018c3e82a426ec34b39b825ac68dc.zip |
staging: erofs: add erofs_allocpage
This patch introduces an temporary _on-stack_ page
pool to reuse the freed page directly as much as
it can for better performance and release all pages
at a time, it also slightly reduces the possibility of
the potential memory allocation failure.
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/erofs/internal.h')
-rw-r--r-- | drivers/staging/erofs/internal.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/staging/erofs/internal.h b/drivers/staging/erofs/internal.h index bea5ec458707..210ab6c64df8 100644 --- a/drivers/staging/erofs/internal.h +++ b/drivers/staging/erofs/internal.h @@ -369,5 +369,12 @@ static inline void erofs_vunmap(const void *mem, unsigned int count) #endif } +/* utils.c */ +extern struct page *erofs_allocpage(struct list_head *pool, gfp_t gfp); + +#ifndef lru_to_page +#define lru_to_page(head) (list_entry((head)->prev, struct page, lru)) +#endif + #endif |