Skip to content

Commit d6f9469

Browse files
committed
Merge tag 'erofs-for-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs
Pull erofs updates from Gao Xiang: "The most interesting part is the new mount api conversion, which is actually a old patch already pending for several cycles. And the others are recent trivial cleanups here. Summary: - Convert to use the new mount apis - Some random cleanup patches" * tag 'erofs-for-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs: erofs: suppress false positive last_block warning erofs: convert to use the new mount fs_context api erofs: code cleanup by removing ifdef macro surrounding
2 parents cadf322 + 34f853b commit d6f9469

File tree

8 files changed

+136
-173
lines changed

8 files changed

+136
-173
lines changed

fs/erofs/data.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ static inline struct bio *erofs_read_raw_page(struct bio *bio,
265265
*/
266266
static int erofs_raw_access_readpage(struct file *file, struct page *page)
267267
{
268-
erofs_off_t last_block;
268+
erofs_off_t uninitialized_var(last_block);
269269
struct bio *bio;
270270

271271
trace_erofs_readpage(page, true);
@@ -282,7 +282,7 @@ static int erofs_raw_access_readpage(struct file *file, struct page *page)
282282

283283
static void erofs_raw_access_readahead(struct readahead_control *rac)
284284
{
285-
erofs_off_t last_block;
285+
erofs_off_t uninitialized_var(last_block);
286286
struct bio *bio = NULL;
287287
struct page *page;
288288

fs/erofs/inode.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -311,27 +311,21 @@ int erofs_getattr(const struct path *path, struct kstat *stat,
311311

312312
const struct inode_operations erofs_generic_iops = {
313313
.getattr = erofs_getattr,
314-
#ifdef CONFIG_EROFS_FS_XATTR
315314
.listxattr = erofs_listxattr,
316-
#endif
317315
.get_acl = erofs_get_acl,
318316
};
319317

320318
const struct inode_operations erofs_symlink_iops = {
321319
.get_link = page_get_link,
322320
.getattr = erofs_getattr,
323-
#ifdef CONFIG_EROFS_FS_XATTR
324321
.listxattr = erofs_listxattr,
325-
#endif
326322
.get_acl = erofs_get_acl,
327323
};
328324

329325
const struct inode_operations erofs_fast_symlink_iops = {
330326
.get_link = simple_get_link,
331327
.getattr = erofs_getattr,
332-
#ifdef CONFIG_EROFS_FS_XATTR
333328
.listxattr = erofs_listxattr,
334-
#endif
335329
.get_acl = erofs_get_acl,
336330
};
337331

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 */

fs/erofs/namei.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,7 @@ static struct dentry *erofs_lookup(struct inode *dir,
244244
const struct inode_operations erofs_dir_iops = {
245245
.lookup = erofs_lookup,
246246
.getattr = erofs_getattr,
247-
#ifdef CONFIG_EROFS_FS_XATTR
248247
.listxattr = erofs_listxattr,
249-
#endif
250248
.get_acl = erofs_get_acl,
251249
};
252250

0 commit comments

Comments
 (0)