mirror of
https://github.com/vatesfr/xen-orchestra.git
synced 2026-09-10 22:14:48 -05:00
feat(disk-transform): port getBlockIndexesCount to the relevant classes (#10058)
This commit is contained in:
committed by
GitHub
parent
3ffd9b1f56
commit
0cfcb998a2
@@ -79,6 +79,11 @@ export class DiskLargerBlock extends RandomAccessDisk {
|
||||
return indexes
|
||||
}
|
||||
|
||||
getBlockIndexesCount(): number {
|
||||
let blockRatio = this.getBlockSize() / this.source.getBlockSize()
|
||||
return this.#source.getBlockIndexesCount() / blockRatio
|
||||
}
|
||||
|
||||
hasBlock(index: number): boolean {
|
||||
const source = this.source
|
||||
let maxBlockSource = Math.ceil(source.getVirtualSize() / source.getBlockSize())
|
||||
|
||||
@@ -42,6 +42,9 @@ export class DiskPassthrough extends Disk {
|
||||
getBlockIndexes(): Array<number> {
|
||||
return this.source.getBlockIndexes()
|
||||
}
|
||||
getBlockIndexesCount(): number {
|
||||
return this.source.getBlockIndexesCount()
|
||||
}
|
||||
hasBlock(index: number): boolean {
|
||||
return this.source.hasBlock(index)
|
||||
}
|
||||
@@ -102,6 +105,9 @@ export abstract class RandomDiskPassthrough extends RandomAccessDisk {
|
||||
getBlockIndexes(): Array<number> {
|
||||
return this.source.getBlockIndexes()
|
||||
}
|
||||
getBlockIndexesCount(): number {
|
||||
return this.source.getBlockIndexesCount()
|
||||
}
|
||||
hasBlock(index: number): boolean {
|
||||
return this.source.hasBlock(index)
|
||||
}
|
||||
|
||||
@@ -49,6 +49,9 @@ export class NegativeDisk extends RandomAccessDisk {
|
||||
getBlockIndexes(): Array<number> {
|
||||
return this.#child.getBlockIndexes()
|
||||
}
|
||||
getBlockIndexesCount(): number {
|
||||
return this.#child.getBlockIndexesCount()
|
||||
}
|
||||
hasBlock(index: number): boolean {
|
||||
return this.#child.hasBlock(index)
|
||||
}
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
|
||||
- @vates/types minor
|
||||
- @xen-orchestra/backup-archive patch
|
||||
- @xen-orchestra/disk-transform patch
|
||||
- @xen-orchestra/rest-api minor
|
||||
- @xen-orchestra/web minor
|
||||
- @xen-orchestra/web-core minor
|
||||
@@ -60,5 +61,4 @@
|
||||
- xen-api minor
|
||||
- xo-server minor
|
||||
|
||||
|
||||
<!--packages-end-->
|
||||
|
||||
Reference in New Issue
Block a user