Commit aabe5136 authored by Haicheng Li's avatar Haicheng Li Committed by Jaegeuk Kim

f2fs: use bool for booleans

Signed-off-by: default avatarHaicheng Li <haicheng.li@linux.intel.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk.kim@samsung.com>
parent dcdfff65
...@@ -275,7 +275,7 @@ int recover_orphan_inodes(struct f2fs_sb_info *sbi) ...@@ -275,7 +275,7 @@ int recover_orphan_inodes(struct f2fs_sb_info *sbi)
if (!is_set_ckpt_flags(F2FS_CKPT(sbi), CP_ORPHAN_PRESENT_FLAG)) if (!is_set_ckpt_flags(F2FS_CKPT(sbi), CP_ORPHAN_PRESENT_FLAG))
return 0; return 0;
sbi->por_doing = 1; sbi->por_doing = true;
start_blk = __start_cp_addr(sbi) + 1; start_blk = __start_cp_addr(sbi) + 1;
orphan_blkaddr = __start_sum_addr(sbi) - 1; orphan_blkaddr = __start_sum_addr(sbi) - 1;
...@@ -292,7 +292,7 @@ int recover_orphan_inodes(struct f2fs_sb_info *sbi) ...@@ -292,7 +292,7 @@ int recover_orphan_inodes(struct f2fs_sb_info *sbi)
} }
/* clear Orphan Flag */ /* clear Orphan Flag */
clear_ckpt_flags(F2FS_CKPT(sbi), CP_ORPHAN_PRESENT_FLAG); clear_ckpt_flags(F2FS_CKPT(sbi), CP_ORPHAN_PRESENT_FLAG);
sbi->por_doing = 0; sbi->por_doing = false;
return 0; return 0;
} }
......
...@@ -361,8 +361,8 @@ struct f2fs_sb_info { ...@@ -361,8 +361,8 @@ struct f2fs_sb_info {
struct rw_semaphore cp_rwsem; /* blocking FS operations */ struct rw_semaphore cp_rwsem; /* blocking FS operations */
struct mutex node_write; /* locking node writes */ struct mutex node_write; /* locking node writes */
struct mutex writepages; /* mutex for writepages() */ struct mutex writepages; /* mutex for writepages() */
int por_doing; /* recovery is doing or not */ bool por_doing; /* recovery is doing or not */
int on_build_free_nids; /* build_free_nids is doing */ bool on_build_free_nids; /* build_free_nids is doing */
struct task_struct *cp_task; /* checkpoint task */ struct task_struct *cp_task; /* checkpoint task */
/* for orphan inode management */ /* for orphan inode management */
......
...@@ -1439,9 +1439,9 @@ bool alloc_nid(struct f2fs_sb_info *sbi, nid_t *nid) ...@@ -1439,9 +1439,9 @@ bool alloc_nid(struct f2fs_sb_info *sbi, nid_t *nid)
/* Let's scan nat pages and its caches to get free nids */ /* Let's scan nat pages and its caches to get free nids */
mutex_lock(&nm_i->build_lock); mutex_lock(&nm_i->build_lock);
sbi->on_build_free_nids = 1; sbi->on_build_free_nids = true;
build_free_nids(sbi); build_free_nids(sbi);
sbi->on_build_free_nids = 0; sbi->on_build_free_nids = false;
mutex_unlock(&nm_i->build_lock); mutex_unlock(&nm_i->build_lock);
goto retry; goto retry;
} }
......
...@@ -425,7 +425,7 @@ int recover_fsync_data(struct f2fs_sb_info *sbi) ...@@ -425,7 +425,7 @@ int recover_fsync_data(struct f2fs_sb_info *sbi)
{ {
struct list_head inode_list; struct list_head inode_list;
int err; int err;
int need_writecp = 0; bool need_writecp = false;
fsync_entry_slab = f2fs_kmem_cache_create("f2fs_fsync_inode_entry", fsync_entry_slab = f2fs_kmem_cache_create("f2fs_fsync_inode_entry",
sizeof(struct fsync_inode_entry), NULL); sizeof(struct fsync_inode_entry), NULL);
...@@ -435,7 +435,7 @@ int recover_fsync_data(struct f2fs_sb_info *sbi) ...@@ -435,7 +435,7 @@ int recover_fsync_data(struct f2fs_sb_info *sbi)
INIT_LIST_HEAD(&inode_list); INIT_LIST_HEAD(&inode_list);
/* step #1: find fsynced inode numbers */ /* step #1: find fsynced inode numbers */
sbi->por_doing = 1; sbi->por_doing = true;
err = find_fsync_dnodes(sbi, &inode_list); err = find_fsync_dnodes(sbi, &inode_list);
if (err) if (err)
goto out; goto out;
...@@ -443,7 +443,7 @@ int recover_fsync_data(struct f2fs_sb_info *sbi) ...@@ -443,7 +443,7 @@ int recover_fsync_data(struct f2fs_sb_info *sbi)
if (list_empty(&inode_list)) if (list_empty(&inode_list))
goto out; goto out;
need_writecp = 1; need_writecp = true;
/* step #2: recover data */ /* step #2: recover data */
err = recover_data(sbi, &inode_list, CURSEG_WARM_NODE); err = recover_data(sbi, &inode_list, CURSEG_WARM_NODE);
...@@ -451,7 +451,7 @@ int recover_fsync_data(struct f2fs_sb_info *sbi) ...@@ -451,7 +451,7 @@ int recover_fsync_data(struct f2fs_sb_info *sbi)
out: out:
destroy_fsync_dnodes(&inode_list); destroy_fsync_dnodes(&inode_list);
kmem_cache_destroy(fsync_entry_slab); kmem_cache_destroy(fsync_entry_slab);
sbi->por_doing = 0; sbi->por_doing = false;
if (!err && need_writecp) if (!err && need_writecp)
write_checkpoint(sbi, false); write_checkpoint(sbi, false);
return err; return err;
......
...@@ -850,7 +850,7 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent) ...@@ -850,7 +850,7 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent)
mutex_init(&sbi->writepages); mutex_init(&sbi->writepages);
mutex_init(&sbi->cp_mutex); mutex_init(&sbi->cp_mutex);
mutex_init(&sbi->node_write); mutex_init(&sbi->node_write);
sbi->por_doing = 0; sbi->por_doing = false;
spin_lock_init(&sbi->stat_lock); spin_lock_init(&sbi->stat_lock);
init_rwsem(&sbi->bio_sem); init_rwsem(&sbi->bio_sem);
init_rwsem(&sbi->cp_rwsem); init_rwsem(&sbi->cp_rwsem);
......
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