@@ -814,12 +814,12 @@ static void free_inode_rec(struct inode_record *rec)
814814 free (rec );
815815}
816816
817- static int can_free_inode_rec (struct inode_record * rec )
817+ static bool can_free_inode_rec (struct inode_record * rec )
818818{
819819 if (!rec -> errors && rec -> checked && rec -> found_inode_item &&
820820 rec -> nlink == rec -> found_link && list_empty (& rec -> backrefs ))
821- return 1 ;
822- return 0 ;
821+ return true ;
822+ return false ;
823823}
824824
825825static void maybe_free_inode_rec (struct cache_tree * inode_cache ,
@@ -905,7 +905,7 @@ static int check_orphan_item(struct btrfs_root *root, u64 ino)
905905 return ret ;
906906}
907907
908- static int process_inode_item (struct extent_buffer * eb ,
908+ static bool process_inode_item (struct extent_buffer * eb ,
909909 int slot , struct btrfs_key * key ,
910910 struct shared_node * active_node )
911911{
@@ -918,7 +918,7 @@ static int process_inode_item(struct extent_buffer *eb,
918918 BUG_ON (rec -> ino != key -> objectid || rec -> refs > 1 );
919919 if (rec -> found_inode_item ) {
920920 rec -> errors |= I_ERR_DUP_INODE_ITEM ;
921- return 1 ;
921+ return true ;
922922 }
923923 item = btrfs_item_ptr (eb , slot , struct btrfs_inode_item );
924924 rec -> nlink = btrfs_inode_nlink (eb , item );
@@ -947,7 +947,7 @@ static int process_inode_item(struct extent_buffer *eb,
947947 btrfs_inode_transid (eb , item ) > gen_uplimit )
948948 rec -> errors |= I_ERR_INVALID_GEN ;
949949 maybe_free_inode_rec (& active_node -> inode_cache , rec );
950- return 0 ;
950+ return false ;
951951}
952952
953953static struct inode_backref * get_inode_backref (struct inode_record * rec ,
@@ -1249,7 +1249,7 @@ static int enter_shared_node(struct btrfs_root *root, u64 bytenr, u32 refs,
12491249 int ret ;
12501250
12511251 if (level == wc -> active_node )
1252- return 0 ;
1252+ return false ;
12531253
12541254 BUG_ON (wc -> active_node <= level );
12551255 node = find_shared_node (& wc -> shared , bytenr );
@@ -1259,7 +1259,7 @@ static int enter_shared_node(struct btrfs_root *root, u64 bytenr, u32 refs,
12591259 node = find_shared_node (& wc -> shared , bytenr );
12601260 wc -> nodes [level ] = node ;
12611261 wc -> active_node = level ;
1262- return 0 ;
1262+ return false ;
12631263 }
12641264
12651265 if (wc -> root_level == wc -> active_node &&
@@ -1270,7 +1270,7 @@ static int enter_shared_node(struct btrfs_root *root, u64 bytenr, u32 refs,
12701270 remove_cache_extent (& wc -> shared , & node -> cache );
12711271 free (node );
12721272 }
1273- return 1 ;
1273+ return true ;
12741274 }
12751275
12761276 dest = wc -> nodes [wc -> active_node ];
@@ -1279,7 +1279,7 @@ static int enter_shared_node(struct btrfs_root *root, u64 bytenr, u32 refs,
12791279 remove_cache_extent (& wc -> shared , & node -> cache );
12801280 free (node );
12811281 }
1282- return 1 ;
1282+ return true ;
12831283}
12841284
12851285static int leave_shared_node (struct btrfs_root * root ,
@@ -4204,7 +4204,7 @@ static int maybe_free_extent_rec(struct cache_tree *extent_cache,
42044204 return 0 ;
42054205}
42064206
4207- static int check_owner_ref (struct btrfs_root * root ,
4207+ static bool check_owner_ref (struct btrfs_root * root ,
42084208 struct extent_record * rec ,
42094209 struct extent_buffer * buf )
42104210{
@@ -4215,7 +4215,7 @@ static int check_owner_ref(struct btrfs_root *root,
42154215 struct btrfs_path path ;
42164216 struct extent_buffer * parent ;
42174217 int level ;
4218- int found = 0 ;
4218+ bool found = false ;
42194219 int ret ;
42204220
42214221 rbtree_postorder_for_each_entry_safe (node , tmp ,
@@ -4228,14 +4228,14 @@ static int check_owner_ref(struct btrfs_root *root,
42284228 continue ;
42294229 back = to_tree_backref (node );
42304230 if (btrfs_header_owner (buf ) == back -> root )
4231- return 0 ;
4231+ return false ;
42324232 }
42334233 /*
42344234 * Some unexpected root item referring to this one, return 1 to
42354235 * indicate owner not found
42364236 */
42374237 if (rec -> is_root )
4238- return 1 ;
4238+ return true ;
42394239
42404240 /* try to find the block by search corresponding fs tree */
42414241 key .objectid = btrfs_header_owner (buf );
@@ -4244,7 +4244,7 @@ static int check_owner_ref(struct btrfs_root *root,
42444244
42454245 ref_root = btrfs_read_fs_root (gfs_info , & key );
42464246 if (IS_ERR (ref_root ))
4247- return 1 ;
4247+ return true ;
42484248
42494249 level = btrfs_header_level (buf );
42504250 if (level == 0 )
@@ -4256,15 +4256,15 @@ static int check_owner_ref(struct btrfs_root *root,
42564256 path .lowest_level = level + 1 ;
42574257 ret = btrfs_search_slot (NULL , ref_root , & key , & path , 0 , 0 );
42584258 if (ret < 0 )
4259- return 0 ;
4259+ return false ;
42604260
42614261 parent = path .nodes [level + 1 ];
42624262 if (parent && buf -> start == btrfs_node_blockptr (parent ,
42634263 path .slots [level + 1 ]))
4264- found = 1 ;
4264+ found = true ;
42654265
42664266 btrfs_release_path (& path );
4267- return found ? 0 : 1 ;
4267+ return ! found ;
42684268}
42694269
42704270static int is_extent_tree_record (struct extent_record * rec )
@@ -6050,20 +6050,20 @@ static int check_csums(void)
60506050 return ret ;
60516051}
60526052
6053- static int is_dropped_key (struct btrfs_key * key ,
6053+ static bool is_dropped_key (struct btrfs_key * key ,
60546054 struct btrfs_key * drop_key )
60556055{
60566056 if (key -> objectid < drop_key -> objectid )
6057- return 1 ;
6057+ return true ;
60586058 else if (key -> objectid == drop_key -> objectid ) {
60596059 if (key -> type < drop_key -> type )
6060- return 1 ;
6060+ return true ;
60616061 else if (key -> type == drop_key -> type ) {
60626062 if (key -> offset < drop_key -> offset )
6063- return 1 ;
6063+ return true ;
60646064 }
60656065 }
6066- return 0 ;
6066+ return false ;
60676067}
60686068
60696069/*
0 commit comments