VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   32 Branches   54 Tags
29b24f6ca112d drivers/staging/erofs/internal.h (Gao Xiang           2019-07-31 23:57:31 +0800   1) /* SPDX-License-Identifier: GPL-2.0-only */
29b24f6ca112d drivers/staging/erofs/internal.h (Gao Xiang           2019-07-31 23:57:31 +0800   2) /*
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800   3)  * Copyright (C) 2017-2018 HUAWEI, Inc.
592e7cd00bb9d fs/erofs/internal.h              (Alexander A. Klimov 2020-07-13 15:09:44 +0200   4)  *             https://www.huawei.com/
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800   5)  * Created by Gao Xiang <gaoxiang25@huawei.com>
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800   6)  */
14f362b4f4058 drivers/staging/erofs/internal.h (Gao Xiang           2019-07-31 23:57:36 +0800   7) #ifndef __EROFS_INTERNAL_H
14f362b4f4058 drivers/staging/erofs/internal.h (Gao Xiang           2019-07-31 23:57:36 +0800   8) #define __EROFS_INTERNAL_H
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800   9) 
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800  10) #include <linux/fs.h>
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800  11) #include <linux/dcache.h>
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800  12) #include <linux/mm.h>
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800  13) #include <linux/pagemap.h>
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800  14) #include <linux/bio.h>
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800  15) #include <linux/buffer_head.h>
47e4937a4a7ca fs/erofs/internal.h              (Gao Xiang           2019-08-23 05:36:59 +0800  16) #include <linux/magic.h>
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800  17) #include <linux/slab.h>
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800  18) #include <linux/vmalloc.h>
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800  19) #include "erofs_fs.h"
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800  20) 
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800  21) /* redefine pr_fmt "erofs: " */
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800  22) #undef pr_fmt
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800  23) #define pr_fmt(fmt) "erofs: " fmt
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800  24) 
4f761fa253b49 fs/erofs/internal.h              (Gao Xiang           2019-09-04 10:09:09 +0800  25) __printf(3, 4) void _erofs_err(struct super_block *sb,
4f761fa253b49 fs/erofs/internal.h              (Gao Xiang           2019-09-04 10:09:09 +0800  26) 			       const char *function, const char *fmt, ...);
4f761fa253b49 fs/erofs/internal.h              (Gao Xiang           2019-09-04 10:09:09 +0800  27) #define erofs_err(sb, fmt, ...)	\
4f761fa253b49 fs/erofs/internal.h              (Gao Xiang           2019-09-04 10:09:09 +0800  28) 	_erofs_err(sb, __func__, fmt "\n", ##__VA_ARGS__)
4f761fa253b49 fs/erofs/internal.h              (Gao Xiang           2019-09-04 10:09:09 +0800  29) __printf(3, 4) void _erofs_info(struct super_block *sb,
4f761fa253b49 fs/erofs/internal.h              (Gao Xiang           2019-09-04 10:09:09 +0800  30) 			       const char *function, const char *fmt, ...);
4f761fa253b49 fs/erofs/internal.h              (Gao Xiang           2019-09-04 10:09:09 +0800  31) #define erofs_info(sb, fmt, ...) \
4f761fa253b49 fs/erofs/internal.h              (Gao Xiang           2019-09-04 10:09:09 +0800  32) 	_erofs_info(sb, __func__, fmt "\n", ##__VA_ARGS__)
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800  33) #ifdef CONFIG_EROFS_FS_DEBUG
4f761fa253b49 fs/erofs/internal.h              (Gao Xiang           2019-09-04 10:09:09 +0800  34) #define erofs_dbg(x, ...)       pr_debug(x "\n", ##__VA_ARGS__)
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800  35) #define DBG_BUGON               BUG_ON
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800  36) #else
4f761fa253b49 fs/erofs/internal.h              (Gao Xiang           2019-09-04 10:09:09 +0800  37) #define erofs_dbg(x, ...)       ((void)0)
eef1687898665 drivers/staging/erofs/internal.h (Gao Xiang           2018-11-23 01:15:59 +0800  38) #define DBG_BUGON(x)            ((void)(x))
14f362b4f4058 drivers/staging/erofs/internal.h (Gao Xiang           2019-07-31 23:57:36 +0800  39) #endif	/* !CONFIG_EROFS_FS_DEBUG */
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800  40) 
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800  41) /* EROFS_SUPER_MAGIC_V1 to represent the whole file system */
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800  42) #define EROFS_SUPER_MAGIC   EROFS_SUPER_MAGIC_V1
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800  43) 
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800  44) typedef u64 erofs_nid_t;
14f362b4f4058 drivers/staging/erofs/internal.h (Gao Xiang           2019-07-31 23:57:36 +0800  45) typedef u64 erofs_off_t;
14f362b4f4058 drivers/staging/erofs/internal.h (Gao Xiang           2019-07-31 23:57:36 +0800  46) /* data type for filesystem-wide blocks number */
14f362b4f4058 drivers/staging/erofs/internal.h (Gao Xiang           2019-07-31 23:57:36 +0800  47) typedef u32 erofs_blk_t;
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800  48) 
f57a3fe44995a fs/erofs/internal.h              (Chao Yu             2020-05-29 18:48:36 +0800  49) struct erofs_fs_context {
f57a3fe44995a fs/erofs/internal.h              (Chao Yu             2020-05-29 18:48:36 +0800  50) #ifdef CONFIG_EROFS_FS_ZIP
f57a3fe44995a fs/erofs/internal.h              (Chao Yu             2020-05-29 18:48:36 +0800  51) 	/* current strategy of how to use managed cache */
f57a3fe44995a fs/erofs/internal.h              (Chao Yu             2020-05-29 18:48:36 +0800  52) 	unsigned char cache_strategy;
30048cdac4b92 fs/erofs/internal.h              (Huang Jianan        2021-03-17 11:54:48 +0800  53) 	/* strategy of sync decompression (false - auto, true - force on) */
30048cdac4b92 fs/erofs/internal.h              (Huang Jianan        2021-03-17 11:54:48 +0800  54) 	bool readahead_sync_decompress;
f57a3fe44995a fs/erofs/internal.h              (Chao Yu             2020-05-29 18:48:36 +0800  55) 
f57a3fe44995a fs/erofs/internal.h              (Chao Yu             2020-05-29 18:48:36 +0800  56) 	/* threshold for decompression synchronously */
f57a3fe44995a fs/erofs/internal.h              (Chao Yu             2020-05-29 18:48:36 +0800  57) 	unsigned int max_sync_decompress_pages;
f57a3fe44995a fs/erofs/internal.h              (Chao Yu             2020-05-29 18:48:36 +0800  58) #endif
f57a3fe44995a fs/erofs/internal.h              (Chao Yu             2020-05-29 18:48:36 +0800  59) 	unsigned int mount_opt;
f57a3fe44995a fs/erofs/internal.h              (Chao Yu             2020-05-29 18:48:36 +0800  60) };
f57a3fe44995a fs/erofs/internal.h              (Chao Yu             2020-05-29 18:48:36 +0800  61) 
5d50538fc567c fs/erofs/internal.h              (Huang Jianan        2021-03-29 09:23:06 +0800  62) /* all filesystem-wide lz4 configurations */
5d50538fc567c fs/erofs/internal.h              (Huang Jianan        2021-03-29 09:23:06 +0800  63) struct erofs_sb_lz4_info {
5d50538fc567c fs/erofs/internal.h              (Huang Jianan        2021-03-29 09:23:06 +0800  64) 	/* # of pages needed for EROFS lz4 rolling decompression */
5d50538fc567c fs/erofs/internal.h              (Huang Jianan        2021-03-29 09:23:06 +0800  65) 	u16 max_distance_pages;
4fea63f7d76e4 fs/erofs/internal.h              (Gao Xiang           2021-04-07 12:39:23 +0800  66) 	/* maximum possible blocks for pclusters in the filesystem */
4fea63f7d76e4 fs/erofs/internal.h              (Gao Xiang           2021-04-07 12:39:23 +0800  67) 	u16 max_pclusterblks;
5d50538fc567c fs/erofs/internal.h              (Huang Jianan        2021-03-29 09:23:06 +0800  68) };
5d50538fc567c fs/erofs/internal.h              (Huang Jianan        2021-03-29 09:23:06 +0800  69) 
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800  70) struct erofs_sb_info {
22fe04a77d104 drivers/staging/erofs/internal.h (Gao Xiang           2019-07-31 23:57:39 +0800  71) #ifdef CONFIG_EROFS_FS_ZIP
2497ee41295c7 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:22:03 +0800  72) 	/* list for all registered superblocks, mainly for shrinker */
2497ee41295c7 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:22:03 +0800  73) 	struct list_head list;
a15813126272e drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:22:04 +0800  74) 	struct mutex umount_mutex;
2497ee41295c7 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:22:03 +0800  75) 
64094a04414f0 fs/erofs/internal.h              (Gao Xiang           2020-02-20 10:46:42 +0800  76) 	/* managed XArray arranged in physical block number */
64094a04414f0 fs/erofs/internal.h              (Gao Xiang           2020-02-20 10:46:42 +0800  77) 	struct xarray managed_pslots;
105d4ad857dcb drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:22:07 +0800  78) 
22fe04a77d104 drivers/staging/erofs/internal.h (Gao Xiang           2019-07-31 23:57:39 +0800  79) 	unsigned int shrinker_run_no;
14373711dd54b fs/erofs/internal.h              (Gao Xiang           2021-03-29 18:00:12 +0800  80) 	u16 available_compr_algs;
22fe04a77d104 drivers/staging/erofs/internal.h (Gao Xiang           2019-07-31 23:57:39 +0800  81) 
4279f3f9889f2 drivers/staging/erofs/internal.h (Gao Xiang           2019-07-31 23:57:49 +0800  82) 	/* pseudo inode to manage cached pages */
4279f3f9889f2 drivers/staging/erofs/internal.h (Gao Xiang           2019-07-31 23:57:49 +0800  83) 	struct inode *managed_cache;
5d50538fc567c fs/erofs/internal.h              (Huang Jianan        2021-03-29 09:23:06 +0800  84) 
5d50538fc567c fs/erofs/internal.h              (Huang Jianan        2021-03-29 09:23:06 +0800  85) 	struct erofs_sb_lz4_info lz4;
22fe04a77d104 drivers/staging/erofs/internal.h (Gao Xiang           2019-07-31 23:57:39 +0800  86) #endif	/* CONFIG_EROFS_FS_ZIP */
22fe04a77d104 drivers/staging/erofs/internal.h (Gao Xiang           2019-07-31 23:57:39 +0800  87) 	u32 blocks;
22fe04a77d104 drivers/staging/erofs/internal.h (Gao Xiang           2019-07-31 23:57:39 +0800  88) 	u32 meta_blkaddr;
22fe04a77d104 drivers/staging/erofs/internal.h (Gao Xiang           2019-07-31 23:57:39 +0800  89) #ifdef CONFIG_EROFS_FS_XATTR
22fe04a77d104 drivers/staging/erofs/internal.h (Gao Xiang           2019-07-31 23:57:39 +0800  90) 	u32 xattr_blkaddr;
02827e1796b33 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:58 +0800  91) #endif
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800  92) 
22fe04a77d104 drivers/staging/erofs/internal.h (Gao Xiang           2019-07-31 23:57:39 +0800  93) 	/* inode slot unit size in bit shift */
22fe04a77d104 drivers/staging/erofs/internal.h (Gao Xiang           2019-07-31 23:57:39 +0800  94) 	unsigned char islotbits;
22fe04a77d104 drivers/staging/erofs/internal.h (Gao Xiang           2019-07-31 23:57:39 +0800  95) 
14373711dd54b fs/erofs/internal.h              (Gao Xiang           2021-03-29 18:00:12 +0800  96) 	u32 sb_size;			/* total superblock size */
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800  97) 	u32 build_time_nsec;
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800  98) 	u64 build_time;
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800  99) 
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 100) 	/* what we really care is nid, rather than ino.. */
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 101) 	erofs_nid_t root_nid;
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 102) 	/* used for statfs, f_files - f_favail */
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 103) 	u64 inos;
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 104) 
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 105) 	u8 uuid[16];                    /* 128-bit uuid for volume */
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 106) 	u8 volume_name[16];             /* volume name */
b858a4844cfba fs/erofs/internal.h              (Pratik Shinde       2019-11-04 10:49:37 +0800 107) 	u32 feature_compat;
426a930891cf1 fs/erofs/internal.h              (Gao Xiang           2019-09-04 10:08:53 +0800 108) 	u32 feature_incompat;
5efe5137f05bb drivers/staging/erofs/internal.h (Gao Xiang           2019-06-13 16:35:41 +0800 109) 
f57a3fe44995a fs/erofs/internal.h              (Chao Yu             2020-05-29 18:48:36 +0800 110) 	struct erofs_fs_context ctx;	/* options */
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 111) };
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 112) 
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 113) #define EROFS_SB(sb) ((struct erofs_sb_info *)(sb)->s_fs_info)
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 114) #define EROFS_I_SB(inode) ((struct erofs_sb_info *)(inode)->i_sb->s_fs_info)
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 115) 
b17500a0fdbae drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:52 +0800 116) /* Mount flags set via mount options or defaults */
b17500a0fdbae drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:52 +0800 117) #define EROFS_MOUNT_XATTR_USER		0x00000010
b17500a0fdbae drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:52 +0800 118) #define EROFS_MOUNT_POSIX_ACL		0x00000020
b17500a0fdbae drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:52 +0800 119) 
f57a3fe44995a fs/erofs/internal.h              (Chao Yu             2020-05-29 18:48:36 +0800 120) #define clear_opt(ctx, option)	((ctx)->mount_opt &= ~EROFS_MOUNT_##option)
f57a3fe44995a fs/erofs/internal.h              (Chao Yu             2020-05-29 18:48:36 +0800 121) #define set_opt(ctx, option)	((ctx)->mount_opt |= EROFS_MOUNT_##option)
f57a3fe44995a fs/erofs/internal.h              (Chao Yu             2020-05-29 18:48:36 +0800 122) #define test_opt(ctx, option)	((ctx)->mount_opt & EROFS_MOUNT_##option)
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 123) 
4279f3f9889f2 drivers/staging/erofs/internal.h (Gao Xiang           2019-07-31 23:57:49 +0800 124) enum {
4279f3f9889f2 drivers/staging/erofs/internal.h (Gao Xiang           2019-07-31 23:57:49 +0800 125) 	EROFS_ZIP_CACHE_DISABLED,
4279f3f9889f2 drivers/staging/erofs/internal.h (Gao Xiang           2019-07-31 23:57:49 +0800 126) 	EROFS_ZIP_CACHE_READAHEAD,
4279f3f9889f2 drivers/staging/erofs/internal.h (Gao Xiang           2019-07-31 23:57:49 +0800 127) 	EROFS_ZIP_CACHE_READAROUND
4279f3f9889f2 drivers/staging/erofs/internal.h (Gao Xiang           2019-07-31 23:57:49 +0800 128) };
4279f3f9889f2 drivers/staging/erofs/internal.h (Gao Xiang           2019-07-31 23:57:49 +0800 129) 
f57a3fe44995a fs/erofs/internal.h              (Chao Yu             2020-05-29 18:48:36 +0800 130) #ifdef CONFIG_EROFS_FS_ZIP
14f362b4f4058 drivers/staging/erofs/internal.h (Gao Xiang           2019-07-31 23:57:36 +0800 131) #define EROFS_LOCKED_MAGIC     (INT_MIN | 0xE0F510CCL)
14f362b4f4058 drivers/staging/erofs/internal.h (Gao Xiang           2019-07-31 23:57:36 +0800 132) 
e7e9a307be9d7 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:22:05 +0800 133) /* basic unit of the workstation of a super_block */
e7e9a307be9d7 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:22:05 +0800 134) struct erofs_workgroup {
e7e9a307be9d7 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:22:05 +0800 135) 	/* the workgroup index in the workstation */
e7e9a307be9d7 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:22:05 +0800 136) 	pgoff_t index;
e7e9a307be9d7 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:22:05 +0800 137) 
e7e9a307be9d7 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:22:05 +0800 138) 	/* overall workgroup reference count */
e7e9a307be9d7 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:22:05 +0800 139) 	atomic_t refcount;
e7e9a307be9d7 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:22:05 +0800 140) };
e7e9a307be9d7 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:22:05 +0800 141) 
73f5c66df3e26 drivers/staging/erofs/internal.h (Gao Xiang           2018-11-23 01:16:02 +0800 142) #if defined(CONFIG_SMP)
73f5c66df3e26 drivers/staging/erofs/internal.h (Gao Xiang           2018-11-23 01:16:02 +0800 143) static inline bool erofs_workgroup_try_to_freeze(struct erofs_workgroup *grp,
73f5c66df3e26 drivers/staging/erofs/internal.h (Gao Xiang           2018-11-23 01:16:02 +0800 144) 						 int val)
e7e9a307be9d7 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:22:05 +0800 145) {
e7e9a307be9d7 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:22:05 +0800 146) 	preempt_disable();
73f5c66df3e26 drivers/staging/erofs/internal.h (Gao Xiang           2018-11-23 01:16:02 +0800 147) 	if (val != atomic_cmpxchg(&grp->refcount, val, EROFS_LOCKED_MAGIC)) {
e7e9a307be9d7 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:22:05 +0800 148) 		preempt_enable();
e7e9a307be9d7 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:22:05 +0800 149) 		return false;
e7e9a307be9d7 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:22:05 +0800 150) 	}
e7e9a307be9d7 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:22:05 +0800 151) 	return true;
e7e9a307be9d7 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:22:05 +0800 152) }
e7e9a307be9d7 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:22:05 +0800 153) 
73f5c66df3e26 drivers/staging/erofs/internal.h (Gao Xiang           2018-11-23 01:16:02 +0800 154) static inline void erofs_workgroup_unfreeze(struct erofs_workgroup *grp,
73f5c66df3e26 drivers/staging/erofs/internal.h (Gao Xiang           2018-11-23 01:16:02 +0800 155) 					    int orig_val)
e7e9a307be9d7 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:22:05 +0800 156) {
948bbdb1818b7 drivers/staging/erofs/internal.h (Gao Xiang           2018-11-23 01:16:03 +0800 157) 	/*
948bbdb1818b7 drivers/staging/erofs/internal.h (Gao Xiang           2018-11-23 01:16:03 +0800 158) 	 * other observers should notice all modifications
948bbdb1818b7 drivers/staging/erofs/internal.h (Gao Xiang           2018-11-23 01:16:03 +0800 159) 	 * in the freezing period.
948bbdb1818b7 drivers/staging/erofs/internal.h (Gao Xiang           2018-11-23 01:16:03 +0800 160) 	 */
948bbdb1818b7 drivers/staging/erofs/internal.h (Gao Xiang           2018-11-23 01:16:03 +0800 161) 	smp_mb();
73f5c66df3e26 drivers/staging/erofs/internal.h (Gao Xiang           2018-11-23 01:16:02 +0800 162) 	atomic_set(&grp->refcount, orig_val);
e7e9a307be9d7 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:22:05 +0800 163) 	preempt_enable();
e7e9a307be9d7 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:22:05 +0800 164) }
e7e9a307be9d7 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:22:05 +0800 165) 
df134b8d17b90 drivers/staging/erofs/internal.h (Gao Xiang           2018-11-23 01:16:01 +0800 166) static inline int erofs_wait_on_workgroup_freezed(struct erofs_workgroup *grp)
df134b8d17b90 drivers/staging/erofs/internal.h (Gao Xiang           2018-11-23 01:16:01 +0800 167) {
df134b8d17b90 drivers/staging/erofs/internal.h (Gao Xiang           2018-11-23 01:16:01 +0800 168) 	return atomic_cond_read_relaxed(&grp->refcount,
df134b8d17b90 drivers/staging/erofs/internal.h (Gao Xiang           2018-11-23 01:16:01 +0800 169) 					VAL != EROFS_LOCKED_MAGIC);
df134b8d17b90 drivers/staging/erofs/internal.h (Gao Xiang           2018-11-23 01:16:01 +0800 170) }
df134b8d17b90 drivers/staging/erofs/internal.h (Gao Xiang           2018-11-23 01:16:01 +0800 171) #else
73f5c66df3e26 drivers/staging/erofs/internal.h (Gao Xiang           2018-11-23 01:16:02 +0800 172) static inline bool erofs_workgroup_try_to_freeze(struct erofs_workgroup *grp,
73f5c66df3e26 drivers/staging/erofs/internal.h (Gao Xiang           2018-11-23 01:16:02 +0800 173) 						 int val)
73f5c66df3e26 drivers/staging/erofs/internal.h (Gao Xiang           2018-11-23 01:16:02 +0800 174) {
73f5c66df3e26 drivers/staging/erofs/internal.h (Gao Xiang           2018-11-23 01:16:02 +0800 175) 	preempt_disable();
73f5c66df3e26 drivers/staging/erofs/internal.h (Gao Xiang           2018-11-23 01:16:02 +0800 176) 	/* no need to spin on UP platforms, let's just disable preemption. */
73f5c66df3e26 drivers/staging/erofs/internal.h (Gao Xiang           2018-11-23 01:16:02 +0800 177) 	if (val != atomic_read(&grp->refcount)) {
73f5c66df3e26 drivers/staging/erofs/internal.h (Gao Xiang           2018-11-23 01:16:02 +0800 178) 		preempt_enable();
73f5c66df3e26 drivers/staging/erofs/internal.h (Gao Xiang           2018-11-23 01:16:02 +0800 179) 		return false;
73f5c66df3e26 drivers/staging/erofs/internal.h (Gao Xiang           2018-11-23 01:16:02 +0800 180) 	}
73f5c66df3e26 drivers/staging/erofs/internal.h (Gao Xiang           2018-11-23 01:16:02 +0800 181) 	return true;
73f5c66df3e26 drivers/staging/erofs/internal.h (Gao Xiang           2018-11-23 01:16:02 +0800 182) }
73f5c66df3e26 drivers/staging/erofs/internal.h (Gao Xiang           2018-11-23 01:16:02 +0800 183) 
73f5c66df3e26 drivers/staging/erofs/internal.h (Gao Xiang           2018-11-23 01:16:02 +0800 184) static inline void erofs_workgroup_unfreeze(struct erofs_workgroup *grp,
73f5c66df3e26 drivers/staging/erofs/internal.h (Gao Xiang           2018-11-23 01:16:02 +0800 185) 					    int orig_val)
73f5c66df3e26 drivers/staging/erofs/internal.h (Gao Xiang           2018-11-23 01:16:02 +0800 186) {
73f5c66df3e26 drivers/staging/erofs/internal.h (Gao Xiang           2018-11-23 01:16:02 +0800 187) 	preempt_enable();
73f5c66df3e26 drivers/staging/erofs/internal.h (Gao Xiang           2018-11-23 01:16:02 +0800 188) }
73f5c66df3e26 drivers/staging/erofs/internal.h (Gao Xiang           2018-11-23 01:16:02 +0800 189) 
df134b8d17b90 drivers/staging/erofs/internal.h (Gao Xiang           2018-11-23 01:16:01 +0800 190) static inline int erofs_wait_on_workgroup_freezed(struct erofs_workgroup *grp)
df134b8d17b90 drivers/staging/erofs/internal.h (Gao Xiang           2018-11-23 01:16:01 +0800 191) {
df134b8d17b90 drivers/staging/erofs/internal.h (Gao Xiang           2018-11-23 01:16:01 +0800 192) 	int v = atomic_read(&grp->refcount);
df134b8d17b90 drivers/staging/erofs/internal.h (Gao Xiang           2018-11-23 01:16:01 +0800 193) 
df134b8d17b90 drivers/staging/erofs/internal.h (Gao Xiang           2018-11-23 01:16:01 +0800 194) 	/* workgroup is never freezed on uniprocessor systems */
df134b8d17b90 drivers/staging/erofs/internal.h (Gao Xiang           2018-11-23 01:16:01 +0800 195) 	DBG_BUGON(v == EROFS_LOCKED_MAGIC);
df134b8d17b90 drivers/staging/erofs/internal.h (Gao Xiang           2018-11-23 01:16:01 +0800 196) 	return v;
df134b8d17b90 drivers/staging/erofs/internal.h (Gao Xiang           2018-11-23 01:16:01 +0800 197) }
14f362b4f4058 drivers/staging/erofs/internal.h (Gao Xiang           2019-07-31 23:57:36 +0800 198) #endif	/* !CONFIG_SMP */
14f362b4f4058 drivers/staging/erofs/internal.h (Gao Xiang           2019-07-31 23:57:36 +0800 199) #endif	/* !CONFIG_EROFS_FS_ZIP */
e7e9a307be9d7 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:22:05 +0800 200) 
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 201) /* we strictly follow PAGE_SIZE and no buffer head yet */
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 202) #define LOG_BLOCK_SIZE		PAGE_SHIFT
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 203) 
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 204) #undef LOG_SECTORS_PER_BLOCK
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 205) #define LOG_SECTORS_PER_BLOCK	(PAGE_SHIFT - 9)
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 206) 
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 207) #undef SECTORS_PER_BLOCK
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 208) #define SECTORS_PER_BLOCK	(1 << SECTORS_PER_BLOCK)
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 209) 
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 210) #define EROFS_BLKSIZ		(1 << LOG_BLOCK_SIZE)
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 211) 
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 212) #if (EROFS_BLKSIZ % 4096 || !EROFS_BLKSIZ)
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 213) #error erofs cannot be used in this platform
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 214) #endif
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 215) 
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 216) #define ROOT_NID(sb)		((sb)->root_nid)
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 217) 
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 218) #define erofs_blknr(addr)       ((addr) / EROFS_BLKSIZ)
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 219) #define erofs_blkoff(addr)      ((addr) % EROFS_BLKSIZ)
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 220) #define blknr_to_addr(nr)       ((erofs_off_t)(nr) * EROFS_BLKSIZ)
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 221) 
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 222) static inline erofs_off_t iloc(struct erofs_sb_info *sbi, erofs_nid_t nid)
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 223) {
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 224) 	return blknr_to_addr(sbi->meta_blkaddr) + (nid << sbi->islotbits);
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 225) }
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 226) 
de06a6a375414 fs/erofs/internal.h              (Gao Xiang           2021-03-29 09:23:05 +0800 227) #define EROFS_FEATURE_FUNCS(name, compat, feature) \
de06a6a375414 fs/erofs/internal.h              (Gao Xiang           2021-03-29 09:23:05 +0800 228) static inline bool erofs_sb_has_##name(struct erofs_sb_info *sbi) \
de06a6a375414 fs/erofs/internal.h              (Gao Xiang           2021-03-29 09:23:05 +0800 229) { \
de06a6a375414 fs/erofs/internal.h              (Gao Xiang           2021-03-29 09:23:05 +0800 230) 	return sbi->feature_##compat & EROFS_FEATURE_##feature; \
de06a6a375414 fs/erofs/internal.h              (Gao Xiang           2021-03-29 09:23:05 +0800 231) }
de06a6a375414 fs/erofs/internal.h              (Gao Xiang           2021-03-29 09:23:05 +0800 232) 
de06a6a375414 fs/erofs/internal.h              (Gao Xiang           2021-03-29 09:23:05 +0800 233) EROFS_FEATURE_FUNCS(lz4_0padding, incompat, INCOMPAT_LZ4_0PADDING)
14373711dd54b fs/erofs/internal.h              (Gao Xiang           2021-03-29 18:00:12 +0800 234) EROFS_FEATURE_FUNCS(compr_cfgs, incompat, INCOMPAT_COMPR_CFGS)
5404c33010cb8 fs/erofs/internal.h              (Gao Xiang           2021-04-07 12:39:22 +0800 235) EROFS_FEATURE_FUNCS(big_pcluster, incompat, INCOMPAT_BIG_PCLUSTER)
de06a6a375414 fs/erofs/internal.h              (Gao Xiang           2021-03-29 09:23:05 +0800 236) EROFS_FEATURE_FUNCS(sb_chksum, compat, COMPAT_SB_CHKSUM)
de06a6a375414 fs/erofs/internal.h              (Gao Xiang           2021-03-29 09:23:05 +0800 237) 
62dc45979f3f8 drivers/staging/erofs/internal.h (Gao Xiang           2019-02-18 15:19:04 +0800 238) /* atomic flag definitions */
a5876e24f13f1 fs/erofs/internal.h              (Gao Xiang           2019-09-04 10:08:56 +0800 239) #define EROFS_I_EA_INITED_BIT	0
a5876e24f13f1 fs/erofs/internal.h              (Gao Xiang           2019-09-04 10:08:56 +0800 240) #define EROFS_I_Z_INITED_BIT	1
62dc45979f3f8 drivers/staging/erofs/internal.h (Gao Xiang           2019-02-18 15:19:04 +0800 241) 
62dc45979f3f8 drivers/staging/erofs/internal.h (Gao Xiang           2019-02-18 15:19:04 +0800 242) /* bitlock definitions (arranged in reverse order) */
a5876e24f13f1 fs/erofs/internal.h              (Gao Xiang           2019-09-04 10:08:56 +0800 243) #define EROFS_I_BL_XATTR_BIT	(BITS_PER_LONG - 1)
a5876e24f13f1 fs/erofs/internal.h              (Gao Xiang           2019-09-04 10:08:56 +0800 244) #define EROFS_I_BL_Z_BIT	(BITS_PER_LONG - 2)
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 245) 
a5876e24f13f1 fs/erofs/internal.h              (Gao Xiang           2019-09-04 10:08:56 +0800 246) struct erofs_inode {
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 247) 	erofs_nid_t nid;
62dc45979f3f8 drivers/staging/erofs/internal.h (Gao Xiang           2019-02-18 15:19:04 +0800 248) 
62dc45979f3f8 drivers/staging/erofs/internal.h (Gao Xiang           2019-02-18 15:19:04 +0800 249) 	/* atomic flags (including bitlocks) */
62dc45979f3f8 drivers/staging/erofs/internal.h (Gao Xiang           2019-02-18 15:19:04 +0800 250) 	unsigned long flags;
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 251) 
8a76568225dea fs/erofs/internal.h              (Gao Xiang           2019-09-04 10:08:54 +0800 252) 	unsigned char datalayout;
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 253) 	unsigned char inode_isize;
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 254) 	unsigned short xattr_isize;
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 255) 
e82a9a17d49c5 drivers/staging/erofs/internal.h (Pratik Shinde       2019-07-15 17:51:27 +0530 256) 	unsigned int xattr_shared_count;
e82a9a17d49c5 drivers/staging/erofs/internal.h (Pratik Shinde       2019-07-15 17:51:27 +0530 257) 	unsigned int *xattr_shared_xattrs;
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 258) 
152a333a58956 drivers/staging/erofs/internal.h (Gao Xiang           2019-06-24 15:22:52 +0800 259) 	union {
152a333a58956 drivers/staging/erofs/internal.h (Gao Xiang           2019-06-24 15:22:52 +0800 260) 		erofs_blk_t raw_blkaddr;
152a333a58956 drivers/staging/erofs/internal.h (Gao Xiang           2019-06-24 15:22:52 +0800 261) #ifdef CONFIG_EROFS_FS_ZIP
152a333a58956 drivers/staging/erofs/internal.h (Gao Xiang           2019-06-24 15:22:52 +0800 262) 		struct {
152a333a58956 drivers/staging/erofs/internal.h (Gao Xiang           2019-06-24 15:22:52 +0800 263) 			unsigned short z_advise;
152a333a58956 drivers/staging/erofs/internal.h (Gao Xiang           2019-06-24 15:22:52 +0800 264) 			unsigned char  z_algorithmtype[2];
152a333a58956 drivers/staging/erofs/internal.h (Gao Xiang           2019-06-24 15:22:52 +0800 265) 			unsigned char  z_logical_clusterbits;
152a333a58956 drivers/staging/erofs/internal.h (Gao Xiang           2019-06-24 15:22:52 +0800 266) 		};
14f362b4f4058 drivers/staging/erofs/internal.h (Gao Xiang           2019-07-31 23:57:36 +0800 267) #endif	/* CONFIG_EROFS_FS_ZIP */
152a333a58956 drivers/staging/erofs/internal.h (Gao Xiang           2019-06-24 15:22:52 +0800 268) 	};
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 269) 	/* the corresponding vfs inode */
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 270) 	struct inode vfs_inode;
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 271) };
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 272) 
a5876e24f13f1 fs/erofs/internal.h              (Gao Xiang           2019-09-04 10:08:56 +0800 273) #define EROFS_I(ptr)	\
a5876e24f13f1 fs/erofs/internal.h              (Gao Xiang           2019-09-04 10:08:56 +0800 274) 	container_of(ptr, struct erofs_inode, vfs_inode)
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 275) 
99634bf388db0 fs/erofs/internal.h              (Gao Xiang           2019-09-04 10:09:05 +0800 276) static inline unsigned long erofs_inode_datablocks(struct inode *inode)
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 277) {
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 278) 	/* since i_size cannot be changed */
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 279) 	return DIV_ROUND_UP(inode->i_size, EROFS_BLKSIZ);
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 280) }
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 281) 
8a76568225dea fs/erofs/internal.h              (Gao Xiang           2019-09-04 10:08:54 +0800 282) static inline unsigned int erofs_bitrange(unsigned int value, unsigned int bit,
8a76568225dea fs/erofs/internal.h              (Gao Xiang           2019-09-04 10:08:54 +0800 283) 					  unsigned int bits)
8a76568225dea fs/erofs/internal.h              (Gao Xiang           2019-09-04 10:08:54 +0800 284) {
8a76568225dea fs/erofs/internal.h              (Gao Xiang           2019-09-04 10:08:54 +0800 285) 
8a76568225dea fs/erofs/internal.h              (Gao Xiang           2019-09-04 10:08:54 +0800 286) 	return (value >> bit) & ((1 << bits) - 1);
8a76568225dea fs/erofs/internal.h              (Gao Xiang           2019-09-04 10:08:54 +0800 287) }
8a76568225dea fs/erofs/internal.h              (Gao Xiang           2019-09-04 10:08:54 +0800 288) 
8a76568225dea fs/erofs/internal.h              (Gao Xiang           2019-09-04 10:08:54 +0800 289) 
8a76568225dea fs/erofs/internal.h              (Gao Xiang           2019-09-04 10:08:54 +0800 290) static inline unsigned int erofs_inode_version(unsigned int value)
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 291) {
8a76568225dea fs/erofs/internal.h              (Gao Xiang           2019-09-04 10:08:54 +0800 292) 	return erofs_bitrange(value, EROFS_I_VERSION_BIT,
8a76568225dea fs/erofs/internal.h              (Gao Xiang           2019-09-04 10:08:54 +0800 293) 			      EROFS_I_VERSION_BITS);
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 294) }
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 295) 
8a76568225dea fs/erofs/internal.h              (Gao Xiang           2019-09-04 10:08:54 +0800 296) static inline unsigned int erofs_inode_datalayout(unsigned int value)
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 297) {
8a76568225dea fs/erofs/internal.h              (Gao Xiang           2019-09-04 10:08:54 +0800 298) 	return erofs_bitrange(value, EROFS_I_DATALAYOUT_BIT,
8a76568225dea fs/erofs/internal.h              (Gao Xiang           2019-09-04 10:08:54 +0800 299) 			      EROFS_I_DATALAYOUT_BITS);
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 300) }
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 301) 
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 302) extern const struct super_operations erofs_sops;
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 303) 
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 304) extern const struct address_space_operations erofs_raw_access_aops;
0c638f70d7310 fs/erofs/internal.h              (Gao Xiang           2019-11-08 11:37:33 +0800 305) extern const struct address_space_operations z_erofs_aops;
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 306) 
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 307) /*
8137824eddd2e fs/erofs/internal.h              (Yue Hu              2021-03-25 15:10:08 +0800 308)  * Logical to physical block mapping
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 309)  *
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 310)  * Different with other file systems, it is used for 2 access modes:
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 311)  *
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 312)  * 1) RAW access mode:
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 313)  *
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 314)  * Users pass a valid (m_lblk, m_lofs -- usually 0) pair,
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 315)  * and get the valid m_pblk, m_pofs and the longest m_len(in bytes).
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 316)  *
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 317)  * Note that m_lblk in the RAW access mode refers to the number of
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 318)  * the compressed ondisk block rather than the uncompressed
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 319)  * in-memory block for the compressed file.
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 320)  *
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 321)  * m_pofs equals to m_lofs except for the inline data page.
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 322)  *
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 323)  * 2) Normal access mode:
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 324)  *
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 325)  * If the inode is not compressed, it has no difference with
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 326)  * the RAW access mode. However, if the inode is compressed,
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 327)  * users should pass a valid (m_lblk, m_lofs) pair, and get
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 328)  * the needed m_pblk, m_pofs, m_len to get the compressed data
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 329)  * and the updated m_lblk, m_lofs which indicates the start
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 330)  * of the corresponding uncompressed data in the file.
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 331)  */
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 332) enum {
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 333) 	BH_Zipped = BH_PrivateStart,
b6a76183dea8d drivers/staging/erofs/internal.h (Gao Xiang           2019-06-24 15:22:58 +0800 334) 	BH_FullMapped,
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 335) };
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 336) 
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 337) /* Has a disk mapping */
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 338) #define EROFS_MAP_MAPPED	(1 << BH_Mapped)
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 339) /* Located in metadata (could be copied from bd_inode) */
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 340) #define EROFS_MAP_META		(1 << BH_Meta)
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 341) /* The extent has been compressed */
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 342) #define EROFS_MAP_ZIPPED	(1 << BH_Zipped)
b6a76183dea8d drivers/staging/erofs/internal.h (Gao Xiang           2019-06-24 15:22:58 +0800 343) /* The length of extent is full */
b6a76183dea8d drivers/staging/erofs/internal.h (Gao Xiang           2019-06-24 15:22:58 +0800 344) #define EROFS_MAP_FULL_MAPPED	(1 << BH_FullMapped)
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 345) 
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 346) struct erofs_map_blocks {
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 347) 	erofs_off_t m_pa, m_la;
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 348) 	u64 m_plen, m_llen;
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 349) 
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 350) 	unsigned int m_flags;
3b423417d0d1d drivers/staging/erofs/internal.h (Chao Yu             2019-01-15 09:42:21 +0800 351) 
3b423417d0d1d drivers/staging/erofs/internal.h (Chao Yu             2019-01-15 09:42:21 +0800 352) 	struct page *mpage;
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 353) };
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 354) 
8137824eddd2e fs/erofs/internal.h              (Yue Hu              2021-03-25 15:10:08 +0800 355) /* Flags used by erofs_map_blocks_flatmode() */
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 356) #define EROFS_GET_BLOCKS_RAW    0x0001
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 357) 
152a333a58956 drivers/staging/erofs/internal.h (Gao Xiang           2019-06-24 15:22:52 +0800 358) /* zmap.c */
3b423417d0d1d drivers/staging/erofs/internal.h (Chao Yu             2019-01-15 09:42:21 +0800 359) #ifdef CONFIG_EROFS_FS_ZIP
152a333a58956 drivers/staging/erofs/internal.h (Gao Xiang           2019-06-24 15:22:52 +0800 360) int z_erofs_fill_inode(struct inode *inode);
3b423417d0d1d drivers/staging/erofs/internal.h (Chao Yu             2019-01-15 09:42:21 +0800 361) int z_erofs_map_blocks_iter(struct inode *inode,
3b423417d0d1d drivers/staging/erofs/internal.h (Chao Yu             2019-01-15 09:42:21 +0800 362) 			    struct erofs_map_blocks *map,
3b423417d0d1d drivers/staging/erofs/internal.h (Chao Yu             2019-01-15 09:42:21 +0800 363) 			    int flags);
3b423417d0d1d drivers/staging/erofs/internal.h (Chao Yu             2019-01-15 09:42:21 +0800 364) #else
ff784a78af117 drivers/staging/erofs/internal.h (Gao Xiang           2019-08-14 18:37:05 +0800 365) static inline int z_erofs_fill_inode(struct inode *inode) { return -EOPNOTSUPP; }
3b423417d0d1d drivers/staging/erofs/internal.h (Chao Yu             2019-01-15 09:42:21 +0800 366) static inline int z_erofs_map_blocks_iter(struct inode *inode,
3b423417d0d1d drivers/staging/erofs/internal.h (Chao Yu             2019-01-15 09:42:21 +0800 367) 					  struct erofs_map_blocks *map,
3b423417d0d1d drivers/staging/erofs/internal.h (Chao Yu             2019-01-15 09:42:21 +0800 368) 					  int flags)
3b423417d0d1d drivers/staging/erofs/internal.h (Chao Yu             2019-01-15 09:42:21 +0800 369) {
ff784a78af117 drivers/staging/erofs/internal.h (Gao Xiang           2019-08-14 18:37:05 +0800 370) 	return -EOPNOTSUPP;
3b423417d0d1d drivers/staging/erofs/internal.h (Chao Yu             2019-01-15 09:42:21 +0800 371) }
14f362b4f4058 drivers/staging/erofs/internal.h (Gao Xiang           2019-07-31 23:57:36 +0800 372) #endif	/* !CONFIG_EROFS_FS_ZIP */
3b423417d0d1d drivers/staging/erofs/internal.h (Chao Yu             2019-01-15 09:42:21 +0800 373) 
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 374) /* data.c */
e655b5b3a29c5 fs/erofs/internal.h              (Gao Xiang           2019-09-04 10:09:03 +0800 375) struct page *erofs_get_meta_page(struct super_block *sb, erofs_blk_t blkaddr);
6e78901a9f233 drivers/staging/erofs/internal.h (Gao Xiang           2018-08-21 22:49:30 +0800 376) 
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 377) /* inode.c */
2abd781413877 drivers/staging/erofs/internal.h (Gao Xiang           2018-10-09 22:07:13 +0800 378) static inline unsigned long erofs_inode_hash(erofs_nid_t nid)
2abd781413877 drivers/staging/erofs/internal.h (Gao Xiang           2018-10-09 22:07:13 +0800 379) {
2abd781413877 drivers/staging/erofs/internal.h (Gao Xiang           2018-10-09 22:07:13 +0800 380) #if BITS_PER_LONG == 32
2abd781413877 drivers/staging/erofs/internal.h (Gao Xiang           2018-10-09 22:07:13 +0800 381) 	return (nid >> 32) ^ (nid & 0xffffffff);
2abd781413877 drivers/staging/erofs/internal.h (Gao Xiang           2018-10-09 22:07:13 +0800 382) #else
2abd781413877 drivers/staging/erofs/internal.h (Gao Xiang           2018-10-09 22:07:13 +0800 383) 	return nid;
2abd781413877 drivers/staging/erofs/internal.h (Gao Xiang           2018-10-09 22:07:13 +0800 384) #endif
2abd781413877 drivers/staging/erofs/internal.h (Gao Xiang           2018-10-09 22:07:13 +0800 385) }
2abd781413877 drivers/staging/erofs/internal.h (Gao Xiang           2018-10-09 22:07:13 +0800 386) 
609398266c542 drivers/staging/erofs/internal.h (Gao Xiang           2019-01-14 19:40:24 +0800 387) extern const struct inode_operations erofs_generic_iops;
609398266c542 drivers/staging/erofs/internal.h (Gao Xiang           2019-01-14 19:40:24 +0800 388) extern const struct inode_operations erofs_symlink_iops;
609398266c542 drivers/staging/erofs/internal.h (Gao Xiang           2019-01-14 19:40:24 +0800 389) extern const struct inode_operations erofs_fast_symlink_iops;
b17500a0fdbae drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:52 +0800 390) 
2e1d66379ece5 drivers/staging/erofs/internal.h (Gao Xiang           2019-01-16 16:59:56 +0800 391) struct inode *erofs_iget(struct super_block *sb, erofs_nid_t nid, bool dir);
549c7297717c3 fs/erofs/internal.h              (Christian Brauner   2021-01-21 14:19:43 +0100 392) int erofs_getattr(struct user_namespace *mnt_userns, const struct path *path,
549c7297717c3 fs/erofs/internal.h              (Christian Brauner   2021-01-21 14:19:43 +0100 393) 		  struct kstat *stat, u32 request_mask,
549c7297717c3 fs/erofs/internal.h              (Christian Brauner   2021-01-21 14:19:43 +0100 394) 		  unsigned int query_flags);
2e1d66379ece5 drivers/staging/erofs/internal.h (Gao Xiang           2019-01-16 16:59:56 +0800 395) 
609398266c542 drivers/staging/erofs/internal.h (Gao Xiang           2019-01-14 19:40:24 +0800 396) /* namei.c */
609398266c542 drivers/staging/erofs/internal.h (Gao Xiang           2019-01-14 19:40:24 +0800 397) extern const struct inode_operations erofs_dir_iops;
609398266c542 drivers/staging/erofs/internal.h (Gao Xiang           2019-01-14 19:40:24 +0800 398) 
609398266c542 drivers/staging/erofs/internal.h (Gao Xiang           2019-01-14 19:40:24 +0800 399) int erofs_namei(struct inode *dir, struct qstr *name,
609398266c542 drivers/staging/erofs/internal.h (Gao Xiang           2019-01-14 19:40:24 +0800 400) 		erofs_nid_t *nid, unsigned int *d_type);
609398266c542 drivers/staging/erofs/internal.h (Gao Xiang           2019-01-14 19:40:24 +0800 401) 
609398266c542 drivers/staging/erofs/internal.h (Gao Xiang           2019-01-14 19:40:24 +0800 402) /* dir.c */
609398266c542 drivers/staging/erofs/internal.h (Gao Xiang           2019-01-14 19:40:24 +0800 403) extern const struct file_operations erofs_dir_fops;
609398266c542 drivers/staging/erofs/internal.h (Gao Xiang           2019-01-14 19:40:24 +0800 404) 
598162d050801 fs/erofs/internal.h              (Gao Xiang           2021-04-07 12:39:26 +0800 405) static inline void *erofs_vm_map_ram(struct page **pages, unsigned int count)
598162d050801 fs/erofs/internal.h              (Gao Xiang           2021-04-07 12:39:26 +0800 406) {
598162d050801 fs/erofs/internal.h              (Gao Xiang           2021-04-07 12:39:26 +0800 407) 	int retried = 0;
598162d050801 fs/erofs/internal.h              (Gao Xiang           2021-04-07 12:39:26 +0800 408) 
598162d050801 fs/erofs/internal.h              (Gao Xiang           2021-04-07 12:39:26 +0800 409) 	while (1) {
598162d050801 fs/erofs/internal.h              (Gao Xiang           2021-04-07 12:39:26 +0800 410) 		void *p = vm_map_ram(pages, count, -1);
598162d050801 fs/erofs/internal.h              (Gao Xiang           2021-04-07 12:39:26 +0800 411) 
598162d050801 fs/erofs/internal.h              (Gao Xiang           2021-04-07 12:39:26 +0800 412) 		/* retry two more times (totally 3 times) */
598162d050801 fs/erofs/internal.h              (Gao Xiang           2021-04-07 12:39:26 +0800 413) 		if (p || ++retried >= 3)
598162d050801 fs/erofs/internal.h              (Gao Xiang           2021-04-07 12:39:26 +0800 414) 			return p;
598162d050801 fs/erofs/internal.h              (Gao Xiang           2021-04-07 12:39:26 +0800 415) 		vm_unmap_aliases();
598162d050801 fs/erofs/internal.h              (Gao Xiang           2021-04-07 12:39:26 +0800 416) 	}
598162d050801 fs/erofs/internal.h              (Gao Xiang           2021-04-07 12:39:26 +0800 417) 	return NULL;
598162d050801 fs/erofs/internal.h              (Gao Xiang           2021-04-07 12:39:26 +0800 418) }
598162d050801 fs/erofs/internal.h              (Gao Xiang           2021-04-07 12:39:26 +0800 419) 
524887347fcb6 fs/erofs/internal.h              (Gao Xiang           2021-04-10 03:06:30 +0800 420) /* pcpubuf.c */
524887347fcb6 fs/erofs/internal.h              (Gao Xiang           2021-04-10 03:06:30 +0800 421) void *erofs_get_pcpubuf(unsigned int requiredpages);
524887347fcb6 fs/erofs/internal.h              (Gao Xiang           2021-04-10 03:06:30 +0800 422) void erofs_put_pcpubuf(void *ptr);
524887347fcb6 fs/erofs/internal.h              (Gao Xiang           2021-04-10 03:06:30 +0800 423) int erofs_pcpubuf_growsize(unsigned int nrpages);
524887347fcb6 fs/erofs/internal.h              (Gao Xiang           2021-04-10 03:06:30 +0800 424) void erofs_pcpubuf_init(void);
524887347fcb6 fs/erofs/internal.h              (Gao Xiang           2021-04-10 03:06:30 +0800 425) void erofs_pcpubuf_exit(void);
524887347fcb6 fs/erofs/internal.h              (Gao Xiang           2021-04-10 03:06:30 +0800 426) 
14f362b4f4058 drivers/staging/erofs/internal.h (Gao Xiang           2019-07-31 23:57:36 +0800 427) /* utils.c / zdata.c */
5ddcee1f3a1cc fs/erofs/internal.h              (Gao Xiang           2019-11-21 21:59:54 +0800 428) struct page *erofs_allocpage(struct list_head *pool, gfp_t gfp);
fa61a33f53760 drivers/staging/erofs/internal.h (Gao Xiang           2019-06-24 15:22:53 +0800 429) 
22fe04a77d104 drivers/staging/erofs/internal.h (Gao Xiang           2019-07-31 23:57:39 +0800 430) #ifdef CONFIG_EROFS_FS_ZIP
14f362b4f4058 drivers/staging/erofs/internal.h (Gao Xiang           2019-07-31 23:57:36 +0800 431) int erofs_workgroup_put(struct erofs_workgroup *grp);
14f362b4f4058 drivers/staging/erofs/internal.h (Gao Xiang           2019-07-31 23:57:36 +0800 432) struct erofs_workgroup *erofs_find_workgroup(struct super_block *sb,
997626d838387 fs/erofs/internal.h              (Vladimir Zapolskiy  2020-01-02 14:01:16 +0200 433) 					     pgoff_t index);
64094a04414f0 fs/erofs/internal.h              (Gao Xiang           2020-02-20 10:46:42 +0800 434) struct erofs_workgroup *erofs_insert_workgroup(struct super_block *sb,
64094a04414f0 fs/erofs/internal.h              (Gao Xiang           2020-02-20 10:46:42 +0800 435) 					       struct erofs_workgroup *grp);
14f362b4f4058 drivers/staging/erofs/internal.h (Gao Xiang           2019-07-31 23:57:36 +0800 436) void erofs_workgroup_free_rcu(struct erofs_workgroup *grp);
22fe04a77d104 drivers/staging/erofs/internal.h (Gao Xiang           2019-07-31 23:57:39 +0800 437) void erofs_shrinker_register(struct super_block *sb);
22fe04a77d104 drivers/staging/erofs/internal.h (Gao Xiang           2019-07-31 23:57:39 +0800 438) void erofs_shrinker_unregister(struct super_block *sb);
22fe04a77d104 drivers/staging/erofs/internal.h (Gao Xiang           2019-07-31 23:57:39 +0800 439) int __init erofs_init_shrinker(void);
22fe04a77d104 drivers/staging/erofs/internal.h (Gao Xiang           2019-07-31 23:57:39 +0800 440) void erofs_exit_shrinker(void);
22fe04a77d104 drivers/staging/erofs/internal.h (Gao Xiang           2019-07-31 23:57:39 +0800 441) int __init z_erofs_init_zip_subsystem(void);
22fe04a77d104 drivers/staging/erofs/internal.h (Gao Xiang           2019-07-31 23:57:39 +0800 442) void z_erofs_exit_zip_subsystem(void);
14f362b4f4058 drivers/staging/erofs/internal.h (Gao Xiang           2019-07-31 23:57:36 +0800 443) int erofs_try_to_free_all_cached_pages(struct erofs_sb_info *sbi,
14f362b4f4058 drivers/staging/erofs/internal.h (Gao Xiang           2019-07-31 23:57:36 +0800 444) 				       struct erofs_workgroup *egrp);
14f362b4f4058 drivers/staging/erofs/internal.h (Gao Xiang           2019-07-31 23:57:36 +0800 445) int erofs_try_to_free_cached_page(struct address_space *mapping,
14f362b4f4058 drivers/staging/erofs/internal.h (Gao Xiang           2019-07-31 23:57:36 +0800 446) 				  struct page *page);
5d50538fc567c fs/erofs/internal.h              (Huang Jianan        2021-03-29 09:23:06 +0800 447) int z_erofs_load_lz4_config(struct super_block *sb,
46249cded18ac fs/erofs/internal.h              (Gao Xiang           2021-03-29 09:23:07 +0800 448) 			    struct erofs_super_block *dsb,
46249cded18ac fs/erofs/internal.h              (Gao Xiang           2021-03-29 09:23:07 +0800 449) 			    struct z_erofs_lz4_cfgs *lz4, int len);
22fe04a77d104 drivers/staging/erofs/internal.h (Gao Xiang           2019-07-31 23:57:39 +0800 450) #else
22fe04a77d104 drivers/staging/erofs/internal.h (Gao Xiang           2019-07-31 23:57:39 +0800 451) static inline void erofs_shrinker_register(struct super_block *sb) {}
22fe04a77d104 drivers/staging/erofs/internal.h (Gao Xiang           2019-07-31 23:57:39 +0800 452) static inline void erofs_shrinker_unregister(struct super_block *sb) {}
22fe04a77d104 drivers/staging/erofs/internal.h (Gao Xiang           2019-07-31 23:57:39 +0800 453) static inline int erofs_init_shrinker(void) { return 0; }
22fe04a77d104 drivers/staging/erofs/internal.h (Gao Xiang           2019-07-31 23:57:39 +0800 454) static inline void erofs_exit_shrinker(void) {}
22fe04a77d104 drivers/staging/erofs/internal.h (Gao Xiang           2019-07-31 23:57:39 +0800 455) static inline int z_erofs_init_zip_subsystem(void) { return 0; }
22fe04a77d104 drivers/staging/erofs/internal.h (Gao Xiang           2019-07-31 23:57:39 +0800 456) static inline void z_erofs_exit_zip_subsystem(void) {}
5d50538fc567c fs/erofs/internal.h              (Huang Jianan        2021-03-29 09:23:06 +0800 457) static inline int z_erofs_load_lz4_config(struct super_block *sb,
46249cded18ac fs/erofs/internal.h              (Gao Xiang           2021-03-29 09:23:07 +0800 458) 				  struct erofs_super_block *dsb,
46249cded18ac fs/erofs/internal.h              (Gao Xiang           2021-03-29 09:23:07 +0800 459) 				  struct z_erofs_lz4_cfgs *lz4, int len)
5d50538fc567c fs/erofs/internal.h              (Huang Jianan        2021-03-29 09:23:06 +0800 460) {
14373711dd54b fs/erofs/internal.h              (Gao Xiang           2021-03-29 18:00:12 +0800 461) 	if (lz4 || dsb->u1.lz4_max_distance) {
5d50538fc567c fs/erofs/internal.h              (Huang Jianan        2021-03-29 09:23:06 +0800 462) 		erofs_err(sb, "lz4 algorithm isn't enabled");
5d50538fc567c fs/erofs/internal.h              (Huang Jianan        2021-03-29 09:23:06 +0800 463) 		return -EINVAL;
5d50538fc567c fs/erofs/internal.h              (Huang Jianan        2021-03-29 09:23:06 +0800 464) 	}
5d50538fc567c fs/erofs/internal.h              (Huang Jianan        2021-03-29 09:23:06 +0800 465) 	return 0;
5d50538fc567c fs/erofs/internal.h              (Huang Jianan        2021-03-29 09:23:06 +0800 466) }
22fe04a77d104 drivers/staging/erofs/internal.h (Gao Xiang           2019-07-31 23:57:39 +0800 467) #endif	/* !CONFIG_EROFS_FS_ZIP */
2e1d66379ece5 drivers/staging/erofs/internal.h (Gao Xiang           2019-01-16 16:59:56 +0800 468) 
a6b9b1d5eae61 drivers/staging/erofs/internal.h (Gao Xiang           2019-08-14 18:37:03 +0800 469) #define EFSCORRUPTED    EUCLEAN         /* Filesystem is corrupted */
a6b9b1d5eae61 drivers/staging/erofs/internal.h (Gao Xiang           2019-08-14 18:37:03 +0800 470) 
14f362b4f4058 drivers/staging/erofs/internal.h (Gao Xiang           2019-07-31 23:57:36 +0800 471) #endif	/* __EROFS_INTERNAL_H */
bfb8674dc0447 drivers/staging/erofs/internal.h (Gao Xiang           2018-07-26 20:21:45 +0800 472)