if (ret)
break;
- bkey_on_stack_reassemble(&sk, c, k);
- k = bkey_i_to_s_c(sk.k);
-
offset_into_extent = iter->pos.offset -
bkey_start_offset(k.k);
sectors = k.k->size - offset_into_extent;
+ bkey_on_stack_reassemble(&sk, c, k);
+
ret = bch2_read_indirect_extent(trans,
&offset_into_extent, &sk);
if (ret)
break;
+ k = bkey_i_to_s_c(sk.k);
+
sectors = min(sectors, k.k->size - offset_into_extent);
bch2_trans_unlock(trans);
continue;
}
- bkey_on_stack_realloc(&cur, c, k.k->u64s);
- bkey_on_stack_realloc(&prev, c, k.k->u64s);
- bkey_reassemble(cur.k, k);
- k = bkey_i_to_s_c(cur.k);
-
offset_into_extent = iter->pos.offset -
bkey_start_offset(k.k);
sectors = k.k->size - offset_into_extent;
+ bkey_on_stack_realloc(&cur, c, k.k->u64s);
+ bkey_on_stack_realloc(&prev, c, k.k->u64s);
+ bkey_reassemble(cur.k, k);
+
ret = bch2_read_indirect_extent(&trans,
&offset_into_extent, &cur);
if (ret)
break;
+ k = bkey_i_to_s_c(cur.k);
+
sectors = min(sectors, k.k->size - offset_into_extent);
if (offset_into_extent)
unsigned bytes, sectors, offset_into_extent;
bkey_on_stack_reassemble(&sk, c, k);
- k = bkey_i_to_s_c(sk.k);
offset_into_extent = iter->pos.offset -
bkey_start_offset(k.k);
if (ret)
break;
+ k = bkey_i_to_s_c(sk.k);
+
sectors = min(sectors, k.k->size - offset_into_extent);
bch2_trans_unlock(&trans);
sectors = k.k->size - offset_into_extent;
bkey_on_stack_reassemble(&sk, c, k);
- k = bkey_i_to_s_c(sk.k);
ret = bch2_read_indirect_extent(&trans,
&offset_into_extent, &sk);
if (ret)
goto err;
+ k = bkey_i_to_s_c(sk.k);
+
/*
* With indirect extents, the amount of data to read is the min
* of the original extent and the indirect extent: