qcow.c (32cc71def9e3885f9527af713e6d8dc7521ddc08) qcow.c (353a5d84b25c335b259f37c4f43dad96e6d60ba8)
1/*
2 * Block driver for the QCOW format
3 *
4 * Copyright (c) 2004-2006 Fabrice Bellard
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights

--- 583 unchanged lines hidden (view full) ---

592 uint64_t coffset;
593
594 coffset = cluster_offset & s->cluster_offset_mask;
595 if (s->cluster_cache_offset != coffset) {
596 csize = cluster_offset >> (63 - s->cluster_bits);
597 csize &= (s->cluster_size - 1);
598 BLKDBG_EVENT(bs->file, BLKDBG_READ_COMPRESSED);
599 ret = bdrv_pread(bs->file, coffset, csize, s->cluster_data, 0);
1/*
2 * Block driver for the QCOW format
3 *
4 * Copyright (c) 2004-2006 Fabrice Bellard
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights

--- 583 unchanged lines hidden (view full) ---

592 uint64_t coffset;
593
594 coffset = cluster_offset & s->cluster_offset_mask;
595 if (s->cluster_cache_offset != coffset) {
596 csize = cluster_offset >> (63 - s->cluster_bits);
597 csize &= (s->cluster_size - 1);
598 BLKDBG_EVENT(bs->file, BLKDBG_READ_COMPRESSED);
599 ret = bdrv_pread(bs->file, coffset, csize, s->cluster_data, 0);
600 if (ret != csize)
600 if (ret < 0)
601 return -1;
602 if (decompress_buffer(s->cluster_cache, s->cluster_size,
603 s->cluster_data, csize) < 0) {
604 return -1;
605 }
606 s->cluster_cache_offset = coffset;
607 }
608 return 0;

--- 604 unchanged lines hidden ---
601 return -1;
602 if (decompress_buffer(s->cluster_cache, s->cluster_size,
603 s->cluster_data, csize) < 0) {
604 return -1;
605 }
606 s->cluster_cache_offset = coffset;
607 }
608 return 0;

--- 604 unchanged lines hidden ---