Commit 66aee5aa authored by Yuwei Guan's avatar Yuwei Guan Committed by Jaegeuk Kim

f2fs: change type for 'sbi->readdir_ra'

Before this patch, the varibale 'readdir_ra' takes effect if it's equal
to '1' or not, so we can change type for it from 'int' to 'bool'.
Signed-off-by: default avatarYuwei Guan <Yuwei.Guan@zeekrlife.com>
Reviewed-by: default avatarChao Yu <chao@kernel.org>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 777cd95b
...@@ -1010,7 +1010,7 @@ int f2fs_fill_dentries(struct dir_context *ctx, struct f2fs_dentry_ptr *d, ...@@ -1010,7 +1010,7 @@ int f2fs_fill_dentries(struct dir_context *ctx, struct f2fs_dentry_ptr *d,
struct fscrypt_str de_name = FSTR_INIT(NULL, 0); struct fscrypt_str de_name = FSTR_INIT(NULL, 0);
struct f2fs_sb_info *sbi = F2FS_I_SB(d->inode); struct f2fs_sb_info *sbi = F2FS_I_SB(d->inode);
struct blk_plug plug; struct blk_plug plug;
bool readdir_ra = sbi->readdir_ra == 1; bool readdir_ra = sbi->readdir_ra;
bool found_valid_dirent = false; bool found_valid_dirent = false;
int err = 0; int err = 0;
......
...@@ -1698,7 +1698,7 @@ struct f2fs_sb_info { ...@@ -1698,7 +1698,7 @@ struct f2fs_sb_info {
unsigned int total_node_count; /* total node block count */ unsigned int total_node_count; /* total node block count */
unsigned int total_valid_node_count; /* valid node block count */ unsigned int total_valid_node_count; /* valid node block count */
int dir_level; /* directory level */ int dir_level; /* directory level */
int readdir_ra; /* readahead inode in readdir */ bool readdir_ra; /* readahead inode in readdir */
u64 max_io_bytes; /* max io bytes to merge IOs */ u64 max_io_bytes; /* max io bytes to merge IOs */
block_t user_block_count; /* # of user blocks */ block_t user_block_count; /* # of user blocks */
......
...@@ -4085,7 +4085,7 @@ static void f2fs_tuning_parameters(struct f2fs_sb_info *sbi) ...@@ -4085,7 +4085,7 @@ static void f2fs_tuning_parameters(struct f2fs_sb_info *sbi)
1 << F2FS_IPU_HONOR_OPU_WRITE; 1 << F2FS_IPU_HONOR_OPU_WRITE;
} }
sbi->readdir_ra = 1; sbi->readdir_ra = true;
} }
static int f2fs_fill_super(struct super_block *sb, void *data, int silent) static int f2fs_fill_super(struct super_block *sb, void *data, int silent)
......
...@@ -656,6 +656,11 @@ static ssize_t __sbi_store(struct f2fs_attr *a, ...@@ -656,6 +656,11 @@ static ssize_t __sbi_store(struct f2fs_attr *a,
return count; return count;
} }
if (!strcmp(a->attr.name, "readdir_ra")) {
sbi->readdir_ra = !!t;
return count;
}
*ui = (unsigned int)t; *ui = (unsigned int)t;
return count; return count;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment