Compare commits
2 Commits
99adbb9483
...
f18a749324
Author | SHA1 | Date |
---|---|---|
Vitaliy Filippov | f18a749324 | |
Vitaliy Filippov | 6e9307c522 |
|
@ -337,7 +337,7 @@ std::vector<osd_chain_read_t> osd_t::collect_chained_read_requests(osd_op_t *cur
|
||||||
{
|
{
|
||||||
uint8_t *part_bitmap = ((uint8_t*)op_data->snapshot_bitmaps) + chain_pos*stripe_count*clean_entry_bitmap_size;
|
uint8_t *part_bitmap = ((uint8_t*)op_data->snapshot_bitmaps) + chain_pos*stripe_count*clean_entry_bitmap_size;
|
||||||
int start = !cur_op->req.rw.len ? 0 : (cur_op->req.rw.offset - op_data->oid.stripe)/bs_bitmap_granularity;
|
int start = !cur_op->req.rw.len ? 0 : (cur_op->req.rw.offset - op_data->oid.stripe)/bs_bitmap_granularity;
|
||||||
int end = !cur_op->req.rw.len ? op_data->pg_data_size*clean_entry_bitmap_size : start + cur_op->req.rw.len/bs_bitmap_granularity;
|
int end = !cur_op->req.rw.len ? op_data->pg_data_size*clean_entry_bitmap_size*8 : start + cur_op->req.rw.len/bs_bitmap_granularity;
|
||||||
// Skip unneeded part in the beginning
|
// Skip unneeded part in the beginning
|
||||||
while (start < end && (
|
while (start < end && (
|
||||||
((global_bitmap[start>>3] >> (start&7)) & 1) ||
|
((global_bitmap[start>>3] >> (start&7)) & 1) ||
|
||||||
|
|
|
@ -489,7 +489,7 @@ std::string format_datetime(uint64_t unixtime)
|
||||||
bool is_zero(void *buf, size_t size)
|
bool is_zero(void *buf, size_t size)
|
||||||
{
|
{
|
||||||
size_t i = 0;
|
size_t i = 0;
|
||||||
while (i <= size-8)
|
while (i+8 <= size)
|
||||||
{
|
{
|
||||||
if (*(uint64_t*)((uint8_t*)buf + i))
|
if (*(uint64_t*)((uint8_t*)buf + i))
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue