@@ -814,12 +814,12 @@ static void free_inode_rec(struct inode_record *rec)
814
814
free (rec );
815
815
}
816
816
817
- static int can_free_inode_rec (struct inode_record * rec )
817
+ static bool can_free_inode_rec (struct inode_record * rec )
818
818
{
819
819
if (!rec -> errors && rec -> checked && rec -> found_inode_item &&
820
820
rec -> nlink == rec -> found_link && list_empty (& rec -> backrefs ))
821
- return 1 ;
822
- return 0 ;
821
+ return true ;
822
+ return false ;
823
823
}
824
824
825
825
static 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)
905
905
return ret ;
906
906
}
907
907
908
- static int process_inode_item (struct extent_buffer * eb ,
908
+ static bool process_inode_item (struct extent_buffer * eb ,
909
909
int slot , struct btrfs_key * key ,
910
910
struct shared_node * active_node )
911
911
{
@@ -918,7 +918,7 @@ static int process_inode_item(struct extent_buffer *eb,
918
918
BUG_ON (rec -> ino != key -> objectid || rec -> refs > 1 );
919
919
if (rec -> found_inode_item ) {
920
920
rec -> errors |= I_ERR_DUP_INODE_ITEM ;
921
- return 1 ;
921
+ return true ;
922
922
}
923
923
item = btrfs_item_ptr (eb , slot , struct btrfs_inode_item );
924
924
rec -> nlink = btrfs_inode_nlink (eb , item );
@@ -947,7 +947,7 @@ static int process_inode_item(struct extent_buffer *eb,
947
947
btrfs_inode_transid (eb , item ) > gen_uplimit )
948
948
rec -> errors |= I_ERR_INVALID_GEN ;
949
949
maybe_free_inode_rec (& active_node -> inode_cache , rec );
950
- return 0 ;
950
+ return false ;
951
951
}
952
952
953
953
static 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,
1249
1249
int ret ;
1250
1250
1251
1251
if (level == wc -> active_node )
1252
- return 0 ;
1252
+ return false ;
1253
1253
1254
1254
BUG_ON (wc -> active_node <= level );
1255
1255
node = find_shared_node (& wc -> shared , bytenr );
@@ -1259,7 +1259,7 @@ static int enter_shared_node(struct btrfs_root *root, u64 bytenr, u32 refs,
1259
1259
node = find_shared_node (& wc -> shared , bytenr );
1260
1260
wc -> nodes [level ] = node ;
1261
1261
wc -> active_node = level ;
1262
- return 0 ;
1262
+ return false ;
1263
1263
}
1264
1264
1265
1265
if (wc -> root_level == wc -> active_node &&
@@ -1270,7 +1270,7 @@ static int enter_shared_node(struct btrfs_root *root, u64 bytenr, u32 refs,
1270
1270
remove_cache_extent (& wc -> shared , & node -> cache );
1271
1271
free (node );
1272
1272
}
1273
- return 1 ;
1273
+ return true ;
1274
1274
}
1275
1275
1276
1276
dest = wc -> nodes [wc -> active_node ];
@@ -1279,7 +1279,7 @@ static int enter_shared_node(struct btrfs_root *root, u64 bytenr, u32 refs,
1279
1279
remove_cache_extent (& wc -> shared , & node -> cache );
1280
1280
free (node );
1281
1281
}
1282
- return 1 ;
1282
+ return true ;
1283
1283
}
1284
1284
1285
1285
static int leave_shared_node (struct btrfs_root * root ,
@@ -4204,7 +4204,7 @@ static int maybe_free_extent_rec(struct cache_tree *extent_cache,
4204
4204
return 0 ;
4205
4205
}
4206
4206
4207
- static int check_owner_ref (struct btrfs_root * root ,
4207
+ static bool check_owner_ref (struct btrfs_root * root ,
4208
4208
struct extent_record * rec ,
4209
4209
struct extent_buffer * buf )
4210
4210
{
@@ -4215,7 +4215,7 @@ static int check_owner_ref(struct btrfs_root *root,
4215
4215
struct btrfs_path path ;
4216
4216
struct extent_buffer * parent ;
4217
4217
int level ;
4218
- int found = 0 ;
4218
+ bool found = false ;
4219
4219
int ret ;
4220
4220
4221
4221
rbtree_postorder_for_each_entry_safe (node , tmp ,
@@ -4228,14 +4228,14 @@ static int check_owner_ref(struct btrfs_root *root,
4228
4228
continue ;
4229
4229
back = to_tree_backref (node );
4230
4230
if (btrfs_header_owner (buf ) == back -> root )
4231
- return 0 ;
4231
+ return false ;
4232
4232
}
4233
4233
/*
4234
4234
* Some unexpected root item referring to this one, return 1 to
4235
4235
* indicate owner not found
4236
4236
*/
4237
4237
if (rec -> is_root )
4238
- return 1 ;
4238
+ return true ;
4239
4239
4240
4240
/* try to find the block by search corresponding fs tree */
4241
4241
key .objectid = btrfs_header_owner (buf );
@@ -4244,7 +4244,7 @@ static int check_owner_ref(struct btrfs_root *root,
4244
4244
4245
4245
ref_root = btrfs_read_fs_root (gfs_info , & key );
4246
4246
if (IS_ERR (ref_root ))
4247
- return 1 ;
4247
+ return true ;
4248
4248
4249
4249
level = btrfs_header_level (buf );
4250
4250
if (level == 0 )
@@ -4256,15 +4256,15 @@ static int check_owner_ref(struct btrfs_root *root,
4256
4256
path .lowest_level = level + 1 ;
4257
4257
ret = btrfs_search_slot (NULL , ref_root , & key , & path , 0 , 0 );
4258
4258
if (ret < 0 )
4259
- return 0 ;
4259
+ return false ;
4260
4260
4261
4261
parent = path .nodes [level + 1 ];
4262
4262
if (parent && buf -> start == btrfs_node_blockptr (parent ,
4263
4263
path .slots [level + 1 ]))
4264
- found = 1 ;
4264
+ found = true ;
4265
4265
4266
4266
btrfs_release_path (& path );
4267
- return found ? 0 : 1 ;
4267
+ return ! found ;
4268
4268
}
4269
4269
4270
4270
static int is_extent_tree_record (struct extent_record * rec )
@@ -6050,20 +6050,20 @@ static int check_csums(void)
6050
6050
return ret ;
6051
6051
}
6052
6052
6053
- static int is_dropped_key (struct btrfs_key * key ,
6053
+ static bool is_dropped_key (struct btrfs_key * key ,
6054
6054
struct btrfs_key * drop_key )
6055
6055
{
6056
6056
if (key -> objectid < drop_key -> objectid )
6057
- return 1 ;
6057
+ return true ;
6058
6058
else if (key -> objectid == drop_key -> objectid ) {
6059
6059
if (key -> type < drop_key -> type )
6060
- return 1 ;
6060
+ return true ;
6061
6061
else if (key -> type == drop_key -> type ) {
6062
6062
if (key -> offset < drop_key -> offset )
6063
- return 1 ;
6063
+ return true ;
6064
6064
}
6065
6065
}
6066
- return 0 ;
6066
+ return false ;
6067
6067
}
6068
6068
6069
6069
/*
0 commit comments