104104
105105static inline struct bset * write_block (struct btree * b )
106106{
107- return ((void * ) btree_bset_first (b )) + b -> written * block_bytes (b -> c );
107+ return ((void * ) btree_bset_first (b )) + b -> written * block_bytes (b -> c -> cache );
108108}
109109
110110static void bch_btree_init_next (struct btree * b )
@@ -173,7 +173,7 @@ void bch_btree_node_read_done(struct btree *b)
173173 goto err ;
174174
175175 err = "bad btree header" ;
176- if (b -> written + set_blocks (i , block_bytes (b -> c )) >
176+ if (b -> written + set_blocks (i , block_bytes (b -> c -> cache )) >
177177 btree_blocks (b ))
178178 goto err ;
179179
@@ -199,13 +199,13 @@ void bch_btree_node_read_done(struct btree *b)
199199
200200 bch_btree_iter_push (iter , i -> start , bset_bkey_last (i ));
201201
202- b -> written += set_blocks (i , block_bytes (b -> c ));
202+ b -> written += set_blocks (i , block_bytes (b -> c -> cache ));
203203 }
204204
205205 err = "corrupted btree" ;
206206 for (i = write_block (b );
207207 bset_sector_offset (& b -> keys , i ) < KEY_SIZE (& b -> key );
208- i = ((void * ) i ) + block_bytes (b -> c ))
208+ i = ((void * ) i ) + block_bytes (b -> c -> cache ))
209209 if (i -> seq == b -> keys .set [0 ].data -> seq )
210210 goto err ;
211211
@@ -347,7 +347,7 @@ static void do_btree_node_write(struct btree *b)
347347
348348 b -> bio -> bi_end_io = btree_node_write_endio ;
349349 b -> bio -> bi_private = cl ;
350- b -> bio -> bi_iter .bi_size = roundup (set_bytes (i ), block_bytes (b -> c ));
350+ b -> bio -> bi_iter .bi_size = roundup (set_bytes (i ), block_bytes (b -> c -> cache ));
351351 b -> bio -> bi_opf = REQ_OP_WRITE | REQ_META | REQ_FUA ;
352352 bch_bio_map (b -> bio , i );
353353
@@ -423,10 +423,10 @@ void __bch_btree_node_write(struct btree *b, struct closure *parent)
423423
424424 do_btree_node_write (b );
425425
426- atomic_long_add (set_blocks (i , block_bytes (b -> c )) * b -> c -> sb .block_size ,
426+ atomic_long_add (set_blocks (i , block_bytes (b -> c -> cache )) * b -> c -> sb .block_size ,
427427 & PTR_CACHE (b -> c , & b -> key , 0 )-> btree_sectors_written );
428428
429- b -> written += set_blocks (i , block_bytes (b -> c ));
429+ b -> written += set_blocks (i , block_bytes (b -> c -> cache ));
430430}
431431
432432void bch_btree_node_write (struct btree * b , struct closure * parent )
@@ -1344,7 +1344,7 @@ static int btree_gc_coalesce(struct btree *b, struct btree_op *op,
13441344
13451345 if (nodes < 2 ||
13461346 __set_blocks (b -> keys .set [0 ].data , keys ,
1347- block_bytes (b -> c )) > blocks * (nodes - 1 ))
1347+ block_bytes (b -> c -> cache )) > blocks * (nodes - 1 ))
13481348 return 0 ;
13491349
13501350 for (i = 0 ; i < nodes ; i ++ ) {
@@ -1378,7 +1378,7 @@ static int btree_gc_coalesce(struct btree *b, struct btree_op *op,
13781378 k = bkey_next (k )) {
13791379 if (__set_blocks (n1 , n1 -> keys + keys +
13801380 bkey_u64s (k ),
1381- block_bytes (b -> c )) > blocks )
1381+ block_bytes (b -> c -> cache )) > blocks )
13821382 break ;
13831383
13841384 last = k ;
@@ -1394,7 +1394,7 @@ static int btree_gc_coalesce(struct btree *b, struct btree_op *op,
13941394 * though)
13951395 */
13961396 if (__set_blocks (n1 , n1 -> keys + n2 -> keys ,
1397- block_bytes (b -> c )) >
1397+ block_bytes (b -> c -> cache )) >
13981398 btree_blocks (new_nodes [i ]))
13991399 goto out_unlock_nocoalesce ;
14001400
@@ -1403,7 +1403,7 @@ static int btree_gc_coalesce(struct btree *b, struct btree_op *op,
14031403 last = & r -> b -> key ;
14041404 }
14051405
1406- BUG_ON (__set_blocks (n1 , n1 -> keys + keys , block_bytes (b -> c )) >
1406+ BUG_ON (__set_blocks (n1 , n1 -> keys + keys , block_bytes (b -> c -> cache )) >
14071407 btree_blocks (new_nodes [i ]));
14081408
14091409 if (last )
@@ -2210,7 +2210,7 @@ static int btree_split(struct btree *b, struct btree_op *op,
22102210 goto err ;
22112211
22122212 split = set_blocks (btree_bset_first (n1 ),
2213- block_bytes (n1 -> c )) > (btree_blocks (b ) * 4 ) / 5 ;
2213+ block_bytes (n1 -> c -> cache )) > (btree_blocks (b ) * 4 ) / 5 ;
22142214
22152215 if (split ) {
22162216 unsigned int keys = 0 ;
0 commit comments