diff options
author | Gao Xiang <gaoxiang25@huawei.com> | 2019-09-03 22:09:05 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-09-05 14:10:08 -0400 |
commit | 99634bf388db04048b83a075358a1d166e7300fb (patch) | |
tree | 101429479b254d807a2e762fa2a4851a490e1b4c /fs/erofs | |
parent | 94e4e153b1c25a49b4953c424e6e2f66efb449f3 (diff) |
erofs: add "erofs_" prefix for common and short functions
Add erofs_ prefix to free_inode, alloc_inode, ...
Reported-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Link: https://lore.kernel.org/r/20190904020912.63925-19-gaoxiang25@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/erofs')
-rw-r--r-- | fs/erofs/data.c | 4 | ||||
-rw-r--r-- | fs/erofs/decompressor.c | 22 | ||||
-rw-r--r-- | fs/erofs/inode.c | 8 | ||||
-rw-r--r-- | fs/erofs/internal.h | 2 | ||||
-rw-r--r-- | fs/erofs/namei.c | 12 | ||||
-rw-r--r-- | fs/erofs/super.c | 40 | ||||
-rw-r--r-- | fs/erofs/zdata.c | 19 |
7 files changed, 54 insertions, 53 deletions
diff --git a/fs/erofs/data.c b/fs/erofs/data.c index 70b1e353756e..3ce87a88452a 100644 --- a/fs/erofs/data.c +++ b/fs/erofs/data.c | |||
@@ -9,7 +9,7 @@ | |||
9 | 9 | ||
10 | #include <trace/events/erofs.h> | 10 | #include <trace/events/erofs.h> |
11 | 11 | ||
12 | static inline void read_endio(struct bio *bio) | 12 | static void erofs_readendio(struct bio *bio) |
13 | { | 13 | { |
14 | struct super_block *const sb = bio->bi_private; | 14 | struct super_block *const sb = bio->bi_private; |
15 | struct bio_vec *bvec; | 15 | struct bio_vec *bvec; |
@@ -45,7 +45,7 @@ static struct bio *erofs_grab_raw_bio(struct super_block *sb, | |||
45 | { | 45 | { |
46 | struct bio *bio = bio_alloc(GFP_NOIO, nr_pages); | 46 | struct bio *bio = bio_alloc(GFP_NOIO, nr_pages); |
47 | 47 | ||
48 | bio->bi_end_io = read_endio; | 48 | bio->bi_end_io = erofs_readendio; |
49 | bio_set_dev(bio, sb->s_bdev); | 49 | bio_set_dev(bio, sb->s_bdev); |
50 | bio->bi_iter.bi_sector = (sector_t)blkaddr << LOG_SECTORS_PER_BLOCK; | 50 | bio->bi_iter.bi_sector = (sector_t)blkaddr << LOG_SECTORS_PER_BLOCK; |
51 | bio->bi_private = sb; | 51 | bio->bi_private = sb; |
diff --git a/fs/erofs/decompressor.c b/fs/erofs/decompressor.c index 555c04730f87..8ed38504a9f1 100644 --- a/fs/erofs/decompressor.c +++ b/fs/erofs/decompressor.c | |||
@@ -32,8 +32,8 @@ static bool use_vmap; | |||
32 | module_param(use_vmap, bool, 0444); | 32 | module_param(use_vmap, bool, 0444); |
33 | MODULE_PARM_DESC(use_vmap, "Use vmap() instead of vm_map_ram() (default 0)"); | 33 | MODULE_PARM_DESC(use_vmap, "Use vmap() instead of vm_map_ram() (default 0)"); |
34 | 34 | ||
35 | static int lz4_prepare_destpages(struct z_erofs_decompress_req *rq, | 35 | static int z_erofs_lz4_prepare_destpages(struct z_erofs_decompress_req *rq, |
36 | struct list_head *pagepool) | 36 | struct list_head *pagepool) |
37 | { | 37 | { |
38 | const unsigned int nr = | 38 | const unsigned int nr = |
39 | PAGE_ALIGN(rq->pageofs_out + rq->outputsize) >> PAGE_SHIFT; | 39 | PAGE_ALIGN(rq->pageofs_out + rq->outputsize) >> PAGE_SHIFT; |
@@ -114,7 +114,7 @@ static void *generic_copy_inplace_data(struct z_erofs_decompress_req *rq, | |||
114 | return tmp; | 114 | return tmp; |
115 | } | 115 | } |
116 | 116 | ||
117 | static int lz4_decompress(struct z_erofs_decompress_req *rq, u8 *out) | 117 | static int z_erofs_lz4_decompress(struct z_erofs_decompress_req *rq, u8 *out) |
118 | { | 118 | { |
119 | unsigned int inputmargin, inlen; | 119 | unsigned int inputmargin, inlen; |
120 | u8 *src; | 120 | u8 *src; |
@@ -188,8 +188,8 @@ static struct z_erofs_decompressor decompressors[] = { | |||
188 | .name = "shifted" | 188 | .name = "shifted" |
189 | }, | 189 | }, |
190 | [Z_EROFS_COMPRESSION_LZ4] = { | 190 | [Z_EROFS_COMPRESSION_LZ4] = { |
191 | .prepare_destpages = lz4_prepare_destpages, | 191 | .prepare_destpages = z_erofs_lz4_prepare_destpages, |
192 | .decompress = lz4_decompress, | 192 | .decompress = z_erofs_lz4_decompress, |
193 | .name = "lz4" | 193 | .name = "lz4" |
194 | }, | 194 | }, |
195 | }; | 195 | }; |
@@ -247,8 +247,8 @@ static void erofs_vunmap(const void *mem, unsigned int count) | |||
247 | vunmap(mem); | 247 | vunmap(mem); |
248 | } | 248 | } |
249 | 249 | ||
250 | static int decompress_generic(struct z_erofs_decompress_req *rq, | 250 | static int z_erofs_decompress_generic(struct z_erofs_decompress_req *rq, |
251 | struct list_head *pagepool) | 251 | struct list_head *pagepool) |
252 | { | 252 | { |
253 | const unsigned int nrpages_out = | 253 | const unsigned int nrpages_out = |
254 | PAGE_ALIGN(rq->pageofs_out + rq->outputsize) >> PAGE_SHIFT; | 254 | PAGE_ALIGN(rq->pageofs_out + rq->outputsize) >> PAGE_SHIFT; |
@@ -308,8 +308,8 @@ dstmap_out: | |||
308 | return ret; | 308 | return ret; |
309 | } | 309 | } |
310 | 310 | ||
311 | static int shifted_decompress(const struct z_erofs_decompress_req *rq, | 311 | static int z_erofs_shifted_transform(const struct z_erofs_decompress_req *rq, |
312 | struct list_head *pagepool) | 312 | struct list_head *pagepool) |
313 | { | 313 | { |
314 | const unsigned int nrpages_out = | 314 | const unsigned int nrpages_out = |
315 | PAGE_ALIGN(rq->pageofs_out + rq->outputsize) >> PAGE_SHIFT; | 315 | PAGE_ALIGN(rq->pageofs_out + rq->outputsize) >> PAGE_SHIFT; |
@@ -353,7 +353,7 @@ int z_erofs_decompress(struct z_erofs_decompress_req *rq, | |||
353 | struct list_head *pagepool) | 353 | struct list_head *pagepool) |
354 | { | 354 | { |
355 | if (rq->alg == Z_EROFS_COMPRESSION_SHIFTED) | 355 | if (rq->alg == Z_EROFS_COMPRESSION_SHIFTED) |
356 | return shifted_decompress(rq, pagepool); | 356 | return z_erofs_shifted_transform(rq, pagepool); |
357 | return decompress_generic(rq, pagepool); | 357 | return z_erofs_decompress_generic(rq, pagepool); |
358 | } | 358 | } |
359 | 359 | ||
diff --git a/fs/erofs/inode.c b/fs/erofs/inode.c index 8d496adbeaea..384905e0677c 100644 --- a/fs/erofs/inode.c +++ b/fs/erofs/inode.c | |||
@@ -9,7 +9,7 @@ | |||
9 | #include <trace/events/erofs.h> | 9 | #include <trace/events/erofs.h> |
10 | 10 | ||
11 | /* no locking */ | 11 | /* no locking */ |
12 | static int read_inode(struct inode *inode, void *data) | 12 | static int erofs_read_inode(struct inode *inode, void *data) |
13 | { | 13 | { |
14 | struct erofs_inode *vi = EROFS_I(inode); | 14 | struct erofs_inode *vi = EROFS_I(inode); |
15 | struct erofs_inode_compact *dic = data; | 15 | struct erofs_inode_compact *dic = data; |
@@ -163,7 +163,7 @@ static int erofs_fill_symlink(struct inode *inode, void *data, | |||
163 | return 0; | 163 | return 0; |
164 | } | 164 | } |
165 | 165 | ||
166 | static int fill_inode(struct inode *inode, int isdir) | 166 | static int erofs_fill_inode(struct inode *inode, int isdir) |
167 | { | 167 | { |
168 | struct erofs_sb_info *sbi = EROFS_SB(inode->i_sb); | 168 | struct erofs_sb_info *sbi = EROFS_SB(inode->i_sb); |
169 | struct erofs_inode *vi = EROFS_I(inode); | 169 | struct erofs_inode *vi = EROFS_I(inode); |
@@ -193,7 +193,7 @@ static int fill_inode(struct inode *inode, int isdir) | |||
193 | DBG_BUGON(!PageUptodate(page)); | 193 | DBG_BUGON(!PageUptodate(page)); |
194 | data = page_address(page); | 194 | data = page_address(page); |
195 | 195 | ||
196 | err = read_inode(inode, data + ofs); | 196 | err = erofs_read_inode(inode, data + ofs); |
197 | if (!err) { | 197 | if (!err) { |
198 | /* setup the new inode */ | 198 | /* setup the new inode */ |
199 | switch (inode->i_mode & S_IFMT) { | 199 | switch (inode->i_mode & S_IFMT) { |
@@ -286,7 +286,7 @@ struct inode *erofs_iget(struct super_block *sb, | |||
286 | 286 | ||
287 | vi->nid = nid; | 287 | vi->nid = nid; |
288 | 288 | ||
289 | err = fill_inode(inode, isdir); | 289 | err = erofs_fill_inode(inode, isdir); |
290 | if (!err) | 290 | if (!err) |
291 | unlock_new_inode(inode); | 291 | unlock_new_inode(inode); |
292 | else { | 292 | else { |
diff --git a/fs/erofs/internal.h b/fs/erofs/internal.h index 13c8d841c43a..881eb2ee18b5 100644 --- a/fs/erofs/internal.h +++ b/fs/erofs/internal.h | |||
@@ -308,7 +308,7 @@ struct erofs_inode { | |||
308 | #define EROFS_I(ptr) \ | 308 | #define EROFS_I(ptr) \ |
309 | container_of(ptr, struct erofs_inode, vfs_inode) | 309 | container_of(ptr, struct erofs_inode, vfs_inode) |
310 | 310 | ||
311 | static inline unsigned long inode_datablocks(struct inode *inode) | 311 | static inline unsigned long erofs_inode_datablocks(struct inode *inode) |
312 | { | 312 | { |
313 | /* since i_size cannot be changed */ | 313 | /* since i_size cannot be changed */ |
314 | return DIV_ROUND_UP(inode->i_size, EROFS_BLKSIZ); | 314 | return DIV_ROUND_UP(inode->i_size, EROFS_BLKSIZ); |
diff --git a/fs/erofs/namei.c b/fs/erofs/namei.c index a6b6a4ab1403..6debc1d88282 100644 --- a/fs/erofs/namei.c +++ b/fs/erofs/namei.c | |||
@@ -14,9 +14,9 @@ struct erofs_qstr { | |||
14 | }; | 14 | }; |
15 | 15 | ||
16 | /* based on the end of qn is accurate and it must have the trailing '\0' */ | 16 | /* based on the end of qn is accurate and it must have the trailing '\0' */ |
17 | static inline int dirnamecmp(const struct erofs_qstr *qn, | 17 | static inline int erofs_dirnamecmp(const struct erofs_qstr *qn, |
18 | const struct erofs_qstr *qd, | 18 | const struct erofs_qstr *qd, |
19 | unsigned int *matched) | 19 | unsigned int *matched) |
20 | { | 20 | { |
21 | unsigned int i = *matched; | 21 | unsigned int i = *matched; |
22 | 22 | ||
@@ -71,7 +71,7 @@ static struct erofs_dirent *find_target_dirent(struct erofs_qstr *name, | |||
71 | }; | 71 | }; |
72 | 72 | ||
73 | /* string comparison without already matched prefix */ | 73 | /* string comparison without already matched prefix */ |
74 | int ret = dirnamecmp(name, &dname, &matched); | 74 | int ret = erofs_dirnamecmp(name, &dname, &matched); |
75 | 75 | ||
76 | if (!ret) { | 76 | if (!ret) { |
77 | return de + mid; | 77 | return de + mid; |
@@ -98,7 +98,7 @@ static struct page *find_target_block_classic(struct inode *dir, | |||
98 | 98 | ||
99 | startprfx = endprfx = 0; | 99 | startprfx = endprfx = 0; |
100 | head = 0; | 100 | head = 0; |
101 | back = inode_datablocks(dir) - 1; | 101 | back = erofs_inode_datablocks(dir) - 1; |
102 | 102 | ||
103 | while (head <= back) { | 103 | while (head <= back) { |
104 | const int mid = head + (back - head) / 2; | 104 | const int mid = head + (back - head) / 2; |
@@ -134,7 +134,7 @@ static struct page *find_target_block_classic(struct inode *dir, | |||
134 | EROFS_BLKSIZ); | 134 | EROFS_BLKSIZ); |
135 | 135 | ||
136 | /* string comparison without already matched prefix */ | 136 | /* string comparison without already matched prefix */ |
137 | diff = dirnamecmp(name, &dname, &matched); | 137 | diff = erofs_dirnamecmp(name, &dname, &matched); |
138 | kunmap_atomic(de); | 138 | kunmap_atomic(de); |
139 | 139 | ||
140 | if (!diff) { | 140 | if (!diff) { |
diff --git a/fs/erofs/super.c b/fs/erofs/super.c index b64d69f18270..36e569a79172 100644 --- a/fs/erofs/super.c +++ b/fs/erofs/super.c | |||
@@ -16,14 +16,14 @@ | |||
16 | 16 | ||
17 | static struct kmem_cache *erofs_inode_cachep __read_mostly; | 17 | static struct kmem_cache *erofs_inode_cachep __read_mostly; |
18 | 18 | ||
19 | static void init_once(void *ptr) | 19 | static void erofs_inode_init_once(void *ptr) |
20 | { | 20 | { |
21 | struct erofs_inode *vi = ptr; | 21 | struct erofs_inode *vi = ptr; |
22 | 22 | ||
23 | inode_init_once(&vi->vfs_inode); | 23 | inode_init_once(&vi->vfs_inode); |
24 | } | 24 | } |
25 | 25 | ||
26 | static struct inode *alloc_inode(struct super_block *sb) | 26 | static struct inode *erofs_alloc_inode(struct super_block *sb) |
27 | { | 27 | { |
28 | struct erofs_inode *vi = | 28 | struct erofs_inode *vi = |
29 | kmem_cache_alloc(erofs_inode_cachep, GFP_KERNEL); | 29 | kmem_cache_alloc(erofs_inode_cachep, GFP_KERNEL); |
@@ -36,7 +36,7 @@ static struct inode *alloc_inode(struct super_block *sb) | |||
36 | return &vi->vfs_inode; | 36 | return &vi->vfs_inode; |
37 | } | 37 | } |
38 | 38 | ||
39 | static void free_inode(struct inode *inode) | 39 | static void erofs_free_inode(struct inode *inode) |
40 | { | 40 | { |
41 | struct erofs_inode *vi = EROFS_I(inode); | 41 | struct erofs_inode *vi = EROFS_I(inode); |
42 | 42 | ||
@@ -64,7 +64,7 @@ static bool check_layout_compatibility(struct super_block *sb, | |||
64 | return true; | 64 | return true; |
65 | } | 65 | } |
66 | 66 | ||
67 | static int superblock_read(struct super_block *sb) | 67 | static int erofs_read_superblock(struct super_block *sb) |
68 | { | 68 | { |
69 | struct erofs_sb_info *sbi; | 69 | struct erofs_sb_info *sbi; |
70 | struct buffer_head *bh; | 70 | struct buffer_head *bh; |
@@ -218,7 +218,7 @@ static int erofs_build_cache_strategy(struct erofs_sb_info *sbi, | |||
218 | #endif | 218 | #endif |
219 | 219 | ||
220 | /* set up default EROFS parameters */ | 220 | /* set up default EROFS parameters */ |
221 | static void default_options(struct erofs_sb_info *sbi) | 221 | static void erofs_default_options(struct erofs_sb_info *sbi) |
222 | { | 222 | { |
223 | #ifdef CONFIG_EROFS_FS_ZIP | 223 | #ifdef CONFIG_EROFS_FS_ZIP |
224 | sbi->cache_strategy = EROFS_ZIP_CACHE_READAROUND; | 224 | sbi->cache_strategy = EROFS_ZIP_CACHE_READAROUND; |
@@ -252,7 +252,7 @@ static match_table_t erofs_tokens = { | |||
252 | {Opt_err, NULL} | 252 | {Opt_err, NULL} |
253 | }; | 253 | }; |
254 | 254 | ||
255 | static int parse_options(struct super_block *sb, char *options) | 255 | static int erofs_parse_options(struct super_block *sb, char *options) |
256 | { | 256 | { |
257 | substring_t args[MAX_OPT_ARGS]; | 257 | substring_t args[MAX_OPT_ARGS]; |
258 | char *p; | 258 | char *p; |
@@ -322,7 +322,7 @@ static int parse_options(struct super_block *sb, char *options) | |||
322 | #ifdef CONFIG_EROFS_FS_ZIP | 322 | #ifdef CONFIG_EROFS_FS_ZIP |
323 | static const struct address_space_operations managed_cache_aops; | 323 | static const struct address_space_operations managed_cache_aops; |
324 | 324 | ||
325 | static int managed_cache_releasepage(struct page *page, gfp_t gfp_mask) | 325 | static int erofs_managed_cache_releasepage(struct page *page, gfp_t gfp_mask) |
326 | { | 326 | { |
327 | int ret = 1; /* 0 - busy */ | 327 | int ret = 1; /* 0 - busy */ |
328 | struct address_space *const mapping = page->mapping; | 328 | struct address_space *const mapping = page->mapping; |
@@ -336,9 +336,9 @@ static int managed_cache_releasepage(struct page *page, gfp_t gfp_mask) | |||
336 | return ret; | 336 | return ret; |
337 | } | 337 | } |
338 | 338 | ||
339 | static void managed_cache_invalidatepage(struct page *page, | 339 | static void erofs_managed_cache_invalidatepage(struct page *page, |
340 | unsigned int offset, | 340 | unsigned int offset, |
341 | unsigned int length) | 341 | unsigned int length) |
342 | { | 342 | { |
343 | const unsigned int stop = length + offset; | 343 | const unsigned int stop = length + offset; |
344 | 344 | ||
@@ -348,13 +348,13 @@ static void managed_cache_invalidatepage(struct page *page, | |||
348 | DBG_BUGON(stop > PAGE_SIZE || stop < length); | 348 | DBG_BUGON(stop > PAGE_SIZE || stop < length); |
349 | 349 | ||
350 | if (offset == 0 && stop == PAGE_SIZE) | 350 | if (offset == 0 && stop == PAGE_SIZE) |
351 | while (!managed_cache_releasepage(page, GFP_NOFS)) | 351 | while (!erofs_managed_cache_releasepage(page, GFP_NOFS)) |
352 | cond_resched(); | 352 | cond_resched(); |
353 | } | 353 | } |
354 | 354 | ||
355 | static const struct address_space_operations managed_cache_aops = { | 355 | static const struct address_space_operations managed_cache_aops = { |
356 | .releasepage = managed_cache_releasepage, | 356 | .releasepage = erofs_managed_cache_releasepage, |
357 | .invalidatepage = managed_cache_invalidatepage, | 357 | .invalidatepage = erofs_managed_cache_invalidatepage, |
358 | }; | 358 | }; |
359 | 359 | ||
360 | static int erofs_init_managed_cache(struct super_block *sb) | 360 | static int erofs_init_managed_cache(struct super_block *sb) |
@@ -396,7 +396,7 @@ static int erofs_fill_super(struct super_block *sb, void *data, int silent) | |||
396 | return -ENOMEM; | 396 | return -ENOMEM; |
397 | 397 | ||
398 | sb->s_fs_info = sbi; | 398 | sb->s_fs_info = sbi; |
399 | err = superblock_read(sb); | 399 | err = erofs_read_superblock(sb); |
400 | if (err) | 400 | if (err) |
401 | return err; | 401 | return err; |
402 | 402 | ||
@@ -410,9 +410,9 @@ static int erofs_fill_super(struct super_block *sb, void *data, int silent) | |||
410 | sb->s_xattr = erofs_xattr_handlers; | 410 | sb->s_xattr = erofs_xattr_handlers; |
411 | #endif | 411 | #endif |
412 | /* set erofs default mount options */ | 412 | /* set erofs default mount options */ |
413 | default_options(sbi); | 413 | erofs_default_options(sbi); |
414 | 414 | ||
415 | err = parse_options(sb, data); | 415 | err = erofs_parse_options(sb, data); |
416 | if (err) | 416 | if (err) |
417 | return err; | 417 | return err; |
418 | 418 | ||
@@ -512,7 +512,7 @@ static int __init erofs_module_init(void) | |||
512 | erofs_inode_cachep = kmem_cache_create("erofs_inode", | 512 | erofs_inode_cachep = kmem_cache_create("erofs_inode", |
513 | sizeof(struct erofs_inode), 0, | 513 | sizeof(struct erofs_inode), 0, |
514 | SLAB_RECLAIM_ACCOUNT, | 514 | SLAB_RECLAIM_ACCOUNT, |
515 | init_once); | 515 | erofs_inode_init_once); |
516 | if (!erofs_inode_cachep) { | 516 | if (!erofs_inode_cachep) { |
517 | err = -ENOMEM; | 517 | err = -ENOMEM; |
518 | goto icache_err; | 518 | goto icache_err; |
@@ -619,7 +619,7 @@ static int erofs_remount(struct super_block *sb, int *flags, char *data) | |||
619 | int err; | 619 | int err; |
620 | 620 | ||
621 | DBG_BUGON(!sb_rdonly(sb)); | 621 | DBG_BUGON(!sb_rdonly(sb)); |
622 | err = parse_options(sb, data); | 622 | err = erofs_parse_options(sb, data); |
623 | if (err) | 623 | if (err) |
624 | goto out; | 624 | goto out; |
625 | 625 | ||
@@ -639,8 +639,8 @@ out: | |||
639 | 639 | ||
640 | const struct super_operations erofs_sops = { | 640 | const struct super_operations erofs_sops = { |
641 | .put_super = erofs_put_super, | 641 | .put_super = erofs_put_super, |
642 | .alloc_inode = alloc_inode, | 642 | .alloc_inode = erofs_alloc_inode, |
643 | .free_inode = free_inode, | 643 | .free_inode = erofs_free_inode, |
644 | .statfs = erofs_statfs, | 644 | .statfs = erofs_statfs, |
645 | .show_options = erofs_show_options, | 645 | .show_options = erofs_show_options, |
646 | .remount_fs = erofs_remount, | 646 | .remount_fs = erofs_remount, |
diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c index 3010fa3d1ac3..8587d6751c48 100644 --- a/fs/erofs/zdata.c +++ b/fs/erofs/zdata.c | |||
@@ -40,7 +40,7 @@ void z_erofs_exit_zip_subsystem(void) | |||
40 | kmem_cache_destroy(pcluster_cachep); | 40 | kmem_cache_destroy(pcluster_cachep); |
41 | } | 41 | } |
42 | 42 | ||
43 | static inline int init_unzip_workqueue(void) | 43 | static inline int z_erofs_init_workqueue(void) |
44 | { | 44 | { |
45 | const unsigned int onlinecpus = num_possible_cpus(); | 45 | const unsigned int onlinecpus = num_possible_cpus(); |
46 | const unsigned int flags = WQ_UNBOUND | WQ_HIGHPRI | WQ_CPU_INTENSIVE; | 46 | const unsigned int flags = WQ_UNBOUND | WQ_HIGHPRI | WQ_CPU_INTENSIVE; |
@@ -54,7 +54,7 @@ static inline int init_unzip_workqueue(void) | |||
54 | return z_erofs_workqueue ? 0 : -ENOMEM; | 54 | return z_erofs_workqueue ? 0 : -ENOMEM; |
55 | } | 55 | } |
56 | 56 | ||
57 | static void init_once(void *ptr) | 57 | static void z_erofs_pcluster_init_once(void *ptr) |
58 | { | 58 | { |
59 | struct z_erofs_pcluster *pcl = ptr; | 59 | struct z_erofs_pcluster *pcl = ptr; |
60 | struct z_erofs_collection *cl = z_erofs_primarycollection(pcl); | 60 | struct z_erofs_collection *cl = z_erofs_primarycollection(pcl); |
@@ -67,7 +67,7 @@ static void init_once(void *ptr) | |||
67 | pcl->compressed_pages[i] = NULL; | 67 | pcl->compressed_pages[i] = NULL; |
68 | } | 68 | } |
69 | 69 | ||
70 | static void init_always(struct z_erofs_pcluster *pcl) | 70 | static void z_erofs_pcluster_init_always(struct z_erofs_pcluster *pcl) |
71 | { | 71 | { |
72 | struct z_erofs_collection *cl = z_erofs_primarycollection(pcl); | 72 | struct z_erofs_collection *cl = z_erofs_primarycollection(pcl); |
73 | 73 | ||
@@ -81,9 +81,10 @@ int __init z_erofs_init_zip_subsystem(void) | |||
81 | { | 81 | { |
82 | pcluster_cachep = kmem_cache_create("erofs_compress", | 82 | pcluster_cachep = kmem_cache_create("erofs_compress", |
83 | Z_EROFS_WORKGROUP_SIZE, 0, | 83 | Z_EROFS_WORKGROUP_SIZE, 0, |
84 | SLAB_RECLAIM_ACCOUNT, init_once); | 84 | SLAB_RECLAIM_ACCOUNT, |
85 | z_erofs_pcluster_init_once); | ||
85 | if (pcluster_cachep) { | 86 | if (pcluster_cachep) { |
86 | if (!init_unzip_workqueue()) | 87 | if (!z_erofs_init_workqueue()) |
87 | return 0; | 88 | return 0; |
88 | 89 | ||
89 | kmem_cache_destroy(pcluster_cachep); | 90 | kmem_cache_destroy(pcluster_cachep); |
@@ -272,8 +273,8 @@ int erofs_try_to_free_cached_page(struct address_space *mapping, | |||
272 | } | 273 | } |
273 | 274 | ||
274 | /* page_type must be Z_EROFS_PAGE_TYPE_EXCLUSIVE */ | 275 | /* page_type must be Z_EROFS_PAGE_TYPE_EXCLUSIVE */ |
275 | static inline bool try_inplace_io(struct z_erofs_collector *clt, | 276 | static inline bool z_erofs_try_inplace_io(struct z_erofs_collector *clt, |
276 | struct page *page) | 277 | struct page *page) |
277 | { | 278 | { |
278 | struct z_erofs_pcluster *const pcl = clt->pcl; | 279 | struct z_erofs_pcluster *const pcl = clt->pcl; |
279 | const unsigned int clusterpages = BIT(pcl->clusterbits); | 280 | const unsigned int clusterpages = BIT(pcl->clusterbits); |
@@ -296,7 +297,7 @@ static int z_erofs_attach_page(struct z_erofs_collector *clt, | |||
296 | /* give priority for inplaceio */ | 297 | /* give priority for inplaceio */ |
297 | if (clt->mode >= COLLECT_PRIMARY && | 298 | if (clt->mode >= COLLECT_PRIMARY && |
298 | type == Z_EROFS_PAGE_TYPE_EXCLUSIVE && | 299 | type == Z_EROFS_PAGE_TYPE_EXCLUSIVE && |
299 | try_inplace_io(clt, page)) | 300 | z_erofs_try_inplace_io(clt, page)) |
300 | return 0; | 301 | return 0; |
301 | 302 | ||
302 | ret = z_erofs_pagevec_enqueue(&clt->vector, | 303 | ret = z_erofs_pagevec_enqueue(&clt->vector, |
@@ -409,7 +410,7 @@ static struct z_erofs_collection *clregister(struct z_erofs_collector *clt, | |||
409 | if (!pcl) | 410 | if (!pcl) |
410 | return ERR_PTR(-ENOMEM); | 411 | return ERR_PTR(-ENOMEM); |
411 | 412 | ||
412 | init_always(pcl); | 413 | z_erofs_pcluster_init_always(pcl); |
413 | pcl->obj.index = map->m_pa >> PAGE_SHIFT; | 414 | pcl->obj.index = map->m_pa >> PAGE_SHIFT; |
414 | 415 | ||
415 | pcl->length = (map->m_llen << Z_EROFS_PCLUSTER_LENGTH_BIT) | | 416 | pcl->length = (map->m_llen << Z_EROFS_PCLUSTER_LENGTH_BIT) | |