1 /* SPDX-License-Identifier: GPL-2.0 */
3 * linux/drivers/staging/erofs/compress.h
5 * Copyright (C) 2019 HUAWEI, Inc.
6 * http://www.huawei.com/
7 * Created by Gao Xiang <gaoxiang25@huawei.com>
9 #ifndef __EROFS_FS_COMPRESS_H
10 #define __EROFS_FS_COMPRESS_H
13 * - 0x5A110C8D ('sallocated', Z_EROFS_MAPPING_STAGING) -
14 * used to mark temporary allocated pages from other
15 * file/cached pages and NULL mapping pages.
17 #define Z_EROFS_MAPPING_STAGING ((void *)0x5A110C8D)
19 /* check if a page is marked as staging */
20 static inline bool z_erofs_page_is_staging(struct page
*page
)
22 return page
->mapping
== Z_EROFS_MAPPING_STAGING
;
25 static inline bool z_erofs_put_stagingpage(struct list_head
*pagepool
,
28 if (!z_erofs_page_is_staging(page
))
31 /* staging pages should not be used by others at the same time */
32 if (page_ref_count(page
) > 1)
35 list_add(&page
->lru
, pagepool
);