Skip to content

Commit f57a3fe

Browse files
chaseyuGao Xiang
authored andcommitted
erofs: convert to use the new mount fs_context api
Convert the erofs to use new internal mount API as the old one will be obsoleted and removed. This allows greater flexibility in communication of mount parameters between userspace, the VFS and the filesystem. See Documentation/filesystems/mount_api.txt for more information. Cc: Al Viro <[email protected]> Cc: David Howells <[email protected]> Signed-off-by: Chao Yu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Gao Xiang <[email protected]>
1 parent e7cda1e commit f57a3fe

File tree

4 files changed

+132
-156
lines changed

4 files changed

+132
-156
lines changed

fs/erofs/internal.h

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,17 @@ typedef u64 erofs_off_t;
4646
/* data type for filesystem-wide blocks number */
4747
typedef u32 erofs_blk_t;
4848

49+
struct erofs_fs_context {
50+
#ifdef CONFIG_EROFS_FS_ZIP
51+
/* current strategy of how to use managed cache */
52+
unsigned char cache_strategy;
53+
54+
/* threshold for decompression synchronously */
55+
unsigned int max_sync_decompress_pages;
56+
#endif
57+
unsigned int mount_opt;
58+
};
59+
4960
struct erofs_sb_info {
5061
#ifdef CONFIG_EROFS_FS_ZIP
5162
/* list for all registered superblocks, mainly for shrinker */
@@ -55,14 +66,8 @@ struct erofs_sb_info {
5566
/* managed XArray arranged in physical block number */
5667
struct xarray managed_pslots;
5768

58-
/* threshold for decompression synchronously */
59-
unsigned int max_sync_decompress_pages;
60-
6169
unsigned int shrinker_run_no;
6270

63-
/* current strategy of how to use managed cache */
64-
unsigned char cache_strategy;
65-
6671
/* pseudo inode to manage cached pages */
6772
struct inode *managed_cache;
6873
#endif /* CONFIG_EROFS_FS_ZIP */
@@ -88,7 +93,7 @@ struct erofs_sb_info {
8893
u32 feature_compat;
8994
u32 feature_incompat;
9095

91-
unsigned int mount_opt;
96+
struct erofs_fs_context ctx; /* options */
9297
};
9398

9499
#define EROFS_SB(sb) ((struct erofs_sb_info *)(sb)->s_fs_info)
@@ -98,17 +103,17 @@ struct erofs_sb_info {
98103
#define EROFS_MOUNT_XATTR_USER 0x00000010
99104
#define EROFS_MOUNT_POSIX_ACL 0x00000020
100105

101-
#define clear_opt(sbi, option) ((sbi)->mount_opt &= ~EROFS_MOUNT_##option)
102-
#define set_opt(sbi, option) ((sbi)->mount_opt |= EROFS_MOUNT_##option)
103-
#define test_opt(sbi, option) ((sbi)->mount_opt & EROFS_MOUNT_##option)
106+
#define clear_opt(ctx, option) ((ctx)->mount_opt &= ~EROFS_MOUNT_##option)
107+
#define set_opt(ctx, option) ((ctx)->mount_opt |= EROFS_MOUNT_##option)
108+
#define test_opt(ctx, option) ((ctx)->mount_opt & EROFS_MOUNT_##option)
104109

105-
#ifdef CONFIG_EROFS_FS_ZIP
106110
enum {
107111
EROFS_ZIP_CACHE_DISABLED,
108112
EROFS_ZIP_CACHE_READAHEAD,
109113
EROFS_ZIP_CACHE_READAROUND
110114
};
111115

116+
#ifdef CONFIG_EROFS_FS_ZIP
112117
#define EROFS_LOCKED_MAGIC (INT_MIN | 0xE0F510CCL)
113118

114119
/* basic unit of the workstation of a super_block */

0 commit comments

Comments
 (0)