1. 08 6月, 2016 6 次提交
    • E
      block: Track write zero limits in bytes · cf081fca
      Eric Blake 提交于
      Another step towards removing sector-based interfaces: convert
      the maximum write and minimum alignment values from sectors to
      bytes.  Rename the variables to let the compiler check that all
      users are converted to the new semantics.
      
      The maximum remains an int as long as BDRV_REQUEST_MAX_SECTORS
      is constrained by INT_MAX (this means that we can't even
      support a 2G write_zeroes, but just under it) - changing
      operation lengths to unsigned or to 64-bits is a much bigger
      audit, and debatable if we even want to do it (since at the
      core, a 32-bit platform will still have ssize_t as its
      underlying limit on write()).
      
      Meanwhile, alignment is changed to 'uint32_t', since it makes no
      sense to have an alignment larger than the maximum write, and
      less painful to use an unsigned type with well-defined behavior
      in bit operations than to have to worry about what happens if
      a driver mistakenly supplies a negative alignment.
      
      Add an assert that no one was trying to use sectors to get a
      write zeroes larger than 2G, and therefore that a later conversion
      to bytes won't be impacted by keeping the limit at 32 bits.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      cf081fca
    • E
      iscsi: Use block size as minimum zero/discard alignment · 8b184744
      Eric Blake 提交于
      If hardware does not advertise a minimum zero/discard
      alignment, we still want to guarantee that the block layer
      will align requests to our blocks, rather than the arbitrary
      512-byte BDRV sector size.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      8b184744
    • E
      qcow2: Catch more unaligned write_zero into zero cluster · ebb718a5
      Eric Blake 提交于
      is_zero_cluster() and is_zero_cluster_top_locked() are used only
      by qcow2_co_write_zeroes().  The former is too broad (we don't
      care if the sectors we are about to overwrite are non-zero, only
      that all other sectors in the cluster are zero), so it needs to
      be called up to twice but with smaller limits - rename it along
      with adding the neeeded parameter.  The latter can be inlined for
      more compact code.
      
      The testsuite change shows that we now have a sparser top file
      when an unaligned write_zeroes overwrites the only portion of
      the backing file with data.
      
      Based on a patch proposal by Denis V. Lunev.
      
      CC: Denis V. Lunev <den@openvz.org>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NDenis V. Lunev <den@openvz.org>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      ebb718a5
    • D
      qcow2: add tracepoints for qcow2_co_write_zeroes · 5a64e942
      Denis V. Lunev 提交于
      This patch follows guidelines of all other tracepoints in qcow2, like ones
      in qcow2_co_writev. I think that they should dump values in the same
      quantities or be changed all together.
      Signed-off-by: NDenis V. Lunev <den@openvz.org>
      CC: Eric Blake <eblake@redhat.com>
      CC: Kevin Wolf <kwolf@redhat.com>
      Message-Id: <1463476543-3087-4-git-send-email-den@openvz.org>
      [eblake: typo fix in commit message]
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      5a64e942
    • D
      qcow2: simplify logic in qcow2_co_write_zeroes · ba142846
      Denis V. Lunev 提交于
      Unaligned requests will occupy only one cluster. This is true since the
      previous commit. Simplify the code taking this consideration into
      account.
      
      In other words, the caller is now buggy if it ever passes us an unaligned
      request that crosses cluster boundaries (the only requests that can cross
      boundaries will be aligned).
      
      There are no other changes so far.
      Signed-off-by: NDenis V. Lunev <den@openvz.org>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      CC: Eric Blake <eblake@redhat.com>
      CC: Kevin Wolf <kwolf@redhat.com>
      Message-Id: <1463476543-3087-3-git-send-email-den@openvz.org>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      ba142846
    • D
      block: split write_zeroes always · 443668ca
      Denis V. Lunev 提交于
      We should split requests even if they are less than write_zeroes_alignment.
      For example we can have the following request:
        offset 62k
        size   4k
        write_zeroes_alignment 64k
      The original code sent 1 request covering 2 qcow2 clusters, and resulted
      in both clusters being allocated. But by splitting the request, we can
      cater to the case where one of the two clusters can be zeroed as a
      whole, for only 1 cluster allocated after the operation.
      Signed-off-by: NDenis V. Lunev <den@openvz.org>
      CC: Eric Blake <eblake@redhat.com>
      CC: Kevin Wolf <kwolf@redhat.com>
      Message-Id: <1463476543-3087-2-git-send-email-den@openvz.org>
      
      [eblake: Avoid exceeding nb_sectors, hoist alignment checks out of
      loop, and update testsuite to show that patch works]
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NFam Zheng <famz@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      443668ca
  2. 07 6月, 2016 9 次提交
  3. 29 5月, 2016 1 次提交
  4. 26 5月, 2016 18 次提交
  5. 23 5月, 2016 1 次提交
  6. 19 5月, 2016 5 次提交