Skip to content

Commit

Permalink
Merge tag 'erofs-for-5.8-rc1' of git://git.kernel.org/pub/scm/linux/k…
Browse files Browse the repository at this point in the history
…ernel/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
  • Loading branch information
torvalds committed Jun 3, 2020
2 parents cadf322 + 34f853b commit d6f9469
Show file tree
Hide file tree
Showing 8 changed files with 136 additions and 173 deletions.
4 changes: 2 additions & 2 deletions fs/erofs/data.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ static inline struct bio *erofs_read_raw_page(struct bio *bio,
*/
static int erofs_raw_access_readpage(struct file *file, struct page *page)
{
erofs_off_t last_block;
erofs_off_t uninitialized_var(last_block);
struct bio *bio;

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

static void erofs_raw_access_readahead(struct readahead_control *rac)
{
erofs_off_t last_block;
erofs_off_t uninitialized_var(last_block);
struct bio *bio = NULL;
struct page *page;

Expand Down
6 changes: 0 additions & 6 deletions fs/erofs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,27 +311,21 @@ int erofs_getattr(const struct path *path, struct kstat *stat,

const struct inode_operations erofs_generic_iops = {
.getattr = erofs_getattr,
#ifdef CONFIG_EROFS_FS_XATTR
.listxattr = erofs_listxattr,
#endif
.get_acl = erofs_get_acl,
};

const struct inode_operations erofs_symlink_iops = {
.get_link = page_get_link,
.getattr = erofs_getattr,
#ifdef CONFIG_EROFS_FS_XATTR
.listxattr = erofs_listxattr,
#endif
.get_acl = erofs_get_acl,
};

const struct inode_operations erofs_fast_symlink_iops = {
.get_link = simple_get_link,
.getattr = erofs_getattr,
#ifdef CONFIG_EROFS_FS_XATTR
.listxattr = erofs_listxattr,
#endif
.get_acl = erofs_get_acl,
};

27 changes: 16 additions & 11 deletions fs/erofs/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,17 @@ typedef u64 erofs_off_t;
/* data type for filesystem-wide blocks number */
typedef u32 erofs_blk_t;

struct erofs_fs_context {
#ifdef CONFIG_EROFS_FS_ZIP
/* current strategy of how to use managed cache */
unsigned char cache_strategy;

/* threshold for decompression synchronously */
unsigned int max_sync_decompress_pages;
#endif
unsigned int mount_opt;
};

struct erofs_sb_info {
#ifdef CONFIG_EROFS_FS_ZIP
/* list for all registered superblocks, mainly for shrinker */
Expand All @@ -55,14 +66,8 @@ struct erofs_sb_info {
/* managed XArray arranged in physical block number */
struct xarray managed_pslots;

/* threshold for decompression synchronously */
unsigned int max_sync_decompress_pages;

unsigned int shrinker_run_no;

/* current strategy of how to use managed cache */
unsigned char cache_strategy;

/* pseudo inode to manage cached pages */
struct inode *managed_cache;
#endif /* CONFIG_EROFS_FS_ZIP */
Expand All @@ -88,7 +93,7 @@ struct erofs_sb_info {
u32 feature_compat;
u32 feature_incompat;

unsigned int mount_opt;
struct erofs_fs_context ctx; /* options */
};

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

#define clear_opt(sbi, option) ((sbi)->mount_opt &= ~EROFS_MOUNT_##option)
#define set_opt(sbi, option) ((sbi)->mount_opt |= EROFS_MOUNT_##option)
#define test_opt(sbi, option) ((sbi)->mount_opt & EROFS_MOUNT_##option)
#define clear_opt(ctx, option) ((ctx)->mount_opt &= ~EROFS_MOUNT_##option)
#define set_opt(ctx, option) ((ctx)->mount_opt |= EROFS_MOUNT_##option)
#define test_opt(ctx, option) ((ctx)->mount_opt & EROFS_MOUNT_##option)

#ifdef CONFIG_EROFS_FS_ZIP
enum {
EROFS_ZIP_CACHE_DISABLED,
EROFS_ZIP_CACHE_READAHEAD,
EROFS_ZIP_CACHE_READAROUND
};

#ifdef CONFIG_EROFS_FS_ZIP
#define EROFS_LOCKED_MAGIC (INT_MIN | 0xE0F510CCL)

/* basic unit of the workstation of a super_block */
Expand Down
2 changes: 0 additions & 2 deletions fs/erofs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,7 @@ static struct dentry *erofs_lookup(struct inode *dir,
const struct inode_operations erofs_dir_iops = {
.lookup = erofs_lookup,
.getattr = erofs_getattr,
#ifdef CONFIG_EROFS_FS_XATTR
.listxattr = erofs_listxattr,
#endif
.get_acl = erofs_get_acl,
};

Loading

0 comments on commit d6f9469

Please sign in to comment.