Re: [PATCH v4 20/30] qcow2: Add subcluster support to discard_in_l2_slice()

2020-04-23 Thread Alberto Garcia
On Wed 22 Apr 2020 08:09:53 PM CEST, Vladimir Sementsov-Ogievskiy wrote: >> There's currently an inconsistency now that I think of it: if an image >> has subclusters and QCOW_OFLAG_ZERO set then qcow2_get_cluster_type() >> returns QCOW2_CLUSTER_ZERO_* but qcow2_get_subcluster_type() returns >>

Re: [PATCH v4 20/30] qcow2: Add subcluster support to discard_in_l2_slice()

2020-04-22 Thread Vladimir Sementsov-Ogievskiy
22.04.2020 20:42, Alberto Garcia wrote: On Wed 22 Apr 2020 01:35:25 PM CEST, Vladimir Sementsov-Ogievskiy wrote: 17.03.2020 21:16, Alberto Garcia wrote: Two changes are needed in this function: 1) A full discard deallocates a cluster so we can skip the operation if it is already

Re: [PATCH v4 20/30] qcow2: Add subcluster support to discard_in_l2_slice()

2020-04-22 Thread Alberto Garcia
On Wed 22 Apr 2020 01:35:25 PM CEST, Vladimir Sementsov-Ogievskiy wrote: > 17.03.2020 21:16, Alberto Garcia wrote: >> Two changes are needed in this function: >> >> 1) A full discard deallocates a cluster so we can skip the operation if >> it is already unallocated. With extended L2 entries

Re: [PATCH v4 20/30] qcow2: Add subcluster support to discard_in_l2_slice()

2020-04-22 Thread Vladimir Sementsov-Ogievskiy
17.03.2020 21:16, Alberto Garcia wrote: Two changes are needed in this function: 1) A full discard deallocates a cluster so we can skip the operation if it is already unallocated. With extended L2 entries however if any of the subclusters has the 'all zeroes' bit set then we have to

Re: [PATCH v4 20/30] qcow2: Add subcluster support to discard_in_l2_slice()

2020-04-14 Thread Max Reitz
On 10.04.20 14:47, Alberto Garcia wrote: > On Thu 09 Apr 2020 12:05:12 PM CEST, Max Reitz wrote: >>> switch (qcow2_get_cluster_type(bs, old_l2_entry)) { >>> case QCOW2_CLUSTER_UNALLOCATED: >>> -if (full_discard || !bs->backing) { >>> +if (full_discard) {

Re: [PATCH v4 20/30] qcow2: Add subcluster support to discard_in_l2_slice()

2020-04-10 Thread Alberto Garcia
On Thu 09 Apr 2020 12:05:12 PM CEST, Max Reitz wrote: >> switch (qcow2_get_cluster_type(bs, old_l2_entry)) { >> case QCOW2_CLUSTER_UNALLOCATED: >> -if (full_discard || !bs->backing) { >> +if (full_discard) { >> +/* If the image has extended

Re: [PATCH v4 20/30] qcow2: Add subcluster support to discard_in_l2_slice()

2020-04-09 Thread Max Reitz
On 17.03.20 19:16, Alberto Garcia wrote: > Two changes are needed in this function: > > 1) A full discard deallocates a cluster so we can skip the operation if >it is already unallocated. With extended L2 entries however if any >of the subclusters has the 'all zeroes' bit set then we have

[PATCH v4 20/30] qcow2: Add subcluster support to discard_in_l2_slice()

2020-03-17 Thread Alberto Garcia
Two changes are needed in this function: 1) A full discard deallocates a cluster so we can skip the operation if it is already unallocated. With extended L2 entries however if any of the subclusters has the 'all zeroes' bit set then we have to clear it. 2) Setting the QCOW_OFLAG_ZERO